修复食谱采购统计问题
This commit is contained in:
parent
ceb0c6e6b1
commit
86bb66a757
@ -33,7 +33,7 @@
|
||||
FROM sys_order
|
||||
WHERE ${column} IS NOT NULL AND ${column} <> 0 AND del_flag = 0
|
||||
<if test="reviewStatus != null and reviewStatus != ''">
|
||||
AND review_status = #{reviewStatus}
|
||||
AND review_status = ${reviewStatus}
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''">AND date_format(order_time,'%y%m%d') >=
|
||||
date_format(${beginTime},'%y%m%d')
|
||||
|
@ -5,7 +5,8 @@ const oriState = {
|
||||
cusUnitDict: {},
|
||||
cusWeightDict: {},
|
||||
menuTypeDict: {},
|
||||
idgTypeDict: {}
|
||||
idgTypeDict: {},
|
||||
igdUnitDict: {}
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
@ -55,6 +56,13 @@ const actions = {
|
||||
}, {});
|
||||
commit("updateStateData", { idgTypeDict });
|
||||
});
|
||||
getDicts("sys_ingredient_unit").then(response => {
|
||||
const igdUnitDict = response.data.reduce((obj, cur) => {
|
||||
obj[cur.dictLabel] = cur.dictValue;
|
||||
return obj;
|
||||
}, {});
|
||||
commit("updateStateData", { igdUnitDict });
|
||||
});
|
||||
},
|
||||
async fetchFullRecipes({ commit, dispatch }, payload) {
|
||||
return new Promise((res, rej) => {
|
||||
|
@ -67,16 +67,12 @@ export default {
|
||||
title: "",
|
||||
logo: require("@/assets/logo/st_logo.png"),
|
||||
shoppingCart: {},
|
||||
igdUnitDict: {
|
||||
鸡蛋: "个",
|
||||
牛奶: "盒",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
showDrawer(obj) {
|
||||
const { recipesId, num, label, data } = obj;
|
||||
console.log(obj);
|
||||
// console.log(obj);
|
||||
this.label = label;
|
||||
// num < 0 全部计算
|
||||
this.title = `${
|
||||
@ -100,6 +96,7 @@ export default {
|
||||
}
|
||||
},
|
||||
processShoppingCart(num, data = []) {
|
||||
console.log(data);
|
||||
this.shoppingCart = data.reduce((obj, cur, idx) => {
|
||||
if (
|
||||
num < 0 || // 全部计算
|
||||
@ -115,14 +112,14 @@ export default {
|
||||
const tarIObj = tarObj.find((zObj) => zObj.name === iObj.name);
|
||||
if (tarIObj) {
|
||||
tarIObj.weight += this.igdUnitDict[iObj.name]
|
||||
? iObj.cusWeight
|
||||
? parseInt(iObj.cusWeight)
|
||||
: iObj.weight;
|
||||
} else {
|
||||
tarObj.push({
|
||||
type: iObj.type,
|
||||
name: iObj.name,
|
||||
weight: this.igdUnitDict[iObj.name]
|
||||
? iObj.cusWeight
|
||||
? parseInt(iObj.cusWeight)
|
||||
: iObj.weight,
|
||||
unit: this.igdUnitDict[iObj.name] || "g",
|
||||
});
|
||||
@ -133,7 +130,7 @@ export default {
|
||||
type: iObj.type,
|
||||
name: iObj.name,
|
||||
weight: this.igdUnitDict[iObj.name]
|
||||
? iObj.cusWeight
|
||||
? parseInt(iObj.cusWeight)
|
||||
: iObj.weight,
|
||||
unit: this.igdUnitDict[iObj.name] || "g",
|
||||
},
|
||||
@ -144,7 +141,7 @@ export default {
|
||||
}
|
||||
return obj;
|
||||
}, {});
|
||||
// console.log(this.shoppingCart);
|
||||
console.log(this.shoppingCart);
|
||||
},
|
||||
handleOnBackClick() {
|
||||
this.visible = false;
|
||||
@ -153,7 +150,7 @@ export default {
|
||||
...mapActions(["fetchFullRecipes"]),
|
||||
},
|
||||
computed: {
|
||||
...mapState(["recipes", "idgTypeDict"]),
|
||||
...mapState(["recipes", "idgTypeDict", "igdUnitDict"]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user