修复菜品修改问题

This commit is contained in:
huangdeliang
2021-02-09 14:10:47 +08:00
parent afb7465281
commit 1775b657a7
26 changed files with 257 additions and 137 deletions

View File

@ -413,7 +413,7 @@ export default {
});
this.getDicts("cus_account").then((response) => {
this.accountIdOptions = response.data;
console.log(response.data);
// console.log(response.data);
this.accountIdOptions.splice(0, 0, {
dictLabel: "无",
dictValue: "0",
@ -559,7 +559,7 @@ export default {
accountId,
...obj,
};
console.log(this.form);
// console.log(this.form);
this.resetForm("form");
},
handleOnClosed() {
@ -600,7 +600,7 @@ export default {
watch: {
// 监听收款账号的变化
"form.accountId": function (newVal, oldVal) {
console.log("updte");
// console.log("updte");
this.initPlanningAndOperation();
},
},

View File

@ -162,10 +162,10 @@ export default {
});
},
changeShowModule(){
console.log("---------------");
// console.log("---------------");
for(var i = 0; i < this.stepArray.length; i++){
let flag = this.showModuleArray.find((opt) => opt === i);
console.log(flag != null && flag != undefined);
// console.log(flag != null && flag != undefined);
this.$set(this.stepArray, i, (flag != null && flag != undefined));
}
}

View File

@ -0,0 +1,87 @@
<template>
<div class="main">
<div class="aspect">指标</div>
<div class="recipes">
<el-table :data="mData" border :span-method="spanMethod" size="mini">
<el-table-column :label="`${name}第${num}天`"></el-table-column>
<el-table-column label="菜品" prop="name"></el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
name: "RecipesCom",
props: {
data: {
type: Array,
default: [],
required: true,
},
name: {
type: String,
default: "",
},
num: {
type: Number,
default: 0,
},
},
components: {},
mounted() {
// console.log(this.data);
},
data() {
return {};
},
computed: {
mData() {
if (!this.data.dishes) {
return [];
}
const mData = this.data.dishes.reduce((arr, cur) => {
if (cur.id > 0) {
cur.igdList.forEach((igd) => {
if (igd.id > 0) {
const tarDetail = cur.detail.find((det) => det.id == igd.id);
arr.push({
id: cur.id,
name: cur.name,
type: cur.type,
isMain: cur.isMain,
methods: cur.methods,
igdId: igd.id,
igdName: igd.name,
proteinRatio: igd.proteinRatio,
fatRatio: igd.fatRatio,
carbonRatio: igd.carbonRatio,
rec: igd.rec,
notRec: igd.notRec,
weight: tarDetail ? tarDetail.weight : igd.weight,
cusWeight: tarDetail ? tarDetail.cus_weight : igd.cusWeight,
cusUnit: tarDetail ? tarDetail.cus_unit : igd.cusUnit,
});
}
});
}
return arr;
}, []);
// console.log(mData);
return mData;
},
},
methods: {
spanMethod({ row, column, rowIndex, columnIndex }) {},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.main {
.aspect {
}
.recipies {
}
}
</style>

View File

@ -1,25 +0,0 @@
<template>
<div class="main">
<div class="aspect">指标</div>
<div class="recipes">食谱</div>
</div>
</template>
<script>
export default {
name: "RecipesView",
components: {},
data() {
return {};
},
methods: {},
};
</script>
<style rel="stylesheet/scss" lang="scss">
.main {
.aspect {
}
.recipies {
}
}
</style>

View File

@ -35,7 +35,7 @@ export default {
if (typeof val !== 'string') return
const themeCluster = this.getThemeCluster(val.replace('#', ''))
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
console.log(themeCluster, originalCluster)
// console.log(themeCluster, originalCluster)
const $message = this.$message({
message: ' Compiling the theme',