|
@ -58,9 +58,9 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="检验方案模板编码"> |
|
|
<el-form-item label="检验特性编号"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="item.inspectionCode" |
|
|
v-model="item.inspectionFeatureCode" |
|
|
placeholder="根据系统生成" |
|
|
placeholder="根据系统生成" |
|
|
:disabled="true" |
|
|
:disabled="true" |
|
|
/> |
|
|
/> |
|
@ -76,7 +76,7 @@ |
|
|
<el-input v-model="item.sequenceCode" :disabled="true" /> |
|
|
<el-input v-model="item.sequenceCode" :disabled="true" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<!-- <el-col :span="12"> |
|
|
<el-form-item label="检验特性编码"> |
|
|
<el-form-item label="检验特性编码"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="item.inspectionCharCode" |
|
|
v-model="item.inspectionCharCode" |
|
@ -84,7 +84,7 @@ |
|
|
:disabled="true" |
|
|
:disabled="true" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> --> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div class="small-title">检验特性</div> |
|
|
<div class="small-title">检验特性</div> |
|
@ -235,6 +235,23 @@ |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<!-- 手动评估的时候显示 --> |
|
|
|
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> |
|
|
|
|
|
<el-form-item label="评估代码" required> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode" |
|
|
|
|
|
placeholder="请选择评估代码" |
|
|
|
|
|
@change="changeFeatureType" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
<el-col |
|
|
<el-col |
|
|
:span="24" |
|
|
:span="24" |
|
|
style=" |
|
|
style=" |
|
@ -268,23 +285,7 @@ |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<!-- 手动评估的时候显示 --> |
|
|
|
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> |
|
|
|
|
|
<el-form-item label="评估代码" required> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="cur.estimateCode" |
|
|
|
|
|
placeholder="请选择评估代码" |
|
|
|
|
|
@change="changeFeatureType" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col |
|
|
<el-col |
|
|
:span="12" |
|
|
:span="12" |
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0" |
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0" |
|
@ -312,7 +313,7 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1" > |
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1" > |
|
|
<el-form-item label="缺陷级别" required> |
|
|
<el-form-item label="缺陷级别" required> |
|
|
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> |
|
|
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> |
|
|
<el-option |
|
|
<el-option |
|
@ -511,13 +512,16 @@ const rules = ref({ |
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' } |
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [ |
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [ |
|
|
{ required: true, message: '请输入选择集编码', trigger: 'change' } |
|
|
{ required: true, message: '请选择集编码', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ |
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ |
|
|
{ required: true, message: '请输入选择开始时间', trigger: 'change' } |
|
|
{ required: true, message: '请选择开始时间', trigger: 'change' } |
|
|
], |
|
|
], |
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ |
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ |
|
|
{ required: true, message: '请输入选择结束时间', trigger: 'blur' } |
|
|
{ required: true, message: '请选择结束时间', trigger: 'blur' } |
|
|
|
|
|
], |
|
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.estimateCode': [ |
|
|
|
|
|
{ required: true, message: '请选择评估代码', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
}) |
|
|
}) |
|
@ -549,7 +553,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
inspectionValue: '', //检验值 |
|
|
inspectionValue: '', //检验值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
estimateCode: '', //评估代码 |
|
|
|
|
|
defectLevel: '', //缺陷级别 |
|
|
defectLevel: '', //缺陷级别 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
@ -561,7 +564,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
inspectionValue: '', //检验值 |
|
|
inspectionValue: '', //检验值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
estimateCode: '', //评估代码 |
|
|
|
|
|
defectLevel: '', //缺陷级别 |
|
|
defectLevel: '', //缺陷级别 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
@ -584,6 +586,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
} else { |
|
|
} else { |
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false |
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false |
|
|
} |
|
|
} |
|
|
|
|
|
if (item.samplingProcessRespVO.evaluationMode == 1) { |
|
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true |
|
|
|
|
|
} else { |
|
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
data.value.subList = list |
|
|
data.value.subList = list |
|
|
|
|
|
|
|
@ -718,24 +725,30 @@ const submitForm = async () => { |
|
|
const valid = await elForm.validate() |
|
|
const valid = await elForm.validate() |
|
|
if (!valid) return |
|
|
if (!valid) return |
|
|
// 校验包装列表 |
|
|
// 校验包装列表 |
|
|
|
|
|
|
|
|
|
|
|
console.log(11,data.value.packageList) |
|
|
|
|
|
if(data.value.packageList?.length>0){ |
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
if (!validateForm1) return |
|
|
if (!validateForm1) return |
|
|
let number = 0 |
|
|
let number = 0 |
|
|
data.value.packageList.forEach(cur=>{ |
|
|
data.value.packageList.forEach(cur=>{ |
|
|
number += parseFloat(cur.sampleAmount) |
|
|
number += parseFloat(cur.sampleAmount) |
|
|
}) |
|
|
}) |
|
|
if(number > data.value.sampleTotalAmount){ |
|
|
if(number != data.value.sampleTotalAmount){ |
|
|
message.error(`采样数量之和不可以大于总数量`) |
|
|
message.error(`采样数量之和不等于总数量`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
if (!bol2) { |
|
|
if (!bol2) { |
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
// 判断附加费用数组是否有未填的选项 |
|
|
// 判断数组是否有未填的选项 |
|
|
let arrBol = [] |
|
|
let arrBol = [] |
|
|
let isOutweigh = []//结束时间是否大于开始时间 |
|
|
let isOutweigh = []//结束时间是否大于开始时间 |
|
|
|
|
|
let numberList = []//判断合格数量和不合格数量之和是否等于主表数量 |
|
|
data.value.subList.forEach((item, index) => { |
|
|
data.value.subList.forEach((item, index) => { |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
arrBol.push( |
|
|
arrBol.push( |
|
@ -746,15 +759,15 @@ const submitForm = async () => { |
|
|
) |
|
|
) |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
if (item.samplingProcessRespVO.evaluationMode == 1) { |
|
|
// if (item.samplingProcessRespVO.evaluationMode == 1) { |
|
|
arrBol.push( |
|
|
// arrBol.push( |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
// item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
(cur, key) => { |
|
|
// (cur, key) => { |
|
|
return !cur.estimateCode || !cur.defectLevel |
|
|
// return !cur.estimateCode |
|
|
} |
|
|
// } |
|
|
) |
|
|
// ) |
|
|
) |
|
|
// ) |
|
|
} |
|
|
// } |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { |
|
|
arrBol.push( |
|
|
arrBol.push( |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
@ -777,16 +790,32 @@ const submitForm = async () => { |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) |
|
|
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) |
|
|
} |
|
|
} |
|
|
|
|
|
// 合格数量和不合格数量之和不等于总数量 |
|
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
|
|
|
numberList.push( |
|
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
|
|
(cur, key) => { |
|
|
|
|
|
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
let isEmpty1 = arrBol.some(item=>item == true) |
|
|
let isEmpty1 = arrBol.some(item=>item == true) |
|
|
|
|
|
let isEmptyNumberList = numberList.some(item=>item == true) |
|
|
if(isEmpty1){ |
|
|
if(isEmpty1){ |
|
|
message.error('检验工序和检验特性有字段未填写完全') |
|
|
message.error('检验工序和检验特性有字段未填写完全') |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if(isOutweigh.length>0){ |
|
|
if(isOutweigh?.length>0){ |
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
console.log(44,numberList) |
|
|
|
|
|
if(isEmptyNumberList){ |
|
|
|
|
|
message.error('合格数量和不合格数量之和不等于总数量') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
if (formType.value == 'create') { |
|
|
if (formType.value == 'create') { |
|
|
// 主子表——提交请求 |
|
|
// 主子表——提交请求 |
|
|
emit('submitForm', formType.value, data.value) |
|
|
emit('submitForm', formType.value, data.value) |
|
@ -951,7 +980,6 @@ const resultEntryMethodChange = (e, item) => { |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
inspectionValue: '', //检验值 |
|
|
inspectionValue: '', //检验值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
estimateCode: '', //评估代码 |
|
|
|
|
|
defectLevel: '', //缺陷级别 |
|
|
defectLevel: '', //缺陷级别 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
@ -963,7 +991,6 @@ const resultEntryMethodChange = (e, item) => { |
|
|
{ |
|
|
{ |
|
|
inspectionValue: '', //检验值 |
|
|
inspectionValue: '', //检验值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
qualitativeCode: '', //定性字典项值 |
|
|
estimateCode: '', //评估代码 |
|
|
|
|
|
defectLevel: '', //缺陷级别 |
|
|
defectLevel: '', //缺陷级别 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
qualifiedQuantity: '', //合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|