|
|
@@ -3,18 +3,131 @@
|
|
|
<template #header>
|
|
|
<app-navbar title="履约信息" />
|
|
|
</template>
|
|
|
- <Tabs class="van-tabs--list" v-model:active="active" :swipe-threshold="4">
|
|
|
- <Tab title="买履约">
|
|
|
- </Tab>
|
|
|
- <Tab title="卖履约">
|
|
|
- </Tab>
|
|
|
- </Tabs>
|
|
|
+
|
|
|
+ <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
|
|
|
+ :page-count="pageCount" @refresh="onChange">
|
|
|
+ <Tabs class="van-tabs--list" v-model:active="buyorsell" :swipe-threshold="4" @click="onChange">
|
|
|
+ <Tab title="买履约" />
|
|
|
+ <Tab title="卖履约" />
|
|
|
+ </Tabs>
|
|
|
+ <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>{{ item.performanceplanid }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>时间</span>
|
|
|
+ <span>{{ item.createtime }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>类型</span>
|
|
|
+ <span>{{ getPerformanceTypeName(item.performancetype) }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>关联单号</span>
|
|
|
+ <span>{{ item.relatedorderid }}</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>{{ item.curstepname }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>卖方已收</span>
|
|
|
+ <span>{{ item.sellreceivedamount }}</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <span>步骤到期日期</span>
|
|
|
+ <span>{{ formatDate( item.curstepdeadline) }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="g-order-list__btnbar">
|
|
|
+ <Button size="small" @click="showComponent('breach', item)" round>违约</Button>
|
|
|
+ <Button size="small" @click="showComponent('modify', item)" round>修改</Button>
|
|
|
+ <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" />
|
|
|
+ </app-pull-refresh>
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
-import { Tab, Tabs } from 'vant'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
+import { Tab, Tabs, Button } from 'vant'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { queryPerformancePlan } from '@/services/api/performance'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+import { getPerformanceStatusName, getPerformanceTypeName } from '@/constants/order'
|
|
|
+
|
|
|
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['detail', defineAsyncComponent(() => import('./components/detail/Index.vue'))], // 详情
|
|
|
+ ['modify', defineAsyncComponent(() => import('./components/modify/Index.vue'))], // 修改
|
|
|
+ ['breach', defineAsyncComponent(() => import('./components/breach/Index.vue'))], // 违约
|
|
|
+])
|
|
|
+
|
|
|
+const dataList = shallowRef<Model.PerformancePlanRsp[]>([])
|
|
|
+const selectedRow = shallowRef<Model.PerformancePlanRsp>()
|
|
|
+const error = shallowRef(false)
|
|
|
+const pullRefreshRef = shallowRef()
|
|
|
+const buyorsell = shallowRef(0)
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
+ pullRefreshRef.value?.refresh()
|
|
|
+})
|
|
|
+
|
|
|
+const onChange = () => {
|
|
|
+ run({
|
|
|
+ buyorsell: buyorsell.value
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const { loading, pageIndex, pageCount, run } = useRequest(queryPerformancePlan, {
|
|
|
+ params: {
|
|
|
+ buyorsell: buyorsell.value
|
|
|
+ },
|
|
|
+ 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 active = shallowRef(0)
|
|
|
</script>
|