From c85262f492569119ce41e04a0cb3da871c2dc783 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Wed, 11 Jun 2025 09:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/base/canteenStall/area/index.vue | 16 +++---- src/views/base/canteenStall/stall/index.vue | 42 +++++++++++++++++++ src/views/base/mobile/bannerList/index.vue | 38 +++++++++-------- src/views/dish/dish/index.vue | 4 +- .../material/components/MaterialDialog.vue | 5 ++- src/views/dish/material/index.vue | 3 ++ src/views/dish/menu/detail.vue | 2 +- src/views/dish/menu/edit.vue | 2 +- .../components/MaterialDialog.vue | 10 ++--- 9 files changed, 86 insertions(+), 36 deletions(-) diff --git a/src/views/base/canteenStall/area/index.vue b/src/views/base/canteenStall/area/index.vue index 0231d741..81d64a2f 100644 --- a/src/views/base/canteenStall/area/index.vue +++ b/src/views/base/canteenStall/area/index.vue @@ -111,8 +111,8 @@ - - + + @@ -163,9 +163,9 @@ maxlength="30" /> - + - + 0 + return this.checkUrlList.length > 1 }, }, methods: { @@ -347,22 +347,26 @@ export default { reader.onload = (e) => { const img = new Image(); img.onload = () => { - const { width, height } = img; - // 设置你希望限制的图片尺寸 - const MAX_WIDTH = 750; - const MAX_HEIGHT = 520; - console.log(width) - console.log(height) - if (width <= MAX_WIDTH && height <= MAX_HEIGHT) { - this.form[fileType] = file.raw - this.$refs['form'].validateField(fileType) - this.$message.success(`图片尺寸符合要求: ${width}x${height}`); - } else { - this.$message.error(`图片尺寸不能超过 ${MAX_WIDTH}x${MAX_HEIGHT}`); - // 清空当前上传的文件 - this.form[fileType] = '' - this.$refs['form'].validateField(fileType) - } + const { width, height } = img; + // 设置你希望限制的图片尺寸 + const MAX_WIDTH = 750; + const MAX_HEIGHT = 520; + console.log(width) + console.log(height) + if (width <= MAX_WIDTH && height <= MAX_HEIGHT) { + this.form[fileType] = file.raw + this.$refs['form'].validateField(fileType) + this.$message.success(`图片尺寸符合要求: ${width}x${height}`); + } else { + this.$message.error(`图片尺寸不能超过 ${MAX_WIDTH}x${MAX_HEIGHT}`); + this.checkUrlNameList=[] + this.checkUrlList=[] + this.fileList=[] + // 清空当前上传的文件 + this.form[fileType] = '' + this.$refs['form'].validateField(fileType) + + } }; img.src = e.target.result; }; diff --git a/src/views/dish/dish/index.vue b/src/views/dish/dish/index.vue index b9555e90..05e280c1 100644 --- a/src/views/dish/dish/index.vue +++ b/src/views/dish/dish/index.vue @@ -489,8 +489,8 @@ --> - - + + diff --git a/src/views/dish/material/components/MaterialDialog.vue b/src/views/dish/material/components/MaterialDialog.vue index 5a38d47a..8ca55b76 100644 --- a/src/views/dish/material/components/MaterialDialog.vue +++ b/src/views/dish/material/components/MaterialDialog.vue @@ -288,8 +288,9 @@ export default { materialName: [{ required: true, message: '请输入原料名称', trigger: 'blur' }], areaId: [{ required: true, message: '请选择所属区域', trigger: 'change' }], materialTypeId: [{ required: true, message: '请选择原料类别', trigger: 'change' }], - salesMode: [{ required: true, message: '请选择计量类型', trigger: 'change' }], - // unitId: [{ required: true, message: '请选择原料单位', trigger: 'change' }] + salesMode: [{ required: true, message: '请选择计量类型', trigger: 'change' }], + nutritionTypeId: [{ required: true, message: '请选择营养信息类别', trigger: 'change' }], + nutritionId: [{ required: true, message: '请选择营养信息', trigger: 'change' }], }, nutritionFields: [ { label: '可食部分', prop: 'edible', unit: 'g/100g' }, diff --git a/src/views/dish/material/index.vue b/src/views/dish/material/index.vue index a6110bec..43769343 100644 --- a/src/views/dish/material/index.vue +++ b/src/views/dish/material/index.vue @@ -493,6 +493,7 @@ export default { this.$modal.msgSuccess("删除成功"); this.getList(); this.getTreeData(); + this.$refs.materialDialog.getTypeTreeData(); }) .catch(() => {}); }, @@ -511,12 +512,14 @@ export default { this.$modal.msgSuccess("修改成功"); this.open = false; this.getTreeData(); + this.$refs.materialDialog.getTypeTreeData(); }); } else { addMaterialTypeApi(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getTreeData(); + this.$refs.materialDialog.getTypeTreeData(); }); } } diff --git a/src/views/dish/menu/detail.vue b/src/views/dish/menu/detail.vue index 21ea34f1..5da1f655 100644 --- a/src/views/dish/menu/detail.vue +++ b/src/views/dish/menu/detail.vue @@ -131,7 +131,7 @@ :props="{ emitPath: false,// 若设置 false,则只返回该节点的值,只返回最后选择的id checkStrictly: false,//来设置父子节点取消选中关联,从而达到选择任意一级选项的目的 - value:'typeId',label:'dishesTypeName' + value:'dishesTypeId',label:'dishesTypeName' }" clearable @change="getDishesPage"> - + + v-model="form.description"> @@ -207,7 +207,7 @@ export default { size:'',//商品规格 taxRate:'',//商品税率 supplyCertificate: '', - productRemark:"",//简介 + description:"",//简介 imgUrl:"",//图片 }, @@ -340,7 +340,7 @@ export default { } this.$set(this.form,"qualityNum",row.qualityNum) this.$set(this.form,"supplyCertificate","") - this.$set(this.form,"productRemark",row.productRemark) + this.$set(this.form,"description",row.description) this.$set(this.form,"imgUrl",row.imgUrl) //图片反显 if(row.imgUrl){ @@ -392,7 +392,7 @@ export default { qualityType:"1",//保质期类型 qualityNum:"",//保质期 supplyCertificate: '', - productRemark:"",//简介 + description:"",//简介 imgUrl:"" }; },