移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

178 rivejä
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. >
  23. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  24. <van-cell :title="item.payer" :value="item.auditStatus" center :to="{name:'approvalDetail11', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../../../static/images/onlineHome/icon_yn7.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:'approvalModify11', 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. import {cashSubmit, delCash, listCash} from "../../../../api/onlineHome/bankAgriculture/paymentApproval";
  52. export default {
  53. name: "approvalList11",
  54. data() {
  55. return {
  56. applicationList:[],
  57. auditStatusOptions:[],
  58. loading: false,
  59. finished: false,
  60. queryParams:{
  61. pageNum:1,
  62. pageSize:10,
  63. cashType: '11',
  64. }
  65. };
  66. },
  67. created() {
  68. this.getDicts("audit_status").then((response) => {
  69. this.auditStatusOptions = response.data;
  70. });
  71. },
  72. methods: {
  73. goAdd(){
  74. window.location = 'approvalAdd11';
  75. },
  76. getList(){
  77. setTimeout(() => {
  78. listCash(this.queryParams).then(response => {
  79. console.log(response)
  80. for (var i = 0; i < response.rows.length; i++) {
  81. response.rows[i].auditStatus = this.selectDictLabel(this.auditStatusOptions, response.rows[i].auditStatus);
  82. this.applicationList.push(response.rows[i]);
  83. }
  84. console.log(this.applicationList.length >= response.total)
  85. if(this.applicationList.length >= response.total){
  86. this.finished = true;
  87. return;
  88. }else{
  89. this.loading = false;
  90. this.queryParams.pageNum += 1 ;
  91. }
  92. });
  93. }, 1000);
  94. },
  95. deleteList(id,index){
  96. this.$dialog.confirm({
  97. message: '您确认删除草稿?',
  98. })
  99. .then(() => {
  100. // on confirm
  101. this.applicationList.splice(index,1)
  102. delCash(id).then(res => {
  103. if(res.code = 200){
  104. this.$toast.success('删除成功');
  105. }
  106. });
  107. })
  108. .catch(() => {
  109. // on cancel
  110. });
  111. },
  112. onSubmit(id){
  113. this.$dialog.confirm({
  114. message: '您确认提交草稿?',
  115. })
  116. .then(() => {
  117. cashSubmit(id).then(res => {
  118. this.$toast.success('提交成功');
  119. setTimeout(function(){
  120. history.go(0)
  121. },2000)
  122. })
  123. })
  124. .catch(() => {
  125. // on cancel
  126. });
  127. }
  128. },
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .app-container {
  133. padding: 0.2rem 3%;
  134. }
  135. /deep/.van-cell__title{
  136. flex: 0.7;
  137. }
  138. /deep/.van-cell__title span{
  139. font-family: Arial;
  140. font-size: 0.4rem;
  141. font-weight: normal;
  142. }
  143. /deep/.van-cell__label span{
  144. color: #1D6FE9;
  145. font-weight: bold;
  146. i{
  147. font-size: 0.2rem;
  148. }
  149. }
  150. /deep/.van-cell__value{
  151. flex: 0.3;
  152. color: #1D6FE9;
  153. font-weight: bold;
  154. }
  155. /deep/.van-swipe-cell{
  156. margin-bottom: 0.2rem;
  157. border-radius: 0.2rem;
  158. overflow: hidden;
  159. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  160. }
  161. /deep/van-ellipsis{
  162. font-weight: bold;
  163. }
  164. .van-row{
  165. height: 100%;
  166. }
  167. .van-col{
  168. height: 100%;
  169. }
  170. .delete-button {
  171. height: 100%;
  172. }
  173. </style>