|
@@ -0,0 +1,95 @@
|
|
|
|
|
+<!-- 查询管理-内部订单查询-线下交收单查询-失败 -->
|
|
|
|
|
+<template>
|
|
|
|
|
+ <app-drawer title="详细" width="960" v-model:show="show">
|
|
|
|
|
+ <app-table-details :data="data" :label-width="160" :cell-props="detailProps1" :column="2">
|
|
|
|
|
+ <template #auditremark>
|
|
|
|
|
+ <el-input ref="inputRef" type="textarea" :rows="3" placeholder="必填" v-model="formData.auditremark" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </app-table-details>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="onSubmit">交收失败</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </app-drawer>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { shallowRef, reactive, PropType } from 'vue'
|
|
|
|
|
+import { ElMessage, InputInstance } from 'element-plus'
|
|
|
|
|
+import { formatDate } from '@/filters'
|
|
|
|
|
+import { getBuyOrSellName } from '@/constants/order'
|
|
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
|
|
+import { queryOfflineDetail, offlineFail } from '@/services/api/order'
|
|
|
|
|
+import { CellProp } from '@pc/components/base/table-details/types'
|
|
|
|
|
+import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
|
|
|
|
|
+import { i18n } from '@/stores'
|
|
|
|
|
+
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ record: {
|
|
|
|
|
+ type: Object as PropType<Model.OfflineRsp>,
|
|
|
|
|
+ required: true
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const { t } = i18n.global
|
|
|
|
|
+const show = shallowRef(true)
|
|
|
|
|
+const refresh = shallowRef(false)
|
|
|
|
|
+const loading = shallowRef(false)
|
|
|
|
|
+const inputRef = shallowRef<InputInstance>()
|
|
|
|
|
+
|
|
|
|
|
+const formData = reactive<Model.offlineFailReq>({
|
|
|
|
|
+ auditremark: '',
|
|
|
|
|
+ deliveryorderid: props.record.deliveryorderid,
|
|
|
|
|
+ marketid: props.record.marketid
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const { data } = useRequest(queryOfflineDetail, {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ deliveryorderid: props.record.deliveryorderid
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: (err) => {
|
|
|
|
|
+ ElMessage.error(err)
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const detailProps1: CellProp[] = [
|
|
|
|
|
+ { prop: 'deliveryorderid', label: '交收单号:' },
|
|
|
|
|
+ { prop: 'username', label: '申请人:' },
|
|
|
|
|
+ { prop: 'goodsdisplay', label: '交收商品:' },
|
|
|
|
|
+ { prop: 'buyorsell', label: '方向:', formatValue: (val) => getBuyOrSellName(val) },
|
|
|
|
|
+ { prop: 'deliveryqty', label: '交收数量:' },
|
|
|
|
|
+ { prop: 'deliveryprice', label: '交收价格:' },
|
|
|
|
|
+ { prop: 'deliveryamount', label: '交收货款:' },
|
|
|
|
|
+ { prop: 'matchname', label: '对手方:' },
|
|
|
|
|
+ { prop: 'deliveryinfo', label: '交收信息:' },
|
|
|
|
|
+ { prop: 'reqtime', label: '申请时间:', formatValue: (val) => formatDate(val) },
|
|
|
|
|
+ { prop: 'orderstatusdisplay', label: '交收状态:' },
|
|
|
|
|
+ { prop: 'auditremark', label: '备注:', required: true }
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+const onCancel = (isRefresh = false) => {
|
|
|
|
|
+ show.value = false
|
|
|
|
|
+ refresh.value = isRefresh
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onSubmit = () => {
|
|
|
|
|
+ if (formData.auditremark) {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ offlineFail({
|
|
|
|
|
+ data: formData
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ ElMessage.success('提交成功')
|
|
|
|
|
+ onCancel(true)
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ ElMessage.error('提交失败:' + err)
|
|
|
|
|
+ onCancel()
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ inputRef.value?.focus()
|
|
|
|
|
+ ElMessage.warning('请输入备注')
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|