移动端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

approvalList5.vue 4.8 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 :title="item.payer" :value="item.auditStatus" center :to="{name:'approvalDetail5', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../../../static/images/onlineHome/icon_yn5.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p><span><i>¥</i>{{item.expenditureAmount}}</span><i style="margin-right: 1rem;"></i>{{item.applyDate}}</p>
  30. </template>
  31. </van-cell>
  32. <template #right>
  33. <van-row>
  34. <van-col>
  35. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" square text="修改" type="info" :to="{name:'approvalModify5', query: {id:item.id}}" class="delete-button" />
  36. </van-col>
  37. <van-col>
  38. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" color="#FFA63E" square text="提交" type="info" @click="onSubmit(item.id)" class="delete-button" />
  39. </van-col>
  40. <van-col>
  41. <van-button v-if="item.auditStatus=='草稿'||item.auditStatus=='驳回'" square text="删除" type="danger" @click="deleteList(item.id,index)" class="delete-button" />
  42. </van-col>
  43. </van-row>
  44. </template>
  45. </van-swipe-cell>
  46. </van-list>
  47. </div>
  48. </template>
  49. <script>
  50. import { listTransfer , customSubmit , delTransfer } from "@/api/onlineHome/bankAgriculture/paymentApproval";
  51. export default {
  52. name: "approvalList5",
  53. data() {
  54. return {
  55. applicationList:[],
  56. auditStatusOptions:[],
  57. loading: false,
  58. finished: false,
  59. queryParams:{
  60. pageNum:1,
  61. pageSize:10,
  62. transferType:"5",
  63. }
  64. };
  65. },
  66. created() {
  67. this.getDicts("audit_status").then((response) => {
  68. this.auditStatusOptions = response.data;
  69. });
  70. },
  71. methods: {
  72. goAdd(){
  73. window.location = 'approvalAdd5';
  74. },
  75. getList(){
  76. setTimeout(() => {
  77. listTransfer(this.queryParams).then(response => {
  78. console.log(response)
  79. for (var i = 0; i < response.rows.length; i++) {
  80. response.rows[i].auditStatus = this.selectDictLabel(this.auditStatusOptions, response.rows[i].auditStatus);
  81. this.applicationList.push(response.rows[i]);
  82. }
  83. console.log(this.applicationList.length >= response.total)
  84. if(this.applicationList.length >= response.total){
  85. this.finished = true;
  86. return;
  87. }else{
  88. this.loading = false;
  89. this.queryParams.pageNum += 1 ;
  90. }
  91. });
  92. }, 1000);
  93. },
  94. deleteList(id,index){
  95. this.$dialog.confirm({
  96. message: '您确认删除草稿?',
  97. })
  98. .then(() => {
  99. // on confirm
  100. this.applicationList.splice(index,1)
  101. delTransfer(id).then(res => {
  102. if(res.code = 200){
  103. this.$toast.success('删除成功');
  104. }
  105. });
  106. })
  107. .catch(() => {
  108. // on cancel
  109. });
  110. },
  111. onSubmit(id){
  112. this.$dialog.confirm({
  113. message: '您确认提交草稿?',
  114. })
  115. .then(() => {
  116. customSubmit(id).then(res => {
  117. this.$toast.success('提交成功');
  118. setTimeout(function(){
  119. history.go(0)
  120. },2000)
  121. })
  122. })
  123. .catch(() => {
  124. // on cancel
  125. });
  126. }
  127. },
  128. }
  129. </script>
  130. <style scoped lang="scss">
  131. .app-container {
  132. padding: 0.2rem 3%;
  133. }
  134. /deep/.van-cell__title{
  135. flex: 0.7;
  136. }
  137. /deep/.van-cell__title span{
  138. font-family: Arial;
  139. font-size: 0.4rem;
  140. font-weight: normal;
  141. }
  142. /deep/.van-cell__label span{
  143. color: #1D6FE9;
  144. font-weight: bold;
  145. i{
  146. font-size: 0.2rem;
  147. }
  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>