diff --git a/pages/order/report-order-exception.vue b/pages/order/report-order-exception.vue index 217b039..8a5ad8d 100644 --- a/pages/order/report-order-exception.vue +++ b/pages/order/report-order-exception.vue @@ -5,7 +5,7 @@ 异常原因 请选择异常原因 - {{typeList[typeListIndex].title}} + {{ abnormalTitle }} @@ -18,7 +18,7 @@ - + @@ -28,7 +28,7 @@ import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue"; import MeButton from "../../components/me-button/me-button.vue"; import helpers from "../../utils/helpers"; -import {ref, reactive} from 'vue' +import {ref, reactive, computed} from 'vue' import {onLoad} from '@dcloudio/uni-app' import api from "../../api/api"; import {throttle} from "../../utils/throttle"; @@ -40,6 +40,23 @@ const bindPickerChange = (e) => { const typeListIndex = ref(0) +const abnormalTitle = computed(() => { + if (submitData.abnormal_id === 0 || typeList.value === null) { + return '' + } + + const match = typeList.value.find(item => item.id === submitData.abnormal_id) + return match ? match.title : '' +}) + +const submitText = computed(() => { + if (orderInfo.value === null) { + return '立即上报' + } + + return '再次上报' +}) + //提交 const submit = throttle(() => { if (!validate()) { @@ -78,7 +95,18 @@ const submit = throttle(() => { }); }) +const orderInfo = ref(null) const init = () => { + api.orderAbnormalInfo({order_id: orderId.value}).then(res => { + if (res.id !== undefined) { + orderInfo.value = res + submitData.abnormal_id = orderInfo.value.abnormal_id + submitData.detail = orderInfo.value.detail + } + + helpers.delayHideLoading() + }).catch(() => {}) + api.findExceptionTypeList().then(res => { typeList.value = res }).catch(() => {}).finally(() => {