Browse Source

YT-1196WMS 标准成本价格单管理 新增时,提示重复后,页面一直加载,不刷新

intex
zhang_li 1 week ago
parent
commit
d57fbd74f7
  1. 57
      src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue

57
src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue

@ -206,33 +206,38 @@ const openForm = (type: string, row?: any) => {
} }
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType, data) => {
var isHave =Stdcostprice.allSchemas.formSchema.some(function (item) { try{
return item.field === 'activeTime' || item.field === 'expireTime'; var isHave =Stdcostprice.allSchemas.formSchema.some(function (item) {
}); return item.field === 'activeTime' || item.field === 'expireTime';
if(isHave){ });
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ if(isHave){
message.error('失效时间要大于生效时间') if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
return; message.error('失效时间要大于生效时间')
} return;
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
basicFormRef.value.formLoading = true
if (formType === 'create') {
await StdcostpriceApi.createStdcostprice(data)
message.success(t('common.createSuccess'))
} else {
await StdcostpriceApi.updateStdcostprice(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
} }
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
basicFormRef.value.formLoading = true
if (formType === 'create') {
await StdcostpriceApi.createStdcostprice(data)
message.success(t('common.createSuccess'))
} else {
await StdcostpriceApi.updateStdcostprice(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
basicFormRef.value.formLoading = false
if (formType === 'create') {
getList()
}else{
buttonBaseClick('refresh',null)
}
} catch {
basicFormRef.value.formLoading = false
}
} }
// //

Loading…
Cancel
Save