移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

218 lignes
6.1 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. >
  23. <van-swipe-cell v-for="(item,index) in applicationList" :key="index">
  24. <van-cell :title="item.payer" :value="item.auditStatus" center :to="{name:'approvalDetail2', query: {id:item.id}}">
  25. <template #icon>
  26. <van-icon name="../../../../../static/images/onlineHome/icon_yn2.png" size="30" color="#539FFD" style="margin-right: 10px;" />
  27. </template>
  28. <template #label>
  29. <p><span><i>¥</i>{{stateFormat(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:'approvalModify2', 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-col>
  44. <van-button v-if="item.auditStatus=='待审'" square text="撤回" type="danger" @click="cancelApply(item)" class="delete-button" />
  45. </van-col>
  46. </van-row>
  47. </template>
  48. </van-swipe-cell>
  49. </van-list>
  50. </div>
  51. </template>
  52. <script>
  53. import { listTransfer , customSubmit , delTransfer , updateTYinnongTransferFoStatus } from "@/api/onlineHome/bankAgriculture/paymentApproval";
  54. export default {
  55. name: "approvalList2",
  56. data() {
  57. return {
  58. applicationList:[],
  59. auditStatusOptions:[],
  60. loading: false,
  61. finished: false,
  62. queryParams:{
  63. pageNum:1,
  64. pageSize:10,
  65. transferType:"2",
  66. },
  67. form:{}
  68. };
  69. },
  70. created() {
  71. this.getDicts("audit_status").then((response) => {
  72. this.auditStatusOptions = response.data;
  73. });
  74. },
  75. methods: {
  76. //金额千分符 会在整数后添加两个0
  77. stateFormat(cellValue) {
  78. if (cellValue) {
  79. return Number(cellValue)
  80. .toFixed(2)
  81. .replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => {
  82. return $1 + ",";
  83. })
  84. .replace(/\.$/, "") + "元";
  85. }
  86. },
  87. goAdd(){
  88. window.location = 'approvalAdd2';
  89. },
  90. getList(){
  91. setTimeout(() => {
  92. listTransfer(this.queryParams).then(response => {
  93. console.log(response)
  94. for (var i = 0; i < response.rows.length; i++) {
  95. response.rows[i].auditStatus = this.selectDictLabel(this.auditStatusOptions, response.rows[i].auditStatus);
  96. this.applicationList.push(response.rows[i]);
  97. }
  98. console.log(this.applicationList.length >= response.total)
  99. if(this.applicationList.length >= response.total){
  100. this.finished = true;
  101. return;
  102. }else{
  103. this.loading = false;
  104. this.queryParams.pageNum += 1 ;
  105. }
  106. });
  107. }, 1000);
  108. },
  109. deleteList(id,index){
  110. this.$dialog.confirm({
  111. message: '您确认删除草稿?',
  112. })
  113. .then(() => {
  114. // on confirm
  115. this.applicationList.splice(index,1)
  116. delTransfer(id).then(res => {
  117. if(res.code = 200){
  118. this.$toast.success('删除成功');
  119. }
  120. });
  121. })
  122. .catch(() => {
  123. // on cancel
  124. });
  125. },
  126. onSubmit(id){
  127. this.$dialog.confirm({
  128. message: '您确认提交草稿?',
  129. })
  130. .then(() => {
  131. customSubmit(id).then(res => {
  132. this.$toast.success('提交成功');
  133. setTimeout(function(){
  134. history.go(0)
  135. },2000)
  136. })
  137. })
  138. .catch(() => {
  139. // on cancel
  140. });
  141. },
  142. goBack(){
  143. this.$router.push({path:'/yinnong/workbench'})
  144. },
  145. cancelApply(row) {
  146. console.log(row)
  147. const instanceId = row.instanceId;
  148. this.form.id = row.id;
  149. this.form.auditStatus = "0";
  150. this.form.applyUserId = "";
  151. this.form.applyUserName = "";
  152. this.form.applyTime = "";
  153. this.form.instanceId = "";
  154. this.form.processKey = "";
  155. let that = this;
  156. this.$dialog.confirm({
  157. message: '您确认撤回待审数据?',
  158. })
  159. .then(function () {
  160. return updateTYinnongTransferFoStatus(that.form).then(response => {
  161. setTimeout(function(){
  162. history.go(0)
  163. },2000)
  164. that.$toast.success('撤回成功');
  165. });
  166. })
  167. },
  168. },
  169. }
  170. </script>
  171. <style scoped lang="scss">
  172. .app-container {
  173. padding: 0.2rem 3%;
  174. }
  175. /deep/.van-cell__title{
  176. flex: 0.7;
  177. }
  178. /deep/.van-cell__title span{
  179. font-family: Arial;
  180. font-size: 0.4rem;
  181. font-weight: normal;
  182. }
  183. /deep/.van-cell__label span{
  184. color: #1D6FE9;
  185. font-weight: bold;
  186. i{
  187. font-size: 0.2rem;
  188. }
  189. }
  190. /deep/.van-cell__value{
  191. flex: 0.3;
  192. color: #1D6FE9;
  193. font-weight: bold;
  194. }
  195. /deep/.van-swipe-cell{
  196. margin-bottom: 0.2rem;
  197. border-radius: 0.2rem;
  198. overflow: hidden;
  199. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  200. }
  201. /deep/van-ellipsis{
  202. font-weight: bold;
  203. }
  204. .van-row{
  205. height: 100%;
  206. }
  207. .van-col{
  208. height: 100%;
  209. }
  210. .delete-button {
  211. height: 100%;
  212. }
  213. </style>