loan.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view class="total-page page_env-20 page-box sys-list-background-color">
  3. <view class="task-bg">
  4. <Nav :title="'贷后管理'" :genre="1" :back="false" is_fixed></Nav>
  5. <view>
  6. <Search :placeholder="'贷款人姓名或电话'" @setSearch="setSearch"></Search>
  7. <view class="page-box-bg-fff m-lr20 r-20">
  8. <z-tabs ref="tabs" :list="tabsList"
  9. :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
  10. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  11. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  12. </view>
  13. </view>
  14. <EnScroll ref="scroll" :navHeight="100" is_tabHeight @onRefresh="onRefresh"
  15. @onScrollBottom="onScrollBottom">
  16. <LoanItem :task-list="list" @onCalculate="onCalculate"></LoanItem>
  17. </EnScroll>
  18. <Tab :tab-index="2"></Tab>
  19. <uni-popup ref="popup" type="bottom" @touchmove.stop.prevent="moveHandle">
  20. <view class="page-env-160 sys-background-fff r-20">
  21. <view class="row-justify-sb center p-lr30 p-t30">
  22. <view class="wh-25"></view>
  23. <text class="size-30 sys-weight-600">核算年利率</text>
  24. <image class="wh-25" src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task-details/close.png" mode="aspectFill"
  25. @click="onClose">
  26. </image>
  27. </view>
  28. <view class="p-30 size-28 m-b50">
  29. <view class="">
  30. <text>当前年利率</text><text class="sys-weight-600 color-FF730E m-l10">{{(loanItem.interest_rate*1).toFixed(2)}}%</text>
  31. </view>
  32. <view class="row-justify-sb center r-10 sys-from-background-color p-30 m-t30">
  33. <input class="flex" type="text" placeholder="请输入新年利率" v-model="loanItem.new_rate" />
  34. <text class="text-color-12">%</text>
  35. </view>
  36. </view>
  37. <EnButton text="确认核算" @onSubmit="setComputation"></EnButton>
  38. </view>
  39. </uni-popup>
  40. </view>
  41. <!-- <EnButton :is_both="1" leftText="利率对比" rightText="完善贷后" @onLeftSubmit="onRateCompare" @onSubmit="onPerfectRate">-->
  42. <!-- </EnButton>-->
  43. <uni-popup background-color="#fff" ref="clientPopup" type="bottom" border-radius="10px"
  44. @touchmove.stop.prevent="moveHandle">
  45. <view >
  46. <client-type :client-id="loanItem.client_id" @endTaskSet="onClose"></client-type>
  47. </view>
  48. </uni-popup>
  49. </view>
  50. </template>
  51. <script>
  52. // 任务列表
  53. import LoanItem from "@/common/task/loan-item.vue";
  54. import {
  55. getLoanList
  56. } from "@/api/task";
  57. import tools from "@/service/tools";
  58. import loanItem from "@/common/task/loan-item.vue";
  59. import EnSelect from "@/components/en-utils/en-select/en-select.vue";
  60. import ClientType from "@/pages/loan/components/clientType.vue";
  61. export default {
  62. components: {
  63. ClientType,
  64. EnSelect,
  65. LoanItem
  66. },
  67. data() {
  68. return {
  69. current: 0,
  70. tabsList: [{
  71. name: '全部',
  72. disabled: false
  73. }, {
  74. name: '未完成(0)',
  75. dot_color: 'red',
  76. is_dot: false,
  77. disabled: false
  78. }, {
  79. name: '已完成',
  80. dot_color: 'red',
  81. is_dot: false,
  82. disabled: false
  83. }],
  84. searchText: "",
  85. fromData: {
  86. status: 0,
  87. interest_rate: '', //利率区间 数组或者字符串,连接
  88. residue_num: '', //剩余期数
  89. product_name: '', //产品名称
  90. phone: '', //电话号码
  91. selectStr: '', //电话号码
  92. name: '', //客户名称
  93. productId: '', //产品ID
  94. page: 1,
  95. },
  96. total: 0,
  97. list: [],
  98. loanItem:{
  99. interest_rate:0,
  100. id:0,
  101. new_rate:'',
  102. client_id:'',
  103. }
  104. }
  105. },
  106. watch: {
  107. },
  108. mounted() {
  109. this.getList()
  110. },
  111. methods: {
  112. startList() {
  113. this.fromData.status=this.current
  114. this.total = 999;
  115. this.list = [];
  116. this.page = 1;
  117. this.isAjax = false;
  118. this.getList();
  119. },
  120. setSearch(text){
  121. this.fromData.selectStr=text
  122. this.startList()
  123. },
  124. getList() {
  125. getLoanList(this.fromData).then((res) => {
  126. if (res.code === 1) {
  127. this.list = [...this.list, ...res.data.items]
  128. this.total = res.data.total
  129. this.tabsList[1].name='未完成('+res.data.noNum+')'
  130. this.tabsList[1].is_dot = res.data.noNum > 0;
  131. } else {
  132. tools.error(res.msg)
  133. }
  134. })
  135. },
  136. tabsChange(index) {
  137. this.current = index;
  138. this.startList()
  139. },
  140. // 下拉刷新
  141. onRefresh() {
  142. uni.showLoading({
  143. title: '数据加载中'
  144. })
  145. setTimeout(() => {
  146. uni.showToast({
  147. title: '加载完成',
  148. icon: 'none'
  149. })
  150. this.$refs.scroll.onEndPulling()
  151. }, 1000)
  152. console.log("下拉刷新");
  153. },
  154. // 滚动到底部
  155. onScrollBottom() {
  156. uni.showLoading({
  157. title: '数据加载中'
  158. })
  159. setTimeout(() => {
  160. uni.showToast({
  161. title: '加载完成',
  162. icon: 'none'
  163. })
  164. }, 1000)
  165. console.log("到底部了");
  166. },
  167. setComputation() {
  168. uni.navigateTo({
  169. url: "/pages/loan/module/rate_compare?loanId=" + this.loanItem.id
  170. + '&interestRate=' + this.loanItem.interest_rate
  171. + '&newInterestRate=' + this.loanItem.new_rate
  172. })
  173. },
  174. onPerfectRate() {
  175. uni.navigateTo({
  176. url: "/pages/loan/module/perfect_rate"
  177. })
  178. },
  179. onCalculate(data) {
  180. this.loanItem.id=data.item.id
  181. if(data.type===1){
  182. this.loanItem.interest_rate=data.item.interest_rate
  183. this.$refs.popup.open('bottom')
  184. }else {
  185. this.loanItem.client_id=data.item.client_id
  186. this.$refs.clientPopup.open('bottom')
  187. }
  188. },
  189. onClose() {
  190. this.$refs.popup.close('bottom')
  191. this.$refs.clientPopup.close('bottom')
  192. },
  193. moveHandle() {
  194. return false
  195. }
  196. },
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. // .page-box{
  201. // height: 100vh;
  202. // background-image: url("https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/index/index-bg.png?imageMogr2/quality/20");
  203. // background-repeat: no-repeat;
  204. // background-size: 100% auto;
  205. // display: flex;
  206. // flex-direction: column;
  207. // .top-data{
  208. // flex: 1;
  209. // overflow: hidden;
  210. // .top-row{
  211. // height: 680rpx;
  212. // }
  213. // }
  214. // .bottom-data{
  215. // }
  216. // }
  217. </style>