移动端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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