未约未派增加主单退单功能

This commit is contained in:
donqi 2023-10-15 00:50:23 +08:00
parent 1798d7efde
commit 7e0d673551
2 changed files with 38 additions and 7 deletions

View File

@ -15,7 +15,7 @@ export default {
// request 触发前拼接 url
args.url = 'https://www.opsoul.com:8881' + args.url;
// args.url = 'http://127.0.0.1:80' + args.url;
// args.url = 'http://192.168.10.103:80' + args.url;
// args.url = 'http://192.168.10.105:80' + args.url;
if (!args.data) {
args.data = {}
@ -674,6 +674,17 @@ export default {
})
return res[1].data;
},
async rejectMasterOrderWhenAccepted(params = {}) {
let res = await uni.request({
url: '/order/master/console/cancel',
method: 'POST',
data: params,
header: {
'content-type': 'application/x-www-form-urlencoded'
}
})
return res[1].data;
},
async changeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/change/price',

View File

@ -217,6 +217,7 @@
<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>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId != null" @click="rejectDetailOrder(order)">退单</button>
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" v-if="order.orderDetailId == null" @click="rejectMasterOrderWhenAccepted(order)">退单</button>
</view>
<view v-else-if="order.orderStatus === 1">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur margin-top-sm" @click="showServOrderDetail(order)">查看</button>
@ -1250,14 +1251,14 @@
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'none',
title: '拒绝接单成功',
icon: 'success',
title: '拒单成功',
duration: 1000
})
} else {
uni.showToast({
icon: 'none',
title: '拒绝接单失败'
title: '拒单失败'
})
}
},
@ -1268,14 +1269,33 @@
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'none',
title: '拒绝接单成功',
icon: 'success',
title: '退单成功',
duration: 1000
})
} else {
uni.showToast({
icon: 'none',
title: '拒绝接单失败'
title: '退单失败'
})
}
},
async rejectMasterOrderWhenAccepted(order) {
let res = await this.$request.rejectMasterOrderWhenAccepted({
id: order.orderMasterId
});
if (res && res.code === 0) {
this.reloadMasterOrderPage();
uni.showToast({
icon: 'none',
title: '退单成功',
duration: 1000
})
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
})
}
},