diff --git a/src/lang/en/template/dl.js b/src/lang/en/template/dl.js
index 10926e1..892c025 100644
--- a/src/lang/en/template/dl.js
+++ b/src/lang/en/template/dl.js
@@ -168,14 +168,48 @@ export default {
},
dl013: {
...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: {
...common,
gyzjxx: 'Drug Administration Information',
wzly: 'Material Source',
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: {
...common,
diff --git a/src/lang/zh/template/dl.js b/src/lang/zh/template/dl.js
index 931d381..2819a16 100644
--- a/src/lang/zh/template/dl.js
+++ b/src/lang/zh/template/dl.js
@@ -169,14 +169,48 @@ export default {
},
dl013: {
...common,
- cdxx: '测定信息'
+ cdxx: '测定信息',
+ xbmc: '细胞名称',
+ xbbh: '细胞编号',
+ xbxytj: '细胞悬液体积',
+ sjmcdptj: '实际每次滴片体积(ul)',
+ cdcs: '测定次数',
+ pjxbmd: '平均细胞密度',
+ xsbs: '稀释倍数',
+ xbmd: '细胞密度(个/ml)',
+ zsg: '左上格(个)',
+ ysg: '右上格(个)',
+ zxg: '左下格(个)',
+ yxg: '右下格(个)',
+ cdxxTime: '第{index}次',
+ addCdxx: '新增'
},
dl014: {
...common,
gyzjxx: '给药制剂信息',
wzly: '物质来源',
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: {
...common,
diff --git a/src/views/business/comps/template/comps/dl/DL013.vue b/src/views/business/comps/template/comps/dl/DL013.vue
index df575dc..72f5fc1 100644
--- a/src/views/business/comps/template/comps/dl/DL013.vue
+++ b/src/views/business/comps/template/comps/dl/DL013.vue
@@ -58,33 +58,35 @@
:formConfig="cdxxConfig"
:formData="formData"
/>
-
-
新增
+
+ {{
+ $t('template.dl.dl013.addCdxx')
+ }}
@@ -109,7 +111,8 @@ import LineLabel from '@/components/Template/LineLabel'
import TableList from '@/components/Template/Table'
import Step from '@/components/Template/Step'
import templateMixin from '../../mixins/templateMixin'
-import moment from 'moment'
+import { getuuid } from '@/utils/index.js'
+import { EventBus } from '@/utils/eventBus'
const refConf = {
base: 'baseInfoRef',
@@ -248,19 +251,19 @@ export default {
type: 'step',
config: {
xbmc: {
- label: '细胞名称',
+ label: 'template.dl.dl013.xbmc',
type: 'select',
options: this.getDictOptions('business_dl_xbmc'),
fillType: 'actFill',
otherCode: 'xbmcOther'
},
xbbh: {
- label: '细胞编号',
+ label: 'template.dl.dl013.xbbh',
type: 'xb',
fillType: 'actFill'
},
xbxytj: {
- label: '细胞悬液体积',
+ label: 'template.dl.dl013.xbxytj',
type: 'inputNumber',
subType: 'select',
subKey: 'xbxytjUnit',
@@ -278,18 +281,18 @@ export default {
type: 'step',
config: {
sjmcdptj: {
- label: '实际每次滴片体积(ul)',
+ label: 'template.dl.dl013.sjmcdptj',
type: 'inputNumber',
fillType: 'actFill'
},
cdcs: {
- label: '测定次数',
+ label: 'template.dl.dl013.cdcs',
type: 'inputNumber',
fillType: 'actFill',
disabled: true
},
pjxbmd: {
- label: '平均细胞密度',
+ label: 'template.dl.dl013.pjxbmd',
type: 'inputNumber',
fillType: 'actFill',
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() {
return {
formData: {},
- refConf,
- cdcs: 0
+ refConf
}
},
mounted() {
- this.cdcs = this.getCdcsNumber()
+ const formData = this.getFormDataByTemplateData()
+ // 初始化 cdxxConfigs 数组
+ if (!this.formData.cdxxConfigs) {
+ this.$set(this.formData, 'cdxxConfigs', [])
+ }
},
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) {
console.log(e, 'e+++')
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) {
xsbs = this.getNumber(xsbs)
zsg = this.getNumber(zsg)
@@ -376,14 +380,37 @@ export default {
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
getNumber(data) {
@@ -393,34 +420,71 @@ export default {
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,
signData: null
- }
- )
- this.cdcs = this.getCdcsNumber()
+ })
+
+ this.$nextTick(() => {
+ // 更新平均细胞密度
+ this.updatePjxbmd()
+ // 通知后端保存数据
+ EventBus.$emit('onModifyRecord', {
+ type: 'fieldChanged',
+ newRecord: null,
+ resourceList: null
+ })
+ })
+ }
},
- // 新增测定信息次数
+ // 新增测定信息
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',
- this.getCdcsNumber() + 1,
+ this.formData.cdxxConfigs.length,
{
isUpdateRecord: false,
signData: null
}
)
- this.cdcs = this.getCdcsNumber()
+
+ this.$nextTick(() => {
+ // 通知后端保存数据
+ EventBus.$emit('onModifyRecord', {
+ type: 'fieldChanged',
+ newRecord: null,
+ resourceList: null
+ })
+ })
},
// 删除表格行
deleteTableRow(rowIndex, refName) {
@@ -428,27 +492,79 @@ export default {
},
// 获取已填写的表单数据
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() {
- 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() {
- 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() {
const stepResource = this.$refs.yqsyTableRef.getStepResource()
diff --git a/src/views/business/comps/template/comps/dl/DL014.vue b/src/views/business/comps/template/comps/dl/DL014.vue
index 4b0a47b..77731e6 100644
--- a/src/views/business/comps/template/comps/dl/DL014.vue
+++ b/src/views/business/comps/template/comps/dl/DL014.vue
@@ -81,8 +81,58 @@
:formData="formData"
/>
-
+
+
!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: ''
+ })
+ }
+ })
+
+ // 直接修改 formData,CustomTable 会自动响应
+ this.$set(this.formData, 'jlzTableData', newRows)
+
+ this.$message.success(`已生成 ${newRows.length} 行剂量组数据`)
+ },
// 保存
async onSave() {
const formData = this.getStepResource()
@@ -399,13 +637,10 @@ export default {
.print-btn {
margin-bottom: 20px;
}
-.config-header-end {
+
+.jlzmc-complete-btn {
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;
}
diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js
index 8900564..41d348b 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -43,6 +43,7 @@ export default {
'business_dl_amesbjjt', // 毒理-Ames背景菌苔
'business_dl_amescdqk', // 毒理-Ames沉淀情况
'business_dl_xbmc', // 毒理-Ames细胞名称
+ 'business_dl_qsxjbltj', // 毒理-暴露条件
'business_rylx', // 溶液类型
'business_xbzb', // 细胞组别
'business_xblx', // 细胞类型