Forráskód Böngészése

修改添加新酒店初始化时产生的问题

许智捷 1 éve
szülő
commit
4cdfc4ebf7

+ 3 - 3
src/views/room/calendarfangtai.vue

@@ -583,12 +583,12 @@ export default {
     getOrderSource() {
       return new Promise((rs, rj) => {
         var _info = JSON.parse(localStorage.getItem('storeInfo'))
-        getAction('/business/busDictItem/list', {
+        getAction('/business/busDictItem/queryList', {
           hotelId: _info.id,
-          dictId: '1639538915239743490'
+          dictName: '客人来源设置'
         }).then((res) => {
           if (res.success) {
-            this.customerSourceList = res.result.records
+            this.customerSourceList = res.result
           }
           rs(true)
         }).catch(() => {

+ 6 - 6
src/views/room/fangtailive.vue

@@ -1348,21 +1348,21 @@ export default {
     // if (_info) {
     //   this.model.hotelId = _info.id;
     // }
-    await getAction('/business/busDictItem/list', {
+    debugger
+    console.log( 'r--------------=============')
+
+    await getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639538915239743490'
+      dictName: '客人来源设置'
     }).then((res) => {
       console.log(res)
       if (res.success) {
         let list = []
-        res.result.records.forEach((item) => {
+        res.result.forEach((item) => {
           list.push({ label: item.itemText, value: item.id })
         })
-        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)
       }

+ 7 - 5
src/views/room/leasegoods.vue

@@ -312,6 +312,7 @@ export default {
     }
   },
   created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
     // getAction("/business/busRoomBookingOrders/living-orders?status=-1", {
     //   current: 1,
     //   size: 99999,
@@ -321,11 +322,12 @@ export default {
     //     console.log(this.roomsList)
     //   }
     // });
-    getAction('/business/busDictItem/list', {
-      dictId: '1659108818476990465'
+    getAction("/business/busDictItem/queryList", {
+      hotelId: _info.id,
+      dictName: '租借物品名称',
     }).then((res) => {
       if (res.success) {
-        this.busDictItemList = res.result.records
+        this.busDictItemList = res.result
       }
     })
   },
@@ -345,7 +347,7 @@ export default {
     },
     handleChange(value, key, column) {
       console.log('fff', value, key, column)
-      
+
       const newData = [...this.dataSource]
       const target = newData.find(item => key === item.id)
       if (target) {
@@ -520,7 +522,7 @@ export default {
       let find = this.roomsList.find(
         (t) => t.livingOrderId === id
       )
-      
+
       let roomId = find.roomId
       this.dataSource.push({
         id: 9999,

+ 21 - 21
src/views/room/modules/checkIn/BillRoomForm.vue

@@ -619,7 +619,7 @@
 <!--                          <a-select-option :value="2"> 付2 </a-select-option>-->
 <!--                          <a-select-option :value="3"> 付3 </a-select-option>-->
 <!--                        </a-select>-->
-                        <a-input v-model="rentCharges.num" @change="rentNumChange"></a-input>
+                        <a-input-number v-model="rentCharges.num" :min="1" @change="rentNumChange"></a-input-number>
                       </a-col>
                     </a-form-model-item>
                     <a-form-model-item
@@ -1704,20 +1704,20 @@ export default {
         })
         this.editPriceOk()
       }
-      if (val == 1 || val == 5) {
-        // debugger
-        // this.editPriceData.forEach(item => {
-        //   let arr = {}
-        //   arr = this.roomListCopy.filter(t => t.roomId == item.roomId)[0]
-        //   item.marketPrice = arr.marketPrice
-        //   item.prefPrice = item.marketPrice
-        //   item.roomFee = item.marketPrice
-        //   item.edit.forEach((ele) => {
-        //     debugger
-        //     ele.price = item.prefPrice
-        //   })
-        // })
-        // this.editPriceOk()
+      if (val == 1 ) {
+        debugger
+        this.editPriceData.forEach(item => {
+          let arr = {}
+          arr = this.roomListCopy.filter(t => t.roomId == item.roomId)[0]
+          item.marketPrice = arr.marketPrice
+          item.prefPrice = item.marketPrice
+          item.roomFee = item.marketPrice
+          item.edit.forEach((ele) => {
+            debugger
+            ele.price = item.prefPrice
+          })
+        })
+        this.editPriceOk()
       }
       if (val == 2) {
         console.log(this.hourRoomRuleList)
@@ -1913,23 +1913,23 @@ export default {
     }
     // 备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model))
-    getAction('/business/busDictItem/list', {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639538915239743490'
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records
+        this.customerSourceList = res.result
         if (this.customerSourceList && this.customerSourceList.length > 0) {
           this.model.orderInfo.customerSource = this.customerSourceList[0].id
         }
       }
     })
-    getAction('/business/busDictItem/list', {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639544187093995521'
+      dictName: '预定方式'
     }).then((res) => {
       if (res.success) {
-        this.bookingdicWayList = res.result.records
+        this.bookingdicWayList = res.result
       }
     })
 

+ 3 - 3
src/views/room/modules/checkIn/BillRoomInfo.vue

@@ -1223,12 +1223,12 @@ export default {
     }
     // 备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model))
-    getAction('/business/busDictItem/list', {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639538915239743490'
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records
+        this.customerSourceList = res.result
       }
     })
     getAction('/business/busSalesPerson/list', {

+ 4 - 4
src/views/room/modules/checkIn/EditCustomerSourceForm.vue

@@ -101,12 +101,12 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    getAction("/business/busDictItem/list", {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: "1639538915239743490",
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records;
+        this.customerSourceList = res.result;
       }
     });
   },
@@ -180,4 +180,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 5 - 4
src/views/room/modules/leasegoods/CesOrderLeaseGoodsForm.vue

@@ -161,11 +161,12 @@ export default {
     }
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
-    getAction("/business/busDictItem/list", {
-      dictId: "1659108818476990465",
+    getAction("/business/busDictItem/queryList", {
+      hotelId: _info.id,
+      dictName: '租借物品名称',
     }).then((res) => {
       if (res.success) {
-        this.busDictItemList = res.result.records;
+        this.busDictItemList = res.result;
       }
     });
 
@@ -226,4 +227,4 @@ export default {
     },
   },
 };
-</script>
+</script>

+ 6 - 6
src/views/room/modules/schedule/EditScheduleRoomForm.vue

@@ -779,20 +779,20 @@ export default {
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
 
-    getAction("/business/busDictItem/list", {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: "1639538915239743490",
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records;
+        this.customerSourceList = res.result;
       }
     });
-    getAction("/business/busDictItem/list", {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: "1639544187093995521",
+      dictName: '预定方式'
     }).then((res) => {
       if (res.success) {
-        this.bookingdicWayList = res.result.records;
+        this.bookingdicWayList = res.result;
       }
     });
     getAction("/business/busSalesPerson/list", {

+ 6 - 6
src/views/room/modules/schedule/ScheduleRoomForm.vue

@@ -564,12 +564,12 @@ export default {
     // 备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model))
 
-    getAction('/business/busDictItem/list', {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639538915239743490'
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records
+        this.customerSourceList = res.result
         this.model.orderInfo.customerSource = res.result.records[0].id
       }
     })
@@ -583,12 +583,12 @@ export default {
         this.oldVipList = JSON.parse(JSON.stringify(this.vipList))
       }
     })
-    getAction('/business/busDictItem/list', {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: '1639544187093995521'
+      dictName: '预定方式'
     }).then((res) => {
       if (res.success) {
-        this.bookingdicWayList = res.result.records
+        this.bookingdicWayList = res.result
         this.model.orderInfo.bookingDicWay = res.result.records[0].id
       }
     })

+ 6 - 6
src/views/room/modules/scheduleTeam/EdiBatchScheduleRoomForm.vue

@@ -784,20 +784,20 @@ export default {
       //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
 
-      getAction("/business/busDictItem/list", {
+      getAction('/business/busDictItem/queryList', {
         hotelId: _info.id,
-        dictId: "1639538915239743490",
+        dictName: '客人来源设置'
       }).then((res) => {
         if (res.success) {
-          this.customerSourceList = res.result.records;
+          this.customerSourceList = res.result;
         }
       });
-      getAction("/business/busDictItem/list", {
+      getAction('/business/busDictItem/queryList', {
         hotelId: _info.id,
-        dictId: "1639544187093995521",
+        dictName: '预定方式'
       }).then((res) => {
         if (res.success) {
-          this.bookingdicWayList = res.result.records;
+          this.bookingdicWayList = res.result;
         }
       });
       getAction("/business/busSalesPerson/list", {

+ 10 - 10
src/views/room/modules/scheduleTeam/EditScheduleRoomFormMain.vue

@@ -526,28 +526,28 @@ export default {
       //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
 
-      getAction("/business/busDictItem/list", {
+      getAction('/business/busDictItem/queryList', {
         hotelId: _info.id,
-        dictId: "1639544105636417538",
+        dictName: '团队类型'
       }).then((res) => {
         if (res.success) {
-          this.teamTypeDicList = res.result.records;
+          this.teamTypeDicList = res.result;
         }
       });
-      getAction("/business/busDictItem/list", {
+      getAction('/business/busDictItem/queryList', {
         hotelId: _info.id,
-        dictId: "1639538915239743490",
+        dictName: '客人来源设置'
       }).then((res) => {
         if (res.success) {
-          this.customerSourceList = res.result.records;
+          this.customerSourceList = res.result;
         }
       });
-      getAction("/business/busDictItem/list", {
+      getAction('/business/busDictItem/queryList', {
         hotelId: _info.id,
-        dictId: "1639544187093995521",
+        dictName: '预定方式'
       }).then((res) => {
         if (res.success) {
-          this.bookingdicWayList = res.result.records;
+          this.bookingdicWayList = res.result;
         }
       });
       getAction("/business/busSalesPerson/list", {
@@ -926,4 +926,4 @@ export default {
   flex: 1;
   color: rgba(255, 141, 26, 1) !important;
 }
-</style>
+</style>

+ 10 - 10
src/views/room/modules/scheduleTeam/ScheduleRoomForm.vue

@@ -655,28 +655,28 @@ export default {
     //备份model原始值
     this.modelDefault = JSON.parse(JSON.stringify(this.model));
 
-    getAction("/business/busDictItem/list", {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: "1639544105636417538",
+      dictName: '团队类型'
     }).then((res) => {
       if (res.success) {
-        this.teamTypeDicList = res.result.records;
+        this.teamTypeDicList = res.result;
       }
     });
-    getAction("/business/busDictItem/list", {
+    getAction('/business/busDictItem/queryList', {
       hotelId: _info.id,
-      dictId: "1639538915239743490",
+      dictName: '客人来源设置'
     }).then((res) => {
       if (res.success) {
-        this.customerSourceList = res.result.records;
+        this.customerSourceList = res.result;
       }
     });
-    getAction("/business/busDictItem/list", {
+    getAction("/business/busDictItem/queryList", {
       hotelId: _info.id,
-      dictId: "1639544187093995521",
+      dictName: "预定方式",
     }).then((res) => {
       if (res.success) {
-        this.bookingdicWayList = res.result.records;
+        this.bookingdicWayList = res.result;
       }
     });
     getAction("/business/busSalesPerson/list", {
@@ -1068,4 +1068,4 @@ export default {
   flex: 1;
   color: rgba(255, 141, 26, 1) !important;
 }
-</style>
+</style>

+ 1 - 0
src/views/settings/components/modules/dictionaryInfoRight.vue

@@ -199,6 +199,7 @@
             },
             // 添加字典数据
             handleAdd() {
+              console.log(localStorage, 'localStorage')
                 var dictId = localStorage.getItem("dictId")
                 this.$refs.modalForm.add(dictId);
                 this.$refs.modalForm.title = "新增";

+ 1 - 1
src/views/settings/components/modules/roomPayTypeForm.vue

@@ -5,7 +5,7 @@
         <a-row>
           <a-col :span="24">
             <a-form-model-item label="支付方式名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
-              <a-input v-model="model.name" placeholder="请输入支付方式名称"  ></a-input>
+              <a-input v-model="model.name" placeholder="请输入支付方式名称/" :disabled="model.isMust" ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">

+ 1 - 1
src/views/settings/components/paySettings.vue

@@ -115,7 +115,7 @@
           <a @click="configuration(record)">配置</a>
           <a-divider type="vertical" />
            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-              <a>删除</a>
+              <a v-if="!record.isMust">删除</a>
             </a-popconfirm>
 <!--          <a-dropdown>-->
 <!--            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->

+ 64 - 37
src/views/settings/components/roomModules/longRentSchemeModel.vue

@@ -7,11 +7,12 @@
       switchFullscreen
       @ok="handleOk"
       @cancel="close">
-    <a-form-model >
+    <a-form-model ref="form" :model="newScheme" :rules="validatorRules">
       <a-form-model-item
           label="房价名称"
           :labelCol="labelCol"
-          :wrapperCol="wrapperCol">
+          :wrapperCol="wrapperCol"
+          prop="name">
         <a-col :span="8">
           <a-input v-model="newScheme.name"></a-input>
         </a-col>
@@ -20,14 +21,14 @@
           label="租金标准"
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          prop="">
+          name="rentChargesMoney">
         <a-col :span="7">
-          <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额" style="width: 100%"></a-input-number>
-        </a-col>
-        <a-col :span="1"><span>元/</span></a-col>
-        <a-col :span="7">
-          <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number> 月
+          <a-input-number v-model="rentCharges.money" :min="0" placeholder="输入金额"  style="width: 100%"></a-input-number>
         </a-col>
+        <a-col :span="3"><span>元/月</span></a-col>
+<!--        <a-col :span="7">-->
+<!--          <a-input-number v-model="rentCharges.cycleNum" :min="0" placeholder="输入周期" style="width: 80%"></a-input-number> -->
+<!--        </a-col>-->
       </a-form-model-item>
       <a-form-model-item
           label="押金标准"
@@ -46,18 +47,14 @@
           :wrapperCol="wrapperCol"
           prop="orderInfo.roomPriceSlnId">
         <a-col :span="8">
-          <a-select v-model="depositCharges.num">
+          <a-select v-model="depositCharges.num" style="width: 80%">
             <a-select-option :value="1"> 押1 </a-select-option>
             <a-select-option :value="2"> 押2 </a-select-option>
             <a-select-option :value="3"> 押3 </a-select-option>
           </a-select>
         </a-col>
         <a-col :span="8">
-          <a-select v-model="rentCharges.num">
-            <a-select-option :value="1"> 付1 </a-select-option>
-            <a-select-option :value="2"> 付2 </a-select-option>
-            <a-select-option :value="3"> 付3 </a-select-option>
-          </a-select>
+          付 &nbsp;<a-input-number v-model="rentCharges.num" :min="1" @change="rentNumChange" style="width: 80%"></a-input-number>
         </a-col>
       </a-form-model-item>
       <a-form-model-item
@@ -90,11 +87,11 @@
             <a-col :span="5">
               <a-input-number v-model="item.money":min="0" placeholder="输入金额" style="width: 90%"></a-input-number>
             </a-col>
-            <a-col :span="2"><span>{{ item.chargeType == 3 ? '元/吨' : (item.chargeType == 4 ? '元/度' : '元') }}</span></a-col>
-            <a-col :span="5" v-if="item.chargeType == 2">
-              <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>
-            </a-col>
-            <a-col :span="1" v-if="item.chargeType == 2"><span>月</span></a-col>
+            <a-col :span="3"><span>{{ getUnitText(item.chargeType) }}</span></a-col>
+<!--            <a-col :span="5" v-if="item.chargeType == 2">-->
+<!--              <a-input-number v-model="item.cycleNum" :min="0" placeholder="输入周期" style="width: 90%"></a-input-number>-->
+<!--            </a-col>-->
+<!--            <a-col :span="1" v-if="item.chargeType == 2"><span>月</span></a-col>-->
           </a-row>
         </a-col>
       </a-form-model-item>
@@ -119,6 +116,10 @@ export default {
   },
   data() {
     return {
+      validatorRules: {
+        name: [{ required: true, message: '请输入会员卡号!' }],
+        rentChargesMoney: [{ required: true, message: '请输入等级类型!' }],
+      },
       title: '',
       visible: false,
       url: '',
@@ -137,12 +138,14 @@ export default {
       rentCharges: {
         name: '租金',
         chargeType: 2,
-        isMust: true
+        isMust: true,
+        num: 1
       },
       depositCharges: {
         name: '押金',
         chargeType: 1,
-        isMust: true
+        isMust: true,
+        num: 1
       },
       newScheme: {}
     };
@@ -175,34 +178,58 @@ export default {
       this.customChargeList.push(charge)
       this.$forceUpdate()
     },
+    rentNumChange() {
+
+    },
     /** 移除新增费项目 */
     removeCharge(index) {
       console.log(index, 'index')
       this.customChargeList.splice(index,1)
     },
+    getUnitText(val) {
+      if (val == 1) {
+        return '/元'
+      } else if (val === 2) {
+        return '元/月'
+      } else if (val === 3) {
+        return '元/吨'
+      } else if (val === 4) {
+        return '元/度'
+      } else if (val === 5) {
+        return '元/立方'
+      }
+    },
     close() {
       this.visible = false
       Object.assign(this.$data, this.$options.data())
     },
     handleOk() {
-      console.log(this.depositCharges)
-      console.log(this.rentCharges)
-      console.log(this.customChargeList)
-      let chargeList = JSON.parse(JSON.stringify(this.customChargeList))
-      chargeList.push(this.depositCharges)
-      chargeList.push(this.rentCharges)
-      this.newScheme.houseLongRentChargeList = chargeList
-      postAction(this.url, this.newScheme
-      ).then((res) => {
-        if (res.success) {
-          this.$message.success(res.message)
-          this.$emit('ok')
-          this.visible = false
-          Object.assign(this.$data, this.$options.data())
-        } else {
-          this.$message.warning(res.message)
+      const that = this
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          let chargeList = JSON.parse(JSON.stringify(that.customChargeList))
+          chargeList.push(that.depositCharges)
+          chargeList.push(that.rentCharges)
+          console.log(chargeList, ' rrrrrrrrrrrr')
+          if (chargeList.some(e => e.money <= 0 || e.name == null || e.name === '')) {
+            this.$message.warning('请输入费项名称和金额')
+            return
+          }
+          that.newScheme.houseLongRentChargeList = chargeList
+          postAction(that.url, that.newScheme
+          ).then((res) => {
+            if (res.success) {
+              that.$message.success(res.message)
+              that.$emit('ok')
+              that.visible = false
+              Object.assign(that.$data, that.$options.data())
+            } else {
+              that.$message.warning(res.message)
+            }
+          })
         }
       })
+
     }
   }
 };