|
|
@ -11,49 +11,32 @@ |
|
|
<!-- 操作步骤 --> |
|
|
<!-- 操作步骤 --> |
|
|
<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" |
|
|
|
|
|
ref="operateStepRef" :formConfig="operateConfig" :formData="formData" /> |
|
|
|
|
|
<BaseInfoFormPackage v-if="fillType !== 'preFill'" fieldItemLabel="template.dj.dj001.fhfw" |
|
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" ref="operateStepRef" |
|
|
|
|
|
:formConfig="operateConfig" :formData="formData" /> |
|
|
|
|
|
<BaseInfoFormPackage v-if="fillType !== 'preFill'" fieldItemLabel="template.dj.dj001.fhfw" |
|
|
ref="fhfwCheckBoxRef" :formConfig="fhfwCheckBoxConfig" :formData="formData" /> |
|
|
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`" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<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 }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaionDelete |
|
|
|
|
|
:row="row" |
|
|
|
|
|
:rowIndex="rowIndex" |
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'operateTableRef')" |
|
|
|
|
|
></TableOpertaionDelete> |
|
|
|
|
|
|
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'operateTableRef')"> |
|
|
|
|
|
</TableOpertaionDelete> |
|
|
</template> |
|
|
</template> |
|
|
</CustomTable> |
|
|
</CustomTable> |
|
|
</div> |
|
|
</div> |
|
|
<div class="template-form-item" > |
|
|
|
|
|
|
|
|
<div class="template-form-item"> |
|
|
<span>{{ $t('template.dj.dj001.fhlr') }}</span> |
|
|
<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`" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<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 }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaionDelete |
|
|
|
|
|
:row="row" |
|
|
|
|
|
:rowIndex="rowIndex" |
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'fhlrTableRef')" |
|
|
|
|
|
></TableOpertaionDelete> |
|
|
|
|
|
|
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'fhlrTableRef')"> |
|
|
|
|
|
</TableOpertaionDelete> |
|
|
</template> |
|
|
</template> |
|
|
</CustomTable> |
|
|
</CustomTable> |
|
|
</div> |
|
|
</div> |
|
|
@ -130,7 +113,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
//操作步骤配制 |
|
|
//操作步骤配制 |
|
|
@ -146,7 +129,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
//复核范围配制 |
|
|
//复核范围配制 |
|
|
@ -166,11 +149,11 @@ export default { |
|
|
type: "checkboxTree", |
|
|
type: "checkboxTree", |
|
|
fillType: 'actFill', |
|
|
fillType: 'actFill', |
|
|
options: Array.isArray(this.fhlrCheckOptions) ? this.fhlrCheckOptions : [] |
|
|
options: Array.isArray(this.fhlrCheckOptions) ? this.fhlrCheckOptions : [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
//复核范围 |
|
|
//复核范围 |
|
|
@ -204,8 +187,8 @@ export default { |
|
|
fhfwCheck: { checkedValues: [], otherValues: {} }, |
|
|
fhfwCheck: { checkedValues: [], otherValues: {} }, |
|
|
fhlrCheck: { checkedValues: [], otherValues: {} }, |
|
|
fhlrCheck: { checkedValues: [], otherValues: {} }, |
|
|
}, |
|
|
}, |
|
|
fhfwCheckOptions:[], |
|
|
|
|
|
fhlrCheckOptions:[], |
|
|
|
|
|
|
|
|
fhfwCheckOptions: [], |
|
|
|
|
|
fhlrCheckOptions: [], |
|
|
isFirstTableDataRecorded: false, |
|
|
isFirstTableDataRecorded: false, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
@ -213,25 +196,29 @@ export default { |
|
|
this.getTableData() |
|
|
this.getTableData() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 删除表格行 |
|
|
|
|
|
async deleteTableRow(rowIndex, refName) { |
|
|
|
|
|
this.$refs[refName].deleteRow(rowIndex) |
|
|
|
|
|
}, |
|
|
//获取已填写的表单数据 |
|
|
//获取已填写的表单数据 |
|
|
getFilledFormData() { |
|
|
getFilledFormData() { |
|
|
return this.getFilledFormDataByRefs( |
|
|
return this.getFilledFormDataByRefs( |
|
|
[ |
|
|
[ |
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
|
|
|
|
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
] |
|
|
] |
|
|
) |
|
|
) |
|
|
}, |
|
|
}, |
|
|
//获取填写完成的表单数据 |
|
|
//获取填写完成的表单数据 |
|
|
async getFormData() { |
|
|
async getFormData() { |
|
|
let content = await this.validFormFields([ |
|
|
let content = await this.validFormFields([ |
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
|
|
|
|
|
|
"baseInfoRef", "operateStepRef", "operateTableRef", "fhlrTableRef", "fhfwCheckBoxRef" |
|
|
]); |
|
|
]); |
|
|
return content; |
|
|
return content; |
|
|
}, |
|
|
}, |
|
|
getResource() { |
|
|
getResource() { |
|
|
//使用的试剂、仪器 |
|
|
//使用的试剂、仪器 |
|
|
// const stepResource = this.$refs.stepRef.getStepResource() |
|
|
// const stepResource = this.$refs.stepRef.getStepResource() |
|
|
this.resourceTmp = [] |
|
|
|
|
|
|
|
|
this.resourceTmp = [] |
|
|
this.yqResourceTmp = [] |
|
|
this.yqResourceTmp = [] |
|
|
return this.resourceTmp; |
|
|
return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
@ -241,7 +228,7 @@ export default { |
|
|
console.log(content); |
|
|
console.log(content); |
|
|
}, |
|
|
}, |
|
|
// 删除表格行 |
|
|
// 删除表格行 |
|
|
deleteRow(rowIndex,type) { |
|
|
|
|
|
|
|
|
deleteRow(rowIndex, type) { |
|
|
const tableRef1 = this.$refs['operateTableRef']; |
|
|
const tableRef1 = this.$refs['operateTableRef']; |
|
|
const tableRef2 = this.$refs['tableSecondRef']; |
|
|
const tableRef2 = this.$refs['tableSecondRef']; |
|
|
if (type == 'firstTable' && tableRef1) { |
|
|
if (type == 'firstTable' && tableRef1) { |
|
|
@ -258,12 +245,12 @@ export default { |
|
|
// 修复:增加空值保护 |
|
|
// 修复:增加空值保护 |
|
|
const stepTableFormData = formData.stepTableFormData || this.formData.stepTableFormData || []; |
|
|
const stepTableFormData = formData.stepTableFormData || this.formData.stepTableFormData || []; |
|
|
const stepTableFormData_1 = formData.stepTableFormData_1 || this.formData.stepTableFormData_1 || []; |
|
|
const stepTableFormData_1 = formData.stepTableFormData_1 || this.formData.stepTableFormData_1 || []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理数据为checkboxTree期望的格式(包含children结构) |
|
|
// 处理数据为checkboxTree期望的格式(包含children结构) |
|
|
const firstList = stepTableFormData |
|
|
const firstList = stepTableFormData |
|
|
.filter(item => item && item.fhfw && item.fhfw.trim()) // 严格过滤空值 |
|
|
.filter(item => item && item.fhfw && item.fhfw.trim()) // 严格过滤空值 |
|
|
.map(item => ({ |
|
|
|
|
|
label: item.fhfw, |
|
|
|
|
|
|
|
|
.map(item => ({ |
|
|
|
|
|
label: item.fhfw, |
|
|
value: item.fhfw, |
|
|
value: item.fhfw, |
|
|
children: [] // 必须包含children字段,否则checkboxTree会报错 |
|
|
children: [] // 必须包含children字段,否则checkboxTree会报错 |
|
|
})) |
|
|
})) |
|
|
@ -274,8 +261,8 @@ export default { |
|
|
|
|
|
|
|
|
const secondList = stepTableFormData_1 |
|
|
const secondList = stepTableFormData_1 |
|
|
.filter(item => item && item.fhlr && item.fhlr.trim()) // 严格过滤空值 |
|
|
.filter(item => item && item.fhlr && item.fhlr.trim()) // 严格过滤空值 |
|
|
.map(item => ({ |
|
|
|
|
|
label: item.fhlr, |
|
|
|
|
|
|
|
|
.map(item => ({ |
|
|
|
|
|
label: item.fhlr, |
|
|
value: item.fhlr, |
|
|
value: item.fhlr, |
|
|
children: [] // 必须包含children字段 |
|
|
children: [] // 必须包含children字段 |
|
|
})) |
|
|
})) |
|
|
@ -284,11 +271,11 @@ export default { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 响应式更新 |
|
|
// 响应式更新 |
|
|
this.$nextTick(()=>{ |
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
this.fhfwCheckOptions = firstList; |
|
|
this.fhfwCheckOptions = firstList; |
|
|
this.fhlrCheckOptions = secondList; |
|
|
this.fhlrCheckOptions = secondList; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
// 异常时重置为空数组,避免页面崩溃 |
|
|
// 异常时重置为空数组,避免页面崩溃 |
|
|
this.fhfwCheckOptions = []; |
|
|
this.fhfwCheckOptions = []; |
|
|
@ -298,5 +285,4 @@ export default { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss"></style> |