|
|
@ -312,7 +312,7 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</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-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> |
|
|
|
<el-option |
|
|
@ -718,24 +718,30 @@ const submitForm = async () => { |
|
|
|
const valid = await elForm.validate() |
|
|
|
if (!valid) return |
|
|
|
// 校验包装列表 |
|
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
|
|
|
|
|
console.log(11,data.value.packageList) |
|
|
|
if(data.value.packageList?.length>0){ |
|
|
|
const validateForm1 = await tableFormRef.value.validateForm() |
|
|
|
if (!validateForm1) return |
|
|
|
let number = 0 |
|
|
|
data.value.packageList.forEach(cur=>{ |
|
|
|
number += parseFloat(cur.sampleAmount) |
|
|
|
}) |
|
|
|
if(number > data.value.sampleTotalAmount){ |
|
|
|
message.error(`采样数量之和不可以大于总数量`) |
|
|
|
return |
|
|
|
let number = 0 |
|
|
|
data.value.packageList.forEach(cur=>{ |
|
|
|
number += parseFloat(cur.sampleAmount) |
|
|
|
}) |
|
|
|
if(number != data.value.sampleTotalAmount){ |
|
|
|
message.error(`采样数量之和不等于总数量`) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
|
if (!bol2) { |
|
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
|
return |
|
|
|
} |
|
|
|
// 判断附加费用数组是否有未填的选项 |
|
|
|
// 判断数组是否有未填的选项 |
|
|
|
let arrBol = [] |
|
|
|
let isOutweigh = []//结束时间是否大于开始时间 |
|
|
|
let numberList = []//判断合格数量和不合格数量之和是否等于主表数量 |
|
|
|
data.value.subList.forEach((item, index) => { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
|
arrBol.push( |
|
|
@ -750,7 +756,7 @@ const submitForm = async () => { |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.estimateCode || !cur.defectLevel |
|
|
|
return !cur.estimateCode |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
@ -777,16 +783,32 @@ const submitForm = async () => { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
|
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 isEmptyNumberList = numberList.some(item=>item == true) |
|
|
|
if(isEmpty1){ |
|
|
|
message.error('检验工序和检验特性有字段未填写完全') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(isOutweigh.length>0){ |
|
|
|
if(isOutweigh?.length>0){ |
|
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
console.log(44,numberList) |
|
|
|
if(isEmptyNumberList){ |
|
|
|
message.error('合格数量和不合格数量之和不等于总数量') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (formType.value == 'create') { |
|
|
|
// 主子表——提交请求 |
|
|
|
emit('submitForm', formType.value, data.value) |
|
|
|