|
|
@ -48,6 +48,7 @@ |
|
|
|
:apiCreate="SamplingProcessApi.createSamplingProcess" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
@onChange="onChange" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
@ -65,6 +66,7 @@ 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' }) |
|
|
|
|
|
|
@ -226,6 +228,61 @@ const importSuccess = () => { |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
const onChange =async (field,value)=>{ |
|
|
|
if(field == 'sampleType'&& value == '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(field == 'sampleType'&& value == '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(field == 'sampleType'&& value == '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(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 |
|
|
|
} |
|
|
|
if(item.field == "sampleProgCode"){ |
|
|
|
item.component = 'Select' |
|
|
|
item.componentProps.disabled = false |
|
|
|
item.componentProps.options = options |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 筛选提交 |
|
|
|
const searchFormClick = (searchData) => { |
|
|
|
tableObject.params = { |
|
|
|