完善发货流程
This commit is contained in:
@@ -175,7 +175,12 @@ class Demand extends Api
|
|||||||
} elseif ($item->status == 4 && $item->accept_status == 1) {
|
} elseif ($item->status == 4 && $item->accept_status == 1) {
|
||||||
$button = ['name' => '前去验收', 'theme' => 'danger'];
|
$button = ['name' => '前去验收', 'theme' => 'danger'];
|
||||||
} elseif ($item->status == 5 && $item->accept_status == 2) {
|
} 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;
|
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: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.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.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>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
@@ -58,10 +58,20 @@ var canAcceptPassed = function (demandInfo) {
|
|||||||
demandInfo.accept_status == 1;
|
demandInfo.accept_status == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 客户确认收货:待收货且开发者已发货
|
||||||
var canConfirmReceipt = function (demandInfo) {
|
var canConfirmReceipt = function (demandInfo) {
|
||||||
if (!demandInfo) return false;
|
if (!demandInfo) return false;
|
||||||
return demandInfo.status == 5 &&
|
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)
|
// 获取交付内容(订单发货表,后端 detail 接口挂载的 delivery 字段,未发货返回 null)
|
||||||
@@ -111,6 +121,7 @@ module.exports = {
|
|||||||
canCompleteWork: canCompleteWork,
|
canCompleteWork: canCompleteWork,
|
||||||
canAcceptPassed: canAcceptPassed,
|
canAcceptPassed: canAcceptPassed,
|
||||||
canConfirmReceipt: canConfirmReceipt,
|
canConfirmReceipt: canConfirmReceipt,
|
||||||
|
isWaitingDeliver: isWaitingDeliver,
|
||||||
getDelivery: getDelivery,
|
getDelivery: getDelivery,
|
||||||
canDeliverGoods: canDeliverGoods,
|
canDeliverGoods: canDeliverGoods,
|
||||||
isDelivered: isDelivered,
|
isDelivered: isDelivered,
|
||||||
|
|||||||
Reference in New Issue
Block a user