Commit 864ccc22 authored by zhoutong's avatar zhoutong

处理移出的一些bug

parent a31b61be
...@@ -87,6 +87,7 @@ service.interceptors.response.use(res => { ...@@ -87,6 +87,7 @@ service.interceptors.response.use(res => {
return Promise.reject('无效的会话,或者会话已过期,请重新登录。') return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) { } else if (code === 500) {
Message({ Message({
dangerouslyUseHTMLString: true,
message: msg, message: msg,
type: 'error' type: 'error'
}) })
......
...@@ -538,7 +538,10 @@ export default { ...@@ -538,7 +538,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
remove({ ...params, deleteType: 2 }).then((res) => { remove({ ...params, deleteType: 2 }).then((res) => {
...@@ -547,12 +550,14 @@ export default { ...@@ -547,12 +550,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
remove({ ...params, deleteType: 1 }).then((res) => { remove({ ...params, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getLoadSecGoodsList(); this.getLoadSecGoodsList();
}); });
}); });
}
}); });
} }
}); });
......
...@@ -246,6 +246,31 @@ export default { ...@@ -246,6 +246,31 @@ export default {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getSecGoods(); 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,10 +287,63 @@ export default { ...@@ -262,10 +287,63 @@ export default {
} else { } else {
params.orderItemIdList = [item.orderItemId]; params.orderItemIdList = [item.orderItemId];
} }
createGoods(params).then((res) => { 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(() => { serviceMsg(res, this).then(() => {
this.queryAllData(); 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();
});
}
}); });
}, },
/* 增加部分 */ /* 增加部分 */
......
...@@ -747,7 +747,10 @@ export default { ...@@ -747,7 +747,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
deleteGoods({ ...param, deleteType: 2 }).then((res) => { deleteGoods({ ...param, deleteType: 2 }).then((res) => {
...@@ -756,12 +759,14 @@ export default { ...@@ -756,12 +759,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
deleteGoods({ ...param, deleteType: 1 }).then((res) => { deleteGoods({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.queryAllData(); this.queryAllData();
}); });
}); });
}
}); });
} }
}); });
......
...@@ -251,7 +251,10 @@ export default { ...@@ -251,7 +251,10 @@ export default {
}).catch((res) => { }).catch((res) => {
if (res.code === 666) { if (res.code === 666) {
this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), { this.$confirm(res.msg+this.$t('是否需要一起移出?'), this.$t("提示"), {
type: "warning", dangerouslyUseHTMLString: true,
distinguishCancelAndClose: true,
confirmButtonText: '确定移出',
cancelButtonText: '仅移出当前订单'
}) })
.then((_) => { .then((_) => {
tallyRemove({ ...param, deleteType: 2 }).then((res) => { tallyRemove({ ...param, deleteType: 2 }).then((res) => {
...@@ -260,12 +263,14 @@ export default { ...@@ -260,12 +263,14 @@ export default {
}); });
}); });
}) })
.catch((_) => { .catch(action => {
if(action =='cancel'){
tallyRemove({ ...param, deleteType: 1 }).then((res) => { tallyRemove({ ...param, deleteType: 1 }).then((res) => {
serviceMsg(res, this).then(() => { serviceMsg(res, this).then(() => {
this.getList(); 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