|
|
@ -66,7 +66,6 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import {getSamplingScheme} from "@/api/qms/samplingProcess"; |
|
|
|
|
|
|
|
defineOptions({ name: 'SamplingProcess' }) |
|
|
|
|
|
|
@ -150,8 +149,56 @@ const buttonTableClick = async (val, row) => { |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field =="sampleType"){ |
|
|
|
if(row.sampleType == "1"){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
|
item.label='样品量' |
|
|
|
item.component = 'Input' |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(row.sampleType == "2"){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
|
item.label='样品量(%)' |
|
|
|
item.component = 'Input' |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(row.sampleType == "3"){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
|
item.label='样品量' |
|
|
|
item.component = 'Input' |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(row.sampleType == "4"){ |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.component = 'Select' |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// form表单提交 |
|
|
@ -263,13 +310,6 @@ const onChange =async (field,value)=>{ |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(field == 'sampleType'&& value == '4'){ |
|
|
|
const data = await SamplingProcessApi.getSamplingScheme() |
|
|
|
const options = data.map(item=>{ |
|
|
|
return{ |
|
|
|
value:item.code, |
|
|
|
label:item.description, |
|
|
|
} |
|
|
|
}) |
|
|
|
SamplingProcess.allSchemas.formSchema.forEach(item=>{ |
|
|
|
if(item.field == "sampleSize"){ |
|
|
|
item.componentProps.disabled = true |
|
|
@ -277,7 +317,6 @@ const onChange =async (field,value)=>{ |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.component = 'Select' |
|
|
|
item.componentProps.disabled = false |
|
|
|
item.componentProps.options = options |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|