|
@ -389,24 +389,7 @@ const detailOpenForm = (type, row) => { |
|
|
// 子表新增/编辑校验 |
|
|
// 子表新增/编辑校验 |
|
|
const detailValidate = (data) => { |
|
|
const detailValidate = (data) => { |
|
|
// return true; |
|
|
// return true; |
|
|
let tag = false; |
|
|
let tag = true; |
|
|
// if (data.qty <= 0) { |
|
|
|
|
|
// message.warning('数量必须大于0') |
|
|
|
|
|
// tag = false; |
|
|
|
|
|
// return tag; |
|
|
|
|
|
// } else { |
|
|
|
|
|
// tag = true; |
|
|
|
|
|
// return tag; |
|
|
|
|
|
// } |
|
|
|
|
|
let req = DeviceInspectionDetailRules.uncompleted?.find(item => { |
|
|
|
|
|
return item.required == true |
|
|
|
|
|
}) |
|
|
|
|
|
if (req !== undefined) { |
|
|
|
|
|
tag = false |
|
|
|
|
|
message.warning('需填入未完成原因') |
|
|
|
|
|
} else { |
|
|
|
|
|
tag = true |
|
|
|
|
|
} |
|
|
|
|
|
return tag |
|
|
return tag |
|
|
} |
|
|
} |
|
|
// 子表提交 |
|
|
// 子表提交 |
|
@ -501,15 +484,20 @@ const submitForm = async (formType, data) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function detailOnChange(field, cur, item) { |
|
|
function detailOnChange(field, cur, item,formRef) { |
|
|
if (field == 'status') { |
|
|
if (field == 'status') { |
|
|
if (cur == '1') { |
|
|
if (cur == '1') { |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: true }] |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true |
|
|
|
|
|
formRef.setValues({completionTime:''}) |
|
|
|
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: true, message: '该项为必填项' }] |
|
|
|
|
|
DeviceInspectionDetailRules.completionTime = [{ required: false }] |
|
|
} else { |
|
|
} else { |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
formRef.setValues({uncompleted:''}) |
|
|
|
|
|
DeviceInspectionDetailRules.completionTime = [{ required: true , message: '该项为必填项'}] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -517,17 +505,22 @@ function detailOnChange(field, cur, item) { |
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
const openFormCallBack = (type, row, masterParmas, callback) => { |
|
|
if (row == undefined || row == null) { |
|
|
if (row == undefined || row == null) { |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
DeviceInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}] |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'status').value = '0' |
|
|
} else { |
|
|
} else { |
|
|
if (row.status == '1') { |
|
|
if (row.status == '1') { |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: true }] |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = true |
|
|
|
|
|
|
|
|
|
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: true,message: '该项为必填项' }] |
|
|
|
|
|
DeviceInspectionDetailRules.completionTime = [{ required: false }] |
|
|
} else { |
|
|
} else { |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = '' |
|
|
DeviceInspectionDetail.allSchemas.formSchema.find(item => item.field == 'completionTime').componentProps.disabled = false |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
DeviceInspectionDetailRules.uncompleted = [{ required: false }] |
|
|
|
|
|
DeviceInspectionDetailRules.completionTime = [{ required: true ,message: '该项为必填项'}] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|