|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<Dialog
|
|
|
|
:title="dialogTitle"
|
|
|
|
v-model="dialogVisible"
|
|
|
|
:width="dialogWidth"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:vLoading="formLoading"
|
|
|
|
>
|
|
|
|
<div style="max-height: 80vh; overflow-y: auto; padding: 0px 20px">
|
|
|
|
<!-- <el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef">
|
|
|
|
|
|
|
|
</el-form> -->
|
|
|
|
<Form
|
|
|
|
ref="formMainRef"
|
|
|
|
:rules="rules"
|
|
|
|
:schema="formSchema"
|
|
|
|
:is-col="true"
|
|
|
|
@opensearchTable="opensearchTable"
|
|
|
|
/>
|
|
|
|
<el-tabs
|
|
|
|
v-model="editableTabsValue"
|
|
|
|
class="demo-tabs"
|
|
|
|
@edit="handleTabsEdit"
|
|
|
|
type="border-card"
|
|
|
|
tab-position="left"
|
|
|
|
:stretch="false"
|
|
|
|
>
|
|
|
|
<el-tab-pane
|
|
|
|
v-for="item in data.subList"
|
|
|
|
:key="item.name"
|
|
|
|
:label="item.processCode"
|
|
|
|
:name="item.name"
|
|
|
|
>
|
|
|
|
<div class="small-title">检验工序</div>
|
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="编码" prop="processCode">
|
|
|
|
<el-input
|
|
|
|
v-model="item.processCode"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="检验方案模板编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCode"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="描述" prop="processDescribe">
|
|
|
|
<el-input v-model="item.processDescribe" :disabled="true" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="顺序号" prop="sequenceCode">
|
|
|
|
<el-input v-model="item.sequenceCode" :disabled="true" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="检验特性编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionCharCode"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
<div class="small-title">检验特性</div>
|
|
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="编码">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.number"
|
|
|
|
placeholder="根据系统生成"
|
|
|
|
:disabled="true"
|
|
|
|
/>
|
|
|
|
</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>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="检验方法"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择检验方法"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="采样过程编码"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionMethod"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择采样过程编码"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="动态修改规则编码"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode"
|
|
|
|
>
|
|
|
|
<div style="display: flex; width: 100%">
|
|
|
|
<el-input
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName"
|
|
|
|
disabled
|
|
|
|
placeholder="请选择动态修改规则编码"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col> -->
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="是否允许修改特征值"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
|
|
|
|
>
|
|
|
|
<el-switch
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.isCanUpdate"
|
|
|
|
disabled
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="结果录入方式"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
|
|
|
|
>
|
|
|
|
<el-select
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod"
|
|
|
|
placeholder="请选择结果录入方式"
|
|
|
|
@change="resultEntryMethodChange($event, item)"
|
|
|
|
disabled
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="dict in getStrDictOptions(
|
|
|
|
DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY
|
|
|
|
)"
|
|
|
|
: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="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
|
|
|
|
)"
|
|
|
|
: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="inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
|
|
|
|
>
|
|
|
|
<el-date-picker
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime"
|
|
|
|
type="datetime"
|
|
|
|
placeholder="请选择开始时间"
|
|
|
|
style="width: 100%"
|
|
|
|
value-format="x"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item
|
|
|
|
label="结束时间"
|
|
|
|
prop="inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
|
|
|
|
>
|
|
|
|
<el-date-picker
|
|
|
|
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime"
|
|
|
|
type="datetime"
|
|
|
|
placeholder="请选择结束时间"
|
|
|
|
style="width: 100%"
|
|
|
|
value-format="x"
|
|
|
|
/>
|
|
|
|
</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 item.inspectionJobCharacteristicsUpdateReqVO
|
|
|
|
.recordInspectionQuantifyList"
|
|
|
|
:key="i"
|
|
|
|
>
|
|
|
|
<el-row>
|
|
|
|
<!-- 汇总录入的时候显示 -->
|
|
|
|
<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-form-item label="不合格数量">
|
|
|
|
<el-input
|
|
|
|
v-model="cur.unqualifiedQuantity"
|
|
|
|
placeholder="请输入不合格数量"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
<!-- 手动评估的时候显示 -->
|
|
|
|
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
|
|
|
|
<el-form-item label="评估代码">
|
|
|
|
<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
|
|
|
|
: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-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"
|
|
|
|
:key="dict.dictionaryValue"
|
|
|
|
:label="dict.dictionaryLabel"
|
|
|
|
: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)"
|
|
|
|
:key="dict.value"
|
|
|
|
:label="dict.label"
|
|
|
|
:value="dict.value"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
|
|
|
</div>
|
|
|
|
<template #footer>
|
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" />
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
<Dialog
|
|
|
|
title="修改名称"
|
|
|
|
v-model="dialogVisibleName"
|
|
|
|
width="500px"
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
>
|
|
|
|
<div style="padding: 0px 20px">
|
|
|
|
<el-form ref="nameRef" :model="nameForm">
|
|
|
|
<el-form-item
|
|
|
|
:rules="[{ required: true, message: '请输入名称', trigger: 'blur' }]"
|
|
|
|
prop="name"
|
|
|
|
>
|
|
|
|
<el-input v-model="nameForm.name" style="width: 240px" placeholder="请输入名称" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
<template #footer>
|
|
|
|
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick1" />
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons'
|
|
|
|
import { getCurrentInstance } from 'vue'
|
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
|
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
|
|
|
|
import { SearchTable } from '@/components/SearchTable'
|
|
|
|
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data'
|
|
|
|
// import { InspectionTemplateMain } from '@/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data'
|
|
|
|
// import * as InspectionTemplateApi from '@/api/qms/inspectionTemplate'
|
|
|
|
// import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
|
|
|
|
// import * as ItemBasicApi from '@/api/wms/itembasic'
|
|
|
|
import * as SamplingProcessApi from '@/api/qms/samplingProcess' //采样过程
|
|
|
|
import * as InspectionMethodApi from '@/api/qms/inspectionMethod' //检验方法
|
|
|
|
import { InspectionMethod } from '@/views/qms/inspectionMethod/inspectionMethod.data' //检验方法
|
|
|
|
import * as DynamicRuleApi from '@/api/qms/dynamicRule' //动态修改规则
|
|
|
|
import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule.data' //动态修改规则
|
|
|
|
import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集
|
|
|
|
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
// 显示窗口宽度设置
|
|
|
|
basicFormWidth: {
|
|
|
|
type: String,
|
|
|
|
default: ''
|
|
|
|
},
|
|
|
|
// 检验特性表单,列表 相关信息
|
|
|
|
formAllSchemasFeatures: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
// 检验工序表单,列表 相关信息
|
|
|
|
formAllSchemasProcess: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
// 检验模板表单,列表 相关信息
|
|
|
|
formAllSchemasMain: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
// 底部按钮集合
|
|
|
|
footButttondata: {
|
|
|
|
type: Array,
|
|
|
|
required: false,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
// 表单,列表 相关信息
|
|
|
|
formAllSchemas: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
default: null
|
|
|
|
},
|
|
|
|
// 校验rules
|
|
|
|
rules: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
default: null
|
|
|
|
}
|
|
|
|
})
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
|
|
|
const dialogWidth = ref()
|
|
|
|
const formMainRef = ref()
|
|
|
|
const formFeaturesRef = ref()
|
|
|
|
const formProcessRef = ref()
|
|
|
|
const formSchema = ref(props.formAllSchemas?.formSchema)
|
|
|
|
|
|
|
|
const data = ref({
|
|
|
|
code: '',
|
|
|
|
itemCode: '',
|
|
|
|
version: '',
|
|
|
|
testTypeCode: '',
|
|
|
|
programmeTemplateCode: '',
|
|
|
|
splitRule: '',
|
|
|
|
aql: '',
|
|
|
|
inspectionLevel: '',
|
|
|
|
effectiveDate: '',
|
|
|
|
expirationDate: '',
|
|
|
|
available: 'TRUE',
|
|
|
|
subList: []
|
|
|
|
})
|
|
|
|
|
|
|
|
const dialogVisibleName = ref(false)
|
|
|
|
const nameForm = ref({
|
|
|
|
name: ''
|
|
|
|
})
|
|
|
|
const nameRef = ref()
|
|
|
|
if (props.basicFormWidth) {
|
|
|
|
dialogWidth.value = props.basicFormWidth + '%'
|
|
|
|
} else {
|
|
|
|
dialogWidth.value = props.isBusiness ? '60%' : '40%'
|
|
|
|
}
|
|
|
|
const rules = ref({
|
|
|
|
...props.rules,
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.description': [
|
|
|
|
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [
|
|
|
|
{ required: true, message: '请选择检验方法编码', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [
|
|
|
|
{ required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [
|
|
|
|
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [
|
|
|
|
{ required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.featureType': [
|
|
|
|
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [
|
|
|
|
{ required: true, message: '请输入目标值', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [
|
|
|
|
{ required: true, message: '请输入上限值', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [
|
|
|
|
{ required: true, message: '请输入下限值', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [
|
|
|
|
{ required: true, message: '请选择计量单位', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [
|
|
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
|
|
|
|
{ required: true, message: '请输入选择集编码', trigger: 'change' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
|
|
|
|
{ required: true, message: '请输入选择开始时间', trigger: 'change' }
|
|
|
|
],
|
|
|
|
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
|
|
|
|
{ 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) => {
|
|
|
|
if (titleName) {
|
|
|
|
dialogTitle.value = t('action.' + titleName)
|
|
|
|
} else {
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
}
|
|
|
|
formType.value = type
|
|
|
|
if (row) {
|
|
|
|
data.value = JSON.parse(JSON.stringify(row))
|
|
|
|
console.log(data.value)
|
|
|
|
let list = []
|
|
|
|
list = await InspectionJobDetailPageApi.getInspectionJobDetailList(row.id)
|
|
|
|
list.forEach((item, index) => {
|
|
|
|
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.push({
|
|
|
|
inspectionValue: '', //检验值
|
|
|
|
qualitativeCode: '', //定性字典项值
|
|
|
|
estimateCode: '', //评估代码
|
|
|
|
defectLevel: '', //缺陷级别
|
|
|
|
qualifiedQuantity: '', //合格数量
|
|
|
|
unqualifiedQuantity: '' //不合格数量
|
|
|
|
})
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
|
|
|
|
{
|
|
|
|
inspectionValue: '', //检验值
|
|
|
|
qualitativeCode: '', //定性字典项值
|
|
|
|
estimateCode: '', //评估代码
|
|
|
|
defectLevel: '', //缺陷级别
|
|
|
|
qualifiedQuantity: '', //合格数量
|
|
|
|
unqualifiedQuantity: '' //不合格数量
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
// 编辑判断上限下限目标值是否必填
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
data.value.subList = list
|
|
|
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
nextTick(() => {
|
|
|
|
formMainRef.value.setValues(row)
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
data.value = {
|
|
|
|
code: '',
|
|
|
|
itemCode: '',
|
|
|
|
version: '',
|
|
|
|
testTypeCode: '',
|
|
|
|
programmeTemplateCode: '',
|
|
|
|
splitRule: '',
|
|
|
|
aql: '',
|
|
|
|
inspectionLevel: '',
|
|
|
|
effectiveDate: '',
|
|
|
|
expirationDate: '',
|
|
|
|
available: 'TRUE',
|
|
|
|
subList: []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dialogVisible.value = true
|
|
|
|
tabIndex = data.value.subList.length + 1
|
|
|
|
}
|
|
|
|
defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗
|
|
|
|
import type { TabPaneName } from 'element-plus'
|
|
|
|
|
|
|
|
const editableTabsValue = ref('1')
|
|
|
|
// const editableTabs = ref([])
|
|
|
|
|
|
|
|
const handleTabsEdit = (targetName: TabPaneName | undefined, action: 'remove' | 'add') => {
|
|
|
|
if (action === 'add') {
|
|
|
|
nameForm.value.name = ''
|
|
|
|
dialogVisibleName.value = true
|
|
|
|
} else if (action === 'remove') {
|
|
|
|
const tabs = data.value.subList
|
|
|
|
let activeName = editableTabsValue.value
|
|
|
|
if (activeName === targetName) {
|
|
|
|
tabs.forEach((tab, index) => {
|
|
|
|
if (tab.name === targetName) {
|
|
|
|
const nextTab = tabs[index + 1] || tabs[index - 1]
|
|
|
|
if (nextTab) {
|
|
|
|
activeName = nextTab.name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
editableTabsValue.value = activeName
|
|
|
|
data.value.subList = tabs.filter((tab) => tab.name !== targetName)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** 修改名称时间 */
|
|
|
|
const buttonBaseClick1 = (val) => {
|
|
|
|
// 保存
|
|
|
|
if (val == 'save') {
|
|
|
|
if (!nameRef.value) return
|
|
|
|
nameRef.value.validate((valid, fields) => {
|
|
|
|
if (valid) {
|
|
|
|
const newTabName = `${++tabIndex}`
|
|
|
|
data.value.subList.push({
|
|
|
|
description: nameForm.value.name,
|
|
|
|
name: newTabName,
|
|
|
|
inspectionCode: '',
|
|
|
|
sequenceCode: '',
|
|
|
|
inspectionCharCode: '',
|
|
|
|
inspectionJobCharacteristicsUpdateReqVO: {
|
|
|
|
describe: '',
|
|
|
|
inspectionMethodCode: '',
|
|
|
|
dynamicUpdateCode: '',
|
|
|
|
inspectionMethod: '',
|
|
|
|
isCanUpdate: '',
|
|
|
|
isDestructionInspection: '',
|
|
|
|
resultEntryMethod: '',
|
|
|
|
featureType: '',
|
|
|
|
quantifyIsCapping: '',
|
|
|
|
quantifyIsLowlimit: '',
|
|
|
|
quantifyIsTarget: '',
|
|
|
|
quantifyTarget: '',
|
|
|
|
quantifyCapping: '',
|
|
|
|
quantifyLowlimit: '',
|
|
|
|
quantifyUom: '',
|
|
|
|
quantifyDecimal: '',
|
|
|
|
quantifyQuantifyCode: ''
|
|
|
|
}
|
|
|
|
})
|
|
|
|
console.log(data.value.subList)
|
|
|
|
|
|
|
|
editableTabsValue.value = newTabName
|
|
|
|
dialogVisibleName.value = false
|
|
|
|
} else {
|
|
|
|
console.log('error submit!')
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
// 关闭
|
|
|
|
else if (val == 'close') {
|
|
|
|
dialogVisibleName.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const buttonBaseClick = (val) => {
|
|
|
|
// 保存
|
|
|
|
if (val == 'save') {
|
|
|
|
submitForm()
|
|
|
|
}
|
|
|
|
// 关闭
|
|
|
|
else if (val == 'close') {
|
|
|
|
dialogVisible.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 传递给父类
|
|
|
|
const emit = defineEmits(['submitForm', 'searchTableSuccess'])
|
|
|
|
const validateForm = (formRef) => {
|
|
|
|
// console.log(TableBaseForm_Ref.value)
|
|
|
|
let _lists = formRef?.map((v) => v.validate())
|
|
|
|
return Promise.all(_lists)
|
|
|
|
.then(() => {
|
|
|
|
return true
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
return false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
try {
|
|
|
|
console.log(data.value.subList)
|
|
|
|
// const validateForm1 = await validateForm(formMainRef.value)
|
|
|
|
const elForm = unref(formMainRef)?.getElFormRef()
|
|
|
|
// 校验表单
|
|
|
|
if (!elForm) return
|
|
|
|
const valid = await elForm.validate()
|
|
|
|
if (!valid) return
|
|
|
|
// const bol1 = await validateForm(formProcessRef.value)
|
|
|
|
const bol2 = await validateForm(formFeaturesRef.value)
|
|
|
|
if (!bol2) {
|
|
|
|
message.error(`模板中有检验工序和检验特性未填写完全`)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
// 判断附加费用数组是否有未填的选项
|
|
|
|
let arrBol = data.value.subList.map((item, index) => {
|
|
|
|
let arr1 = []
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
|
|
|
|
arr1.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) => {
|
|
|
|
return !cur.estimateCode || !cur.defectLevel
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
|
|
|
|
arr1.push(
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
|
|
|
|
(cur, key) => {
|
|
|
|
return !cur.inspectionValue
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) {
|
|
|
|
arr1.push(
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
|
|
|
|
(cur, key) => {
|
|
|
|
return !cur.qualitativeCode
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
return arr1
|
|
|
|
})
|
|
|
|
// 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)
|
|
|
|
if (formType.value == 'create') {
|
|
|
|
// 主子表——提交请求
|
|
|
|
emit('submitForm', formType.value, data.value)
|
|
|
|
} else {
|
|
|
|
// 编辑/执行
|
|
|
|
emit('submitForm', formType.value, data.value)
|
|
|
|
}
|
|
|
|
} catch {
|
|
|
|
console.log(111)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/** 弹窗按钮 */
|
|
|
|
let Butttondata: any = []
|
|
|
|
if (props.footButttondata) {
|
|
|
|
Butttondata = props.footButttondata
|
|
|
|
} else {
|
|
|
|
Butttondata = [
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭
|
|
|
|
]
|
|
|
|
}
|
|
|
|
// 选择特征类型
|
|
|
|
const changeFeatureType = (e) => {
|
|
|
|
console.log(e)
|
|
|
|
// if (e) {
|
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = true
|
|
|
|
// } else {
|
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode'][0].required = false
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
const searchTableRef = ref()
|
|
|
|
const opensearchTable = (
|
|
|
|
formField,
|
|
|
|
searchField,
|
|
|
|
searchTitle,
|
|
|
|
searchAllSchemas,
|
|
|
|
searchPage,
|
|
|
|
searchCondition,
|
|
|
|
multiple,
|
|
|
|
type,
|
|
|
|
row
|
|
|
|
) => {
|
|
|
|
const _searchCondition = {}
|
|
|
|
// 判断查询条件中,是否存在指向主表的数据
|
|
|
|
if (searchCondition && searchCondition.length > 0) {
|
|
|
|
// 转换筛选条件所需
|
|
|
|
let filters: any[] = []
|
|
|
|
for (var i = 0; i < searchCondition.length; i++) {
|
|
|
|
// searchCondition.forEach((item) => {
|
|
|
|
// 查询条件为主表某字段,需要赋值主表数据,数据来源是详情的,赋值需要从row中获取
|
|
|
|
if (searchCondition[i].isMainValue) {
|
|
|
|
_searchCondition[searchCondition[i].key] = formRef.value.formModel[searchCondition[i].value]
|
|
|
|
? formRef.value.formModel[searchCondition[i].value]
|
|
|
|
: props.detailData
|
|
|
|
? props.detailData[searchCondition[i].value]
|
|
|
|
: row
|
|
|
|
? row[searchCondition[i].value]
|
|
|
|
: ''
|
|
|
|
// 是否含有空参数情况
|
|
|
|
let isNull = false
|
|
|
|
if (
|
|
|
|
_searchCondition[searchCondition[i].key] == '' ||
|
|
|
|
_searchCondition[searchCondition[i].key] == undefined
|
|
|
|
) {
|
|
|
|
isNull = true
|
|
|
|
}
|
|
|
|
if (isNull) {
|
|
|
|
message.warning(
|
|
|
|
searchCondition[i].message ? searchCondition[i].message : '前置条件未选择!'
|
|
|
|
)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// 扩展 转换为筛选条件进行查询
|
|
|
|
if (searchCondition[i].isSearch) {
|
|
|
|
filters.push({
|
|
|
|
action: searchCondition[i].action,
|
|
|
|
column: searchCondition[i].key,
|
|
|
|
value: searchCondition[i].value
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
_searchCondition[searchCondition[i].key] = searchCondition[i].value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (filters.length > 0) {
|
|
|
|
_searchCondition.isSearch = true
|
|
|
|
_searchCondition.filters = filters
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const _searchTableTitle = searchTitle
|
|
|
|
const _searchTableAllSchemas = searchAllSchemas
|
|
|
|
const _searchTablePage = searchPage
|
|
|
|
searchTableRef.value.open(
|
|
|
|
_searchTableTitle,
|
|
|
|
_searchTableAllSchemas,
|
|
|
|
_searchTablePage,
|
|
|
|
formField,
|
|
|
|
searchField,
|
|
|
|
multiple,
|
|
|
|
type,
|
|
|
|
row,
|
|
|
|
_searchCondition
|
|
|
|
)
|
|
|
|
}
|
|
|
|
// 弹层确定返回所选数据
|
|
|
|
// val : 弹层列表row 数据
|
|
|
|
const searchTableSuccess = async (formField, searchField, val, type, row) => {
|
|
|
|
if (type == 'features') {
|
|
|
|
row.inspectionJobCharacteristicsUpdateReqVO[formField] = val[0].code
|
|
|
|
if (formField == 'inspectionMethodCode') {
|
|
|
|
row.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName = val[0].description
|
|
|
|
} else if (formField == 'dynamicUpdateCode') {
|
|
|
|
row.inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateName = val[0].description
|
|
|
|
} else if (formField == 'inspectionMethod') {
|
|
|
|
row.inspectionJobCharacteristicsUpdateReqVO.inspectionName = val[0].description
|
|
|
|
}
|
|
|
|
} else if (type == 'main') {
|
|
|
|
data.value[formField] = val[0].code
|
|
|
|
if (formField == 'itemCode') {
|
|
|
|
data.value.itemName = val[0].name
|
|
|
|
} else if (formField == 'testTypeCode') {
|
|
|
|
data.value.testTypeName = val[0].description
|
|
|
|
} else if (formField == 'programmeTemplateCode') {
|
|
|
|
data.value.programmeTemplateName = val[0].description
|
|
|
|
}
|
|
|
|
if (formField == 'programmeTemplateCode') {
|
|
|
|
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
|
|
|
|
list.forEach((item, index) => {
|
|
|
|
editableTabsValue.value = index + 1
|
|
|
|
item.name = index + 1
|
|
|
|
// 编辑判断上限下限目标值是否必填
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required =
|
|
|
|
false
|
|
|
|
}
|
|
|
|
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
|
|
|
|
} else {
|
|
|
|
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
data.value.subList = list
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
|
|
|
|
}
|
|
|
|
// 请选择结果录入方式
|
|
|
|
const resultEntryMethodChange = (e, item) => {
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
|
|
|
|
if (e == 0) {
|
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
|
|
|
|
for (let i = 0; i < data.value.sampleTotalAmount; i++) {
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
|
|
|
|
inspectionValue: '', //检验值
|
|
|
|
qualitativeCode: '', //定性字典项值
|
|
|
|
estimateCode: '', //评估代码
|
|
|
|
defectLevel: '', //缺陷级别
|
|
|
|
qualifiedQuantity: '', //合格数量
|
|
|
|
unqualifiedQuantity: '' //不合格数量
|
|
|
|
})
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
|
|
|
|
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [
|
|
|
|
{
|
|
|
|
inspectionValue: '', //检验值
|
|
|
|
qualitativeCode: '', //定性字典项值
|
|
|
|
estimateCode: '', //评估代码
|
|
|
|
defectLevel: '', //缺陷级别
|
|
|
|
qualifiedQuantity: '', //合格数量
|
|
|
|
unqualifiedQuantity: '' //不合格数量
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
console.log(222, item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList)
|
|
|
|
}
|
|
|
|
// 选择选定级
|
|
|
|
const changeQualitativeCode = (e, item, cur) => {
|
|
|
|
let obj = item.selectedProjectRespVOList.find((cur) => cur.dictionaryValue == e)
|
|
|
|
console.log(obj)
|
|
|
|
cur.defectLevel = obj.defectLevel
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
.small-title {
|
|
|
|
font-weight: bold;
|
|
|
|
padding: 0px 10px 10px;
|
|
|
|
color: #1a8bfc;
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style>
|
|
|
|
.el-tabs--left .el-tabs__header.is-left {
|
|
|
|
min-height: 700px !important;
|
|
|
|
min-width: 150px !important;
|
|
|
|
}
|
|
|
|
.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left {
|
|
|
|
min-width: 120px !important;
|
|
|
|
}
|
|
|
|
</style>
|