|
|
|
|
@ -100,7 +100,7 @@
|
|
|
|
|
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
|
|
|
|
<text>服务时间:{{order.expectTimeStart + '~' + order.expectTimeEnd}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="margin-top-sm" v-if="[0,1,2].indexOf(order.orderStatus) === -1">
|
|
|
|
|
<view class="margin-top-sm" v-if="order.orderDetailId != null && order.orderStatus > 2">
|
|
|
|
|
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
|
|
|
|
<text>上门时间:{{order.workBeginTime}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
@ -114,7 +114,7 @@
|
|
|
|
|
:second="$dateUtil.countDownDiff(order.expectTimeEnd).seconds">
|
|
|
|
|
</uni-countdown>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="margin-top-sm" v-if="order.orderStatus > 3">
|
|
|
|
|
<view class="margin-top-sm" v-if="order.orderDetailId != null && order.orderStatus > 3">
|
|
|
|
|
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-time"></text></text>
|
|
|
|
|
<text>完成时间:{{order.workFinishTime}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
@ -134,27 +134,29 @@
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">改价</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">转发</button> -->
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="updateMasterOrder(order, 1)">确认接单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="updateOrderStatus(order.orderMasterId, 1, 'updateMasterOrder')" v-if="order.orderDetailId == null">确认接单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="updateOrderStatus(order.orderDetailId, 1, 'updateDetailOrder')" v-else>确认接单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm">拒绝接单</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="order.orderStatus === 1">
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrderPopup" @click="getCanAssignList(order)" @tap="togglePopup($event, order)">派单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="assignWork2MySelf(order)">自己承接</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-popup="dispatchOrderPopup" @click="getCanAssignList(order)" @tap="togglePopup($event, order)" v-show="order.orderDetailId == null">派单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="assignWork2MySelf(order)" v-show="order.orderDetailId == null">自己承接</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showTimeArrangeModal" @tap="showModal($event, order)">预约时间</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="order.orderStatus === 2">
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">修改时间</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="workBegin(order)">立即上门</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">修改时间</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="workBegin(order)" v-show="order.orderDetailId != null">立即上门</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="order.orderStatus === 3">
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, order)">改价</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showNewServPriceModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">改价</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="makePhoneCall(order.customerPhone)">联系客户</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)">重新排期</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)" v-if="order.payStatus === 1">发起完单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)">生成收款码</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showEditTimeArrangeModal" @tap="showModal($event, order)" v-show="order.orderDetailId != null">重新排期</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @tap="finishOrder(order)" v-if="order.payStatus === 1" v-show="order.orderDetailId != null">发起完单</button>
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" data-modal="showPayQrcodeModal" v-if="order.payStatus === 0" @tap="makePayQrcode($event, order)" v-show="order.orderDetailId != null">生成收款码</button>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-if="order.orderStatus === 4 || order.orderStatus === 5">
|
|
|
|
|
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
|
|
|
|
|
@ -216,7 +218,8 @@
|
|
|
|
|
<text>备注:{{order.customerRemark}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<load-status-bar ref="loadStatusBar" @loadMore="loadMasterOrderPage"></load-status-bar>
|
|
|
|
|
<view :class="tabCur !== 4 ? 'cu-tabbar-height' : ''"></view>
|
|
|
|
|
<load-status-bar v-show="tabCur === 4" ref="loadStatusBar" @loadMore="loadMasterOrderPage"></load-status-bar>
|
|
|
|
|
<!-- 模态框 -->
|
|
|
|
|
<time-arrange :show="showTimeArrangeModal" :data="curOrder" :curDate="curDate" @showArrangeFailTime="showArrangeFailTime" @editServTime="editServTime"></time-arrange>
|
|
|
|
|
<time-arrange-fail :show="showArrangeFailTimeModal" :data="curOrder"></time-arrange-fail>
|
|
|
|
|
@ -230,7 +233,7 @@
|
|
|
|
|
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="dispatchOrderPopup" @click="togglePopup"><text
|
|
|
|
|
class="cuIcon-close"></text></view>
|
|
|
|
|
<view class="bg-white padding" style="padding-top: 74rpx; min-height: 600rpx;">
|
|
|
|
|
<dispatch-order ref="dispatchOrder" v-if="myTeamMembers && myTeamMembers.length > 0" @assignWork="assignWork" :members="myTeamMembers"></dispatch-order>
|
|
|
|
|
<dispatch-order ref="dispatchOrder" v-if="myTeamMembers && myTeamMembers.length > 0" @assignWork="assignWork" :members="myTeamMembers" :totalMoney="curOrder.totalMoney"></dispatch-order>
|
|
|
|
|
<view v-else class="align-center-view text-xl">无可指派的师傅</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 底部占位 -->
|
|
|
|
|
@ -384,15 +387,13 @@
|
|
|
|
|
// }
|
|
|
|
|
this.pageNum = 1;
|
|
|
|
|
this.orderList = [];
|
|
|
|
|
this.$refs.loadStatusBar.showLoadMore();
|
|
|
|
|
// this.$refs.loadStatusBar.showLoadMore();
|
|
|
|
|
this.loadMasterOrderPage();
|
|
|
|
|
// 订单统计
|
|
|
|
|
this.loadOrderStatistics();
|
|
|
|
|
},
|
|
|
|
|
async loadMasterOrderPage(params = {}) {
|
|
|
|
|
params.pageSize = this.$globalData.initPageSize;
|
|
|
|
|
// params.orderStatus = this.subStateList[this.tabCur].code;
|
|
|
|
|
// params.pageNum = this.pageParams[this.tabCur].pageNum;
|
|
|
|
|
params.pageNum = this.pageNum;
|
|
|
|
|
params.goodsName = this.formData.orderKeywords;
|
|
|
|
|
params.countryId = this.formData.area && this.formData.area.length > 2 ? this.formData.area[2].areaId : null;
|
|
|
|
|
@ -402,20 +403,17 @@
|
|
|
|
|
} else if (this.stateCur != null) {
|
|
|
|
|
params.orderStatus = this.stateList[this.stateCur].code;
|
|
|
|
|
}
|
|
|
|
|
this.$refs.loadStatusBar.showLoading();
|
|
|
|
|
try {
|
|
|
|
|
let res = null;
|
|
|
|
|
// 不同状态的单需要请求不同接口
|
|
|
|
|
if (this.tabCur === 0 || this.stateCur != null) {
|
|
|
|
|
res = await this.$request.qryMasterOrderPage(params);
|
|
|
|
|
} else {
|
|
|
|
|
if (this.tabCur === 4) {
|
|
|
|
|
// 已完成状态只查询子单,需要进行分页处理
|
|
|
|
|
this.$refs.loadStatusBar.showLoading();
|
|
|
|
|
res = await this.$request.qryDetailOrderPage(params);
|
|
|
|
|
}
|
|
|
|
|
if (res && res.rows) {
|
|
|
|
|
let rowsLength = res.rows.length;
|
|
|
|
|
if (rowsLength > 0) {
|
|
|
|
|
this.orderList = this.orderList.concat(res.rows);
|
|
|
|
|
// this.pageParams[this.tabCur].pageNum++;
|
|
|
|
|
this.pageNum++;
|
|
|
|
|
if (rowsLength === params.pageSize) {
|
|
|
|
|
this.$refs.loadStatusBar.showLoadMore();
|
|
|
|
|
@ -424,6 +422,13 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.$refs.loadStatusBar.showLoadOver();
|
|
|
|
|
} else {
|
|
|
|
|
// 其他状态下的单需要展示主单及子单的混合列表,不做分页处理
|
|
|
|
|
res = await this.$request.qryMixOrderList(params);
|
|
|
|
|
if (res && res.data) {
|
|
|
|
|
this.orderList = res.data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
this.$refs.loadStatusBar.showLoadErr();
|
|
|
|
|
@ -614,11 +619,14 @@
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
async editServTime(id, datetimeArr, ifRollback2WS) {
|
|
|
|
|
async editServTime(id, datetimeArr, ifRollback2WS, order) {
|
|
|
|
|
// 确定方法名
|
|
|
|
|
let reqFunName = "updateDetailOrder";
|
|
|
|
|
if (this.tabCur === 0) {
|
|
|
|
|
reqFunName = "updateOrder"
|
|
|
|
|
let reqFunName = "updateOrder";
|
|
|
|
|
if (this.tabCur === 0 && order.orderDetailId == null) {
|
|
|
|
|
id = order.orderMasterId;
|
|
|
|
|
} else {
|
|
|
|
|
reqFunName = "updateDetailOrder";
|
|
|
|
|
id = order.orderDetailId;
|
|
|
|
|
}
|
|
|
|
|
// 确定参数
|
|
|
|
|
let params = datetimeArr && datetimeArr.length > 1 ? {
|
|
|
|
|
@ -642,14 +650,17 @@
|
|
|
|
|
if (statusUpdateRes && statusUpdateRes.code === 0) {
|
|
|
|
|
finishFlag = true;
|
|
|
|
|
}
|
|
|
|
|
} else if (order && order.orderDetailId == null) {
|
|
|
|
|
finishFlag = await this.assignWork2MySelf(order);
|
|
|
|
|
} else {
|
|
|
|
|
finishFlag = true;
|
|
|
|
|
finishFlag = await this.updateOrderStatus(order.orderDetailId, 2, 'updateDetailOrder');
|
|
|
|
|
}
|
|
|
|
|
if (finishFlag) {
|
|
|
|
|
this.reloadMasterOrderPage();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '修改成功',
|
|
|
|
|
icon: 'success'
|
|
|
|
|
title: '预约时间成功',
|
|
|
|
|
icon: 'none',
|
|
|
|
|
duration: 2000
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -734,9 +745,9 @@
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
async updateMasterOrder(order, status) {
|
|
|
|
|
let res = await this.$request.updateMasterOrder({
|
|
|
|
|
id: order.orderMasterId,
|
|
|
|
|
async updateOrderStatus(id, status, funName) {
|
|
|
|
|
let res = await this.$request[funName]({
|
|
|
|
|
id: id,
|
|
|
|
|
orderStatus: status,
|
|
|
|
|
});
|
|
|
|
|
if (res && res.code === 0) {
|
|
|
|
|
@ -744,7 +755,9 @@
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success'
|
|
|
|
|
})
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
updateRefundStatus(status, index) {
|
|
|
|
|
this.orderList[index].refundStatus = status;
|
|
|
|
|
@ -769,6 +782,10 @@
|
|
|
|
|
let res = await this.$request.updateDetailOrder(params);
|
|
|
|
|
if (res && res.code === 0) {
|
|
|
|
|
this.reloadMasterOrderPage();
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
duration: 1000
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/* modal,popup确认或关闭后的回调 */
|
|
|
|
|
@ -786,11 +803,13 @@
|
|
|
|
|
title: '派单成功',
|
|
|
|
|
icon: 'success'
|
|
|
|
|
})
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '派单失败,请确认派单价格不高于本订单价格',
|
|
|
|
|
icon: 'none'
|
|
|
|
|
})
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async assignWork2MySelf(orderInfo) {
|
|
|
|
|
@ -812,7 +831,7 @@
|
|
|
|
|
orderMasterId: orderInfo.orderMasterId,
|
|
|
|
|
isAll: 1
|
|
|
|
|
}
|
|
|
|
|
this.assignWork(params);
|
|
|
|
|
return await this.assignWork(params);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|