|
|
|
@ -15,7 +15,7 @@ |
|
|
|
<!-- 操作记录 --> |
|
|
|
<div class="template-form-item"> |
|
|
|
<BaseInfoFormPackage ref="swypyjInfoRef" fieldItemLabel="template.common.operationSteps" |
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" |
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" @onRegentSubmit="onRegentSubmit" |
|
|
|
:formData="formData" /> |
|
|
|
<CustomTable |
|
|
|
:ref="`tableRef`" |
|
|
|
@ -56,7 +56,7 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion |
|
|
|
export default { |
|
|
|
name: "dl024", |
|
|
|
dicts: [ |
|
|
|
'business_dl_xbmc' |
|
|
|
'business_dl_xbmc','business_sydd' |
|
|
|
], |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete }, |
|
|
|
mixins: [templateMixin], |
|
|
|
@ -67,6 +67,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 表格数据 |
|
|
|
tableFormData() { |
|
|
|
return { |
|
|
|
stepTableFormData: this.formData.stepTableFormData || [], |
|
|
|
headerSelectFields: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 备注表单配置 |
|
|
|
remarkConig() { |
|
|
|
return [ |
|
|
|
@ -145,6 +152,7 @@ export default { |
|
|
|
label: 'template.dl.dl024.qxbd', |
|
|
|
type: 'qxbd', |
|
|
|
fillType: 'actFill', |
|
|
|
qxbdType:'DL003', |
|
|
|
filledCodes:['bdmc','bdbh'], |
|
|
|
}, |
|
|
|
pykssj:{ |
|
|
|
@ -152,7 +160,7 @@ export default { |
|
|
|
type: 'input', |
|
|
|
fillType: 'actFill', |
|
|
|
subType: 'button', |
|
|
|
subKey: 'pyjssj', |
|
|
|
subKey: 'pykssj', |
|
|
|
buttonName: 'template.dl.dl024.jsButton', |
|
|
|
}, |
|
|
|
pyjssj: { |
|
|
|
@ -188,87 +196,49 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 选择仪器编号预留 |
|
|
|
// 选择前置表单预留 |
|
|
|
onRegentSubmit(e) { |
|
|
|
const { selectInfo, key, rowIndex } = e |
|
|
|
const { row } = selectInfo |
|
|
|
console.log('选择仪器编号预留===',row) |
|
|
|
// if (key === 'yqbh' && this.$refs.yqsyTableRef) { |
|
|
|
try { |
|
|
|
// 解析前序表单的内容 |
|
|
|
const bdnr = JSON.parse(row.bdnr) |
|
|
|
// 获取剂量组列表数据 |
|
|
|
const stepTableFormData = bdnr.jlzTableData || [] |
|
|
|
|
|
|
|
if (stepTableFormData.length === 0) { |
|
|
|
// 清空当前的换液情况列表数据 |
|
|
|
this.$set(this.formData, 'stepTableFormData', []) |
|
|
|
this.$message.warning('前序表单中没有细胞编号数据') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 从剂量组数据中提取细胞编号 |
|
|
|
const itemData = stepTableFormData.map(item => ({ |
|
|
|
xbbh: item.jlzb || '', // 细胞编号 |
|
|
|
})) |
|
|
|
// 使用 $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('解析前序表单数据失败') |
|
|
|
} |
|
|
|
// if (key === 'qxbd' && this.$refs.tableRef) { |
|
|
|
// const params = { |
|
|
|
// yqmc: row.mc, |
|
|
|
// yqmc: row.xbbh, |
|
|
|
// yqxh: row.xh, |
|
|
|
// xccsjzjdrq: row.jzrq |
|
|
|
// } |
|
|
|
// this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) |
|
|
|
// this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params) |
|
|
|
// } |
|
|
|
}, |
|
|
|
onFormSelect(fields){ |
|
|
|
this.onHandleBlur(fields) |
|
|
|
}, |
|
|
|
//选择table header下拉框也要更新体积 |
|
|
|
onHeaderSelectChange(data){ |
|
|
|
const {key, headerSelectFields,dataSource=[]} = data; |
|
|
|
const keys = [ |
|
|
|
'targetStartSolutionVolumeUnit', |
|
|
|
'targetDiluentVolumeUnit', |
|
|
|
'targetSolutionConcentrationUnit', |
|
|
|
'targetSolutionVolumeUnit', |
|
|
|
] |
|
|
|
if(keys.includes(key)){ |
|
|
|
const {targetStartSolution,subTargetStartSolution} = this.$refs.swypyjInfoRef?.getFilledFormData(); |
|
|
|
const params = { |
|
|
|
subTargetStartSolution, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params) |
|
|
|
} |
|
|
|
}, |
|
|
|
beforeSaveRecord(data){ |
|
|
|
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","remarkRef","tableRef"]) |
|
|
|
@ -280,9 +250,18 @@ export default { |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
//使用的试剂、仪器 |
|
|
|
// stepRef不存在,直接返回空数组 |
|
|
|
this.resourceTmp = [] |
|
|
|
this.yqResourceTmp = [] |
|
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
|
const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || [] |
|
|
|
// 从操作步骤中提取试剂和仪器资源 |
|
|
|
this.resourceTmp = stepResource.sjResource || [] |
|
|
|
const tableFromHyqk = tableList |
|
|
|
.filter(item => item.xybh) |
|
|
|
.map(item => ({ |
|
|
|
bh: item.xybh, |
|
|
|
type: 'cell' |
|
|
|
})) |
|
|
|
|
|
|
|
this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk] |
|
|
|
return this.resourceTmp; |
|
|
|
}, |
|
|
|
//保存 |
|
|
|
|