index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <van-nav-bar :title="'用印申请'" left-text="" left-arrow @click-left="onClickLeft" @click-right="onClickRight">
  3. <!-- <template #right>
  4. {{ $t("common.add") }}
  5. </template> -->
  6. </van-nav-bar>
  7. <van-search v-model="req.keyword" :placeholder="$t('common.pleaseEnterKeywords')" @search="onRefresh" />
  8. <van-pull-refresh v-model="loading" @refresh="onRefresh">
  9. <div class="list">
  10. <van-list v-model:loading="loading" :finished="finished" :finished-text="$t('common.noMore')" @load="getList" style="margin-bottom: 60px">
  11. <commonList :data="listData" @onClick="toDtl" :config="listConfig">
  12. <template #useMethod="{row}">
  13. <div style="width:100%">
  14. {{dictKeyValue(row.useMethod,useMethodData)}}
  15. </div>
  16. </template>
  17. <template #isContract="{row}">
  18. <div style="width:100%">
  19. {{dictKeyValue(row.isContract,sealIsContract)}}
  20. </div>
  21. </template>
  22. <template #status="{row}">
  23. <div style="width:100%">
  24. {{dictValueLabel(row.status,statusData)}}
  25. </div>
  26. </template>
  27. </commonList>
  28. </van-list>
  29. </div>
  30. </van-pull-refresh>
  31. <!-- <van-action-sheet v-model:show="actionType" :actions="actions" @select="onSelect" /> -->
  32. </template>
  33. <script setup>
  34. import { ref, getCurrentInstance } from "vue";
  35. import commonList from "@/components/common-list.vue";
  36. import { getAllDict } from "@/utils/auth";
  37. const proxy = getCurrentInstance().proxy;
  38. const sealIsContract = getAllDict()["seal_is_contract"];
  39. const onClickLeft = () => proxy.$router.push("/main/working");
  40. const onClickRight = () => {
  41. proxy.$router.push({
  42. path: "/main/processDtl",
  43. query: {
  44. flowKey: "contract_flow",
  45. },
  46. });
  47. };
  48. const actionType = ref(false);
  49. const actions = ref([
  50. {
  51. name: proxy.t("common.view"),
  52. type: "1",
  53. },
  54. {
  55. name: proxy.t("common.contractChange"),
  56. type: "2",
  57. },
  58. {
  59. name: proxy.t("common.cancel"),
  60. },
  61. ]);
  62. const req = ref({
  63. pageNum: 1,
  64. keyword: null,
  65. });
  66. const finished = ref(false);
  67. const onRefresh = () => {
  68. req.value.pageNum = 1;
  69. finished.value = false;
  70. getList("refresh");
  71. };
  72. const loading = ref(false);
  73. const listData = ref([]);
  74. const getList = (type) => {
  75. loading.value = true;
  76. proxy
  77. .post("/sealUse/page", req.value)
  78. .then((res) => {
  79. listData.value =
  80. type === "refresh"
  81. ? res.data.rows
  82. : listData.value.concat(res.data.rows);
  83. if (req.value.pageNum * 10 >= res.data.total) {
  84. finished.value = true;
  85. }
  86. req.value.pageNum++;
  87. loading.value = false;
  88. })
  89. .catch(() => {
  90. loading.value = false;
  91. });
  92. };
  93. let rowData = ref({});
  94. const toDtl = (row) => {
  95. proxy.$router.push({
  96. path: "/main/processDtl",
  97. query: {
  98. flowKey: "seal_use_flow",
  99. id: row.flowId,
  100. processType: 20,
  101. businessId: row.id,
  102. },
  103. });
  104. };
  105. const useMethodData = ref([
  106. {
  107. dictValue: "借章",
  108. dictKey: "1",
  109. },
  110. {
  111. dictValue: "盖章",
  112. dictKey: "2",
  113. },
  114. ]);
  115. const statusData = ref([
  116. {
  117. label: "草稿",
  118. value: 0,
  119. },
  120. {
  121. label: "审批中",
  122. value: 10,
  123. },
  124. {
  125. label: "审批驳回",
  126. value: 20,
  127. },
  128. {
  129. label: "审批通过",
  130. value: 30,
  131. },
  132. {
  133. label: "作废",
  134. value: 88,
  135. },
  136. ]);
  137. const listConfig = ref([
  138. {
  139. label: "流水号",
  140. prop: "code",
  141. },
  142. {
  143. label: "申请人",
  144. prop: "createUserName",
  145. },
  146. {
  147. label: "申请日期",
  148. prop: "applyTime",
  149. },
  150. {
  151. type: "slot",
  152. label: "使用方式",
  153. slotName: "useMethod",
  154. },
  155. {
  156. type: "slot",
  157. label: "是否销售合同",
  158. slotName: "isContract",
  159. },
  160. {
  161. type: "slot",
  162. label: "审批状态",
  163. slotName: "status",
  164. },
  165. ]);
  166. </script>
  167. <style lang="scss" scoped>
  168. .list {
  169. min-height: 70vh;
  170. }
  171. </style>