|
|
@ -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) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
|