|
|
@ -206,33 +206,38 @@ const openForm = (type: string, row?: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
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){ |
|
|
|
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) |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
try{ |
|
|
|
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){ |
|
|
|
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) |
|
|
|
} |
|
|
|
} catch { |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|