From 9f3dd1c1782f4dcb914dfc68a20b108f9d7f6e3f Mon Sep 17 00:00:00 2001 From: xubinxcode Date: Sun, 14 Nov 2021 15:27:56 +0800 Subject: [PATCH] init --- src/components/HelloWorld.vue | 583 +++++++++++++++++++++--------------------- src/components/hotel.vue | 79 +++--- src/components/hotelother.vue | 64 ++--- 3 files changed, 351 insertions(+), 375 deletions(-) diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index 3f38407..c9b2626 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -110,299 +110,304 @@ diff --git a/src/components/hotel.vue b/src/components/hotel.vue index 5cd978c..b374414 100644 --- a/src/components/hotel.vue +++ b/src/components/hotel.vue @@ -1,7 +1,7 @@ @@ -325,11 +326,11 @@ - - - - - + + 未发单 + 已发单 + 已确认 + 已取消 @@ -380,7 +381,7 @@ data() { return { dataObjTemp: this.$lo.cloneDeep(this.dataObj), - confirm_status: '未发单', + opened: '1', roomListOpt: [], date: [], roomPlan: [], @@ -389,7 +390,7 @@ }, computed: { disable() { - return this.dataObjTemp.editType != 'add' + return this.dataObjTemp.editType == 'view' } }, watch: { @@ -397,24 +398,6 @@ console.log('change') this.dataObjTemp = this.$lo.cloneDeep(this.dataObj) }, - confirm_status(val) { - let type = ''; - switch (val) { - case "未发单": - type = '1' - break; - case "已发单": - type = '2' - break; - case "已确认": - type = '3' - break; - case "已取消": - type = '4' - break; - } - this.$set(this.dataObj, "confirm_status", type) - }, date(val) { console.log(val) this.$set(this.dataObj, "check_in_date", val[0]) @@ -429,7 +412,7 @@ price: '', cost: '', count: '', - note: '', + customer_comments: '', supplier_id: '' }) } @@ -451,7 +434,8 @@ this.dataObj.purchasePriceList.forEach((item) => { this.$set(item, 'supplier_id', value) }) - this.$set(this.dataObj, 'supplier_id', value) + // this.$set(this.dataObj, 'supplier_id', value) + this.dataObj.supplier_id = value; } }, changeNote(value) { @@ -459,7 +443,8 @@ this.dataObj.purchasePriceList.forEach((item) => { this.$set(item, 'customer_comments', value) }) - this.$set(this.dataObj, 'customer_comments', value) + this.dataObj.customer_comments = value; + // this.$set(this.dataObj, 'customer_comments', value) } }, arraySpanMethod({row, column, rowIndex, columnIndex}) { @@ -591,21 +576,23 @@ }, edit() { this.dataObjTemp.editType = 'edit'; + // this.$set(this.dataObj, 'editType', 'edit'); }, save() { - this.dataObjTemp.editType = 'view'; axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => { - console.log(res) - if (res.flag) { - this.$alert('提示', res.msg, { - confirmButtonText: '确定', - }); + console.log(res.data) + if (res.data.flag) { + this.dataObjTemp.editType = 'view'; } + this.$alert(res.data.msg, '提示', { + confirmButtonText: '确定', + }); }).catch((err) => { console.log(err) }) }, cancel() { + this.dataObjTemp.editType = 'view'; this.$set(this.dataObj, 'editType', 'view'); this.$set(this, 'dataObj', this.dataObj); } diff --git a/src/components/hotelother.vue b/src/components/hotelother.vue index 457c341..882337e 100644 --- a/src/components/hotelother.vue +++ b/src/components/hotelother.vue @@ -1,7 +1,7 @@