drawer.vue 12 KB

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