|
|
|
@ -11,47 +11,67 @@ |
|
|
|
<TableList label="template.common.sjInfo" :columns="sjColumns" :dataSource="resourceSj" /> |
|
|
|
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" |
|
|
|
label="template.common.storageCondition" ref="storageConditionRef" |
|
|
|
label="template.common.storageCondition" :ref="refConfig.storageConditionRef" |
|
|
|
:formConfig="storageFormConfig" :formData="formData" /> |
|
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
|
<LineLabel label="样本说明" /> |
|
|
|
<div class="template-form-item"> |
|
|
|
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" @click="printTag">{{ |
|
|
|
$t('template.common.bqdy') }}</el-button> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" |
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> |
|
|
|
<!-- <el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" @click="onAdd">新增</el-button> |
|
|
|
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" @click="printTag">删除</el-button> --> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="样本说明" label = "样本说明" :ref="refConfig.ybsmFormPackageRef" |
|
|
|
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="formData" /> |
|
|
|
<el-button v-if="fillType === 'actFill'" type="primary" @click="onImportAnimal">导入动物</el-button> |
|
|
|
<CustomTable |
|
|
|
:ref = "refConfig.ybsmTableRef" |
|
|
|
:columns="ybsmColumns" |
|
|
|
:showOperation="fillType === 'actFill'" |
|
|
|
:showAddRow="fillType === 'actFill'" |
|
|
|
:dataSource="formData.ybsmData" > |
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
<TableOpertaionDelete |
|
|
|
:row="row" |
|
|
|
:rowIndex="rowIndex" |
|
|
|
:columns="columns" |
|
|
|
@deleteRow="() => deleteTableRow(rowIndex, 'ybsmTableRef')" |
|
|
|
></TableOpertaionDelete> |
|
|
|
</template> |
|
|
|
</CustomTable> |
|
|
|
</div> |
|
|
|
<Step ref="stepRef" :formData="formData.stepData"></Step> |
|
|
|
|
|
|
|
<Step :ref="refConfig.stepRef" :formData="formData.stepData"></Step> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
|
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
|
<ImportExcelDialog ref="ImportExcelDialog" @onLoadData="onLoadExcelData" :downloadArr="['动物编号']" @downloadExcelTemplate="downloadExcelTemplate" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; |
|
|
|
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete"; |
|
|
|
import ImportExcelDialog from '../../dialog/ImportExcelDialog' |
|
|
|
|
|
|
|
import LineLabel from "@/components/Template/LineLabel"; |
|
|
|
import TableList from "@/components/Template/Table"; |
|
|
|
import Step from "@/components/Template/Step"; |
|
|
|
import templateMixin from "../../mixins/templateMixin"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import { getLatestSn } from '@/api/template'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { debounce } from 'lodash-es' |
|
|
|
import { getBaseInfoFormConfig, getStorageFormConfig, getRemarkFormConfig, getYbsmFormConfig,getTableColumns } from "../../formConfig/sp/SP0021"; |
|
|
|
const refConfig = { |
|
|
|
baseInfoRef: "baseInfoRef", |
|
|
|
remarkRef: "remarkRef", |
|
|
|
synrRef: "synrRef", |
|
|
|
yqjgRef: "yqjgRef", |
|
|
|
cjrqRef: "cjrqRef", |
|
|
|
fxpsjwjRef: "fxpsjwjRef", |
|
|
|
storageConditionRef: "storageConditionRef", |
|
|
|
stepRef: "stepRef", |
|
|
|
ybsmTableRef: "ybsmTableRef", |
|
|
|
ybsmFormPackageRef: "ybsmFormPackageRef", |
|
|
|
} |
|
|
|
const compRefs = Object.values(refConfig); |
|
|
|
export default { |
|
|
|
name: "SP0021", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable }, |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete,ImportExcelDialog }, |
|
|
|
mixins: [templateMixin], |
|
|
|
props: { |
|
|
|
fillType: { |
|
|
|
@ -66,206 +86,23 @@ export default { |
|
|
|
computed: { |
|
|
|
// 配置条件 |
|
|
|
storageFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: "conditionItem", |
|
|
|
config: { |
|
|
|
storageCondition: { |
|
|
|
label: 'template.common.storageConditionLabel', |
|
|
|
type: "select", |
|
|
|
fillType: "preFill", |
|
|
|
options: this.getDictOptions("business_cctj"), |
|
|
|
otherCode: "storageConditionOther", |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
return getStorageFormConfig(this) |
|
|
|
}, |
|
|
|
// 备注表单配置 |
|
|
|
remarkConig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: "cellItem", |
|
|
|
config: { |
|
|
|
remark: { |
|
|
|
label: "", |
|
|
|
type: "textarea", |
|
|
|
fillType: "actFill", |
|
|
|
span: 1, |
|
|
|
placeholder: 'template.common.remarkPlaceholder', |
|
|
|
maxlength: 1000, |
|
|
|
rows: 5 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
return getRemarkFormConfig(this) |
|
|
|
}, |
|
|
|
// 试验基本信息表单配置 |
|
|
|
baseInfoFormConfig() { |
|
|
|
//毒理002没得方法编号和版本号 |
|
|
|
let baseConfig = this.sn=='DL002'? |
|
|
|
{ |
|
|
|
studyMc: { |
|
|
|
label: 'template.common.testName', |
|
|
|
type: "input", |
|
|
|
disabled: true, |
|
|
|
}, |
|
|
|
studySn: { |
|
|
|
label: 'template.common.testNumber', |
|
|
|
type: "input", |
|
|
|
disabled: true, |
|
|
|
} |
|
|
|
}: |
|
|
|
{ |
|
|
|
studyMc: { |
|
|
|
label: 'template.common.testName', |
|
|
|
type: "input", |
|
|
|
disabled: true, |
|
|
|
}, |
|
|
|
studySn: { |
|
|
|
label: 'template.common.testNumber', |
|
|
|
type: "input", |
|
|
|
disabled: true, |
|
|
|
}, |
|
|
|
methodCode: { |
|
|
|
label: 'template.common.methodCode', |
|
|
|
type: "input", |
|
|
|
fillType: "preFill", |
|
|
|
maxlength: 50 |
|
|
|
}, |
|
|
|
versionNum: { |
|
|
|
label: 'template.common.versionNumber', |
|
|
|
type: "inputNumber", |
|
|
|
fillType: "actFill", |
|
|
|
prepend: "V", |
|
|
|
maxlength: 50 |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: "cardItem", |
|
|
|
config: baseConfig |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "conditionItem", |
|
|
|
label: 'template.common.testConfigurationConditions', |
|
|
|
config: { |
|
|
|
pre: { |
|
|
|
label: 'template.common.preFill', |
|
|
|
type: "select", |
|
|
|
multiple: true, |
|
|
|
fillType: "preFill", |
|
|
|
options: this.getDictOptions('business_pztj'), |
|
|
|
otherCode: "preOther", |
|
|
|
}, |
|
|
|
act: { |
|
|
|
label: 'template.common.actualFill', |
|
|
|
type: "select", |
|
|
|
fillType: "actFill", |
|
|
|
otherCode: "actOther", |
|
|
|
multiple: true, |
|
|
|
compareTo: "pre", |
|
|
|
options: this.getDictOptions('business_pztj') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "cellItem", |
|
|
|
label: 'template.common.configurationTime', |
|
|
|
config: { |
|
|
|
startDate: { |
|
|
|
label: 'template.common.startTime', |
|
|
|
type: "input", |
|
|
|
}, |
|
|
|
endDate: { |
|
|
|
label: 'template.common.endTime', |
|
|
|
type: "input", |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
return getBaseInfoFormConfig(this) |
|
|
|
}, |
|
|
|
// 操作步骤表单配置 |
|
|
|
stepFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
type: "step", |
|
|
|
config: { |
|
|
|
targetName: { |
|
|
|
label: 'template.common.targetSolutionName', |
|
|
|
type: "input", |
|
|
|
fillType: "preFill", |
|
|
|
maxlength: 50 |
|
|
|
}, |
|
|
|
targetCode: { |
|
|
|
label: 'template.common.targetSolutionCode', |
|
|
|
type: "input", |
|
|
|
subType: "span", |
|
|
|
fillType: "preFill", |
|
|
|
subKey: "targetCodeSn", |
|
|
|
maxlength: 20 |
|
|
|
}, |
|
|
|
targetPreConcentration: { |
|
|
|
label: 'template.common.targetPreConcentration', |
|
|
|
type: "inputNumber", |
|
|
|
subType: "select", |
|
|
|
subKey: "targetPreConcentrationUnit", |
|
|
|
fillType: "preFill", |
|
|
|
subOptions: this.getDictOptions('business_nddw'), |
|
|
|
maxlength: 10, |
|
|
|
selectTo: "targetActConcentrationUnit",//下拉选择后,赋值到对应字段 |
|
|
|
}, |
|
|
|
targetActConcentration: { |
|
|
|
label: 'template.common.targetActConcentration', |
|
|
|
type: "inputNumber", |
|
|
|
subType: "select", |
|
|
|
subKey: "targetActConcentrationUnit", |
|
|
|
compareTo: "targetPreConcentration",//与哪个字段比较 |
|
|
|
fillType: "actFill", |
|
|
|
subFillType: "preFill", |
|
|
|
subOptions: this.getDictOptions('business_nddw'), |
|
|
|
copyFrom: "targetPreConcentration",//复制哪个字段 |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
targetPreVolume: { |
|
|
|
label: 'template.common.targetPreVolume', |
|
|
|
type: "inputNumber", |
|
|
|
subType: "select", |
|
|
|
subKey: "targetPreVolumeUnit", |
|
|
|
subOptions: this.getDictOptions('business_tjdw'), |
|
|
|
fillType: "preFill", |
|
|
|
maxlength: 10, |
|
|
|
selectTo: "targetActVolumeUnit",//下拉选择后,赋值到对应字段 |
|
|
|
}, |
|
|
|
targetActVolume: { |
|
|
|
label: 'template.common.targetActVolume', |
|
|
|
type: "inputNumber", |
|
|
|
subType: "select", |
|
|
|
subKey: "targetActVolumeUnit", |
|
|
|
fillType: "actFill", |
|
|
|
subFillType: "preFill", |
|
|
|
subOptions: this.getDictOptions('business_tjdw'), |
|
|
|
compareTo: "targetPreVolume",//与哪个字段比较 |
|
|
|
copyFrom: "targetPreVolume",//复制哪个字段 |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
effectivePeriod: { |
|
|
|
label: 'template.common.effectivePeriod', |
|
|
|
type: "inputNumber", |
|
|
|
subType: "select", |
|
|
|
subKey: "effectivePeriodUnit", |
|
|
|
fillType: "preFill", |
|
|
|
subOptions: this.getDictOptions('business_yxqdw'), |
|
|
|
maxlength: 10 |
|
|
|
}, |
|
|
|
expireDate: { |
|
|
|
label: 'template.common.expireDate', |
|
|
|
type: "input", |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
// 样本说明 |
|
|
|
ybsmFormConfig() { |
|
|
|
return getYbsmFormConfig(this) |
|
|
|
}, |
|
|
|
// 样本说明表格列 |
|
|
|
ybsmColumns() { |
|
|
|
return getTableColumns(this) |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
@ -275,40 +112,35 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const formData = this.getFormDataByTemplateData(); |
|
|
|
if (!formData.targetCodeSn && this.fillType === "actFill") { |
|
|
|
this.getCode(formData); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//打印标签 |
|
|
|
printTag() { |
|
|
|
const printConfig = this.getBasePrintConfig(); |
|
|
|
const { storageCondition, targetCodeSn } = this.formData; |
|
|
|
printConfig["存储条件"] = storageCondition; |
|
|
|
printConfig["编号"] = targetCodeSn; |
|
|
|
|
|
|
|
EventBus.$emit('showTagPrintDialog', { printConfig }) |
|
|
|
onLoadExcelData(excelData) { |
|
|
|
const data = excelData.splice(1); |
|
|
|
console.log(data,"ddd") |
|
|
|
this.$refs.ImportExcelDialog.cancel() |
|
|
|
setTimeout(() => { |
|
|
|
this.justUpdateFilledFormData(); |
|
|
|
}, 100); |
|
|
|
}, |
|
|
|
downloadExcelTemplate(arr){ |
|
|
|
this.exportExcel(arr) |
|
|
|
}, |
|
|
|
// 导入动物 |
|
|
|
onImportAnimal(){ |
|
|
|
this.$refs.ImportExcelDialog.show() |
|
|
|
}, |
|
|
|
// 删除表格行 |
|
|
|
deleteTableRow(rowIndex, refName) { |
|
|
|
this.$refs[refName].deleteRow(rowIndex) |
|
|
|
}, |
|
|
|
//获取目标溶液编号 |
|
|
|
getCode: debounce(async function (v) { |
|
|
|
const result = await getLatestSn({ |
|
|
|
count: 1, |
|
|
|
pre: v.targetCode, |
|
|
|
type: 1 |
|
|
|
}) |
|
|
|
if (result.code == 200) { |
|
|
|
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0]) |
|
|
|
} |
|
|
|
}, 100), |
|
|
|
//获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]) |
|
|
|
return this.getFilledFormDataByRefs(compRefs) |
|
|
|
}, |
|
|
|
//获取填写完成的表单数据 |
|
|
|
async getFormData() { |
|
|
|
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); |
|
|
|
let content = await this.validFormFields(compRefs); |
|
|
|
return content; |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
|