|
@ -70,6 +70,8 @@ |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
@detailSubmitForm="detailSubmitForm" |
|
|
:isSearchTableItem="true" |
|
|
:isSearchTableItem="true" |
|
|
|
|
|
:openFormCallBack="openFormCallBack" |
|
|
|
|
|
@detailOnChange="detailOnChange" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
@ -161,7 +163,7 @@ const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { // 新增 |
|
|
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; |
|
|
// MoldInspectionMain.allSchemas.formSchema[4].value = 'PROCCED'; |
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; |
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'status').value = 'PROCCED'; |
|
|
MoldInspectionMain.allSchemas.formSchema[5].value = 'DEVICE'; |
|
|
MoldInspectionMain.allSchemas.formSchema.find((item) => item.field == 'type').value = 'MOLD'; |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
} else if (val == 'import') { // 导入 |
|
|
handleImport() |
|
|
handleImport() |
|
@ -349,19 +351,31 @@ const detailValidate = (data) => { |
|
|
// tag = true; |
|
|
// tag = true; |
|
|
// return tag; |
|
|
// return tag; |
|
|
// } |
|
|
// } |
|
|
|
|
|
let req = MoldInspectionDetailRules.uncompleted?.find(item => { |
|
|
|
|
|
return item.required == true |
|
|
|
|
|
}) |
|
|
|
|
|
if (req !== undefined) { |
|
|
|
|
|
tag = false |
|
|
|
|
|
message.warning('需填入未完成原因') |
|
|
|
|
|
} else { |
|
|
|
|
|
tag = true |
|
|
|
|
|
} |
|
|
|
|
|
return tag |
|
|
} |
|
|
} |
|
|
// 子表提交 |
|
|
// 子表提交 |
|
|
const detailSubmitForm = async (formType, data, getList, formRef, tableList) => { |
|
|
const detailSubmitForm = async (formType, data, getList1, formRef, tableList) => { |
|
|
console.log('data',data) |
|
|
console.log('data', data) |
|
|
try { |
|
|
try { |
|
|
let data1 = { |
|
|
let data1 = { |
|
|
id: data.id, |
|
|
id: data.id, |
|
|
number: data.maintenanceNumber, |
|
|
number: data.number, |
|
|
|
|
|
masterId: data.masterId, |
|
|
siteId: data.siteId, |
|
|
siteId: data.siteId, |
|
|
available: data.available, |
|
|
available: data.available, |
|
|
concurrencyStamp: data.concurrencyStamp, |
|
|
concurrencyStamp: data.concurrencyStamp, |
|
|
name: data.name, |
|
|
name: data.name, |
|
|
peoples: data.peoples, |
|
|
peoples: data.peoples, |
|
|
|
|
|
status: data.status, |
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
estimatedMinutes: data.estimatedMinutes, |
|
|
actualMinutes: data.actualMinutes, |
|
|
actualMinutes: data.actualMinutes, |
|
|
chargePeoples: data.chargePeoples.join(','), |
|
|
chargePeoples: data.chargePeoples.join(','), |
|
@ -371,15 +385,19 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => |
|
|
} |
|
|
} |
|
|
console.log('data1',data1) |
|
|
console.log('data1',data1) |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
|
|
|
console.log('create', data1) |
|
|
await MoldInspectionDetailApi.createMoldInspectionDetail(data1) |
|
|
await MoldInspectionDetailApi.createMoldInspectionDetail(data1) |
|
|
|
|
|
console.log('finish', data1) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
|
await MoldInspectionDetailApi.updateMoldInspectionDetail(data1) |
|
|
await MoldInspectionDetailApi.updateMoldInspectionDetail(data1) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|
formRef.dialogVisible = false |
|
|
formRef.dialogVisible = false |
|
|
|
|
|
console.log('before', data1) |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
|
await getList() |
|
|
await formRef.getList1 |
|
|
|
|
|
console.log('after', data1) |
|
|
detailRef.value.tableObject.tableList.forEach(item => { |
|
|
detailRef.value.tableObject.tableList.forEach(item => { |
|
|
if (item.itemNumbers?.length > 0) { |
|
|
if (item.itemNumbers?.length > 0) { |
|
|
let str = '' |
|
|
let str = '' |
|
@ -391,7 +409,7 @@ const detailSubmitForm = async (formType, data, getList, formRef, tableList) => |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
} finally { |
|
|
} finally { |
|
|
formRef.formLoading = false |
|
|
detailRef.value.formLoading = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -429,12 +447,46 @@ const submitForm = async (formType, data) => { |
|
|
await MoldInspectionMainApi.updateMoldInspectionMain(data) |
|
|
await MoldInspectionMainApi.updateMoldInspectionMain(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|
formRef.value.dialogVisible = false |
|
|
basicFormRef.value.dialogVisible = false |
|
|
// 刷新当前列表 |
|
|
// 刷新当前列表 |
|
|
getList() |
|
|
getList() |
|
|
} finally { |
|
|
} finally { |
|
|
formRef.value.formLoading = false |
|
|
basicFormRef.value.formLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function detailOnChange(field, cur, item) { |
|
|
|
|
|
if (field == 'status') { |
|
|
|
|
|
if (cur == '1') { |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
|
|
|
MoldInspectionDetailRules.uncompleted = [required] |
|
|
|
|
|
} else { |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
|
|
MoldInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
|
|
|
if (row == undefined || row == null) { |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
|
|
delete MoldInspectionDetailRules.uncompleted; |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' |
|
|
|
|
|
} else { |
|
|
|
|
|
if (row.status == '1') { |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
|
|
|
MoldInspectionDetailRules.uncompleted = [required] |
|
|
|
|
|
} else { |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
|
|
|
MoldInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
|
|
|
MoldInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
callback() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|