feat: 异常支持重复上传
This commit is contained in:
parent
0050d4989a
commit
e1decb94cf
|
|
@ -1,32 +1,23 @@
|
|||
<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>
|
||||
<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>
|
||||
<picker @change="bindPickerChange" range-key="title" :range="typeList">
|
||||
<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 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>
|
||||
</template>
|
||||
</picker>
|
||||
|
||||
<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({
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user