|
|
@ -38,10 +38,10 @@ |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
<template #goal="{ row }"> |
|
|
|
<span>{{ row.goal+"%" }}</span> |
|
|
|
<span>{{ row.type=='0'?row.goal+"%":row.goal }}</span> |
|
|
|
</template> |
|
|
|
<template #actual="{ row }"> |
|
|
|
<span>{{ row.goal==null?"":row.goal+"%" }}</span> |
|
|
|
<span>{{ row.actual==null||row.actual==""||row.type!='0'?row.actual:row.actual+"%" }}</span> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -170,37 +170,41 @@ const buttonTableClick = async (val, row) => { |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
if (type == 'update') { |
|
|
|
console.log("123",BasciYearEquipment.allSchemas.formSchema); |
|
|
|
BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'factoryType').componentProps.disabled = true//编辑置灰 |
|
|
|
// BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'factory_type').componentProps.disabled = true//编辑置灰 |
|
|
|
//BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'year_index').componentProps.disabled = true//编辑置灰 |
|
|
|
} |
|
|
|
// if (type == 'update') { |
|
|
|
// BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'factoryType').componentProps.disabled = true//编辑置灰 |
|
|
|
// // BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'factory_type').componentProps.disabled = true//编辑置灰 |
|
|
|
// //BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'year_index').componentProps.disabled = true//编辑置灰 |
|
|
|
// }else{ |
|
|
|
// BasciYearEquipment.allSchemas.formSchema.find(item => item.field == 'factoryType').componentProps.disabled = false//编辑置灰 |
|
|
|
// } |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
// 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} |
|
|
|
} |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
|