Browse Source

检验模板和方案校验修改

master_hella_20240701
zhang_li 8 months ago
parent
commit
e59ff3024d
  1. 156
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue
  2. 27
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

156
src/views/qms/basicDataManage/inspectionScheme/addForm.vue

@ -450,111 +450,106 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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 <el-form-item
label="是否设定上限" label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyUom"
> >
<el-switch <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
@change="changeIsCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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.quantifyCapping" prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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 <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
@change="changeLowlimit" @change="changeIsCapping($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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 <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
@change="changeLowlimit($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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.quantifyIsTarget" prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值" label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-switch <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
@change="changeIsTarget" @change="changeIsTarget($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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 <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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.quantifyIsLowlimit">
<el-form-item <el-form-item
label="计量单位" label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyUom" prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</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 <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item <el-form-item
label="选择集" label="选择集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
@ -751,7 +746,7 @@ const rules = ref({
{ required: true, message: '请输入目标值', trigger: 'blur' } { required: true, message: '请输入目标值', trigger: 'blur' }
], ],
'inspectionCharacteristicsBaseVO.quantifyCapping': [ 'inspectionCharacteristicsBaseVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: 'blur' } { required: true, message: '请输入上限值', trigger: ['blur','change'] }
], ],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [ 'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' } { required: true, message: '请输入下限值', trigger: 'blur' }
@ -785,26 +780,24 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode) list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode)
} }
list.forEach((item, index) => { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
editableTabsValue.value = index + 1 rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
item.name = index + 1 rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
// list.forEach((item, index) => {
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { editableTabsValue.value = index+1
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true item.name = index + 1
} else { // rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false //
} if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true }
} else { if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} }
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { }
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false })
}
})
data.value.process = list data.value.process = list
} else { } else {
data.value = { data.value = {
@ -1090,26 +1083,25 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
} }
if (formField == 'programmeTemplateCode') { if (formField == 'programmeTemplateCode') {
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
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) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index+1
item.name = index + 1 item.name = index + 1
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
// //
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else { }
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else { }
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { }
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
}) })
data.value.process = list data.value.process = list
} }
@ -1123,15 +1115,18 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
} }
// //
const changeIsCapping = (e) => { const changeIsCapping = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else { } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
} }
// //
const changeLowlimit = (e) => { const changeLowlimit = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else { } else {
@ -1139,7 +1134,8 @@ const changeLowlimit = (e) => {
} }
} }
// //
const changeIsTarget = (e) => { const changeIsTarget = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { } else {

27
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -293,7 +293,7 @@
label="是否设定上限" label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/> <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping($event,item)"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -302,7 +302,7 @@
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限" label="是否设定下限"
> >
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/> <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit($event,item)"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -313,7 +313,7 @@
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($event,item)" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -737,11 +737,16 @@ const submitForm = async () => {
return return
} }
// ,, // ,,
console.log(data.value.process)
const arr1 = data.value.process.filter( const arr1 = data.value.process.filter(
(item) => (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)))|| // console.log(String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length)
(item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) && // 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)))) &&
item.inspectionCharacteristicsBaseVO.featureType == 0 item.inspectionCharacteristicsBaseVO.featureType == 0
) )
if (arr1 && arr1.length > 0) { if (arr1 && arr1.length > 0) {
@ -894,15 +899,18 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
} }
// //
const changeIsCapping = (e) => { const changeIsCapping = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else { } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
} }
// //
const changeLowlimit = (e) => { const changeLowlimit = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else { } else {
@ -910,7 +918,8 @@ const changeLowlimit = (e) => {
} }
} }
// //
const changeIsTarget = (e) => { const changeIsTarget = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { } else {

Loading…
Cancel
Save