index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="SUPTaskApproval">
  3. <van-nav-bar class="navBar" title="主管任务审批" left-arrow @click-left="onClickLeft" />
  4. <van-tabs class="myTab" type="card" v-model="tabVal" color="#0057ba" @change="tabChange">
  5. <van-tab title="待审批" name="1"></van-tab>
  6. <van-tab title="已审批" name="2"></van-tab>
  7. </van-tabs>
  8. <div class="content">
  9. <van-list v-model="loading" :finished="finished" finished-text="--已经到底了--">
  10. <div class="newCarList" v-for="(item, index) in list" :key="index">
  11. <van-cell is-link>
  12. <div class="newlist" @click="approveFn(item)">
  13. <div class="title">
  14. <p class="textLeft">{{ item.summaryTaskName }}</p>
  15. </div>
  16. <div class="info">提交人:{{ item.applyUserName }}</div>
  17. <div class="info">部门:{{ item.applyDeptName }}</div>
  18. <div class="info">拜访时间:{{ item.todoTime }}</div>
  19. </div>
  20. </van-cell>
  21. </div>
  22. <van-empty description="" v-if="list.length == 0" />
  23. </van-list>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import { getSummaryApprovalList } from '@/api/SUPTaskApproval.js';
  29. export default {
  30. data() {
  31. return {
  32. tabVal: '1',
  33. list: [],
  34. loading: false,
  35. finished: true,
  36. };
  37. },
  38. created() {
  39. this.tabVal = this.$route.query.tabVal || '1';
  40. this.getApprovalList();
  41. },
  42. methods: {
  43. tabChange(name) {
  44. window.scrollTo(0, 0);
  45. this.list = [];
  46. this.tabVal = name;
  47. this.getApprovalList();
  48. },
  49. onClickLeft() {
  50. this.$router.replace({
  51. path: '/My/index',
  52. });
  53. },
  54. getApprovalList() {
  55. this.toastLoading(0, '加载中...', true);
  56. getSummaryApprovalList({ type: this.tabVal })
  57. .then((res) => {
  58. this.toastLoading().clear();
  59. if (res.code == 200 && res.data) {
  60. this.list = res.data;
  61. }
  62. })
  63. .catch((err) => {
  64. this.toastLoading().clear();
  65. this.$toast(err.msg);
  66. });
  67. },
  68. approveFn(row) {
  69. this.$router.push({
  70. path: '/VisitSummaryDetail',
  71. query: {
  72. userSummaryId: row.userSummaryId,
  73. summaryApprovalId: row.summaryApprovalId,
  74. source: 'SUPTaskApproval',
  75. approvalType: this.tabVal,
  76. },
  77. });
  78. },
  79. },
  80. };
  81. </script>
  82. <style lang="scss">
  83. .SUPTaskApproval {
  84. .myTab {
  85. .van-tabs__nav--card {
  86. margin: 0 !important;
  87. border-left: 0;
  88. border-right: 0;
  89. }
  90. .van-tabs__wrap,
  91. .van-tabs__nav--card {
  92. height: 39px;
  93. }
  94. .van-tab {
  95. line-height: 40px;
  96. }
  97. }
  98. .van-tabs__nav--card .van-tab.van-tab--active {
  99. background-color: #0057ba !important;
  100. }
  101. .content {
  102. .newCarList {
  103. margin: 14px;
  104. border-radius: 8px;
  105. overflow: hidden;
  106. }
  107. .newCarList .van-cell {
  108. border-radius: 6px;
  109. overflow: hidden;
  110. }
  111. .newCarList .newlist .title {
  112. /* line-height: 32px; */
  113. }
  114. .newCarList .van-cell__right-icon {
  115. top: 5px;
  116. }
  117. .newCarList .newlist {
  118. box-sizing: border-box;
  119. }
  120. .newCarList .newlist .title {
  121. font-size: 14px;
  122. font-weight: bold;
  123. color: #333;
  124. padding: 5px 0;
  125. /* line-height: 14px; */
  126. }
  127. .newCarList .newlist .info {
  128. font-size: 14px;
  129. color: #999;
  130. line-height: 26px;
  131. }
  132. .newCarList .newlist .title p {
  133. padding: 0;
  134. margin: 0;
  135. }
  136. .newCarList .newlist .title .textLeft {
  137. display: inline-block;
  138. /* padding-bottom: 10px; */
  139. }
  140. .newCarList .newlist .title .textRight {
  141. float: right;
  142. color: #0057ba;
  143. }
  144. }
  145. }
  146. </style>