Pārlūkot izejas kodu

修改房态bug 以及完善部分冲账

覃浩 2 gadi atpakaļ
vecāks
revīzija
26230dc17d

+ 101 - 36
src/views/room/fangtailive.vue

@@ -1105,6 +1105,33 @@ export default {
           value: '6'
         },
       ],
+      // 老房间信息筛选暂时
+      oldRoomInformationScreening:[
+        {
+          label: '欠费',
+          value: '1'
+        },
+        {
+          label: '无押金',
+          value: '2'
+        },
+        {
+          label: '续住',
+          value: '3'
+        },
+        {
+          label: '换房',
+          value: '4'
+        },
+        {
+          label: '租借',
+          value: '5'
+        },
+        {
+          label: '不足',
+          value: '6'
+        },
+      ],
       // 对客服务筛选
       customerServiceScreening:[
         {
@@ -1128,6 +1155,29 @@ export default {
           value: '5'
         },
       ],
+      // 老对客服务筛选
+      oldCustomerServiceScreening:[
+        {
+          label: '生日',
+          value: '1'
+        },
+        {
+          label: '叫醒',
+          value: '2'
+        },
+        {
+          label: '免打扰',
+          value: '3'
+        },
+        {
+          label: '免查询',
+          value: '4'
+        },
+        {
+          label: '保密房',
+          value: '5'
+        },
+      ],
       startDate: '',
       endDate: '',
       customerSourceList: [],
@@ -1154,7 +1204,9 @@ export default {
       // 老房态数据
       oldRoomStatusList: [],
       // 老来源数据
-      oldCustomerSourceList: []
+      oldCustomerSourceList: [],
+      // 老房型
+      oldCesRoomLayoutList: []
     }
   },
   watch: {
@@ -1236,25 +1288,28 @@ export default {
       )
     }
   },
-  created() {
+  async created() {
     // 禁用右键
     // document.oncontextmenu = new Function("event.returnValue=false");
     var _info = JSON.parse(localStorage.getItem('storeInfo'))
     // if (_info) {
     //   this.model.hotelId = _info.id;
     // }
-    getAction('/business/busDictItem/list', {
+    await getAction('/business/busDictItem/list', {
       hotelId: _info.id,
       dictId: '1639538915239743490'
     }).then((res) => {
-      // console.log(res);
+      console.log(res);
       if (res.success) {
-        var list = []
+        let list = []
         res.result.records.forEach((item) => {
           list.push({ label: item.itemText, value: item.id })
         })
-        this.customerSourceList = list
-        this.oldCustomerSourceList = list
+        console.log(list);
+        this.customerSourceList = this.customerSourceList.concat(list)
+        this.oldCustomerSourceList = this.oldCustomerSourceList.concat(list)
+        // this.customerSourceList = list
+        // this.oldCustomerSourceList = list
         console.log(this.customerSourceList);
         console.log(this.oldCustomerSourceList);
       }
@@ -1269,7 +1324,8 @@ export default {
         res.result.records.forEach((item) => {
           list.push({ label: item.name, value: item.id })
         })
-        this.cesRoomLayoutList = list
+        this.cesRoomLayoutList = this.cesRoomLayoutList.concat(list)
+        this.oldCesRoomLayoutList = this.oldCesRoomLayoutList.concat(list)
       }
     })
     getAction('/rooms/cesRoomBuildingFloor/tree', {}).then((res) => {
@@ -1308,6 +1364,27 @@ export default {
     // this.$refs.ModalEditScheduleRoom.disableSubmit = false;
   },
   methods: {
+    // 处理房型数字
+    treatmentRoomType() {
+      // 处理房型
+      this.roomList.forEach(item => {
+        item.rooms.forEach(cust => {
+          this.roomTypeData(cust.layout.id)
+        })
+      })
+      this.cesRoomLayoutList.forEach(item => {
+        // if(this.isNumber) {
+        //   return
+        // }
+        if ('figure' in item) {
+          let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
+          this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
+        } else {
+          let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
+          this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + 0,value: item.value})
+        }
+      })
+    }, 
     // 处理筛选条件数据-房型
     roomTypeData(val) {
       this.cesRoomLayoutList.forEach(item => {
@@ -2347,6 +2424,7 @@ export default {
         this.$refs.batchCardModalCopy.edit([obj])
       }
     },
+    // 修改房态
     changeState(livingOrder, state) {
       console.log(livingOrder)
       let secrecy = (state === 1 ? !livingOrder.secrecy : livingOrder.secrecy)
@@ -2370,6 +2448,7 @@ export default {
           this.$message.error(resp.message)
         }
       })
+      this.loadData()
     },
     // 处理房态数字
     houseStateNumbers() {
@@ -2527,30 +2606,12 @@ export default {
           // 处理房态
           this.houseStateNumbers()
           // 处理来源
-          console.log(this.customerSourceList);
-          console.log(this.oldCustomerSourceList);
-          this.customerSourceList = this.oldCustomerSourceList
-          
+          this.customerSourceList = Object.assign([], this.oldCustomerSourceList); 
           this.handleSourceFigure()
-          
           // 处理房型
-          this.roomList.forEach(item => {
-            item.rooms.forEach(cust => {
-              this.roomTypeData(cust.layout.id)
-            })
-          })
-          this.cesRoomLayoutList.forEach(item => {
-            if(this.isNumber) {
-              return
-            }
-            if ('figure' in item) {
-              let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
-              this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
-            } else {
-              let tempindex = this.cesRoomLayoutList.findIndex(index => index == item)
-              this.cesRoomLayoutList.splice(tempindex,1,{label: item.label + 0,value: item.value})
-            }
-          })
+          this.cesRoomLayoutList = Object.assign([], this.oldCesRoomLayoutList);
+          this.treatmentRoomType()
+          
         }
       })
       await getAction("/fw/fwLivingJx/getJxRooms", {}).then((res) => {
@@ -2562,6 +2623,7 @@ export default {
               this.rouseRoomList = res.result;
           }
           var temproomlist = this.oldRoomList
+          this.customerServiceScreening = Object.assign([], this.oldCustomerServiceScreening);
           // 这里处理对客服务中的叫醒数据
           this.rouseRoomList.forEach(item => {
             temproomlist.forEach((cust,custindex) => {
@@ -2589,10 +2651,11 @@ export default {
               }
             })
           })
+          console.log(111);
           this.customerServiceScreening.forEach(item => {
-            if(this.isNumber) {
-              return
-            }
+            // if(this.isNumber) {
+            //   return
+            // }
             if ('figure' in item) {
               let tempindex = this.customerServiceScreening.findIndex(index => index == item)
               this.customerServiceScreening.splice(tempindex,1,{label: item.label + item.figure,value: item.value})
@@ -2601,6 +2664,7 @@ export default {
               this.customerServiceScreening.splice(tempindex,1,{label: item.label + 0,value: item.value})
             }
           })
+          console.log(this.customerServiceScreening);
       });
       await getAction("/order/cesOrderLeaseGoods/getLeaseRoom", {}).then((res) => {
           console.log(res);
@@ -2611,6 +2675,7 @@ export default {
               this.rouseinfoRoomList = res.result;
           }
           let templeaseroomlist = this.oldRoomList
+          this.roomInformationScreening = Object.assign([], this.oldRoomInformationScreening); 
           // 这里处理对房间信息中的租借
           this.rouseinfoRoomList.forEach(item => {
             templeaseroomlist.forEach((cust,custindex) => {
@@ -2640,9 +2705,9 @@ export default {
             })
           })
           this.roomInformationScreening.forEach(item => {
-            if(this.isNumber) {
-              return
-            }
+            // if(this.isNumber) {
+            //   return
+            // }
             if ('figure' in item) {
               let tempindex = this.roomInformationScreening.findIndex(index => index == item)
               this.roomInformationScreening.splice(tempindex,1,{label: item.label + item.figure,value: item.value})

+ 18 - 2
src/views/room/modules/checkIn/PayOrRefund.vue

@@ -280,6 +280,15 @@
                 <span v-else>{{ record.returnMoney }}</span> -->
               </template>
             </a-table>
+            <a-col :span="7" class="settle_style" v-if="model.money < 0">
+            <a-form-model-item
+              :label="&quot;实&quot; + (this.isRefund ? &quot;退&quot; : &quot;收&quot;) + &quot;合计&quot;"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+            >
+              {{ Math.abs(sumAmount.toFixed(2)) }}元
+            </a-form-model-item>
+          </a-col>
           </a-col>
           <a-col :span="24" style="text-align: end">
             <a-checkbox default-checked>打印结账单</a-checkbox>
@@ -477,11 +486,18 @@ export default {
       return this.disabled
     },
     sumAmount() {
-      // console.log(this.isRefund);
+      console.log(this.isRefund);
       if (this.isRefund) {
         var sum = this.feeList.reduce(function (total, item) {
-          return total + item.prerefund
+          console.log(item);
+          if ('prerefund' in item) {
+            return total + item.prerefund
+          } else {
+            return total + 0
+          }
+          
         }, 0)
+        console.log(sum);
         return sum
       } else {
         var sum = this.payList.reduce(function (total, item) {

+ 1 - 1
src/views/room/modules/checkIn/PayOrRefundModal.vue

@@ -28,7 +28,7 @@ export default {
   data() {
     return {
       title: "",
-      width: 1400,
+      width: 1300,
       visible: false,
       disableSubmit: false,
       showYinshou: true,

+ 13 - 7
src/views/room/modules/checkIn/StrikeBalanceModel.vue

@@ -45,8 +45,9 @@
         {{ record.money }}
       </template>
       <template slot="num" slot-scope="text, record">
-        <a-input-number v-model='record.num' :min="1" :max="record.feeGoodVo.num"></a-input-number>
-        <!-- {{ record.money }} -->
+        <!-- {{  }} -->
+        <a-input-number v-model="record.num" :min="1" :max="record.feeGoodVo.num"></a-input-number>
+        <!-- {{ record.feeGoodVo.num }} -->
       </template>
       
       <template slot="remark" slot-scope="text, record">
@@ -131,6 +132,7 @@ const columns = [
     // dataIndex: 'oldPrice',
     width: 60,
     align: 'center',
+    scopedSlots: { customRender: 'subjectType' },
     customRender: function (text, record) {
         return record.feeGoodVo.num
     }
@@ -141,9 +143,9 @@ const columns = [
     width: 60,
     align: 'center',
     scopedSlots: { customRender: 'num'},
-    customRender: function (text, record) {
-        return record.feeGoodVo.num
-    }
+    // customRender: function (text, record) {
+    //     return record.num = record.feeGoodVo.num
+    // }
   },
   {
     title: '冲账金额',
@@ -184,6 +186,8 @@ export default {
     edit(record, map) {
       this.visible = true
       console.log(record)
+      this.productList = []
+      this.feesList = []
       record.forEach(index => {
         if (index.feeGoodVo == null) {
           this.feesList.push(index)
@@ -191,8 +195,6 @@ export default {
           this.productList.push(index)
         ]
       })
-      console.log(this.feesList);
-      console.log(this.productList);
       // this.feesList = record
       this.feesList.forEach(e => {
         e.roomName = map.get(e.roomId)
@@ -201,7 +203,11 @@ export default {
       this.productList.forEach(e => {
         e.roomName = map.get(e.roomId)
         e.oldPrice = e.money
+        let tempnum = JSON.parse(JSON.stringify(e.feeGoodVo))
+        this.$set(e,'num',tempnum.num)
       })
+      console.log(this.feesList);
+      console.log(this.productList);
     },
     close() {
       this.$emit('close')

+ 74 - 7
src/views/settings/components/roomModules/modules/housePriceSchemeDetailList.vue

@@ -112,7 +112,7 @@
                     //     dataIndex: 'layoutPrice'
                     // },
                     {
-                        title:'挂牌价(元)1',
+                        title:'挂牌价(元)',
                         align:"center",
                         // dataIndex: 'layoutPrice',
                         customRender(text, record) {
@@ -120,7 +120,7 @@
                         }
                     },
                     {
-                        title:'前台价(散客)1',
+                        title:'前台价(散客)',
                         align:"center",
                         // dataIndex: 'layoutPrice',
                         customRender(text, record) {
@@ -128,7 +128,7 @@
                         }
                     },
                     {
-                        title:'微信小程序(散客)1',
+                        title:'微信小程序(散客)',
                         align:"center",
                         // dataIndex: 'layoutPrice',
                         customRender(text, record) {
@@ -205,8 +205,12 @@
                 tablemode: 'ordinaryDays',
                 // 会员参数
                 memberList: [],
+                // 协议参数
+                agreementList: [],
                 // 列表数据处理
                 handlelistData: [],
+                // 钟点房参数
+                hourlyRoomList: []
 
             }
         },
@@ -221,6 +225,11 @@
             await this.loadData()
             // console.log(this.dataSource);
             this.handlelistData = this.dataSource
+            // 获取协议
+            this.getAgreement()
+            // 获取钟点房
+            this.getHourlyRoom()
+            // 获取会员方案
             this.getMember()
             console.log(this.handlelistData);
             // console.log(this.memberList);
@@ -259,21 +268,79 @@
                     templist.children.push(tempchildren)
 
                 })
-                this.columns.splice(1,0,templist)
+                this.columns.splice(5,0,templist)
                 // this.memberList = templist
                 this.handlelistData.forEach(item => {
                     templist.children.forEach(index => {
                         item[index.dataIndex] = (item.layoutPrice * (index.discount * 0.01))
                     })
                 })
-                console.log(this.columns);
-                console.log(templist);
+                // console.log(this.columns);
+                // console.log(templist);
                 // console.log(this.superFieldList);
-                console.log(this.handlelistData);
+                // console.log(this.handlelistData);
                 
                 // console.log(this.dataSource);
             },
+            // 拿到协议方案
+            async getAgreement() {
+            await getAction('/business/busMarketAgreementUnit/getAgreementUnitsDetail').then(res => {
+                this.agreementList = res.result
+            })
+            let templist = {
+                    title: '协议',
+                    children: [
+                    ],
+                }
+                this.agreementList.forEach(item => {
+                    let tempchildren = {
+                        title: item.customerName,
+                        dataIndex: item.id,
+                        discount: item.marketAgreementCustomer.discount
+                    }
+                    templist.children.push(tempchildren)
 
+                })
+                this.columns.splice(5,0,templist)
+                // this.memberList = templist
+                this.handlelistData.forEach(item => {
+                    templist.children.forEach(index => {
+                        item[index.dataIndex] = (item.layoutPrice * (index.discount * 0.01))
+                    })
+                })
+            },
+            // 获取钟点房
+            async getHourlyRoom() {
+                await getAction('/rooms/cesHourRoomRule/list', {
+                    pageNo:1,
+                    pageSize:999
+                }).then(res => {
+                    console.log(res);
+                    this.hourlyRoomList = res.result.records
+                })
+                let templist = {
+                    title: '钟点房价(元/分钟)',
+                    children: [
+                    ],
+                }
+                this.hourlyRoomList.forEach(item => {
+                    let tempchildren = {
+                        title: item.hourRoomName,
+                        dataIndex: item.id,
+                        align: 'center',
+                        duration: item.afterOpenRoomPay + '元' + '/' + item.afterOpenRoom + '分钟'
+                    }
+                    templist.children.push(tempchildren)
+
+                })
+                this.columns.splice(5,0,templist)
+                // this.memberList = templist
+                this.handlelistData.forEach(item => {
+                    templist.children.forEach(index => {
+                        item[index.dataIndex] = index.duration
+                    })
+                })
+            },
             getSuperFieldList(){
                 let fieldList=[];
                 fieldList.push({type:'string',value:'tenantId',text:'关联租户'})

+ 12 - 2
src/views/settings/components/roomModules/modules/housePriceSchemeLayout/housePriceSchemeLayoutForm.vue

@@ -75,7 +75,7 @@
           queryList: "/business/busSchemeLayoutDailyPrice/queryList",
           editDailyPrice: "/business/busSchemeLayoutDailyPrice/editDailyPrice",
           batchUpdatePrice: "/business/busSchemeLayoutDailyPrice/batchUpdatePrice",
-
+          list: "/business/busHousePriceSchemeLayout/layoutPricePage",
           queryListByCond: "/business/busSchemeLayoutDailyPrice/queryListByCond",
         },
         curDate :moment(new Date()).format('YYYY-MM-DD'),
@@ -87,6 +87,7 @@
         updateMoney:0,
         updateDate:'',
         selectDate:'',
+
       }
     },
     computed: {
@@ -96,6 +97,8 @@
     },
     created () {
       this.selectDate = moment(new Date()).format('YYYY-MM-DD 00:00:00')
+      console.log(this.dataSource);
+
       //获取数据
       this.$nextTick(()=>{
         getAction(this.url.queryList, {
@@ -128,9 +131,16 @@
           }
         });
       })
-
+      this.getDateList()
     },
     methods: {
+      // 获取数据
+      getDateList() {
+        console.log(this.dataSource);
+        // getAction('/business/busHousePriceSchemeLayout/layoutPricePage').then(res => {
+        //   console.log(res);
+        // })
+      },
       edit (record) {
         this.model = Object.assign({}, record);
         this.visible = true;