todo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <template>
  2. <van-tabs v-model:active="activeName" @change="tabChange()">
  3. <van-tab title="个贷待办" name="personal">
  4. <van-search v-model="personalListQuery.keyword" placeholder="请输入搜索关键词" @search="onPersonalSearch()" />
  5. <van-pull-refresh v-model="loading" @refresh="onPersonalRefresh()">
  6. <van-list v-model:loading="loading" :finished="personalFinished" finished-text="没有待办了" @load="personalTodoList()">
  7. <div class="card" v-for="item in personalListData" :key="item.id" @click="toPersonalDetail(item)">
  8. <h3>
  9. <van-icon name="link-o" />
  10. &nbsp;{{ item.orderId }}
  11. </h3>
  12. <p class="projectName">
  13. <van-icon name="location-o" />
  14. &nbsp;{{ item.location }}
  15. </p>
  16. <p>
  17. <van-icon name="contact-o" />
  18. &nbsp;{{ item.clientName }}-{{ item.clientSubName}}
  19. </p>
  20. <p>
  21. <van-tag type="primary" size="medium">{{ item.nodeName }}</van-tag>&nbsp;
  22. <van-tag type="success" size="medium">{{ item.clientManager }}</van-tag>&nbsp;
  23. <van-tag color="#969799" size="medium">{{ item.created }}</van-tag>
  24. </p>
  25. </div>
  26. </van-list>
  27. </van-pull-refresh>
  28. <van-back-top right="10vw" bottom="10vh" />
  29. </van-tab>
  30. <van-tab title="大中型待办" name="major">
  31. <van-search v-model="majorListQuery.keyword" placeholder="请输入搜索关键词" @search="onMajorSearch()" />
  32. <van-pull-refresh v-model="loading" @refresh="onMajorRefresh()">
  33. <van-list v-model:loading="loading" :finished="majorFinished" finished-text="没有待办了" @load="majorTodoList()">
  34. <div class="card" v-for="item in majorListData" :key="item.id">
  35. <h3>
  36. <van-icon name="link-o" />
  37. &nbsp;{{ item.orderId }}
  38. </h3>
  39. <p class="productionNo" v-if="item.statementNo || item.reportNo">
  40. <van-icon name="coupon-o" />
  41. &nbsp;
  42. {{ item.statementNo }}
  43. <!-- 产品号都不为空才显示中间的分割空格, 以保持页面间距统一 -->
  44. <span v-if="item.statementNo && item.reportNo">&nbsp;&nbsp;</span>
  45. {{ item.reportNo }}
  46. </p>
  47. <p class="projectName">
  48. <van-icon name="location-o" />
  49. &nbsp;{{ item.productionName == null ? item.orderName : item.productionName }}
  50. </p>
  51. <p>
  52. <van-tag type="primary" size="medium">{{ item.nodeName }}</van-tag>&nbsp;
  53. <van-tag type="success" size="medium">{{ item.clientManager }}</van-tag>&nbsp;
  54. <van-tag color="#969799" size="medium">{{ item.created }}</van-tag>
  55. </p>
  56. </div>
  57. </van-list>
  58. </van-pull-refresh>
  59. <van-back-top right="10vw" bottom="10vh" />
  60. </van-tab>
  61. <van-tab title="资产待办" name="assets">
  62. <van-search v-model="assetsListQuery.keyWord" placeholder="请输入搜索关键词" @search="onAssetsSearch()" />
  63. <van-pull-refresh v-model="loading" @refresh="onAssetsRefresh()">
  64. <van-list v-model:loading="loading" :finished="assetsFinished" finished-text="没有待办了" @load="assetsTodoList()">
  65. <div class="card" v-for="item in assetsListData" :key="item.id">
  66. <h3>
  67. <van-icon name="link-o" />
  68. &nbsp;{{ item.orderId }}
  69. </h3>
  70. <p class="productionNo" v-if="item.statementNo || item.reportNo">
  71. <van-icon name="coupon-o" />
  72. &nbsp;
  73. {{ item.statementNo }}
  74. <!-- 产品号都不为空才显示中间的分割空格, 以保持页面间距统一 -->
  75. <span v-if="item.statementNo && item.reportNo">&nbsp;&nbsp;</span>
  76. {{ item.reportNo }}
  77. </p>
  78. <p class="projectName">
  79. <van-icon name="location-o" />
  80. &nbsp;{{ item.reportName || item.statementName || item.name }}
  81. </p>
  82. <p>
  83. <van-tag type="primary" size="medium">{{ item.currentNodeName }}</van-tag>&nbsp;
  84. <van-tag type="success" size="medium">{{ item.clientManagerName }}</van-tag>&nbsp;
  85. <van-tag color="#969799" size="medium">{{ item.created }}</van-tag>
  86. </p>
  87. </div>
  88. </van-list>
  89. </van-pull-refresh>
  90. <van-back-top right="10vw" bottom="10vh" />
  91. </van-tab>
  92. </van-tabs>
  93. </template>
  94. <script>
  95. import { getPersonalTodoList } from '@/api/personal';
  96. import { getMajorTodoList } from '@/api/major';
  97. import { getAssetsTodoList } from '@/api/assets';
  98. export default {
  99. data() {
  100. return {
  101. activeName: 'personal',
  102. personalListData: [],
  103. majorListData: [],
  104. assetsListData: [],
  105. // 加载状态
  106. loading: false,
  107. // 加载完成状态
  108. personalFinished: false,
  109. majorFinished: false,
  110. assetsFinished: false,
  111. personalListQuery: {
  112. // 当前页数
  113. current: 1,
  114. // 查询关键字
  115. keyword: null,
  116. },
  117. majorListQuery: {
  118. // 当前页数
  119. current: 1,
  120. // 查询关键字
  121. keyword: null,
  122. },
  123. assetsListQuery: {
  124. // 当前页数
  125. current: 1,
  126. // 查询关键字
  127. keyWord: null,
  128. },
  129. };
  130. },
  131. created() {
  132. this.personalFinished = false;
  133. this.majorFinished = false;
  134. this.assetsFinished = false;
  135. this.personalTodoList();
  136. },
  137. methods: {
  138. // 监听标签页改变
  139. tabChange() {
  140. switch (this.activeName) {
  141. case 'personal':
  142. break;
  143. case 'major':
  144. break;
  145. case 'assets':
  146. break;
  147. default:
  148. break;
  149. }
  150. },
  151. // 个贷待办列表刷新
  152. onPersonalRefresh() {
  153. this.personalListQuery.current = 1;
  154. this.personalFinished = false;
  155. this.personalListData = [];
  156. this.personalTodoList();
  157. },
  158. // 个贷待办列表关键字搜索
  159. onPersonalSearch() {
  160. this.personalListQuery.current = 1;
  161. this.personalFinished = false;
  162. this.personalListData = [];
  163. this.personalTodoList();
  164. },
  165. // 获取个贷待办
  166. personalTodoList() {
  167. this.loading = true;
  168. getPersonalTodoList(this.personalListQuery).then((res) => {
  169. if (res.code == 200) {
  170. if (res.data.records) {
  171. this.personalListData = this.personalListData.concat(res.data.records);
  172. }
  173. // 判断是否还有下一页
  174. if (res.data.pages > this.personalListQuery.current) {
  175. // 服务端返回的总页数大于当前页数, 将当前页数+1
  176. this.personalListQuery.current++;
  177. } else {
  178. // 反之停止加载
  179. this.personalFinished = true;
  180. }
  181. }
  182. this.loading = false;
  183. });
  184. },
  185. // 大中型待办列表刷新
  186. onMajorRefresh() {
  187. this.majorListQuery.current = 1;
  188. this.majorFinished = false;
  189. this.majorListData = [];
  190. this.majorTodoList();
  191. },
  192. // 大中型待办列表关键字搜索
  193. onMajorSearch() {
  194. this.majorListQuery.current = 1;
  195. this.majorFinished = false;
  196. this.majorListData = [];
  197. this.majorTodoList();
  198. },
  199. // 获取大中型待办
  200. majorTodoList() {
  201. this.loading = true;
  202. getMajorTodoList(this.majorListQuery).then((res) => {
  203. if (res.code == 200) {
  204. if (res.data.records) {
  205. this.majorListData = this.majorListData.concat(res.data.records);
  206. }
  207. // 判断是否还有下一页
  208. if (res.data.pages > this.majorListQuery.current) {
  209. // 服务端返回的总页数大于当前页数, 将当前页数+1
  210. this.majorListQuery.current++;
  211. } else {
  212. // 反之停止加载
  213. this.majorFinished = true;
  214. }
  215. }
  216. this.loading = false;
  217. });
  218. },
  219. // 资产待办列表刷新
  220. onAssetsRefresh() {
  221. this.assetsListQuery.current = 1;
  222. this.assetsFinished = false;
  223. this.assetsListData = [];
  224. this.assetsTodoList();
  225. },
  226. // 资产待办列表关键字搜索
  227. onAssetsSearch() {
  228. this.assetsListQuery.current = 1;
  229. this.assetsFinished = false;
  230. this.assetsListData = [];
  231. this.assetsTodoList();
  232. },
  233. // 获取资产待办
  234. assetsTodoList() {
  235. this.loading = true;
  236. // 查询待办必须要设置这个参数
  237. this.assetsListQuery.handlerId = 1;
  238. getAssetsTodoList(this.assetsListQuery).then((res) => {
  239. if (res.code == 200) {
  240. if (res.data.records) {
  241. this.assetsListData = this.assetsListData.concat(res.data.records);
  242. }
  243. // 判断是否还有下一页
  244. if (res.data.pages > this.assetsListQuery.current) {
  245. // 服务端返回的总页数大于当前页数, 将当前页数+1
  246. this.assetsListQuery.current++;
  247. } else {
  248. // 反之停止加载
  249. this.assetsFinished = true;
  250. }
  251. }
  252. this.loading = false;
  253. });
  254. },
  255. // 个贷前往待办详情页
  256. toPersonalDetail(row) {
  257. const nodeCode = row.nodeCode;
  258. switch (nodeCode) {
  259. case 'REPORT_OUT_APPLY':
  260. case 'LETTER_OUT_APPLY':
  261. case 'REPORT_OUT_DEPARTMENT_CHECK':
  262. case 'LETTER_OUT_DEPARTMENT_CHECK':
  263. case 'BUSINESS_ARCHIVING':
  264. case 'STATEMENT_IN':
  265. case 'STATEMENT_OUT':
  266. case 'REPORT_IN':
  267. case 'REPORT_OUT':
  268. case 'LETTER_IN':
  269. case 'LETTER_OUT':
  270. showDialog({
  271. message: '当前节点需要业务操作, 请在电脑端处理节点',
  272. }).then(() => {
  273. // on close
  274. });
  275. break;
  276. default:
  277. this.$router.push(`/index/personal/todoDetail?id=${row.businessId}&currentNodeCode=${row.nodeCode}&orderId=${row.orderId}&doWorkflow=${true}&isOnline=${row.isOnline}&handlerName=${row.handlerName}&nodeTime=${row.nodeCreated}`);
  278. break;
  279. }
  280. },
  281. },
  282. };
  283. </script>
  284. <style scoped>
  285. .card {
  286. background-color: white;
  287. border-radius: 12px;
  288. box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.1);
  289. padding: 16px;
  290. margin: 10px;
  291. }
  292. .productionNo {
  293. width: 100%;
  294. font-size: 14px;
  295. }
  296. .projectName {
  297. width: 100%;
  298. /* overflow: hidden;
  299. white-space: nowrap;
  300. text-overflow: ellipsis; */
  301. }
  302. </style>