张延森 2 年之前
父節點
當前提交
f14606e29a
共有 5 個文件被更改,包括 103 次插入68 次删除
  1. 1
    1
      src/pages/index.vue
  2. 0
    65
      src/pages/invoice/promulgate.vue
  3. 95
    0
      src/pages/publicity/list.vue
  4. 1
    1
      src/router/index.js
  5. 6
    1
      src/services/invoice.js

+ 1
- 1
src/pages/index.vue 查看文件

@@ -65,7 +65,7 @@ const goRecord = () => {
65 65
   router.push({ name: 'invoice.records'})
66 66
 }
67 67
 const goPromulgate = () => {
68
-  router.push({ name: 'invoice.promulgate'})
68
+  router.push({ name: 'publicity.list'})
69 69
 }
70 70
 onMounted(() => {
71 71
   getInvoiceFill(formData.data.invoiceId).then(res => {

+ 0
- 65
src/pages/invoice/promulgate.vue 查看文件

@@ -1,65 +0,0 @@
1
-<template>
2
-  <div class="list">
3
-    <h2>信息公示</h2>
4
-    <van-list>
5
-      <van-cell
6
-        class="item"
7
-        v-for="item in recordList"
8
-        :key="item.invoiceId"
9
-        :title="item.orgName"
10
-        @click="() => goDetail(item.invoiceId)"
11
-      >
12
-        <template #value>
13
-          <span>{{ item.name }}</span>
14
-        </template>
15
-      </van-cell>
16
-    </van-list>
17
-  </div>
18
-</template>
19
-<script setup>
20
-import { onMounted, ref } from "vue"
21
-import { useRouter } from 'vue-router'
22
-
23
-const router = useRouter();
24
-
25
-const recordList = ref([
26
-  {
27
-    orgName:'江苏林业集团',
28
-    name: '张九九',
29
-    invoiceId: '1',
30
-  },
31
-  {
32
-    orgName:'南京云致科技有限公司',
33
-    name: '李盼',
34
-    invoiceId: '2',
35
-  },
36
-  {
37
-    orgName:'邓州市源盛农机专业合作社',
38
-    name: '印雪彬',
39
-    invoiceId: '3',
40
-  },
41
-  {
42
-    orgName:'杭州昱恒科技有限公司',
43
-    name: '陈康',
44
-    invoiceId: '4',
45
-  },
46
-])
47
-
48
-onMounted(() => {
49
-  //获取提交记录
50
-})
51
-const goDetail = (val) => {
52
-  router.push({ name: 'invoice.fill', params: { id: val } })
53
-}
54
-</script>
55
-<style lang="less" scoped>
56
-.list {
57
-  padding: 16px;
58
-  h2 {
59
-    text-align: center;
60
-  }
61
-  .item + .item {
62
-    margin-top: 16px;
63
-  }
64
-}
65
-</style>

+ 95
- 0
src/pages/publicity/list.vue 查看文件

@@ -0,0 +1,95 @@
1
+<template>
2
+  <div class="publicity-page">
3
+    <h3>信息公示</h3>
4
+    <van-list
5
+      class="publicity-list"
6
+      v-model:loading="loading"
7
+      :finished="finished"
8
+      @load="onLoad"
9
+      finished-text="我们是有底线的"
10
+    >
11
+      <van-cell
12
+        class="item"
13
+        v-for="item in list"
14
+        :key="item.detailId"
15
+        :title="item.orgName"
16
+        is-link
17
+        :to="{ name: 'invoice.fill', query: { invoiceId, personId: item.personId } }"
18
+      >
19
+        <template #value>
20
+          <span class="pname">{{ item.personName }}</span>
21
+        </template>
22
+      </van-cell>
23
+    </van-list>
24
+  </div>
25
+</template>
26
+<script setup>
27
+import { computed, onMounted, reactive, ref } from "vue"
28
+import { useRouter, useRoute } from 'vue-router'
29
+import { getList } from "@/services/invoice";
30
+
31
+const router = useRouter();
32
+const route = useRoute();
33
+const { invoiceId = 'f11ab8d28fd097e7aa4877ae7068a876' } = route;
34
+
35
+const list = ref([])
36
+const error = ref(false);
37
+const loading = ref(false);
38
+const pagenavi = reactive({ pageNum: 1, pageSize: 10, total: 0 })
39
+const finished = computed(() => pagenavi.pageNum * pagenavi.pageSize > pagenavi.total)
40
+
41
+const queryData = (params) => {
42
+  getList(invoiceId, params).then(res => {
43
+    const { records, ...pageInfo } = res;
44
+    if (pageInfo.current === 1) {
45
+      list.value = records || []
46
+    } else {
47
+      list.value = list.value.concat(records || [])
48
+    }
49
+
50
+    pagenavi.pageNum = pageInfo.current
51
+    pagenavi.total = pageInfo.total
52
+    error.value = false
53
+    loading.value = false
54
+  }).catch(() => {
55
+    error.value = true
56
+    loading.value = false
57
+  })
58
+}
59
+
60
+const onLoad = () => {
61
+  const params = { pageNum: pagenavi.pageNum + 1, pageSize: pagenavi.pageSize }
62
+  queryData(params)
63
+}
64
+
65
+onMounted(() => {
66
+  //获取提交记录
67
+  const params = { pageNum: pagenavi.pageNum, pageSize: pagenavi.pageSize }
68
+  queryData(params)
69
+})
70
+
71
+</script>
72
+<style lang="less" scoped>
73
+.publicity-page {
74
+  height: 100%;
75
+  display: flex;
76
+  flex-direction: column;
77
+
78
+  h3 {
79
+    flex: none;
80
+    text-align: center;
81
+    letter-spacing: 2px;
82
+  }
83
+
84
+  .publicity-list {
85
+    flex: 1;
86
+  }
87
+
88
+  .pname {
89
+    color: #333;
90
+  }
91
+  // .item + .item {
92
+  //   margin-top: 16px;
93
+  // }
94
+}
95
+</style>

+ 1
- 1
src/router/index.js 查看文件

@@ -7,7 +7,7 @@ const routes = [
7 7
   { path: '/', name: 'index', component: () => import('@/pages/index.vue') },
8 8
   { path: '/invoice/fill', name: 'invoice.fill', component: () => import('@/pages/invoice/fill.vue') },
9 9
   { path: '/invoice/records', name: 'invoice.records', component: () => import('@/pages/invoice/records.vue') },
10
-  { path: '/invoice/promulgate', name: 'invoice.promulgate', component: () => import('@/pages/invoice/promulgate.vue') },
10
+  { path: '/publicity/list', name: 'publicity.list', component: () => import('@/pages/publicity/list.vue') },
11 11
   { path: '/login', name: 'login', component: () => import('@/pages/login.vue') },
12 12
 ];
13 13
 

+ 6
- 1
src/services/invoice.js 查看文件

@@ -8,4 +8,9 @@ export function getInvoiceFill(id) {
8 8
 // 获取报销模板详情
9 9
 export function getInvoiceModel(id,params) {
10 10
   return request.get(`/invoice/${id}/detail/info`,{params})
11
-}
11
+}
12
+
13
+// 获取报销列表
14
+export function getList(invoiceId, params) {
15
+  return request.get(`/invoice/${invoiceId}/detail`,{params})
16
+}