完善发货流程

This commit is contained in:
Dev
2026-09-30 15:16:09 +08:00
parent bc17810445
commit 0758c7e618
3 changed files with 19 additions and 2 deletions
@@ -175,7 +175,12 @@ class Demand extends Api
} elseif ($item->status == 4 && $item->accept_status == 1) {
$button = ['name' => '前去验收', 'theme' => 'danger'];
} elseif ($item->status == 5 && $item->accept_status == 2) {
$button = ['name' => '确认收货', 'theme' => 'danger'];
//开发者发货后客户才能确认收货
if ($item->hasDelivery) {
$button = ['name' => '确认收货', 'theme' => 'danger'];
} else {
$button = ['name' => '待发货', 'theme' => 'light'];
}
}
}
return $button;
@@ -112,5 +112,6 @@
<t-button wx:if="{{_calc.canSignContractCustomer(demandInfo)}}" data-status="1" theme="danger" size="large" bind:tap="signContractCustomer" block>合同签约</t-button>
<t-button wx:elif="{{_calc.canAcceptPassed(demandInfo)}}" theme="danger" size="large" bind:tap="acceptPassed" block>验收</t-button>
<t-button wx:elif="{{_calc.canConfirmReceipt(demandInfo)}}" theme="danger" size="large" bind:tap="confirmReceipt" block>确认收货</t-button>
<t-button wx:elif="{{_calc.isWaitingDeliver(demandInfo)}}" theme="light" size="large" disabled block>待发货(等待开发者交付)</t-button>
</block>
</view>
+12 -1
View File
@@ -58,10 +58,20 @@ var canAcceptPassed = function (demandInfo) {
demandInfo.accept_status == 1;
}
// 客户确认收货:待收货且开发者已发货
var canConfirmReceipt = function (demandInfo) {
if (!demandInfo) return false;
return demandInfo.status == 5 &&
demandInfo.accept_status == 2;
demandInfo.accept_status == 2 &&
!!getDelivery(demandInfo);
}
// 开发者尚未发货,客户等待交付中
var isWaitingDeliver = function (demandInfo) {
if (!demandInfo) return false;
return demandInfo.status == 5 &&
demandInfo.accept_status == 2 &&
!getDelivery(demandInfo);
}
// 获取交付内容(订单发货表,后端 detail 接口挂载的 delivery 字段,未发货返回 null)
@@ -111,6 +121,7 @@ module.exports = {
canCompleteWork: canCompleteWork,
canAcceptPassed: canAcceptPassed,
canConfirmReceipt: canConfirmReceipt,
isWaitingDeliver: isWaitingDeliver,
getDelivery: getDelivery,
canDeliverGoods: canDeliverGoods,
isDelivered: isDelivered,