Browse Source

HL-5290 WMS 包装规格 新增已经存在的包装提示包装已存在,但是页面一直加载

hella_online_20240816
TengXF 3 months ago
parent
commit
063f1bf4b4
  1. 55
      src/views/wms/basicDataManage/itemManage/packageunit/index.vue

55
src/views/wms/basicDataManage/itemManage/packageunit/index.vue

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

Loading…
Cancel
Save