drawer.vue 12 KB

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