|
@ -181,26 +181,29 @@ const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
|
var isHave = BasciYearEquipment.allSchemas.formSchema.some(function (item) { |
|
|
try { |
|
|
return item.field === 'activeTime' || item.field === 'expireTime' |
|
|
var isHave = BasciYearEquipment.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.activeTime == 0) data.activeTime = null |
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
if (data.expireTime == 0) data.expireTime = null |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await BasciYearEquipmentApi.createBasciYearEquipment(data) |
|
|
await BasciYearEquipmentApi.createBasciYearEquipment(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
|
await BasciYearEquipmentApi.updateBasciYearEquipment(data) |
|
|
await BasciYearEquipmentApi.updateBasciYearEquipment(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|
basicFormRef.value.dialogVisible = false |
|
|
basicFormRef.value.dialogVisible = false |
|
|
getList() |
|
|
getList() |
|
|
}catch{ |
|
|
|
|
|
basicFormRef.value.dialogVisible = false} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
|