移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

193 строки
5.3 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="goBack()"
  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>{{stateFormat(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. //金额千分符 会在整数后添加两个0
  75. stateFormat(cellValue) {
  76. if (cellValue) {
  77. return Number(cellValue)
  78. .toFixed(2)
  79. .replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  80. return $1 + ",";
  81. })
  82. .replace(/\.$/, "") + "元";
  83. }
  84. },
  85. goAdd(){
  86. window.location = 'approvalAdd';
  87. },
  88. getList(){
  89. setTimeout(() => {
  90. listTransfer(this.queryParams).then(response => {
  91. console.log(response)
  92. for (var i = 0; i < response.rows.length; i++) {
  93. response.rows[i].auditStatus = this.selectDictLabel(this.auditStatusOptions, response.rows[i].auditStatus);
  94. this.applicationList.push(response.rows[i]);
  95. }
  96. console.log(this.applicationList.length >= response.total)
  97. if(this.applicationList.length >= response.total){
  98. this.finished = true;
  99. return;
  100. }else{
  101. this.loading = false;
  102. this.queryParams.pageNum += 1 ;
  103. }
  104. });
  105. }, 1000);
  106. },
  107. deleteList(id,index){
  108. this.$dialog.confirm({
  109. message: '您确认删除草稿?',
  110. })
  111. .then(() => {
  112. // on confirm
  113. this.applicationList.splice(index,1)
  114. delTransfer(id).then(res => {
  115. if(res.code = 200){
  116. this.$toast.success('删除成功');
  117. }
  118. });
  119. })
  120. .catch(() => {
  121. // on cancel
  122. });
  123. },
  124. onSubmit(id){
  125. this.$dialog.confirm({
  126. message: '您确认提交草稿?',
  127. })
  128. .then(() => {
  129. customSubmit(id).then(res => {
  130. this.$toast.success('提交成功');
  131. setTimeout(function(){
  132. history.go(0)
  133. },2000)
  134. })
  135. })
  136. .catch(() => {
  137. // on cancel
  138. });
  139. },
  140. goBack(){
  141. this.$router.push({path:'/yinnong/workbench'})
  142. },
  143. },
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .app-container {
  148. padding: 0.2rem 3%;
  149. }
  150. /deep/.van-cell__title{
  151. flex: 0.7;
  152. }
  153. /deep/.van-cell__title span{
  154. font-family: Arial;
  155. font-size: 0.4rem;
  156. font-weight: normal;
  157. }
  158. /deep/.van-cell__label span{
  159. color: #1D6FE9;
  160. font-weight: bold;
  161. i{
  162. font-size: 0.2rem;
  163. }
  164. }
  165. /deep/.van-cell__value{
  166. flex: 0.3;
  167. color: #1D6FE9;
  168. font-weight: bold;
  169. }
  170. /deep/.van-swipe-cell{
  171. margin-bottom: 0.2rem;
  172. border-radius: 0.2rem;
  173. overflow: hidden;
  174. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  175. }
  176. /deep/van-ellipsis{
  177. font-weight: bold;
  178. }
  179. .van-row{
  180. height: 100%;
  181. }
  182. .van-col{
  183. height: 100%;
  184. }
  185. .delete-button {
  186. height: 100%;
  187. }
  188. </style>