From f554aaeceb9c31853d8d414f2b4a9d17ad2ff966 Mon Sep 17 00:00:00 2001 From: xubinxcode Date: Tue, 2 Nov 2021 23:52:24 +0800 Subject: [PATCH] init --- src/components/HelloWorld.vue | 136 ++++++++++++++++++++++++++++++++---------- src/components/hotel.vue | 51 +++++++++++----- src/components/hotelother.vue | 74 ++++++++++++++--------- 3 files changed, 186 insertions(+), 75 deletions(-) diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index 7eaecc0..924967f 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -88,7 +88,8 @@ - + @@ -116,30 +117,30 @@ saleCount: 1, editSingle: false, orderMain: { - commissioner: '订单专员', - channel_id: '订单渠道', - channel_order_no: '渠道订单编号', - user_name: '用户姓名', - user_phone: "111111111111", - order_memo: "备注", + commissioner: '', + channel_id: '', + channel_order_no: '', + user_name: '', + user_phone: "", + order_memo: "", }, orderMainCopy: {}, hotelListObj: { - hotel_id: '酒店名称', - room_id: '房型名称', - plan_id: '价格方案', + hotel_id: '', + room_id: '', + plan_id: '', check_in_date: '', check_out_date: '', - customer_name: '出游人姓名', - confirm_no: '123456', - trade_order_number: '123456', + customer_name: '', + confirm_no: '', + trade_order_number: '', confirm_status: '1', - room_memo: '床型说明', - purchase_user_id: '资源负责人', - plan_memo: '价格方案说明', - total_price: '总金额', - total_cost: '成本价', - profit: '利润', + room_memo: '', + purchase_user_id: '', + plan_memo: '', + total_price: '', + total_cost: '', + profit: '', editType: 'add', purchasePriceList: [{ run_date: '请选择日期', @@ -152,19 +153,19 @@ }, hotelList: [], hotelotherListObj: { - item_id: '附加项目类型', - item_name: '附加项目名称', - item_unit: '计价单位', + item_id: '', + item_name: '', + item_unit: '', check_in_date: '', - customer_name: '出游人姓名', - confirm_no: '123456', - trade_order_number: '123456', - purchase_user_id: '资源负责人', + customer_name: '', + confirm_no: '', + trade_order_number: '', + purchase_user_id: '', confirm_status: '1', - item_memo: '附加项目说明', - total_price: '总金额', - total_cost: '成本价', - profit: '利润', + item_memo: '', + total_price: '', + total_cost: '', + profit: '', editType: 'add', purchasePriceList: [{ run_date: '请选择日期', @@ -179,6 +180,8 @@ hotelListOpt: [], channelListOpt: [], userOpt: [], + roomPlan: [], + cf_itemOpt: [], } }, computed: { @@ -239,21 +242,89 @@ if (process.env.NODE_ENV !== 'production') { axios.defaults.baseURL = '/api' //关键代码 } + axios.get("/hotel.php/cf_item/getList").then((res) => { + console.log(res) + this.cf_itemOpt = res.data.list + // this.cf_itemOpt = [{ + // "id": 1, + // "name": "附加项目1", + // "item_unit": "件", + // "item_type": 1, + // "item_memo": "说说说", + // "item_type_name": "一日游" + // }, { + // "id": 2, + // "name": "附加项2222", + // "item_unit": "张", + // "item_type": 2, + // "item_memo": "说说说", + // "item_type_name": "交通接驳" + // }] + }).catch((err) => { + console.log(err) + }) axios.get("/hotel.php/auth/admin/getList").then((res) => { console.log(res) this.userOpt = res.data.list + // this.userOpt = [{"id": 1, "name": "Admin"}, {"id": 2, "name": "瞿殿斌"}, { + // "id": 3, + // "name": "宋晓明" + // }, {"id": 4, "name": "庄亮"}, {"id": 5, "name": "testlkx"}] }).catch((err) => { console.log(err) }) axios.get("/hotel.php/cf_hotel_info/getHotelList").then((res) => { console.log(res) this.hotelListOpt = res.data.list + // this.hotelListOpt = [{"id": 0, "name": "暂无"}, {"id": 1, "name": "111"}, {"id": 2, "name": "222"}] + }).catch((err) => { + console.log(err) + }) + + console.log(item) + axios.get("/hotel.php/cf_room_plan/getList").then((res) => { + console.log(res) + this.roomPlan = res.data.list + // this.roomPlan = [{"id": 1, "name": "111"}] }).catch((err) => { console.log(err) }) axios.get("/hotel.php/cf_channel_info/getList").then((res) => { console.log(res) this.channelListOpt = res.data.list + // this.channelListOpt = [{"id": 1, "name": "测试飞猪", "commission_rate": "10.00"}, { + // "id": 2, + // "name": "【昊瀚】飞猪日历房", + // "commission_rate": "8.00" + // }, {"id": 3, "name": "【昊瀚】飞猪套餐", "commission_rate": "3.50"}, { + // "id": 4, + // "name": "【水汪清】携程", + // "commission_rate": "0.00" + // }, {"id": 5, "name": "【昊瀚】美团大众", "commission_rate": "0.00"}, { + // "id": 6, + // "name": "【守则固】携程", + // "commission_rate": "0.00" + // }, {"id": 7, "name": "【守则固】同程艺龙", "commission_rate": "0.00"}, { + // "id": 8, + // "name": "【守则固】途牛", + // "commission_rate": "0.00" + // }, {"id": 9, "name": "【水汪清】去哪儿", "commission_rate": "0.00"}, { + // "id": 10, + // "name": "【昊瀚】小红书", + // "commission_rate": "0.00" + // }, {"id": 11, "name": "【冲抵】唯途", "commission_rate": "0.00"}, { + // "id": 12, + // "name": "【昊瀚】淘1站", + // "commission_rate": "0.00" + // }, {"id": 13, "name": "【昊瀚】线下", "commission_rate": "0.00"}, { + // "id": 14, + // "name": "【水汪清】浪客行", + // "commission_rate": "0.00" + // }, {"id": 15, "name": "【毛木宁】日历房", "commission_rate": "8.00"}, { + // "id": 16, + // "name": "【毛木宁】套餐", + // "commission_rate": "3.50" + // }] }).catch((err) => { console.log(err) }) @@ -280,3 +351,8 @@ } } + diff --git a/src/components/hotel.vue b/src/components/hotel.vue index 93b8b19..6410467 100644 --- a/src/components/hotel.vue +++ b/src/components/hotel.vue @@ -12,9 +12,9 @@
- 修改 - 保存 - 取消 + 修改 + 保存 + 取消
@@ -27,7 +27,7 @@ @@ -36,10 +36,10 @@ - + @@ -48,7 +48,14 @@ - + + + + @@ -201,7 +208,14 @@ - + + + + @@ -332,10 +346,10 @@ export default { name: "hotel", - props: {userOpt: Array,type: String, saleCount: Number, dataObj: Object, hotelListOpt: Array}, + props: {roomPlan: Array, userOpt: Array, type: String, saleCount: Number, dataObj: Object, hotelListOpt: Array}, data() { return { - dataObjCopy: this.$lo.cloneDeep(this.dataObj), + dataObjTemp: this.$lo.cloneDeep(this.dataObj), confirm_status: '未发单', roomListOpt: [], date: [], @@ -344,13 +358,13 @@ }, computed: { disable() { - return this.dataObj.editType != 'add' + return this.dataObjTemp.editType != 'add' } }, watch: { dataObj(val) { console.log('change') - this.dataObjCopy = this.$lo.cloneDeep(this.dataObj) + this.dataObjTemp = this.$lo.cloneDeep(this.dataObj) }, confirm_status(val) { let type = ''; @@ -507,16 +521,17 @@ console.log(item) axios.get("/hotel.php/cf_room_info/getRoomList?hotelId=" + item).then((res) => { console.log(res) - this.roomListOpt = res.data.list + // this.roomListOpt = res.data.list + this.roomListOpt = [{"id": 1, "name": "111"}] }).catch((err) => { console.log(err) }) }, edit() { - this.$set(this.dataObj, 'editType', 'edit'); + this.dataObjTemp.editType = 'edit'; }, save() { - this.$set(this.dataObj, 'editType', 'view'); + this.dataObjTemp.editType = 'view'; axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => { console.log(res) if (res.flag) { @@ -530,7 +545,7 @@ }, cancel() { this.$set(this.dataObj, 'editType', 'view'); - this.$set(this, 'dataObj', this.orderMainCopy); + this.$set(this, 'dataObj', this.dataObj); } }, mounted() { @@ -549,4 +564,8 @@ .card /deep/ .el-collapse-item__header { height: auto; } + + .left { + text-align: left; + } diff --git a/src/components/hotelother.vue b/src/components/hotelother.vue index 52c919b..45d7838 100644 --- a/src/components/hotelother.vue +++ b/src/components/hotelother.vue @@ -12,9 +12,9 @@
- 修改 - 保存 - 取消 + 修改 + 保存 + 取消
@@ -23,11 +23,12 @@ - + @@ -35,12 +36,16 @@ - +
+ {{dataObjTemp.item_name}} +
- +
+ {{dataObjTemp.item_unit}} +
@@ -125,7 +130,7 @@ @@ -146,7 +151,7 @@ - {{dataObj.item_memo}} + {{dataObjTemp.item_memo}} @@ -161,8 +166,8 @@ @@ -170,12 +175,18 @@ - +
+ {{dataObjTemp.item_name}} +
+
- +
+ {{dataObjTemp.item_unit}} +
+
@@ -261,7 +272,7 @@ @@ -282,7 +293,7 @@ - {{dataObj.item_memo}} +
{{dataObjTemp.item_memo}}
@@ -296,13 +307,12 @@ export default { name: "hotelother", - props: {userOpt: Array, type: String, saleCount: Number, dataObj: Object}, + props: {cf_itemOpt: Array, userOpt: Array, type: String, saleCount: Number, dataObj: Object}, data() { return { - dataObjCopy: this.$lo.cloneDeep(this.dataObj), + dataObjTemp: this.$lo.cloneDeep(this.dataObj), confirm_status: '未发单', check_in_date: '', - cf_itemOpt: [], day: [] } }, @@ -314,7 +324,7 @@ watch: { dataObj(val) { console.log('change') - this.dataObjCopy = this.$lo.cloneDeep(this.dataObj) + this.dataObjTemp = this.$lo.cloneDeep(this.dataObj) }, confirm_status(val) { let type = ''; @@ -352,6 +362,13 @@ } }, methods: { + changeItem(id) { + let data = this.cf_itemOpt.find((item) => { + return item.id == id + }) + data.item_name = data.name + this.dataObjTemp = Object.assign(this.dataObjTemp, data); + }, changeNum(value) { if (this.type == 'add') { this.dataObj.purchasePriceList.forEach((item) => { @@ -456,10 +473,10 @@ return sums; }, edit() { - this.$set(this.dataObj, 'editType', 'edit'); + this.dataObjTemp.editType = 'edit'; }, save() { - this.$set(this.dataObj, 'editType', 'view'); + this.dataObjTemp.editType = 'view'; axios.post("/hotel.php/order_main/subOrderSave", this.dataObj).then((res) => { console.log(res) if (res.flag) { @@ -473,19 +490,14 @@ }, cancel() { this.$set(this.dataObj, 'editType', 'view'); - this.$set(this, 'dataObj', this.orderMainCopy); + this.$set(this, 'dataObj', this.dataObj); } }, mounted() { if (process.env.NODE_ENV !== 'production') { axios.defaults.baseURL = '/api' //关键代码 } - axios.get("/hotel.php/cf_item/getList").then((res) => { - console.log(res) - this.cf_itemOpt = res.data.list - }).catch((err) => { - console.log(err) - }) + } } @@ -497,4 +509,8 @@ .card /deep/ .el-collapse-item__header { height: auto; } + + .left { + text-align: left; + }