feat: 上报异常

This commit is contained in:
gcd 2025-04-20 22:51:56 +08:00
parent 353ea4b17a
commit 4bb1fcc37c
5 changed files with 83 additions and 28 deletions

View File

@ -91,6 +91,18 @@ class Api {
let url = `${config.host}/worker/abnormal/index`; let url = `${config.host}/worker/abnormal/index`;
return fetch.request('GET', url, {}, true) return fetch.request('GET', url, {}, true)
} }
// 获取订单异常详情
static orderAbnormalInfo(data) {
let url = `${config.host}/worker/order_abnormal/info`;
return fetch.request('GET', url, data, true)
}
// 上报异常
static createOrderAbnormal(data) {
let url = `${config.host}/worker/order_abnormal/create`;
return fetch.request('postFrom', url, data, true)
}
} }
export default Api export default Api

View File

@ -47,6 +47,12 @@
<view class="title flex-l">客户备注</view> <view class="title flex-l">客户备注</view>
<view class="value flex-l">{{data.remark ? data.remark : '无备注信息'}}</view> <view class="value flex-l">{{data.remark ? data.remark : '无备注信息'}}</view>
</view> </view>
<view class="report-order-exception flex-c" v-if="data.status !== enums.ORDER_DISPATCH_STATUS.STATUS_TOGET">
<view @click="reportOrderException(data.order_info.id)" class="report-ctr flex-c" hover-class="auto-mask-layer-radius4" hover-start-time="0" hover-stay-time="50">
<me-icon type="icon-arrow-up-line" color="var(--importantColor)" size="36rpx"></me-icon>
<text class="text">上报异常</text>
</view>
</view>
</view> </view>
<!-- 已拒接--> <!-- 已拒接-->
@ -91,7 +97,7 @@
<text>{{data.order_info.online_amount}}元抵扣{{data.order_info.discount_amount}}</text> <text>{{data.order_info.online_amount}}元抵扣{{data.order_info.discount_amount}}</text>
</view> </view>
</view> </view>
<view class="item-row flex-sb line-after"> <view class="item-row flex-sb line-after" v-if="data.offline_total_type !== 0">
<view class="title flex-l">尾款收款方</view> <view class="title flex-l">尾款收款方</view>
<view class="value flex-r"> <view class="value flex-r">
<text>{{ data.offline_total_type === 1 ? '师傅收' : '公司收' }}</text> <text>{{ data.offline_total_type === 1 ? '师傅收' : '公司收' }}</text>
@ -164,6 +170,11 @@ const openLocation = () => {
}); });
} }
//
const reportOrderException = (orderId) => {
helpers.jumpToPage('report-order-exception', `order_id=${orderId}`)
}
// //
const arrivedOnSite = () => { const arrivedOnSite = () => {
helpers.jumpToPage('arrived-on-site', 'id=' + id.value) helpers.jumpToPage('arrived-on-site', 'id=' + id.value)
@ -228,7 +239,7 @@ onShow(() => {
const data = ref(null) const data = ref(null)
const init = () => { const init = () => {
uni.showLoading({ uni.showLoading({
title: '获取中' title: '加载中'
}); });
api.orderInfo({order_dispatch_id: id.value}).then(res => { api.orderInfo({order_dispatch_id: id.value}).then(res => {
data.value = res data.value = res
@ -347,6 +358,19 @@ const previewImage = (url) => {
line-height: 48rpx; line-height: 48rpx;
} }
} }
.report-order-exception {
width: 100%;
height: 80rpx;
.report-ctr {
width: 198rpx;
height: 64rpx;
border-radius: 8rpx;
.text {
font-size: 28rpx;
color: var(--importantColor);
}
}
}
.images { .images {
width: 100%; width: 100%;
position: relative; position: relative;

View File

@ -1,23 +1,32 @@
<template> <template>
<view class="ctr" v-if="data !== null"> <view class="ctr" v-if="orderInfo !== null">
<view class="form-group"> <view class="form-group">
<picker @change="bindPickerChange" range-key="title" :range="typeList"> <template v-if="orderInfo.length === 0">
<picker @change="bindPickerChange" range-key="title" :range="typeList">
<view class="item input flex-sb line-after">
<view class="title flex-l">异常原因</view>
<view v-if="submitData.abnormal_id === 0" class="select-ctr flex-r">请选择异常原因</view>
<view v-else class="select-ctr flex-r select">{{typeList[typeListIndex].title}}</view>
</view>
</picker>
</template>
<template v-else>
<view class="item input flex-sb line-after"> <view class="item input flex-sb line-after">
<view class="title flex-l">异常原因</view> <view class="title flex-l">异常原因</view>
<view v-if="submitData.abnormal_id === 0" class="select-ctr flex-r">请选择异常原因</view> <view class="select-ctr flex-r select">{{orderInfo.abnormal_title}}</view>
<view v-else class="select-ctr flex-r select">{{typeList[typeListIndex].title}}</view>
</view> </view>
</picker> </template>
<view class="textarea"> <view class="textarea">
<view class="title flex-l">异常说明</view> <view class="title flex-l">异常说明</view>
<view class="value"> <view class="value">
<textarea :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/> <textarea v-if="orderInfo.length === 0" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea v-else disabled="disabled" :disable-default-padding="true" class="input-textarea" v-model="orderInfo.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
</view> </view>
</view> </view>
</view> </view>
<me-empty-space height="376"></me-empty-space> <me-empty-space height="376"></me-empty-space>
<view class="bottom"> <view class="bottom" v-if="orderInfo.length === 0">
<me-button @click="submit()" text="立即上报" width="686rpx" icon-type="icon-arrow-up-line" margin-top="32rpx"></me-button> <me-button @click="submit()" text="立即上报" width="686rpx" icon-type="icon-arrow-up-line" margin-top="32rpx"></me-button>
</view> </view>
</view> </view>
@ -49,48 +58,54 @@ const submit = throttle(() => {
uni.showModal({ uni.showModal({
title: '提示信息', title: '提示信息',
confirmText: '确认', confirmText: '确认',
content: '确认已完成所有服务', content: '确认上报异常',
success: function (res) { success: function (res) {
if (res.confirm) { if (res.confirm) {
uni.showLoading({ uni.showLoading({
title: '提交中' title: '提交中'
}); });
let data = helpers.deepObj(submitData) submitData.order_id = orderId.value
data.complete_images = (submitData.complete_images).join(',')
data.order_dispatch_id = id.value
api.completeService(data).then(() => { api.createOrderAbnormal(submitData).then(() => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ uni.showToast({
title: '已完成服务', title: '完成上报',
icon: "success" icon: "success"
}) })
setTimeout(() => { init()
uni.navigateBack();
}, 1000)
}).catch(() => {}) }).catch(() => {})
} }
} }
}); });
}) })
const id = ref(null) const orderId = ref(null)
onLoad((params) => { onLoad((params) => {
id.value = params.id orderId.value = params.order_id
uni.showLoading({
title: '加载中'
})
init() init()
}) })
const data = ref(null) const orderInfo = ref(null)
const typeList = ref(null) const typeList = ref(null)
const init = () => { const init = () => {
api.orderInfo({order_dispatch_id: id.value}).then(res => { api.orderAbnormalInfo({order_id: orderId.value}).then(res => {
data.value = res orderInfo.value = res
if (orderInfo.value.id !== undefined) {
uni.setNavigationBarTitle({
title: '上报详情',
})
}
uni.hideLoading()
}).catch(() => {}) }).catch(() => {})
api.findExceptionTypeList().then(res => { api.findExceptionTypeList().then(res => {
typeList.value = res typeList.value = res
console.log(typeList.value)
}).catch(() => {}) }).catch(() => {})
} }

View File

@ -60,7 +60,7 @@
<text class="text">{{getOrderStatusText(item.status)}}</text> <text class="text">{{getOrderStatusText(item.status)}}</text>
</view> </view>
<view class="operate flex-r"> <view class="operate flex-r">
<view class="btn flex-c" @click="reportOrderException(item.id)" hover-class="auto-mask-layer-radius8" hover-start-time="0" hover-stay-time="50"> <view class="btn flex-c" @click="reportOrderException(item.order_info.id)" hover-class="auto-mask-layer-radius8" hover-start-time="0" hover-stay-time="50">
<me-icon type="icon-arrow-up-line" color="#FFFFFF" size="40rpx"></me-icon> <me-icon type="icon-arrow-up-line" color="#FFFFFF" size="40rpx"></me-icon>
<text>上报异常</text> <text>上报异常</text>
</view> </view>
@ -89,8 +89,8 @@ const toDetail = (id) => {
} }
// //
const reportOrderException = (id) => { const reportOrderException = (orderId) => {
helpers.jumpToPage('report-order-exception', `id=${id}`) helpers.jumpToPage('report-order-exception', `order_id=${orderId}`)
} }
// //

View File

@ -24,6 +24,7 @@
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500;
color: var(--titleColor); color: var(--titleColor);
} }
.value { .value {
@ -46,6 +47,7 @@
height: 100rpx; height: 100rpx;
font-size: 30rpx; font-size: 30rpx;
color: var(--titleColor); color: var(--titleColor);
font-weight: 500;
} }
.value { .value {
width: 446rpx; width: 446rpx;
@ -73,6 +75,7 @@
height: 80rpx; height: 80rpx;
font-size: 30rpx; font-size: 30rpx;
color: var(--titleColor); color: var(--titleColor);
font-weight: 500;
} }
.desc { .desc {
margin-left: 8rpx; margin-left: 8rpx;
@ -122,6 +125,7 @@
width: 200rpx; width: 200rpx;
height: 100rpx; height: 100rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500;
color: var(--titleColor); color: var(--titleColor);
} }
.input-ctr { .input-ctr {