Browse Source

feat:[模板管理][update]

luojie
luojie 2 weeks ago
parent
commit
97c9b82466
4 changed files with 77 additions and 41 deletions
  1. +62
    -28
      src/components/Template/StepComponents/ry/zlfz.vue
  2. +13
    -12
      src/views/business/comps/template/comps/dl/DL020.vue
  3. +0
    -1
      src/views/business/comps/template/comps/dl/DL021.vue
  4. +2
    -0
      src/views/business/comps/template/dialog/SelectMixReagentDialog.vue

+ 62
- 28
src/components/Template/StepComponents/ry/zlfz.vue View File

@ -1,16 +1,14 @@
<!-- 质量分装 -->
<template>
<StepFormPackage :fieldItemLabel = "fieldItemLabel"
@onRegentSubmit = "onRegentSubmit"
ref="stepFormPackageRef" :prefixKey="stepIndex+'_'+'ry_zlfz'" @resetRecord="resetRecord" :form-config="formConfig"
@onSubPackageSubmit="onSubPackageSubmit"
:formData="formData" />
<StepFormPackage :fieldItemLabel="fieldItemLabel" @onRegentSubmit="onRegentSubmit" ref="stepFormPackageRef"
:prefixKey="stepIndex + '_' + 'ry_zlfz'" @resetRecord="resetRecord" :form-config="formConfig"
@onSubPackageSubmit="onSubPackageSubmit" :formData="formData" />
</template>
<script>
import StepFormPackage from '@/components/Template/StepFormPackage.vue';
import stepMixins from '@/components/Template/mixins/stepMixins.js';
import { compareVolume } from '@/utils/volumeTools.js';
export default {
mixins: [stepMixins],
components: {
@ -40,8 +38,8 @@ export default {
}
},
{
config:{
zlfz:{
config: {
zlfz: {
type: "zlfz",
}
}
@ -50,31 +48,67 @@ export default {
}
},
methods: {
onRegentSubmit(data){
console.log(data,"onRegentSubmit")
const {key,selectInfo} = data;
if(key === 'gsp'){//
this.$refs.stepFormPackageRef.updateZlfzData("zlfz",{mybh:selectInfo.selectedId});
onRegentSubmit(data) {
console.log(data, "onRegentSubmit")
const { key, selectInfo } = data;
if (key === 'gsp') {//
const { row = {} } = selectInfo;
const gspInfo = {//
max: row.kc,//
maxUnit: row.kcdw,//
}
this.$refs.stepFormPackageRef.updateFormData("gspInfo", gspInfo);
this.$refs.stepFormPackageRef.updateZlfzData("zlfz", { mybh: selectInfo.selectedId });
// this.formData[key] = data;
}
},
async onSubPackageSubmit(data){
const {key} = data;
if(key === 'zlfz'){
const formData = await this.$refs.stepFormPackageRef.getFormData();
if(formData){
const {zlfz} = formData;
const fzInfo = {
...zlfz.formData,
fzList:zlfz.fzList,
};
this.$refs.stepFormPackageRef.updateFormData("fzInfo",fzInfo);
this.$message.success("质量分装成功");
this.justUpdateFilledFormData();
}
async onSubPackageSubmit(data) {
const { key } = data;
if (key === 'zlfz') {
this.$refs.stepFormPackageRef.getFormData().then(res => {
console.log(res, "res")
if (res) {
const { zlfz } = res;
const gspInfo = res.gspInfo || this.formData.gspInfo || {};
const { max, maxUnit } = gspInfo;
const dw = zlfz.formData.dw;
const errMsg = "分装后小份容量之和大于母液容量,是否确认分装?"
const totalVolume = zlfz.fzList.reduce((acc, cur) => acc + Number(cur.actnum), 0);
const compareResult = compareVolume(totalVolume, dw, max, maxUnit);
const fzInfo = {
...zlfz.formData,
fzList: zlfz.fzList,
};
if (compareResult > 0 || !max) {//
this.$modal.confirm(errMsg, '提示', {
confirmButtonText: this.$t('form.saveConfirm'),
cancelButtonText: this.$t('form.cancel'),
type: 'warning'
}).then(() => {
this.submitEmit(fzInfo);
}).catch(() => {
//
});
return;
}
this.submitEmit(fzInfo);
}
}).catch(err => {
console.log(err, "err")
this.$message.error("请填写分装信息");
})
}
},
submitEmit(fzInfo) {
this.$refs.stepFormPackageRef.updateFormData("fzInfo", fzInfo);
this.$message.success("质量分装成功");
this.justUpdateFilledFormData();
}
}
}

+ 13
- 12
src/views/business/comps/template/comps/dl/DL020.vue View File

@ -2,21 +2,21 @@
<template>
<div>
<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="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resourceSj" />
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resourceSj" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" />
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.xbxx" label="template.dl.dl020.xbxx"
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData"
/>
ref="swypyjInfoRef" :formConfig="swypyjInfoFormConfig" :formData="formData" />
<LineLabel label="template.dl.dl020.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<LineLabel label="template.dl.dl020.czbz" />
<Step ref="stepRef" :formData="formData.stepData"></Step>
<BaseInfoFormPackage fieldItemLabel="template.dl.dl020.dlbz" label="template.dl.dl020.dlbz"
ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
@ -116,11 +116,11 @@ export default {
type: "cellItem",
config: {
qxbd: {
span:1,
span: 1,
label: 'template.dl.dl020.qxbd',
type: 'qxbd',
fillType: 'actFill',
filledCodes:['bdmc','bdbh'],
filledCodes: ['bdmc', 'bdbh'],
},
}
},
@ -129,16 +129,16 @@ export default {
},
data() {
return {
formData: {},
};
},
mounted() {
console.log(this.formData,"formData")
},
methods: {
//
async getFilledFormData() {
let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepRef", "remarkRef"]);
return content;
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepRef", "remarkRef"]);
},
//
async getFormData() {
@ -180,6 +180,7 @@ export default {
.print-btn {
margin-bottom: 20px;
}
.config-header-end {
display: flex;
justify-content: flex-end;

+ 0
- 1
src/views/business/comps/template/comps/dl/DL021.vue View File

@ -176,7 +176,6 @@ export default {
},
data() {
return {
formData: {},
};
},
mounted() {

+ 2
- 0
src/views/business/comps/template/dialog/SelectMixReagentDialog.vue View File

@ -187,6 +187,8 @@ export default {
sxrq: row.sxr,
ndz: (row.nd||"")+(row.nddw||""),
type: Number(this.selectType),
kc: row.kc,
kcdw: row.kcdw,
}
const {qxbdType,checkType} = this;
if(qxbdType){

Loading…
Cancel
Save