@@ -26,10 +26,10 @@
:item-class="item => item.is_timeout ? 'row-timeout' : ''"
hide-default-footer>
-
+
+ :style="item.guadan_status?.code == 502 ? 'pointer-events: none; opacity: 0.5; cursor: not-allowed;' : ''" @click.prevent="changeViews('edit',item)">編輯
+
+
+
+
\ No newline at end of file
diff --git a/web/admin/region/index.aspx b/web/admin/region/index.aspx
index b4c85d0..9689a90 100644
--- a/web/admin/region/index.aspx
+++ b/web/admin/region/index.aspx
@@ -213,6 +213,13 @@
:headers="room_bed.bed_headers"
:items ="room_bed.bed_items"
>
+
+
+
+ {{ getConditionNames(item.limits) }}
+
+ 無
+
{{item.isactive ? '啟用' : '停用'}}
@@ -257,7 +264,20 @@
-
+
+
+
+
+
+
+
+
@@ -547,9 +567,15 @@
{ text: '床位編號', value: 'uuid' },
{ text: '床位名稱', value: 'name' },
{ text: '床位狀態', value: 'statuscode' },
+ { text: '設定條件', value: 'limits' }, // 可選:在表格中顯示條件
{ text: '是否啟用', value: 'isactive' },
{ text: '', value: 'action' },
],
+ // 1. 新增條件來源選單 (可經由 API 載入,這裡預設填入您提供的 JSON)
+ bed_conditions: [
+ { "paramNo": "01", "paramName": "需要輪椅", "remark": "" },
+ { "paramNo": "02", "paramName": "需要拐杖", "remark": "" }
+ ],
newBedForm: {
uuid: null,
RegionUuid: null,
@@ -557,13 +583,37 @@
statuscode: null,
IsActive: true,
Gender: null,
+ Limits:[]
},
showBedModal: false,
bed_status: [], //床位狀態列表
+ //bed_conditions:[]
}
};
},
methods: {
+ loadBedConditions() {
+ this.room_bed.bed_conditions = 0; // 清空陣列
+ let self = this;
+ let data = [];
+ axios.post(HTTP_HOST + 'api/guadan/getGuadanLimit').then((res) => {
+
+ if (res.status == 200) {
+ res.data.forEach(item => {
+ console.log('掛單條件', item);
+ })
+ this.room_bed.bed_conditions = res.data;
+ }
+ })
+ },
+ getConditionNames(conditionIds) {
+ let condition = conditionIds.split(",");
+ if (!condition || !Array.isArray(condition)) return '';
+ return this.room_bed.bed_conditions
+ .filter(c => condition.includes(c.paramNo))
+ .map(c => c.paramName)
+ .join('、');
+ },
closeBedInUsedModal() {
this.bed_is_used_modal = false;
this.bed_is_used_modal_message = null;
@@ -759,6 +809,7 @@
statuscode: "101",
IsActive: true,
Gender: this.currentSelectRoom.gender, // 不設預設值,強制選擇
+ Limits: [] // 重置為空陣列
};
this.room_bed.showBedModal = true;
},
@@ -834,13 +885,24 @@
statuscode: bed.statuscode,
IsActive: bed.isactive,
Gender: bed.gender,
+ // 確保將後端回傳的條件清單帶入(如果是字串或陣列,建議統一轉為陣列)
+ Limits: bed.limits ? [...bed.limits] : []
};
this.room_bed.showBedModal = true;
},
async saveEditBed() {
try {
- await axios.post(HTTP_HOST + 'api/region/bed/update', this.room_bed.newBedForm);
+ let data= {
+ uuid: this.room_bed.newBedForm.uuid,
+ RoomUuid: this.room_bed.newBedForm.RoomUuid,
+ Name: this.room_bed.newBedForm.Name,
+ statuscode: this.room_bed.newBedForm.statuscode,
+ IsActive: this.room_bed.newBedForm.IsActive,
+ Gender: this.room_bed.newBedForm.Gender,
+ Limits: this.room_bed.newBedForm.Limits.join(',') // 假設後端接受逗號分隔的字串
+ };
+ await axios.post(HTTP_HOST + 'api/region/bed/update', data);
this.room_bed.showBedModal = false;
const updated = this.room_bed.newBedForm;
@@ -852,7 +914,8 @@
roomUuid: updated.RoomUuid,
name: updated.Name,
statuscode: updated.statuscode,
- isactive: updated.IsActive
+ isactive: updated.IsActive,
+ limits: updated.Limits
});
}
@@ -1015,6 +1078,7 @@
}
},
mounted() {
+ this.loadBedConditions();
this.loadRegions();
this.loadRegionType();
this.getBedStatus();