historyMessage.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <van-nav-bar
  3. :title="$t('historyMessage.name')"
  4. left-text=""
  5. left-arrow
  6. @click-left="onClickLeft"
  7. @click-right="onClickRight"
  8. >
  9. </van-nav-bar>
  10. <van-search
  11. v-model="req.keyword"
  12. :placeholder="$t('common.pleaseEnterKeywords')"
  13. @search="onRefresh"
  14. />
  15. <van-pull-refresh v-model="loading" @refresh="onRefresh">
  16. <div class="list">
  17. <van-list
  18. v-model:loading="loading"
  19. :finished="finished"
  20. :finished-text="$t('common.noMore')"
  21. @load="getList"
  22. style="margin-bottom: 60px"
  23. >
  24. <commonList :data="listData" @onClick="toDtl" :config="listConfig">
  25. <template #typeName="{ row }">
  26. <div>消息通知</div>
  27. </template>
  28. </commonList>
  29. </van-list>
  30. </div>
  31. </van-pull-refresh>
  32. </template>
  33. <script setup>
  34. import { ref, getCurrentInstance } from "vue";
  35. import commonList from "@/components/common-list.vue";
  36. const proxy = getCurrentInstance().proxy;
  37. const onClickLeft = () => proxy.$router.push("/main/working");
  38. const req = ref({
  39. pageNum: 1,
  40. keyword: null,
  41. });
  42. const finished = ref(false);
  43. const onRefresh = () => {
  44. req.value.pageNum = 1;
  45. finished.value = false;
  46. getList("refresh");
  47. };
  48. const loading = ref(false);
  49. const listData = ref([]);
  50. const statusData = ref([
  51. {
  52. label: "草稿",
  53. value: 0,
  54. },
  55. {
  56. label: "审批中",
  57. value: 10,
  58. },
  59. {
  60. label: "驳回",
  61. value: 20,
  62. },
  63. {
  64. label: "审批通过",
  65. value: 30,
  66. },
  67. {
  68. label: "终止",
  69. value: 99,
  70. },
  71. ]);
  72. const payStatusData = ref([]);
  73. const getDict = () => {
  74. proxy.getDictOne(["pay_status"]).then((res) => {
  75. payStatusData.value = res["pay_status"].data.map((x) => ({
  76. label: x.dictValue,
  77. value: x.dictKey,
  78. }));
  79. });
  80. };
  81. getDict();
  82. const getList = (type) => {
  83. loading.value = true;
  84. proxy
  85. .post("/pushInfo/page", req.value)
  86. .then((res) => {
  87. listData.value =
  88. type === "refresh"
  89. ? res.data.rows
  90. : listData.value.concat(res.data.rows);
  91. if (req.value.pageNum * 10 >= res.data.total) {
  92. finished.value = true;
  93. }
  94. req.value.pageNum++;
  95. loading.value = false;
  96. })
  97. .catch(() => {
  98. loading.value = false;
  99. });
  100. };
  101. const toDtl = (row) => {};
  102. const onClickRight = () => {
  103. proxy.$router.push({
  104. path: "/main/processDtl",
  105. query: {
  106. flowKey: "pay_flow",
  107. },
  108. });
  109. };
  110. const listConfig = ref([
  111. {
  112. type: "slot",
  113. label: proxy.t("historyMessage.messageType"),
  114. slotName: "typeName",
  115. },
  116. {
  117. label: proxy.t("historyMessage.sendTime"),
  118. prop: "createTime",
  119. },
  120. {
  121. label: proxy.t("historyMessage.messageContent"),
  122. prop: "title",
  123. },
  124. ]);
  125. </script>
  126. <style lang="scss" scoped>
  127. .list {
  128. min-height: 70vh;
  129. }
  130. </style>