添加开发者发货功能

This commit is contained in:
Dev
2026-09-30 14:56:56 +08:00
parent f13a5e682a
commit bc17810445
14 changed files with 768 additions and 4 deletions
@@ -64,6 +64,36 @@ var canConfirmReceipt = function (demandInfo) {
demandInfo.accept_status == 2;
}
// 获取交付内容(订单发货表,后端 detail 接口挂载的 delivery 字段,未发货返回 null)
var getDelivery = function (demandInfo) {
if (!demandInfo) {
return null;
}
return demandInfo.delivery || null;
}
// 开发者待发货:需求待收货(客户已付尾款)、自己中标且尚未交付
var canDeliverGoods = function (demandInfo) {
if (!demandInfo) return false;
return demandInfo.status == 5 &&
demandInfo.isMyWin &&
demandInfo.winBidding &&
demandInfo.winBidding.bidding_status == 2 &&
demandInfo.winBidding.process_status == 2 &&
!getDelivery(demandInfo);
}
// 开发者已发货、等待客户确认收货
var isDelivered = function (demandInfo) {
if (!demandInfo) return false;
return demandInfo.status == 5 &&
demandInfo.isMyWin &&
demandInfo.winBidding &&
demandInfo.winBidding.bidding_status == 2 &&
demandInfo.winBidding.process_status == 2 &&
!!getDelivery(demandInfo);
}
// 数值拼接单位,空值时不显示单位
var withUnit = function (value, unit) {
if (value === undefined || value === null || value === '') {
@@ -81,5 +111,8 @@ module.exports = {
canCompleteWork: canCompleteWork,
canAcceptPassed: canAcceptPassed,
canConfirmReceipt: canConfirmReceipt,
getDelivery: getDelivery,
canDeliverGoods: canDeliverGoods,
isDelivered: isDelivered,
withUnit: withUnit,
};