|
|
|
@ -9,6 +9,9 @@ |
|
|
|
import StepFormPackage from '@/components/Template/StepFormPackage.vue'; |
|
|
|
import stepMixins from '@/components/Template/mixins/stepMixins.js'; |
|
|
|
import { compareVolume } from '@/utils/volumeTools.js'; |
|
|
|
import { |
|
|
|
sj_subpackage, |
|
|
|
} from '@/api/business/sj/sj' |
|
|
|
export default { |
|
|
|
mixins: [stepMixins], |
|
|
|
components: { |
|
|
|
@ -64,13 +67,16 @@ export default { |
|
|
|
if (res) { |
|
|
|
const { zlfz } = res; |
|
|
|
const gspInfo = res.selectInfo_gsp || {}; |
|
|
|
const { kc, kcdw } = gspInfo; |
|
|
|
const { kc, kcdw, gg, ggdw, bh } = 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, kc, kcdw); |
|
|
|
const fzInfo = { |
|
|
|
...zlfz.formData, |
|
|
|
gg, |
|
|
|
ggdw, |
|
|
|
bh, |
|
|
|
fzList: zlfz.fzList, |
|
|
|
}; |
|
|
|
if (compareResult > 0 || !kc) {//没有填写实际溶液体积的也需要提示错误信息 |
|
|
|
@ -96,10 +102,39 @@ export default { |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
submitEmit(fzInfo) { |
|
|
|
async submitEmit(fzInfo) { |
|
|
|
this.$refs.stepFormPackageRef.updateFormData("fzInfo", fzInfo); |
|
|
|
this.$message.success("质量分装成功"); |
|
|
|
this.justUpdateFilledFormData(); |
|
|
|
const { dw,bh, gg, ggdw, fzList = [] } = fzInfo; |
|
|
|
if(!fzList.length){ |
|
|
|
this.$message.error("请填写分装信息"); |
|
|
|
return; |
|
|
|
} |
|
|
|
const list = fzList.map((item) => { |
|
|
|
return { |
|
|
|
bh: item.preCode, |
|
|
|
kc: item.actnum, |
|
|
|
kcdw: dw, |
|
|
|
} |
|
|
|
}) |
|
|
|
let postData = { |
|
|
|
studyId: this.templateData.studyId, |
|
|
|
studyFormId: this.templateData.id, |
|
|
|
bh, |
|
|
|
gg, |
|
|
|
ggdw, |
|
|
|
studySubjectId: this.templateData.studySubjectId, |
|
|
|
studyId: this.templateData.studyId, |
|
|
|
studyFormId: this.templateData.id, |
|
|
|
list: list |
|
|
|
} |
|
|
|
const res = await sj_subpackage(postData) |
|
|
|
if (res.code === 200) { |
|
|
|
this.$message.success('分装成功') |
|
|
|
this.justUpdateFilledFormData(); |
|
|
|
} else { |
|
|
|
this.$message.error('分装失败') |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|