luojie 2 months ago
parent
commit
eccced9420
19 changed files with 3180 additions and 184 deletions
  1. +2
    -1
      src/components/Template/HandleFormItem.vue
  2. +5
    -0
      src/lang/en/template/gsp.js
  3. +8
    -0
      src/lang/en/template/lba.js
  4. +5
    -0
      src/lang/zh/template/gsp.js
  5. +8
    -0
      src/lang/zh/template/lba.js
  6. +1
    -1
      src/utils/formPackageCommon.js
  7. +21
    -2
      src/views/business/comps/template/TemplateTable.vue
  8. +0
    -1
      src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue
  9. +579
    -172
      src/views/business/comps/template/comps/gsp/GSP002.vue
  10. +1
    -2
      src/views/business/comps/template/comps/gsp/GSP003.vue
  11. +1020
    -0
      src/views/business/comps/template/comps/gsp/GSP004.vue
  12. +0
    -1
      src/views/business/comps/template/comps/gsp/GSP010.vue
  13. +52
    -3
      src/views/business/comps/template/comps/lba/LBA004.vue
  14. +303
    -0
      src/views/business/comps/template/comps/lba/LBA006.vue
  15. +1
    -0
      src/views/business/comps/template/comps/pcr/PCR002.vue
  16. +586
    -0
      src/views/business/comps/template/comps/pcr/PCR003.vue
  17. +586
    -0
      src/views/business/comps/template/comps/pcr/PCR004.vue
  18. +0
    -1
      src/views/business/comps/template/comps/sp/SP00456.vue
  19. +2
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 2
- 1
src/components/Template/HandleFormItem.vue View File

@ -205,7 +205,7 @@ export default {
visible: false,// visible: false,//
checkboxValue: this.getChecked(),// checkboxValue: this.getChecked(),//
uuid: getuuid(), // EventBus uuid: getuuid(), // EventBus
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq'], ////
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq','jcb'], ////
selectRegentInfo: {},//// selectRegentInfo: {},////
fileList: [],// fileList: [],//
uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload", uploadFileUrl: process.env.VUE_APP_BASE_API + "/file/upload",
@ -417,6 +417,7 @@ export default {
mjy: "5",// mjy: "5",//
xj: "9",// xj: "9",//
xb: "11",// xb: "11",//
jcb: "13",//
} }
params = { params = {
...params, ...params,

+ 5
- 0
src/lang/en/template/gsp.js View File

@ -34,6 +34,11 @@ export default {
}, },
GSP002:{ GSP002:{
xsy:'稀释液', xsy:'稀释液',
cbybdpz:'储备液比对配制',
zlkz:'质量控制',
cbywdx:'储备液稳定性',
lmd:'灵敏度',
clhwdx:'处理后稳定性'
}, },
GSP003:{ GSP003:{
calcConditionLabel:'计算公式', calcConditionLabel:'计算公式',

+ 8
- 0
src/lang/en/template/lba.js View File

@ -25,5 +25,13 @@ export default {
sjypjrz: '实际样品加入值', sjypjrz: '实际样品加入值',
ysjzjrz: '预设基质加入值', ysjzjrz: '预设基质加入值',
sjjzjrz: '实际基质加入值' sjjzjrz: '实际基质加入值'
},
lba006: {
fxtj: 'Analysis conditions',
fxsj: 'Analysis time',
fxxx: 'Analysis Information',
jcb: 'Analysis Plate',
jg: 'Result',
sjwjm: 'Data file name'
} }
} }

+ 5
- 0
src/lang/zh/template/gsp.js View File

@ -34,6 +34,11 @@ export default {
}, },
GSP002:{ GSP002:{
xsy:'稀释液', xsy:'稀释液',
cbybdpz:'储备液比对配制',
zlkz:'质量控制',
cbywdx:'储备液稳定性',
lmd:'灵敏度',
clhwdx:'处理后稳定性'
}, },
GSP003:{ GSP003:{
calcConditionLabel:'计算公式', calcConditionLabel:'计算公式',

+ 8
- 0
src/lang/zh/template/lba.js View File

@ -25,5 +25,13 @@ export default {
sjypjrz: '实际样品加入值', sjypjrz: '实际样品加入值',
ysjzjrz: '预设基质加入值', ysjzjrz: '预设基质加入值',
sjjzjrz: '实际基质加入值' sjjzjrz: '实际基质加入值'
},
lba006: {
fxtj: '分析条件',
fxsj: '分析时间',
fxxx: '分析信息',
jcb: '检测板',
jg: '结果',
sjwjm: '数据文件名'
} }
} }

+ 1
- 1
src/utils/formPackageCommon.js View File

@ -5,7 +5,7 @@ export const isShowOther = (v = [], col) => {
} }
// 确保v是数组类型,以避免类型错误 // 确保v是数组类型,以避免类型错误
const arr = Array.isArray(v) ? v : [v] const arr = Array.isArray(v) ? v : [v]
const otherArr = ['其他', '遮光', 'CA-QC Dilution-']
const otherArr = ['其他', '遮光', 'CA-QC Dilution-', '拒绝', '部分接受']
//和凡哥商量,只要value为负数都显示其他 //和凡哥商量,只要value为负数都显示其他
return arr.some((item) => otherArr.includes(item)) return arr.some((item) => otherArr.includes(item))
} }

+ 21
- 2
src/views/business/comps/template/TemplateTable.vue View File

@ -43,6 +43,7 @@ import Demo from "./comps/sp/Demo.vue";
// //
import GSP002 from "./comps/gsp/GSP002.vue"; import GSP002 from "./comps/gsp/GSP002.vue";
import GSP003 from "./comps/gsp/GSP003.vue"; import GSP003 from "./comps/gsp/GSP003.vue";
import GSP004 from "./comps/gsp/GSP004.vue";
import GSP010 from "./comps/gsp/GSP010.vue"; import GSP010 from "./comps/gsp/GSP010.vue";
//// ////
@ -53,17 +54,22 @@ import DMYPPZJLB from "./comps/gsp/DMYPPZJLB.vue";
// PCR // PCR
//PCR001-使SP001 //PCR001-使SP001
import PCR002 from "./comps/pcr/PCR002.vue"; import PCR002 from "./comps/pcr/PCR002.vue";
import PCR003 from "./comps/pcr/PCR003.vue";
import PCR004 from "./comps/pcr/PCR004.vue";
//LBA //LBA
// LBA001-使SP001 // LBA001-使SP001
import LBA002 from "./comps/lba/LBA002.vue"; import LBA002 from "./comps/lba/LBA002.vue";
import LBA003 from "./comps/lba/LBA003.vue"; import LBA003 from "./comps/lba/LBA003.vue";
import LBA004 from "./comps/lba/LBA004.vue"; import LBA004 from "./comps/lba/LBA004.vue";
import LBA006 from "./comps/lba/LBA006.vue";
//ADA //ADA
// ADA001-使SP001 // ADA001-使SP001
// ADA002-使LBA002 // ADA002-使LBA002
// ADA003-使LBA003 // ADA003-使LBA003
// ADA004-使LBA004
// ADA006-使LBA006
// //
// YP001-使SP001 // YP001-使SP001
@ -76,7 +82,7 @@ export default {
//// ////
MJYLQSQD, SYWZPZJHB, DMYPPZJLB, MJYLQSQD, SYWZPZJHB, DMYPPZJLB,
// //
GSP002, GSP003, GSP010,
GSP002, GSP003, GSP004, GSP010,
// //
SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018, SP001, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
// PCR // PCR
@ -84,7 +90,8 @@ export default {
//LBA //LBA
LBA002, LBA002,
LBA003, LBA003,
LBA004
LBA004,
LBA006
}, },
props: { props: {
sn: { sn: {
@ -129,10 +136,17 @@ export default {
'SP017': 'SP017', 'SP017': 'SP017',
'SP018': 'SP018', 'SP018': 'SP018',
// //
'GSP001': 'DMYPPZJLB', 'GSP001': 'DMYPPZJLB',
'GSP002': 'GSP002', 'GSP002': 'GSP002',
'GSP003': 'GSP003', 'GSP003': 'GSP003',
'GSP004': 'GSP004',
'GSP006': 'GSP002',
'GSP008': 'GSP002',
'GSP010': 'GSP010', 'GSP010': 'GSP010',
'GSP012': 'GSP002',
'GSP013': 'GSP002',
'GSP014': 'GSP002',
//// ////
'SYWZPZJHB': 'SYWZPZJHB', 'SYWZPZJHB': 'SYWZPZJHB',
'MJYLQSQD': 'MJYLQSQD', 'MJYLQSQD': 'MJYLQSQD',
@ -140,15 +154,20 @@ export default {
//PCR //PCR
'PCR001': 'SP001', 'PCR001': 'SP001',
'PCR002': 'PCR002', 'PCR002': 'PCR002',
'PCR003': 'PCR003',
'PCR004': 'PCR004',
//LBA //LBA
'LBA001': 'SP001', 'LBA001': 'SP001',
'LBA002': 'LBA002', 'LBA002': 'LBA002',
'LBA003': 'LBA003', 'LBA003': 'LBA003',
'LBA004': 'LBA004', 'LBA004': 'LBA004',
'LBA006': 'LBA006',
//ADA //ADA
'ADA001': 'SP001', 'ADA001': 'SP001',
'ADA002': 'LBA002', 'ADA002': 'LBA002',
'ADA003': 'LBA003', 'ADA003': 'LBA003',
'ADA004': 'LBA004',
'ADA006': 'LBA006',
// //
'YP001': 'SP001', 'YP001': 'SP001',
} }

+ 0
- 1
src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue View File

@ -403,7 +403,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

+ 579
- 172
src/views/business/comps/template/comps/gsp/GSP002.vue View File

@ -1,4 +1,4 @@
<!-- 供试品部试剂配制记录表 -->
<!-- 试剂配制记录表平行稀释 -->
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
@ -9,50 +9,54 @@
<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" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> <TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz"
v-if="resourceWz.length > 0" />
<TableList label="template.common.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> <TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<LineLabel v-if="sn=='GSP002'" label="template.common.operationSteps" />
<LineLabel v-if="sn=='GSP006'" label="template.gsp.GSP002.cbybdpz" />
<LineLabel v-if="sn=='GSP008'" label="template.gsp.GSP002.zlkz" />
<LineLabel v-if="sn=='GSP012'" label="template.gsp.GSP002.cbywdx" />
<LineLabel v-if="sn=='GSP013'" label="template.gsp.GSP002.lmd" />
<LineLabel v-if="sn=='GSP014'" label="template.gsp.GSP002.clhwdx" />
<!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')" <div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex"> :key="'paralle_' + paralleIndex">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header-end" v-if="fillType === 'preFill'">
<el-button type="primary" @click="handleAddParalle(false)">{{
$t('template.lba.lba004.xz')}}</el-button>
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{
$t('template.lba.lba004.sc')}}</el-button>
<div class="config-header-right">
<el-button type="primary" v-if="fillType === 'preFill'" @click="handleAddParalle">{{
$t('template.common.addBtn') }}</el-button>
<el-button v-if="fillType === 'preFill' && formData.paralleConfigs.length > 1"
type="danger" @click="deleteParalleConfig(paralleIndex)">{{
$t('template.common.deleteBtn') }}</el-button>
</div> </div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" <BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" :ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')" />
<!-- <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill' || fillType === 'preFill'"
:fieldItemLabel="$t('template.common.pxpz')" />
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:columns="paralleStepColumns" :columns="paralleStepColumns"
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" @onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)" ></TableOpertaionDelete>
</template>
</CustomTable> -->
<CustomTable :ref="`paralleStepTableRef_${paralleIndex}`"
:showOperation="fillType === 'preFill'" :columns="paralleStepColumns"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')">
:fieldItemLabel="$t('template.common.pxpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns"
<TableOpertaion @printTag="(e) => printTag(e, 'paralleConfigs', paralleIndex)"
@startConfig="(val) => startConfig(val, 'paralleConfigs', paralleIndex)"
@configComplete="(val) => configComplete(val, 'paralleConfigs', paralleIndex)"
@subPackageSubmit="(val) => subPackageSubmit(val, 'paralleConfigs', paralleIndex)"
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)"> @deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaionDelete>
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
<Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`" <Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData"
:fieldItemLabel="$t('template.lba.lba004.xszj')" :prefixKey="'paralle' + paralleIndex">
</Step>
:formData="paralleConfig.paralleStepData" :fieldItemLabel="$t('template.common.pxpz')"
:prefixKey="'paralle' + paralleIndex"></Step>
</div> </div>
</div> </div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" <BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
@ -64,54 +68,52 @@
</template> </template>
<script> <script>
import { EventBus } from "@/utils/eventBus";
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage";
import LineLabel from "@/components/Template/LineLabel"; import LineLabel from "@/components/Template/LineLabel";
import TableList from "@/components/Template/Table"; import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step"; import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin";
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { debounce } from 'lodash-es';
import templateMixin from "../../mixins/templateMixin.js";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { getExpireDate, duplicateResource } from "@/utils/index.js";
import { isCommonUnit } from "@/utils/conTools";
import moment from "moment";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
export default { export default {
name: "GSP002", name: "GSP002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete },
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
mixins: [templateMixin], mixins: [templateMixin],
props: { props: {
fillType: { fillType: {
type: String, type: String,
default: 'preFill', default: 'preFill',
}, },
sn: {
type: String,
default: '',
},
}, },
computed: {
//
jcbColumns() {
return [{
label: 'template.lba.lba002.jcbmc',
prop: 'jcb',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
}, {
label: '',
prop: 'jcbBh',
bodyType: 'jcb',
bodyFillType: 'actFill',
width: 280
}]
watch: {
fillType: {
immediate: true,
handler(v) {
console.log(v, "fillType")
}
}, },
},
computed: {
// //
remarkConig() { remarkConig() {
return [ return [
{ {
type: "cellItem",
type: 'cellItem',
config: { config: {
remark: { remark: {
label: "",
type: "textarea",
fillType: "actFill",
label: '',
type: 'textarea',
fillType: 'actFill',
span: 1, span: 1,
placeholder: 'template.common.remarkPlaceholder', placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000, maxlength: 1000,
@ -119,102 +121,116 @@ export default {
} }
} }
} }
]
];
}, },
// //
baseInfoFormConfig() { baseInfoFormConfig() {
return [ return [
{ {
type: "cardItem",
type: 'cardItem',
config: { config: {
studyMc: { studyMc: {
label: 'template.common.testName', label: 'template.common.testName',
type: "input",
disabled: true,
type: 'input',
disabled: true
}, },
studySn: { studySn: {
label: 'template.common.testNumber', label: 'template.common.testNumber',
type: "input",
disabled: true,
type: 'input',
disabled: true
}, },
methodCode: { methodCode: {
label: 'template.common.methodCode', label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
type: 'input',
fillType: 'preFill',
maxlength: 50 maxlength: 50
}, },
versionNum: { versionNum: {
label: 'template.common.versionNumber', label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
type: 'inputNumber',
fillType: 'actFill',
prepend: 'V',
maxlength: 50 maxlength: 50
},
}
} }
}, },
{ {
type: "conditionItem",
label: 'template.lba.lba002.cztj',
type: 'conditionItem',
label: 'template.common.testConfigurationConditions',
config: { config: {
pre: { pre: {
label: 'template.common.preFill', label: 'template.common.preFill',
type: "select",
type: 'select',
multiple: true, multiple: true,
fillType: "preFill",
fillType: 'preFill',
options: this.getDictOptions('business_pztj'), options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
otherCode: 'preOther'
}, },
act: { act: {
label: 'template.common.actualFill', label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
type: 'select',
fillType: 'actFill',
otherCode: 'actOther',
multiple: true, multiple: true,
compareTo: "pre",
options: this.getDictOptions('business_pztj')
options: this.getDictOptions('business_pztj'),
compareTo: 'pre'
} }
} }
}, },
{ {
type: "cellItem",
label: 'template.lba.lba002.czsj',
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
containerMaterial: {
label: 'template.sp.sp00456.rqcz',
type: 'select',
options: this.getDictOptions('business_rqcz'),
fillType: 'actFill',
multiple: true,
otherCode: 'containerMaterialOther'
}
}
},
{
type: 'cellItem',
label: 'template.common.configurationTime',
config: { config: {
startDate: { startDate: {
label: 'template.common.startTime', label: 'template.common.startTime',
type: "input",
type: 'input'
}, },
endDate: { endDate: {
label: 'template.common.endTime', label: 'template.common.endTime',
type: "input",
},
type: 'input'
}
} }
} }
]
];
}, },
paralleStepFormConfig() { paralleStepFormConfig() {
return [ return [
{ {
type: 'step', type: 'step',
config: { config: {
jz: {
label: 'template.gsp.GSP002.xsy',
solution: {
label: 'template.sp.sp00456.xsy',
type: 'input', type: 'input',
fillType: 'preFill', fillType: 'preFill',
subType: 'sj', subType: 'sj',
subKey: 'jzCode',
subKey: 'subSolution',
subFillType: 'actFill', subFillType: 'actFill',
maxlength: 20 maxlength: 20
}, },
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
paralleStepStorageCondition: {
label: 'template.sp.sp00456.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'paralleStepStorageConditionOther'
}
} }
} }
]
];
}, },
paralleStepColumns() { paralleStepColumns() {
return [ return [
@ -432,25 +448,341 @@ export default {
copyFrom: "targetDiluentVolume", copyFrom: "targetDiluentVolume",
compareTo: 'targetDiluentVolume' // compareTo: 'targetDiluentVolume' //
} }
]
}
];
},
}, },
data() { data() {
return { return {
formData: {}
subSolutionVisible: false,
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
dataSource: [],
currentTableIndex: "",//
currentTableKey: "",//key
targetAcSolutionFromTable: true,//
currentRowData: {},//
}; };
}, },
mounted() { mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
setTimeout(() => {
this.handleUpdateCode(formData);
}, 0);
}
if (this.fillType === "preFill") { if (this.fillType === "preFill") {
this.handleAddParalle(true);
if (!this.formData.paralleConfigs) {
this.handleAddParalle()
}
} }
}, },
methods: { methods: {
//
//
subPackageSubmit(data, configType, index) {
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
if (fzList && fzList.length > 0) {
const list = fzList.map((item) => {
return {
bh: mybh + item.preCode + item.subCode,
kc: item.num,
kcdw: dw,
}
})
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
list: list
}
this.subPackageRequest(postData);
}
},
startConfig(val) {
const { rowData } = val;
console.log(rowData, "rowData")
let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
}
this.startConfigRequest(postData);
},
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
debugger
let postData = {
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
kc: total,
kcdw: unit,
}
this.configCompleteRequest(postData);
},
//
printTag(e, configType, index) {
const { nickName, name } = this.$store.getters;
const { printCode, row, type } = e;
const currentForm = this.formData[configType][index];
const { stepStorageCondition, startDate, expireDate, paralleStepStorageCondition } = currentForm;
const targetSolutionExpirationDate = row.targetSolutionExpirationDate;
const lang = this.$i18n.locale;
const printConfig = {
"品名": "暂时还不知道品名是哪个字段",
"存储条件": stepStorageCondition || paralleStepStorageCondition,
"配制日期": moment(startDate).format("YYYY-MM-DD"),
"有效期至": moment(targetSolutionExpirationDate || expireDate).format("YYYY-MM-DD HH:mm"),
"配置者": lang === "zh_CN" ? nickName : name,
//type==="subPackage"
//type==="row"
"编号": type === "subPackage" ? printCode : (row.targetSolutionCode + row.subTargetSolutionCode),
}
console.log(printConfig, "printConfig")
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
async assignNumbersToTableData(config) {
return new Promise(async (resolve, reject) => {
const configs = this.formData[config]
const { startDate } = this.formData;
// paralleConfigsparalleTableFormData
if (configs && configs.length > 0) {
for (let i = 0; i < configs.length; i++) {
const ref = `paralleStepTableRef_${i}`;
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i];
if (!expireDate && config === "ladderConfigs") {
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit);
configs[i].expireDate = date;
}
if (stepTableFormData && stepTableFormData.length > 0) {
const tableDataArray = stepTableFormData;
// subTargetSolutionCode
const hasAnyWithValue = tableDataArray.some(row =>
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== '');
//
if (!hasAnyWithValue) {
const codes = stepTableFormData.map((item) => ({ prex: item.targetSolutionCode, type: 1 }));
const snList = await this.getLatestSnArr(codes);
tableDataArray.forEach((row, idx) => {
let expDate = {};
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) {
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision);
expDate = {
targetSolutionExpirationDate: date
}
}
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
});
resolve()
} else {
reject()
}
}
}
}
})
},
async handleUpdateCode() {
Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs")
]).then(() => {
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
})
},
//
handleAddParalle() {
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
},
//
handleAddLadder() {
//
if (!this.formData.ladderConfigs) {
this.$set(this.formData, 'ladderConfigs', []);
}
//
this.formData.ladderConfigs.push({
ladderStepData: [],
ladderTableFormData: [],
showLadderConfig: true
});
},
//
deleteLadderConfig(index) {
this.formData.ladderConfigs.splice(index, 1);
},
//
deleteParalleConfig(index) {
this.formData.paralleConfigs.splice(index, 1);
},
//
handleAddRow(type, rowIndex, configIndex = 0) {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef && tableRef[0].addRow) {
tableRef[0].addRow({});
}
},
//
deleteRow(rowIndex, type, configIndex = 0) {
//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
}
},
//
onHandleTableBlur(type, configIndex, e) {
const { colKey = "", item, rowIndex } = e;
debugger
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if (type === "paralle") {
const volumne = item.targetStartSolutionConcentration || 0;
if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne);
}
}
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//
if (type === "paralle") {
const targetAcSolution = item.targetAcSolution || 0;//
if (targetAcSolution) {
const volResult = this.updateSjmbrynd(item, targetAcSolution);
if (!volResult) {
return
}
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd,
});
}
}
}
},
onTableBeforeReagentSubmit(data) {
const { selectData, callback, key, rowData } = data;
if (key === "actStartSolutionCode" && !isCommonUnit(selectData.row.nddw, [rowData.targetStartSolutionConcentrationPrecision])) {//table
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
}
},
// table
onTableRegentSubmit(type, configIndex, data) {
const { selectInfo, rowIndex, key, rowData } = data;
const { row, selectedId } = selectInfo;
if (key === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0];
if (tableRef) {
const volResult = this.updateSjmbrynd(rowData, row.nd);
//code
tableRef.updateDataSourceByRowIndex(rowIndex, {
actStartSolutionCode: selectedId,
targetAcSolution: row.nd,
})
if (!volResult) {
return
}
tableRef.updateDataSourceByRowIndex(rowIndex, {
actSolutionVolume: volResult.actVol,
actSolutionConcentration: volResult.actNd,
})
}
}
},
//
onRegentSubmit(type, rowIndex, data) {
const { selectInfo, key } = data;
const { row } = selectInfo;
if (key) {
const packageRef = this.$refs[`paralleStepFormPackageRef_${rowIndex}`][0];
if (key === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.nd);
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution");
this.updateTableNd(row, rowIndex);
}
}
},
updateRecord() {
this.$nextTick(() => {
EventBus.$emit('onModifyRecord', {
type: "fieldChanged",
newRecord: null,
resourceList: null,
},)
})
},
//table
updateTableNd(row, rowIndex) {
const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData();
const newData = JSON.parse(JSON.stringify(stepTableFormData));
//
newData.forEach((item, index) => {
let initNd = row.nd;//
if (index === 0) {
item.startSolutionCode = row.bh;
} else {
item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode;
initNd = newData[i - 1].actSolutionConcentration;
}
const volResult = this.updateSjmbrynd(item, initNd);
if (!volResult) {
return
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
// stepTableRef
})
this.$refs[`ladderStepTableRef_${rowIndex}`][0].updateDataSource(newData);
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
refsToValidate.push(`paralleStepTableRef_${i}`);
refsToValidate.push(`paralleStepRef_${i}`);
}
}
return await this.validFormFields(refsToValidate);
},
getFilledFormData() { getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData(); const baseData = this.$refs.baseInfoRef.getFilledFormData();
const fjData = this.$refs.fjRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
// //
const paralleConfigsData = []; const paralleConfigsData = [];
@ -468,14 +800,14 @@ export default {
}); });
} }
} }
const remarkData = this.$refs.remarkRef.getFilledFormData();
return { return {
...baseData, ...baseData,
...fjData,
...remarkData,
paralleConfigs: paralleConfigsData, paralleConfigs: paralleConfigsData,
...remarkData
} }
}, },
//
async getFormData() { async getFormData() {
// //
const validFlag = await this.validFields(); const validFlag = await this.validFields();
@ -483,85 +815,129 @@ export default {
return false; return false;
} }
let content = this.getFilledFormData(); let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "jcbRef", "fjRef", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
refsToValidate.push(`paralleStepTableRef_${i}`);
refsToValidate.push(`paralleStepRef_${i}`);
if (content) {
const { paralleConfigs = [] } = content;
if (paralleConfigs.length > 0) {
const paralleConUnitDiff = paralleConfigs.every(item => {
const { stepTableFormData = [], headerSelectFields = {} } = item;
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields;
return isCommonUnit(actSolutionConcentrationUnit, [...conUnits, targetSolutionConcentrationUnit]);
});
if (!paralleConUnitDiff) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false;
}
} }
} }
return await this.validFormFields(refsToValidate);
return content;
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
//
handleAddParalle(init) {
let isAdd = !init
if (init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length === 0)) {
isAdd = true
}
if (isAdd) {
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
if (content.paralleConfigs && content.paralleConfigs.length > 0) {
for (let i = 0; i < content.paralleConfigs.length; i++) {
let paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: paralleConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: stepTableFormData[j].targetSolutionExpirationDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: stepTableFormData[j].targetSolutionCycle,
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision,
})
//
tmpResource.push({
mc: null,
bh: paralleConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
} }
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
}
},
//
deleteParalleConfig(index) {
if (this.formData.paralleConfigs.length === 1) {
// this.$message.error("1");
return;
} }
this.formData.paralleConfigs.splice(index, 1);
},
deleteJcbRow(rowIndex) {
const jcbRef = this.$refs['jcbRef'];
if (jcbRef) {
jcbRef.deleteRow(rowIndex);
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
} }
//使
const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return this.resourceTmp;
}, },
//
deleteRow(rowIndex, type, configIndex = 0) {
//
if (type === 'ladder') {
const tableRef = this.$refs[`ladderStepTableRef_${configIndex}`];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
} else if (type === 'paralle') {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
getStepResource() {
const sjResource = [], yqResource = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleResource = this.$refs[`paralleStepRef_${i}`][0].getStepResource();
sjResource.push(...paralleResource.sjResource);
yqResource.push(...paralleResource.yqResource);
} }
} }
//
const { sj, yq } = duplicateResource(sjResource, yqResource)
return { sjResource: sj, yqResource: yq };
}, },
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
}
} }
}; };
</script> </script>
@ -570,17 +946,48 @@ export default {
margin-top: 20px; margin-top: 20px;
} }
.print-btn {
.config-section {
margin-bottom: 20px; margin-bottom: 20px;
padding: 15px;
border: 1px solid #ebeef5;
border-radius: 4px;
background-color: #fafafa;
} }
.config-header-end {
.config-header {
display: flex; display: flex;
justify-content: flex-end;
justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 15px; margin-bottom: 15px;
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
color: #303133; color: #303133;
} }
.config-header .el-button {
color: #f56c6c;
font-size: 14px;
}
.config-header .el-button:hover {
color: #f78989;
}
.mt-0 {
margin-top: 0;
}
.config-header-right {
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
text-align: right;
width: 100%;
}
.s-container {
box-shadow: none !important;
padding: 24px 0 !important;
}
</style> </style>

+ 1
- 2
src/views/business/comps/template/comps/gsp/GSP003.vue View File

@ -1,4 +1,4 @@
<!-- 试验物质配制记录表 -->
<!-- 试验物质配制记录表精准配制 -->
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
@ -437,7 +437,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

+ 1020
- 0
src/views/business/comps/template/comps/gsp/GSP004.vue
File diff suppressed because it is too large
View File


+ 0
- 1
src/views/business/comps/template/comps/gsp/GSP010.vue View File

@ -387,7 +387,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
debugger
return this.resourceTmp; return this.resourceTmp;
}, },
//使 //使

+ 52
- 3
src/views/business/comps/template/comps/lba/LBA004.vue View File

@ -88,7 +88,8 @@ import TableList from "@/components/Template/Table";
import Step from "@/components/Template/Step"; import Step from "@/components/Template/Step";
import templateMixin from "../../mixins/templateMixin"; import templateMixin from "../../mixins/templateMixin";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import { uniqeResource,uniqeResourceOne } from "@/utils/calUnitTools";
import { duplicateResource } from "@/utils/index.js";
import { debounce } from 'lodash-es'; import { debounce } from 'lodash-es';
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue" import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
@ -375,12 +376,60 @@ export default {
}, },
getResource() { getResource() {
let content = this.getFilledFormData(); let content = this.getFilledFormData();
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
if (content.paralleConfigs && content.paralleConfigs.length > 0) {
for (let i = 0; i < content.paralleConfigs.length; i++) {
let paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
tmpResource.push({
mc: null,
bh: paralleConfigs.jzCode,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].sjjzjrz,
syldw: paralleConfigs.headerSelectFields.sjjzjrzUnit,
yxzq: null,
yxzqdw: null,
})
}
}
}
}
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
}
//使 //使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = stepResource.sjResource || []
const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource
return this.resourceTmp; return this.resourceTmp;
}, },
getStepResource() {
const sjResource = [], yqResource = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleResource = this.$refs[`paralleStepRef_${i}`][0].getStepResource();
sjResource.push(...paralleResource.sjResource);
yqResource.push(...paralleResource.yqResource);
}
}
//
const { sj, yq } = duplicateResource(sjResource, yqResource)
return { sjResource: sj, yqResource: yq };
},
// //
async onSave() { async onSave() {
const formData = this.getStepResource(); const formData = this.getStepResource();

+ 303
- 0
src/views/business/comps/template/comps/lba/LBA006.vue View File

@ -0,0 +1,303 @@
<!-- 配体结合分析处理记录表 -->
<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" />
<LineLabel label="template.lba.lba006.fxxx" />
<!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex">
<div class="template-form-item">
<div class="config-header-end">
<el-button type="primary" @click="handleAddParalle(false)">{{ $t('template.lba.lba004.xz')}}</el-button>
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{ $t('template.lba.lba004.sc')}}</el-button>
</div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.lba.lba004.xszj')" />
</div>
</div>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<!-- <button @click="onSave">保存</button> -->
</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 { EventBus } from "@/utils/eventBus";
import { uniqeResource,uniqeResourceOne } from "@/utils/calUnitTools";
import { duplicateResource } from "@/utils/index.js";
import { debounce } from 'lodash-es';
import CustomTable from '@/components/Template/CustomTable.vue';
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
export default {
name: "LBA006",
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,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "actFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.lba.lba006.fxtj',
config: {
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.lba.lba006.fxsj',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
paralleStepFormConfig(){
return [
{
type: 'step',
config: {
jcb: {
label: 'template.lba.lba006.jcb',
type: 'jcb',
fillType: 'actFill',
maxlength: 20
},
jg: {
label: 'template.lba.lba006.jg',
type: "select",
fillType: "actFill",
otherLabel: " ",
otherCode: "jgOther",
otherMaxlength: 100,
multiple: false,
options: this.getDictOptions('business_lba_jg')
},
sjwjm: {
span:1,
label: 'template.lba.lba006.sjwjm',
type: 'input',
fillType: 'actFill',
maxlength: 100
}
}
}
]
},
},
data() {
return {
formData: {}
};
},
mounted() {
this.handleAddParalle(true);
},
methods: {
//
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
const remarkData = this.$refs.remarkRef.getFilledFormData();
//
const paralleConfigsData = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData();
paralleConfigsData.push({
...paralleFormData,
showParalleConfig: true
});
}
}
return {
...baseData,
...remarkData,
paralleConfigs: paralleConfigsData,
}
},
//
async getFormData() {
//
const validFlag = await this.validFields();
if (!validFlag) {
return false;
}
let content = this.getFilledFormData();
return content
},
//
async validFields() {
//
let refsToValidate = ["baseInfoRef", "remarkRef"];
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleStepFormPackageRef_${i}`);
}
}
return await this.validFormFields(refsToValidate);
},
getResource() {
let content = this.getFilledFormData();
//使
this.resourceTmp = []
this.yqResourceTmp = []
return this.resourceTmp;
},
//
async onSave() {
const formData = this.getStepResource();
console.log(formData, "formData")
},
//
handleAddParalle(init) {
let isAdd = !init
if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){
isAdd = true
}
if(isAdd){
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
this.formData.paralleConfigs.push({
showParalleConfig: true
});
}
},
//
deleteParalleConfig(index) {
if(this.formData.paralleConfigs.length===1){
// this.$message.error("1");
return;
}
this.formData.paralleConfigs.splice(index, 1);
},
//
deleteRow(rowIndex, type, configIndex = 0) {
//
if (type === 'ladder') {
const tableRef = this.$refs[`ladderStepTableRef_${configIndex}`];
if (tableRef) {
tableRef.deleteRow(rowIndex);
}
} else if (type === 'paralle') {
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`];
if (tableRef) {
tableRef[0].deleteRow(rowIndex);
}
}
},
}
};
</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>

+ 1
- 0
src/views/business/comps/template/comps/pcr/PCR002.vue View File

@ -19,6 +19,7 @@
@onSureModifyRecord="onSureModifyRecord" @onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord" @resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<el-button type="primary">导入模板</el-button>
<CustomTable <CustomTable
@blur="onHandleTableBlur" @blur="onHandleTableBlur"
:ref="`stepTableRef`" :ref="`stepTableRef`"

+ 586
- 0
src/views/business/comps/template/comps/pcr/PCR003.vue View File

@ -0,0 +1,586 @@
<!-- PCR生物分析标准曲线制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.pcr.pcr002.title') }}<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.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
@clickable="handleFormClickable"
@onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`stepTableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> -->
</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.js";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "PCR002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
tableStepColumns() {
return getLadderColumnsConfig(this, 'business_pcr_fxbzqxzbb');
},
//
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,
},
}
},
{
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: {
startSolution: {
label: 'template.pcr.pcr002.qsyry',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subStartSolution',
subFillType: 'actFill',
maxlength: 20
},
targetStartSolution: {
label: 'template.pcr.pcr002.ysqsyrynd',
type: 'inputNumber',
subType: 'select',
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
subKey: 'subTargetStartSolution',
maxlength: 10
},
targetAcSolution: {
label: 'template.pcr.pcr002.sjqsyrynd',
type: 'input',
fillType: 'actFill',
disabled: true,
maxlength: 10,
compareTo: 'targetStartSolution', //
},
solution: {
label: 'template.pcr.pcr002.xsy',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subSolution',
subFillType: 'actFill',
maxlength: 20
},
stepStorageCondition: {
label: 'template.pcr.pcr002.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'stepStorageConditionOther'
},
effectivePeriod: {
label: 'template.pcr.pcr002.mbryyxzq',
type: 'input',
subType: 'select',
subKey: 'effectivePeriodUnit',
fillType: 'preFill',
subOptions: this.getDictOptions('business_yxqdw')
},
expireDate: {
label: 'template.pcr.pcr002.mbrysxr',
type: 'input'
}
}
}
]
},
},
data() {
return {
reagentType: null, // 1- 2-
formData: {},
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
onSureModifyRecord(key) {
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
}
},
resetRecord() {
this.$refs.stepTableRef.resetRecord();
},
//
handleFormClickable(obj) {
if (this.fillType === "preFill") {
return;
}
console.log(obj)
const subKey = obj.subKey;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show(this.formData.id)
this.currentSubKey = subKey;
this.reagentType = 1;
}
},
//
handleClickable(col, rowIndex) {
//
this.reagentType = 2
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show(this.formData.id)
}
},
//
onSelectReagentSubmit(code,row){
if(this.reagentType===1){
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
//
if(this.currentSubKey == 'subStartSolution') {
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw);
this.updateStepTableData(row);
}
}else{
this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row) {
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
//
for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i];
if (i === 0) {
// row.code
newStepTableData[i].startSolutionCode = row.bh;
} else {
// targetSolutionCode
// targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
}
console.log(item, row, 'updateStepTableData')
const volResult = this.updateSjmbrynd(item, row.nd);
console.log(volResult, 'volResult')
if (!volResult) {
continue
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
item.actSolutionExpire = row.sxr;
}
this.$refs.stepTableRef.updateDataSource(newStepTableData);
// tableRef
},
//
async getCode(v) {
const { stepTableFormData = [] } = v;
if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) {
let postSn = []
for (let i = 0; i < stepTableFormData.length; i++) {
postSn.push({
pre: stepTableFormData[i].targetSolutionCode,
type: 1
})
}
const result = await getLatestSnArr(postSn)
if (result.code == 200) {
for (let i = 0; i < stepTableFormData.length; i++) {
this.$refs.stepTableRef.updateDataSourceByRowIndex(i, {
subTargetSolutionCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
console.log(content)
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
//
tmpResource.push({
mc: null,
bh: item.startSolutionCode,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actStartSolutionVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actDiluentVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actDiluentVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode+item.subTargetSolutionCode,
ph: null,
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
nd: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
//
async onSave() {
let content = this.$refs.stepRef.getStepResource();
console.log(content);
},
//
deleteRow(rowIndex) {
const stepTableRef = this.$refs['stepTableRef'];
if (stepTableRef) {
stepTableRef.deleteRow(rowIndex);
}
},
configComplete(val) {
if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) {
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:" + JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc: null,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.rowData.bh + val.rowData.bhCode,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:" + JSON.stringify(postData))
sj_configurationCompleted(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
startConfig(val) {
console.log("开始配置数据:" + JSON.stringify(val))
let postData = {
bh: val.rowData.bh + val.rowData.bhCode,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:" + JSON.stringify(postData))
sj_startConfiguration(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
subPackageSubmit(val) {
console.log("分装数据:" + JSON.stringify(val))
if (val.fzsj.fzList && val.fzsj.fzList.length > 0) {
let list = []
for (let i = 0; i < val.fzsj.fzList.length; i++) {
let item = val.fzsj.fzList[i]
list.push({
bh: val.fzsj.mybh + item.preCode,
kc: item.num,
kcdw: val.fzsj.dw,
})
}
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.fzsj.mybh,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
list: list
}
console.log("分装提交数据:" + JSON.stringify(postData))
sj_subpackage(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 586
- 0
src/views/business/comps/template/comps/pcr/PCR004.vue View File

@ -0,0 +1,586 @@
<!-- PCR生物分析标准曲线制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.pcr.pcr002.title') }}<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.reagentInfo" :columns="sysjColumns" :dataSource="resource" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
@clickable="handleFormClickable"
@onSureModifyRecord="onSureModifyRecord"
@resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
<CustomTable
@blur="onHandleTableBlur"
:ref="`stepTableRef`"
:columns="tableStepColumns"
:formData="formData"
:prefixKey = "`table`"
@clickable="handleClickable"
fieldItemLabel = "template.common.operationSteps"
>
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="(rowIndex) => deleteRow(rowIndex)"
@subPackageSubmit="subPackageSubmit"
@startConfig="startConfig"
@configComplete="configComplete"
></TableOpertaion>
</template>
</CustomTable>
</div>
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
</div>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
<!-- <button @click="onSave">保存</button> -->
</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.js";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "PCR002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
tableStepColumns() {
return getLadderColumnsConfig(this, 'business_pcr_fxzkypzbb');
},
//
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,
},
}
},
{
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: {
startSolution: {
label: 'template.pcr.pcr002.qsyry',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subStartSolution',
subFillType: 'actFill',
maxlength: 20
},
targetStartSolution: {
label: 'template.pcr.pcr002.ysqsyrynd',
type: 'inputNumber',
subType: 'select',
fillType: 'preFill',
subOptions: this.getDictOptions('business_nddw'),
subKey: 'subTargetStartSolution',
maxlength: 10
},
targetAcSolution: {
label: 'template.pcr.pcr002.sjqsyrynd',
type: 'input',
fillType: 'actFill',
disabled: true,
maxlength: 10,
compareTo: 'targetStartSolution', //
},
solution: {
label: 'template.pcr.pcr002.xsy',
type: 'input',
fillType: 'preFill',
subType: 'clickable',
subKey: 'subSolution',
subFillType: 'actFill',
maxlength: 20
},
stepStorageCondition: {
label: 'template.pcr.pcr002.cctj',
type: 'select',
fillType: 'preFill',
options: this.getDictOptions('business_cctj'),
otherCode: 'stepStorageConditionOther'
},
effectivePeriod: {
label: 'template.pcr.pcr002.mbryyxzq',
type: 'input',
subType: 'select',
subKey: 'effectivePeriodUnit',
fillType: 'preFill',
subOptions: this.getDictOptions('business_yxqdw')
},
expireDate: {
label: 'template.pcr.pcr002.mbrysxr',
type: 'input'
}
}
}
]
},
},
data() {
return {
reagentType: null, // 1- 2-
formData: {},
currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
};
},
mounted() {
const formData = this.getFormDataByTemplateData();
if (this.fillType === "actFill") {
this.getCode(formData);
}
},
methods: {
//
onSureModifyRecord(key) {
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
}
},
resetRecord() {
this.$refs.stepTableRef.resetRecord();
},
//
handleFormClickable(obj) {
if (this.fillType === "preFill") {
return;
}
console.log(obj)
const subKey = obj.subKey;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.$refs.selectReagentDialogRef.show(this.formData.id)
this.currentSubKey = subKey;
this.reagentType = 1;
}
},
//
handleClickable(col, rowIndex) {
//
this.reagentType = 2
this.rowIndex = rowIndex
this.currentSubKey = col.prop;
console.log("clickable",rowIndex, col)
if(col.prop === "sjry"){
//-
this.$refs.selectReagentDialogRef.show(this.formData.id)
}
},
//
onSelectReagentSubmit(code,row){
if(this.reagentType===1){
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
//
if(this.currentSubKey == 'subStartSolution') {
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd + row.nddw);
this.updateStepTableData(row);
}
}else{
this.$refs.stepTableRef.updateDataSourceByRowIndex(this.rowIndex,{
[this.currentSubKey]: code,
})
}
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row) {
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
//
for (let i = 0; i < newStepTableData.length; i++) {
const item = newStepTableData[i];
if (i === 0) {
// row.code
newStepTableData[i].startSolutionCode = row.bh;
} else {
// targetSolutionCode
// targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode + newStepTableData[i - 1].subTargetSolutionCode;
}
console.log(item, row, 'updateStepTableData')
const volResult = this.updateSjmbrynd(item, row.nd);
console.log(volResult, 'volResult')
if (!volResult) {
continue
}
item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd;
item.actSolutionExpire = row.sxr;
}
this.$refs.stepTableRef.updateDataSource(newStepTableData);
// tableRef
},
//
async getCode(v) {
const { stepTableFormData = [] } = v;
if (stepTableFormData && stepTableFormData.length > 0 && !stepTableFormData[0].bhCode) {
let postSn = []
for (let i = 0; i < stepTableFormData.length; i++) {
postSn.push({
pre: stepTableFormData[i].targetSolutionCode,
type: 1
})
}
const result = await getLatestSnArr(postSn)
if (result.code == 200) {
for (let i = 0; i < stepTableFormData.length; i++) {
this.$refs.stepTableRef.updateDataSourceByRowIndex(i, {
subTargetSolutionCode: result.data[i],
})
}
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}
}
},
//
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"])
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
console.log(content)
//resource
let tmpResource = []
if(this.fillType === "actFill"){
let tableList = content.stepTableFormData
if(tableList && tableList.length>0){
for(let i=0;i<tableList.length;i++){
//
let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
//
tmpResource.push({
mc: null,
bh: item.startSolutionCode,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actStartSolutionVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actDiluentVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actDiluentVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode+item.subTargetSolutionCode,
ph: null,
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
nd: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
//
async onSave() {
let content = this.$refs.stepRef.getStepResource();
console.log(content);
},
//
deleteRow(rowIndex) {
const stepTableRef = this.$refs['stepTableRef'];
if (stepTableRef) {
stepTableRef.deleteRow(rowIndex);
}
},
configComplete(val) {
if (val.rowData.sjjzxql === '' || val.rowData.sjjzxql === undefined || val.rowData.sjryxql === '' || val.rowData.sjryxql === undefined) {
this.$message.error("表格内容未填完")
return
}
console.log("完成配置数据:" + JSON.stringify(val))
const { total, unit } = addTj([val.rowData.sjjzxql, val.rowData.sjryxql], [val.headerSelectFields.sjjzxqlUnit, val.headerSelectFields.sjryxqlUnit])
let postData = {
mc: null,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.rowData.bh + val.rowData.bhCode,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
kc: total,
kcdw: unit,
}
console.log("完成配置提交数据:" + JSON.stringify(postData))
sj_configurationCompleted(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
startConfig(val) {
console.log("开始配置数据:" + JSON.stringify(val))
let postData = {
bh: val.rowData.bh + val.rowData.bhCode,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
}
console.log("开始配置提交数据:" + JSON.stringify(postData))
sj_startConfiguration(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
},
subPackageSubmit(val) {
console.log("分装数据:" + JSON.stringify(val))
if (val.fzsj.fzList && val.fzsj.fzList.length > 0) {
let list = []
for (let i = 0; i < val.fzsj.fzList.length; i++) {
let item = val.fzsj.fzList[i]
list.push({
bh: val.fzsj.mybh + item.preCode,
kc: item.num,
kcdw: val.fzsj.dw,
})
}
let postData = {
studyId: this.formData.studyId,
studyFormId: this.formData.id,
studySubjectId: this.formData.studySubjectId,
bh: val.fzsj.mybh,
nd: val.rowData.hhwznd,
nddw: val.headerSelectFields.hhwzndUnit,
list: list
}
console.log("分装提交数据:" + JSON.stringify(postData))
sj_subpackage(postData).then(() => {
}).catch(() => {
})
.finally(() => {
})
}
},
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.print-btn {
margin-bottom: 20px;
}
</style>

+ 0
- 1
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -851,7 +851,6 @@ export default {
const stepResource = this.getStepResource() const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || []) this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource
return this.resourceTmp; return this.resourceTmp;
}, },
getStepResource() { getStepResource() {

+ 2
- 0
src/views/business/comps/template/mixins/templateMixin.js View File

@ -29,6 +29,8 @@ export default {
'business_sp_xskkx', //色谱-编号-稀释可靠性 'business_sp_xskkx', //色谱-编号-稀释可靠性
'business_sp_cbydb', //色谱-编号-储备液对比 'business_sp_cbydb', //色谱-编号-储备液对比
'business_pcr_gzy', // PCR-编号-工作液 'business_pcr_gzy', // PCR-编号-工作液
'business_lba_jg' // LBA006-结果
], ],
props: { props: {
templateData: { templateData: {

Loading…
Cancel
Save