supplier.vue 17 KB

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