diff --git a/src/components/Template/StepComponents/ry/zlfz.vue b/src/components/Template/StepComponents/ry/zlfz.vue index ff5a65b..939b2bc 100644 --- a/src/components/Template/StepComponents/ry/zlfz.vue +++ b/src/components/Template/StepComponents/ry/zlfz.vue @@ -51,38 +51,29 @@ export default { 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; - + this.$nextTick(() => { + this.$refs.stepFormPackageRef.updateZlfzData("zlfz", { mybh: selectInfo.selectedId }); + }) } }, 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 gspInfo = res.selectInfo_gsp || {}; + const { kc, kcdw } = 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 compareResult = compareVolume(totalVolume, dw, kc, kcdw); const fzInfo = { ...zlfz.formData, fzList: zlfz.fzList, }; - if (compareResult > 0 || !max) {//没有填写实际溶液体积的也需要提示错误信息 + if (compareResult > 0 || !kc) {//没有填写实际溶液体积的也需要提示错误信息 this.$modal.confirm(errMsg, '提示', { confirmButtonText: this.$t('form.saveConfirm'), cancelButtonText: this.$t('form.cancel'), diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 364a4ee..5d7367a 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -378,7 +378,7 @@ export default { key.startsWith('selectInfo_') ) selectInfoKeys.forEach((key) => { - result[key] = formData[key] + result[key] = this.formFields[key] || formData[key] || '' }) // 更新表单字段 this.formFields = { ...result } @@ -594,6 +594,7 @@ export default { return new Promise((resolve, reject) => { if (validateResult.valid && subComponentValidateResult.valid) { + console.log(this.formFields, 'this.formFields') resolve(this.formFields) } else if (!validateResult.valid) { // this.$message.error("表单内容未填完,请填写后再提交");