Commit 4303eceb authored by zhoutong's avatar zhoutong

处理移出的一些bug

parent 1c250b00
......@@ -87,6 +87,7 @@ service.interceptors.response.use(res => {
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
Message({
dangerouslyUseHTMLString: true,
message: msg,
type: 'error'
})
......
......@@ -538,7 +538,10 @@ export default {
}).catch((res) => {
if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning",
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
})
.then((_) => {
remove({ ...params, deleteType: 2 }).then((res) => {
......@@ -547,12 +550,14 @@ export default {
});
});
})
.catch((_) => {
remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getLoadSecGoodsList();
.catch(action => {
if(action =='cancel'){
remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getLoadSecGoodsList();
});
});
});
}
});
}
});
......
......@@ -246,6 +246,31 @@ export default {
serviceMsg(res, this).then(() => {
this.getSecGoods();
});
}).catch((res) => {
if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
})
.then((_) => {
remove({ ...params, deleteType: 2 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getSecGoods();
});
});
})
.catch(action => {
if(action =='cancel'){
remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getSecGoods();
});
});
}
});
}
});
},
/** 预装 */
......@@ -262,11 +287,64 @@ export default {
} else {
params.orderItemIdList = [item.orderItemId];
}
createGoods(params).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
createGoods(params)
.then((res) => {
const { data } = res;
if (data.relationMsg) {
const msg = data.relationMsg.replaceAll(",", "");
this.$confirm(msg, this.$t("提示"), {
type: "warning",
})
.then((_) => {
loadRelationOrder(data).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
} else {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
}
})
.catch((res) => {
if (res.code === 555) {
const msg = res.msg && res.msg.replaceAll(",", "");
this.$confirm(msg, this.$t("提示"), {
type: "warning",
})
.then((_) => {
createGoods({ ...params, relationStatus: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
}
if (res.code === 566) {
this.$confirm(res.msg+this.$t('是否需要一起预装?'), this.$t("提示"), {
type: "warning",
})
.then((_) => {
createGoods({ ...params, relationStatus: 2 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
})
.catch((_) => {
this.queryAllData();
});
}
});
},
/* 增加部分 */
addPart() {
......
......@@ -747,7 +747,10 @@ export default {
}).catch((res) => {
if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning",
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
})
.then((_) => {
deleteGoods({ ...param, deleteType: 2 }).then((res) => {
......@@ -756,12 +759,14 @@ export default {
});
});
})
.catch((_) => {
deleteGoods({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
.catch(action => {
if(action =='cancel'){
deleteGoods({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.queryAllData();
});
});
});
}
});
}
});
......
......@@ -251,7 +251,10 @@ export default {
}).catch((res) => {
if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning",
dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
})
.then((_) => {
tallyRemove({ ...param, deleteType: 2 }).then((res) => {
......@@ -260,12 +263,14 @@ export default {
});
});
})
.catch((_) => {
tallyRemove({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getList();
.catch(action => {
if(action =='cancel'){
tallyRemove({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => {
this.getList();
});
});
});
}
});
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment