Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
c06eb5412d
  1. 76
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

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

@ -125,8 +125,14 @@
null, null,
'检验方法', '检验方法',
SamplingProcess.allSchemas, SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage, InspectionMethodApi.getInspectionMethodPage,
null, [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false, false,
null, null,
item item
@ -159,7 +165,13 @@
'采样过程编码', '采样过程编码',
SamplingProcess.allSchemas, SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage, SamplingProcessApi.getSamplingProcessPage,
null, [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false, false,
null, null,
item item
@ -191,8 +203,14 @@
null, null,
'动态修改规则编码', '动态修改规则编码',
SamplingProcess.allSchemas, SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage, DynamicRuleApi.getDynamicRulePage,
null, [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false, false,
null, null,
item item
@ -392,8 +410,14 @@
null, null,
'选择集编码', '选择集编码',
SamplingProcess.allSchemas, SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage, SelectedSetApi.getSelectedSetPage,
null, [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false, false,
null, null,
item item
@ -438,7 +462,10 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate' import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data' import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data'
import * as SamplingProcessApi from '@/api/qms/samplingProcess' import * as SamplingProcessApi from '@/api/qms/samplingProcess'//
import * as InspectionMethodApi from '@/api/qms/inspectionMethod'//
import * as DynamicRuleApi from '@/api/qms/dynamicRule'//
import * as SelectedSetApi from '@/api/qms/selectedSet'//
const message = useMessage() // const message = useMessage() //
const props = defineProps({ const props = defineProps({
@ -580,28 +607,27 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type formType.value = type
if (row) { if (row) {
data.value = row data.value = row
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index + 1
item.name = index + 1 item.name = index + 1
// //
if(item.quantifyIsCapping){ if (item.quantifyIsCapping) {
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
} }
if(item.quantifyIsLowlimit){ if (item.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}else{ } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
} }
if(item.quantifyIsTarget){ if (item.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}else{ } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
} }
}) })
data.value.process = list data.value.process = list
} else { } else {
@ -722,20 +748,26 @@ const submitForm = async () => {
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
} }
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(item=>(!item.inspectionCharacteristicsBaseVO.quantifyIsCapping&&!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit&&!item.inspectionCharacteristicsBaseVO.quantifyIsTarget&&item.inspectionCharacteristicsBaseVO.featureType == 0)) const arr = data.value.process.filter(
(item) =>
!item.inspectionCharacteristicsBaseVO.quantifyIsCapping &&
!item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit &&
!item.inspectionCharacteristicsBaseVO.quantifyIsTarget &&
item.inspectionCharacteristicsBaseVO.featureType == 0
)
console.log(arr) 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; return
} }
if (formType.value == 'create') { if (formType.value == 'create') {
// //

Loading…
Cancel
Save