Browse Source

巡检点检

master
songguoqiang 7 months ago
parent
commit
408e207f2c
  1. 41
      src/views/eam/basic/basciYearEquipment/index.vue

41
src/views/eam/basic/basciYearEquipment/index.vue

@ -181,26 +181,29 @@ const openForm = (type: string, row?: any) => {
// form
const formsSuccess = async (formType, data) => {
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) {
message.error('失效时间要大于生效时间')
return
try {
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) {
message.error('失效时间要大于生效时间')
return
}
}
}
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await BasciYearEquipmentApi.createBasciYearEquipment(data)
message.success(t('common.createSuccess'))
} else {
await BasciYearEquipmentApi.updateBasciYearEquipment(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
if (data.activeTime == 0) data.activeTime = null
if (data.expireTime == 0) data.expireTime = null
if (formType === 'create') {
await BasciYearEquipmentApi.createBasciYearEquipment(data)
message.success(t('common.createSuccess'))
} else {
await BasciYearEquipmentApi.updateBasciYearEquipment(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}catch{
basicFormRef.value.dialogVisible = false}
}
/** 详情操作 */

Loading…
Cancel
Save