|
@@ -0,0 +1,152 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
|
|
|
|
|
+ <app-view>
|
|
|
|
|
+ <template #header>
|
|
|
|
|
+ <app-navbar :title="buyorsell === 0 ? '买历史履约信息' : '卖历史履约信息'" @back="closed">
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <Cell title="查询日期" :value="dateRange.join('-')" @click="showCalendar = true" is-link />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </app-navbar>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
|
|
|
+ :page-count="pageCount" @refresh="onRefresh">
|
|
|
|
|
+ <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.wrstandardcode }}/{{ item.wrstandardname }}</h4>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="right">
|
|
|
|
|
+ <span>{{ getPerformanceStatusName(item.performancestatus) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="g-order-list__content">
|
|
|
|
|
+ <ul>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>日期</span>
|
|
|
|
|
+ <span>{{ formatDate(item.createtime, 'YYYY-MM-DD') }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>类型</span>
|
|
|
|
|
+ <span>{{ getPerformanceTypeName(item.performancetype) }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>履约数量</span>
|
|
|
|
|
+ <span>{{ item.qty }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>履约金额</span>
|
|
|
|
|
+ <span>{{ item.amount }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>买方已付</span>
|
|
|
|
|
+ <span>{{ item.buypaidamount }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>当前步骤</span>
|
|
|
|
|
+ <span>{{ handleNoneValue(item.curstepname) }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li>
|
|
|
|
|
+ <span>卖方已收</span>
|
|
|
|
|
+ <span>{{ item.sellreceivedamount }}</span>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="g-order-list__btnbar">
|
|
|
|
|
+ <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
|
|
+ <Calendar v-model:show="showCalendar" type="range" :max-date="new Date()"
|
|
|
|
|
+ :min-date="moment().subtract(1, 'years').toDate()" @confirm="onConfirm" />
|
|
|
|
|
+ </app-pull-refresh>
|
|
|
|
|
+ </app-view>
|
|
|
|
|
+ </app-modal>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { shallowRef, defineAsyncComponent, ref } from 'vue'
|
|
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
|
|
+import { Button, Calendar, Cell } from 'vant'
|
|
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
|
|
+import { queryPerformancePlan } from '@/services/api/performance'
|
|
|
|
|
+import { formatDate, handleNoneValue } from '@/filters'
|
|
|
|
|
+import { getPerformanceStatusName, getPerformanceTypeName } from '@/constants/order'
|
|
|
|
|
+import moment from 'moment'
|
|
|
|
|
+import AppModal from '@/components/base/modal/index.vue'
|
|
|
|
|
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
|
|
+
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ buyorsell: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ required: true
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
|
|
+ ['detail', defineAsyncComponent(() => import('../detail/Index.vue'))], // 详情
|
|
|
|
|
+])
|
|
|
|
|
+
|
|
|
|
|
+const dataList = shallowRef<Model.PerformancePlanRsp[]>([])
|
|
|
|
|
+const showModal = shallowRef(true)
|
|
|
|
|
+const selectedRow = shallowRef<Model.PerformancePlanRsp>()
|
|
|
|
|
+const error = shallowRef(false)
|
|
|
|
|
+const pullRefreshRef = shallowRef()
|
|
|
|
|
+const refresh = shallowRef(false) // 是否刷新父组件数据
|
|
|
|
|
+const showCalendar = shallowRef(false) // 是否显示日期选择器
|
|
|
|
|
+const dateRange = ref<string[]>([]) // 日期范围
|
|
|
|
|
+
|
|
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const { loading, pageIndex, pageCount, run } = useRequest(queryPerformancePlan, {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ buyorsell: props.buyorsell
|
|
|
|
|
+ },
|
|
|
|
|
+ onSuccess: (res) => {
|
|
|
|
|
+ if (pageIndex.value === 1) {
|
|
|
|
|
+ dataList.value = []
|
|
|
|
|
+ }
|
|
|
|
|
+ dataList.value.push(...res.data)
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: () => {
|
|
|
|
|
+ error.value = true
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const showComponent = (componentName: string, row: Model.PerformancePlanRsp) => {
|
|
|
|
|
+ selectedRow.value = row
|
|
|
|
|
+ openComponent(componentName)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 选择日期
|
|
|
|
|
+const onConfirm = ([start, end]: Date[]) => {
|
|
|
|
|
+ showCalendar.value = false
|
|
|
|
|
+ dateRange.value = [formatDate(start.toISOString(), 'YYYYMMDD'), formatDate(end.toISOString(), 'YYYYMMDD')]
|
|
|
|
|
+ pageIndex.value = 1
|
|
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onRefresh = () => {
|
|
|
|
|
+ const [startDate, endDate] = dateRange.value
|
|
|
|
|
+ run({
|
|
|
|
|
+ buyorsell: props.buyorsell,
|
|
|
|
|
+ begindate: startDate,
|
|
|
|
|
+ enddate: endDate
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 关闭弹窗
|
|
|
|
|
+const closed = (isRefresh = false) => {
|
|
|
|
|
+ refresh.value = isRefresh
|
|
|
|
|
+ showModal.value = false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 暴露组件属性给父组件调用
|
|
|
|
|
+defineExpose({
|
|
|
|
|
+ closed,
|
|
|
|
|
+})
|
|
|
|
|
+</script>
|