|
|
@ -2,8 +2,8 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="detail-container"> |
|
|
<div class="detail-container"> |
|
|
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{formData.templateMc || "生物样品标曲工作液制备表"}}<img |
|
|
|
|
|
src="@/assets/images/detail-title.png" /></div> |
|
|
|
|
|
|
|
|
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc || |
|
|
|
|
|
"生物样品标曲工作液制备表" }}<img src="@/assets/images/detail-title.png" /></div> |
|
|
<div class="detail-content"> |
|
|
<div class="detail-content"> |
|
|
<div class="content"> |
|
|
<div class="content"> |
|
|
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig" |
|
|
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig" |
|
|
@ -14,12 +14,14 @@ |
|
|
:formData="formData" /> |
|
|
:formData="formData" /> |
|
|
<LineLabel label="操作步骤" /> |
|
|
<LineLabel label="操作步骤" /> |
|
|
<div class="template-form-item"> |
|
|
<div class="template-form-item"> |
|
|
<BaseInfoFormPcakge @clickable="handleClickable" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur" |
|
|
|
|
|
:formData="formData" /> |
|
|
|
|
|
<CustomTable fieldItemLabel = "操作步骤" @blur="onHandleTableBlur" :showAddRow="false" :showOperation="fillType==='actFill'" ref="stepTableRef" :columns="stepColumns" |
|
|
|
|
|
:formData="formData" > |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex}"> |
|
|
|
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" @deleteRow="deleteRow"></TableOpertaion> |
|
|
|
|
|
|
|
|
<BaseInfoFormPcakge @clickable="handleClickable" ref="stepFormPackageRef" |
|
|
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> |
|
|
|
|
|
<CustomTable fieldItemLabel="操作步骤" @blur="onHandleTableBlur" :showAddRow="false" |
|
|
|
|
|
:showOperation="fillType === 'actFill'" ref="stepTableRef" :columns="stepColumns" |
|
|
|
|
|
:formData="formData"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="deleteRow"></TableOpertaion> |
|
|
</template> |
|
|
</template> |
|
|
</CustomTable> |
|
|
</CustomTable> |
|
|
</div> |
|
|
</div> |
|
|
@ -30,9 +32,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
</div> |
|
|
</div> |
|
|
<SelectReagentDialog |
|
|
|
|
|
@submit="onSelectReagentSubmit" |
|
|
|
|
|
ref="selectReagentDialogRef" > |
|
|
|
|
|
|
|
|
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef"> |
|
|
</SelectReagentDialog> |
|
|
</SelectReagentDialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
@ -46,11 +46,11 @@ import templateMixin from "../../mixins/templateMixin"; |
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
import {EventBus} from "@/utils/eventBus"; |
|
|
|
|
|
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: "SWYPBQGZYZBB", |
|
|
name: "SWYPBQGZYZBB", |
|
|
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, |
|
|
|
|
|
|
|
|
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, |
|
|
mixins: [templateMixin], |
|
|
mixins: [templateMixin], |
|
|
props: { |
|
|
props: { |
|
|
fillType: { |
|
|
fillType: { |
|
|
@ -62,7 +62,7 @@ export default { |
|
|
fillType: { |
|
|
fillType: { |
|
|
immediate: true, |
|
|
immediate: true, |
|
|
handler(v) { |
|
|
handler(v) { |
|
|
if(v &&this.fillType === "actFill"){ |
|
|
|
|
|
|
|
|
if (v && this.fillType === "actFill") { |
|
|
this.handleUpdateCode(); |
|
|
this.handleUpdateCode(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -132,7 +132,7 @@ export default { |
|
|
label: "版本号", |
|
|
label: "版本号", |
|
|
type: "inputNumber", |
|
|
type: "inputNumber", |
|
|
fillType: "actFill", |
|
|
fillType: "actFill", |
|
|
prepend:"V", |
|
|
|
|
|
|
|
|
prepend: "V", |
|
|
maxlength: 50, |
|
|
maxlength: 50, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -268,10 +268,11 @@ export default { |
|
|
bodySubType: "span", |
|
|
bodySubType: "span", |
|
|
bodySubKey: "subTargetSolutionCode", |
|
|
bodySubKey: "subTargetSolutionCode", |
|
|
bodyFillType: "preFill", |
|
|
bodyFillType: "preFill", |
|
|
width: 280 |
|
|
|
|
|
|
|
|
width: 280, |
|
|
|
|
|
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"], |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "起始溶液编号", |
|
|
|
|
|
|
|
|
label: "起始溶液编号", |
|
|
prop: "startSolutionCode", |
|
|
prop: "startSolutionCode", |
|
|
width: 280, |
|
|
width: 280, |
|
|
bodyType: "input", |
|
|
bodyType: "input", |
|
|
@ -279,7 +280,7 @@ export default { |
|
|
bodyMaxlength: 10, |
|
|
bodyMaxlength: 10, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "预设起始溶液体积", |
|
|
|
|
|
|
|
|
label: "预设起始溶液体积", |
|
|
prop: "targetStartSolutionVolume", |
|
|
prop: "targetStartSolutionVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "targetStartSolutionVolumeUnit", |
|
|
headerSelectKey: "targetStartSolutionVolumeUnit", |
|
|
@ -297,7 +298,7 @@ export default { |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "实际起始溶液体积", |
|
|
|
|
|
|
|
|
label: "实际起始溶液体积", |
|
|
prop: "actStartSolutionVolume", |
|
|
prop: "actStartSolutionVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "actStartSolutionVolumeUnit", |
|
|
headerSelectKey: "actStartSolutionVolumeUnit", |
|
|
@ -310,7 +311,7 @@ export default { |
|
|
copyFrom: "targetStartSolutionVolume",//复制哪个字段 |
|
|
copyFrom: "targetStartSolutionVolume",//复制哪个字段 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "预设稀释液体积", |
|
|
|
|
|
|
|
|
label: "预设稀释液体积", |
|
|
prop: "targetDiluentVolume", |
|
|
prop: "targetDiluentVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "targetDiluentVolumeUnit", |
|
|
headerSelectKey: "targetDiluentVolumeUnit", |
|
|
@ -328,7 +329,7 @@ export default { |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "实际稀释液体积", |
|
|
|
|
|
|
|
|
label: "实际稀释液体积", |
|
|
prop: "actDiluentVolume", |
|
|
prop: "actDiluentVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "actDiluentVolumeUnit", |
|
|
headerSelectKey: "actDiluentVolumeUnit", |
|
|
@ -341,7 +342,7 @@ export default { |
|
|
copyFrom: "targetDiluentVolume",//复制哪个字段 |
|
|
copyFrom: "targetDiluentVolume",//复制哪个字段 |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "预设目标溶液浓度", |
|
|
|
|
|
|
|
|
label: "预设目标溶液浓度", |
|
|
prop: "targetSolutionConcentration", |
|
|
prop: "targetSolutionConcentration", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "targetSolutionConcentrationUnit", |
|
|
headerSelectKey: "targetSolutionConcentrationUnit", |
|
|
@ -352,7 +353,7 @@ export default { |
|
|
bodyMaxlength: 10, |
|
|
bodyMaxlength: 10, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "实际目标溶液浓度", |
|
|
|
|
|
|
|
|
label: "实际目标溶液浓度", |
|
|
prop: "actSolutionConcentration", |
|
|
prop: "actSolutionConcentration", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "actSolutionConcentrationUnit", |
|
|
headerSelectKey: "actSolutionConcentrationUnit", |
|
|
@ -369,8 +370,8 @@ export default { |
|
|
bodyMaxlength: 10, |
|
|
bodyMaxlength: 10, |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
bodySubPlaceholder: "请输入保留小数位数", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
|
|
|
label: "预设目标溶液体积", |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
label: "预设目标溶液体积", |
|
|
prop: "targetSolutionVolume", |
|
|
prop: "targetSolutionVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "targetSolutionVolumeUnit", |
|
|
headerSelectKey: "targetSolutionVolumeUnit", |
|
|
@ -381,7 +382,7 @@ export default { |
|
|
bodyMaxlength: 10, |
|
|
bodyMaxlength: 10, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: "实际目标溶液体积", |
|
|
|
|
|
|
|
|
label: "实际目标溶液体积", |
|
|
prop: "actSolutionVolume", |
|
|
prop: "actSolutionVolume", |
|
|
width: 280, |
|
|
width: 280, |
|
|
headerSelectKey: "actSolutionVolumeUnit", |
|
|
headerSelectKey: "actSolutionVolumeUnit", |
|
|
@ -413,46 +414,46 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
//更新代码 |
|
|
//更新代码 |
|
|
async handleUpdateCode() { |
|
|
async handleUpdateCode() { |
|
|
const {stepTableFormData = []} = this.formData; |
|
|
|
|
|
if(stepTableFormData.length === 0){ |
|
|
|
|
|
|
|
|
const { stepTableFormData = [] } = this.formData; |
|
|
|
|
|
if (stepTableFormData.length === 0) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const hasAnyWithValue = stepTableFormData.some(row => |
|
|
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
|
|
if(hasAnyWithValue){ |
|
|
|
|
|
|
|
|
const hasAnyWithValue = stepTableFormData.some(row => |
|
|
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
|
|
if (hasAnyWithValue) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const snList = await this.getLatestSn(stepTableFormData.length); |
|
|
const snList = await this.getLatestSn(stepTableFormData.length); |
|
|
stepTableFormData.forEach((item,index) => { |
|
|
|
|
|
this.$refs.stepTableRef.updateDataSourceByRowIndex(index,{subTargetSolutionCode: stepTableFormData.length==1?snList:snList[index]}); |
|
|
|
|
|
|
|
|
stepTableFormData.forEach((item, index) => { |
|
|
|
|
|
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: stepTableFormData.length == 1 ? snList : snList[index] }); |
|
|
}) |
|
|
}) |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
//通知后端保存数据 |
|
|
//通知后端保存数据 |
|
|
const params = { |
|
|
const params = { |
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
} |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//获取已填写的表单数据 |
|
|
//获取已填写的表单数据 |
|
|
getFilledFormData(){ |
|
|
|
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef","stepTableRef"]) |
|
|
|
|
|
|
|
|
getFilledFormData() { |
|
|
|
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"]) |
|
|
}, |
|
|
}, |
|
|
handleClickable(item) { |
|
|
handleClickable(item) { |
|
|
if(this.fillType === "preFill"){ |
|
|
|
|
|
|
|
|
if (this.fillType === "preFill") { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const {subKey = ""} = item; |
|
|
|
|
|
if(subKey === "subStartSolution" || subKey === "subSolution"){//起始源溶液点击事件 |
|
|
|
|
|
|
|
|
const { subKey = "" } = item; |
|
|
|
|
|
if (subKey === "subStartSolution" || subKey === "subSolution") {//起始源溶液点击事件 |
|
|
this.$refs.selectReagentDialogRef.show() |
|
|
this.$refs.selectReagentDialogRef.show() |
|
|
this.currentSubKey = subKey; |
|
|
this.currentSubKey = subKey; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
//选择试剂提交事件 |
|
|
//选择试剂提交事件 |
|
|
onSelectReagentSubmit(code,row){ |
|
|
|
|
|
if(this.currentSubKey === "subStartSolution"){//起始源溶液点击事件 |
|
|
|
|
|
|
|
|
onSelectReagentSubmit(code, row) { |
|
|
|
|
|
if (this.currentSubKey === "subStartSolution") {//起始源溶液点击事件 |
|
|
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd); |
|
|
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd); |
|
|
this.updateStepTableData(row); |
|
|
this.updateStepTableData(row); |
|
|
} |
|
|
} |
|
|
@ -460,12 +461,12 @@ export default { |
|
|
this.$refs.selectReagentDialogRef.onCancel() |
|
|
this.$refs.selectReagentDialogRef.onCancel() |
|
|
}, |
|
|
}, |
|
|
//更新table数据 |
|
|
//更新table数据 |
|
|
updateStepTableData(row){ |
|
|
|
|
|
const {stepTableFormData = []} = this.formData; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateStepTableData(row) { |
|
|
|
|
|
const { stepTableFormData = [] } = this.formData; |
|
|
|
|
|
|
|
|
// 创建新的表格数据副本 |
|
|
// 创建新的表格数据副本 |
|
|
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
for (let i = 0; i < newStepTableData.length; i++) { |
|
|
for (let i = 0; i < newStepTableData.length; i++) { |
|
|
if (i === 0) { |
|
|
if (i === 0) { |
|
|
@ -477,16 +478,16 @@ export default { |
|
|
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode; |
|
|
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新stepTableRef组件的数据 |
|
|
// 更新stepTableRef组件的数据 |
|
|
this.$refs.stepTableRef.updateDataSource(newStepTableData); |
|
|
this.$refs.stepTableRef.updateDataSource(newStepTableData); |
|
|
}, |
|
|
}, |
|
|
async getFormData() { |
|
|
async getFormData() { |
|
|
return await this.validFormFields(["baseInfoRef", "storageConditionRef","stepFormPackageRef","stepTableRef","stepRef","remarkRef"]); |
|
|
|
|
|
|
|
|
return await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); |
|
|
}, |
|
|
}, |
|
|
async onSave() { |
|
|
async onSave() { |
|
|
// const formData = await this.getFormData(); |
|
|
// const formData = await this.getFormData(); |
|
|
const formData = await this.validFormFields(["baseInfoRef", "storageConditionRef","stepFormPackageRef","stepTableRef","stepRef","remarkRef"]); |
|
|
|
|
|
|
|
|
const formData = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); |
|
|
|
|
|
|
|
|
console.log(formData, "formData") |
|
|
console.log(formData, "formData") |
|
|
} |
|
|
} |
|
|
|