drawer.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  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. // this.in'it()
  130. },
  131. onShow(){
  132. this.init()
  133. },
  134. // 下拉到底部后加载新数据
  135. onReachBottom() {
  136. //判断下一页是否存在数据,不存在将显示暂无数据等提示语
  137. if (this.listall.length >= this.pageIndex * 10) {
  138. this.pageIndex++;//页数加一
  139. this.init();//回调接口
  140. }else{
  141. this.nomore=true
  142. }
  143. },
  144. methods: {
  145. init(){
  146. uni.showLoading()
  147. uni.$u.http.post('/api/Drawer/search',{
  148. pageIndex:this.pageIndex,
  149. pageSize:10,
  150. name:this.keywords,
  151. status: this.statusall,
  152. // startTime:'',
  153. // endTime:'',
  154. // name:'',
  155. // contractStatus:'',
  156. // contractNo:''
  157. }, {
  158. custom: {
  159. auth: true
  160. }
  161. }).then((res) => {
  162. uni.hideLoading()
  163. this.total=res.total
  164. let list=res.result
  165. if(list.length>0){
  166. list.forEach(item=>{
  167. item.checked=false
  168. this.listall.push(item)
  169. })
  170. if(list.length<10){
  171. that.nomore=true
  172. }
  173. }
  174. }).catch((err) => {
  175. uni.hideLoading()
  176. console.log(err)
  177. })
  178. },
  179. close() {
  180. this.show = false
  181. },
  182. open(){
  183. },
  184. restoreALL() {
  185. this.contract_status = 0
  186. },
  187. makeSureSelect() {
  188. this.shai = true
  189. that.pageIndex = 1
  190. that.nomore = false
  191. that.listall = []
  192. this.init()
  193. this.close()
  194. },
  195. choose(title, k) {
  196. if (title == "出票人状态") {
  197. this.contract_status = k
  198. if (k == 2) {
  199. this.statusall = 4
  200. } else if (k == 1) {
  201. this.statusall = 5
  202. } else if (k == 0) {
  203. this.statusall = 0
  204. }
  205. }
  206. },
  207. changeSeach(e){
  208. this.keywords=e.detail.value
  209. that.pageIndex = 1
  210. that.nomore = false
  211. that.listall = []
  212. this.init()
  213. },
  214. checkBox(id){
  215. let list=this.listall
  216. list.forEach(item=>{
  217. if(item.id==id){
  218. item.checked=!item.checked
  219. }
  220. })
  221. this.listall = JSON.parse(JSON.stringify(list))
  222. },
  223. selectDown(){
  224. this.editall=false
  225. this.quan=false
  226. let list=this.listall
  227. list.forEach(item=>{
  228. item.checked=false
  229. })
  230. },
  231. allSelect(){
  232. let list=this.listall
  233. if(this.quan){
  234. list.forEach(item => {
  235. item.checked =true
  236. })
  237. }else{
  238. list.forEach(item => {
  239. item.checked =false
  240. })
  241. }
  242. this.listall = JSON.parse(JSON.stringify(list))
  243. console.log(this.listall)
  244. },
  245. makeSureAll(){
  246. this.quan=!this.quan
  247. this.allSelect()
  248. },
  249. closeEidt(){
  250. this.editall=false
  251. },
  252. openEidt(){
  253. this.editall=true
  254. },
  255. acpDetail(id){
  256. uni.navigateTo({
  257. url:"/pages/alldeatil/drawerdetail?id="+id
  258. })
  259. },
  260. addContract(){
  261. uni.navigateTo({
  262. url:'/pages/alldeatil/addnewdrawer'
  263. })
  264. },
  265. backDrawer(){
  266. },
  267. deleteDrawer(){
  268. let ids=[]
  269. that.listall.forEach(item=>{
  270. if(item.checked){
  271. ids.push(item.id)
  272. }
  273. })
  274. if(ids.length==0){
  275. that.$toast("请选择合同")
  276. return
  277. }
  278. uni.showModal({
  279. title: '提示',
  280. content:"是否批量删除?",
  281. success: function (res) {
  282. if (res.confirm) {
  283. uni.showLoading()
  284. uni.$u.http.post('/api/Drawer/manager',
  285. {
  286. ids:ids,
  287. operateType:1
  288. },
  289. {
  290. custom: {
  291. auth: true
  292. }
  293. }).then((res) => {
  294. uni.hideLoading()
  295. that.editall=false
  296. that.quan=false
  297. that.$toast("操作成功")
  298. setTimeout(()=>{
  299. that.pageIndex=1
  300. that.nomore=false
  301. that.listall=[]
  302. that.init()
  303. },500)
  304. }).catch((err) => {
  305. uni.hideLoading()
  306. that.$toast(err.msg)
  307. })
  308. } else if (res.cancel) {
  309. }
  310. }
  311. })
  312. },
  313. backDrawer(){
  314. let ids=[]
  315. that.listall.forEach(item=>{
  316. if(item.checked){
  317. ids.push(item.id)
  318. }
  319. })
  320. if(ids.length==0){
  321. that.$toast("请选择合同")
  322. return
  323. }
  324. uni.showModal({
  325. title: '提示',
  326. content:"是否批量复原?",
  327. success: function (res) {
  328. if (res.confirm) {
  329. uni.showLoading()
  330. uni.$u.http.post('/api/Drawer/manager',
  331. {
  332. ids:ids,
  333. operateType:2
  334. },
  335. {
  336. custom: {
  337. auth: true
  338. }
  339. }).then((res) => {
  340. uni.hideLoading()
  341. that.editall=false
  342. that.quan=false
  343. that.$toast("操作成功")
  344. setTimeout(()=>{
  345. that.pageIndex=1
  346. that.nomore=false
  347. that.listall=[]
  348. that.init()
  349. },500)
  350. }).catch((err) => {
  351. uni.hideLoading()
  352. that.$toast(err.msg)
  353. })
  354. } else if (res.cancel) {
  355. }
  356. }
  357. })
  358. }
  359. }
  360. }
  361. </script>
  362. <style lang="scss">
  363. page{
  364. background-color: #F6F6F6 !important;
  365. }
  366. .headbgbox {
  367. background-color: #fff;
  368. padding: 23rpx 31rpx;
  369. box-sizing: border-box;
  370. position: fixed;
  371. top: 0;
  372. z-index: 999;
  373. width: 100%;
  374. .screen {
  375. display: flex;
  376. justify-content: center;
  377. align-items: center;
  378. padding-left: 30rpx;
  379. }
  380. }
  381. .searchbox {
  382. padding-left: 30rpx;
  383. box-sizing: border-box;
  384. background-color: #ECECEC;
  385. border-radius: 38rpx;
  386. // width: 688rpx;
  387. flex: 1;
  388. height: 75rpx;
  389. margin: 0 auto;
  390. display: flex;
  391. align-items: center;
  392. justify-content: center;
  393. }
  394. .acpcardlist{
  395. margin-top: 140rpx;
  396. .acpcard{
  397. flex: 1;
  398. // width: 690rpx;
  399. // height: 270rpx;
  400. margin: 0 30rpx;
  401. // margin-top: 20rpx;
  402. background-color: #fff;
  403. border-radius: 20rpx;
  404. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  405. .allmsg{
  406. display: flex;
  407. padding: 40rpx 30rpx;
  408. box-sizing: border-box;
  409. // width: 100%;
  410. .cicle{
  411. width: 28rpx;
  412. height: 28rpx;
  413. border-radius: 50%;
  414. margin-top: 8rpx;
  415. }
  416. .acpcont{
  417. margin-left: 20rpx;
  418. width: 100%;
  419. .acpname{
  420. box-sizing: border-box;
  421. display: flex;
  422. align-items: center;
  423. padding-bottom: 30rpx;
  424. flex-grow: 1;
  425. width: 100%;
  426. // width: 572rpx;
  427. font-size: 42rpx;
  428. font-weight: 600;
  429. .tagdel{
  430. margin-left: 10rpx;
  431. width: 80rpx;
  432. height:36rpx;
  433. border-radius: 10rpx;
  434. background-color: rgb(241,206,195);
  435. font-size: 24rpx;
  436. font-weight: 400;
  437. color: rgb(213,109,77);
  438. line-height: 36rpx;
  439. text-align: center;
  440. }
  441. .tag{
  442. margin-left: 10rpx;
  443. width: 80rpx;
  444. height:36rpx;
  445. border-radius: 10rpx;
  446. background-color: rgb(232,222,203);
  447. font-size: 24rpx;
  448. font-weight: 400;
  449. color: #D8AB5A;
  450. line-height: 36rpx;
  451. text-align: center;
  452. }
  453. }
  454. }
  455. .acpinfo{
  456. border-top: 1rpx solid #E8E8E8;
  457. display: flex;
  458. flex: 1;
  459. flex-direction: column;
  460. font-size: 28rpx;
  461. color: #BEBDBB;
  462. justify-content: space-between;
  463. box-sizing: border-box;
  464. .pt{
  465. padding-top: 20rpx;
  466. }
  467. }
  468. }
  469. }
  470. }
  471. .totalmanage {
  472. margin-top: 90rpx;
  473. margin-bottom: 100rpx;
  474. // position: fixed;
  475. bottom: 0;
  476. display: flex;
  477. justify-content: space-between;
  478. align-items: center;
  479. width: 100%;
  480. padding: 0 30rpx;
  481. box-sizing: border-box;
  482. .managebox {
  483. width: 23.8rpx;
  484. height: 29.7rpx;
  485. image {
  486. width: 100%;
  487. height: 100%;
  488. }
  489. }
  490. .maboxtitls {
  491. width: 160rpx;
  492. height: 60rpx;
  493. display: flex;
  494. align-items: center;
  495. justify-content: center;
  496. border-radius: 30rpx;
  497. background-color: #D9D9D9;
  498. // line-height: 60rpx;
  499. font-size: 28rpx;
  500. box-sizing: border-box;
  501. // align-items: center;
  502. }
  503. }
  504. .plusicon{
  505. position: fixed;
  506. left: 0;
  507. right: 0;
  508. margin: 0 auto;
  509. bottom:110rpx;
  510. width: 150rpx;
  511. height: 150rpx;
  512. background: url("@/static/img/plusicon.png") no-repeat;
  513. background-size: 150rpx 150rpx;
  514. }
  515. </style>