drawer.vue 11 KB

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