订单流程调整

This commit is contained in:
donqi 2022-09-12 00:21:19 +08:00
parent 33ba80479a
commit 41c8926ebd
6 changed files with 88 additions and 54 deletions

View File

@ -13,8 +13,8 @@ export default {
})
let userInfo = _this.getCurUserInfo();
// request 触发前拼接 url
args.url = 'https://www.opsoul.com' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'https://www.opsoul.com' + args.url;
args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'http://192.168.2.42:80' + args.url;
if (!args.data) {
@ -440,6 +440,14 @@ export default {
})
return res[1].data;
},
async qryMixOrderList(params = {}) {
let res = await uni.request({
url: '/order/app/mix/order/list',
method: 'POST',
data: params
})
return res[1].data;
},
async updateOrder(params = {}) {
let res = await uni.request({
url: '/order/master/editOrderMaster',

View File

@ -19,7 +19,10 @@
</view>
</view>
</view>
<view class="padding-tb-sm solid-bottom flex justify-between align-center">
<view class="padding-top-sm padding-bottom-xs flex justify-between align-center">
<text class="margin-right-sm">本单任务金额<text class="text-red text-lg">{{totalMoney}}</text></text>
</view>
<view class="padding-bottom-sm solid-bottom flex justify-between align-center">
<text class="margin-right-sm" style="width: 150rpx;">派单价格</text>
<input type="digit" class="line-input radius-input" v-model="dispatchTotalPrice" placeholder="请输入派出总额"></input>
</view>
@ -90,6 +93,10 @@
orderNow: {
type: Boolean,
default: false
},
totalMoney: {
type: Number,
default: null
}
},
data() {

View File

@ -150,7 +150,7 @@
return;
}
// let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00';
this.$emit('editServTime', this.data.orderDetailId, [this.expectTimeStart, this.expectTimeEnd], this.ifRollback2WS);
this.$emit('editServTime', this.data.orderDetailId, [this.expectTimeStart, this.expectTimeEnd], this.ifRollback2WS, this.data);
this.hideModal(e);
},
changeReasonRadio(e) {

View File

@ -128,7 +128,7 @@
return;
}
// let datetime = this.date + ' ' + this.time + ':00';
this.$emit('editServTime', this.data.orderMasterId, [this.expectTimeStart, this.expectTimeEnd]);
this.$emit('editServTime', this.data.orderMasterId, [this.expectTimeStart, this.expectTimeEnd], false, this.data);
this.hideModal(e);
},
makePhoneCall(phoneNum) {

View File

@ -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
})
}
},
/* modalpopup确认或关闭后的回调 */
@ -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);
}
}
}

View File

@ -59,7 +59,7 @@
<text class="cuIcon-time text-main-color margin-right-xs"></text>
<text>排单时间{{servDetail.mainServOrder.boodTime}}</text>
</view> -->
<view class="margin-top-sm" v-if="servDetail.orderStatus >= 3">
<view class="margin-top-sm" v-if="servDetail.orderDetailId != null && servDetail.orderStatus >= 3">
<text class="cuIcon-time text-main-color margin-right-xs"></text>
<text>上门时间{{servDetail.workBeginTime}}</text>
</view>
@ -89,7 +89,7 @@
</view>
</view>
<!-- 完成记录 -->
<view v-if="[0, 1].indexOf(servDetail.orderStatus) === -1" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm" v-for="(item, index) in servDetail.standardList">
<view v-if="servDetail.orderDetailId == null" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm" v-for="(item, index) in servDetail.standardList">
<view class="cu-bar solid-bottom">
<view class="action bar-first-action">
<text class="cuIcon-titles text-main-color"></text> 完成记录
@ -100,7 +100,7 @@
<product-picked :pickedList="[item]" :columnTitleArr="servedColumnHeaders" :valFieldArr="servedValFields"></product-picked>
</view>
</view>
<view v-if="servDetail.orderStatus > 3 && servDetail.finishImgList && servDetail.finishImgList.length" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm">
<view v-if="servDetail.orderDetailId != null && servDetail.orderStatus > 3 && servDetail.finishImgList && servDetail.finishImgList.length" class="bg-white margin-lr-sm padding-lr padding-bottom margin-top-sm">
<view class="cu-bar solid-bottom">
<view class="action bar-first-action">
<text class="cuIcon-titles text-main-color"></text> 完工图片
@ -117,12 +117,12 @@
</view>
<!-- 订单编码和时间 -->
<view class="bg-white margin-top-sm padding margin-lr-sm margin-bottom-with-bar">
<view v-if="[0, 1].indexOf(servDetail.orderStatus) !== -1">订单编码{{servDetail.orderMasterCode}}</view>
<view v-else>订单编码{{servDetail.orderDetailCode}}</view>
<view v-if="servDetail.orderDetailCode != null">订单编码{{servDetail.orderDetailCode}}</view>
<view v-else>订单编码{{servDetail.orderMasterCode}}</view>
<view class="margin-top-xs">订单时间{{servDetail.createTime}}</view>
</view>
<!-- 底部操作栏 -->
<view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderStatus === 2">
<view class="cu-bar bg-white tabbar border fixed-bottom-bar" v-if="servDetail.orderDetailId != null && servDetail.orderStatus === 2">
<!-- <view class="action" data-popup="orderManage" @click="togglePopup">
<view class="cuIcon-list"></view> 订单管理
</view>
@ -201,7 +201,7 @@
async loadData() {
let orderId = null;
let funName = null;
if ([0, 1].indexOf(this.order.orderStatus) !== -1) {
if (this.order.orderDetailId == null) {
//
orderId = this.order.orderMasterId;
funName = "getOrderMasterDetail";