index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  1. <template>
  2. <view class="content">
  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="合同名称/编号、承兑人名称或出票"
  7. placeholder-style="color:#BBBCBE" />
  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="cardlist">
  17. <view>
  18. <view class="lable " v-for="(item,index) in listall" :key="index" >
  19. <view class="radiobox" v-if="editall">
  20. <radio :value="index" :checked="item.checked" color="#D8AB5A" @click="checkBox(item.id)"/>
  21. </view>
  22. <view class="card" @click.stop="moveDetail(item.id)">
  23. <view class="passreview" v-if="item.statusText=='成功'">
  24. <image src="../../static/img/resuccess.png" mode="aspectFill"></image>
  25. </view>
  26. <view class="passreview" v-if="item.statusText=='待审核'" >
  27. <image src="../../static/img/toreviewe.png" mode="aspectFill"></image>
  28. </view>
  29. <view class="passreview" v-if="item.statusText=='失败'" >
  30. <image src="../../static/img/falis.png" mode="aspectFill"></image>
  31. </view>
  32. <view class="passreview" v-if="item.statusText=='已删除'" >
  33. <image src="../../static/img/redel.png" mode="aspectFill"></image>
  34. </view>
  35. <view class="timebox" v-if="item.statusText=='成功'"><text>{{item.contractNo}}</text></view>
  36. <view class="timebox" v-if="item.statusText=='待审核'" :style="{'background-color':'#FFEBE5'}"><text>{{item.contractNo}}</text></view>
  37. <view class="timebox" v-if="item.statusText=='失败'" :style="{'background-color':'#E7E7E7'}"><text>{{item.contractNo}}</text></view>
  38. <view class="timebox" v-if="item.statusText=='已删除'" :style="{'background-color':'#F6F6F6'}"><text>{{item.contractNo}}</text></view>
  39. <view class="innerbox">
  40. <view class="listicon">
  41. <image src="/static/img/listticon.png" mode="aspectFill"></image>
  42. </view>
  43. <text class="cardtitle hideone">{{item.name}}</text>
  44. </view>
  45. <view class="contractmsg flex5">
  46. <text>合同编号:{{item.contractNo}}</text>
  47. <text style="padding-top: 10rpx;">承兑人:{{item.acceptorName}}</text>
  48. <text style="padding-top: 10rpx;">供应商:四川高鼎科技有限公司</text>
  49. </view>
  50. <view class="flex6 contadra">
  51. <text>出票人:{{item.drawersName}}</text>
  52. <text>汇票状态:{{item.status}}</text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="nomore" v-if="listall.length==0">
  59. <text>暂无数据</text>
  60. </view>
  61. <view class="totalmanage " v-if="listall.length>0">
  62. <text style="color:#68625B;font-size: 28rpx;">合计:{{total}}份</text>
  63. <view class=" maboxtitls" @click="editall=true">
  64. <view class="managebox">
  65. <image src="/static/img/manage.png" mode="aspectFit"></image>
  66. </view>
  67. <text style="padding-left: 15rpx;">管理</text>
  68. </view>
  69. </view>
  70. <view class="safebt"></view>
  71. <!-- <view class="plusicon" @click="addContract" v-if="state==1"></view> -->
  72. <u-popup :show="show" @close="close" @open="open">
  73. <view class="popscreen">
  74. <view class="checklist" v-for="(item,index) in ctrstatus" :key="index">
  75. <view class="alllistbtn">
  76. <text class="btntitle" style="">{{item.title}}</text>
  77. <view class="yunbtn">
  78. <view class="btnchoose" v-for="(i,k) in item.list" :key="k" @click="choose(item.title,k)"
  79. :class="[contract_status == k?'active':'btnchoose']">
  80. <text>{{i.name}}</text>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <view class="checklist" v-for="(item,index) in billstatus" :key="index">
  86. <view class="alllistbtn">
  87. <text class="btntitle" style="">{{item.title}}</text>
  88. <view class="yunbtn">
  89. <view class="btnchoose" v-for="(i,k) in item.list" :key="k" @click="choose(item.title,k)"
  90. :class="[draft_status == k?'active':'btnchoose']">
  91. <text>{{i.name}}</text>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="checklist" v-for="(item,index) in upstauts" :key="index">
  97. <view class="alllistbtn">
  98. <text class="btntitle" style="">{{item.title}}</text>
  99. <view class="yunbtn">
  100. <view class="btnchoose" v-for="(i,k) in item.list" :key="k" @click="choose(item.title,k)"
  101. :class="[time_status == k?'active':'btnchoose']">
  102. <text>{{i.name}}</text>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="flex4 custom">
  108. <text style="font-size: 26rpx;font-weight: 600;">自定义</text>
  109. <view class="custombox flex3">
  110. <view class="creatdata flex6">
  111. <text>开始日期</text>
  112. <view class="flex4 chodatain" @click="openDatePicker(1)">
  113. <text>{{creatTime}}</text>
  114. <u-icon name="arrow-right" color="#BEBDBB" bold="true" size="12"></u-icon>
  115. </view>
  116. </view>
  117. <view class="creatdata flex6">
  118. <text>结束日期</text>
  119. <view class="flex4 chodatain" @click="openDatePicker(2)">
  120. <text>{{endTime}}</text>
  121. <u-icon name="arrow-right" color="#BEBDBB" bold="true" size="12"></u-icon>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="searchbox" style="margin: 0 20px;margin-bottom: 30px;">
  127. <u-icon name="search" bold="true" size="25" color="rgb(246,185,78)"></u-icon>
  128. <input type="text" v-model="keywords" placeholder="请输入供应商名称"
  129. placeholder-style="color:#BBBCBE" />
  130. </view>
  131. <view class="aszs flex6">
  132. <view class="againbtn"><text>重置</text></view>
  133. <view class="againbtn" style="color: #D8AB5A;border: 1rpx solid #D8AB5A;"><text>确认</text></view>
  134. </view>
  135. </view>
  136. </u-popup>
  137. <u-datetime-picker :show="dateshow" v-model="value1" mode="date" @confirm="chooseDate"
  138. @cancel="closeDate" ></u-datetime-picker>
  139. <!-- 底部删除 -->
  140. <u-popup :show="editall&&state==1" @close="closeEidt" @open="openEidt" :overlay="false">
  141. <view class="editbox">
  142. <view class="chooseall flex6">
  143. <view class="leftchoose ">
  144. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  145. <text>全选</text>
  146. </view>
  147. <view class="surebtn" @click="selectDown">
  148. 完成
  149. </view>
  150. </view>
  151. <view class="choosebtn">
  152. <view class="delbtn flex1" @click="dele">删除</view>
  153. <view class="restorebtn flex1" @click="restore">复原</view>
  154. </view>
  155. </view>
  156. </u-popup>
  157. <u-popup :show="editall&&state==0" @close="closeEidt" @open="openEidt" :overlay="false">
  158. <view class="editbox">
  159. <view class="chooseall flex6">
  160. <view class="leftchoose ">
  161. <radio :checked="quan" @click="makeSureAll" color="#D8AB5A"></radio>
  162. <text>全选</text>
  163. </view>
  164. <view class="anniu">
  165. <text class="usa" @click="dele">删除</text>
  166. <text class="usa" @click="restore">复原</text>
  167. <text @click="selectDown" class="usa">完成</text>
  168. </view>
  169. </view>
  170. <view class="choosebtn">
  171. <view class="delbtn flex1" @click="examineFail">审核失败</view>
  172. <view class="restorebtn flex1" @click="examineSuccess">审核成功</view>
  173. </view>
  174. </view>
  175. </u-popup>
  176. <tabar ></tabar>
  177. </view>
  178. </template>
  179. <script>
  180. let that
  181. import tabar from "@/componet/tabbar/tabbar.vue"
  182. export default {
  183. components:{
  184. tabar
  185. },
  186. data() {
  187. return {
  188. keywords: '',
  189. state:0,
  190. show: false,
  191. editall:false,
  192. dateshow: false,
  193. quan:false,
  194. creatTime: "请选择",
  195. endTime: "请选择",
  196. value1: Number(new Date()),
  197. intime: 1,
  198. contract_status: '',
  199. draft_status: '',
  200. time_status: '',
  201. listall:[],
  202. pageIndex:1,
  203. total:'',
  204. nomore:false,
  205. ctrstatus: [{
  206. title: "合同状态",
  207. list: [{
  208. name: "全部",
  209. },
  210. {
  211. name: "待审核",
  212. },
  213. {
  214. name: "成功",
  215. },
  216. {
  217. name: "失败",
  218. },
  219. {
  220. name: "已删除",
  221. },
  222. ]
  223. }],
  224. billstatus: [{
  225. title: "汇票状态",
  226. list: [{
  227. name: "全部",
  228. },
  229. {
  230. name: "待审核",
  231. },
  232. {
  233. name: "成功",
  234. },
  235. {
  236. name: "失败",
  237. },
  238. {
  239. name: "已删除",
  240. },
  241. ]
  242. }],
  243. upstauts: [{
  244. title: "上传日期",
  245. list: [{
  246. name: "全部",
  247. },
  248. {
  249. name: "今日",
  250. },
  251. {
  252. name: "昨日",
  253. },
  254. ]
  255. }],
  256. }
  257. },
  258. onLoad() {
  259. that=this
  260. this.state = this.$store.state.admin
  261. this.init()
  262. },
  263. onshow(){
  264. this.init()
  265. },
  266. // 下拉到底部后加载新数据
  267. onReachBottom() {
  268. //判断下一页是否存在数据,不存在将显示暂无数据等提示语
  269. if (this.listall.length >= this.pageIndex * 10) {
  270. this.pageIndex++;//页数加一
  271. this.init();//回调接口
  272. }else{
  273. this.nomore=true
  274. }
  275. },
  276. methods: {
  277. init() {
  278. uni.showLoading()
  279. uni.$u.http.post('/api/Contract/search',{
  280. pageIndex:this.pageIndex,
  281. pageSize:10,
  282. // startTime:'',
  283. // endTime:'',
  284. // name:'',
  285. // contractStatus:0,
  286. // contractNo:''
  287. }, {
  288. custom: {
  289. auth: true
  290. }
  291. }).then((res) => {
  292. uni.hideLoading()
  293. this.total=res.total
  294. let list=res.result
  295. if(list.length>0){
  296. list.forEach(item=>{
  297. item.checked=false
  298. this.listall.push(item)
  299. })
  300. if(list.length<10){
  301. that.nomore=true
  302. }
  303. }
  304. }).catch((err) => {
  305. uni.hideLoading()
  306. console.log(err)
  307. })
  308. },
  309. examineFail(){
  310. let ids=[]
  311. that.listall.forEach(item=>{
  312. if(item.checked){
  313. ids.push(item.id)
  314. }
  315. })
  316. if(ids.length==0){
  317. this.$toast("请选择合同")
  318. return
  319. }
  320. uni.showModal({
  321. title: '提示',
  322. content: '是否批量审核失败?',
  323. success: function (res) {
  324. if (res.confirm) {
  325. uni.showLoading()
  326. uni.$u.http.post('/api/Contract/manage',
  327. {
  328. ids:ids,
  329. operateType:4
  330. },
  331. {
  332. custom: {
  333. auth: true
  334. }
  335. }).then((res) => {
  336. uni.hideLoading()
  337. that.editall=false
  338. that.quan=false
  339. that.$toast("操作成功")
  340. setTimeout(()=>{
  341. that.init()
  342. },500)
  343. }).catch((err) => {
  344. uni.hideLoading()
  345. that.$toast(err.msg)
  346. })
  347. } else if (res.cancel) {
  348. console.log('用户点击取消');
  349. }
  350. }
  351. });
  352. },
  353. dele(){
  354. let ids=[]
  355. that.listall.forEach(item=>{
  356. if(item.checked){
  357. ids.push(item.id)
  358. }
  359. })
  360. if(ids.length==0){
  361. that.$toast("请选择合同")
  362. return
  363. }
  364. uni.showModal({
  365. title: '提示',
  366. content:"是否批量删除?",
  367. success: function (res) {
  368. if (res.confirm) {
  369. uni.showLoading()
  370. uni.$u.http.post('/api/Contract/manage',
  371. {
  372. ids:ids,
  373. operateType:1
  374. },
  375. {
  376. custom: {
  377. auth: true
  378. }
  379. }).then((res) => {
  380. uni.hideLoading()
  381. that.editall=false
  382. that.quan=false
  383. that.$toast("操作成功")
  384. setTimeout(()=>{
  385. that.init()
  386. },500)
  387. }).catch((err) => {
  388. uni.hideLoading()
  389. that.$toast(err.msg)
  390. })
  391. } else if (res.cancel) {
  392. }
  393. }
  394. })
  395. },
  396. restore(){
  397. let ids=[]
  398. that.listall.forEach(item=>{
  399. if(item.checked){
  400. ids.push(item.id)
  401. }
  402. })
  403. if(ids.length==0){
  404. that.$toast("请选择合同")
  405. return
  406. }
  407. uni.showModal({
  408. title: '提示',
  409. content:"是否批量复原?",
  410. success: function (res) {
  411. if (res.confirm) {
  412. uni.showLoading()
  413. uni.$u.http.post('/api/Contract/manage',
  414. {
  415. ids:ids,
  416. operateType:2
  417. },
  418. {
  419. custom: {
  420. auth: true
  421. }
  422. }).then((res) => {
  423. uni.hideLoading()
  424. that.editall=false
  425. that.quan=false
  426. that.$toast("操作成功")
  427. setTimeout(()=>{
  428. that.init()
  429. },500)
  430. }).catch((err) => {
  431. uni.hideLoading()
  432. that.$toast(err.msg)
  433. })
  434. } else if (res.cancel) {
  435. }
  436. }
  437. })
  438. },
  439. examineSuccess(){
  440. let ids=[]
  441. that.listall.forEach(item=>{
  442. if(item.checked){
  443. ids.push(item.id)
  444. }
  445. })
  446. if(ids.length==0){
  447. that.$toast("请选择合同")
  448. return
  449. }
  450. uni.showModal({
  451. title: '提示',
  452. content:"是否批量审核成功?",
  453. success: function (res) {
  454. if (res.confirm) {
  455. uni.showLoading()
  456. uni.$u.http.post('/api/Contract/manage',
  457. {
  458. ids:ids,
  459. operateType:3
  460. },
  461. {
  462. custom: {
  463. auth: true
  464. }
  465. }).then((res) => {
  466. uni.hideLoading()
  467. that.editall=false
  468. that.quan=false
  469. that.$toast("操作成功")
  470. setTimeout(()=>{
  471. that.init()
  472. },500)
  473. }).catch((err) => {
  474. uni.hideLoading()
  475. that.$toast(err.msg)
  476. })
  477. } else if (res.cancel) {
  478. }
  479. }
  480. })
  481. },
  482. checkBox(id){
  483. let list=this.listall
  484. list.forEach(item=>{
  485. if(item.id==id){
  486. item.checked=!item.checked
  487. }
  488. })
  489. this.listall = JSON.parse(JSON.stringify(list))
  490. },
  491. allSelect(){
  492. let list=this.listall
  493. if(this.quan){
  494. list.forEach(item => {
  495. item.checked =true
  496. })
  497. }else{
  498. list.forEach(item => {
  499. item.checked =false
  500. })
  501. }
  502. this.listall = JSON.parse(JSON.stringify(list))
  503. console.log(this.listall)
  504. },
  505. addContract(){
  506. uni.navigateTo({
  507. url:'/pages/alldeatil/upcontract'
  508. })
  509. },
  510. moveDetail(id){
  511. uni.navigateTo({
  512. url:"/pages/alldeatil/contractdetail?id="+id
  513. })
  514. },
  515. makeSureAll(){
  516. this.quan=!this.quan
  517. this.allSelect()
  518. },
  519. selectDown(){
  520. this.editall=false
  521. this.quan=false
  522. let list=this.listall
  523. list.forEach(item=>{
  524. item.checked=false
  525. })
  526. },
  527. closeEidt(){
  528. this.editall=false
  529. },
  530. openEidt(){
  531. this.editall=true
  532. },
  533. chooseDate(e) {
  534. this.dateshow = false
  535. const timeFormat = uni.$u.timeFormat
  536. if (this.intime == 1) {
  537. this.creatTime = timeFormat(e.value, 'yyyy-mm-dd')
  538. } else {
  539. this.endTime = timeFormat(e.value, 'yyyy-mm-dd')
  540. }
  541. },
  542. openDatePicker(e) {
  543. console.log(e)
  544. if (e == 1) {
  545. this.intime = 1
  546. } else {
  547. this.intime = 2
  548. }
  549. this.dateshow = true
  550. },
  551. closeDate() {
  552. this.dateshow = false
  553. },
  554. open() {
  555. // console.log('open');
  556. },
  557. close() {
  558. this.show = false
  559. // console.log('close');
  560. },
  561. choose(title, k) {
  562. if (title == "合同状态") {
  563. this.contract_status = k
  564. } else if (title == "汇票状态") {
  565. this.draft_status = k
  566. } else if (title == "上传日期") {
  567. this.time_status = k
  568. }
  569. }
  570. }
  571. }
  572. </script>
  573. <style lang="scss">
  574. page {
  575. background-color: #F6F6F6 !important;
  576. }
  577. .headbgbox {
  578. background-color: #fff;
  579. padding: 23rpx 31rpx;
  580. box-sizing: border-box;
  581. position: fixed;
  582. top: 0;
  583. z-index: 999;
  584. width: 100%;
  585. .screen {
  586. display: flex;
  587. justify-content: center;
  588. align-items: center;
  589. padding-left: 30rpx;
  590. }
  591. }
  592. .searchbox {
  593. padding-left: 30rpx;
  594. box-sizing: border-box;
  595. background-color: #ECECEC;
  596. border-radius: 38rpx;
  597. // width: 688rpx;
  598. flex: 1;
  599. height: 75rpx;
  600. margin: 0 auto;
  601. display: flex;
  602. align-items: center;
  603. // justify-content: center;
  604. // margin-top: -10rpx;
  605. input{
  606. width: 240px;
  607. overflow: hidden;
  608. text-overflow:ellipsis;
  609. white-space: nowrap;
  610. }
  611. }
  612. .cardlist {
  613. display: flex;
  614. justify-content: center;
  615. flex-direction: column;
  616. // align-items: center;
  617. margin: 0 auto;
  618. margin-top: 120rpx;
  619. }
  620. .lable {
  621. display: flex;
  622. margin: 0 auto;
  623. margin-top: 20rpx;
  624. .radiobox {
  625. margin-right: -10rpx;
  626. margin-left: 30rpx;
  627. }
  628. }
  629. .card {
  630. flex: 1;
  631. overflow: hidden;
  632. margin: 0 30rpx;
  633. // width: 690rpx;
  634. // height: 315rpx;
  635. border-radius: 20rpx;
  636. background-color: #fff;
  637. position: relative;
  638. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  639. .passreview {
  640. position: absolute;
  641. right: 30rpx;
  642. top: 30rpx;
  643. width: 141rpx;
  644. height: 123.5rpx;
  645. image {
  646. width: 100%;
  647. height: 100%;
  648. }
  649. }
  650. .contadra{
  651. font-size: 24rpx;
  652. color: #BEBDBB;
  653. padding: 20rpx 0;
  654. margin: 0 30rpx;
  655. border-top: 1rpx solid #E8E8E8;
  656. }
  657. .innerbox {
  658. padding: 49rpx 0rpx;
  659. padding-bottom: 30rpx;
  660. margin: 0 30rpx;
  661. display: flex;
  662. align-items: center;
  663. border-bottom: 1rpx solid #E8E8E8;
  664. .listicon {
  665. width: 32rpx;
  666. height: 36rpx;
  667. image {
  668. width: 100%;
  669. height: 100%;
  670. }
  671. }
  672. }
  673. .cardtitle {
  674. display: block;
  675. max-width: 390rpx;
  676. font-size: 32rpx;
  677. font-weight: 600;
  678. padding-left: 10rpx;
  679. }
  680. .timebox {
  681. background-color: #FFF8E5;
  682. width: 100%;
  683. padding: 0 30rpx;
  684. box-sizing: border-box;
  685. color: #D8AB5A;
  686. font-size: 28rpx;
  687. height: 60rpx;
  688. line-height: 60rpx;
  689. }
  690. .contractmsg {
  691. padding: 30rpx;
  692. box-sizing: border-box;
  693. color: #68625B;
  694. font-size: 26rpx;
  695. // border-bottom: 1rpx solid #E8E8E8;
  696. }
  697. }
  698. .totalmanage {
  699. margin-top: 90rpx;
  700. margin-bottom: 100rpx;
  701. // position: fixed;
  702. // bottom: 0;
  703. display: flex;
  704. justify-content: space-between;
  705. align-items: center;
  706. width: 100%;
  707. padding: 0 30rpx;
  708. box-sizing: border-box;
  709. .managebox {
  710. width: 23.8rpx;
  711. height: 29.7rpx;
  712. image {
  713. width: 100%;
  714. height: 100%;
  715. }
  716. }
  717. .maboxtitls {
  718. width: 160rpx;
  719. height: 60rpx;
  720. display: flex;
  721. align-items: center;
  722. justify-content: center;
  723. border-radius: 30rpx;
  724. background-color: #D9D9D9;
  725. // line-height: 60rpx;
  726. font-size: 28rpx;
  727. box-sizing: border-box;
  728. // align-items: center;
  729. }
  730. }
  731. </style>