山东大学项目实训开发日志——基于vue+springboot的医院耗材管理系统(14)
发布时间
阅读量:
阅读量
我们解决了一个逻辑上的问题:
1.医院向供货商下单,如果供货商一时不能提供足够的数量,应该怎么办。
临床科室应向上级机构提交请求。若上级机构资源不足,则需采取相应措施。
在深入探讨后,在第一个议题上而后端负责人提出建议称应具备一个功能:即支持供应商按批次发货,并规定每一批次运输完成后需更新库存记录以反映剩余库存数量相应减少(具体数值等于原有需求总量减去已完成运送的数量)。然而我方认为此建议存在不合理之处认为不应随意更改订单信息(因为既然已经声明可作调整那么就可能有订货被取消转移或被部分满足的情况出现从而可能导致信任危机)。最终我们采纳了一项折中方案即支持供应商按批次发货并实时更新库存状态直至全部完成交货
就第二个问题而言,在此情况下科室库不应能提交超过现有库存数量的申请。即当科室库提出申请时系统会进行核对若超出库存则会触发并显示"库存不足"提示信息。
供货商页面显示的操作按钮代码:
查看 配货 编辑 删除 撤销 关闭
点击“配货”按钮后执行的方法:
handlePlaceOrder(index, row) {
this.$router.push({
path: '/oms/preInBillAdd',
query: {orderNo: row.orderNo, supplierShortName: row.supplierShortName, createBy: row.createBy}
})
},
然后是这种方法调用后会触发的一系列其他方法,在基于我们的代码架构设计下,在这些过程中还涉及许多其他功能模块,在这些情况下我们暂时不做详细展开。这里仅实现了一个核心配货算法
submitOrder(submitType) {
this.$refs.form.validate(valid => {
if (valid) {
this.loadingbut = true;
const arr = [];
this.model.tableData.forEach(item => {
const obj = {
code: item.code,
quantity: item.quantity,
price: item.price,
batchNo: item.batchNo,
expireDate: item.expireDate,
supplierId: item.supplierId,
factory: item.factory,
supplierShortName: item.supplierShortName
}
arr.push(obj);
})
const isRepeat = this.getNewList(arr);
let flag = true;
this.orderInfo.forEach(item => {
isRepeat.forEach(item1 => {
if (item.reagentId === parseInt(item1.code, 10) && item1.quantity > item.unsendNum) {
flag = false;
}
})
})
//只有配货数量小于等于未发货数量时,才可以配货
if (flag) {
console.log('配货数量没问题!');
let sendData = {
billType: this.listQuery.billType,
billStatus: this.listQuery.billStatus,
preInBillMessList: arr,
remark: this.listQuery.remark,
billCreator: this.listQuery.billCreator,
orderNo: this.$route.query.orderNo
}
createPreInBillItem(sendData).then(response => {
if (response.data > 0) {
this.loadingbut = false;
this.$message({
message: '提交成功',
type: 'success',
duration: 1000
});
this.$router.push("/oms/preInBill");
}
}).catch(error => {
this.loadingbut = false;
})
} else {
console.log('配货数量超出!');
this.loadingbut = false;
this.$message({
message: '配货数量与订单不符!',
type: 'warning'
});
}
} else {
console.log('参数验证不合法!');
this.loadingbut = false;
this.$message({
message: '提交失败!',
type: 'warning'
});
return false
}
})
},
可见,在规定系统的配货规模上也存在硬性规定或标准。不难看出,在采用该系统之前必须确保逻辑上的严密性
全部评论 (0)
还没有任何评论哟~
