feat: 异常上报

This commit is contained in:
苟川东 2025-04-20 14:02:02 +08:00
parent 3184caa2de
commit 353ea4b17a
3 changed files with 34 additions and 22 deletions

View File

@ -85,6 +85,12 @@ class Api {
let url = `${config.host}/worker/order_dispatch/completeService`;
return fetch.request('postFrom', url, data, true)
}
// 异常原因列表
static findExceptionTypeList() {
let url = `${config.host}/worker/abnormal/index`;
return fetch.request('GET', url, {}, true)
}
}
export default Api

View File

@ -1,11 +1,14 @@
<template>
<view class="ctr" v-if="data !== null">
<view class="form-group">
<view class="item input flex-sb line-after" @click="selectFinalPaymentMethod()">
<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.final_payment_method === null" class="select-ctr flex-r">异常原因</view>
<view v-else class="select-ctr flex-r select">{{submitData.final_payment_method === 1 ? '线下尾款' : '线上尾款'}}</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>
<view class="textarea">
<view class="title flex-l">异常说明</view>
<view class="value">
@ -29,7 +32,13 @@ import {ref, reactive} from 'vue'
import {onLoad} from '@dcloudio/uni-app'
import api from "../../api/api";
import {throttle} from "../../utils/throttle";
import enums from "../../utils/enums";
const bindPickerChange = (e) => {
typeListIndex.value = e.detail.value;
submitData.abnormal_id = typeList.value[e.detail.value].id
}
const typeListIndex = ref(0)
//
const submit = throttle(() => {
@ -73,33 +82,27 @@ onLoad((params) => {
})
const data = ref(null)
const typeList = ref(null)
const init = () => {
api.orderInfo({order_dispatch_id: id.value}).then(res => {
data.value = res
}).catch(() => {})
api.findExceptionTypeList().then(res => {
typeList.value = res
console.log(typeList.value)
}).catch(() => {})
}
//
const submitData = reactive({
abnormal_id: null,
abnormal_id: 0,
detail: '',
})
const selectFinalPaymentMethod = () => {
uni.showActionSheet({
itemList: ['线下尾款', '线上尾款'],
success: function (res) {
submitData.final_payment_method = res.tapIndex + 1
},
fail: function (res) {
console.log(res.errMsg);
}
});
}
//
const validate = () => {
if (submitData.abnormal_id === null) {
if (submitData.abnormal_id === 0) {
helpers.showToast('请选择异常原因')
return false
}

View File

@ -116,7 +116,7 @@
}
.input {
width: 100%;
height: 100rpx;
min-height: 100rpx;
position: relative;
.title {
width: 200rpx;
@ -139,7 +139,10 @@
font-size: 30rpx;
color: var(--descriptionColor);
width: 100%;
height: 100%;
min-height: 100rpx;
line-height: 48rpx;
padding: 16rpx 0;
box-sizing: border-box;
}
.select {
color: var(--titleColor);