Browse Source

feat:[模板管理]sp003生成物资

lkf
15881625488@163.com 2 months ago
parent
commit
810cccd3d3
1 changed files with 67 additions and 36 deletions
  1. +67
    -36
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue

+ 67
- 36
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -2,7 +2,7 @@
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc ||
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
"生物样品标曲工作液制备表" }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
@ -15,14 +15,16 @@
<LineLabel label="操作步骤" />
<div class="template-form-item">
<BaseInfoFormPackage @clickable="handleClickable" ref="stepFormPackageRef"
@resetRecord="resetRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" />
@resetRecord="resetRecord" :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 @startConfig="startConfig" @configComplete="configComplete" @printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType" :row="row"
:rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow"></TableOpertaion>
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
:row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteRow">
</TableOpertaion>
</template>
</CustomTable>
</div>
@ -417,25 +419,25 @@ export default {
mounted() {
},
methods: {
resetRecord(){
resetRecord() {
this.$refs.stepTableRef.resetRecord();
},
startConfig(val){
startConfig(val) {
const { rowData } = val;
let postData = {
bh:rowData.targetSolutionCode+rowData.subTargetSolutionCode,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
}
this.startConfigRequest(postData);
},
configComplete(val){
const { rowData,headerSelectFields } = val;
configComplete(val) {
const { rowData, headerSelectFields } = val;
//(+)
const {total,unit} = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit])
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,
mc: null,
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit,
kc: total,
kcdw: unit,
}
@ -444,27 +446,27 @@ export default {
//
printTag(data) {
const printConfig = this.getBasePrintConfig(data);
EventBus.$emit('showTagPrintDialog', {printConfig})
EventBus.$emit('showTagPrintDialog', { printConfig })
},
//
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.subCode,
kc:item.num,
kcdw:dw,
const { fzsj, rowData, headerSelectFields } = data;
const { fzList = [], dw = "", mybh } = fzsj;
if (fzList && fzList.length > 0) {
const list = fzList.map((item) => {
return {
bh: mybh + 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,
list:list
studyId: this.formData.studyId,
studyFormId: this.formData.id,
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
list: list
}
this.subPackageRequest(postData);
}
@ -511,15 +513,15 @@ export default {
//
onSelectReagentSubmit(code, row) {
if (this.currentSubKey === "subStartSolution") {//
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd,["targetAcSolution"]);
this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd, ["targetAcSolution"]);
this.updateStepTableData(row);
}
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code,[this.currentSubKey]);
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code, [this.currentSubKey]);
this.$refs.selectReagentDialogRef.onCancel()
},
//table
updateStepTableData(row) {
const {stepTableFormData = []} = this.$refs.stepTableRef.getFilledFormData();
const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();
//
const newStepTableData = JSON.parse(JSON.stringify(stepTableFormData));
@ -535,7 +537,7 @@ export default {
// targetSolutionCode
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
}
const {actVol,actNd} = this.updateSjmbrynd(item, row.nd);
const { actVol, actNd } = this.updateSjmbrynd(item, row.nd);
item.actSolutionVolume = actVol;
item.actSolutionConcentration = actNd;
}
@ -544,11 +546,40 @@ export default {
this.$refs.stepTableRef.updateDataSource(newStepTableData);
},
async getFormData() {
return await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
//resource
let tmpResource = []
let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) {
//
let item = tableList[i]
tmpResource.push({
mc: null,
bh: item.targetSolutionCode + item.subTargetSolutionCode,
ph: null,
nd: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
source: 'ELN配制',
sxrq: content.expireDate,
ndz: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
kc: item.actStartSolutionVolume + item.actDiluentVolume,//todo -
kcdw: content.headerSelectFields.actStartSolutionVolumeUnit || content.headerSelectFields.actDiluentVolumeUnit,//todo --
syl: null,
syldw: content.headerSelectFields.actStartSolutionVolumeUnit || content.headerSelectFields.actDiluentVolumeUnit,//todo --,
yxzq: null,
yxzqdw: null,
})
}
}
//使
this.resource = tmpResource
return content;
},
async onSave() {
// const formData = await this.getFormData();
const formData = await this.validFormFields(["baseInfoRef","stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
const formData = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
console.log(formData, "formData")
}

Loading…
Cancel
Save