From b3a03328358140985ccad2055eb31c474725177b Mon Sep 17 00:00:00 2001 From: "28353131@qq.com" <28353131@qq.com> Date: Sat, 28 Nov 2020 18:06:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A4=E4=BA=92=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E5=B5=8C=E5=85=A5=E5=A4=9A=E9=80=89=E5=99=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=8F=9C=E5=8D=95=EF=BC=8C=E5=B9=B6=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9B=B4=E6=8E=A5=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/fantang/weekMenu/index.vue | 88 +++++++++++++------ 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/ruoyi-ui/src/views/fantang/weekMenu/index.vue b/ruoyi-ui/src/views/fantang/weekMenu/index.vue index 83f760cb9..d13121eac 100644 --- a/ruoyi-ui/src/views/fantang/weekMenu/index.vue +++ b/ruoyi-ui/src/views/fantang/weekMenu/index.vue @@ -11,7 +11,7 @@ :disabled="single" @click="handleUpdate" v-hasPermi="['fantang:weekMenu:edit']" - >修改 + >保存 @@ -36,9 +36,28 @@ - + + + - + + + @@ -143,7 +162,7 @@ // 菜品列表 foodList: [], // queryParams - foodQueryParams:{ + foodQueryParams: { pageNum: 1, pageSize: 9, name: null, @@ -154,35 +173,35 @@ // 是否显示弹出层 open: false, dinnerTypeOptions: [{ - value: '早餐', - label: '早餐' - }, { - value: '午餐', - label: '午餐' - }, { - value: '晚餐', - label: '晚餐' - } + value: '早餐', + label: '早餐' + }, { + value: '午餐', + label: '午餐' + }, { + value: '晚餐', + label: '晚餐' + } ], - weekdayOptions : [{ + weekdayOptions: [{ value: '周一', label: '周一' }, { value: '周二', label: '周二' - },{ + }, { value: '周三', label: '周三' - },{ + }, { value: '周四', label: '周四' - },{ + }, { value: '周五', label: '周五' - },{ + }, { value: '周六', label: '周六' - },{ + }, { value: '周日', label: '周日' }], @@ -217,7 +236,7 @@ this.getList(); }, methods: { - objectSpanMethod({ row, column, rowIndex, columnIndex }) { + objectSpanMethod({row, column, rowIndex, columnIndex}) { if (columnIndex === 1) { if (rowIndex % 3 === 0) { return { @@ -234,7 +253,7 @@ }, formatStartFlag(row) { - if(row.flag) + if (row.flag) return "启用"; else return "禁用"; @@ -245,6 +264,13 @@ listWeekMenu(this.queryParams).then(response => { this.weekMenuList = response.rows; this.total = response.total; + console.log("before-->", this.weekMenuList); + for (let i = 0; i < this.weekMenuList.length; i++) { + if (this.weekMenuList[i].foods !== null) + this.weekMenuList[i].foods = this.weekMenuList[i].foods.split(',').map(Number); + + } + console.log("after-->", this.weekMenuList); this.loading = false; }); listFood(this.queryParams).then(response => { @@ -289,13 +315,19 @@ }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); - const id = row.id || this.ids - getWeekMenu(id).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改每周菜单"; + row.foods = row.foods.toLocaleString(); + updateWeekMenu(row).then(response => { + this.msgSuccess("修改成功"); + row.foods = row.foods.split(',').map(Number); }); + + // this.reset(); + // const id = row.id || this.ids + // getWeekMenu(id).then(response => { + // this.form = response.data; + // this.open = true; + // this.title = "修改每周菜单"; + // }); }, /** 提交按钮 */ submitForm() {