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,
'检验方法',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
null,
InspectionMethodApi.getInspectionMethodPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
@ -159,7 +165,13 @@
'采样过程编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
null,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
@ -191,8 +203,14 @@
null,
'动态修改规则编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
null,
DynamicRuleApi.getDynamicRulePage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
@ -392,8 +410,14 @@
null,
'选择集编码',
SamplingProcess.allSchemas,
SamplingProcessApi.getSamplingProcessPage,
null,
SelectedSetApi.getSelectedSetPage,
[
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
],
false,
null,
item
@ -438,7 +462,10 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as InspectionProcessPageApi from '@/api/qms/inspectionTemplate'
import { SearchTable } from '@/components/SearchTable'
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 props = defineProps({
@ -580,28 +607,27 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type
if (row) {
data.value = row
let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
list.forEach((item, index) => {
editableTabsValue.value = index + 1
item.name = index + 1
//
if(item.quantifyIsCapping){
if (item.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
}else{
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
}
if(item.quantifyIsLowlimit){
if (item.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
}else{
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
}
if(item.quantifyIsTarget){
if (item.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
}else{
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
}
})
data.value.process = list
} else {
@ -722,20 +748,26 @@ const submitForm = async () => {
await formMainRef.value.validate()
if (!data.value.process || data.value.process.length == 0) {
message.error(`请添加工序`)
return;
return
}
const bol1 = await validateForm(formProcessRef.value)
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol1 || !bol2) {
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)
if(arr&&arr.length>0){
const str = arr.map(item=>item.description).join(',')
if (arr && arr.length > 0) {
const str = arr.map((item) => item.description).join(',')
message.error(`${str}是否设定上线,是否设定下限,是否是定目标值至少一项为是`)
return;
return
}
if (formType.value == 'create') {
//

Loading…
Cancel
Save