|
|
@@ -0,0 +1,116 @@
|
|
|
+<!-- 交收提货-线下交收单 -->
|
|
|
+<template>
|
|
|
+ <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
|
+ :page-count="pageCount" @refresh="run">
|
|
|
+ <div class="g-order-list">
|
|
|
+ <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
|
|
|
+ <div class="g-order-list__titlebar">
|
|
|
+ <div class="left">
|
|
|
+ <h4>{{ item.goodsnamedisplay }}</h4>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <span>{{ item.orderstatusdisplay }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="g-order-list__content">
|
|
|
+ <ul>
|
|
|
+ <li class="left">
|
|
|
+ <Image width="100" height="100" radius="4" :src="getImageUrl(item.thumurls)" />
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.buyorselldisplay') }}</span>
|
|
|
+ <span>{{ item.buyorselldisplay }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.deliveryqty') }}</span>
|
|
|
+ <span>{{ item.deliveryqty }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.deliveryprice') }}</span>
|
|
|
+ <span>{{ item.orderstatus === 1 ? '--' : item.deliveryprice }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.deliveryamount') }}</span>
|
|
|
+ <span>{{ item.orderstatus === 1 ? '--' : item.deliveryamount }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.deliveryinfo') }}</span>
|
|
|
+ <span>{{ item.deliveryinfo }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>{{ $t('delivery.offline.applydate') }}</span>
|
|
|
+ <span>{{ formatDate(item.reqtime, 'YYYY-MM-DD') }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="g-order-list__btnbar">
|
|
|
+ <Button size="small" @click="onCancel(item)" v-if="item.orderstatus === 1" round>{{ $t('operation.cancel2') }}</Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </app-pull-refresh>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { shallowRef } from 'vue'
|
|
|
+import { Button } from 'vant'
|
|
|
+import { getFileUrl } from '@/filters'
|
|
|
+import { fullloading, dialog } from '@/utils/vant'
|
|
|
+import { formatDate, handleRequestBigNumber } from '@/filters'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { queryMineTradeGoodsDeliveryOfflines } from '@/services/api/transfer'
|
|
|
+import { offlineDeliveryApplyCancelOrder } from '@/services/api/trade'
|
|
|
+import { i18n } from '@/stores'
|
|
|
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
+
|
|
|
+const dataList = shallowRef<Model.MineTradeGoodsDeliveryOfflinesRsp[]>([])
|
|
|
+const error = shallowRef(false)
|
|
|
+const pullRefreshRef = shallowRef()
|
|
|
+const { t } = i18n.global
|
|
|
+
|
|
|
+const { loading, pageIndex, pageCount, run } = useRequest(queryMineTradeGoodsDeliveryOfflines, {
|
|
|
+ params: {
|
|
|
+ pagesize: 20,
|
|
|
+ marketids: '10101',
|
|
|
+ buyorsell: 1
|
|
|
+ },
|
|
|
+ onSuccess: (res) => {
|
|
|
+ if (pageIndex.value === 1) {
|
|
|
+ dataList.value = []
|
|
|
+ }
|
|
|
+ dataList.value.push(...res.data)
|
|
|
+ },
|
|
|
+ onError: () => {
|
|
|
+ error.value = true
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const onCancel = (row: Model.MineTradeGoodsDeliveryOfflinesRsp) => {
|
|
|
+ dialog({
|
|
|
+ message: t('order.listingorder.tips1'),
|
|
|
+ showCancelButton: true,
|
|
|
+ }).then(() => {
|
|
|
+ fullloading((hideLoading) => {
|
|
|
+ offlineDeliveryApplyCancelOrder({
|
|
|
+ data: {
|
|
|
+ Header: {
|
|
|
+ MarketID: row.marketid,
|
|
|
+ GoodsID: row.goodsid
|
|
|
+ },
|
|
|
+ DeliveryOrderID: handleRequestBigNumber(row.deliveryorderid)
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ hideLoading(t('order.listingorder.tips2'), 'success')
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
+ }).catch((err) => {
|
|
|
+ hideLoading(err, 'fail')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const getImageUrl = (url: string) => {
|
|
|
+ const [firstImg] = url.split(',')
|
|
|
+ return firstImg ? getFileUrl(firstImg) : ''
|
|
|
+}
|
|
|
+</script>
|