| @ -0,0 +1,314 @@ | |||
| <!-- Ames实验(掺入法)平皿培养记录表 --> | |||
| <template> | |||
| <div> | |||
| <div class="detail-container"> | |||
| <div class="detail-title"> | |||
| <img src="@/assets/images/detail-title.png" />{{ formData.bdmc | |||
| }}<img src="@/assets/images/detail-title.png" /> | |||
| </div> | |||
| <div class="detail-content"> | |||
| <div class="content"> | |||
| <BaseInfoFormPackage | |||
| fieldItemLabel="template.common.baseInfo" | |||
| label="template.common.baseInfo" | |||
| :ref="refConf.base" | |||
| :formConfig="baseInfoFormConfig" | |||
| :formData="formData" | |||
| /> | |||
| <LineLabel label="template.dl.dl007.yqsyxx" /> | |||
| <CustomTable | |||
| :columns="yqsyColumns" | |||
| :ref="refConf.yqsy" | |||
| @onRegentSubmit="(e) => onRegentSubmit(e)" | |||
| :showOperation="fillType === 'actFill'" | |||
| :showAddRow="fillType === 'actFill'" | |||
| :formData="formData" | |||
| :prefixKey="`yqsyTable`" | |||
| > | |||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||
| <TableOpertaionDelete | |||
| :row="row" | |||
| :rowIndex="rowIndex" | |||
| :columns="columns" | |||
| @deleteRow="() => deleteTableRow(rowIndex, 'yqsyTableRef')" | |||
| ></TableOpertaionDelete> | |||
| </template> | |||
| </CustomTable> | |||
| <BaseInfoFormPackage | |||
| fieldItemLabel="template.dl.dl007.czxx" | |||
| label="template.dl.dl007.czxx" | |||
| :ref="refConf.czInfo" | |||
| :formConfig="czInfoFormConfig" | |||
| :formData="formData" | |||
| @clickButton="handleClickButton" | |||
| @onRegentSubmit="onRegentSubmit" | |||
| /> | |||
| <BaseInfoFormPackage | |||
| fieldItemLabel="template.dl.dl007.bz" | |||
| label="template.dl.dl007.bz" | |||
| :ref="refConf.remark" | |||
| :formConfig="remarkConig" | |||
| :formData="formData" | |||
| /> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import BaseInfoFormPackage from '@/components/Template/BaseInfoFormPackage' | |||
| import TableOpertaionDelete from '@/components/Template/operation/TableOpertaionDelete.vue' | |||
| import CustomTable from '@/components/Template/CustomTable.vue' | |||
| import LineLabel from '@/components/Template/LineLabel' | |||
| import TableList from '@/components/Template/Table' | |||
| import Step from '@/components/Template/Step' | |||
| import templateMixin from '../../mixins/templateMixin' | |||
| import moment from 'moment' | |||
| const refConf = { | |||
| base: 'baseInfoRef', | |||
| yqsy: 'yqsyTableRef', | |||
| czInfo: 'czInfoRef', | |||
| remark: 'remarkRef' | |||
| } | |||
| const refNames = Object.values(refConf) | |||
| export default { | |||
| name: 'DL007', | |||
| components: { | |||
| BaseInfoFormPackage, | |||
| LineLabel, | |||
| TableList, | |||
| Step, | |||
| CustomTable, | |||
| TableOpertaionDelete | |||
| }, | |||
| mixins: [templateMixin], | |||
| props: { | |||
| fillType: { | |||
| type: String, | |||
| default: 'preFill' | |||
| } | |||
| }, | |||
| computed: { | |||
| // 备注表单配置 | |||
| remarkConig() { | |||
| return [ | |||
| { | |||
| type: 'cellItem', | |||
| config: { | |||
| remark: { | |||
| label: '', | |||
| type: 'textarea', | |||
| fillType: 'actFill', | |||
| span: 1, | |||
| placeholder: 'template.common.remarkPlaceholder', | |||
| maxlength: 1000, | |||
| rows: 5 | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 试验基本信息表单配置 | |||
| baseInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: 'cardItem', | |||
| config: { | |||
| studyMc: { | |||
| label: 'template.common.testName', | |||
| type: 'input', | |||
| disabled: true | |||
| }, | |||
| studySn: { | |||
| label: 'template.common.testNumber', | |||
| type: 'input', | |||
| disabled: true | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| type: 'conditionItem', | |||
| label: 'template.dl.dl007.sydd', | |||
| config: { | |||
| sydd: { | |||
| span: 1, | |||
| label: 'template.dl.dl007.sydd', | |||
| type: 'select', | |||
| options: this.getDictOptions('business_sydd'), | |||
| fillType: 'actFill', | |||
| otherCode: 'syddOther' | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| type: 'cellItem', | |||
| label: 'template.common.configurationTime', | |||
| config: { | |||
| startDate: { | |||
| label: 'template.common.startTime', | |||
| type: 'input', | |||
| disabled: true | |||
| }, | |||
| endDate: { | |||
| label: 'template.common.endTime', | |||
| type: 'input', | |||
| disabled: true | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 仪器使用信息 | |||
| yqsyColumns() { | |||
| return [ | |||
| { | |||
| label: 'template.dl.dl007.yqbh', | |||
| prop: 'yqbh', | |||
| bodyType: 'yq', | |||
| bodyFillType: 'actFill' | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.yqmc', | |||
| prop: 'yqmc', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.yqxh', | |||
| prop: 'yqxh', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.xccsjzjdrq', | |||
| prop: 'jzrq', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| } | |||
| ] | |||
| }, | |||
| // 操作信息表信息 | |||
| czInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: 'cellItem', | |||
| config: { | |||
| qxbd: { | |||
| label: 'template.dl.dl007.qxbd', | |||
| type: 'qxbd', | |||
| fillType: 'actFill', | |||
| filledCodes: ['bdmc', 'bdbh'] | |||
| }, | |||
| pykssj: { | |||
| label: 'template.dl.dl007.pykssj', | |||
| fillType: 'actFill', | |||
| type: 'input', | |||
| disabled: true | |||
| }, | |||
| pyjssj: { | |||
| label: 'template.dl.dl007.pyjssj', | |||
| type: 'input', | |||
| fillType: 'actFill', | |||
| maxlength: 200, | |||
| subType: 'button', | |||
| subKey: 'pyjssjButton', | |||
| buttonName: 'template.dl.dl007.jsButton' | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| data() { | |||
| return { | |||
| formData: {}, | |||
| refConf | |||
| } | |||
| }, | |||
| methods: { | |||
| // 删除表格行 | |||
| deleteTableRow(rowIndex, refName) { | |||
| this.$refs[refName].deleteRow(rowIndex) | |||
| }, | |||
| // 点击按钮 | |||
| handleClickButton(_item, signData) { | |||
| this.$refs.czInfoRef.updateFormData( | |||
| 'pyjssj', | |||
| moment().format('YYYY/MM/DD HH:mm'), | |||
| { isUpdateRecord: true, signData } | |||
| ) | |||
| }, | |||
| // 获取已填写的表单数据 | |||
| getFilledFormData() { | |||
| return this.getFilledFormDataByRefs(refNames) | |||
| }, | |||
| // 获取填写完成的表单数据 | |||
| async getFormData() { | |||
| return await this.validFormFields(refNames) | |||
| }, | |||
| // 只做校验 | |||
| async validFields() { | |||
| return await this.validFormFields(refNames) | |||
| }, | |||
| getResource() { | |||
| const stepResource = this.$refs.yqsyTableRef.getStepResource() | |||
| // 使用的试剂、仪器 | |||
| this.resourceTmp = stepResource.sjResource || [] | |||
| this.yqResourceTmp = stepResource.yqResource || [] | |||
| return this.resourceTmp | |||
| }, | |||
| onRegentSubmit(e) { | |||
| const { selectInfo, key, rowIndex } = e | |||
| const { row } = selectInfo | |||
| if (key === 'yqbh') { | |||
| const params = { | |||
| yqmc: row.mc, | |||
| yqxh: row.xh, | |||
| jzrq: row.jzrq | |||
| } | |||
| this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) | |||
| } | |||
| if (key === 'qxbd') { | |||
| this.$refs.czInfoRef.updateFormData('pykssj', row.startDate) | |||
| } | |||
| }, | |||
| // 保存 | |||
| async onSave() { | |||
| const formData = this.getStepResource() | |||
| console.log(formData, 'formData') | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"> | |||
| .mt-20 { | |||
| margin-top: 20px; | |||
| } | |||
| .print-btn { | |||
| margin-bottom: 20px; | |||
| } | |||
| .config-header-end { | |||
| display: flex; | |||
| justify-content: flex-end; | |||
| align-items: center; | |||
| margin-bottom: 15px; | |||
| font-weight: bold; | |||
| font-size: 16px; | |||
| color: #303133; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,339 @@ | |||
| <!-- Ames试验平皿成像确认记录表 --> | |||
| <template> | |||
| <div> | |||
| <div class="detail-container"> | |||
| <div class="detail-title"> | |||
| <img src="@/assets/images/detail-title.png" />{{ formData.bdmc | |||
| }}<img src="@/assets/images/detail-title.png" /> | |||
| </div> | |||
| <div class="detail-content"> | |||
| <div class="content"> | |||
| <BaseInfoFormPackage | |||
| fieldItemLabel="template.common.baseInfo" | |||
| label="template.common.baseInfo" | |||
| :ref="refConf.base" | |||
| :formConfig="baseInfoFormConfig" | |||
| :formData="formData" | |||
| /> | |||
| <LineLabel label="template.dl.dl007.yqsyxx" /> | |||
| <CustomTable | |||
| :columns="yqsyColumns" | |||
| :ref="refConf.yqsy" | |||
| @onRegentSubmit="(e) => onRegentSubmit(e)" | |||
| :showOperation="fillType === 'actFill'" | |||
| :showAddRow="fillType === 'actFill'" | |||
| :formData="formData" | |||
| :prefixKey="`yqsyTable`" | |||
| > | |||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||
| <TableOpertaionDelete | |||
| :row="row" | |||
| :rowIndex="rowIndex" | |||
| :columns="columns" | |||
| @deleteRow="() => deleteTableRow(rowIndex, 'yqsyTableRef')" | |||
| ></TableOpertaionDelete> | |||
| </template> | |||
| </CustomTable> | |||
| <!-- 成像情况 --> | |||
| <LineLabel label="template.dl.dl008.cxqk" /> | |||
| <BaseInfoFormPackage | |||
| :ref="refConf.cxqkqxbb" | |||
| :formConfig="cxqkqxbbInfoFormConfig" | |||
| :formData="formData" | |||
| @clickButton="handleClickButton" | |||
| @onRegentSubmit="onRegentSubmit" | |||
| /> | |||
| <CustomTable | |||
| :columns="cxqkColumns" | |||
| :ref="refConf.cxqk" | |||
| @onRegentSubmit="(e) => onRegentSubmit(e)" | |||
| :showOperation="fillType === 'actFill'" | |||
| :formData="formData" | |||
| :prefixKey="`cxqkTable`" | |||
| > | |||
| </CustomTable> | |||
| <BaseInfoFormPackage | |||
| :ref="refConf.cxqkwrqk" | |||
| :formConfig="cxqkwrqkConfig" | |||
| :formData="formData" | |||
| /> | |||
| <BaseInfoFormPackage | |||
| fieldItemLabel="template.dl.dl007.bz" | |||
| label="template.dl.dl007.bz" | |||
| :ref="refConf.remark" | |||
| :formConfig="remarkConfig" | |||
| :formData="formData" | |||
| /> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import BaseInfoFormPackage from '@/components/Template/BaseInfoFormPackage' | |||
| import TableOpertaionDelete from '@/components/Template/operation/TableOpertaionDelete.vue' | |||
| import CustomTable from '@/components/Template/CustomTable.vue' | |||
| import LineLabel from '@/components/Template/LineLabel' | |||
| import TableList from '@/components/Template/Table' | |||
| import Step from '@/components/Template/Step' | |||
| import templateMixin from '../../mixins/templateMixin' | |||
| import moment from 'moment' | |||
| const refConf = { | |||
| base: 'baseInfoRef', | |||
| yqsy: 'yqsyTableRef', | |||
| cxqkqxbb: 'cxqkqxbbInfoRef', | |||
| cxqk: 'cxqkTableRef', | |||
| cxqkwrqk: 'cxqkwrqkInfoRef', | |||
| remark: 'remarkRef' | |||
| } | |||
| const refNames = Object.values(refConf) | |||
| export default { | |||
| name: 'DL008', | |||
| components: { | |||
| BaseInfoFormPackage, | |||
| LineLabel, | |||
| TableList, | |||
| Step, | |||
| CustomTable, | |||
| TableOpertaionDelete | |||
| }, | |||
| mixins: [templateMixin], | |||
| props: { | |||
| fillType: { | |||
| type: String, | |||
| default: 'preFill' | |||
| } | |||
| }, | |||
| computed: { | |||
| // 备注表单配置 | |||
| remarkConfig() { | |||
| return [ | |||
| { | |||
| type: 'cellItem', | |||
| config: { | |||
| remark: { | |||
| label: '', | |||
| type: 'textarea', | |||
| fillType: 'actFill', | |||
| span: 1, | |||
| placeholder: 'template.common.remarkPlaceholder', | |||
| maxlength: 1000, | |||
| rows: 5 | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 成像情况-污染情况信息 | |||
| cxqkwrqkConfig() { | |||
| return [ | |||
| { | |||
| type: 'conditionItem', | |||
| config: { | |||
| cxqkwrqk: { | |||
| // 注意:这里选项为污染时需要填写信息,与别的选择中 '其他' 选项不一样 | |||
| span: 1, | |||
| label: 'template.dl.dl008.wrqk', | |||
| type: 'select', | |||
| options: this.getDictOptions('business_dl_ameswrqk'), | |||
| fillType: 'actFill', | |||
| otherCode: 'cxqkwrqkOther' | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 试验基本信息表单配置 | |||
| baseInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: 'cardItem', | |||
| config: { | |||
| studyMc: { | |||
| label: 'template.common.testName', | |||
| type: 'input', | |||
| disabled: true | |||
| }, | |||
| studySn: { | |||
| label: 'template.common.testNumber', | |||
| type: 'input', | |||
| disabled: true | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| type: 'conditionItem', | |||
| label: 'template.dl.dl007.sydd', | |||
| config: { | |||
| sydd: { | |||
| span: 1, | |||
| label: 'template.dl.dl007.sydd', | |||
| type: 'select', | |||
| options: this.getDictOptions('business_sydd'), | |||
| fillType: 'actFill', | |||
| otherCode: 'syddOther' | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| type: 'cellItem', | |||
| label: 'template.common.configurationTime', | |||
| config: { | |||
| startDate: { | |||
| label: 'template.common.startTime', | |||
| type: 'input', | |||
| disabled: true | |||
| }, | |||
| endDate: { | |||
| label: 'template.common.endTime', | |||
| type: 'input', | |||
| disabled: true | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 成像情况-操作信息列表信息 TODO:数据结构可能需要动态生成 | |||
| cxqkColumns() { | |||
| return [] | |||
| }, | |||
| // 仪器使用信息 | |||
| yqsyColumns() { | |||
| return [ | |||
| { | |||
| label: 'template.dl.dl007.yqbh', | |||
| prop: 'yqbh', | |||
| bodyType: 'yq', | |||
| bodyFillType: 'actFill' | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.yqmc', | |||
| prop: 'yqmc', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.yqxh', | |||
| prop: 'yqxh', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| }, | |||
| { | |||
| label: 'template.dl.dl007.xccsjzjdrq', | |||
| prop: 'jzrq', | |||
| bodyType: 'input', | |||
| bodyDisabled: true, | |||
| bodyFillType: 'actFill', | |||
| disabled: true | |||
| } | |||
| ] | |||
| }, | |||
| // 成像情况-前序表单信息 | |||
| cxqkqxbbInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: 'cellItem', | |||
| config: { | |||
| cxqkqxbd: { | |||
| label: 'template.dl.dl007.qxbd', | |||
| type: 'qxbd', | |||
| fillType: 'actFill', | |||
| filledCodes: ['bdmc', 'bdbh'] | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| } | |||
| }, | |||
| data() { | |||
| return { | |||
| formData: {}, | |||
| refConf | |||
| } | |||
| }, | |||
| mounted() {}, | |||
| methods: { | |||
| // 删除表格行 | |||
| deleteTableRow(rowIndex, refName) { | |||
| this.$refs[refName].deleteRow(rowIndex) | |||
| }, | |||
| // 点击按钮 | |||
| handleClickButton(_item, signData) { | |||
| this.$refs.cxqkqxbbInfoRef.updateFormData( | |||
| 'pyjssj', | |||
| moment().format('YYYY/MM/DD HH:mm'), | |||
| { isUpdateRecord: true, signData } | |||
| ) | |||
| }, | |||
| //获取已填写的表单数据 | |||
| getFilledFormData() { | |||
| return this.getFilledFormDataByRefs(refNames) | |||
| }, | |||
| //获取填写完成的表单数据 | |||
| async getFormData() { | |||
| return await this.validFormFields(refNames) | |||
| }, | |||
| //只做校验 | |||
| async validFields() { | |||
| return await this.validFormFields(refNames) | |||
| }, | |||
| getResource() { | |||
| const stepResource = this.$refs.yqsyTableRef.getStepResource() | |||
| // 使用的试剂、仪器 | |||
| this.resourceTmp = stepResource.sjResource || [] | |||
| this.yqResourceTmp = stepResource.yqResource || [] | |||
| return this.resourceTmp | |||
| }, | |||
| onRegentSubmit(e) { | |||
| const { selectInfo, key, rowIndex } = e | |||
| const { row } = selectInfo | |||
| if (key === 'yqbh') { | |||
| const params = { | |||
| yqmc: row.mc, | |||
| yqxh: row.xh, | |||
| jzrq: row.jzrq | |||
| } | |||
| this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) | |||
| } | |||
| if (key === 'qxbd') { | |||
| this.$refs.cxqkqxbbInfoRef.updateFormData('pykssj', row.startDate) | |||
| } | |||
| }, | |||
| // 保存 | |||
| async onSave() { | |||
| const formData = this.getStepResource() | |||
| console.log(formData, 'formData') | |||
| } | |||
| } | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"> | |||
| .mt-20 { | |||
| margin-top: 20px; | |||
| } | |||
| .print-btn { | |||
| margin-bottom: 20px; | |||
| } | |||
| .config-header-end { | |||
| display: flex; | |||
| justify-content: flex-end; | |||
| align-items: center; | |||
| margin-bottom: 15px; | |||
| font-weight: bold; | |||
| font-size: 16px; | |||
| color: #303133; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- Ames试验(掺入法)观察结果记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL009', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 骨髓收集记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL010', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 细胞复苏记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL011', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 细胞制备记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL012', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 细胞密度测定记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL013', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 细胞给药/观察记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL014', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -0,0 +1,16 @@ | |||
| <!-- 细胞换液/观察记录表 --> | |||
| <template> | |||
| <div></div> | |||
| </template> | |||
| <script> | |||
| export default { | |||
| name: 'DL015', | |||
| data() { | |||
| return {} | |||
| }, | |||
| mounted() {}, | |||
| methods: {} | |||
| } | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"></style> | |||
| @ -1,232 +0,0 @@ | |||
| <!-- 试验物质配制计划表 --> | |||
| <template> | |||
| <div> | |||
| <div class="detail-container"> | |||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">试验物质配制计划表<img | |||
| src="@/assets/images/detail-title.png" /></div> | |||
| <div class="detail-content"> | |||
| <div class="content"> | |||
| <BaseInfoFormPackage label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig" | |||
| :formData="formData" /> | |||
| <LineLabel label="计划信息" /> | |||
| <div class="template-form-item"> | |||
| <BaseInfoFormPackage ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur" | |||
| :formData="formData" /> | |||
| <CustomTable @blur="onHandleTableBlur" :showHeaderSelect="fillType === 'actFill'" :showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns" | |||
| :formData="formData" > | |||
| <template slot="operation" slot-scope="{ row, rowIndex, columns }"> | |||
| <TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion> | |||
| </template> | |||
| </CustomTable> | |||
| <div class="add-row"> | |||
| <el-button type="primary" plain @click="addRow">添加行</el-button> | |||
| </div> | |||
| </div> | |||
| <BaseInfoFormPackage label="特别说明" ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||
| </div> | |||
| </div> | |||
| <button @click="onSave">保存</button> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; | |||
| import LineLabel from "@/components/Template/LineLabel"; | |||
| import templateMixin from "../../mixins/templateMixin"; | |||
| import CustomTable from '@/components/Template/CustomTable.vue'; | |||
| import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" | |||
| export default { | |||
| name: "SYWZPZJHB", | |||
| components: { BaseInfoFormPackage, LineLabel, CustomTable, TableOpertaion }, | |||
| mixins: [templateMixin], | |||
| props: { | |||
| value: { | |||
| type: {}, | |||
| default: () => { }, | |||
| }, | |||
| fillType: { | |||
| type: String, | |||
| default: 'preFill', | |||
| }, | |||
| }, | |||
| watch: { | |||
| value: { | |||
| immediate: true, | |||
| handler(v) { | |||
| } | |||
| }, | |||
| fillType: { | |||
| immediate: true, | |||
| handler(v) { | |||
| console.log(v,"fillType") | |||
| } | |||
| }, | |||
| }, | |||
| computed: { | |||
| // 备注表单配置 | |||
| remarkConig() { | |||
| return [ | |||
| { | |||
| type: "cellItem", | |||
| config: { | |||
| remark: { | |||
| label: "", | |||
| type: "textarea", | |||
| fillType: "actFill", | |||
| span: 1, | |||
| placeholder: "请输入特别说明", | |||
| maxlength: 1000, | |||
| rows: 5 | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 试验基本信息表单配置 | |||
| baseInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: "cardItem", | |||
| config: { | |||
| studyMc: { | |||
| label: "试验名称", | |||
| type: "input", | |||
| disabled: true, | |||
| }, | |||
| studySn: { | |||
| label: "试验编号", | |||
| type: "input", | |||
| disabled: true, | |||
| }, | |||
| } | |||
| }, | |||
| ] | |||
| }, | |||
| // 操作步骤表单配置 | |||
| stepFormConfig() { | |||
| return [ | |||
| { | |||
| type: "step", | |||
| config: { | |||
| drawTime: { | |||
| label: "领取时间", | |||
| type: "input", | |||
| fillType: "actFill", | |||
| }, | |||
| analyzeTime: { | |||
| label: "分析时间", | |||
| type: "input", | |||
| fillType: "actFill", | |||
| }, | |||
| testSubstance: { | |||
| label: "试验物质", | |||
| type: "input", | |||
| fillType: "actFill", | |||
| }, | |||
| configFrequency: { | |||
| label: "配置频率", | |||
| type: "input", | |||
| fillType: "actFill", | |||
| }, | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 步骤表格列配置 | |||
| stepColumns() { | |||
| return [ | |||
| { | |||
| label: "给药剂量或组别", | |||
| prop: "startSolutionCode", | |||
| width: 280, | |||
| bodyType: "input", | |||
| bodyFillType: "actFill", | |||
| bodyMaxlength: 50, | |||
| }, | |||
| { | |||
| label: "配制浓度", | |||
| prop: "preparationConcentration", | |||
| width: 280, | |||
| headerSelectKey: "preparationConcentrationUnit", | |||
| fillType: "actFill", | |||
| headerOptions: this.getDictOptions('business_nddw'), | |||
| bodyType: "input", | |||
| bodyFillType: "actFill", | |||
| bodyMaxlength: 50, | |||
| }, | |||
| { | |||
| label: "配制体积", | |||
| prop: "preparationVolume", | |||
| width: 280, | |||
| headerSelectKey: "preparationVolumeUnit", | |||
| fillType: "actFill", | |||
| headerOptions: this.getDictOptions('business_tjdw'), | |||
| bodyType: "input", | |||
| bodyFillType: "actFill", | |||
| bodyMaxlength: 50, | |||
| }, | |||
| ] | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| selectReagentVisible: false, | |||
| subSolutionVisible: false, | |||
| currentSubKey: "",//当前点击的子项key | |||
| dataSource: [], | |||
| stepTableDataSource: [], | |||
| }; | |||
| }, | |||
| mounted() { | |||
| }, | |||
| methods: { | |||
| async getFormData() { | |||
| const baseData = await this.$refs.baseInfoRef.getFormData(); | |||
| const stepFormData = await this.$refs.stepFormPackageRef.getFormData(); | |||
| const stepTableFormData = await this.$refs.stepTableRef.getFormData(); | |||
| const remarkData = await this.$refs.remarkRef.getFormData(); | |||
| if(!stepTableFormData.stepTableFormData.length){ | |||
| this.$message.error("请添加计划信息"); | |||
| return; | |||
| } | |||
| return { | |||
| ...baseData, | |||
| ...stepFormData, | |||
| ...remarkData, | |||
| ...stepTableFormData | |||
| } | |||
| }, | |||
| async onSave() { | |||
| const formData = await this.getFormData(); | |||
| // const formData = await this.$refs.stepTableRef.getFormData(); | |||
| console.log(formData, "formData") | |||
| }, | |||
| // 添加行 | |||
| addRow() { | |||
| this.$refs.stepTableRef.addRow({ | |||
| startSolutionCode: "", | |||
| preparationConcentration: "", | |||
| preparationVolume: "", | |||
| }) | |||
| } | |||
| } | |||
| }; | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"> | |||
| .mt-20 { | |||
| margin-top: 20px; | |||
| } | |||
| .add-row{ | |||
| display: flex; | |||
| justify-content: center; | |||
| padding: 20px 0; | |||
| } | |||
| </style> | |||
| @ -0,0 +1,441 @@ | |||
| <!-- 供试品部试剂配制记录表 --> | |||
| <template> | |||
| <div> | |||
| <div class="detail-container"> | |||
| <div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc }}<img | |||
| src="@/assets/images/detail-title.png" /></div> | |||
| <div class="detail-content"> | |||
| <div class="content"> | |||
| <!-- 基本信息 --> | |||
| <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" | |||
| ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> | |||
| <!-- 基本信息 --> | |||
| <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" | |||
| :formConfig="storageFormConfig" :formData="formData" /> | |||
| <LineLabel label="template.common.operationSteps" /> | |||
| <!-- 操作步骤 --> | |||
| <div v-for="(formConfig, ladderIndex) in formData.formConfigs" :key="'ladder_' + ladderIndex"> | |||
| <div class="template-form-item"> | |||
| <div class="config-header-right"> | |||
| <el-button v-if="fillType === 'preFill'" type="primary" @click="handleAddFormConfig">{{ | |||
| $t('template.common.addBtn') }}</el-button> | |||
| <el-button v-if="fillType === 'preFill' && formData.formConfigs.length > 1" | |||
| type="danger" @click="handleDeleteFormConfig(ladderIndex)">{{ | |||
| $t('template.common.deleteBtn') | |||
| }}</el-button> | |||
| <el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" | |||
| @click="printTag">{{ $t('template.common.bqdy') }}</el-button> | |||
| </div> | |||
| <BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" | |||
| :ref="`formConfigStepFormPackageRef_${ladderIndex}`" :formConfig="stepFormConfig" | |||
| :formData="formConfig" /> | |||
| <Step class="mt-0 s-container" :ref="`formStepRef_${ladderIndex}`" | |||
| :formData="formConfig.stepData" :fieldItemLabel="$t('template.common.jtpz')" | |||
| :prefixKey="'form_' + ladderIndex"></Step> | |||
| </div> | |||
| </div> | |||
| <!-- 备注 --> | |||
| <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" | |||
| ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; | |||
| 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 { duplicateResource, getExpireDate } from "@/utils/index.js"; | |||
| export default { | |||
| name: "DMYPPZJLB", | |||
| components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable }, | |||
| mixins: [templateMixin], | |||
| props: { | |||
| fillType: { | |||
| type: String, | |||
| default: 'preFill', | |||
| }, | |||
| }, | |||
| computed: { | |||
| // 配置条件 | |||
| storageFormConfig() { | |||
| return [ | |||
| { | |||
| type: "conditionItem", | |||
| config: { | |||
| storageCondition: { | |||
| label: 'template.common.storageConditionLabel', | |||
| type: "select", | |||
| fillType: "preFill", | |||
| options: this.getDictOptions("business_cctj"), | |||
| otherCode: "storageConditionOther", | |||
| }, | |||
| } | |||
| } | |||
| ]; | |||
| }, | |||
| // 备注表单配置 | |||
| remarkConig() { | |||
| return [ | |||
| { | |||
| type: "cellItem", | |||
| config: { | |||
| remark: { | |||
| label: "", | |||
| type: "textarea", | |||
| fillType: "actFill", | |||
| span: 1, | |||
| placeholder: 'template.common.remarkPlaceholder', | |||
| maxlength: 1000, | |||
| rows: 5 | |||
| } | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 试验基本信息表单配置 | |||
| baseInfoFormConfig() { | |||
| return [ | |||
| { | |||
| type: "cardItem", | |||
| config: { | |||
| 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 | |||
| }, | |||
| } | |||
| }, | |||
| { | |||
| 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", | |||
| }, | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| // 操作步骤表单配置 | |||
| 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", | |||
| }, | |||
| } | |||
| } | |||
| ] | |||
| }, | |||
| }, | |||
| data() { | |||
| return { | |||
| formData: {} | |||
| }; | |||
| }, | |||
| mounted() { | |||
| const formData = this.getFormDataByTemplateData(); | |||
| if (!formData.targetCodeSn && this.fillType === "actFill") { | |||
| this.getCode(formData); | |||
| } else { | |||
| if (!this.formData.formConfigs) { | |||
| this.$set(this.formData, 'formConfigs', []); | |||
| this.formData.formConfigs.push({ | |||
| formConfigs: [], | |||
| }); | |||
| } | |||
| } | |||
| }, | |||
| methods: { | |||
| //新增 | |||
| handleAddFormConfig() { | |||
| if (!this.formData.formConfigs) { | |||
| this.$set(this.formData, 'formConfigs', []); | |||
| } | |||
| this.formData.formConfigs.push({ | |||
| formConfigs: [], | |||
| }); | |||
| }, | |||
| //删除 | |||
| handleDeleteFormConfig(index) { | |||
| this.formData.formConfigs.splice(index, 1); | |||
| }, | |||
| //todo 打印标签 | |||
| printTag() { | |||
| const printConfig = this.getBasePrintConfig(); | |||
| const { storageCondition, targetCodeSn } = this.formData; | |||
| printConfig["存储条件"] = storageCondition; | |||
| printConfig["编号"] = targetCodeSn; | |||
| EventBus.$emit('showTagPrintDialog', { printConfig }) | |||
| }, | |||
| //填报获取编号 | |||
| getCode: debounce(async function (v) { | |||
| if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { | |||
| for (let i = 0; i < this.formData.formConfigs.length; i++) { | |||
| let item = this.formData.formConfigs[i] | |||
| const result = await getLatestSn({ | |||
| count: 1, | |||
| pre: item.targetCode, | |||
| type: 1 | |||
| }) | |||
| if (result.code == 200) { | |||
| this.$refs[`formConfigStepFormPackageRef_${i}`][0].updateFormData("targetCodeSn", result.data[0]) | |||
| } | |||
| } | |||
| } | |||
| }, 100), | |||
| //获取字段值,不检验 | |||
| getFilledFormData() { | |||
| const baseData = this.$refs.baseInfoRef.getFilledFormData(); | |||
| const conditionData = this.$refs.storageConditionRef.getFilledFormData(); | |||
| const formConfigsData = []; | |||
| if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { | |||
| for (let i = 0; i < this.formData.formConfigs.length; i++) { | |||
| const formData = this.$refs[`formConfigStepFormPackageRef_${i}`][0].getFilledFormData(); | |||
| const stepData = this.$refs[`formStepRef_${i}`][0].getFilledFormData(); | |||
| if(this.formData.startDate&&formData.effectivePeriod&&formData.effectivePeriodUnit){ | |||
| formData.expireDate=getExpireDate(this.formData.startDate, formData.effectivePeriod, formData.effectivePeriodUnit) | |||
| } | |||
| formConfigsData.push({ | |||
| ...formData, | |||
| ...stepData, | |||
| }); | |||
| } | |||
| } | |||
| const remarkData = this.$refs.remarkRef.getFilledFormData(); | |||
| return { | |||
| ...baseData, | |||
| ...conditionData, | |||
| formConfigs: formConfigsData, | |||
| ...remarkData | |||
| } | |||
| }, | |||
| //检验 | |||
| async validFields() { | |||
| // 构建需要验证的引用数组 | |||
| let refsToValidate = ["baseInfoRef", "storageConditionRef", "remarkRef"]; | |||
| if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { | |||
| for (let i = 0; i < this.formData.formConfigs.length; i++) { | |||
| refsToValidate.push(`formConfigStepFormPackageRef_${i}`); | |||
| refsToValidate.push(`formStepRef_${i}`); | |||
| } | |||
| } | |||
| return await this.validFormFields(refsToValidate); | |||
| }, | |||
| //获取字段值 | |||
| async getFormData() { | |||
| //先校验再获取值 | |||
| const validFlag = await this.validFields(); | |||
| if (!validFlag) { | |||
| return false; | |||
| } | |||
| let content = this.getFilledFormData(); | |||
| return content; | |||
| }, | |||
| //获取生成,使用物资 | |||
| getResource() { | |||
| let content = this.getFilledFormData(); | |||
| //生成resource | |||
| let tmpResource = [] | |||
| if (this.fillType === "actFill") { | |||
| let tableList = content.formConfigs | |||
| if (tableList && tableList.length > 0) { | |||
| for (let i = 0; i < tableList.length; i++) { | |||
| let item = tableList[i] | |||
| tmpResource.push({ | |||
| mc: item.targetName, | |||
| bh: item.targetCode + item.targetCodeSn, | |||
| ph: '', | |||
| ndz: item.targetActConcentration + item.targetActConcentrationUnit, | |||
| nd: item.targetActConcentration, | |||
| nddw: item.targetActConcentrationUnit, | |||
| ly: 'ELN配制', | |||
| sxrq: item.expireDate, | |||
| kc: item.targetActVolume, | |||
| kcdw: item.targetActVolumeUnit, | |||
| syl: null, | |||
| type: null, | |||
| elnType: this.product, | |||
| syldw: item.targetActVolumeUnit, | |||
| yxzq: item.effectivePeriod, | |||
| yxzqdw: item.effectivePeriodUnit, | |||
| }) | |||
| } | |||
| } | |||
| } | |||
| //使用的试剂、仪器 | |||
| const stepResource = this.getStepResource() | |||
| this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) | |||
| this.yqResourceTmp = stepResource.yqResource || [] | |||
| return this.resourceTmp; | |||
| }, | |||
| //获取步骤使用物资 | |||
| getStepResource() { | |||
| const sjResource = [], yqResource = []; | |||
| if (this.formData.formConfigs && this.formData.formConfigs.length > 0) { | |||
| for (let i = 0; i < this.formData.formConfigs.length; i++) { | |||
| const paralleResource = this.$refs[`formStepRef_${i}`][0].getStepResource(); | |||
| sjResource.push(...paralleResource.sjResource); | |||
| yqResource.push(...paralleResource.yqResource); | |||
| } | |||
| } | |||
| //去重 | |||
| const { sj, yq } = duplicateResource(sjResource, yqResource) | |||
| return { sjResource: sj, yqResource: yq }; | |||
| }, | |||
| } | |||
| }; | |||
| </script> | |||
| <style rel="stylesheet/scss" lang="scss"> | |||
| .mt-20 { | |||
| margin-top: 20px; | |||
| } | |||
| .print-btn { | |||
| margin-bottom: 20px; | |||
| } | |||
| .config-header-right { | |||
| margin-bottom: 15px; | |||
| font-weight: bold; | |||
| font-size: 16px; | |||
| color: #303133; | |||
| text-align: right; | |||
| width: 100%; | |||
| } | |||
| </style> | |||