移动端
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

178 rader
4.6 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. @click-right="goAdd()"
  9. >
  10. <template #title>
  11. <p style="font-weight: bold;">银农收款账户列表</p>
  12. </template>
  13. <template #right>
  14. <van-icon name="add" size="18"/>
  15. </template>
  16. </van-nav-bar>
  17. <van-list
  18. v-model="loading"
  19. :finished="finished"
  20. finished-text="没有更多了"
  21. @load="getList"
  22. >
  23. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  24. <van-cell center :to="{name:'collectionDetail', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../../../static/images/onlineHome/icon_yn9.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p>{{item.payeeAccount}}</p>
  30. </template>
  31. <template #title>
  32. <p class="van-ellipsis">{{item.payee}}</p>
  33. </template>
  34. <template #default>
  35. <p>{{item.accountType}}</p>
  36. <p style="font-size: 12px;font-weight: normal;color: #878787;">{{item.bankType}}</p>
  37. </template>
  38. </van-cell>
  39. <template #right>
  40. <van-row>
  41. <van-col>
  42. <van-button square text="修改" type="info" :to="{name:'collectionModify', query: {id:item.id}}" class="delete-button" />
  43. </van-col>
  44. <van-col>
  45. <van-button square text="删除" type="danger" @click="deleteList(item.id,index)" class="delete-button" />
  46. </van-col>
  47. </van-row>
  48. </template>
  49. </van-swipe-cell>
  50. </van-list>
  51. </div>
  52. </template>
  53. <script>
  54. import { listPayee , delPayee } from "@/api/onlineHome/bankAgriculture/collectionAccount";
  55. export default {
  56. name: "collectionList",
  57. data() {
  58. return {
  59. applicationList:[],
  60. loading: false,
  61. finished: false,
  62. queryParams:{
  63. pageNum:1,
  64. pageSize:10,
  65. }
  66. };
  67. },
  68. created() {
  69. this.getDicts("bank_type").then(response => {
  70. this.bankTypeOptions = response.data;
  71. });
  72. this.getDicts("sys_normal_disable").then(response => {
  73. this.statusOptions = response.data;
  74. });
  75. this.getDicts("bank_account_type").then(response => {
  76. this.accountTypeOptions = response.data;
  77. });
  78. this.getDicts("payee_type").then(response => {
  79. this.payeeTypeOptions = response.data;
  80. });
  81. },
  82. methods: {
  83. goAdd(){
  84. window.location = 'collectionAdd';
  85. },
  86. getList(){
  87. setTimeout(() => {
  88. listPayee(this.queryParams).then(response => {
  89. console.log(response)
  90. for (var i = 0; i < response.rows.length; i++) {
  91. response.rows[i].accountType = this.selectDictLabel(this.accountTypeOptions, response.rows[i].accountType);
  92. response.rows[i].bankType = this.selectDictLabel(this.bankTypeOptions, response.rows[i].bankType);
  93. this.applicationList.push(response.rows[i]);
  94. }
  95. if(this.applicationList.length >= response.total){
  96. this.finished = true;
  97. return;
  98. }else{
  99. this.loading = false;
  100. this.queryParams.pageNum += 1 ;
  101. }
  102. });
  103. }, 1000);
  104. },
  105. deleteList(id,index){
  106. this.$dialog.confirm({
  107. message: '您确认删除收款账户?',
  108. })
  109. .then(() => {
  110. // on confirm
  111. this.applicationList.splice(index,1)
  112. delPayee(id).then(res => {
  113. if(res.code = 200){
  114. this.$toast.success('删除成功');
  115. }
  116. });
  117. })
  118. .catch(() => {
  119. // on cancel
  120. });
  121. }
  122. },
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .app-container {
  127. padding: 0.2rem 3%;
  128. }
  129. /deep/.van-cell__title{
  130. flex: 0.7;
  131. width: 70%;
  132. }
  133. /deep/.van-cell__title span{
  134. font-family: Arial;
  135. font-size: 0.4rem;
  136. font-weight: normal;
  137. }
  138. /deep/.van-cell__label span{
  139. color: #1D6FE9;
  140. font-weight: bold;
  141. i{
  142. font-size: 0.2rem;
  143. }
  144. }
  145. .van-cell__label{
  146. color: #333333;
  147. font-size: 14Px;
  148. }
  149. /deep/.van-cell__value{
  150. flex: 0.3;
  151. color: #1D6FE9;
  152. font-weight: bold;
  153. }
  154. /deep/.van-swipe-cell{
  155. margin-bottom: 0.2rem;
  156. border-radius: 0.2rem;
  157. overflow: hidden;
  158. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  159. }
  160. /deep/van-ellipsis{
  161. font-weight: bold;
  162. }
  163. .van-row{
  164. height: 100%;
  165. }
  166. .van-col{
  167. height: 100%;
  168. }
  169. .delete-button {
  170. height: 100%;
  171. }
  172. </style>