!116 修复食谱制作问题

Merge pull request !116 from 德仔/develop
This commit is contained in:
德仔 2021-03-10 19:12:12 +08:00 committed by Gitee
commit 9946667f88
9 changed files with 47 additions and 14 deletions

View File

@ -670,7 +670,7 @@ export default {
} }
}, },
handleOrderTypeChange() { handleOrderTypeChange() {
console.log(this.form.orderTypeList); // console.log(this.form.orderTypeList);
}, },
}, },
watch: { watch: {

View File

@ -170,7 +170,7 @@ export default {
} }
return arr; return arr;
}, []); }, []);
console.log(this.orderList); // console.log(this.orderList);
this.visible = true; this.visible = true;
}); });

View File

@ -569,7 +569,7 @@ export default {
}; };
// console.log(this.form); // console.log(this.form);
this.resetForm("form"); this.resetForm("form");
console.log("--"+obj.orderType); // console.log("--"+obj.orderType);
this.onSaleShow = this.form.orderType == "2"; this.onSaleShow = this.form.orderType == "2";
this.afterSaleNutriAssShow = this.form.orderType != "2" && this.form.afterSaleCommissOrder == 0; this.afterSaleNutriAssShow = this.form.orderType != "2" && this.form.afterSaleCommissOrder == 0;
this.planOperatorShow = this.form.afterSaleCommissOrder == 0; this.planOperatorShow = this.form.afterSaleCommissOrder == 0;

View File

@ -33,7 +33,7 @@ const oriState = {
templateInfo: undefined, templateInfo: undefined,
copyData: undefined, copyData: undefined,
canCopyMenuTypes: [], canCopyMenuTypes: [],
fontSize: 12 fontSize: parseInt(localStorage.getItem("fontSize")) || 12
}; };
const mutations = { const mutations = {
@ -45,6 +45,7 @@ const mutations = {
); );
if (tarDishes) { if (tarDishes) {
if (actionType === "replace") { if (actionType === "replace") {
tarDishes.remark = "";
// 替换菜品,修改类型 // 替换菜品,修改类型
Object.keys(payload.data).forEach(key => { Object.keys(payload.data).forEach(key => {
tarDishes[key] = payload.data[key]; tarDishes[key] = payload.data[key];
@ -69,6 +70,7 @@ const mutations = {
}, },
updateFontSize(state, payload) { updateFontSize(state, payload) {
state.fontSize = payload.fontSize; state.fontSize = payload.fontSize;
localStorage.setItem("fontSize", payload.fontSize);
}, },
addRecipesDishes(state, payload) { addRecipesDishes(state, payload) {
state.recipesData[payload.num].dishes.push(payload.data); state.recipesData[payload.num].dishes.push(payload.data);
@ -299,7 +301,7 @@ const actions = {
// console.log(params); // console.log(params);
}, },
async addDishes({ commit, state }, payload) { async addDishes({ commit, state }, payload) {
console.log(payload); // console.log(payload);
const tarDishesList = state.recipesData[payload.num].dishes.filter( const tarDishesList = state.recipesData[payload.num].dishes.filter(
obj => obj.type === payload.data.type obj => obj.type === payload.data.type
); );
@ -366,6 +368,7 @@ const actions = {
params.remark = payload.remark; params.remark = payload.remark;
} else if (actionType === "replace") { } else if (actionType === "replace") {
params.dishesId = payload.data.dishesId; params.dishesId = payload.data.dishesId;
params.remark = "";
params.detail = payload.data.igdList.map(igd => ({ params.detail = payload.data.igdList.map(igd => ({
id: igd.id, id: igd.id,
weight: igd.weight, weight: igd.weight,

View File

@ -247,7 +247,7 @@
} }
}); });
this.ingredientArray.splice(tagIndex, 1); this.ingredientArray.splice(tagIndex, 1);
console.log( JSON.stringify(this.ingredientArray)) // console.log( JSON.stringify(this.ingredientArray))
} }
}, },
created() { created() {

View File

@ -636,7 +636,7 @@ export default {
this.searchOrderTypeArray != null this.searchOrderTypeArray != null
? encodeURIComponent(JSON.stringify(this.searchOrderTypeArray)) ? encodeURIComponent(JSON.stringify(this.searchOrderTypeArray))
: null; : null;
console.log(this.queryParams.searchOrderTypeArray); // console.log(this.queryParams.searchOrderTypeArray);
//this.dealOrderTypeArray(); //this.dealOrderTypeArray();
listOrder(this.addDateRange(this.queryParams, this.daterange)).then( listOrder(this.addDateRange(this.queryParams, this.daterange)).then(
(response) => { (response) => {

View File

@ -142,6 +142,8 @@ export default {
loading: false, loading: false,
mFontSize: 12, mFontSize: 12,
fontSizeOpts: [ fontSizeOpts: [
{ value: 8, label: "8" },
{ value: 10, label: "10" },
{ value: 12, label: "12" }, { value: 12, label: "12" },
{ value: 14, label: "14" }, { value: 14, label: "14" },
{ value: 16, label: "16" }, { value: 16, label: "16" },
@ -149,17 +151,25 @@ export default {
], ],
}; };
}, },
mounted() {
// this.mFontSize = parseInt(localStorage.getItem("fontSize")) || 12;
// this.updateFontSize({fontSize:})
},
updated() { updated() {
// console.log(this.data); // console.log(this.data);
if (this.fontSize !== this.mFontSize) {
this.mFontSize = this.fontSize;
// console.log(this.fontSize);
}
}, },
props: ["collapse", "data"], props: ["collapse", "data"],
computed: { computed: {
...mapState(["recipesId", "reviewStatus", "healthyData", "fontSize"]), ...mapState(["recipesId", "reviewStatus", "healthyData", "fontSize"]),
}, },
watch: { watch: {
fontSize(val) { // fontSize(val) {
this.mFontSize = val; // this.mFontSize = val;
}, // },
}, },
methods: { methods: {
handleOnSizeChange(fontSize) { handleOnSizeChange(fontSize) {

View File

@ -401,12 +401,18 @@ export default {
} }
return arr; return arr;
}, []); }, []);
console.log(mData); // console.log(mData);
return mData; return mData;
}, },
...mapGetters(["typeDict"]), ...mapGetters(["typeDict"]),
...mapState(["currentDay", "copyData", "fontSize", "canCopyMenuTypes"]), ...mapState([
"currentDay",
"copyData",
"fontSize",
"canCopyMenuTypes",
"recipesId",
]),
}, },
methods: { methods: {
cellClassName({ row, column, rowIndex, columnIndex }) { cellClassName({ row, column, rowIndex, columnIndex }) {
@ -470,9 +476,17 @@ export default {
handleOnPaste(type) { handleOnPaste(type) {
// console.log(this.copyData); // console.log(this.copyData);
if (this.copyData) { if (this.copyData) {
const data = {
...this.copyData,
type,
};
if (!this.recipesId) {
//
data.id = new Date().getTime();
}
this.addDishes({ this.addDishes({
num: this.num, num: this.num,
data: { ...this.copyData, type }, data,
}).catch((err) => { }).catch((err) => {
this.$message.error(err); this.$message.error(err);
}); });
@ -624,6 +638,12 @@ export default {
color: #595959; color: #595959;
} }
.recipes_cell_8 {
font-size: 8px;
}
.recipes_cell_10 {
font-size: 10px;
}
.recipes_cell_12 { .recipes_cell_12 {
font-size: 12px; font-size: 12px;
} }

View File

@ -147,7 +147,7 @@ export default {
}, },
{} {}
); );
console.log(this.shoppingCart); // console.log(this.shoppingCart);
}, },
handleOnBackClick() { handleOnBackClick() {
this.visible = false; this.visible = false;