luojie 2 months ago
parent
commit
c30f81c790
2 changed files with 76 additions and 58 deletions
  1. +51
    -31
      src/views/business/comps/template/comps/sp/SP00456.vue
  2. +25
    -27
      src/views/business/study/comp/tbbd/Bj.vue

+ 51
- 31
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -2,7 +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.bdmc }}<img src="@/assets/images/detail-title.png" /></div>
<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="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
@ -15,8 +16,10 @@
:formConfig="storageFormConfig" :formData="formData" /> :formConfig="storageFormConfig" :formData="formData" />
<LineLabel label="template.common.operationSteps" /> <LineLabel label="template.common.operationSteps" />
<div v-if="fillType === 'preFill'" class="mt-20"> <div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle">{{ $t('template.common.xzpxpz') }}</el-button>
<el-button type="primary" @click="handleAddLadder">{{ $t('template.common.xzjtpz') }}</el-button>
<el-button type="primary" @click="handleAddParalle">{{ $t('template.common.xzpxpz')
}}</el-button>
<el-button type="primary" @click="handleAddLadder">{{ $t('template.common.xzjtpz')
}}</el-button>
</div> </div>
<!-- 阶梯配制区域 --> <!-- 阶梯配制区域 -->
@ -26,15 +29,17 @@
<div class="config-header"> <div class="config-header">
<div>{{ $t('template.common.jtpz') }}</div> <div>{{ $t('template.common.jtpz') }}</div>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" <el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteLadderConfig(ladderIndex)">{{ $t('template.common.deleteBtn') }}</el-button>
@click="deleteLadderConfig(ladderIndex)">{{ $t('template.common.deleteBtn')
}}</el-button>
</div> </div>
<BaseInfoFormPackage
@onRegentSubmit="(e) => onRegentSubmit('ladder', ladderIndex, e)"
<BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit('ladder', ladderIndex, e)"
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig" :ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig"
:formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')" :prefixKey="'ladder_' + ladderIndex" />
:formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')"
:prefixKey="'ladder_' + ladderIndex" />
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)"
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill'" :columns="ladderStepColumns"
:formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')">
:ref="`ladderStepTableRef_${ladderIndex}`" :showOperation="fillType === 'actFill'"
:columns="ladderStepColumns" :formData="ladderConfig"
:prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e, 'ladderConfigs', ladderIndex)" <TableOpertaion @printTag="(e) => printTag(e, 'ladderConfigs', ladderIndex)"
@startConfig="(val) => startConfig(val, 'ladderConfigs', ladderIndex)" @startConfig="(val) => startConfig(val, 'ladderConfigs', ladderIndex)"
@ -53,22 +58,27 @@
</div> </div>
<!-- 平行配制区域 --> <!-- 平行配制区域 -->
<div :label="$t('template.common.pxpz')" v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
<div :label="$t('template.common.pxpz')"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex"> :key="'paralle_' + paralleIndex">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header"> <div class="config-header">
<div>{{ $t('template.common.pxpz') }}</div> <div>{{ $t('template.common.pxpz') }}</div>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" <el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteParalleConfig(paralleIndex)">{{ $t('template.common.deleteBtn') }}</el-button>
@click="deleteParalleConfig(paralleIndex)">{{ $t('template.common.deleteBtn')
}}</el-button>
</div> </div>
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" <BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" :ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :fieldItemLabel="$t('template.common.pxpz')" />
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.common.pxpz')" />
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)" <CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill'" :columns="paralleStepColumns"
:ref="`paralleStepTableRef_${paralleIndex}`" :showOperation="fillType === 'actFill'"
:columns="paralleStepColumns"
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" @onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)"
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" :fieldItemLabel="$t('template.common.pxpz')">
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
:fieldItemLabel="$t('template.common.pxpz')">
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @printTag="(e) => printTag(e, 'paralleConfigs', paralleIndex)" <TableOpertaion @printTag="(e) => printTag(e, 'paralleConfigs', paralleIndex)"
@startConfig="(val) => startConfig(val, 'paralleConfigs', paralleIndex)" @startConfig="(val) => startConfig(val, 'paralleConfigs', paralleIndex)"
@ -181,7 +191,7 @@ export default {
} }
}, },
methods: { methods: {
// //
subPackageSubmit(data, configType, index) { subPackageSubmit(data, configType, index) {
const { fzsj, rowData, headerSelectFields } = data; const { fzsj, rowData, headerSelectFields } = data;
@ -202,6 +212,8 @@ export default {
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId, studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);
@ -213,6 +225,8 @@ export default {
let postData = { let postData = {
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode,
studySubjectId: this.formData.studySubjectId, studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
} }
this.startConfigRequest(postData); this.startConfigRequest(postData);
}, },
@ -227,6 +241,8 @@ export default {
nd: rowData.actSolutionConcentration,// nd: rowData.actSolutionConcentration,//
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId, studySubjectId: this.formData.studySubjectId,
studyId: this.formData.studyId,
studyFormId: this.formData.id,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
} }
@ -416,10 +432,10 @@ export default {
}, },
// table // table
onTableRegentSubmit(type, configIndex, data){
const { selectInfo,rowIndex,key,rowData } = data;
const { row,selectedId } = selectInfo;
if (key === "actStartSolutionCode") {//
onTableRegentSubmit(type, configIndex, data) {
const { selectInfo, rowIndex, key, rowData } = data;
const { row, selectedId } = selectInfo;
if (key === "actStartSolutionCode") {//
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0];
if (tableRef) { if (tableRef) {
const volResult = this.updateSjmbrynd(rowData, row.nd); const volResult = this.updateSjmbrynd(rowData, row.nd);
@ -435,10 +451,10 @@ export default {
} }
} }
}, },
// //
onRegentSubmit(type,rowIndex,data) {
const { selectInfo,key} = data;
onRegentSubmit(type, rowIndex, data) {
const { selectInfo, key } = data;
const { row } = selectInfo; const { row } = selectInfo;
if (key) { if (key) {
const ref = type === "ladder" ? "ladderStepFormPackageRef_" : "paralleStepFormPackageRef_" const ref = type === "ladder" ? "ladderStepFormPackageRef_" : "paralleStepFormPackageRef_"
@ -446,9 +462,9 @@ export default {
if (key === "subStartSolution") { if (key === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.nd); packageRef.updateFormData("targetAcSolution", row.nd);
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution"); packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution");
this.updateTableNd(row,rowIndex);
this.updateTableNd(row, rowIndex);
} }
}
}
}, },
updateRecord() { updateRecord() {
this.$nextTick(() => { this.$nextTick(() => {
@ -460,23 +476,23 @@ export default {
}) })
}, },
//table //table
updateTableNd(row,rowIndex) {
updateTableNd(row, rowIndex) {
const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData(); const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData();
const newData = JSON.parse(JSON.stringify(stepTableFormData)); const newData = JSON.parse(JSON.stringify(stepTableFormData));
// //
newData.forEach((item, index) => { newData.forEach((item, index) => {
let initNd = row.nd;// let initNd = row.nd;//
if(index ===0){
if (index === 0) {
item.startSolutionCode = row.bh; item.startSolutionCode = row.bh;
}else{
item.startSolutionCode = newData[index - 1].targetSolutionCode+ newData[index - 1].subTargetSolutionCode;
} else {
item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode;
initNd = newData[i - 1].actSolutionConcentration; initNd = newData[i - 1].actSolutionConcentration;
} }
const volResult = this.updateSjmbrynd(item, initNd); const volResult = this.updateSjmbrynd(item, initNd);
if (!volResult) { if (!volResult) {
return return
} }
item.actSolutionVolume = volResult.actVol; item.actSolutionVolume = volResult.actVol;
item.actSolutionConcentration = volResult.actNd; item.actSolutionConcentration = volResult.actNd;
// stepTableRef // stepTableRef
@ -562,10 +578,14 @@ export default {
return false; return false;
} }
let content = this.getFilledFormData(); let content = this.getFilledFormData();
return content;
},
getResource() {
let content = this.getFilledFormData();
//resource //resource
debugger
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
debugger
// //
if (content.ladderConfigs && content.ladderConfigs.length > 0) { if (content.ladderConfigs && content.ladderConfigs.length > 0) {
for (let i = 0; i < content.ladderConfigs.length; i++) { for (let i = 0; i < content.ladderConfigs.length; i++) {
@ -744,7 +764,7 @@ export default {
this.yqResourceTmp = stepResource.yqResource || [] this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource this.resourceTmp = tmpResource
return content;
return this.resourceTmp;
}, },
getStepResource() { getStepResource() {
const sjResource = [], yqResource = []; const sjResource = [], yqResource = [];

+ 25
- 27
src/views/business/study/comp/tbbd/Bj.vue View File

@ -645,32 +645,30 @@ export default {
}, },
async showYjcc() { async showYjcc() {
let that = this let that = this
let content = await that.$refs.templateTable.getFormData()
if (content) {
that.resetYjcc()
that.formYjcc.id = that.form.id
that.cclistYj = []
that.addCcYj()
let resource = that.$refs.templateTable.getResource()
let tmp = _.filter(resource, function (o) {
return o.type == null || o.type == 3 || o.type == 5 || o.type == 7
that.resetYjcc()
that.formYjcc.id = that.form.id
that.cclistYj = []
that.addCcYj()
that.$refs.templateTable.getFilledFormData()
let resource = that.$refs.templateTable.getResource()
let tmp = _.filter(resource, function (o) {
return o.type == null || o.type == 3 || o.type == 5 || o.type == 7
})
if (tmp.length > 0) {
that.$modal.loading()
studyFormFill_yjccFilter({ id: this.form.id, resource: JSON.stringify(tmp) }).then(response => {
let tmpResource = JSON.parse(response.msg)
if (tmpResource.length > 0) {
that.resourceYj = tmpResource
that.openYjcc = true
} else {
that.$modal.msgError("没有可存储的药剂")
}
}).finally(() => {
that.$modal.closeLoading()
}) })
if (tmp.length > 0) {
that.$modal.loading()
studyFormFill_yjccFilter({ id: this.form.id, resource: JSON.stringify(tmp) }).then(response => {
let tmpResource = JSON.parse(response.msg)
if (tmpResource.length > 0) {
that.resourceYj = tmpResource
that.openYjcc = true
} else {
that.$modal.msgError("没有可存储的药剂")
}
}).finally(() => {
that.$modal.closeLoading()
})
} else {
that.$modal.msgError("没有可存储的药剂")
}
} else {
that.$modal.msgError("没有可存储的药剂")
} }
}, },
resetYjcc() { resetYjcc() {
@ -818,8 +816,8 @@ export default {
this.$modal.msgError("请选择要处置的药剂") this.$modal.msgError("请选择要处置的药剂")
} else { } else {
for (var i = 0; i < that.cclistYj.length; i++) { for (var i = 0; i < that.cclistYj.length; i++) {
if (!that.cclistYj[i].ccwz||that.cclistYj[i].ccwz=='') {
this.$modal.msgError('第'+(i+1) + "个存储,存储位置不能为空")
if (!that.cclistYj[i].ccwz || that.cclistYj[i].ccwz == '') {
this.$modal.msgError('第' + (i + 1) + "个存储,存储位置不能为空")
return return
} }
if (!that.cclistYj[i].cctj || that.cclistYj[i].cctj == '') { if (!that.cclistYj[i].cctj || that.cclistYj[i].cctj == '') {

Loading…
Cancel
Save