From dfd11a9a3940ce7a634f1dd9a4c6cdae294f454f Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Wed, 2 Apr 2025 15:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/accountCenter/index.vue | 12 +- src/views/base/canteenStall/canteen/index.vue | 9 +- src/views/base/canteenStall/stall/index.vue | 5 +- src/views/dish/dish/index.vue | 305 ++++++++++++------ src/views/dish/menu/detail.vue | 5 +- src/views/dish/menu/edit.vue | 63 ++-- src/views/dish/menu/index.vue | 4 +- 7 files changed, 265 insertions(+), 138 deletions(-) diff --git a/src/views/accountCenter/index.vue b/src/views/accountCenter/index.vue index 9d418de1..88c01fec 100644 --- a/src/views/accountCenter/index.vue +++ b/src/views/accountCenter/index.vue @@ -18,7 +18,7 @@ -
+
账户数
当前{{accTotalData.reportAccountDataNumSumParam.reportAccountDataNumParam.endCount||0}}
@@ -165,12 +165,7 @@
-
- - - - - + @@ -182,6 +177,7 @@ dicts: [], data() { return { + loading:true, pickerOptions: { disabledDate(time) { // 选择今天以及今天之后的日期 @@ -226,6 +222,7 @@ }, /** 查询列表 */ getData() { + this.loading=true; console.log(this.queryParams) let param = { "startDate": this.queryParams.startDate, @@ -234,6 +231,7 @@ accountDataTotalApi(param).then(response => { this.accTotalData = response console.log(this.accTotalData) + this.loading=false; }); }, //日期 diff --git a/src/views/base/canteenStall/canteen/index.vue b/src/views/base/canteenStall/canteen/index.vue index 5e57c428..60448031 100644 --- a/src/views/base/canteenStall/canteen/index.vue +++ b/src/views/base/canteenStall/canteen/index.vue @@ -230,9 +230,9 @@ @@ -477,7 +477,7 @@ "canteenNum": "", "capacity": "", "contactTel": "", - "custId": "379497835516661760", + "custId": "", "endBusinessTime": "", "startBusinessTime": "", "ifBook": 2, @@ -672,7 +672,8 @@ }else{ this.fileList=[] this.checkUrlList=[] - } + } + this.rangeTime=[response.canteenSaveDTO.startBusinessTime, response.canteenSaveDTO.endBusinessTime] this.deliveryModel = response.deliveryModel; this.orderDTO = response.orderDTO; this.payDTO = response.payDTO; diff --git a/src/views/base/canteenStall/stall/index.vue b/src/views/base/canteenStall/stall/index.vue index eae83c47..4d1d8c1b 100644 --- a/src/views/base/canteenStall/stall/index.vue +++ b/src/views/base/canteenStall/stall/index.vue @@ -211,9 +211,9 @@ @@ -839,6 +839,7 @@ export default { this.$forceUpdate() }); },500) + this.rangeTime=[response.stallSaveDTO.startBusinessTime, response.stallSaveDTO.endBusinessTime] this.deliveryModel = response.deliveryModel; this.orderDTO = response.orderDTO; this.mealtimeList = response.mealtimeList; diff --git a/src/views/dish/dish/index.vue b/src/views/dish/dish/index.vue index b33c2735..402f1023 100644 --- a/src/views/dish/dish/index.vue +++ b/src/views/dish/dish/index.vue @@ -300,9 +300,6 @@ - - - @@ -325,9 +322,6 @@ - - - @@ -338,29 +332,34 @@ - - + - + - - + + - + - - - - + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + @@ -425,34 +507,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -475,18 +530,16 @@ - - - + - - - - + + + + + + + + @@ -500,9 +553,7 @@ - - - + @@ -521,9 +572,7 @@ - - - + - 确 定 + 确 定 取 消 @@ -604,6 +653,7 @@ return { // 遮罩层 loading: true, + btnLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -675,14 +725,19 @@ areaId:null, canteenId:null, stallId:null, - dishesNum:"", - dishesName:"", + dishesNum:null, + dishesName:null, salesMode:1, sizeType:"1", - price:"", + price:null, + littlePrice:null, + largePrice:null, + littleMaterialCost:null, materialCost:0, - weight:"", - weightDeviation:"", + weight:null, + littleWeight:null, + largeWeight:null, + weightDeviation:null, cookId:null, labelIdList:[], season:[], @@ -711,6 +766,18 @@ ], price: [ { required: true, message: "单价不能为空", trigger: "blur" } + ], + littlePrice: [ + { required: true, message: "小份单价不能为空", trigger: "blur" } + ], + littleWeight: [ + { required: true, message: "小份份量不能为空", trigger: "blur" } + ], + largePrice: [ + { required: true, message: "大份单价不能为空", trigger: "blur" } + ], + largeWeight: [ + { required: true, message: "大份份量不能为空", trigger: "blur" } ] }, fileList: [],//图片 @@ -932,14 +999,19 @@ areaId:null, canteenId:null, stallId:null, - dishesNum:"", - dishesName:"", + dishesNum:null, + dishesName:null, salesMode:1, sizeType:"1", - price:"", + price:null, + littlePrice:null, + largePrice:null, + littleMaterialCost:null, materialCost:0, - weight:"", - weightDeviation:"", + weight:null, + littleWeight:null, + largeWeight:null, + weightDeviation:null, cookId:null, labelIdList:[], season:[], @@ -963,7 +1035,34 @@ this.title = "新增"; this.openDish = true; }, - + //修改计价方式 + changeSalesMode(e){ + console.log(e) + this.$set(this.baseForm,"sizeType",'1') + this.$set(this.baseForm,"weight",100) + this.$set(this.baseForm,"price",null) + this.$set(this.baseForm,"littlePrice",null) + this.$set(this.baseForm,"largePrice",null) + this.$set(this.baseForm,"littleWeight",null) + this.$set(this.baseForm,"largeWeight",null) + this.$set(this.baseForm,"littleMaterialCost",0) + this.$set(this.baseForm,"materialCost",0) + this.$set(this.baseForm,"weightDeviation",null) + if(e==1){ + this.$set(this.baseForm,"weight",null) + } + }, + changeSizeType(e){ + console.log(e) + this.$set(this.baseForm,"price",null) + this.$set(this.baseForm,"weight",null) + this.$set(this.baseForm,"littlePrice",null) + this.$set(this.baseForm,"largePrice",null) + this.$set(this.baseForm,"littleWeight",null) + this.$set(this.baseForm,"largeWeight",null) + this.$set(this.baseForm,"littleMaterialCost",0) + this.$set(this.baseForm,"materialCost",0) + }, /** 修改按钮操作 */ handleUpdate(row) { console.log(row) @@ -980,8 +1079,15 @@ this.$set(this.baseForm,"salesMode",response.salesMode) this.$set(this.baseForm,"sizeType",response.sizeType+'') this.$set(this.baseForm,"mealType",response.mealType) - this.$set(this.baseForm,"price",Number(response.price)/100) - this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100) + if(this.baseForm.sizeType==1){ + this.$set(this.baseForm,"price",Number(response.price)/100) + this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100) + }else{ + this.$set(this.baseForm,"littlePrice",Number(response.littlePrice)/100) + this.$set(this.baseForm,"largePrice",Number(response.largePrice)/100) + this.$set(this.baseForm,"littleMaterialCost",Number(response.littleMaterialCost)/100) + this.$set(this.baseForm,"materialCost",Number(response.materialCost)/100) + } if(this.baseForm.imageUrl){ this.fileList=[{url:this.baseForm.imageUrl}] this.checkUrlList=[this.baseForm.imageUrl] @@ -999,23 +1105,36 @@ handleDialogSubmit() { this.$refs.baseForm.validate(valid => { if (valid) { + if(!this.btnLoading){ + this.btnLoading=true this.baseForm.imageUrl = this.checkUrlList[0]; this.baseForm.arr = this.checkUrlList; - this.baseForm.price = Number(this.baseForm.price)*100; - this.baseForm.materialCost = Number(this.baseForm.materialCost)*100; + let param = {...this.baseForm} + if(param.sizeType==1){ + param.price = Number(param.price)*100; + param.materialCost = Number(param.materialCost)*100; + }else{ + param.littlePrice = Number(param.littlePrice)*100; + param.largePrice = Number(param.largePrice)*100; + param.littleMaterialCost = Number(param.littleMaterialCost)*100; + param.materialCost = Number(param.materialCost)*100; + } if (this.title === "新增") { - addMenuDishesApi(this.baseForm).then(response => { - this.$modal.msgSuccess("新增成功"); - this.openDish = false; - this.getList(); + addMenuDishesApi(param).then(response => { + this.openDish = false; + this.$modal.msgSuccess("新增成功"); + this.getList(); + this.btnLoading=false; }); } else { - editMenuDishesApi(this.baseForm).then(response => { - this.$modal.msgSuccess("修改成功"); - this.openDish = false; - this.getList(); + editMenuDishesApi(param).then(response => { + this.openDish = false; + this.$modal.msgSuccess("修改成功"); + this.getList(); + this.btnLoading=false; }); } + } } }) }, diff --git a/src/views/dish/menu/detail.vue b/src/views/dish/menu/detail.vue index cde7e98c..f10f8151 100644 --- a/src/views/dish/menu/detail.vue +++ b/src/views/dish/menu/detail.vue @@ -483,7 +483,6 @@ export default { }, //切换菜谱类型 changeRecipeType(e){ - console.log(this.baseInfo.recipeType) if(this.baseInfo.recipeType==1){//日期范围 this.dateRangeList = this.getDateRange(this.dateRange[0],this.dateRange[1]) this.dateRangeRadio = this.formatDate(this.dateRange[0]) @@ -647,7 +646,7 @@ export default { }, //修改 editDishes(item){ - console.log(item) + // console.log(item) this.dishesList=item.dishesList; this.dishesTypeList=[] this.dishesList.forEach(dish=>{ @@ -673,7 +672,7 @@ export default { "size":100 } getDishesByTypePageApi(param).then((response) => { - console.log(response) + // console.log(response) this.dishesPageList = response.data.records; for(let i =0 ;i < this.dishesList.length ;i++){ this.dishesPageList.forEach(item=>{ diff --git a/src/views/dish/menu/edit.vue b/src/views/dish/menu/edit.vue index 7a6b170b..999e7c94 100644 --- a/src/views/dish/menu/edit.vue +++ b/src/views/dish/menu/edit.vue @@ -1,4 +1,4 @@ -