|
|
@ -8,35 +8,56 @@ |
|
|
<div class="content"> |
|
|
<div class="content"> |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" |
|
|
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> |
|
|
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 操作步骤 --> |
|
|
<!-- 操作步骤 --> |
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
<div class="template-form-item"> |
|
|
<div class="template-form-item"> |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" |
|
|
ref="operateStepRef" :formConfig="operateConfig" :formData="formData" /> |
|
|
ref="operateStepRef" :formConfig="operateConfig" :formData="formData" /> |
|
|
<CustomTable |
|
|
|
|
|
:columns="operateColumns" |
|
|
|
|
|
ref="operateTableRef" |
|
|
|
|
|
:showOperation="fillType === 'preFill'" |
|
|
|
|
|
:showAddRow="fillType === 'preFill'" |
|
|
|
|
|
:formData="formData" |
|
|
|
|
|
:isBorder="false" |
|
|
|
|
|
:prefixKey="`operateTable`" |
|
|
|
|
|
> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaionDelete |
|
|
|
|
|
:row="row" |
|
|
|
|
|
:rowIndex="rowIndex" |
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'operateTableRef')" |
|
|
|
|
|
></TableOpertaionDelete> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.dj.dj001.fhfw" |
|
|
|
|
|
ref="fhfwCheckBoxRef" :formConfig="fhfwCheckBoxConfig" :formData="formData" /> |
|
|
|
|
|
<div class="template-form-item" > |
|
|
|
|
|
<span>{{ $t('template.dj.dj001.fhfw') }}</span> |
|
|
|
|
|
<CustomTable |
|
|
|
|
|
:columns="operateColumns" |
|
|
|
|
|
ref="operateTableRef" |
|
|
|
|
|
:showOperation="fillType === 'preFill'" |
|
|
|
|
|
:showAddRow="fillType === 'preFill'" |
|
|
|
|
|
:formData="formData" |
|
|
|
|
|
:isBorder="false" |
|
|
|
|
|
:prefixKey="`operateTable`" |
|
|
|
|
|
> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaionDelete |
|
|
|
|
|
:row="row" |
|
|
|
|
|
:rowIndex="rowIndex" |
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'operateTableRef')" |
|
|
|
|
|
></TableOpertaionDelete> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="template-form-item" > |
|
|
|
|
|
<span>{{ $t('template.dj.dj001.fhlr') }}</span> |
|
|
|
|
|
<CustomTable |
|
|
|
|
|
:columns="fhlrColumns" |
|
|
|
|
|
ref="fhlrTableRef" |
|
|
|
|
|
:showOperation="fillType === 'preFill'" |
|
|
|
|
|
:showAddRow="fillType === 'preFill'" |
|
|
|
|
|
:formData="{ stepTableFormData: formData.stepTableFormData_1 }" |
|
|
|
|
|
:isBorder="false" |
|
|
|
|
|
:prefixKey="`fhlrTable`" |
|
|
|
|
|
> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaionDelete |
|
|
|
|
|
:row="row" |
|
|
|
|
|
:rowIndex="rowIndex" |
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'fhlrTableRef')" |
|
|
|
|
|
></TableOpertaionDelete> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
</div> |
|
|
</div> |
|
|
@ -59,6 +80,7 @@ import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
import { debounce } from 'lodash-es' |
|
|
import { debounce } from 'lodash-es' |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" |
|
|
import StepFormPackage from "@/components/Template/StepFormPackage.vue" |
|
|
import StepFormPackage from "@/components/Template/StepFormPackage.vue" |
|
|
|
|
|
import { fill } from "lodash"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "DJ001", |
|
|
name: "DJ001", |
|
|
@ -115,7 +137,7 @@ export default { |
|
|
operateConfig() { |
|
|
operateConfig() { |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
type: "step", |
|
|
|
|
|
|
|
|
type: "cellItem", |
|
|
config: { |
|
|
config: { |
|
|
syts: { |
|
|
syts: { |
|
|
label: 'template.dj.dj001.syts', |
|
|
label: 'template.dj.dj001.syts', |
|
|
@ -127,6 +149,30 @@ export default { |
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
|
|
|
//复核范围配置 |
|
|
|
|
|
fhfwCheckBoxConfig() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ |
|
|
|
|
|
type: "checkboxList", |
|
|
|
|
|
config: { |
|
|
|
|
|
fhfwCheck: { |
|
|
|
|
|
label: 'template.dj.dj001.fhfw', |
|
|
|
|
|
type: "checkboxTree", |
|
|
|
|
|
fillType: 'actFill', |
|
|
|
|
|
options: this.fhfwCheckOptions |
|
|
|
|
|
}, |
|
|
|
|
|
fhlrCheck: { |
|
|
|
|
|
label: 'template.dj.dj001.fhlr', |
|
|
|
|
|
type: "checkboxTree", |
|
|
|
|
|
fillType: 'actFill', |
|
|
|
|
|
options: this.fhlrCheckOptions |
|
|
|
|
|
}, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
|
|
|
//复核范围 |
|
|
operateColumns() { |
|
|
operateColumns() { |
|
|
return [ |
|
|
return [ |
|
|
{ |
|
|
{ |
|
|
@ -138,42 +184,54 @@ export default { |
|
|
}, |
|
|
}, |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
|
|
|
//复核内容 |
|
|
|
|
|
fhlrColumns() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ |
|
|
|
|
|
label: 'template.dj.dj001.fhlr', |
|
|
|
|
|
prop: 'fhlr', |
|
|
|
|
|
bodyType: 'select', |
|
|
|
|
|
bodyOptions: this.getDictOptions('business_fhlr'), |
|
|
|
|
|
bodyFillType: 'preFill' |
|
|
|
|
|
}, |
|
|
|
|
|
] |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
formData: {}, |
|
|
formData: {}, |
|
|
|
|
|
fhfwCheckOptions:[], |
|
|
|
|
|
fhlrCheckOptions:[], |
|
|
|
|
|
isFirstTableDataRecorded: false, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
this.getTableData() |
|
|
|
|
|
},200) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
//获取已填写的表单数据 |
|
|
//获取已填写的表单数据 |
|
|
getFilledFormData() { |
|
|
getFilledFormData() { |
|
|
return this.getFilledFormDataByRefs( |
|
|
return this.getFilledFormDataByRefs( |
|
|
[ |
|
|
[ |
|
|
"baseInfoRef", "stepRef", "remarkRef", |
|
|
|
|
|
"fjRef", "tableFirstRef", "stepFormPackageSecondRef", |
|
|
|
|
|
"stepFormPackageThirdRef", "stepFormPackageFourthRef", |
|
|
|
|
|
"stepFormPackageFivthRef", "tableSecondRef", "stepFormPackageSixthRef" |
|
|
|
|
|
|
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
] |
|
|
] |
|
|
) |
|
|
) |
|
|
}, |
|
|
}, |
|
|
//获取填写完成的表单数据 |
|
|
//获取填写完成的表单数据 |
|
|
async getFormData() { |
|
|
async getFormData() { |
|
|
let content = await this.validFormFields([ |
|
|
let content = await this.validFormFields([ |
|
|
"baseInfoRef", "stepRef", "remarkRef", |
|
|
|
|
|
"fjRef", "tableFirstRef", "stepFormPackageSecondRef", |
|
|
|
|
|
"stepFormPackageThirdRef", "stepFormPackageFourthRef", |
|
|
|
|
|
"stepFormPackageFivthRef", "tableSecondRef", "stepFormPackageSixthRef" |
|
|
|
|
|
|
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
]); |
|
|
]); |
|
|
return content; |
|
|
return content; |
|
|
}, |
|
|
}, |
|
|
getResource() { |
|
|
getResource() { |
|
|
//使用的试剂、仪器 |
|
|
//使用的试剂、仪器 |
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
|
|
|
this.resourceTmp = stepResource.sjResource || [] |
|
|
|
|
|
this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
|
|
return this.resourceTmp; |
|
|
|
|
|
|
|
|
// const stepResource = this.$refs.stepRef.getStepResource() |
|
|
|
|
|
// this.resourceTmp = stepResource.sjResource || [] |
|
|
|
|
|
// this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
|
|
// return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
//保存 |
|
|
//保存 |
|
|
async onSave() { |
|
|
async onSave() { |
|
|
@ -191,6 +249,26 @@ export default { |
|
|
tableRef2.deleteRow(rowIndex); |
|
|
tableRef2.deleteRow(rowIndex); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取范围和内容表格数据(核心优化) |
|
|
|
|
|
getTableData() { |
|
|
|
|
|
const formData = this.getFilledFormData() || {}; |
|
|
|
|
|
const stepTableFormData = formData.stepTableFormData || []; |
|
|
|
|
|
const stepTableFormData_1 = formData.stepTableFormData_1 || []; |
|
|
|
|
|
// 处理数据为复选框options格式(去重+空值过滤) |
|
|
|
|
|
const firstList = stepTableFormData |
|
|
|
|
|
.filter(item => item.fhfw) // 过滤空值 |
|
|
|
|
|
.map(item => ({ label: item.fhfw, value: item.fhfw })) |
|
|
|
|
|
.filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); // 去重 |
|
|
|
|
|
|
|
|
|
|
|
const secondList = stepTableFormData_1 |
|
|
|
|
|
.filter(item => item.fhlr) // 过滤空值 |
|
|
|
|
|
.map(item => ({ label: item.fhlr, value: item.fhlr })) |
|
|
|
|
|
.filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); // 去重 |
|
|
|
|
|
|
|
|
|
|
|
// 更新响应式变量(触发computed更新) |
|
|
|
|
|
this.fhfwCheckOptions = firstList; |
|
|
|
|
|
this.fhlrCheckOptions = secondList; |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|