Browse Source

feat:[模板管理][DL013~DL014表单完善]

ouqian
ouqian 1 month ago
parent
commit
559dba1b38
5 changed files with 699 additions and 279 deletions
  1. +36
    -2
      src/lang/en/template/dl.js
  2. +36
    -2
      src/lang/zh/template/dl.js
  3. +231
    -115
      src/views/business/comps/template/comps/dl/DL013.vue
  4. +395
    -160
      src/views/business/comps/template/comps/dl/DL014.vue
  5. +1
    -0
      src/views/business/comps/template/mixins/templateMixin.js

+ 36
- 2
src/lang/en/template/dl.js View File

@ -168,14 +168,48 @@ export default {
}, },
dl013: { dl013: {
...common, ...common,
cdxx: 'Measurement Information'
cdxx: 'Measurement Information',
xbmc: 'Cell Name',
xbbh: 'Cell Number',
xbxytj: 'Cell Suspension Volume',
sjmcdptj: 'Actual Volume per Drop (ul)',
cdcs: 'Measurement Times',
pjxbmd: 'Average Cell Density',
xsbs: 'Dilution Factor',
xbmd: 'Cell Density (cells/ml)',
zsg: 'Upper Left Grid (cells)',
ysg: 'Upper Right Grid (cells)',
zxg: 'Lower Left Grid (cells)',
yxg: 'Lower Right Grid (cells)',
cdxxTime: 'Time {index}',
addCdxx: 'Add'
}, },
dl014: { dl014: {
...common, ...common,
gyzjxx: 'Drug Administration Information', gyzjxx: 'Drug Administration Information',
wzly: 'Material Source', wzly: 'Material Source',
xbmc: 'Cell Name', xbmc: 'Cell Name',
jlzpzxx: 'Dose Group Preparation Information'
jlzpzxx: 'Dose Group Preparation Information',
addJlz: 'Add Dose Group',
pxpb: 'Parallel Bottles',
sftjs9: 'Add S9',
s9hhybh: 'S9 Mix Number',
jlzzs: 'Dose Group Quantity',
jlzzmc: 'Dose Group Name',
pyy: 'Culture Medium',
jlzb: 'Dose Group',
xybh: 'Suspension Number',
gysqgc: 'Pre-dose Observation',
ysplyjrl: 'Preset Culture Medium Volume',
sjplyjrl: 'Actual Culture Medium Volume',
yss9hhyjrl: 'Preset S9 Mix Volume',
sjs9hhyjrl: 'Actual S9 Mix Volume',
gspbh: 'Test Article Number',
ysgspjrl: 'Preset Test Article Volume',
sjgspjrl: 'Actual Test Article Volume',
gyhzqk: 'Post-dose Status',
qrButton: 'Confirm',
wcButton: 'Complete'
}, },
dl015: { dl015: {
...common, ...common,

+ 36
- 2
src/lang/zh/template/dl.js View File

@ -169,14 +169,48 @@ export default {
}, },
dl013: { dl013: {
...common, ...common,
cdxx: '测定信息'
cdxx: '测定信息',
xbmc: '细胞名称',
xbbh: '细胞编号',
xbxytj: '细胞悬液体积',
sjmcdptj: '实际每次滴片体积(ul)',
cdcs: '测定次数',
pjxbmd: '平均细胞密度',
xsbs: '稀释倍数',
xbmd: '细胞密度(个/ml)',
zsg: '左上格(个)',
ysg: '右上格(个)',
zxg: '左下格(个)',
yxg: '右下格(个)',
cdxxTime: '第{index}次',
addCdxx: '新增'
}, },
dl014: { dl014: {
...common, ...common,
gyzjxx: '给药制剂信息', gyzjxx: '给药制剂信息',
wzly: '物质来源', wzly: '物质来源',
xbmc: '细胞名称', xbmc: '细胞名称',
jlzpzxx: '剂量组配制信息'
jlzpzxx: '剂量组配制信息',
addJlz: '新增剂量组',
pxpb: '平行瓶数',
sftjs9: '是否添加S9',
s9hhybh: 'S9混合液编号',
jlzzs: '剂量组数量',
jlzzmc: '剂量组名称',
pyy: '培养液',
jlzb: '剂量组别',
xybh: '悬液编号',
gysqgc: '给药前观察',
ysplyjrl: '预设培养液加入量',
sjplyjrl: '实际培养液加入量',
yss9hhyjrl: '预设S9混合液加入量',
sjs9hhyjrl: '实际S9混合液加入量',
gspbh: '供试品编号',
ysgspjrl: '预设供试品加入量',
sjgspjrl: '实际供试品加入量',
gyhzqk: '给药后状态情况',
qrButton: '确认',
wcButton: '完成'
}, },
dl015: { dl015: {
...common, ...common,

+ 231
- 115
src/views/business/comps/template/comps/dl/DL013.vue View File

@ -58,33 +58,35 @@
:formConfig="cdxxConfig" :formConfig="cdxxConfig"
:formData="formData" :formData="formData"
/> />
<div>
<el-button type="primary" @click="handleCdxxAdd">新增</el-button>
<div v-if="fillType === 'actFill'">
<el-button type="primary" @click="handleCdxxAdd">{{
$t('template.dl.dl013.addCdxx')
}}</el-button>
</div> </div>
</div> </div>
<!-- 测定信息第X次 --> <!-- 测定信息第X次 -->
<div <div
class="template-form-item" class="template-form-item"
v-for="(item, index) in cdxxTimeConfigs"
:key="index"
v-for="(cdxxItem, index) in formData.cdxxConfigs"
:key="'cdxx_' + cdxxItem.id"
> >
<div class="flex-between"> <div class="flex-between">
<span>{{ index + 1 }}</span>
<el-button type="danger" plain @click="handleCdxxDelete(index)"
>删除</el-button
<span>{{ $t('template.dl.dl013.cdxxTime', { index: index + 1 }) }}</span>
<el-button
v-if="fillType === 'actFill'"
type="danger"
plain
@click="handleCdxxDelete(cdxxItem)"
>{{ $t('template.common.deleteBtn') }}</el-button
> >
</div> </div>
<BaseInfoFormPackage <BaseInfoFormPackage
fieldItemLabel="" fieldItemLabel=""
label="" label=""
:ref="`cdxx${index}Ref`" :ref="`cdxx${index}Ref`"
:formConfig="item"
:formData="formData"
@blur="
(e) => {
onBlur(e, index)
}
"
:formConfig="getCdxxTimeConfig(index)"
:formData="cdxxItem"
@blur="(e) => onBlur(e, index)"
/> />
</div> </div>
@ -109,7 +111,8 @@ 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 templateMixin from '../../mixins/templateMixin'
import moment from 'moment'
import { getuuid } from '@/utils/index.js'
import { EventBus } from '@/utils/eventBus'
const refConf = { const refConf = {
base: 'baseInfoRef', base: 'baseInfoRef',
@ -248,19 +251,19 @@ export default {
type: 'step', type: 'step',
config: { config: {
xbmc: { xbmc: {
label: '细胞名称',
label: 'template.dl.dl013.xbmc',
type: 'select', type: 'select',
options: this.getDictOptions('business_dl_xbmc'), options: this.getDictOptions('business_dl_xbmc'),
fillType: 'actFill', fillType: 'actFill',
otherCode: 'xbmcOther' otherCode: 'xbmcOther'
}, },
xbbh: { xbbh: {
label: '细胞编号',
label: 'template.dl.dl013.xbbh',
type: 'xb', type: 'xb',
fillType: 'actFill' fillType: 'actFill'
}, },
xbxytj: { xbxytj: {
label: '细胞悬液体积',
label: 'template.dl.dl013.xbxytj',
type: 'inputNumber', type: 'inputNumber',
subType: 'select', subType: 'select',
subKey: 'xbxytjUnit', subKey: 'xbxytjUnit',
@ -278,18 +281,18 @@ export default {
type: 'step', type: 'step',
config: { config: {
sjmcdptj: { sjmcdptj: {
label: '实际每次滴片体积(ul)',
label: 'template.dl.dl013.sjmcdptj',
type: 'inputNumber', type: 'inputNumber',
fillType: 'actFill' fillType: 'actFill'
}, },
cdcs: { cdcs: {
label: '测定次数',
label: 'template.dl.dl013.cdcs',
type: 'inputNumber', type: 'inputNumber',
fillType: 'actFill', fillType: 'actFill',
disabled: true disabled: true
}, },
pjxbmd: { pjxbmd: {
label: '平均细胞密度',
label: 'template.dl.dl013.pjxbmd',
type: 'inputNumber', type: 'inputNumber',
fillType: 'actFill', fillType: 'actFill',
disabled: true disabled: true
@ -297,76 +300,77 @@ export default {
} }
} }
] ]
},
cdxxTimeConfigs() {
const array = []
for (let index = 1; index <= this.cdcs; index++) {
array.push([
{
type: 'step',
config: {
[`xsbs_${index}`]: {
label: '稀释倍数',
type: 'inputNumber',
maxlength: 4,
fillType: 'actFill'
},
[`xbmd_${index}`]: {
label: '细胞密度(个/ml)',
type: 'input',
fillType: 'actFill',
disabled: true
},
[`zsg_${index}`]: {
label: '左上格(个)',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
[`ysg_${index}`]: {
label: '右上格(个)',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
[`zxg_${index}`]: {
label: '左下格(个)',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
[`yxg_${index}`]: {
label: '右下格(个)',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
}
}
}
])
}
return array
} }
}, },
data() { data() {
return { return {
formData: {}, formData: {},
refConf,
cdcs: 0
refConf
} }
}, },
mounted() { mounted() {
this.cdcs = this.getCdcsNumber()
const formData = this.getFormDataByTemplateData()
// cdxxConfigs
if (!this.formData.cdxxConfigs) {
this.$set(this.formData, 'cdxxConfigs', [])
}
}, },
methods: { methods: {
//
getCdxxTimeConfig(index) {
return [
{
type: 'step',
config: {
xsbs: {
label: 'template.dl.dl013.xsbs',
type: 'inputNumber',
maxlength: 4,
fillType: 'actFill'
},
xbmd: {
label: 'template.dl.dl013.xbmd',
type: 'input',
fillType: 'actFill',
disabled: true
},
zsg: {
label: 'template.dl.dl013.zsg',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
ysg: {
label: 'template.dl.dl013.ysg',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
zxg: {
label: 'template.dl.dl013.zxg',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
},
yxg: {
label: 'template.dl.dl013.yxg',
type: 'inputNumber',
fillType: 'actFill',
maxlength: 10
}
}
}
]
},
onBlur(e, index) { onBlur(e, index) {
console.log(e, 'e+++') console.log(e, 'e+++')
let xbmd = undefined let xbmd = undefined
let xsbs = e[`xsbs_${index + 1}`]
let zsg = e[`zsg_${index + 1}`]
let ysg = e[`ysg_${index + 1}`]
let zxg = e[`zxg_${index + 1}`]
let yxg = e[`yxg_${index + 1}`]
let xsbs = e.xsbs
let zsg = e.zsg
let ysg = e.ysg
let zxg = e.zxg
let yxg = e.yxg
if (xsbs && zsg && ysg && zxg && yxg) { if (xsbs && zsg && ysg && zxg && yxg) {
xsbs = this.getNumber(xsbs) xsbs = this.getNumber(xsbs)
zsg = this.getNumber(zsg) zsg = this.getNumber(zsg)
@ -376,14 +380,37 @@ export default {
xbmd = (((zsg + zxg + ysg + yxg) / 4) * xsbs * 10000).toFixed(1) xbmd = (((zsg + zxg + ysg + yxg) / 4) * xsbs * 10000).toFixed(1)
} }
this.$refs[`cdxx${index}Ref`]?.[0]?.updateFormData(
`xbmd_${index + 1}`,
xbmd,
{
isUpdateRecord: false,
signData: null
this.$refs[`cdxx${index}Ref`]?.[0]?.updateFormData('xbmd', xbmd, {
isUpdateRecord: false,
signData: null
})
//
this.updatePjxbmd()
},
//
updatePjxbmd() {
if (!this.formData.cdxxConfigs || this.formData.cdxxConfigs.length === 0) {
return
}
let total = 0
let count = 0
for (let i = 0; i < this.formData.cdxxConfigs.length; i++) {
const cdxxData = this.$refs[`cdxx${i}Ref`]?.[0]?.getFilledFormData()
if (cdxxData && cdxxData.xbmd) {
total += this.getNumber(cdxxData.xbmd)
count++
} }
)
}
const pjxbmd = count > 0 ? (total / count).toFixed(1) : undefined
this.$refs[refConf.cdxx]?.updateFormData('pjxbmd', pjxbmd, {
isUpdateRecord: false,
signData: null
})
}, },
// 0 // 0
getNumber(data) { getNumber(data) {
@ -393,34 +420,71 @@ export default {
return 0 return 0
} }
}, },
// 0
getCdcsNumber() {
const originData = this.getFilledFormDataByRefs([refConf.cdxx])
const { cdcs } = originData || {}
return this.getNumber(cdcs)
},
handleCdxxDelete(index) {
this.$refs[refConf.cdxx].updateFormData(
'cdcs',
this.getCdcsNumber() - 1 < 0 ? 0 : this.getCdcsNumber() - 1,
{
//
handleCdxxDelete(cdxxItem) {
const configIndex = this.formData.cdxxConfigs.findIndex(
(config) => config.id === cdxxItem.id
)
if (configIndex !== -1) {
//
const newConfigs = [...this.formData.cdxxConfigs]
newConfigs.splice(configIndex, 1)
this.$set(this.formData, 'cdxxConfigs', newConfigs)
//
this.$refs[refConf.cdxx]?.updateFormData('cdcs', newConfigs.length, {
isUpdateRecord: false, isUpdateRecord: false,
signData: null signData: null
}
)
this.cdcs = this.getCdcsNumber()
})
this.$nextTick(() => {
//
this.updatePjxbmd()
//
EventBus.$emit('onModifyRecord', {
type: 'fieldChanged',
newRecord: null,
resourceList: null
})
})
}
}, },
//
//
handleCdxxAdd() { handleCdxxAdd() {
this.$refs[refConf.cdxx].updateFormData(
//
if (!this.formData.cdxxConfigs) {
this.$set(this.formData, 'cdxxConfigs', [])
}
//
this.formData.cdxxConfigs.push({
id: getuuid(),
xsbs: null,
xbmd: null,
zsg: null,
ysg: null,
zxg: null,
yxg: null
})
//
this.$refs[refConf.cdxx]?.updateFormData(
'cdcs', 'cdcs',
this.getCdcsNumber() + 1,
this.formData.cdxxConfigs.length,
{ {
isUpdateRecord: false, isUpdateRecord: false,
signData: null signData: null
} }
) )
this.cdcs = this.getCdcsNumber()
this.$nextTick(() => {
//
EventBus.$emit('onModifyRecord', {
type: 'fieldChanged',
newRecord: null,
resourceList: null
})
})
}, },
// //
deleteTableRow(rowIndex, refName) { deleteTableRow(rowIndex, refName) {
@ -428,27 +492,79 @@ export default {
}, },
// //
getFilledFormData() { getFilledFormData() {
const arr = []
for (let index = 0; index < this.cdcs; index++) {
arr.push(`cdxx${index}Ref`)
const baseData = this.$refs[refConf.base]?.getFilledFormData() || {}
const yqsyData = this.$refs[refConf.yqsy]?.getFilledFormData() || {}
const xbxxData = this.$refs[refConf.xbxx]?.getFilledFormData() || {}
const cdxxData = this.$refs[refConf.cdxx]?.getFilledFormData() || {}
const remarkData = this.$refs[refConf.remark]?.getFilledFormData() || {}
//
const cdxxConfigsData = []
if (this.formData.cdxxConfigs && this.formData.cdxxConfigs.length > 0) {
for (let i = 0; i < this.formData.cdxxConfigs.length; i++) {
const id = this.formData.cdxxConfigs[i].id
const cdxxItemData =
this.$refs[`cdxx${i}Ref`]?.[0]?.getFilledFormData() || {}
cdxxConfigsData.push({
...cdxxItemData,
id
})
}
}
return {
...baseData,
...yqsyData,
...xbxxData,
...cdxxData,
cdxxConfigs: cdxxConfigsData,
...remarkData
} }
return this.getFilledFormDataByRefs([...refNames, ...arr])
}, },
// //
async getFormData() { async getFormData() {
const arr = []
for (let index = 0; index < this.cdcs; index++) {
arr.push(`cdxx${index}Ref`)
//
let refsToValidate = [
refConf.base,
refConf.yqsy,
refConf.xbxx,
refConf.cdxx,
refConf.remark
]
//
if (this.formData.cdxxConfigs && this.formData.cdxxConfigs.length > 0) {
for (let i = 0; i < this.formData.cdxxConfigs.length; i++) {
refsToValidate.push(`cdxx${i}Ref`)
}
} }
return await this.validFormFields([...refNames, ...arr])
const validFlag = await this.validFormFields(refsToValidate)
if (!validFlag) {
return false
}
return this.getFilledFormData()
}, },
// //
async validFields() { async validFields() {
const arr = []
for (let index = 0; index < this.cdcs; index++) {
arr.push(`cdxx${index}Ref`)
//
let refsToValidate = [
refConf.base,
refConf.yqsy,
refConf.xbxx,
refConf.cdxx,
refConf.remark
]
//
if (this.formData.cdxxConfigs && this.formData.cdxxConfigs.length > 0) {
for (let i = 0; i < this.formData.cdxxConfigs.length; i++) {
refsToValidate.push(`cdxx${i}Ref`)
}
} }
return await this.validFormFields([...refNames, ...arr])
return await this.validFormFields(refsToValidate)
}, },
getResource() { getResource() {
const stepResource = this.$refs.yqsyTableRef.getStepResource() const stepResource = this.$refs.yqsyTableRef.getStepResource()

+ 395
- 160
src/views/business/comps/template/comps/dl/DL014.vue View File

@ -81,8 +81,58 @@
:formData="formData" :formData="formData"
/> />
<!-- 预留区域 - 剂量组配制信息 -->
<!-- 剂量组配制信息 -->
<LineLabel label="template.dl.dl014.jlzpzxx" /> <LineLabel label="template.dl.dl014.jlzpzxx" />
<div class="template-form-item">
<BaseInfoFormPackage
fieldItemLabel=""
label=""
:ref="refConf.jlzInfo"
:formConfig="jlzInfoFormConfig"
:formData="formData"
@select="onSftjs9Change"
@clickButton="handleJlzzsButton"
/>
<!-- 剂量组名称列表 -->
<CustomTable
:columns="jlzmcTableColumns"
:ref="refConf.jlzmcTable"
:showOperation="false"
:showAddRow="false"
:formData="jlzmcTableFormData"
:prefixKey="`jlzmcTable`"
></CustomTable>
<!-- 完成按钮 -->
<div class="jlzmc-complete-btn" v-if="fillType === 'preFill'">
<el-button type="primary" @click="handleJlzmcComplete">{{
$t('template.dl.dl014.wcButton')
}}</el-button>
</div>
<!-- 剂量组列表 -->
<CustomTable
:columns="jlzTableColumns"
:ref="refConf.jlzTable"
:showOperation="false"
:showAddRow="false"
:formData="jlzTableFormData"
:prefixKey="`jlzTable`"
>
<template
slot="operation"
slot-scope="{ row, rowIndex, columns }"
>
<TableOpertaionDelete
:row="row"
:rowIndex="rowIndex"
:columns="columns"
@deleteRow="() => deleteTableRow(rowIndex, 'jlzTableRef')"
></TableOpertaionDelete>
</template>
</CustomTable>
</div>
<BaseInfoFormPackage <BaseInfoFormPackage
fieldItemLabel="template.dl.dl007.bz" fieldItemLabel="template.dl.dl007.bz"
@ -105,7 +155,6 @@ 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 templateMixin from '../../mixins/templateMixin'
import moment from 'moment'
const refConf = { const refConf = {
base: 'baseInfoRef', base: 'baseInfoRef',
@ -113,6 +162,9 @@ const refConf = {
sysj: 'sysjTableRef', sysj: 'sysjTableRef',
yqsy: 'yqsyTableRef', yqsy: 'yqsyTableRef',
xbInfo: 'xbInfoRef', xbInfo: 'xbInfoRef',
jlzInfo: 'jlzInfoRef',
jlzmcTable: 'jlzmcTableRef',
jlzTable: 'jlzTableRef',
remark: 'remarkRef' remark: 'remarkRef'
} }
const refNames = Object.values(refConf) const refNames = Object.values(refConf)
@ -135,152 +187,21 @@ export default {
} }
}, },
computed: { computed: {
//
remarkConfig() {
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.dl014.sydd',
config: {
sydd: {
span: 1,
label: 'template.dl.dl014.sydd',
type: 'select',
options: this.getDictOptions('business_sydd'),
fillType: 'actFill',
otherCode: 'syddOther'
}
}
},
{
type: 'cellItem',
label: 'template.dl.dl014.czsj',
config: {
kssj: {
label: 'template.dl.dl014.kssj',
type: 'input',
disabled: true
},
jssj: {
label: 'template.dl.dl014.jssj',
type: 'input',
disabled: true
}
}
}
]
},
//
gyzjColumns() {
return [
{
label: 'template.dl.dl014.mc',
prop: 'mc',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.bh',
prop: 'bh',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.wzly',
prop: 'wzly',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.nd',
prop: 'nd',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.sxr',
prop: 'sxr',
bodyType: 'input',
bodyFillType: 'actFill'
}
]
//
jlzmcTableFormData() {
return {
stepTableFormData: this.formData.jlzmcTableData || [],
headerSelectFields: {}
}
}, },
//
sysjColumns() {
return [
{
label: 'template.dl.dl014.sjmc',
prop: 'sjmc',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.bh',
prop: 'bh',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.ph',
prop: 'ph',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.ndhlcd',
prop: 'ndhlcd',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.ly',
prop: 'ly',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.sxr',
prop: 'sxr',
bodyType: 'input',
bodyFillType: 'actFill'
}
]
//
jlzTableFormData() {
return {
stepTableFormData: this.formData.jlzTableData || [],
headerSelectFields: this.formData.jlzHeaderSelectFields || {}
}
}, },
// 使
//
yqsyColumns() { yqsyColumns() {
return [ return [
{ {
@ -320,26 +241,198 @@ export default {
bltj: { bltj: {
label: 'template.dl.dl014.bltj', label: 'template.dl.dl014.bltj',
type: 'select', type: 'select',
options: this.getDictOptions('business_bltj'),
options: this.getDictOptions('business_dl_qsxjbltj'),
fillType: 'preFill', fillType: 'preFill',
otherCode: 'bltjOther' otherCode: 'bltjOther'
}, },
xbmc: { xbmc: {
label: 'template.dl.dl014.xbmc', label: 'template.dl.dl014.xbmc',
type: 'select', type: 'select',
options: this.getDictOptions('business_xbmc'),
options: this.getDictOptions('business_dl_xbmc'),
fillType: 'preFill', fillType: 'preFill',
otherCode: 'xbmcOther' otherCode: 'xbmcOther'
} }
} }
} }
] ]
},
//
jlzInfoFormConfig() {
const firstStepConfig = {
pxpb: {
label: 'template.dl.dl014.pxpb',
type: 'inputNumber',
fillType: 'preFill'
},
sftjs9: {
label: 'template.dl.dl014.sftjs9',
type: 'select',
options: [
{ label: '是', value: '是' },
{ label: '否', value: '否' }
],
fillType: 'preFill'
}
}
// S9S9
if (this.isSftjs9Yes) {
firstStepConfig.s9hhybh = {
label: 'template.dl.dl014.s9hhybh',
type: 'sj',
fillType: 'actFill'
}
}
//
firstStepConfig.jlzzs = {
label: 'template.dl.dl014.jlzzs',
type: 'inputNumber',
fillType: 'preFill',
subType: 'button',
subKey: 'jlzzsButton',
buttonName: 'template.dl.dl014.qrButton'
}
return [
{
type: 'step',
config: firstStepConfig
}
]
},
//
jlzmcTableColumns() {
return [
{
label: 'template.dl.dl014.jlzzmc',
prop: 'jlzzmc',
bodyType: 'input',
bodyFillType: 'preFill'
}
]
},
//
jlzTableColumns() {
const columns = [
{
label: 'template.dl.dl014.jlzb',
prop: 'jlzb',
bodyType: 'input',
bodyFillType: 'preFill'
},
{
label: 'template.dl.dl014.xybh',
prop: 'xybh',
bodyType: 'sj',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.gysqgc',
prop: 'gysqgc',
bodyType: 'select',
bodyFillType: 'actFill',
bodyOptions: this.getDictOptions('business_dl_gysqgc')
},
{
label: 'template.dl.dl014.ysplyjrl',
prop: 'ysplyjrl',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectKey: 'ysplyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
},
{
label: 'template.dl.dl014.sjplyjrl',
prop: 'sjplyjrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
headerSelectKey: 'ysplyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
}
]
// S9S9
if (this.isSftjs9Yes) {
columns.push(
{
label: 'template.dl.dl014.yss9hhyjrl',
prop: 'yss9hhyjrl',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectKey: 'yss9hhyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
},
{
label: 'template.dl.dl014.sjs9hhyjrl',
prop: 'sjs9hhyjrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
headerSelectKey: 'yss9hhyjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
}
)
}
//
columns.push(
{
label: 'template.dl.dl014.gspbh',
prop: 'gspbh',
bodyType: 'input',
bodyFillType: 'actFill'
},
{
label: 'template.dl.dl014.ysgspjrl',
prop: 'ysgspjrl',
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
},
{
label: 'template.dl.dl014.sjgspjrl',
prop: 'sjgspjrl',
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
headerSelectKey: 'ysgspjrlUnit',
headerOptions: this.getDictOptions('business_tjdw'),
fillType: 'preFill'
},
{
label: 'template.dl.dl014.gyhzqk',
prop: 'gyhzqk',
bodyType: 'select',
bodyFillType: 'actFill',
bodyOptions: this.getDictOptions('business_dl_gyhzqk')
}
)
return columns
} }
}, },
data() { data() {
return { return {
formData: {}, formData: {},
refConf
refConf,
isSftjs9Yes: false // S9
}
},
mounted() {
// isSftjs9Yes
if (this.formData.sftjs9) {
this.isSftjs9Yes = this.formData.sftjs9 === '是' || this.formData.sftjs9 === 'Yes'
} }
}, },
methods: { methods: {
@ -349,23 +442,76 @@ export default {
}, },
// //
getFilledFormData() { getFilledFormData() {
return this.getFilledFormDataByRefs(refNames)
const baseData = this.$refs[refConf.base]?.getFilledFormData() || {}
const gyzjData = this.$refs[refConf.gyzj]?.getFilledFormData() || {}
const sysjData = this.$refs[refConf.sysj]?.getFilledFormData() || {}
const yqsyData = this.$refs[refConf.yqsy]?.getFilledFormData() || {}
const xbInfoData = this.$refs[refConf.xbInfo]?.getFilledFormData() || {}
const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData() || {}
const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData() || {}
const jlzTableData = this.$refs[refConf.jlzTable]?.getFilledFormData() || {}
const remarkData = this.$refs[refConf.remark]?.getFilledFormData() || {}
return {
...baseData,
...gyzjData,
...sysjData,
...yqsyData,
...xbInfoData,
...jlzInfoData,
...remarkData,
// formData
jlzmcTableData: jlzmcTableData.stepTableFormData || [],
jlzTableData: jlzTableData.stepTableFormData || [],
jlzHeaderSelectFields: jlzTableData.headerSelectFields || {}
}
}, },
// //
async getFormData() { async getFormData() {
return await this.validFormFields(refNames)
const refsToValidate = [
refConf.base,
refConf.gyzj,
refConf.sysj,
refConf.yqsy,
refConf.xbInfo,
refConf.jlzInfo,
refConf.jlzmcTable,
refConf.jlzTable,
refConf.remark
]
const validFlag = await this.validFormFields(refsToValidate)
if (!validFlag) {
return false
}
return this.getFilledFormData()
}, },
// //
async validFields() { async validFields() {
return await this.validFormFields(refNames)
const refsToValidate = [
refConf.base,
refConf.gyzj,
refConf.sysj,
refConf.yqsy,
refConf.xbInfo,
refConf.jlzInfo,
refConf.jlzmcTable,
refConf.jlzTable,
refConf.remark
]
return await this.validFormFields(refsToValidate)
}, },
getResource() { getResource() {
const sysjStepResource = this.$refs.sysjTableRef.getStepResource() const sysjStepResource = this.$refs.sysjTableRef.getStepResource()
const yqsyStepResource = this.$refs.yqsyTableRef.getStepResource() const yqsyStepResource = this.$refs.yqsyTableRef.getStepResource()
const jlzTableResource = this.$refs.jlzTableRef.getStepResource()
// 使 // 使
this.resourceTmp = [ this.resourceTmp = [
...(sysjStepResource.sjResource || []), ...(sysjStepResource.sjResource || []),
...(yqsyStepResource.sjResource || [])
...(yqsyStepResource.sjResource || []),
...(jlzTableResource.sjResource || [])
] ]
this.yqResourceTmp = yqsyStepResource.yqResource || [] this.yqResourceTmp = yqsyStepResource.yqResource || []
return this.resourceTmp return this.resourceTmp
@ -383,6 +529,98 @@ export default {
this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params)
} }
}, },
// S9
onSftjs9Change(e) {
const { key, value } = e
if (key === 'sftjs9') {
// isSftjs9Yes computed
this.isSftjs9Yes = value === '是' || value === 'Yes'
}
},
//
handleJlzzsButton(item) {
const { subKey } = item || {}
if (subKey === 'jlzzsButton') {
//
const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData()
const jlzzs = jlzInfoData?.jlzzs
if (!jlzzs || jlzzs <= 0) {
this.$message.warning('请先输入剂量组总数')
return
}
//
const newJlzmcRows = []
for (let i = 0; i < jlzzs; i++) {
newJlzmcRows.push({
jlzzmc: ''
})
}
// formDataCustomTable
this.$set(this.formData, 'jlzmcTableData', newJlzmcRows)
this.$message.success(`已生成 ${jlzzs} 个剂量组名称`)
}
},
//
handleJlzmcComplete() {
//
const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData()
const pxpb = jlzInfoData?.pxpb
if (!pxpb || pxpb <= 0) {
this.$message.warning('请先输入平行瓶数')
return
}
// CustomTable ref
const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData()
const jlzmcList = jlzmcTableData?.stepTableFormData || []
if (jlzmcList.length === 0) {
this.$message.warning('请先设置剂量组名称')
return
}
//
const emptyNames = jlzmcList.filter(item => !item.jlzzmc || item.jlzzmc.trim() === '')
if (emptyNames.length > 0) {
this.$message.warning('请填写所有剂量组名称')
return
}
//
const newRows = []
//
jlzmcList.forEach((jlzmcItem) => {
const jlzzmc = jlzmcItem.jlzzmc
// pxpb
for (let i = 0; i < pxpb; i++) {
newRows.push({
jlzb: jlzzmc, // 使
xybh: '',
gysqgc: '',
ysplyjrl: '',
sjplyjrl: '',
yss9hhyjrl: '',
sjs9hhyjrl: '',
gspbh: '',
ysgspjrl: '',
sjgspjrl: '',
gyhzqk: ''
})
}
})
// formDataCustomTable
this.$set(this.formData, 'jlzTableData', newRows)
this.$message.success(`已生成 ${newRows.length} 行剂量组数据`)
},
// //
async onSave() { async onSave() {
const formData = this.getStepResource() const formData = this.getStepResource()
@ -399,13 +637,10 @@ export default {
.print-btn { .print-btn {
margin-bottom: 20px; margin-bottom: 20px;
} }
.config-header-end {
.jlzmc-complete-btn {
display: flex; display: flex;
justify-content: flex-end;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
justify-content: center;
margin: 15px 0;
} }
</style> </style>

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

@ -43,6 +43,7 @@ export default {
'business_dl_amesbjjt', // 毒理-Ames背景菌苔 'business_dl_amesbjjt', // 毒理-Ames背景菌苔
'business_dl_amescdqk', // 毒理-Ames沉淀情况 'business_dl_amescdqk', // 毒理-Ames沉淀情况
'business_dl_xbmc', // 毒理-Ames细胞名称 'business_dl_xbmc', // 毒理-Ames细胞名称
'business_dl_qsxjbltj', // 毒理-暴露条件
'business_rylx', // 溶液类型 'business_rylx', // 溶液类型
'business_xbzb', // 细胞组别 'business_xbzb', // 细胞组别
'business_xblx', // 细胞类型 'business_xblx', // 细胞类型

Loading…
Cancel
Save