|
@ -10,7 +10,7 @@ |
|
|
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> |
|
|
<!-- <Form ref="formRefMain" :schema="formAllSchemasMain" :is-col="true" :rules="rules" /> --> |
|
|
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> |
|
|
<el-form :model="data" label-width="auto" :rules="rules" ref="formMainRef"> |
|
|
<el-row gutter="20"> |
|
|
<el-row gutter="20"> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="data.code"> |
|
|
<el-form-item label="编码" prop="code"> |
|
|
<el-form-item label="编码" prop="code"> |
|
|
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> |
|
|
<el-input v-model="data.code" placeholder="根据系统生成" :disabled="true" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -22,19 +22,19 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="版本" prop="version"> |
|
|
<el-form-item label="版本" prop="version"> |
|
|
<el-input v-model="data.version" placeholder="请填写版本" /> |
|
|
<el-input v-model="data.version" placeholder="请填写版本" type="number"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="动态修改规则编码" |
|
|
label="动态修改规则" |
|
|
prop="dynamicUpdateCode" |
|
|
prop="dynamicUpdateCode" |
|
|
> |
|
|
> |
|
|
<div style="display: flex; width: 100%"> |
|
|
<div style="display: flex; width: 100%"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="data.dynamicUpdateName" |
|
|
v-model="data.dynamicUpdateName" |
|
|
disabled |
|
|
disabled |
|
|
placeholder="请选择动态修改规则编码" |
|
|
placeholder="请选择动态修改规则" |
|
|
/> |
|
|
/> |
|
|
<el-button |
|
|
<el-button |
|
|
type="info" |
|
|
type="info" |
|
@ -44,7 +44,7 @@ |
|
|
opensearchTable( |
|
|
opensearchTable( |
|
|
'dynamicUpdateCode', |
|
|
'dynamicUpdateCode', |
|
|
null, |
|
|
null, |
|
|
'动态修改规则编码', |
|
|
'动态修改规则', |
|
|
DynamicRule.allSchemas, |
|
|
DynamicRule.allSchemas, |
|
|
DynamicRuleApi.getDynamicRulePage, |
|
|
DynamicRuleApi.getDynamicRulePage, |
|
|
[ |
|
|
[ |
|
@ -91,20 +91,20 @@ |
|
|
/> --> |
|
|
/> --> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formProcessRef"> |
|
|
<el-row :gutter="20"> |
|
|
<el-row :gutter="20"> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.code"> |
|
|
<el-form-item label="编码" prop="code"> |
|
|
<el-form-item label="编码" prop="code"> |
|
|
<el-input v-model="item.code" placeholder="根据系统生成" :disabled="true" /> |
|
|
<el-input v-model="item.code" placeholder="根据系统生成" :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.inspectionCode" |
|
|
v-model="item.inspectionCode" |
|
|
placeholder="根据系统生成" |
|
|
placeholder="根据系统生成" |
|
|
:disabled="true" |
|
|
:disabled="true" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> --> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="描述" prop="description"> |
|
|
<el-form-item label="描述" prop="description"> |
|
|
<el-input v-model="item.description" /> |
|
|
<el-input v-model="item.description" /> |
|
@ -112,25 +112,25 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="顺序号" prop="sequenceCode"> |
|
|
<el-form-item label="顺序号" prop="sequenceCode"> |
|
|
<el-input v-model="item.sequenceCode" /> |
|
|
<el-input v-model="item.sequenceCode" type="number"/> |
|
|
</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" |
|
|
placeholder="根据系统生成" |
|
|
placeholder="根据系统生成" |
|
|
: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> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef"> |
|
|
<el-form :model="item" label-width="auto" :rules="rules" ref="formFeaturesRef"> |
|
|
<el-row :gutter="20"> |
|
|
<el-row :gutter="20"> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.code"> |
|
|
<el-form-item label="编码"> |
|
|
<el-form-item label="编码"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="item.inspectionCharacteristicsBaseVO.code" |
|
|
v-model="item.inspectionCharacteristicsBaseVO.code" |
|
@ -192,7 +192,7 @@ |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessName" |
|
|
v-model="item.inspectionCharacteristicsBaseVO.samplingProcessName" |
|
|
disabled |
|
|
disabled |
|
|
placeholder="请选择采样过程编码" |
|
|
placeholder="请选择采样过程" |
|
|
/> |
|
|
/> |
|
|
<el-button |
|
|
<el-button |
|
|
type="info" |
|
|
type="info" |
|
@ -202,7 +202,7 @@ |
|
|
opensearchTable( |
|
|
opensearchTable( |
|
|
'samplingProcessCode', |
|
|
'samplingProcessCode', |
|
|
null, |
|
|
null, |
|
|
'采样过程编码', |
|
|
'采样过程', |
|
|
SamplingProcess.allSchemas, |
|
|
SamplingProcess.allSchemas, |
|
|
SamplingProcessApi.getSamplingProcessPage, |
|
|
SamplingProcessApi.getSamplingProcessPage, |
|
|
[ |
|
|
[ |
|
@ -270,86 +270,80 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"> |
|
|
|
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="是否设定上限" |
|
|
label="计量单位" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyUom" |
|
|
|
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
> |
|
|
> |
|
|
|
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" /> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/> |
|
|
|
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="上限值" |
|
|
label="小数位" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyCapping" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyDecimal" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
> |
|
|
> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" /> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" |
|
|
label="是否设定上限" |
|
|
label="是否设定下限" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
|
|
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="下限值" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit" |
|
|
label="是否设定下限" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" /> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget" |
|
|
label="是否设定目标值" |
|
|
label="是否设定目标值" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
> |
|
|
> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget"/> |
|
|
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget" /> |
|
|
|
|
|
|
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsCapping"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="目标值" |
|
|
label="上限值" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyTarget" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyCapping" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" /> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" type="number"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"> |
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="计量单位" |
|
|
label="下限值" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyUom" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" /> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" type="number"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsTarget"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="小数位" |
|
|
label="目标值" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyDecimal" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyTarget" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" |
|
|
|
|
|
> |
|
|
> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" /> |
|
|
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" type="number"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item |
|
|
<el-form-item |
|
|
label="选择集编码" |
|
|
label="选择集" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" |
|
|
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1" |
|
|
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1" |
|
|
> |
|
|
> |
|
@ -357,7 +351,7 @@ |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyName" |
|
|
v-model="item.inspectionCharacteristicsBaseVO.quantifyQuantifyName" |
|
|
disabled |
|
|
disabled |
|
|
placeholder="请选择选择集编码" |
|
|
placeholder="请选择选择集" |
|
|
/> |
|
|
/> |
|
|
<el-button |
|
|
<el-button |
|
|
type="info" |
|
|
type="info" |
|
@ -367,7 +361,7 @@ |
|
|
opensearchTable( |
|
|
opensearchTable( |
|
|
'quantifyQuantifyCode', |
|
|
'quantifyQuantifyCode', |
|
|
null, |
|
|
null, |
|
|
'选择集编码', |
|
|
'选择集', |
|
|
SelectedSet.allSchemas, |
|
|
SelectedSet.allSchemas, |
|
|
SelectedSetApi.getSelectedSetPage, |
|
|
SelectedSetApi.getSelectedSetPage, |
|
|
[ |
|
|
[ |
|
@ -428,6 +422,7 @@ import * as DynamicRuleApi from '@/api/qms/dynamicRule' //动态修改规则 |
|
|
import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule.data' //动态修改规则 |
|
|
import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule.data' //动态修改规则 |
|
|
import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集 |
|
|
import * as SelectedSetApi from '@/api/qms/selectedSet' //选择集 |
|
|
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集 |
|
|
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //选择集 |
|
|
|
|
|
import { validateInteger,validateTwoNum,validateMaxNumber5 } from '@/utils/validator' |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
@ -492,18 +487,24 @@ if (props.basicFormWidth) { |
|
|
} |
|
|
} |
|
|
const rules = ref({ |
|
|
const rules = ref({ |
|
|
description: [{ required: true, message: '请填写描述', trigger: 'blur' }], |
|
|
description: [{ required: true, message: '请填写描述', trigger: 'blur' }], |
|
|
version: [{ required: true, message: '请填写版本', trigger: 'blur' }], |
|
|
version: [ |
|
|
inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }], |
|
|
{ required: true, message: '请填写版本', trigger: 'blur' }, |
|
|
sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }], |
|
|
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'} |
|
|
inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }], |
|
|
], |
|
|
|
|
|
inspectionCode: [{ required: true, message: '请选择检验方案模板', trigger: 'blur' }], |
|
|
|
|
|
sequenceCode: [ |
|
|
|
|
|
{ required: true, message: '请填写顺序号', trigger: 'blur' }, |
|
|
|
|
|
{ validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'} |
|
|
|
|
|
], |
|
|
|
|
|
inspectionCharCode: [{ required: true, message: '请选择检验特性', trigger: 'blur' }], |
|
|
'inspectionCharacteristicsBaseVO.description': [ |
|
|
'inspectionCharacteristicsBaseVO.description': [ |
|
|
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } |
|
|
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] } |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [ |
|
|
'inspectionCharacteristicsBaseVO.inspectionMethodCode': [ |
|
|
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } |
|
|
{ required: true, message: '请选择检验方法', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
dynamicUpdateCode: [ |
|
|
dynamicUpdateCode: [ |
|
|
{ required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] } |
|
|
{ required: true, message: '请选择动态修改规则', trigger: ['blur', 'change'] } |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.samplingProcessCode': [ |
|
|
'inspectionCharacteristicsBaseVO.samplingProcessCode': [ |
|
|
{ required: true, message: '请选择采样过程', trigger: ['blur', 'change'] } |
|
|
{ required: true, message: '请选择采样过程', trigger: ['blur', 'change'] } |
|
@ -515,24 +516,28 @@ const rules = ref({ |
|
|
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] } |
|
|
{ required: true, message: '请选择特征类型', trigger: ['blur', 'change'] } |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyTarget': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyTarget': [ |
|
|
{ required: true, message: '请输入目标值', trigger: 'blur' } |
|
|
{ required: true, message: '请输入目标值', trigger: 'blur' }, |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyCapping': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyCapping': [ |
|
|
{ required: true, message: '请输入上限值', trigger: 'blur' } |
|
|
{ required: true, message: '请输入上限值', trigger: 'blur' }, |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [ |
|
|
{ required: true, message: '请输入下限值', trigger: 'blur' } |
|
|
{ required: true, message: '请输入下限值', trigger: 'blur' }, |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyUom': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyUom': [ |
|
|
{ required: true, message: '请选择计量单位', trigger: 'blur' } |
|
|
{ required: true, message: '请选择计量单位', trigger: 'blur' } |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyDecimal': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyDecimal': [ |
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' } |
|
|
{ required: true, message: '请输入小数位', trigger: 'blur' }, |
|
|
|
|
|
{ validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}, |
|
|
|
|
|
{ validator:validateMaxNumber5, message: '不能大于5', trigger: 'blur'} |
|
|
], |
|
|
], |
|
|
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [ |
|
|
'inspectionCharacteristicsBaseVO.quantifyQuantifyCode': [ |
|
|
{ required: true, message: '请输入选择集编码', trigger: 'blur' } |
|
|
{ required: true, message: '请输入选择集', trigger: 'blur' } |
|
|
] |
|
|
] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
/** 打开弹窗 */ |
|
|
let tabIndex = 1 |
|
|
let tabIndex = 1 |
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
|
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { |
|
@ -681,22 +686,44 @@ const validateForm = (formRef) => { |
|
|
return false |
|
|
return false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
// 判断对象数组是否有相同属性 相同:true \ 不相同:false |
|
|
|
|
|
const hasDuplicates =(array)=>{ |
|
|
|
|
|
return array.some((item, index) => { |
|
|
|
|
|
return ( |
|
|
|
|
|
array.findIndex((v, i) => { |
|
|
|
|
|
return ( |
|
|
|
|
|
i !== index && |
|
|
|
|
|
JSON.stringify(v.sequenceCode) === JSON.stringify(item.sequenceCode) |
|
|
|
|
|
) |
|
|
|
|
|
}) !== -1 |
|
|
|
|
|
) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const submitForm = async () => { |
|
|
const submitForm = async () => { |
|
|
try { |
|
|
try { |
|
|
const validateForm1 = await validateForm(formProcessRef.value) |
|
|
|
|
|
console.log(validateForm1) |
|
|
// 检验主表字段 |
|
|
|
|
|
await validateForm(formProcessRef.value) |
|
|
await formMainRef.value.validate() |
|
|
await formMainRef.value.validate() |
|
|
|
|
|
// 检验是否添加工序 |
|
|
if (!data.value.process || data.value.process.length == 0) { |
|
|
if (!data.value.process || data.value.process.length == 0) { |
|
|
message.error(`请添加工序`) |
|
|
message.error(`请添加工序`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if(hasDuplicates(data.value.process)){ |
|
|
|
|
|
message.error(`检验工序顺序号不能相同`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// 检验模板中有检验工序和检验特性未填写完全 |
|
|
const bol1 = await validateForm(formProcessRef.value) |
|
|
const bol1 = await validateForm(formProcessRef.value) |
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
const bol2 = await validateForm(formFeaturesRef.value) |
|
|
if (!bol1 || !bol2) { |
|
|
if (!bol1 || !bol2) { |
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
message.error(`模板中有检验工序和检验特性未填写完全`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 是否设定上线,是否设定下限,是否是定目标值至少一项为是 |
|
|
const arr = data.value.process.filter( |
|
|
const arr = data.value.process.filter( |
|
|
(item) => |
|
|
(item) => |
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping && |
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping && |
|
@ -704,10 +731,39 @@ const submitForm = async () => { |
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget && |
|
|
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget && |
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 |
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 |
|
|
) |
|
|
) |
|
|
console.log(arr) |
|
|
|
|
|
if (arr && arr.length > 0) { |
|
|
if (arr && arr.length > 0) { |
|
|
const str = arr.map((item) => item.description).join(',') |
|
|
const str = arr.map((item) => item.description).join(',') |
|
|
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`) |
|
|
message.error(`${str}是否设定上线,是否设定下限,是否设定目标值至少一项为是`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// 检验上限值,下限值,目标值小数位数不可以大于小数位 |
|
|
|
|
|
const arr1 = data.value.process.filter( |
|
|
|
|
|
(item) => |
|
|
|
|
|
((item.inspectionCharacteristicsBaseVO.quantifyIsCapping && (String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| |
|
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| |
|
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) && |
|
|
|
|
|
item.inspectionCharacteristicsBaseVO.featureType == 0 |
|
|
|
|
|
) |
|
|
|
|
|
if (arr1 && arr1.length > 0) { |
|
|
|
|
|
const str = arr1.map((item) => item.description).join(',') |
|
|
|
|
|
message.error(`${str}上限值,下限值,目标值小数位数不可以大于小数位`) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
// 检验上限值应大目标值大于下限值 |
|
|
|
|
|
const arr2 = data.value.process.filter( |
|
|
|
|
|
(item) => |
|
|
|
|
|
// 上限值存在并且下限值存在时,上限值应大于下限值 |
|
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyLowlimit))|| |
|
|
|
|
|
// 上限值存在并且目标值存在时,上限值应大于目标值 |
|
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping && item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyTarget))|| |
|
|
|
|
|
// 下限值存在并且目标值存在时,下限值应小于目标值 |
|
|
|
|
|
( item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (item.inspectionCharacteristicsBaseVO.quantifyLowlimit >= item.inspectionCharacteristicsBaseVO.quantifyTarget))|| |
|
|
|
|
|
// 上限值,下限值,目标值都存在时,上限值应大于目标值大于下限值 |
|
|
|
|
|
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && item.inspectionCharacteristicsBaseVO.quantifyIsTarget && ((item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyLowlimit)||(item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyTarget)||(item.inspectionCharacteristicsBaseVO.quantifyLowlimit >= item.inspectionCharacteristicsBaseVO.quantifyTarget))) |
|
|
|
|
|
) |
|
|
|
|
|
if (arr2 && arr2.length > 0) { |
|
|
|
|
|
const str = arr2.map((item) => item.description).join(',') |
|
|
|
|
|
message.error(`${str}上限值应大目标值大于下限值`) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (formType.value == 'create') { |
|
|
if (formType.value == 'create') { |
|
|