|
@@ -3,5 +3,95 @@
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<app-navbar title="供求成交-历史" />
|
|
<app-navbar title="供求成交-历史" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:pageIndex="pageIndex" :page-count="pageCount"
|
|
|
|
|
+ v-model:error="error" @refresh="onRefresh">
|
|
|
|
|
+ <Cell title="成交日期" :value="date" @click="show = true"></Cell>
|
|
|
|
|
+ <ul class="section">
|
|
|
|
|
+ <li class="section-item" v-for="(item, index) in dataList" :key="index">
|
|
|
|
|
+ <div class="section-item__titlebar">
|
|
|
|
|
+ <div class="left">
|
|
|
|
|
+ <span>{{ item.wrstandardname }}</span>
|
|
|
|
|
+ <span>{{ getBuyOrSellName(item.buyorsell) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="right">
|
|
|
|
|
+ <span>{{ formatDate(item.tradetime) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="section-item__content">
|
|
|
|
|
+ <table cellspacing="0" cellpadding="0">
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>挂牌数量</th>
|
|
|
|
|
+ <td>{{ item.tradeqty }}</td>
|
|
|
|
|
+ <th>成交价格</th>
|
|
|
|
|
+ <td>{{ item.tradeprice }}</td>
|
|
|
|
|
+ <th>金额</th>
|
|
|
|
|
+ <td>{{ item.tradeqty }}</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td>{{ handleNoneValue(item.warehousename) }}</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="section-item__btnbar">
|
|
|
|
|
+ <Button size="small" @click="onClick(item)" round>详情</Button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </app-pull-refresh>
|
|
|
|
|
+ <Calendar :show="show" type="range" :max-date="new Date()" :min-date="moment().subtract(1, 'years').toDate()" @close="onClose" @confirm="onConfirm" />
|
|
|
</app-view>
|
|
</app-view>
|
|
|
-</template>
|
|
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { shallowRef, ref } from 'vue'
|
|
|
|
|
+import { Button, Calendar, Cell } from 'vant'
|
|
|
|
|
+import { formatDate, handleNoneValue } from '@/filters'
|
|
|
|
|
+import { getBuyOrSellName } from '@/constants/order'
|
|
|
|
|
+import { useQueryWrTradeDetail } from '@/business/order'
|
|
|
|
|
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
+import { useNavigation } from '@/hooks/navigation'
|
|
|
|
|
+import moment from 'moment'
|
|
|
|
|
+
|
|
|
|
|
+const { router } = useNavigation()
|
|
|
|
|
+const { pageIndex, pageCount, getWrTradeDetail, formData } = useQueryWrTradeDetail()
|
|
|
|
|
+const dataList = shallowRef<Model.WrTradeDetailRsp[]>([])
|
|
|
|
|
+const error = shallowRef(false)
|
|
|
|
|
+/// 是否显示日历
|
|
|
|
|
+const show = shallowRef(true)
|
|
|
|
|
+/// 显示日期
|
|
|
|
|
+const date = ref('')
|
|
|
|
|
+/// 下拉刷新
|
|
|
|
|
+const pullRefreshRef = shallowRef()
|
|
|
|
|
+
|
|
|
|
|
+const onClick = (item: Model.WrTradeDetailRsp) => {
|
|
|
|
|
+ router.push({ name: 'wrtrade-detail', params: { item: JSON.stringify(item) } })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onRefresh = (finish: () => void) => {
|
|
|
|
|
+ /// 查询未完成
|
|
|
|
|
+ getWrTradeDetail().then((res) => {
|
|
|
|
|
+ if (pageIndex.value === 1) {
|
|
|
|
|
+ dataList.value = []
|
|
|
|
|
+ }
|
|
|
|
|
+ dataList.value.push(...res)
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ error.value = true
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ finish()
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onClose = () => {
|
|
|
|
|
+ show.value = false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onConfirm = (values: Date[]) => {
|
|
|
|
|
+ const [start, end] = values;
|
|
|
|
|
+ show.value = false
|
|
|
|
|
+ formData.begindate = formatDate(start.toString(), 'YYYYMMDD')
|
|
|
|
|
+ formData.enddate = formatDate(end.toString(), 'YYYYMMDD')
|
|
|
|
|
+ date.value = formData.begindate+'-'+formData.enddate
|
|
|
|
|
+ /// 查询
|
|
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|