acceptor.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <template>
  2. <view>
  3. <view class="headbgbox flex2">
  4. <view class="searchbox">
  5. <u-icon name="search" bold="true" size="25" color="rgb(246,185,78)"></u-icon>
  6. <input type="text" v-model="keywords" placeholder="请输入关键字搜索" placeholder-style="color:#BBBCBE" @blur="changeSeach"/>
  7. </view>
  8. <view class="screen" @click="show = true">
  9. <text>筛选</text>
  10. <view style="padding-left: 10rpx;">
  11. <u-icon name="arrow-down" color="#1F242A" size="14" bold="true"></u-icon>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="acpcardlist">
  16. <view class="lable " v-for="(item,index) in listall" :key="index">
  17. <view class="radiobox" v-if="editall">
  18. <radio :value="index" :checked="item.checked" color="#D8AB5A" @click="checkBox(item.id)" />
  19. </view>
  20. <view class="acpcard" @click="acpDetail(item.id)">
  21. <view class="allmsg">
  22. <view class="cicle" v-if="item.isDeleted==0"></view>
  23. <view class="cicle" v-if="item.isDeleted==1" style="background-color:#D05C39"></view>
  24. <view class="acpcont">
  25. <view class="acpname">
  26. <text>{{item.name}}</text>
  27. <view class="tag" v-if="item.isDeleted==0">正常</view>
  28. <view class="tagdel" v-if="item.isDeleted==1">删除</view>
  29. </view>
  30. <view class="acpinfo ">
  31. <text class="pt">账号:{{item.bankAccount}}</text>
  32. <text class="pt">服务费率:{{item.serviceRate}}%</text>
  33. <text class="pt">利率:{{item.interest}}%</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="nomore" v-if="listall.length==0">
  41. <text>暂无数据</text>
  42. </view>
  43. <view class="totalmanage " v-if="listall.length>0">
  44. <text style="color:#68625B;font-size: 28rpx;">合计:{{total}}份</text>
  45. <view class=" maboxtitls" @click="editall=true">
  46. <view class="managebox">
  47. <image src="/static/img/manage.png" mode="aspectFit"></image>
  48. </view>
  49. <text style="padding-left: 15rpx;">管理</text>
  50. </view>
  51. </view>
  52. <view class="safebt"></view>
  53. <view class="plusicon" @click="addAcceptor"></view>
  54. <u-popup :show="show" @close="close" @open="open">
  55. <view class="popscreen" style="height: 340rpx;">
  56. <view class="checklist" v-for="(item,index) in ctrstatus" :key="index">
  57. <view class="alllistbtn">
  58. <text class="btntitle" style="">{{item.title}}</text>
  59. <view class="yunbtn">
  60. <view class="btnchoose" v-for="(i,k) in item.list" :key="k" @click="choose(item.title,k)"
  61. :class="[contract_status == k?'active':'btnchoose']">
  62. <text>{{i.name}}</text>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="aszs flex6">
  68. <view class="againbtn" @click="restoreALL"><text>重置</text></view>
  69. <view class="againbtn" style="color: #D8AB5A;border: 1rpx solid #D8AB5A;" @click="makeSureSelect">
  70. <text>确认</text></view>
  71. </view>
  72. </view>
  73. </u-popup>
  74. <!-- 底部删除 -->
  75. <u-popup :show="editall" @close="closeEidt" @open="openEidt" :overlay="false">
  76. <view class="editbox">
  77. <view class="chooseall flex6">
  78. <view class="leftchoose ">
  79. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  80. <text>全选</text>
  81. </view>
  82. <view class="surebtn" @click="selectDown">
  83. 完成
  84. </view>
  85. </view>
  86. <view class="choosebtn">
  87. <view class="delbtn flex1" @click="deleteAcceptor">删除</view>
  88. <view class="restorebtn flex1" @click="backAcceptor">复原</view>
  89. </view>
  90. </view>
  91. </u-popup>
  92. <tabar checked="acceptor"></tabar>
  93. </view>
  94. </template>
  95. <script>
  96. let that
  97. import tabar from "@/componet/tabbar/tabbar.vue"
  98. export default {
  99. components: {
  100. tabar
  101. },
  102. data() {
  103. return {
  104. keywords:'',
  105. editall: false,
  106. quan: false,
  107. show: false,
  108. contract_status: 0,
  109. listall: [],
  110. pageIndex: 1,
  111. total: '',
  112. nomore: false,
  113. statusall: 0,
  114. ctrstatus: [{
  115. title: "承兑人状态",
  116. list: [{
  117. name: "全部",
  118. },
  119. {
  120. name: "正常",
  121. },
  122. {
  123. name: "已删除",
  124. },
  125. ]
  126. }],
  127. }
  128. },
  129. onLoad() {
  130. that = this
  131. // this.init()
  132. },
  133. onShow() {
  134. that.pageIndex = 1
  135. that.nomore = false
  136. that.listall = []
  137. this.init()
  138. },
  139. // 下拉到底部后加载新数据
  140. onReachBottom() {
  141. //判断下一页是否存在数据,不存在将显示暂无数据等提示语
  142. if (this.listall.length >= this.pageIndex * 10) {
  143. this.pageIndex++; //页数加一
  144. this.init(); //回调接口
  145. } else {
  146. this.nomore = true
  147. }
  148. },
  149. methods: {
  150. init() {
  151. uni.showLoading()
  152. uni.$u.http.post('/api/Acceptor/search', {
  153. pageIndex: this.pageIndex,
  154. pageSize: 10,
  155. // startTime:'',
  156. // endTime:'',
  157. name:this.keywords,
  158. status: this.statusall,
  159. // contractNo:''
  160. }, {
  161. custom: {
  162. auth: true
  163. }
  164. }).then((res) => {
  165. uni.hideLoading()
  166. this.total = res.total
  167. let list = res.result
  168. if (list.length > 0) {
  169. list.forEach(item => {
  170. item.checked = false
  171. this.listall.push(item)
  172. })
  173. if (list.length < 10) {
  174. that.nomore = true
  175. }
  176. }
  177. }).catch((err) => {
  178. uni.hideLoading()
  179. console.log(err)
  180. })
  181. },
  182. close() {
  183. this.show = false
  184. },
  185. open() {
  186. },
  187. changeSeach(e){
  188. this.keywords=e.detail.value
  189. that.pageIndex = 1
  190. that.nomore = false
  191. that.listall = []
  192. this.init()
  193. },
  194. makeSureSelect() {
  195. that.pageIndex = 1
  196. that.nomore = false
  197. that.listall = []
  198. this.init()
  199. this.close()
  200. },
  201. restoreALL() {
  202. this.contract_status = 0
  203. },
  204. choose(title, k) {
  205. if (title == "承兑人状态") {
  206. this.contract_status = k
  207. if (k == 2) {
  208. this.statusall = 4
  209. } else if (k == 1) {
  210. this.statusall = 5
  211. } else if (k == 0) {
  212. this.statusall = 0
  213. }
  214. }
  215. },
  216. selectDown() {
  217. this.editall = false
  218. this.quan = false
  219. let list = this.listall
  220. list.forEach(item => {
  221. item.checked = false
  222. })
  223. },
  224. checkBox(id) {
  225. let list = this.listall
  226. list.forEach(item => {
  227. if (item.id == id) {
  228. item.checked = !item.checked
  229. }
  230. })
  231. this.listall = JSON.parse(JSON.stringify(list))
  232. },
  233. allSelect() {
  234. let list = this.listall
  235. if (this.quan) {
  236. list.forEach(item => {
  237. item.checked = true
  238. })
  239. } else {
  240. list.forEach(item => {
  241. item.checked = false
  242. })
  243. }
  244. this.listall = JSON.parse(JSON.stringify(list))
  245. },
  246. makeSureAll() {
  247. this.quan = !this.quan
  248. this.allSelect()
  249. },
  250. closeEidt() {
  251. this.editall = false
  252. },
  253. openEidt() {
  254. this.editall = true
  255. },
  256. acpDetail(id) {
  257. uni.navigateTo({
  258. url: "/pages/alldeatil/acptdetail?id=" + id
  259. })
  260. },
  261. addAcceptor() {
  262. uni.navigateTo({
  263. url: '/pages/alldeatil/addnewacpt'
  264. })
  265. },
  266. deleteAcceptor() {
  267. let ids = []
  268. that.listall.forEach(item => {
  269. if (item.checked) {
  270. ids.push(item.id)
  271. }
  272. })
  273. if (ids.length == 0) {
  274. that.$toast("请选择合同")
  275. return
  276. }
  277. uni.showModal({
  278. title: '提示',
  279. content: "是否批量删除?",
  280. success: function(res) {
  281. if (res.confirm) {
  282. uni.showLoading()
  283. uni.$u.http.post('/api/Acceptor/manager', {
  284. ids: ids,
  285. operateType: 1
  286. }, {
  287. custom: {
  288. auth: true
  289. }
  290. }).then((res) => {
  291. uni.hideLoading()
  292. that.editall = false
  293. that.quan = false
  294. that.$toast("操作成功")
  295. setTimeout(() => {
  296. that.pageIndex = 1
  297. that.nomore = false
  298. that.listall = []
  299. that.init()
  300. }, 500)
  301. }).catch((err) => {
  302. uni.hideLoading()
  303. that.$toast(err.msg)
  304. })
  305. } else if (res.cancel) {
  306. }
  307. }
  308. })
  309. },
  310. backAcceptor() {
  311. let ids = []
  312. that.listall.forEach(item => {
  313. if (item.checked) {
  314. ids.push(item.id)
  315. }
  316. })
  317. if (ids.length == 0) {
  318. that.$toast("请选择合同")
  319. return
  320. }
  321. uni.showModal({
  322. title: '提示',
  323. content: "是否批量复原?",
  324. success: function(res) {
  325. if (res.confirm) {
  326. uni.showLoading()
  327. uni.$u.http.post('/api/Acceptor/manager', {
  328. ids: ids,
  329. operateType: 2
  330. }, {
  331. custom: {
  332. auth: true
  333. }
  334. }).then((res) => {
  335. uni.hideLoading()
  336. that.editall = false
  337. that.quan = false
  338. that.$toast("操作成功")
  339. setTimeout(() => {
  340. that.pageIndex = 1
  341. that.nomore = false
  342. that.listall = []
  343. that.init()
  344. }, 500)
  345. }).catch((err) => {
  346. uni.hideLoading()
  347. that.$toast(err.msg)
  348. })
  349. } else if (res.cancel) {
  350. }
  351. }
  352. })
  353. }
  354. }
  355. }
  356. </script>
  357. <style lang="scss">
  358. page {
  359. background-color: #F6F6F6 !important;
  360. }
  361. .headbgbox {
  362. background-color: #fff;
  363. padding: 23rpx 31rpx;
  364. box-sizing: border-box;
  365. position: fixed;
  366. top: 0;
  367. z-index: 999;
  368. width: 100%;
  369. .screen {
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. padding-left: 30rpx;
  374. }
  375. }
  376. .searchbox {
  377. padding-left: 30rpx;
  378. box-sizing: border-box;
  379. background-color: #ECECEC;
  380. border-radius: 38rpx;
  381. // width: 688rpx;
  382. flex: 1;
  383. height: 75rpx;
  384. margin: 0 auto;
  385. display: flex;
  386. align-items: center;
  387. justify-content: center;
  388. }
  389. .acpcardlist {
  390. margin-top: 140rpx;
  391. .acpcard {
  392. flex: 1;
  393. // width: 690rpx;
  394. height: 333rpx;
  395. margin: 0 30rpx;
  396. // margin-top: 20rpx;
  397. background-color: #fff;
  398. border-radius: 20rpx;
  399. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  400. .allmsg {
  401. display: flex;
  402. padding: 40rpx 30rpx;
  403. box-sizing: border-box;
  404. width: 100%;
  405. .cicle {
  406. width: 28rpx;
  407. height: 28rpx;
  408. border-radius: 50%;
  409. background-color: #D8AB5A;
  410. margin-top: 8rpx;
  411. }
  412. .acpcont {
  413. margin-left: 20rpx;
  414. width: 100%;
  415. .acpname {
  416. box-sizing: border-box;
  417. display: flex;
  418. align-items: center;
  419. padding-bottom: 30rpx;
  420. flex-grow: 1;
  421. width: 100%;
  422. // width: 572rpx;
  423. font-size: 42rpx;
  424. font-weight: 600;
  425. .tagdel {
  426. margin-left: 10rpx;
  427. width: 80rpx;
  428. height: 36rpx;
  429. border-radius: 10rpx;
  430. background-color: rgb(241, 206, 195);
  431. font-size: 24rpx;
  432. font-weight: 400;
  433. color: rgb(213, 109, 77);
  434. line-height: 36rpx;
  435. text-align: center;
  436. }
  437. .tag {
  438. margin-left: 10rpx;
  439. width: 80rpx;
  440. height: 36rpx;
  441. border-radius: 10rpx;
  442. background-color: rgb(232, 222, 203);
  443. font-size: 24rpx;
  444. font-weight: 400;
  445. color: #D8AB5A;
  446. line-height: 36rpx;
  447. text-align: center;
  448. }
  449. }
  450. }
  451. .acpinfo {
  452. border-top: 1rpx solid #E8E8E8;
  453. display: flex;
  454. flex: 1;
  455. flex-direction: column;
  456. font-size: 28rpx;
  457. color: #BEBDBB;
  458. justify-content: space-between;
  459. box-sizing: border-box;
  460. .pt {
  461. padding-top: 20rpx;
  462. }
  463. }
  464. }
  465. }
  466. }
  467. .totalmanage {
  468. margin-top: 90rpx;
  469. margin-bottom: 100rpx;
  470. // position: fixed;
  471. bottom: 0;
  472. display: flex;
  473. justify-content: space-between;
  474. align-items: center;
  475. width: 100%;
  476. padding: 0 30rpx;
  477. box-sizing: border-box;
  478. .managebox {
  479. width: 23.8rpx;
  480. height: 29.7rpx;
  481. image {
  482. width: 100%;
  483. height: 100%;
  484. }
  485. }
  486. .maboxtitls {
  487. width: 160rpx;
  488. height: 60rpx;
  489. display: flex;
  490. align-items: center;
  491. justify-content: center;
  492. border-radius: 30rpx;
  493. background-color: #D9D9D9;
  494. // line-height: 60rpx;
  495. font-size: 28rpx;
  496. box-sizing: border-box;
  497. // align-items: center;
  498. }
  499. }
  500. .plusicon {
  501. position: fixed;
  502. left: 0;
  503. right: 0;
  504. margin: 0 auto;
  505. bottom: 110rpx;
  506. width: 150rpx;
  507. height: 150rpx;
  508. background: url("@/static/img/plusicon.png") no-repeat;
  509. background-size: 150rpx 150rpx;
  510. }
  511. </style>