Browse Source

检验任务可以新增修改删除

master_hella_20240701
zhang_li 4 months ago
parent
commit
67324b9307
  1. 310
      src/views/qms/inspectionScheme/addForm.vue
  2. 7
      src/views/qms/inspectionTemplate/addForm.vue

310
src/views/qms/inspectionScheme/addForm.vue

@ -42,10 +42,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input v-model="data.description" placeholder="请填写描述" />
</el-form-item>
</el-col>
<el-form-item label="描述" prop="description">
<el-input v-model="data.description" placeholder="请填写描述" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="版本" prop="version">
<el-input v-model="data.version" placeholder="请填写版本" />
@ -169,7 +169,7 @@
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12" v-if="isShowField !=0">
<el-col :span="12" v-if="isShowField != 0">
<el-form-item label="aql" prop="aql">
<el-select v-model="data.aql" placeholder="请选择aql">
<el-option
@ -181,7 +181,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="isShowField!=0">
<el-col :span="12" v-if="isShowField != 0">
<el-form-item label="检验水平" prop="inspectionLevel">
<el-select v-model="data.inspectionLevel" placeholder="请选择检验水平">
<el-option
@ -195,7 +195,11 @@
</el-col>
<el-col :span="12">
<el-form-item label="每份样品量" prop="samplePieceSize">
<el-input v-model="data.samplePieceSize" placeholder="请填写每份样品量" :disabled='isSamplePieceSizeDisabled'/>
<el-input
v-model="data.samplePieceSize"
placeholder="请填写每份样品量"
:disabled="isSamplePieceSizeDisabled"
/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -229,6 +233,7 @@
</el-form>
<el-tabs
v-model="editableTabsValue"
editable
class="demo-tabs"
@edit="handleTabsEdit"
type="border-card"
@ -241,7 +246,7 @@
:label="item.description"
:name="item.name"
>
<!-- <el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="动态修改规则" prop="dynamicUpdateCode">
<div style="display: flex; width: 100%">
<el-input
@ -447,7 +452,7 @@
<el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型"
@change="changeFeatureType($event,item)"
@change="changeFeatureType($event, item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
>
<el-option
@ -461,11 +466,8 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyUom"
>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item label="计量单位" prop="inspectionCharacteristicsBaseVO.quantifyUom">
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
@ -490,7 +492,7 @@
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
@change="changeIsCapping($event,item)"
@change="changeIsCapping($event, item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
@ -502,24 +504,30 @@
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
@change="changeLowlimit($event,item)"
@change="changeLowlimit($event, item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值"
>
<el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
@change="changeIsTarget($event,item)"
@change="changeIsTarget($event, item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsCapping">
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
"
>
<el-form-item
label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyCapping"
@ -527,11 +535,18 @@
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit">
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit
"
>
<el-form-item
label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
@ -539,11 +554,18 @@
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsTarget">
<el-col
:span="12"
v-if="
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget
"
>
<el-form-item
label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyTarget"
@ -551,16 +573,15 @@
<el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
type="number"
/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item
label="选定集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
>
<div style="display: flex; width: 100%">
<el-input
@ -648,7 +669,7 @@ import * as DynamicRuleApi from '@/api/qms/dynamicRule' //动态修改规则
import { DynamicRule } from '@/views/qms/dynamicRule/dynamicRule.data' //
import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/selectedSet/selectedSet.data' //
import {validateTwoNum} from '@/utils/validator'
import { validateInteger, validateMaxNumber5, validateTwoNum } from '@/utils/validator'
const message = useMessage() //
@ -698,7 +719,7 @@ const data = ref({
code: '',
itemCode: '',
version: '',
inspectionType:'',
inspectionType: '',
programmeTemplateCode: '',
splitRule: '',
aql: '',
@ -707,9 +728,9 @@ const data = ref({
expirationDate: '',
available: 'TRUE',
dynamicUpdateCode: '',
description:'',
samplePieceSize:'',
uom:'',
description: '',
samplePieceSize: '',
uom: '',
process: []
})
@ -730,20 +751,21 @@ const rules = ref({
programmeTemplateCode: [
{ required: true, message: '请选择检验模板', trigger: ['blur', 'change'] }
],
description: [
{ required: true, message: '请选择描述', trigger: 'blur' }
],
description: [{ required: true, message: '请选择描述', trigger: 'blur' }],
// splitRule: [{ required: true, message: '', trigger: ['blur', 'change'] }],
aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }],
inspectionLevel: [
{ required: true, message: '请选择检验水平', trigger: ['blur', 'change'] },
],
inspectionLevel: [{ required: true, message: '请选择检验水平', trigger: ['blur', 'change'] }],
samplePieceSize: [
{ required: true, message: '请输入每份样品量', trigger: ['blur', 'change']},
{ validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'},
{ required: true, message: '请输入每份样品量', trigger: ['blur', 'change'] },
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' }
],
effectiveDate: [{ required: true, message: '请选择生效时间', trigger: ['blur', 'change'] }],
expirationDate: [{ required: true, message: '请选择失效时间', trigger: ['blur', 'change'] }],
sequenceCode: [
{ required: true, message: '请填写顺序号', trigger: 'blur' },
{ validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
],
@ -766,7 +788,7 @@ const rules = ref({
{ required: true, message: '请输入目标值', trigger: 'blur' }
],
'inspectionCharacteristicsBaseVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: ['blur','change'] }
{ required: true, message: '请输入上限值', trigger: ['blur', 'change'] }
],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' }
@ -775,13 +797,15 @@ const rules = ref({
{ required: true, message: '请选择计量单位', trigger: 'blur' }
],
'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': [
{ required: true, message: '请输入选定集', trigger: 'blur' }
]
})
const isShowField = ref(0)//aql 0 0
const isShowField = ref(0) //aql 0 0
/** 打开弹窗 */
let tabIndex = 1
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
@ -792,7 +816,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
dialogTitle.value = t('action.' + type)
}
formType.value = type
isShowField.value=0//isShowField == 0aql
isShowField.value = 0 //isShowField == 0aql
if (row) {
data.value = JSON.parse(JSON.stringify(row))
let list = []
@ -802,34 +826,37 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode)
}
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
list.forEach((item, index) => {
editableTabsValue.value = index+1
item.name = index + 1
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
//
if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}
if(item.inspectionCharacteristicsBaseVO.sampleType == 4){
isShowField.value+=1//isShowField > 0aql
}
})
// aql
if( isShowField.value>0){
rules.value.aql[0].required = true
rules.value.aql[0].required = true
}else{
rules.value.aql[0].required = false
rules.value.aql[0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
//
if (
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) {
isShowField.value += 1 //isShowField > 0aql
}
})
// aql
if (isShowField.value > 0) {
rules.value.aql[0].required = true
rules.value.aql[0].required = true
} else {
rules.value.aql[0].required = false
rules.value.aql[0].required = false
}
data.value.process = list
} else {
data.value = {
@ -844,10 +871,10 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
effectiveDate: '',
expirationDate: '',
available: 'TRUE',
dynamicUpdateCode:'',
description:"",
samplePieceSize:"",
uom:"",
dynamicUpdateCode: '',
description: '',
samplePieceSize: '',
uom: '',
process: []
}
}
@ -894,20 +921,20 @@ const buttonBaseClick1 = (val) => {
name: newTabName,
inspectionCode: '',
sequenceCode: '',
dynamicUpdateCode:'',
dynamicUpdateCode: '',
inspectionCharCode: '',
inspectionCharacteristicsBaseVO: {
describe: '',
inspectionMethodCode: '',
dynamicUpdateCode: '',
inspectionMethod: '',
isCanUpdate: '',
isCanUpdate: true,
isDestructionInspection: '',
resultEntryMethod: '',
featureType: '',
quantifyIsCapping: '',
quantifyIsLowlimit: '',
quantifyIsTarget: '',
quantifyIsCapping: false,
quantifyIsLowlimit: false,
quantifyIsTarget: false,
quantifyTarget: '',
quantifyCapping: '',
quantifyLowlimit: '',
@ -954,10 +981,29 @@ const validateForm = (formRef) => {
return false
})
}
// true \ false
const hasDuplicates = (array) => {
const seen = new Set()
const repeatCode = new Set()
let arr = array.map((item) => parseInt(item.sequenceCode))
arr.forEach((item) => {
if (seen.has(item)) {
repeatCode.add(item)
} else {
seen.add(item)
}
})
const arr1 = Array.from(repeatCode)
if (arr1.length > 0) {
return true
} else {
return false
}
}
const submitForm = async () => {
try {
const aa = await getStrDictOptions(DICT_TYPE.SPLIT_RULES);//
const aa = await getStrDictOptions(DICT_TYPE.SPLIT_RULES) //
data.value.splitRule = aa[0].value
const validateForm1 = await validateForm(formProcessRef.value)
await formMainRef.value.validate()
@ -965,6 +1011,11 @@ const submitForm = async () => {
message.error(`请添加工序`)
return
}
// debugger
if (hasDuplicates(data.value.process)) {
message.error(`检验工序顺序号不能相同`)
return
}
const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol1 || !bol2) {
@ -984,8 +1035,65 @@ const submitForm = async () => {
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return
}
// ,,
console.log(data.value.process)
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) => {
// ,
return (
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit)) ||
//
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)) ||
//
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) >=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)) ||
//
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
(parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) ||
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyCapping) <=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget) ||
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyLowlimit) >=
parseFloat(item.inspectionCharacteristicsBaseVO.quantifyTarget)))
)
})
if (arr2 && arr2.length > 0) {
const str = arr2.map((item) => item.description).join(',')
message.error(`${str}工序上限值应大于目标值大于下限值`)
return
}
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data.value)
} else {
@ -1007,15 +1115,15 @@ if (props.footButttondata) {
]
}
//
const changeFeatureType = (e,item) => {
const changeFeatureType = (e, item) => {
item.inspectionCharacteristicsBaseVO.quantifyIsCapping = false
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit = false
item.inspectionCharacteristicsBaseVO.quantifyIsTarget = false
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
item.inspectionCharacteristicsBaseVO.quantifyTarget= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyName= ''
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode = ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyName = ''
console.log(e)
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
@ -1098,7 +1206,7 @@ const opensearchTable = (
_searchCondition
)
}
const isSamplePieceSizeDisabled = ref(false)//
const isSamplePieceSizeDisabled = ref(false) //
//
// val row
const searchTableSuccess = async (formField, searchField, val, type, row) => {
@ -1120,17 +1228,17 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (formField == 'itemCode') {
data.value.itemName = val[0].name
data.value.uom = val[0].uom
if(data.value.uom == 'EA'){
if (data.value.uom == 'EA') {
data.value.samplePieceSize = 1
isSamplePieceSizeDisabled.value = true
}else{
} else {
data.value.samplePieceSize = ''
isSamplePieceSizeDisabled.value = false
}
} else if (formField == 'inspectionType') {
data.value.testTypeName = val[0].description
} else if (formField == 'programmeTemplateCode') {
isShowField.value=0//isShowField == 0aql
isShowField.value = 0 //isShowField == 0aql
data.value.programmeTemplateName = val[0].description
data.value['dynamicUpdateCode'] = val[0].dynamicUpdateCode
data.value.dynamicUpdateName = val[0].dynamicUpdateName
@ -1139,11 +1247,14 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
list.forEach((item, index) => {
editableTabsValue.value = index+1
editableTabsValue.value = index + 1
item.name = index + 1
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
//
if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
if (
item.inspectionCharacteristicsBaseVO.featureType == 0 &&
item.inspectionCharacteristicsBaseVO.quantifyIsCapping
) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
@ -1152,20 +1263,20 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}
if(item.inspectionCharacteristicsBaseVO.sampleType == 4){
isShowField.value+=1//isShowField > 0aql
if (item.inspectionCharacteristicsBaseVO.sampleType == 4) {
isShowField.value += 1 //isShowField > 0aql
}
})
// aql
if( isShowField.value>0){
rules.value.aql[0].required = true
rules.value.aql[0].required = true
}else{
if (isShowField.value > 0) {
rules.value.aql[0].required = true
rules.value.aql[0].required = true
} else {
rules.value.aql[0].required = false
rules.value.aql[0].required = false
rules.value.aql[0].required = false
}
data.value.process = list
}else if (formField == 'dynamicUpdateCode') {
} else if (formField == 'dynamicUpdateCode') {
data.value[formField] = val[0].code
data.value.dynamicUpdateName = val[0].description
}
@ -1174,17 +1285,16 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
}
//
const changeIsCapping = (e,item) => {
const changeIsCapping = (e, item) => {
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
}
//
const changeLowlimit = (e,item) => {
const changeLowlimit = (e, item) => {
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
@ -1193,7 +1303,7 @@ const changeLowlimit = (e,item) => {
}
}
//
const changeIsTarget = (e,item) => {
const changeIsTarget = (e, item) => {
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true

7
src/views/qms/inspectionTemplate/addForm.vue

@ -297,7 +297,8 @@
prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
>
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" />
<el-input v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
type="number"/>
</el-form-item>
</el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
@ -822,10 +823,6 @@ const submitForm = async () => {
console.log(data.value.process)
const arr1 = data.value.process.filter(
(item) =>
// {
// console.log(String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length)
// console.log(Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal))
// }
((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)))) &&

Loading…
Cancel
Save