|
@ -910,12 +910,14 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
let arr = [] |
|
|
let arr = [] |
|
|
list.forEach((item, index) => { |
|
|
list.forEach((item, index) => { |
|
|
let obj = { |
|
|
let obj = { |
|
|
|
|
|
code: item.code, |
|
|
inspectionCode: item.inspectionCode, |
|
|
inspectionCode: item.inspectionCode, |
|
|
description: item.description, |
|
|
description: item.description, |
|
|
inspectionCharCode: item.inspectionCharCode, |
|
|
inspectionCharCode: item.inspectionCharCode, |
|
|
sequenceCode: item.sequenceCode, |
|
|
sequenceCode: item.sequenceCode, |
|
|
name: String(index + 1), |
|
|
name: String(index + 1), |
|
|
inspectionCharacteristicsBaseVO: { |
|
|
inspectionCharacteristicsBaseVO: { |
|
|
|
|
|
code: item.inspectionCharacteristicsBaseVO.code, |
|
|
description: item.inspectionCharacteristicsBaseVO.description, |
|
|
description: item.inspectionCharacteristicsBaseVO.description, |
|
|
featureType: item.inspectionCharacteristicsBaseVO.featureType, |
|
|
featureType: item.inspectionCharacteristicsBaseVO.featureType, |
|
|
inspectionMethodCode: item.inspectionCharacteristicsBaseVO.inspectionMethodCode, |
|
|
inspectionMethodCode: item.inspectionCharacteristicsBaseVO.inspectionMethodCode, |
|
@ -1388,44 +1390,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
} else if (formField == 'inspectionType') { |
|
|
} else if (formField == 'inspectionType') { |
|
|
data.value.testTypeName = val[0].description |
|
|
data.value.testTypeName = val[0].description |
|
|
} else if (formField == 'programmeTemplateCode') { |
|
|
} else if (formField == 'programmeTemplateCode') { |
|
|
isShowField.value = 0 //设置isShowField == 0隐藏aql和检验水平字段 |
|
|
setDataProgrammeTemplateCode(val[0]) |
|
|
data.value.programmeTemplateName = val[0].description |
|
|
|
|
|
data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode |
|
|
|
|
|
data.value.dynamicUpdateName = val[0].dynamicUpdateName |
|
|
|
|
|
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false |
|
|
|
|
|
list.forEach((item, index) => { |
|
|
|
|
|
editableTabsValue.value = index + 1 |
|
|
|
|
|
item.name = index + 1 |
|
|
|
|
|
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|
|
|
|
|
// 编辑判断上限下限目标值是否必填 |
|
|
|
|
|
if ( |
|
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 && |
|
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping |
|
|
|
|
|
) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) { |
|
|
|
|
|
isShowField.value += 1 //设置isShowField > 0显示aql和检验水平字段 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// 显示aql和检验水平字段的时候添加必填规则 |
|
|
|
|
|
if (isShowField.value > 0) { |
|
|
|
|
|
rules.value.aql[0].required = true |
|
|
|
|
|
rules.value.aql[0].required = true |
|
|
|
|
|
} else { |
|
|
|
|
|
rules.value.aql[0].required = false |
|
|
|
|
|
rules.value.aql[0].required = false |
|
|
|
|
|
} |
|
|
|
|
|
data.value.process = list |
|
|
|
|
|
} else if (formField == 'dynamicUpdateCode') { |
|
|
} else if (formField == 'dynamicUpdateCode') { |
|
|
data.value[formField] = val[0].code |
|
|
data.value[formField] = val[0].code |
|
|
data.value.dynamicUpdateName = val[0].description |
|
|
data.value.dynamicUpdateName = val[0].description |
|
@ -1434,6 +1399,48 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
|
|
|
|
|
|
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) |
|
|
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const setDataProgrammeTemplateCode = async (dataValue)=>{ |
|
|
|
|
|
isShowField.value = 0 //设置isShowField == 0隐藏aql和检验水平字段 |
|
|
|
|
|
data.value.programmeTemplateName = dataValue.description |
|
|
|
|
|
data.value['dynamicUpdateCode'] = dataValue.dynamicUpdateCode |
|
|
|
|
|
data.value.dynamicUpdateName = dataValue.dynamicUpdateName |
|
|
|
|
|
let list = await InspectionProcessPageApi.getListByTempleteCode(dataValue.code) |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false |
|
|
|
|
|
list.forEach((item, index) => { |
|
|
|
|
|
editableTabsValue.value = index + 1 |
|
|
|
|
|
item.name = index + 1 |
|
|
|
|
|
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|
|
|
|
|
// 编辑判断上限下限目标值是否必填 |
|
|
|
|
|
if ( |
|
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 && |
|
|
|
|
|
item.inspectionCharacteristicsBaseVO.quantifyIsCapping |
|
|
|
|
|
) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { |
|
|
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true |
|
|
|
|
|
} |
|
|
|
|
|
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) { |
|
|
|
|
|
isShowField.value += 1 //设置isShowField > 0显示aql和检验水平字段 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
// 显示aql和检验水平字段的时候添加必填规则 |
|
|
|
|
|
if (isShowField.value > 0) { |
|
|
|
|
|
rules.value.aql[0].required = true |
|
|
|
|
|
rules.value.aql[0].required = true |
|
|
|
|
|
} else { |
|
|
|
|
|
rules.value.aql[0].required = false |
|
|
|
|
|
rules.value.aql[0].required = false |
|
|
|
|
|
} |
|
|
|
|
|
data.value.process = list |
|
|
|
|
|
} |
|
|
// 选择是否设定上限值 |
|
|
// 选择是否设定上限值 |
|
|
const changeIsCapping = (e, item) => { |
|
|
const changeIsCapping = (e, item) => { |
|
|
item.inspectionCharacteristicsBaseVO.quantifyCapping = '' |
|
|
item.inspectionCharacteristicsBaseVO.quantifyCapping = '' |
|
@ -1508,6 +1515,7 @@ const onItemBlur = async (field, pageApi, item) => { |
|
|
} |
|
|
} |
|
|
//失去焦点 |
|
|
//失去焦点 |
|
|
const onBlur = async (field, pageApi, item) => { |
|
|
const onBlur = async (field, pageApi, item) => { |
|
|
|
|
|
console.log('onBlur',field, pageApi, item) |
|
|
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value |
|
|
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value |
|
|
if (dataObj[field + 'Code']) { |
|
|
if (dataObj[field + 'Code']) { |
|
|
const _searchCondition = {} |
|
|
const _searchCondition = {} |
|
@ -1528,6 +1536,7 @@ const onBlur = async (field, pageApi, item) => { |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.isSearch = true |
|
|
_searchCondition.filters = filters |
|
|
_searchCondition.filters = filters |
|
|
const array = await pageApi(_searchCondition) |
|
|
const array = await pageApi(_searchCondition) |
|
|
|
|
|
console.log('array',array) |
|
|
Butttondata = [ |
|
|
Butttondata = [ |
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
@ -1541,6 +1550,11 @@ const onBlur = async (field, pageApi, item) => { |
|
|
dataObj[field + 'Code'] = '' |
|
|
dataObj[field + 'Code'] = '' |
|
|
dataObj[field + 'Name'] = '' |
|
|
dataObj[field + 'Name'] = '' |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(field == 'programmeTemplate'){ //检验模板 |
|
|
|
|
|
setDataProgrammeTemplateCode(obj) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
dataObj[field + 'Name'] = '' |
|
|
dataObj[field + 'Name'] = '' |
|
|
Butttondata = [ |
|
|
Butttondata = [ |
|
|