diff --git a/src/lang/en/template/dl.js b/src/lang/en/template/dl.js index 892c025..5d7650a 100644 --- a/src/lang/en/template/dl.js +++ b/src/lang/en/template/dl.js @@ -213,7 +213,15 @@ export default { }, dl015: { ...common, - hyqk: 'Medium Change Status' + hyqk: 'Medium Change Status', + jlzb: 'Dose Group', + xybh: 'Suspension Number', + hyqszqk: 'Growth Before Medium Change', + hyqcdjqk: 'Precipitation Before Medium Change', + hyqqtqk: 'Other Conditions Before Medium Change', + qqpyy: 'Discard Culture Medium', + pbsxd: 'PBS Wash', + pyybrl: 'Culture Medium Volume Added (ul)' }, dl016: { xbxx:'细胞信息', diff --git a/src/lang/zh/template/dl.js b/src/lang/zh/template/dl.js index 2819a16..8a56b24 100644 --- a/src/lang/zh/template/dl.js +++ b/src/lang/zh/template/dl.js @@ -214,7 +214,15 @@ export default { }, dl015: { ...common, - hyqk: '换液情况' + hyqk: '换液情况', + jlzb: '剂量组别', + xybh: '悬液编号', + hyqszqk: '换液前生长情况', + hyqcdjqk: '换液前沉淀情况', + hyqqtqk: '换液前其他情况', + qqpyy: '倾去培养液', + pbsxd: 'PBS洗涤', + pyybrl: '培养液补入量(ul)' }, dl016: { xbxx:'细胞信息', diff --git a/src/views/business/comps/template/comps/dl/DL014.vue b/src/views/business/comps/template/comps/dl/DL014.vue index 77731e6..5abe068 100644 --- a/src/views/business/comps/template/comps/dl/DL014.vue +++ b/src/views/business/comps/template/comps/dl/DL014.vue @@ -16,43 +16,8 @@ :formData="formData" /> - - - - - - - - - + + item.yqbh) + .map(item => ({ + bh: item.yqbh, + mc: item.yqmc, + xh: item.yqxh + })) + + // 从剂量组表格中提取试剂资源(如果有 S9混合液编号或细胞编号) + const jlzData = this.$refs.jlzTableRef?.getFilledFormData() + const jlzList = jlzData?.stepTableFormData || [] + + const sjResourceFromJlz = [] + jlzList.forEach(item => { + // 如果有细胞编号,添加到试剂资源 + if (item.xybh) { + sjResourceFromJlz.push({ + bh: item.xybh, + type: 'cell' + }) + } + }) + + this.resourceTmp = sjResourceFromJlz + return this.resourceTmp }, onRegentSubmit(e) { @@ -524,7 +590,7 @@ export default { const params = { yqmc: row.mc, yqxh: row.xh, - xccsjzjdrq: row.jzrq + jzrq: row.jzrq } this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } @@ -544,12 +610,12 @@ export default { // 获取剂量组总数 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++) { @@ -557,10 +623,10 @@ export default { jlzzmc: '' }) } - + // 直接修改 formData,CustomTable 会自动响应 this.$set(this.formData, 'jlzmcTableData', newJlzmcRows) - + this.$message.success(`已生成 ${jlzzs} 个剂量组名称`) } }, @@ -569,35 +635,37 @@ export default { // 获取平行瓶数 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() === '') + 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({ @@ -615,10 +683,10 @@ export default { }) } }) - + // 直接修改 formData,CustomTable 会自动响应 this.$set(this.formData, 'jlzTableData', newRows) - + this.$message.success(`已生成 ${newRows.length} 行剂量组数据`) }, // 保存 diff --git a/src/views/business/comps/template/comps/dl/DL015.vue b/src/views/business/comps/template/comps/dl/DL015.vue index 8199dda..a4b6f1e 100644 --- a/src/views/business/comps/template/comps/dl/DL015.vue +++ b/src/views/business/comps/template/comps/dl/DL015.vue @@ -16,55 +16,38 @@ :formData="formData" /> - - + + + + - - + @onRegentSubmit="onRegentSubmit" + /> - + + - - - - - - @@ -89,13 +72,11 @@ import LineLabel from '@/components/Template/LineLabel' import TableList from '@/components/Template/Table' import Step from '@/components/Template/Step' import templateMixin from '../../mixins/templateMixin' -import moment from 'moment' const refConf = { base: 'baseInfoRef', - sysj: 'sysjTableRef', - yqsy: 'yqsyTableRef', xbInfo: 'xbInfoRef', + hyqk: 'hyqkTableRef', step: 'stepRef', remark: 'remarkRef' } @@ -119,6 +100,13 @@ export default { } }, computed: { + // 换液情况表格数据 + hyqkFormData() { + return { + stepTableFormData: this.formData.hyqkTableData || [], + headerSelectFields: {} + } + }, // 备注表单配置 remarkConfig() { return [ @@ -174,12 +162,12 @@ export default { type: 'cellItem', label: 'template.dl.dl015.czsj', config: { - kssj: { + startDate: { label: 'template.dl.dl015.kssj', type: 'input', disabled: true }, - jssj: { + endDate: { label: 'template.dl.dl015.jssj', type: 'input', disabled: true @@ -188,98 +176,102 @@ export default { } ] }, - // 试验试剂信息 - sysjColumns() { + // 细胞信息表单配置 + xbInfoFormConfig() { return [ { - label: 'template.dl.dl015.sjmc', - prop: 'sjmc', - bodyType: 'input', - bodyFillType: 'actFill' - }, + type: 'cellItem', + config: { + qxbd: { + label: 'template.dl.dl015.qxbd', + type: 'qxbd', + qxbdType:'DL014', + fillType: 'actFill', + filledCodes: ['bdmc', 'bdbh'] + }, + bltj: { + label: 'template.dl.dl015.bltj', + type: 'select', + options: this.getDictOptions('business_dl_qsxjbltj'), + fillType: 'preFill', + otherCode: 'bltjOther' + } + } + } + ] + }, + // 换液情况表格列配置 + hyqkColumns() { + return [ { - label: 'template.dl.dl015.bh', - prop: 'bh', + label: 'template.dl.dl015.jlzb', + prop: 'jlzb', bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + bodyDisabled: true, + disabled: true }, { - label: 'template.dl.dl015.ph', - prop: 'ph', + label: 'template.dl.dl015.xybh', + prop: 'xybh', bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + bodyDisabled: true, + disabled: true }, { - label: 'template.dl.dl015.ndhlcd', - prop: 'ndhlcd', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqszqk', + prop: 'hyqszqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '良好', value: '良好' }, + { label: '中', value: '中' }, + { label: '差', value: '差' } + ] }, { - label: 'template.dl.dl015.ly', - prop: 'ly', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqcdjqk', + prop: 'hyqcdjqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '严重', value: '严重' }, + { label: '中等', value: '中等' }, + { label: '较少', value: '较少' }, + { label: '无', value: '无' } + ] }, { - label: 'template.dl.dl015.sxr', - prop: 'sxr', - bodyType: 'input', - bodyFillType: 'actFill' - } - ] - }, - // 仪器使用信息 - yqsyColumns() { - return [ - { - label: 'template.dl.dl015.yqmc', - prop: 'yqmc', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqqtqk', + prop: 'hyqqtqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' }, + { label: '无', value: '无' } + ] }, { - label: 'template.dl.dl015.yqxh', - prop: 'yqxh', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.qqpyy', + prop: 'qqpyy', + bodyType: 'checkbox', + bodyFillType: 'actFill', + checkboxLabel: '' }, { - label: 'template.dl.dl015.yqbh', - prop: 'yqbh', - bodyType: 'yq', - bodyFillType: 'actFill' + label: 'template.dl.dl015.pbsxd', + prop: 'pbsxd', + bodyType: 'checkbox', + bodyFillType: 'actFill', + checkboxLabel: '' }, { - label: 'template.dl.dl015.xccsjzjdrq', - prop: 'xccsjzjdrq', - bodyType: 'input', - bodyDisabled: true, + label: 'template.dl.dl015.pyybrl', + prop: 'pyybrl', + bodyType: 'inputNumber', bodyFillType: 'actFill', - disabled: true - } - ] - }, - // 细胞信息表单配置 - xbInfoFormConfig() { - return [ - { - type: 'cellItem', - config: { - qxbd: { - label: 'template.dl.dl015.qxbd', - type: 'qxbd', - fillType: 'actFill', - filledCodes: ['bdmc', 'bdbh'] - }, - bltj: { - label: 'template.dl.dl015.bltj', - type: 'select', - options: this.getDictOptions('business_bltj'), - fillType: 'preFill', - otherCode: 'bltjOther' - } - } + bodyMaxlength: 10 } ] } @@ -297,7 +289,15 @@ export default { }, // 获取已填写的表单数据 getFilledFormData() { - return this.getFilledFormDataByRefs(refNames) + const baseData = this.getFilledFormDataByRefs(refNames) + + // 确保换液情况数据被正确保存 + const hyqkData = this.$refs[refConf.hyqk]?.getFilledFormData() + if (hyqkData) { + baseData.hyqkTableData = hyqkData.stepTableFormData || [] + } + + return baseData }, // 获取填写完成的表单数据 async getFormData() { @@ -308,32 +308,64 @@ export default { return await this.validFormFields(refNames) }, getResource() { - const sysjStepResource = this.$refs.sysjTableRef.getStepResource() - const yqsyStepResource = this.$refs.yqsyTableRef.getStepResource() const stepResource = this.$refs.stepRef.getStepResource() - // 使用的试剂、仪器 - this.resourceTmp = [ - ...(sysjStepResource.sjResource || []), - ...(yqsyStepResource.sjResource || []), - ...(stepResource.sjResource || []) - ] - this.yqResourceTmp = [ - ...(yqsyStepResource.yqResource || []), - ...(stepResource.yqResource || []) - ] + const hyqkData = this.$refs.hyqkTableRef?.getFilledFormData() + const hyqkList = hyqkData?.stepTableFormData || [] + + // 从操作步骤中提取试剂和仪器资源 + this.resourceTmp = stepResource.sjResource || [] + this.yqResourceTmp = stepResource.yqResource || [] + + // 从换液情况表格中提取悬液编号作为试剂资源 + const sjResourceFromHyqk = hyqkList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) + + this.resourceTmp = [...this.resourceTmp, ...sjResourceFromHyqk] + return this.resourceTmp }, onRegentSubmit(e) { - const { selectInfo, key, rowIndex } = e + const { selectInfo, key } = e const { row } = selectInfo - if (key === 'yqbh') { - const params = { - yqmc: row.mc, - yqxh: row.xh, - xccsjzjdrq: row.jzrq + if (key === 'qxbd') { + try { + // 解析前序表单的内容 + const bdnr = JSON.parse(row.bdnr) + console.log('前序表单数据:', bdnr) + + // 获取剂量组列表数据 + const jlzTableData = bdnr.jlzTableData || [] + + if (jlzTableData.length === 0) { + this.$message.warning('前序表单中没有剂量组数据') + return + } + + // 从剂量组数据中提取剂量组别和悬液编号 + const hyqkData = jlzTableData.map(item => ({ + jlzb: item.jlzb || '', // 剂量组别 + xybh: item.xybh || '', // 悬液编号 + hyqszqk: '', // 换液前生长情况 + hyqcdjqk: '', // 换液前沉淀情况 + hyqqtqk: '', // 换液前其他情况 + qqpyy: '', // 倾去培养液 + pbsxd: '', // PBS洗涤 + pyybrl: '' // 培养液补入量 + })) + + // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 + this.$set(this.formData, 'hyqkTableData', hyqkData) + + this.$message.success(`已从前序表单加载 ${hyqkData.length} 条剂量组数据`) + } catch (error) { + console.error('解析前序表单数据失败:', error) + this.$message.error('解析前序表单数据失败') } - this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } }, // 保存