|
|
|
@ -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'), |
|
|
|
|