diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml index b4b9eebe8..69a9eda2b 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCommisionMapper.xml @@ -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') diff --git a/stdiet-ui/src/store/modules/recipesShow.js b/stdiet-ui/src/store/modules/recipesShow.js index e149dc2c2..f5365ea6b 100644 --- a/stdiet-ui/src/store/modules/recipesShow.js +++ b/stdiet-ui/src/store/modules/recipesShow.js @@ -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) => { diff --git a/stdiet-ui/src/views/custom/recipesShow/PlanDrawer/ShoppingPlanDrawer/index.vue b/stdiet-ui/src/views/custom/recipesShow/PlanDrawer/ShoppingPlanDrawer/index.vue index 83b27cf0f..f887bb45f 100644 --- a/stdiet-ui/src/views/custom/recipesShow/PlanDrawer/ShoppingPlanDrawer/index.vue +++ b/stdiet-ui/src/views/custom/recipesShow/PlanDrawer/ShoppingPlanDrawer/index.vue @@ -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>