index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  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">删除</view>
  153. <view class="restorebtn flex1">复原</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">删除</text>
  166. <text class="usa">复原</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. total:'',
  203. ctrstatus: [{
  204. title: "合同状态",
  205. list: [{
  206. name: "全部",
  207. },
  208. {
  209. name: "待审核",
  210. },
  211. {
  212. name: "成功",
  213. },
  214. {
  215. name: "失败",
  216. },
  217. {
  218. name: "已删除",
  219. },
  220. ]
  221. }],
  222. billstatus: [{
  223. title: "汇票状态",
  224. list: [{
  225. name: "全部",
  226. },
  227. {
  228. name: "待审核",
  229. },
  230. {
  231. name: "成功",
  232. },
  233. {
  234. name: "失败",
  235. },
  236. {
  237. name: "已删除",
  238. },
  239. ]
  240. }],
  241. upstauts: [{
  242. title: "上传日期",
  243. list: [{
  244. name: "全部",
  245. },
  246. {
  247. name: "今日",
  248. },
  249. {
  250. name: "昨日",
  251. },
  252. ]
  253. }],
  254. }
  255. },
  256. onLoad() {
  257. that=this
  258. this.state = this.$store.state.admin
  259. this.init()
  260. },
  261. methods: {
  262. init() {
  263. uni.showLoading()
  264. uni.$u.http.post('/api/Contract/search',{
  265. pageIndex:1,
  266. pageSize:10,
  267. // startTime:'',
  268. // endTime:'',
  269. // name:'',
  270. // contractStatus:0,
  271. // contractNo:''
  272. }, {
  273. custom: {
  274. auth: true
  275. }
  276. }).then((res) => {
  277. uni.hideLoading()
  278. this.listall=res.result
  279. this.total=res.total
  280. this.listall.forEach(item=>{
  281. item.checked=false
  282. })
  283. }).catch((err) => {
  284. uni.hideLoading()
  285. console.log(err)
  286. })
  287. },
  288. examineFail(){
  289. let ids=[]
  290. that.listall.forEach(item=>{
  291. if(item.checked){
  292. ids.push(item.id)
  293. }
  294. })
  295. if(ids.length==0){
  296. this.$toast("请选择合同")
  297. return
  298. }
  299. uni.showModal({
  300. title: '提示',
  301. content: '是否批量审核失败?',
  302. success: function (res) {
  303. if (res.confirm) {
  304. uni.showLoading()
  305. uni.$u.http.post('/api/Contract/manage',
  306. {
  307. ids:ids,
  308. operateType:4
  309. },
  310. {
  311. custom: {
  312. auth: true
  313. }
  314. }).then((res) => {
  315. uni.hideLoading()
  316. that.editall=false
  317. that.quan=false
  318. that.$toast("操作成功")
  319. setTimeout(()=>{
  320. that.init()
  321. },500)
  322. }).catch((err) => {
  323. uni.hideLoading()
  324. that.$toast(err.msg)
  325. })
  326. } else if (res.cancel) {
  327. console.log('用户点击取消');
  328. }
  329. }
  330. });
  331. },
  332. examineSuccess(){
  333. let ids=[]
  334. that.listall.forEach(item=>{
  335. if(item.checked){
  336. ids.push(item.id)
  337. }
  338. })
  339. if(ids.length==0){
  340. that.$toast("请选择合同")
  341. return
  342. }
  343. uni.showModal({
  344. title: '提示',
  345. content:"是否批量审核成功?",
  346. success: function (res) {
  347. if (res.confirm) {
  348. uni.showLoading()
  349. uni.$u.http.post('/api/Contract/manage',
  350. {
  351. ids:ids,
  352. operateType:3
  353. },
  354. {
  355. custom: {
  356. auth: true
  357. }
  358. }).then((res) => {
  359. uni.hideLoading()
  360. that.editall=false
  361. that.quan=false
  362. that.$toast("操作成功")
  363. setTimeout(()=>{
  364. that.init()
  365. },500)
  366. }).catch((err) => {
  367. uni.hideLoading()
  368. that.$toast(err.msg)
  369. })
  370. } else if (res.cancel) {
  371. }
  372. }
  373. })
  374. },
  375. checkBox(id){
  376. let list=this.listall
  377. list.forEach(item=>{
  378. if(item.id==id){
  379. item.checked=!item.checked
  380. }
  381. })
  382. this.listall = JSON.parse(JSON.stringify(list))
  383. },
  384. allSelect(){
  385. let list=this.listall
  386. if(this.quan){
  387. list.forEach(item => {
  388. item.checked =true
  389. })
  390. }else{
  391. list.forEach(item => {
  392. item.checked =false
  393. })
  394. }
  395. this.listall = JSON.parse(JSON.stringify(list))
  396. console.log(this.listall)
  397. },
  398. addContract(){
  399. uni.navigateTo({
  400. url:'/pages/alldeatil/upcontract'
  401. })
  402. },
  403. moveDetail(id){
  404. uni.navigateTo({
  405. url:"/pages/alldeatil/contractdetail?id="+id
  406. })
  407. },
  408. makeSureAll(){
  409. this.quan=!this.quan
  410. this.allSelect()
  411. },
  412. selectDown(){
  413. this.editall=false
  414. this.quan=false
  415. let list=this.listall
  416. list.forEach(item=>{
  417. item.checked=false
  418. })
  419. },
  420. closeEidt(){
  421. this.editall=false
  422. },
  423. openEidt(){
  424. this.editall=true
  425. },
  426. chooseDate(e) {
  427. this.dateshow = false
  428. const timeFormat = uni.$u.timeFormat
  429. if (this.intime == 1) {
  430. this.creatTime = timeFormat(e.value, 'yyyy-mm-dd')
  431. } else {
  432. this.endTime = timeFormat(e.value, 'yyyy-mm-dd')
  433. }
  434. },
  435. openDatePicker(e) {
  436. console.log(e)
  437. if (e == 1) {
  438. this.intime = 1
  439. } else {
  440. this.intime = 2
  441. }
  442. this.dateshow = true
  443. },
  444. closeDate() {
  445. this.dateshow = false
  446. },
  447. open() {
  448. // console.log('open');
  449. },
  450. close() {
  451. this.show = false
  452. // console.log('close');
  453. },
  454. choose(title, k) {
  455. if (title == "合同状态") {
  456. this.contract_status = k
  457. } else if (title == "汇票状态") {
  458. this.draft_status = k
  459. } else if (title == "上传日期") {
  460. this.time_status = k
  461. }
  462. }
  463. }
  464. }
  465. </script>
  466. <style lang="scss">
  467. page {
  468. background-color: #F6F6F6 !important;
  469. }
  470. .headbgbox {
  471. background-color: #fff;
  472. padding: 23rpx 31rpx;
  473. box-sizing: border-box;
  474. position: fixed;
  475. top: 0;
  476. z-index: 999;
  477. width: 100%;
  478. .screen {
  479. display: flex;
  480. justify-content: center;
  481. align-items: center;
  482. padding-left: 30rpx;
  483. }
  484. }
  485. .searchbox {
  486. padding-left: 30rpx;
  487. box-sizing: border-box;
  488. background-color: #ECECEC;
  489. border-radius: 38rpx;
  490. // width: 688rpx;
  491. flex: 1;
  492. height: 75rpx;
  493. margin: 0 auto;
  494. display: flex;
  495. align-items: center;
  496. // justify-content: center;
  497. // margin-top: -10rpx;
  498. input{
  499. width: 240px;
  500. overflow: hidden;
  501. text-overflow:ellipsis;
  502. white-space: nowrap;
  503. }
  504. }
  505. .cardlist {
  506. display: flex;
  507. justify-content: center;
  508. flex-direction: column;
  509. // align-items: center;
  510. margin: 0 auto;
  511. margin-top: 120rpx;
  512. }
  513. .lable {
  514. display: flex;
  515. margin: 0 auto;
  516. margin-top: 20rpx;
  517. .radiobox {
  518. margin-right: -10rpx;
  519. margin-left: 30rpx;
  520. }
  521. }
  522. .card {
  523. flex: 1;
  524. overflow: hidden;
  525. margin: 0 30rpx;
  526. // width: 690rpx;
  527. // height: 315rpx;
  528. border-radius: 20rpx;
  529. background-color: #fff;
  530. position: relative;
  531. box-shadow: 0px 8rpx 20rpx 1rpx rgba(31, 36, 42, 0.08);
  532. .passreview {
  533. position: absolute;
  534. right: 30rpx;
  535. top: 30rpx;
  536. width: 141rpx;
  537. height: 123.5rpx;
  538. image {
  539. width: 100%;
  540. height: 100%;
  541. }
  542. }
  543. .contadra{
  544. font-size: 24rpx;
  545. color: #BEBDBB;
  546. padding: 20rpx 0;
  547. margin: 0 30rpx;
  548. border-top: 1rpx solid #E8E8E8;
  549. }
  550. .innerbox {
  551. padding: 49rpx 0rpx;
  552. padding-bottom: 30rpx;
  553. margin: 0 30rpx;
  554. display: flex;
  555. align-items: center;
  556. border-bottom: 1rpx solid #E8E8E8;
  557. .listicon {
  558. width: 32rpx;
  559. height: 36rpx;
  560. image {
  561. width: 100%;
  562. height: 100%;
  563. }
  564. }
  565. }
  566. .cardtitle {
  567. display: block;
  568. max-width: 390rpx;
  569. font-size: 32rpx;
  570. font-weight: 600;
  571. padding-left: 10rpx;
  572. }
  573. .timebox {
  574. background-color: #FFF8E5;
  575. width: 100%;
  576. padding: 0 30rpx;
  577. box-sizing: border-box;
  578. color: #D8AB5A;
  579. font-size: 28rpx;
  580. height: 60rpx;
  581. line-height: 60rpx;
  582. }
  583. .contractmsg {
  584. padding: 30rpx;
  585. box-sizing: border-box;
  586. color: #68625B;
  587. font-size: 26rpx;
  588. // border-bottom: 1rpx solid #E8E8E8;
  589. }
  590. }
  591. .totalmanage {
  592. margin-top: 90rpx;
  593. margin-bottom: 100rpx;
  594. // position: fixed;
  595. // bottom: 0;
  596. display: flex;
  597. justify-content: space-between;
  598. align-items: center;
  599. width: 100%;
  600. padding: 0 30rpx;
  601. box-sizing: border-box;
  602. .managebox {
  603. width: 23.8rpx;
  604. height: 29.7rpx;
  605. image {
  606. width: 100%;
  607. height: 100%;
  608. }
  609. }
  610. .maboxtitls {
  611. width: 160rpx;
  612. height: 60rpx;
  613. display: flex;
  614. align-items: center;
  615. justify-content: center;
  616. border-radius: 30rpx;
  617. background-color: #D9D9D9;
  618. // line-height: 60rpx;
  619. font-size: 28rpx;
  620. box-sizing: border-box;
  621. // align-items: center;
  622. }
  623. }
  624. </style>