|
|
@ -7,9 +7,8 @@ |
|
|
|
:vLoading="formLoading" |
|
|
|
> |
|
|
|
<div style="max-height: 60vh; overflow-y: auto; padding: 0px 20px"> |
|
|
|
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> |
|
|
|
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> |
|
|
|
<el-row> |
|
|
|
<el-row gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="编码" prop="code"> |
|
|
|
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> |
|
|
@ -25,6 +24,103 @@ |
|
|
|
<el-input v-model="data.version" placeholder="请填写版本" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="检验类型编码" prop="testTypeCode" > |
|
|
|
<div style="display: flex; width: 100%"> |
|
|
|
<el-input |
|
|
|
v-model="data.testTypeCode" |
|
|
|
disabled |
|
|
|
placeholder="请选择检验类型编码" |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
type="info" |
|
|
|
plain |
|
|
|
style="width: 40px" |
|
|
|
@click="opensearchTable('testTypeCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApi.getSamplingProcessPage,null,false,null,item)" |
|
|
|
><Icon icon="ep:search"/> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="检验模板编码" prop="programmeTemplateCode" > |
|
|
|
<div style="display: flex; width: 100%"> |
|
|
|
<el-input |
|
|
|
v-model="data.testTypeCode" |
|
|
|
disabled |
|
|
|
placeholder="请选择检验模板编码" |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
type="info" |
|
|
|
plain |
|
|
|
style="width: 40px" |
|
|
|
@click="opensearchTable('programmeTemplateCode', null,'检验类型',SamplingProcess.allSchemas,SamplingProcessApigetSamplingProcessPage,null,false,null,item)" |
|
|
|
><Icon icon="ep:search"/> |
|
|
|
</el-button> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="拆分规则" prop="splitRule"> |
|
|
|
<el-select v-model="data.splitRule" placeholder="请选择拆分规则" > |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions( DICT_TYPE.SPLIT_RULES )" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="aql" prop="aql"> |
|
|
|
<el-select v-model="data.aql" placeholder="请选择aql" > |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions( DICT_TYPE.BASIC_AQL )" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="检验水平" prop="inspectionLevel"> |
|
|
|
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平" > |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.INSPECTION_LEVEL )" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="生效时间" prop="effectiveDate"> |
|
|
|
<el-date-picker |
|
|
|
v-model="data.effectiveDate" |
|
|
|
type="datetime" |
|
|
|
placeholder="请选择生效时间" |
|
|
|
style="width:100%" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="失效时间" prop="expirationDate"> |
|
|
|
<el-date-picker |
|
|
|
v-model="data.expirationDate" |
|
|
|
type="datetime" |
|
|
|
placeholder="请选择失效时间" |
|
|
|
style="width:100%" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="是否可用" prop="available"> |
|
|
|
<el-switch v-model="data.available" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-tabs |
|
|
@ -43,13 +139,6 @@ |
|
|
|
:name="item.name" |
|
|
|
> |
|
|
|
<div class="small-title">检验工序</div> |
|
|
|
<!-- <Form |
|
|
|
:ref="`formRefProcess`+index" |
|
|
|
:schema="formAllSchemasProcess" |
|
|
|
:is-col="true" |
|
|
|
labelWidth="150px" |
|
|
|
:rules="rules" |
|
|
|
/> --> |
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
@ -483,6 +572,7 @@ const data = ref({ |
|
|
|
code: '', |
|
|
|
description: '', |
|
|
|
version: '', |
|
|
|
available:true, |
|
|
|
process: [] |
|
|
|
}) |
|
|
|
const isYesList = [ |
|
|
@ -576,10 +666,28 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
formType.value = type |
|
|
|
if (row) { |
|
|
|
data.value = row |
|
|
|
|
|
|
|
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) |
|
|
|
list.forEach((item, index) => { |
|
|
|
editableTabsValue.value = index + 1 |
|
|
|
item.name = index + 1 |
|
|
|
// 编辑判断上限下限目标值是否必填 |
|
|
|
if(item.quantifyIsCapping){ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true |
|
|
|
}else{ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false |
|
|
|
} |
|
|
|
if(item.quantifyIsLowlimit){ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true |
|
|
|
}else{ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false |
|
|
|
} |
|
|
|
if(item.quantifyIsTarget){ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true |
|
|
|
}else{ |
|
|
|
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
data.value.process = list |
|
|
|
} else { |
|
|
@ -587,6 +695,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
code: '', |
|
|
|
description: '', |
|
|
|
version: '', |
|
|
|
available:true, |
|
|
|
process: [] |
|
|
|
} |
|
|
|
} |
|
|
@ -645,6 +754,7 @@ const buttonBaseClick1 = (val) => { |
|
|
|
featureType: '', |
|
|
|
quantifyIsCapping: '', |
|
|
|
quantifyIsLowlimit: '', |
|
|
|
quantifyIsTarget: '', |
|
|
|
quantifyTarget: '', |
|
|
|
quantifyCapping: '', |
|
|
|
quantifyLowlimit: '', |
|
|
@ -691,6 +801,7 @@ const validateForm = (formRef) => { |
|
|
|
return false |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const submitForm = async () => { |
|
|
|
try { |
|
|
|
const validateForm1 = await validateForm(formProcessRef.value) |
|
|
@ -706,6 +817,13 @@ const submitForm = async () => { |
|
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
|
return; |
|
|
|
} |
|
|
|
const arr = data.value.process.filter(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0)) |
|
|
|
console.log(arr) |
|
|
|
if(arr&&arr.length>0){ |
|
|
|
const str = arr.map(item=>item.description).join(',') |
|
|
|
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`) |
|
|
|
return; |
|
|
|
} |
|
|
|
if (formType.value == 'create') { |
|
|
|
// 主子表——提交请求 |
|
|
|
emit('submitForm', formType.value, data) |
|
|
@ -730,6 +848,11 @@ if (props.footButttondata) { |
|
|
|
// 选择特征类型 |
|
|
|
const changeFeatureType = (e) => { |
|
|
|
console.log(e) |
|
|
|
// if (e) { |
|
|
|
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true |
|
|
|
// } else { |
|
|
|
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false |
|
|
|
// } |
|
|
|
} |
|
|
|
const searchTableRef = ref() |
|
|
|
const opensearchTable = ( |
|
|
|