loan.vue 6.0 KB

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