update from old git
This commit is contained in:
99
web/admin/region/bed/bedstatus/index.aspx
Normal file
99
web/admin/region/bed/bedstatus/index.aspx
Normal file
@@ -0,0 +1,99 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Templates/TBS5ADM001/MasterPage.master" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="admin_region_bed_bedstatus_index" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="page_header" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="page_nav" Runat="Server">
|
||||
<a href="create.aspx" class="btn btn-primary">
|
||||
<i class="mdi mdi-plus"></i>新增床位狀態
|
||||
</a>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<div class="container">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">床位和掛單狀態列表</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="items"
|
||||
:loading="loading"
|
||||
>
|
||||
<template #item.actions="{item}">
|
||||
<a :href="'create.aspx?statusid='+item.uuid" class="btn btn-primary"><i class="mdi mdi-pencil"></i>修改</a>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-danger"
|
||||
@click="confirmDeleteStatus(item)"
|
||||
>
|
||||
<i class="mdi mdi-delete"></i> 刪除
|
||||
</button>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<message-modal ref="messageModal"></message-modal>
|
||||
<confirm-modal ref="confirmModal"></confirm-modal>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="footer_script" Runat="Server">
|
||||
<script>
|
||||
new Vue({
|
||||
'el': '#app',
|
||||
vuetify: new Vuetify(vuetify_options),
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{ text: 'Id', value: 'id' },
|
||||
{ text: '狀態名稱', value: 'name' },
|
||||
{ text: '狀態代碼', value: 'code' },
|
||||
{ text: '描述', value: 'description' },
|
||||
{ text: '状态分类', value: 'categoryName'},
|
||||
{ text: '', value: 'actions' }
|
||||
],
|
||||
items: [],
|
||||
loading: true, // 初始時顯示動畫
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatusList() {
|
||||
axios.get('/api/region/bed/status/list')
|
||||
.then((res) => {
|
||||
this.items = res.data
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
confirmDeleteStatus(item) {
|
||||
this.$refs.confirmModal.open({
|
||||
message: '是否確認刪除給床位狀態',
|
||||
onConfirm: () => {
|
||||
this.deleteStatus(item);
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteStatus(item) {
|
||||
axios.post('/api/region/bed/status/delete', null, {
|
||||
params: { id: item.uuid }
|
||||
})
|
||||
.then(() => {
|
||||
this.items = this.items.filter(i => i.uuid != item.uuid);
|
||||
this.$refs.messageModal.open({
|
||||
title: '操作成功',
|
||||
message: '刪除成功!',
|
||||
status: 'success'
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.getStatusList();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
Reference in New Issue
Block a user