|
|
@ -27,7 +27,7 @@ |
|
|
|
:stretch="false" |
|
|
|
> |
|
|
|
<el-tab-pane |
|
|
|
v-for="(item,index) in data.subList" |
|
|
|
v-for="item in data.subList" |
|
|
|
:key="item.name" |
|
|
|
:label="item.processCode" |
|
|
|
:name="item.name" |
|
|
@ -37,7 +37,11 @@ |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="编码" prop="processCode"> |
|
|
|
<el-input v-model="item.processCode" placeholder="根据系统生成" :disabled="true" /> |
|
|
|
<el-input |
|
|
|
v-model="item.processCode" |
|
|
|
placeholder="根据系统生成" |
|
|
|
:disabled="true" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -83,8 +87,14 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="描述" prop="inspectionJobCharacteristicsUpdateReqVO.description"> |
|
|
|
<el-input v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" :disabled="true" /> |
|
|
|
<el-form-item |
|
|
|
label="描述" |
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.description" |
|
|
|
> |
|
|
|
<el-input |
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.description" |
|
|
|
:disabled="true" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -163,14 +173,20 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="特征类型" prop="inspectionJobCharacteristicsUpdateReqVO.featureType"> |
|
|
|
<el-form-item |
|
|
|
label="特征类型" |
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.featureType" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.featureType" |
|
|
|
placeholder="请选择特征类型" |
|
|
|
@change="changeFeatureType" |
|
|
|
disabled |
|
|
|
> |
|
|
|
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )" |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions( |
|
|
|
DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE |
|
|
|
)" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
@ -179,7 +195,10 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="开始时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"> |
|
|
|
<el-form-item |
|
|
|
label="开始时间" |
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime" |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime" |
|
|
|
type="datetime" |
|
|
@ -190,7 +209,10 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="结束时间" prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"> |
|
|
|
<el-form-item |
|
|
|
label="结束时间" |
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime" |
|
|
|
type="datetime" |
|
|
@ -200,17 +222,37 @@ |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="border: 1px solid #dedede ;border-radius: 4px ;padding-top: 16px;margin-bottom: 10px" v-for="(cur,i) in data.subList[index].inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList" :key="i"> |
|
|
|
<el-col |
|
|
|
:span="24" |
|
|
|
style=" |
|
|
|
border: 1px solid #dedede; |
|
|
|
border-radius: 4px; |
|
|
|
padding-top: 16px; |
|
|
|
margin-bottom: 10px; |
|
|
|
" |
|
|
|
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO |
|
|
|
.recordInspectionQuantifyList" |
|
|
|
:key="i" |
|
|
|
> |
|
|
|
<el-row> |
|
|
|
<!-- 汇总录入的时候显示 --> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> |
|
|
|
<el-col |
|
|
|
:span="12" |
|
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1" |
|
|
|
> |
|
|
|
<el-form-item label="合格数量"> |
|
|
|
<el-input v-model="cur.qualifiedQuantity" placeholder="请输入合格数量" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"> |
|
|
|
<el-col |
|
|
|
:span="12" |
|
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1" |
|
|
|
> |
|
|
|
<el-form-item label="不合格数量"> |
|
|
|
<el-input v-model="cur.unqualifiedQuantity" placeholder="请输入不合格数量"/> |
|
|
|
<el-input |
|
|
|
v-model="cur.unqualifiedQuantity" |
|
|
|
placeholder="请输入不合格数量" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<!-- 手动评估的时候显示 --> |
|
|
@ -219,43 +261,54 @@ |
|
|
|
<el-select |
|
|
|
v-model="cur.estimateCode" |
|
|
|
placeholder="请选择评估代码" |
|
|
|
@change="changeFeatureType"> |
|
|
|
<el-option v-for="dict in getStrDictOptions( DICT_TYPE.EVALUATION_CODE )" |
|
|
|
@change="changeFeatureType" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value"/> |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"> |
|
|
|
<el-col |
|
|
|
:span="12" |
|
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0" |
|
|
|
> |
|
|
|
<el-form-item label="检验值" prop="inspectionValue"> |
|
|
|
<el-input v-model="cur.inspectionValue" placeholder="请输入检验值" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1"> |
|
|
|
<el-col |
|
|
|
:span="12" |
|
|
|
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1" |
|
|
|
> |
|
|
|
<el-form-item label="选定集" prop="qualitativeCode"> |
|
|
|
<el-select |
|
|
|
v-model="cur.qualitativeCode" |
|
|
|
placeholder="请选择选定集" |
|
|
|
@change="changeQualitativeCode($event,item,cur)"> |
|
|
|
<el-option v-for="dict in item.selectedProjectRespVOList" |
|
|
|
@change="changeQualitativeCode($event, item, cur)" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="dict in item.selectedProjectRespVOList" |
|
|
|
:key="dict.dictionaryValue" |
|
|
|
:label="dict.dictionaryLabel" |
|
|
|
:value="dict.dictionaryValue"/> |
|
|
|
:value="dict.dictionaryValue" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1"> |
|
|
|
<el-form-item label="缺陷级别"> |
|
|
|
<el-select |
|
|
|
v-model="cur.defectLevel" |
|
|
|
placeholder="请选择缺陷级别" |
|
|
|
disabled> |
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" |
|
|
|
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> |
|
|
|
<el-option |
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.DEFECT_LEVEL)" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value"/> |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -313,7 +366,6 @@ import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule |
|
|
|
import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集 |
|
|
|
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集 |
|
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
@ -359,7 +411,7 @@ const props = defineProps({ |
|
|
|
type: Object, |
|
|
|
required: true, |
|
|
|
default: null |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
@ -442,17 +494,12 @@ const rules = ref({ |
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ |
|
|
|
{ required: true, message: '请输入选择结束时间', trigger: 'blur' } |
|
|
|
], |
|
|
|
qualifiedQuantity: [ |
|
|
|
{ required: true, message: '请输入选择结束时间', trigger: 'blur' } |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] |
|
|
|
}) |
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
|
let tabIndex = 1 |
|
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
|
|
dialogVisible.value = true |
|
|
|
if (titleName) { |
|
|
|
dialogTitle.value = t('action.' + titleName) |
|
|
|
} else { |
|
|
@ -468,30 +515,32 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
editableTabsValue.value = index + 1 |
|
|
|
item.name = index + 1 |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[] |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true |
|
|
|
for(let i=0;i<data.value.sampleTotalAmount;i++){ |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] |
|
|
|
for (let i = 0; i < parseInt(data.value.sampleTotalAmount); i++) { |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
|
inspectionValue: '', //检验值 |
|
|
|
qualitativeCode: '', //定性字典项值 |
|
|
|
estimateCode: '', //评估代码 |
|
|
|
defectLevel: '', //缺陷级别 |
|
|
|
qualifiedQuantity: '', //合格数量 |
|
|
|
unqualifiedQuantity:'',//不合格数量 |
|
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{ |
|
|
|
inspectionValue:'',//检验值 |
|
|
|
qualitativeCode:'',//定性字典项值 |
|
|
|
estimateCode:'',//评估代码 |
|
|
|
defectLevel:'',//缺陷级别 |
|
|
|
qualifiedQuantity:'',//合格数量 |
|
|
|
unqualifiedQuantity:'',//不合格数量 |
|
|
|
}] |
|
|
|
// item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ |
|
|
|
// inspectionValue: '', //检验值 |
|
|
|
// qualitativeCode: '', //定性字典项值 |
|
|
|
// estimateCode: '', //评估代码 |
|
|
|
// defectLevel: '', //缺陷级别 |
|
|
|
// qualifiedQuantity: '', //合格数量 |
|
|
|
// unqualifiedQuantity: '' //不合格数量 |
|
|
|
// } |
|
|
|
// ) |
|
|
|
} |
|
|
|
// 编辑判断上限下限目标值是否必填 |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { |
|
|
@ -511,7 +560,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
} |
|
|
|
}) |
|
|
|
data.value.subList = list |
|
|
|
|
|
|
|
dialogVisible.value = true |
|
|
|
nextTick(() => { |
|
|
|
formMainRef.value.setValues(row) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
data.value = { |
|
|
|
code: '', |
|
|
@ -528,7 +581,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any |
|
|
|
subList: [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
dialogVisible.value = true |
|
|
|
tabIndex = data.value.subList.length + 1 |
|
|
|
} |
|
|
|
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 |
|
|
@ -633,7 +686,6 @@ const validateForm = (formRef) => { |
|
|
|
|
|
|
|
const submitForm = async () => { |
|
|
|
try { |
|
|
|
|
|
|
|
console.log(data.value.subList) |
|
|
|
// const validateForm1 = await validateForm(formMainRef.value) |
|
|
|
const elForm = unref(formMainRef)?.getElFormRef() |
|
|
@ -648,39 +700,60 @@ const submitForm = async () => { |
|
|
|
return |
|
|
|
} |
|
|
|
// 判断附加费用数组是否有未填的选项 |
|
|
|
let arrBol = data.value.subList.map((item, index) => { |
|
|
|
let arr1 = [] |
|
|
|
let arrBol = [] |
|
|
|
let isOutweigh = []//结束时间是否大于开始时间 |
|
|
|
data.value.subList.forEach((item, index) => { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { |
|
|
|
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.qualifiedQuantity || !cur.unqualifiedQuantity |
|
|
|
})) |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
if (item.samplingProcessRespVO.evaluationMode == 1) { |
|
|
|
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.estimateCode || !cur.defectLevel |
|
|
|
})) |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { |
|
|
|
arr1.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.inspectionValue |
|
|
|
})) |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { |
|
|
|
arr1.push(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ |
|
|
|
arrBol.push( |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( |
|
|
|
(cur, key) => { |
|
|
|
return !cur.qualitativeCode |
|
|
|
})) |
|
|
|
} |
|
|
|
return arr1 |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
// 开始时间大于结束时间放入数组中 |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { |
|
|
|
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) |
|
|
|
} |
|
|
|
}) |
|
|
|
// console.log(arrBol) |
|
|
|
// let isEmpty1 = arrBol.filter(item=>item == true) |
|
|
|
// arrBol.forEach(item=>{ |
|
|
|
// console.log('1q1q') |
|
|
|
// console.log(typeof item) |
|
|
|
// }) |
|
|
|
// setTimeout(()=>{ |
|
|
|
// console.log(arrBol.includes(true)) |
|
|
|
// },2000) |
|
|
|
let isEmpty1 = arrBol.some(item=>item == true) |
|
|
|
if(isEmpty1){ |
|
|
|
message.error('检验工序和检验特性有字段未填写完全') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(isOutweigh.length>0){ |
|
|
|
message.error('检验特性中有开始时间大于结束时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
return; |
|
|
|
if (formType.value == 'create') { |
|
|
|
// 主子表——提交请求 |
|
|
|
emit('submitForm', formType.value, data.value) |
|
|
@ -821,7 +894,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { |
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true |
|
|
|
} else { |
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false |
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = |
|
|
|
false |
|
|
|
} |
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { |
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true |
|
|
@ -847,25 +921,27 @@ const resultEntryMethodChange = (e,item) => { |
|
|
|
estimateCode: '', //评估代码 |
|
|
|
defectLevel: '', //缺陷级别 |
|
|
|
qualifiedQuantity: '', //合格数量 |
|
|
|
unqualifiedQuantity:'',//不合格数量 |
|
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList=[{ |
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [ |
|
|
|
{ |
|
|
|
inspectionValue: '', //检验值 |
|
|
|
qualitativeCode: '', //定性字典项值 |
|
|
|
estimateCode: '', //评估代码 |
|
|
|
defectLevel: '', //缺陷级别 |
|
|
|
qualifiedQuantity: '', //合格数量 |
|
|
|
unqualifiedQuantity:'',//不合格数量 |
|
|
|
}] |
|
|
|
unqualifiedQuantity: '' //不合格数量 |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
console.log(222, item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList) |
|
|
|
} |
|
|
|
// 选择选定级 |
|
|
|
const changeQualitativeCode = (e, item, cur) => { |
|
|
|
let obj = item.selectedProjectRespVOList.find(cur=>cur.dictionaryValue==e) |
|
|
|
let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e) |
|
|
|
console.log(obj) |
|
|
|
cur.defectLevel = obj.defectLevel |
|
|
|
} |
|
|
|