loan.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. setSearch(text){
  113. this.fromData.selectStr=text
  114. this.startList()
  115. },
  116. getList() {
  117. getLoanList(this.fromData).then((res) => {
  118. if (res.code === 1) {
  119. this.list = [...this.list, ...res.data.items]
  120. this.total = res.data.total
  121. this.tabsList[1].name='未完成('+res.data.noNum+')'
  122. this.tabsList[1].is_dot = res.data.noNum > 0;
  123. } else {
  124. tools.error(res.msg)
  125. }
  126. })
  127. },
  128. tabsChange(index) {
  129. this.current = index;
  130. },
  131. // 下拉刷新
  132. onRefresh() {
  133. uni.showLoading({
  134. title: '数据加载中'
  135. })
  136. setTimeout(() => {
  137. uni.showToast({
  138. title: '加载完成',
  139. icon: 'none'
  140. })
  141. this.$refs.scroll.onEndPulling()
  142. }, 1000)
  143. console.log("下拉刷新");
  144. },
  145. // 滚动到底部
  146. onScrollBottom() {
  147. uni.showLoading({
  148. title: '数据加载中'
  149. })
  150. setTimeout(() => {
  151. uni.showToast({
  152. title: '加载完成',
  153. icon: 'none'
  154. })
  155. }, 1000)
  156. console.log("到底部了");
  157. },
  158. setComputation() {
  159. uni.navigateTo({
  160. url: "/pages/loan/module/rate_compare?loanId=" + this.loanItem.id
  161. + '&interestRate=' + this.loanItem.interest_rate
  162. + '&newInterestRate=' + this.loanItem.new_rate
  163. })
  164. },
  165. onPerfectRate() {
  166. uni.navigateTo({
  167. url: "/pages/loan/module/perfect_rate"
  168. })
  169. },
  170. onCalculate(data) {
  171. this.loanItem.id=data.item.id
  172. if(data.type===1){
  173. this.loanItem.interest_rate=data.item.interest_rate
  174. this.$refs.popup.open('bottom')
  175. }else {
  176. this.loanItem.client_id=data.item.client_id
  177. this.$refs.clientPopup.open('bottom')
  178. }
  179. },
  180. onClose() {
  181. this.$refs.popup.close('bottom')
  182. this.$refs.clientPopup.close('bottom')
  183. },
  184. moveHandle() {
  185. return false
  186. }
  187. },
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. // .page-box{
  192. // height: 100vh;
  193. // background-image: url("https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/index/index-bg.png?imageMogr2/quality/20");
  194. // background-repeat: no-repeat;
  195. // background-size: 100% auto;
  196. // display: flex;
  197. // flex-direction: column;
  198. // .top-data{
  199. // flex: 1;
  200. // overflow: hidden;
  201. // .top-row{
  202. // height: 680rpx;
  203. // }
  204. // }
  205. // .bottom-data{
  206. // }
  207. // }
  208. </style>