fix: 🧩 修复bug
This commit is contained in:
@@ -39,6 +39,7 @@ const dataStore = reactive<any>({
|
||||
labelWidth: "120px",
|
||||
formData: cloneDeep(DETAILS_FORM_DATA),
|
||||
ruleForm: cloneDeep(DETAILS_RULE_FORM),
|
||||
compareRuleForm: {},
|
||||
id: null,
|
||||
title: ""
|
||||
});
|
||||
@@ -68,6 +69,8 @@ const getGoodsUp = async () => {
|
||||
if (result?.code === 0) {
|
||||
useMsg("success", "更新成功 !");
|
||||
$Bus.emit("setGoodsResetList");
|
||||
//更新成功以后调用详情接口是为了刷新对比数据防止对比数据不一致
|
||||
getGoodsDetails();
|
||||
}
|
||||
};
|
||||
//详情
|
||||
@@ -80,6 +83,7 @@ const getGoodsDetails = async () => {
|
||||
const result = await getGoodsDetailsApi(dataStore.id);
|
||||
if (result?.code === 0) {
|
||||
dataStore.ruleForm = result?.data;
|
||||
dataStore.compareRuleForm = cloneDeep(result?.data);
|
||||
}
|
||||
};
|
||||
getGoodsDetails();
|
||||
@@ -110,10 +114,26 @@ const handleButtonClickCallback = (item: any) => {
|
||||
dataStore.title === "新增仓位找货优先级" ? handleAdd() : getGoodsUp();
|
||||
}
|
||||
if (type === "preview") {
|
||||
if (!dataStore.id) {
|
||||
if (!dataStore.id && dataStore.title === "新增仓位找货优先级") {
|
||||
useMsg("warning", "请先保存数据 !");
|
||||
return;
|
||||
}
|
||||
// 编辑的话需要判断用户是否有修改
|
||||
if (dataStore.title === "编辑仓位找货优先级") {
|
||||
if (dataStore.compareRuleForm.use_org_number !== dataStore.ruleForm.use_org_number) {
|
||||
useMsg("warning", "请先保存数据 !");
|
||||
return;
|
||||
}
|
||||
if (dataStore.compareRuleForm.warehouse_number !== dataStore.ruleForm.warehouse_number) {
|
||||
useMsg("warning", "请先保存数据 !");
|
||||
return;
|
||||
}
|
||||
if (dataStore.compareRuleForm.pos_picking_priority !== dataStore.ruleForm.pos_picking_priority) {
|
||||
useMsg("warning", "请先保存数据 !");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$router.push({
|
||||
path: "/foundation/set/goods/preview",
|
||||
query: { id: dataStore.id, name: dataStore.title }
|
||||
|
||||
Reference in New Issue
Block a user