diff --git a/common/js/request.js b/common/js/request.js index 462b7b3..0d39363 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -13,17 +13,21 @@ 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 = 'http://10.45.137.214: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) { args.data = {} } - args.data.deptId = globalData.deptId; - args.data.from = globalData.from; - if (!args.data.workerId) { - args.data.workerId = userInfo.workerId; + if (args.data instanceof Object) { + args.data.deptId = globalData.deptId; + args.data.from = globalData.from; + if (!args.data.workerId) { + args.data.workerId = userInfo.workerId; + } } + if (!args.header) { args.header = {} } @@ -480,5 +484,13 @@ export default { method: 'POST' }) return res[1].data; + }, + async qrPay(params = {}) { + let res = await uni.request({ + url: '/pay/ali/qr', + method: 'POST', + data: params.orderMasterId + }) + return res[1].data; } } diff --git a/pages/order-manage/modal/edit-time-arrange.vue b/pages/order-manage/modal/edit-time-arrange.vue index 5fbc321..532a799 100644 --- a/pages/order-manage/modal/edit-time-arrange.vue +++ b/pages/order-manage/modal/edit-time-arrange.vue @@ -84,6 +84,10 @@ curDate: { type: String, default: '' + }, + ifRollback2WS: { + type: Boolean, + default: false } }, data() { @@ -126,7 +130,7 @@ this.resetData(); this.$emit('showArrangeFailTime', e) }, - arrangeTime(e) { + async arrangeTime(e) { if (!(this.time || this.timeRange)) { uni.showToast({ title: '请选择时间' @@ -134,7 +138,7 @@ return; } let datetime = this.date + ' ' + (this.time || this.timeRange) + ':00'; - this.$emit('editServTime', this.data.orderDetailId, datetime); + this.$emit('editServTime', this.data.orderDetailId, datetime, this.ifRollback2WS); this.hideModal(e); }, changeReasonRadio(e) { diff --git a/pages/order-manage/modal/pay-qrcode.vue b/pages/order-manage/modal/pay-qrcode.vue index 3934217..46b229c 100644 --- a/pages/order-manage/modal/pay-qrcode.vue +++ b/pages/order-manage/modal/pay-qrcode.vue @@ -3,8 +3,8 @@ - 扫码支付 - + 支付宝扫码支付 + @@ -12,10 +12,12 @@ - + + + @@ -24,7 +26,8 @@ import ayQrcode from "@/components/ay-qrcode/ay-qrcode.vue"; export default { - nama: 'pay-qrcode', + nama: 'pay-qrcode', + emits: ['finishQrPay'], components: { ayQrcode }, @@ -46,8 +49,8 @@ } }, methods: { - hideModal(e) { - uni.$emit(this.$globalFun.HIDE_MODAL, e); + finishQrPay(e) { + this.$emit('finishQrPay', e); }, // 展示二维码 showQrcode(url) { diff --git a/pages/order-manage/order-manage.vue b/pages/order-manage/order-manage.vue index d45fba4..a9c0ff1 100644 --- a/pages/order-manage/order-manage.vue +++ b/pages/order-manage/order-manage.vue @@ -74,8 +74,9 @@ - - + + + {{tag.content}} @@ -134,24 +135,24 @@ - + - - + + - + + 退单申请: @@ -209,8 +210,8 @@ - - + + @@ -559,7 +560,7 @@ data: data }); }, - async editServTime(id, datetime) { + async editServTime(id, datetime, ifRollback2WS) { let reqFunName = "updateDetailOrder"; if (this.tabCur === 0) { reqFunName = "updateOrder" @@ -569,18 +570,39 @@ revTime: datetime }); if (res.code === 0) { - this.reloadMasterOrderPage(); - uni.showToast({ - title: '修改成功', - icon: 'success' - }) + let finishFlag = false; + if (ifRollback2WS) { + let statusUpdateRes = await this.updateOrderDetailStatus(id, 2); + if (statusUpdateRes && statusUpdateRes.code === 0) { + finishFlag = true; + } + } + if (finishFlag) { + this.reloadMasterOrderPage(); + uni.showToast({ + title: '修改成功', + icon: 'success' + }) + } } }, + async updateOrderDetailStatus(orderDetailId, status) { + let res = await this.$request.updateDetailOrder({ + id: orderDetailId, + orderStatus: status, + workBeginTime: '' + }); + return res; + }, showArrangeFailTime(e) { this.showTimeArrangeModal = false; this.showEditTimeArrangeModal = false; this.showArrangeFailTimeModal = true; }, + finishQrPay(e) { + this.hideModal(e); + this.reloadMasterOrderPage(); + }, togglePopup(e, orderInfo) { if (this.ifShowPageMeta) { this.$refs[e.currentTarget.dataset.popup].close(); @@ -602,19 +624,38 @@ phoneNumber: phoneNum }) }, - makePayQrcode(e, orderInfo) { - this.$refs.payQrcode.showQrcode('http://10.45.81.125:8081/portal/' + Math.random()); - this.showModal(e, orderInfo); + async makePayQrcode(e, orderInfo) { + if (orderInfo.payStatus === 1) { + uni.showToast({ + title: '订单已支付,不要重复付款!', + icon: 'none' + }) + return; + } + let res = await this.$request.qrPay(orderInfo); + if (res && res.code === 0) { + this.$refs.payQrcode.showQrcode(res.data.expend.qrcode_url); + this.showModal(e, orderInfo); + } }, showServOrderDetail(order) { uni.navigateTo({ url: '/pages/order-manage/serv-detail?order=' + encodeURIComponent(JSON.stringify(order)) }) }, - finishOrder(order) { - uni.navigateTo({ - url: '/pages/order-manage/finish-order?order=' + encodeURIComponent(JSON.stringify(order)) - }) + // finishOrder(order) { + // uni.navigateTo({ + // url: '/pages/order-manage/finish-order?order=' + encodeURIComponent(JSON.stringify(order)) + // }) + // }, + async finishOrder(order) { + let res = await this.updateOrderDetailStatus(order.orderDetailId, 6); + if (res && res.code === 0) { + this.reloadMasterOrderPage(); + uni.showToast({ + icon: 'success' + }) + } }, updateRefundStatus(status, index) { this.orderList[index].refundStatus = status; @@ -625,6 +666,20 @@ getCanAssignList(order) { this.$refs.dispatchOrder.$children[0].loadData(order); }, + async workBegin(order) { + let curDate = new Date(); + let formatCurDate = curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate() + + ' ' + curDate.getHours() + ':' + curDate.getMinutes() + ':' + curDate.getSeconds(); + let params = { + id: order.orderDetailId, + orderStatus: 3, + workBeginTime: formatCurDate + } + let res = await this.$request.updateDetailOrder(params); + if (res && res.code === 0) { + this.reloadMasterOrderPage(); + } + }, /* modal,popup确认或关闭后的回调 */ async showAfterSalePic() { // TODO:查询该售后单中的拒绝原因中上传的截图 diff --git a/pages/order-manage/serv-detail.vue b/pages/order-manage/serv-detail.vue index 5da76f3..df300fe 100644 --- a/pages/order-manage/serv-detail.vue +++ b/pages/order-manage/serv-detail.vue @@ -82,15 +82,15 @@ - + - 完成记录({{item.finishList.length}}) + 完成记录 - {{item.finishTime}} + {{item.finishTime}} - + @@ -109,7 +109,7 @@ 发送急报 - 立即上门 + 立即上门 @@ -224,6 +224,9 @@ let res = await this.$request.updateDetailOrder(params); if (res && res.code === 0) { this.loadData(this.servDetail.orderDetailId); + uni.showToast({ + icon: 'success' + }) } }, showModal(e) {