diff --git a/src/views/business/comps/template/comps/dl/DL016.vue b/src/views/business/comps/template/comps/dl/DL016.vue index b25f678..ddfbebd 100644 --- a/src/views/business/comps/template/comps/dl/DL016.vue +++ b/src/views/business/comps/template/comps/dl/DL016.vue @@ -21,7 +21,7 @@ fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" @beforeSaveRecord = "beforeSaveRecord" :showAddRow="false" :showOperation="false" - ref="qcxjjyqkTableRef" :columns="stepColumns" :formData="qcxjjyqkFormData"> + ref="qcxjjyqkTableRef" :columns="stepColumns" :formData="tableFormData"> @@ -62,10 +62,10 @@ export default { }, }, computed: { - // 换液情况表格数据 - qcxjjyqkFormData() { + // 表格数据 + tableFormData() { return { - stepTableFormData: this.formData.qcxjjyqkData || [], + stepTableFormData: this.formData.stepTableFormData || [], headerSelectFields: {} } }, @@ -196,42 +196,34 @@ export default { }; }, mounted() { + console.log('mounted=============',this.formData); }, methods: { onRegentSubmit(e) { - debugger const { selectInfo, key, rowIndex } = e const { row } = selectInfo - console.log('selectInfo==============',selectInfo,key,rowIndex) if (key === 'qxbd') { try { // 解析前序表单的内容 const bdnr = JSON.parse(row.bdnr) - console.log('前序表单数据:', bdnr) - // 获取剂量组列表数据 - const qcxjjyqkData = bdnr.jlzTableData || [] + const stepTableFormData = bdnr.jlzTableData || [] - // if (qcxjjyqkData.length === 0) { - // this.$message.warning('前序表单中没有剂量组数据') - // return - // } + if (stepTableFormData.length === 0) { + // 清空当前的换液情况列表数据 + this.$set(this.formData, 'stepTableFormData', []) + this.$message.warning('前序表单中没有剂量组数据') + return + } // 从剂量组数据中提取剂量组别和悬液编号 - const itemData = qcxjjyqkData.map(item => ({ + const itemData = stepTableFormData.map(item => ({ jlzb: item.jlzb || '', // 剂量组别 xybh: item.xybh || '', // 悬液编号 - hyqszqk: '', // 换液前生长情况 - hyqcdjqk: '', // 换液前沉淀情况 - hyqqtqk: '', // 换液前其他情况 - qqpyy: '', // 倾去培养液 - pbsxd: '', // PBS洗涤 - pyybrl: '' // 培养液补入量 + qsxjjrl: '', // })) - debugger - // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 - this.$set(this.formData, 'qcxjjyqkData', itemData) + this.$set(this.formData, 'stepTableFormData', itemData) this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`) } catch (error) { @@ -262,48 +254,6 @@ export default { const formFields = this.$refs.swypyjInfoRef?.getFilledFormData(); this.onCommonVerifyNdException(formFields,data); }, - configComplete(val) { - const { rowData, headerSelectFields } = val; - //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) - const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) - let postData = { - mc: null, - bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, - nd: rowData.actSolutionConcentration,//实际目标溶液浓度 - nddw: headerSelectFields.actSolutionConcentrationUnit, - studySubjectId: this.formData.studySubjectId, - studyFormId:this.formData.id, - studyId:this.formData.studyId, - kc: total, - kcdw: unit, - } - this.configCompleteRequest(postData); - }, - //分装回调 - subPackageSubmit(data) { - 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, - studyFormId:this.formData.id, - list: list - } - this.subPackageRequest(postData); - } - }, //获取已填写的表单数据 getFilledFormData() { return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "qcxjjyqkTableRef", "stepRef","remarkRef"]) @@ -311,13 +261,27 @@ export default { //获取填写完成的表单数据 async getFormData() { let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "qcxjjyqkTableRef", "stepRef","remarkRef"]); - return content; + console.log('获取填写完成的表单数据==============',content); + return content; }, getResource() { //使用的试剂、仪器 const stepResource = this.$refs.stepRef.getStepResource() + const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || [] + // const tableList = hyqkData?.stepTableFormData || [] + // 从操作步骤中提取试剂和仪器资源 this.resourceTmp = stepResource.sjResource || [] this.yqResourceTmp = stepResource.yqResource || [] + + const tableFromHyqk = tableList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) + + this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk] + console.log('回显填写完成的表单数据==============',this.resourceTmp); return this.resourceTmp; }, //保存 diff --git a/src/views/business/comps/template/comps/dl/DL017.vue b/src/views/business/comps/template/comps/dl/DL017.vue index 0c2ddef..b517588 100644 --- a/src/views/business/comps/template/comps/dl/DL017.vue +++ b/src/views/business/comps/template/comps/dl/DL017.vue @@ -12,22 +12,16 @@ - + ref="stepTableRef" :columns="stepColumns" :formData="tableFormData"> @@ -57,7 +51,7 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion export default { name: "DL017", dicts: [ - 'business_dl_qsxjbltj','business_tjdw','business_dl_sjqszqk','business_dl_sjqcdqk','business_dl_sjqqtqk','business_dl_xbmc' + 'business_dl_qsxjbltj','business_tjdw','business_dl_sjqszqk','business_dl_sjqcdqk','business_dl_sjqqtqk','business_dl_xbmc',"business_sydd" ], components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete }, mixins: [templateMixin], @@ -68,6 +62,13 @@ export default { }, }, computed: { + // 表格数据 + tableFormData() { + return { + stepTableFormData: this.formData.stepTableFormData, + headerSelectFields: {} + } + }, // 备注表单配置 remarkConig() { return [ @@ -113,7 +114,7 @@ export default { label: 'template.dl.dl017.sydd', type: 'select', fillType: 'actFill', - options: this.getDictOptions('business_dl_xbmc'), + options: this.getDictOptions('business_sydd'), otherCode: 'xbmcOther', showOtherLabel:false }, @@ -146,7 +147,7 @@ export default { label: 'template.dl.dl017.qxbd', type: 'qxbd', fillType: 'actFill', - qxbdType:'DL017', + qxbdType:'DL014', filledCodes:['bdmc','bdbh'], }, bltj: { @@ -187,21 +188,21 @@ export default { width: 180, bodyType: "select", bodyFillType: "actFill", - options: this.getDictOptions('business_dl_sjqszqk'), + bodyOptions: this.getDictOptions('business_dl_sjqszqk'), },{ label: "template.dl.dl017.sjqcdqk", prop: "sjqcdqk", width: 180, bodyType: "select", bodyFillType: "actFill", - options: this.getDictOptions('business_dl_sjqcdqk'), + bodyOptions: this.getDictOptions('business_dl_sjqcdqk'), },{ label: "template.dl.dl017.saqqtqk", prop: "saqqtqk", width: 180, bodyType: "select", bodyFillType: "actFill", - options: this.getDictOptions('business_dl_sjqqtqk'), + bodyOptions: this.getDictOptions('business_dl_sjqqtqk'), },{ label: "template.dl.dl017.ddpyy", prop: "ddpyy", @@ -209,7 +210,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.xd", prop: "xd", @@ -217,7 +217,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.sj", prop: "sj", @@ -225,7 +224,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.ds", prop: "ds", @@ -233,7 +231,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.dy1gd", prop: "dy1gd", @@ -241,7 +238,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.dy2gd", prop: "dy2gd", @@ -249,7 +245,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.dy3gd", prop: "dy3gd", @@ -257,7 +252,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, },{ label: "template.dl.dl017.dy4gd", prop: "dy4gd", @@ -265,7 +259,6 @@ export default { bodyType: "checkbox", bodyFillType: "actFill", bodyMaxlength: 10, - bodyDisabled: true, }, ] }, @@ -281,13 +274,47 @@ export default { onRegentSubmit(e) { const { selectInfo, key, rowIndex } = e const { row } = selectInfo - console.log('selectInfo==============',selectInfo) - if (key === 'yqbh') { - const params = { - jlzb: row.mc, - xybh: row.xh, + if (key === 'qxbd') { + try { + // 解析前序表单的内容 + const bdnr = JSON.parse(row.bdnr) + console.log('前序表单内容============', bdnr) + // 获取剂量组列表数据 + const stepTableFormData = bdnr.jlzTableData || [] + + if (stepTableFormData.length === 0) { + // 清空当前的细胞操作情况列表数据 + this.$set(this.formData, 'stepTableFormData', []) + this.$message.warning('前序表单中没有剂量组数据') + return + } + + // 从剂量组数据中提取剂量组别和悬液编号 + const itemData = stepTableFormData.map(item => ({ + jlzb: item.jlzb || '', + xybh: item.xybh || '', + sjqszqk: '', + sjqcdqk: '', + saqqtqk: '', + ddpyy: '', + xd: '', + sj: '', + ds: '', + dy1gd: '', + dy2gd: '', + dy3gd: '', + dy4gd: '' + })) + + // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 + this.$set(this.formData, 'stepTableFormData', itemData) + + this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`) + } catch (error) { + this.$set(this.formData, 'stepTableFormData', []) + console.error('解析前序表单数据失败:', error) + this.$message.error('解析前序表单数据失败') } - this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } }, //选择table header下拉框也要更新体积 @@ -329,31 +356,7 @@ export default { } this.configCompleteRequest(postData); }, - //分装回调 - subPackageSubmit(data) { - 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, - studyFormId:this.formData.id, - list: list - } - this.subPackageRequest(postData); - } - }, + //获取已填写的表单数据 getFilledFormData() { return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"]) @@ -366,8 +369,20 @@ export default { getResource() { //使用的试剂、仪器 const stepResource = this.$refs.stepRef.getStepResource() + const hyqkData = this.$refs.stepTableRef?.getFilledFormData() + const tableList = hyqkData?.stepTableFormData || [] + // 从操作步骤中提取试剂和仪器资源 this.resourceTmp = stepResource.sjResource || [] this.yqResourceTmp = stepResource.yqResource || [] + + const sjResourceFromHyqk = tableList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) + + this.resourceTmp = [...this.resourceTmp, ...sjResourceFromHyqk] return this.resourceTmp; }, //保存 diff --git a/src/views/business/comps/template/comps/dl/DL018.vue b/src/views/business/comps/template/comps/dl/DL018.vue index 4a245a3..fd828e8 100644 --- a/src/views/business/comps/template/comps/dl/DL018.vue +++ b/src/views/business/comps/template/comps/dl/DL018.vue @@ -12,16 +12,16 @@ + ref="stepTableRef" :columns="stepColumns" :formData="tableFormData">