acceptorbind.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  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-if="state==0" v-model="keywords" placeholder="请输入供应商名称" placeholder-style="color:#BBBCBE" @blur="changeSeach"/>
  7. <input type="text" v-if="state==1" v-model="keywords" placeholder="请输入承兑人名称" placeholder-style="color:#BBBCBE" @blur="changeSeach2"/>
  8. </view>
  9. <view class="screen" @click="show = true">
  10. <text>筛选</text>
  11. <view style="padding-left: 10rpx;">
  12. <u-icon name="arrow-down" color="#1F242A" size="14" bold="true"></u-icon>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="acpcardlist">
  17. <view class="lable " v-for="(item,index) in listall" :key="index">
  18. <view class="radiobox" v-if="editall">
  19. <radio :value="index" :checked="item.checked" color="#D8AB5A" @click="checkBox(item.id)" />
  20. </view>
  21. <view class="acpcard" v-if="state==1" style="height: 330rpx;" >
  22. <view class="allmsg">
  23. <view class="acpcont">
  24. <view class="acpname">
  25. <text>{{item.acceptorName}}</text>
  26. <view class="tag" v-if="item.statusText=='待审核'">待审核</view>
  27. <view class="tagdel" v-if="item.statusText=='失败'">失败</view>
  28. <view class="tagdel2" v-if="item.statusText=='失败'" @click="replayAcceptor(item.acceptorId)">重新提交</view>
  29. <view class="tagpass" v-if="item.statusText=='成功'">成功</view>
  30. </view>
  31. <view class="acpinfo " v-if="item.statusText=='失败'">
  32. <!-- <text class="pt">账号:{{item.bankAccount}}</text> -->
  33. <text class="pt">服务费率:%</text>
  34. <text class="pt">利率:%</text>
  35. </view>
  36. <view class="acpinfo " v-if="item.statusText=='成功'">
  37. <!-- <text class="pt">账号:{{item.bankAccount}}</text> -->
  38. <text class="pt">服务费率:{{item.serviceRate}}%</text>
  39. <text class="pt">利率:{{item.interest}}%</text>
  40. <text class="pt" @click.stop="addpdf(item.templateServiceContractList)">点击获取服务合同信息</text>
  41. </view>
  42. <view class="acpinfo " v-if="item.statusText=='待审核'">
  43. <!-- <text class="pt">账号:{{item.bankAccount}}</text> -->
  44. <text class="pt">服务费率:%</text>
  45. <text class="pt">利率:%</text>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="acpcard" v-if="state==0" @click='acpDetail(item.id)'>
  51. <view class="allmsg">
  52. <view class="acpcont">
  53. <view class="acpname">
  54. <text>{{item.acceptorName}}</text>
  55. <view class="tag" v-if="item.statusText=='待审核'">待审核</view>
  56. <view class="tagdel" v-if="item.statusText=='失败'">失败</view>
  57. <view class="tagpass" v-if="item.statusText=='成功'">成功</view>
  58. </view>
  59. <view class="acpinfo ">
  60. <text class="pt">供应商名称:{{item.supplierName}}</text>
  61. <text class="pt">服务费率:{{item.serviceRate}}%</text>
  62. <text class="pt">利率:{{item.interest}}%</text>
  63. <text class="pt" @click.stop="addpdf(item.templateServiceContractList)">点击获取服务合同信息</text>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="nomore" v-if="listall.length==0">
  71. <text>暂无数据</text>
  72. </view>
  73. <view class="totalmanage " v-if="listall.length>0">
  74. <text style="color:#68625B;font-size: 28rpx;">合计:{{total}}份</text>
  75. <view class=" maboxtitls" @click="editall=true">
  76. <view class="managebox">
  77. <image src="/static/img/manage.png" mode="aspectFit"></image>
  78. </view>
  79. <text style="padding-left: 15rpx;">管理</text>
  80. </view>
  81. </view>
  82. <view class="safebt"></view>
  83. <view class="plusicon" v-if="state==1" @click="addAcceptor"></view>
  84. <!-- 筛选功能 -->
  85. <u-popup :show="show" @close="close" @open="open">
  86. <view class="popscreen" style="height: 340rpx;">
  87. <view class="checklist" v-for="(item,index) in ctrstatus" :key="index">
  88. <view class="alllistbtn">
  89. <text class="btntitle" style="">{{item.title}}</text>
  90. <view class="yunbtn">
  91. <view class="btnchoose" v-for="(i,k) in item.list" :key="k" @click="choose(item.title,k)"
  92. :class="[contract_status == k?'active':'btnchoose']">
  93. <text>{{i.name}}</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <view class="aszs flex6">
  99. <view class="againbtn" @click="restoreALL"><text>重置</text></view>
  100. <view class="againbtn" style="color: #D8AB5A;border: 1rpx solid #D8AB5A;" @click="makeSureSelect">
  101. <text>确认</text></view>
  102. </view>
  103. </view>
  104. </u-popup>
  105. <!-- 底部删除 -->
  106. <u-popup :show="editall" @close="closeEidt" @open="openEidt" :overlay="false">
  107. <view class="editbox">
  108. <view class="chooseall flex6">
  109. <view class="leftchoose ">
  110. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  111. <text>全选</text>
  112. </view>
  113. <view class="surebtn" @click="selectDown">
  114. 完成
  115. </view>
  116. </view>
  117. <view class="choosebtn delet-btn">
  118. <view class="delbtn flex1" @click="deleteAcceptor">删除</view>
  119. <!-- <view class="restorebtn flex1" @click="backAcceptor">复原</view> -->
  120. </view>
  121. <view class="choosebtn" v-if="state==0">
  122. <view class="delbtn flex1" @click="examineBillFail()">审核失败</view>
  123. <view class="restorebtn flex1" @click="examineBillSuccess()">审核成功</view>
  124. </view>
  125. </view>
  126. </u-popup>
  127. </view>
  128. </template>
  129. <script>
  130. let that
  131. export default {
  132. data() {
  133. return {
  134. state:'',//业务员为0,供应商为1
  135. supplierId:'',//供应商id
  136. status:'',//承兑人状态
  137. acceptorName:'',//承兑人名称
  138. supplierName:'',//供应商名称
  139. ids:[],//删除承兑人id数组
  140. keywords:'',
  141. editall: false,
  142. quan: false,
  143. show: false,
  144. contract_status: 0,
  145. listall: [],//页面渲染数据
  146. pageIndex: 1,
  147. total: '',
  148. nomore: false,
  149. statusall: 0,
  150. ctrstatus: [{
  151. title: "承兑人状态",
  152. list: [{
  153. name: "全部",
  154. },
  155. {
  156. name: "待审核",
  157. },
  158. {
  159. name: "成功",
  160. },
  161. {
  162. name:'失败'
  163. }
  164. ]
  165. }],
  166. }
  167. },
  168. onLoad(o) {
  169. that = this
  170. this.state = this.$store.state.admin
  171. console.log('state',this.state);
  172. console.log('o',o);
  173. if(o.id){
  174. this.supplierId = o.id
  175. }
  176. },
  177. onShow() {
  178. that.pageIndex = 1
  179. that.nomore = false
  180. that.listall = []
  181. this.init()
  182. },
  183. // 下拉到底部后加载新数据
  184. // onReachBottom() {
  185. // //判断下一页是否存在数据,不存在将显示暂无数据等提示语
  186. // if (this.listall.length >= this.pageIndex * 10) {
  187. // this.pageIndex++; //页数加一
  188. // this.init(); //回调接口
  189. // } else {
  190. // this.nomore = true
  191. // }
  192. // },
  193. methods: {
  194. init() {
  195. uni.showLoading()
  196. uni.$u.http.get(`/api/SupplierAcceptor?pageSize=-1&supplierName=${this.supplierName}&status=${this.status}&acceptorName=${this.keywords}`, {
  197. supplierId:this.supplierId||'',
  198. }, {
  199. custom: {
  200. auth: true
  201. }
  202. }).then((res) => {
  203. uni.hideLoading()
  204. this.total = res.total
  205. this.listall=res.result
  206. // let list = res.result
  207. // if (list.length > 0) {
  208. // list.forEach(item => {
  209. // item.checked = false
  210. // this.listall.push(item)
  211. // })
  212. // if (list.length < 10) {
  213. // that.nomore = true
  214. // }
  215. // }
  216. }).catch((err) => {
  217. uni.hideLoading()
  218. console.log(err)
  219. })
  220. },
  221. //关闭筛选弹框
  222. close() {
  223. this.show = false
  224. },
  225. open() {
  226. },
  227. //搜索功能
  228. changeSeach(){
  229. this.supplierName=this.keywords
  230. that.pageIndex = 1
  231. that.nomore = false
  232. // that.listall = []
  233. this.init()
  234. },
  235. changeSeach2(){
  236. this.acceptorName=this.keywords
  237. that.pageIndex = 1
  238. that.nomore = false
  239. // that.listall = []
  240. this.init()
  241. },
  242. //承兑人状态查询
  243. makeSureSelect() {
  244. that.pageIndex = 1
  245. that.nomore = false
  246. that.listall = []
  247. this.init()
  248. this.close()
  249. },
  250. //承兑人状态查询
  251. choose(title, k) {
  252. if (title == "承兑人状态") {
  253. this.contract_status = k
  254. if (k == 1) {
  255. this.status = 0
  256. } else if (k == 2) {
  257. this.status = 1
  258. } else if (k == 0) {
  259. this.status = ''
  260. }else if(k==3){
  261. this.status=2
  262. }
  263. }
  264. },
  265. //筛选重置
  266. restoreALL() {
  267. this.contract_status = 0
  268. this.status = ''
  269. },
  270. /*底部管理弹框 */
  271. selectDown() {
  272. this.editall = false
  273. this.quan = false
  274. let list = this.listall
  275. list.forEach(item => {
  276. item.checked = false
  277. })
  278. },
  279. /* 部分选择 */
  280. checkBox(id) {
  281. let list = this.listall
  282. list.forEach(item => {
  283. if (item.id == id) {
  284. item.checked = !item.checked
  285. }
  286. })
  287. this.listall = JSON.parse(JSON.stringify(list))
  288. },
  289. /* 全选 */
  290. allSelect() {
  291. let list = this.listall
  292. if (this.quan) {
  293. list.forEach(item => {
  294. item.checked = true
  295. })
  296. } else {
  297. list.forEach(item => {
  298. item.checked = false
  299. })
  300. }
  301. this.listall = JSON.parse(JSON.stringify(list))
  302. console.log(this.listall);
  303. },
  304. makeSureAll() {
  305. this.quan = !this.quan
  306. this.allSelect()
  307. },
  308. closeEidt() {
  309. this.editall = false
  310. },
  311. openEidt() {
  312. this.editall = true
  313. },
  314. //承兑人绑定详情
  315. acpDetail(id) {
  316. uni.navigateTo({
  317. url: "/pages/alldeatil/acptsipplierdetail?id=" + id
  318. })
  319. },
  320. addAcceptor() {
  321. uni.navigateTo({
  322. url: '/pages/alldeatil/addacceptbind?id='+this.supplierId
  323. })
  324. },
  325. //删除承兑人
  326. deleteAcceptor() {
  327. let ids = []
  328. that.listall.forEach(item => {
  329. if (item.checked) {
  330. ids.push(item.id)
  331. }
  332. })
  333. console.log(ids);
  334. if (ids.length == 0) {
  335. that.$toast("请选择承兑人")
  336. return
  337. }
  338. uni.showModal({
  339. title: '提示',
  340. content: "是否批量删除?",
  341. success: function(res) {
  342. if (res.confirm) {
  343. uni.showLoading()
  344. uni.$u.http.post('/api/SupplierAcceptor/delete', [...ids], {
  345. custom: {
  346. auth: true
  347. }
  348. }).then((res) => {
  349. uni.hideLoading()
  350. that.editall = false
  351. that.quan = false
  352. that.$toast("操作成功")
  353. setTimeout(() => {
  354. that.pageIndex = 1
  355. that.nomore = false
  356. that.listall = []
  357. that.init()
  358. }, 500)
  359. }).catch((err) => {
  360. uni.hideLoading()
  361. that.$toast(err.msg)
  362. })
  363. } else if (res.cancel) {
  364. }
  365. }
  366. })
  367. },
  368. //审核失败后重新提交
  369. replayAcceptor(id){
  370. console.log('id',id);
  371. let that = this
  372. this.acceptorIds = [id]
  373. uni.showLoading()
  374. uni.$u.http.post('/api/SupplierAcceptor',{
  375. supplierId:that.supplierId,
  376. acceptorIds:that.acceptorIds
  377. }).then((res) => {
  378. uni.hideLoading()
  379. that.$toast("提交成功")
  380. setTimeout(()=>{
  381. that.init()
  382. },1000)
  383. })
  384. },
  385. //批量审核失败
  386. examineBillFail() {
  387. let ids = []
  388. let that = this
  389. this.listall.forEach(item => {
  390. if (item.checked) {
  391. ids.push(item.id)
  392. }
  393. })
  394. console.log(ids);
  395. if (ids.length == 0) {
  396. that.$toast("请选择承兑人")
  397. return
  398. }
  399. uni.showModal({
  400. title: '提示',
  401. content: '是否审核失败?',
  402. success: function(res) {
  403. if (res.confirm) {
  404. uni.showLoading()
  405. uni.$u.http.post('/api/SupplierAcceptor/update', {
  406. status: 2,
  407. ids:[...ids]
  408. }, {
  409. custom: {
  410. auth: true
  411. }
  412. }).then((res) => {
  413. uni.hideLoading()
  414. that.$toast("操作成功")
  415. that.init()
  416. }).catch((err) => {
  417. uni.hideLoading()
  418. that.$toast(err.msg)
  419. })
  420. } else if (res.cancel) {
  421. console.log('用户点击取消');
  422. }
  423. }
  424. })
  425. },
  426. //批量审核成功
  427. examineBillSuccess() {
  428. let ids = []
  429. let that = this
  430. this.listall.forEach(item => {
  431. if (item.checked) {
  432. ids.push(item.id)
  433. }
  434. })
  435. console.log(ids);
  436. if (ids.length == 0) {
  437. that.$toast("请选择承兑人")
  438. return
  439. }
  440. uni.showModal({
  441. title: '提示',
  442. content: '是否审核成功?',
  443. success: function(res) {
  444. if (res.confirm) {
  445. uni.showLoading()
  446. uni.$u.http.post('/api/SupplierAcceptor/update', {
  447. status: 1,
  448. ids:[...ids]
  449. }, {
  450. custom: {
  451. auth: true
  452. }
  453. }).then((res) => {
  454. uni.hideLoading()
  455. that.$toast("操作成功")
  456. that.init()
  457. }).catch((err) => {
  458. uni.hideLoading()
  459. that.$toast(err.msg)
  460. })
  461. } else if (res.cancel) {
  462. console.log('用户点击取消');
  463. }
  464. }
  465. });
  466. },
  467. addpdf(msg) {
  468. uni.showModal({
  469. title: '提示',
  470. content: "是否获取服务合同信息?",
  471. success: function(res) {
  472. msg.forEach(item=>{
  473. if(res.confirm){
  474. uni.setClipboardData({
  475. data: item,
  476. success: function() {
  477. that.$toast("复制成功,请到浏览器下载")
  478. }
  479. });
  480. }else if(res.cancel){
  481. console.log('取消');
  482. }
  483. })
  484. }
  485. })
  486. },
  487. }
  488. }
  489. </script>
  490. <style lang="scss">
  491. page {
  492. background-color: #F6F6F6 !important;
  493. }
  494. .headbgbox {
  495. background-color: #fff;
  496. padding: 23rpx 31rpx;
  497. box-sizing: border-box;
  498. position: fixed;
  499. top: 0;
  500. z-index: 999;
  501. width: 100%;
  502. .screen {
  503. display: flex;
  504. justify-content: center;
  505. align-items: center;
  506. padding-left: 30rpx;
  507. }
  508. }
  509. .searchbox {
  510. padding-left: 30rpx;
  511. box-sizing: border-box;
  512. background-color: #ECECEC;
  513. border-radius: 38rpx;
  514. // width: 688rpx;
  515. flex: 1;
  516. height: 75rpx;
  517. margin: 0 auto;
  518. display: flex;
  519. align-items: center;
  520. justify-content: center;
  521. }
  522. .acpcardlist {
  523. margin-top: 140rpx;
  524. .acpcard {
  525. flex: 1;
  526. // width: 690rpx;
  527. height: 400rpx;
  528. margin: 0 30rpx;
  529. // margin-top: 20rpx;
  530. background-color: #fff;
  531. border-radius: 20rpx;
  532. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  533. .allmsg {
  534. display: flex;
  535. padding: 40rpx 30rpx;
  536. box-sizing: border-box;
  537. width: 100%;
  538. .cicle {
  539. width: 28rpx;
  540. height: 28rpx;
  541. border-radius: 50%;
  542. background-color: #D8AB5A;
  543. margin-top: 8rpx;
  544. }
  545. .acpcont {
  546. margin-left: 20rpx;
  547. width: 100%;
  548. .acpname {
  549. box-sizing: border-box;
  550. display: flex;
  551. align-items: center;
  552. padding-bottom: 30rpx;
  553. flex-grow: 1;
  554. width: 100%;
  555. // width: 572rpx;
  556. font-size: 34rpx;
  557. font-weight: 600;
  558. .tagdel2{
  559. margin-left: 10rpx;
  560. width: 100rpx;
  561. // height: 36rpx;
  562. border-radius: 10rpx;
  563. background-color: rgba(8, 102, 214,.3);
  564. font-size: 24rpx;
  565. font-weight: 400;
  566. color: rgb(8, 102, 214);
  567. line-height: 36rpx;
  568. text-align: center;
  569. }
  570. .tagdel {
  571. margin-left: 10rpx;
  572. width: 80rpx;
  573. // height: 36rpx;
  574. border-radius: 10rpx;
  575. background-color: rgb(241, 206, 195);
  576. font-size: 24rpx;
  577. font-weight: 400;
  578. color: rgb(213, 109, 77);
  579. line-height: 36rpx;
  580. text-align: center;
  581. }
  582. .tagpass{
  583. margin-left: 10rpx;
  584. width: 80rpx;
  585. height: 36rpx;
  586. border-radius: 10rpx;
  587. background-color: rgba(30, 190, 130,.5);
  588. font-size: 24rpx;
  589. font-weight: 400;
  590. color: rgb(0, 200, 83);
  591. line-height: 36rpx;
  592. text-align: center;
  593. }
  594. .tag {
  595. margin-left: 10rpx;
  596. width: 80rpx;
  597. height: 36rpx;
  598. border-radius: 10rpx;
  599. background-color: rgb(232, 222, 203);
  600. font-size: 24rpx;
  601. font-weight: 400;
  602. color: #D8AB5A;
  603. line-height: 36rpx;
  604. text-align: center;
  605. }
  606. }
  607. }
  608. .acpinfo {
  609. border-top: 1rpx solid #E8E8E8;
  610. display: flex;
  611. flex: 1;
  612. flex-direction: column;
  613. font-size: 28rpx;
  614. color: #BEBDBB;
  615. justify-content: space-between;
  616. box-sizing: border-box;
  617. .pt {
  618. padding-top: 20rpx;
  619. }
  620. }
  621. }
  622. }
  623. }
  624. .totalmanage {
  625. margin-top: 90rpx;
  626. margin-bottom: 100rpx;
  627. // position: fixed;
  628. bottom: 0;
  629. display: flex;
  630. justify-content: space-between;
  631. align-items: center;
  632. width: 100%;
  633. padding: 0 30rpx;
  634. box-sizing: border-box;
  635. .managebox {
  636. width: 23.8rpx;
  637. height: 29.7rpx;
  638. image {
  639. width: 100%;
  640. height: 100%;
  641. }
  642. }
  643. .maboxtitls {
  644. width: 160rpx;
  645. height: 60rpx;
  646. display: flex;
  647. align-items: center;
  648. justify-content: center;
  649. border-radius: 30rpx;
  650. background-color: #D9D9D9;
  651. // line-height: 60rpx;
  652. font-size: 28rpx;
  653. box-sizing: border-box;
  654. // align-items: center;
  655. }
  656. }
  657. .plusicon {
  658. position: fixed;
  659. left: 0;
  660. right: 0;
  661. margin: 0 auto;
  662. bottom: 110rpx;
  663. width: 150rpx;
  664. height: 150rpx;
  665. background: url("@/static/img/plusicon.png") no-repeat;
  666. background-size: 150rpx 150rpx;
  667. }
  668. .editbox{
  669. position: relative;
  670. }
  671. .delet-btn{
  672. position: absolute;
  673. top: 6px;
  674. left: 140px;
  675. .delbtn{
  676. width: 181rpx !important;
  677. }
  678. }
  679. </style>