feat: 异常支持重复上传

This commit is contained in:
苟川东 2025-04-28 16:28:07 +08:00
parent 0050d4989a
commit e1decb94cf

View File

@ -1,7 +1,6 @@
<template>
<view class="ctr" v-if="orderInfo !== null">
<view class="ctr">
<view class="form-group">
<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>
@ -9,24 +8,16 @@
<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="title flex-l">异常原因</view>
<view class="select-ctr flex-r select">{{orderInfo.abnormal_title}}</view>
</view>
</template>
<view class="textarea">
<view class="title flex-l">异常说明</view>
<view class="value">
<textarea maxlength="200" v-if="orderInfo.length === 0" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea maxlength="200" v-else disabled="disabled" :disable-default-padding="true" class="input-textarea" v-model="orderInfo.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
<textarea maxlength="200" :disable-default-padding="true" class="input-textarea" v-model="submitData.detail" placeholder-class="placeholder-class" placeholder="请输入异常说明200字以内"/>
</view>
</view>
</view>
<me-empty-space height="376"></me-empty-space>
<view class="bottom" v-if="orderInfo.length === 0">
<view class="bottom">
<me-button @click="submit()" text="立即上报" width="686rpx" icon-type="icon-arrow-up-line" margin-top="32rpx"></me-button>
</view>
</view>
@ -69,10 +60,17 @@ const submit = throttle(() => {
api.createOrderAbnormal(submitData).then(() => {
helpers.delayHideLoading()
uni.showToast({
title: '完成上报',
icon: "success"
})
uni.showModal({
title: '提示信息',
showCancel: false,
content: '异常已上报',
success: function (res) {
if (res.confirm) {
uni.navigateBack();
}
}
});
init()
}).catch(() => {})
}
@ -80,6 +78,14 @@ const submit = throttle(() => {
});
})
const init = () => {
api.findExceptionTypeList().then(res => {
typeList.value = res
}).catch(() => {}).finally(() => {
helpers.delayHideLoading()
})
}
const orderId = ref(null)
onLoad((params) => {
orderId.value = params.order_id
@ -89,25 +95,7 @@ onLoad((params) => {
init()
})
const orderInfo = ref(null)
const typeList = ref(null)
const init = () => {
api.orderAbnormalInfo({order_id: orderId.value}).then(res => {
orderInfo.value = res
if (orderInfo.value.id !== undefined) {
uni.setNavigationBarTitle({
title: '上报详情',
})
}
helpers.delayHideLoading()
}).catch(() => {})
api.findExceptionTypeList().then(res => {
typeList.value = res
}).catch(() => {})
}
//
const submitData = reactive({