pjpc.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <template>
  2. <div>
  3. <backindex :title="titlename"></backindex>
  4. <p style="text-align: center;font-size: .36rem;margin-top: .2rem;">派件批次 {{dispatchBatchNo}}</p>
  5. <div class="content">
  6. <!-- table切换 -->
  7. <div class="number">
  8. <div class="swiper-container">
  9. <div class="swiper-wrapper">
  10. <!-- Slides -->
  11. <div v-for="item in resultList" class="swiper-slide">
  12. <div>
  13. <p>{{item.build}}/座</p>
  14. <p>待派送 {{item.waitNum}} 已派送 {{item.alreadyNum}}</p>
  15. </div>
  16. </div>
  17. </div>
  18. <!-- 如果需要翻页按钮 -->
  19. <div class="swiper-button-prev">
  20. <!-- <van-icon name="arrow-left" /> -->
  21. </div>
  22. <div class="swiper-button-next">
  23. <!-- <van-icon name="arrow" /> -->
  24. </div>
  25. </div>
  26. <div id="mychart"></div>
  27. </div>
  28. <!-- 快件查询列表 -->
  29. <van-checkbox-group v-model="result">
  30. <van-cell-group>
  31. <div class="jjlist" v-for="(item,index) in expressList">
  32. <div class="listinfo">
  33. <div class="list_top" @click="goInfo(item.expressNo)">
  34. <div class="list_top_left">
  35. <img src="../assets/images/ad_icon1.png" alt="">
  36. <div>
  37. <p>{{item.expressNo}}</p>
  38. <p><span>收</span>{{item.recipient}}</p>
  39. <p>{{item.build}} {{item.sendSeat}} {{item.floor}} {{item.mailRoom}}</p>
  40. </div>
  41. </div>
  42. <!-- <p class="staus1" @click="slide">{{options}}</p> 0-待签收 1-已签收、2-代收、3-拒收、4-延迟',-->
  43. <p class="staus1" v-if="item.signinStatus == 0">待签收</p>
  44. <p class="staus1" v-if="item.signinStatus == 1">本人签收</p>
  45. <p class="staus2" v-if="item.signinStatus == 2">他人代收</p>
  46. <p class="staus2" v-if="item.signinStatus == 3">拒收</p>
  47. <p class="staus2" v-if="item.signinStatus == 4">滞留件</p>
  48. <p class="staus2" v-if="item.signinStatus == 5">问题件</p>
  49. </div>
  50. </div>
  51. <!-- <div>
  52. <van-checkbox :disabled="item.signinStatus != 0" checked-color="#00c4b8" :name="item.expressNo" ref="checkboxes" />
  53. </div> -->
  54. </div>
  55. </van-cell-group>
  56. </van-checkbox-group>
  57. <!-- <div style="margin-top: 16px;">
  58. <van-field readonly clickable name="picker" :value="phone" label="收件人手机" placeholder="输入手机号后四位查询" @click="addshow1=true"/>
  59. <van-field readonly type="text" v-model="recipient" label="收件人" />
  60. <van-button color="#00c4b8" block type="info" @click="signSave">合并签收</van-button>
  61. </div> -->
  62. <!-- 填写手机号码 -->
  63. <!-- <van-popup round v-model="addshow1" class="whrite_add2" closeable @closed="close" :close-on-click-overlay="false">
  64. <div>
  65. <p style="font-size: 16px;text-align: center;margin-bottom: 16px;">填写号码</p>
  66. <van-form @submit="onSubmit">
  67. <van-field v-model="phone" name="收件人手机" label="收件人手机" type="number" maxlength="20" placeholder="输入手机号后四位" @change="searchList()"/>
  68. <ul>
  69. <li v-for="(item,i) in employeeList" @click="choose(i,item)">
  70. <p>{{item.name}}</p>
  71. <p>{{item.department}}</p>
  72. <van-icon v-if="index == i" name="passed" />
  73. </li>
  74. </ul>
  75. <div style="margin-top: 16px;">
  76. <van-button color="#00c4b8" block type="info" native-type="submit">确定</van-button>
  77. </div>
  78. </van-form>
  79. </div>
  80. </van-popup> -->
  81. </div>
  82. <!-- 选择下拉 -->
  83. <!-- <van-popup v-model="showPicker" position="bottom">
  84. <van-picker title="" show-toolbar :columns="columns" @confirm="onConfirm" @cancel="showPicker=false" />
  85. </van-popup> -->
  86. <!-- 筛选 -->
  87. <!-- <van-popup round v-model="addshow" class="whrite_add" closeable>
  88. <div>
  89. <p style="font-size: 16px;text-align: center;margin-bottom: 16px;">筛选</p>
  90. <van-form @submit="search">
  91. <van-field v-model="box" name="寄包柜" label="寄包柜" placeholder="请选择" readonly/>
  92. <van-field v-model="name" name="收件人" label="收件人" placeholder="请输入收件人"/>
  93. <van-field v-model="starttime" name="开始时间" label="开始时间" placeholder="请选择" readonly @click="time(1)"/>
  94. <van-field v-model="endtime" name="结束时间" label="结束时间" placeholder="请选择" readonly @click="time(2)"/>
  95. <van-field v-model="staus" name="状态" label="状态" placeholder="请选择" readonly @click="ztshow=true"/>
  96. <div style="margin-top: 16px;">
  97. <van-button color="#00c4b8" block type="info" native-type="submit">确定</van-button>
  98. </div>
  99. </van-form>
  100. </div>
  101. </van-popup> -->
  102. <!-- 时间 -->
  103. <!-- <van-popup v-model="timeshow" position="bottom">
  104. <van-datetime-picker
  105. v-model="currentDate"
  106. type="datetime"
  107. title="选择时间"
  108. :min-date="minDate"
  109. @confirm="timedate"
  110. @cancel="timeshow=false"
  111. />
  112. </van-popup> -->
  113. <!-- 状态 -->
  114. <!-- <van-popup v-model="ztshow" position="bottom">
  115. <van-picker title="标状态" show-toolbar :columns="ztlist" @confirm="zt" @cancel="ztshow=false"/>
  116. </van-popup> -->
  117. </div>
  118. </template>
  119. <script>
  120. import {Toast,Dialog,Checkbox,CheckboxGroup} from 'vant'
  121. import Swiper from 'swiper'
  122. export default{
  123. data(){
  124. return{
  125. result:[],
  126. titlename:"派件批次",
  127. showPicker:false,
  128. columns:["未派件","待派件"],
  129. options:"待揽件",
  130. addshow:false,
  131. addshow1:false,
  132. name:"",
  133. timeshow:false,
  134. box:"",
  135. starttime:"",
  136. endtime:"",
  137. staus:"",
  138. currentDate:"",
  139. minDate:new Date(),
  140. timetype:"",//时间类别1开始、2结束
  141. ztshow:false,
  142. ztlist:["状态一","状态二"],
  143. total:"",
  144. resultList:[],//楼道统计列表
  145. expressList:[],//快件列表
  146. dispatchBatchNo:'',//批次号
  147. employeeList:[],//收件人列表
  148. phone:'',//手机号
  149. recipient:'',//收件人
  150. index:'-1',
  151. yiPaiSong:'',
  152. }
  153. },
  154. updated:function(){
  155. },
  156. created:function(){
  157. this.isLogin();
  158. },
  159. methods:{
  160. // //合并签收
  161. // signSave(){
  162. // if(this.result.length == 0){
  163. // Toast('请选择需要合并的快递!');
  164. // return;
  165. // }
  166. // if(this.recipient == ''){
  167. // Toast('请选择收件人!');
  168. // return;
  169. // }
  170. // this.$http.post(this.$store.state.host+"/solic/marginSignExpress",
  171. // {expressNoList:this.result.join(','),
  172. // collectAgent:this.recipient},{emulateJSON:true})
  173. // .then(res=>{
  174. // //发送成功
  175. // if(res.body.msg=='success'){
  176. // Toast("合并签收成功!");
  177. // setTimeout(()=>{
  178. // this.getData();
  179. // this.result = [];
  180. // this.recipient = '';
  181. // this.phone = '';
  182. // },1200)
  183. // }else{
  184. // Toast("合并签收失败!");
  185. // }
  186. // },res=>{
  187. // //发送失败
  188. // Toast("网络错误!")
  189. // })
  190. // },
  191. // //选择员工
  192. // choose(val,item){
  193. // this.index = val
  194. // this.recipient = item.name
  195. // this.phone = item.phone
  196. // },
  197. // //手机号后四位搜索
  198. // searchList(){
  199. // this.$http.post(this.$store.state.host+"/solic/getEmployeeInfoByPhone",{
  200. // phone:this.phone,
  201. // },{
  202. // emulateJSON:true,
  203. // })
  204. // .then(res=>{
  205. // //发送成功
  206. // if(res.body.msg=='success'){
  207. // this.employeeList = res.body.employeeList
  208. // }
  209. // },res=>{
  210. // //发送失败
  211. // Toast("网络错误!")
  212. // })
  213. // },
  214. //跳转详情
  215. goInfo(expressNo){
  216. //收件查询
  217. this.$router.push({path:'/Kjsearchinfo',query:{expressNo:expressNo,type:1}})
  218. },
  219. // onSubmit(){
  220. // if(this.recipient == ''){
  221. // Toast('请选择收件人')
  222. // return
  223. // }
  224. // this.addshow1=false
  225. // //this.tjshow=true
  226. // },
  227. close(){
  228. //this.phone = ''
  229. //this.name = ''
  230. //this.department = ''
  231. this.index = ''
  232. },
  233. toggle(index) {
  234. this.$refs.checkboxes[index].toggle();
  235. },
  236. //获取数据
  237. getData(){
  238. Toast.loading({
  239. message: '加载中...',
  240. forbidClick: true,
  241. duration:0
  242. });
  243. this.$http.post(this.$store.state.host+"/solic/getExpressListByBatchNo",{mailRoomId: localStorage.getItem('roomId')},{emulateJSON:true})
  244. .then(res=>{
  245. //发送成功
  246. if(res.body.msg=='success'){
  247. this.resultList = res.body.resultList;
  248. this.expressList = res.body.expressList;
  249. this.dispatchBatchNo = res.body.dispatchBatchNo;
  250. this.yiPaiSong = res.body.yiPaiSong;
  251. this.total = res.body.total;
  252. this.echart();
  253. }else if(res.body.msg=='未获取到批次'){
  254. Toast(res.body.msg)
  255. }
  256. },res=>{
  257. //发送失败
  258. Toast("网络错误!")
  259. })
  260. Toast.clear()
  261. },
  262. // // 下拉选择属性
  263. // slide(){
  264. // this.showPicker=true
  265. // },
  266. // // 下拉选择赋值
  267. // onConfirm(e){
  268. // this.options=e
  269. // this.showPicker=false
  270. // },
  271. search(){},
  272. timedate(e){
  273. var date=new Date(e)
  274. var year=date.getFullYear()
  275. var month=date.getMonth()+1
  276. month=month>9?month:'0'+month
  277. var day=date.getDate()
  278. day=day>9?day:'0'+day
  279. var hour=date.getHours()
  280. hour=hour>9?hour:'0'+hour
  281. var minute=date.getMinutes()
  282. minute=minute>9?minute:'0'+minute
  283. console.log(month)
  284. if(this.timetype==1){
  285. this.starttime=year+'-'+month+'-'+day+' '+hour+':'+minute
  286. }
  287. if(this.timetype==2){
  288. this.endtime=year+'-'+month+'-'+day+' '+hour+':'+minute
  289. }
  290. this.timeshow=false
  291. },
  292. time(obj){
  293. this.timeshow=true
  294. this.timetype=obj
  295. },
  296. // 状态显示
  297. zt(e){
  298. this.staus=e
  299. this.ztshow=false
  300. },
  301. echart(){
  302. let myChart = this.$echarts.init(document.getElementById('mychart'))
  303. var option = {
  304. tooltip: {
  305. trigger: 'item',
  306. //show: false,
  307. },
  308. legend: {
  309. show:false,
  310. top: '30%',
  311. right: '5%',
  312. orient: 'vertical',
  313. icon: 'circle',
  314. },
  315. series: [
  316. {
  317. name: '派送数据',
  318. type: 'pie',
  319. center:["55%","50%"],
  320. radius: ['80%', '90%'],
  321. avoidLabelOverlap: false,
  322. label: {
  323. normal: {
  324. show: true,
  325. position: 'center',
  326. color:'#4c4a4a',
  327. formatter: '{active|派送率}'+'\n\r' + '{total|' + Number(this.yiPaiSong/this.total*100).toFixed(2) +'%}',
  328. rich: {
  329. total:{
  330. fontSize: 18,
  331. fontWeight:'bold',
  332. color:'#00c4b8'
  333. },
  334. active: {
  335. fontSize: 12,
  336. color:'#6c7a89',
  337. lineHeight:30,
  338. },
  339. }
  340. },
  341. emphasis: {//中间文字显示
  342. show: true,
  343. }
  344. },
  345. color:['#00c4b8','#e1fcfa'],
  346. // emphasis: {
  347. // label: {
  348. // show: false,
  349. // fontSize: '40',
  350. // fontWeight: 'bold'
  351. // }
  352. // },
  353. labelLine: {
  354. show: false
  355. },
  356. data: [
  357. {value: this.yiPaiSong, name: '签收成功'},
  358. {value: this.total-this.yiPaiSong, name: '待派送'},
  359. ]
  360. }
  361. ]
  362. }
  363. myChart.setOption(option)
  364. window.addEventListener("resize", () => {myChart.resize();})
  365. },
  366. swiper(){
  367. var mySwiper = new Swiper(".swiper-container", {
  368. direction: 'vertical',//垂直滚动
  369. //speed: 400,//过渡时间
  370. loop: false,//循环
  371. //observer:true,
  372. autoplay:false,
  373. // autoplay: {
  374. // delay: 5000,//自动滚动|时间
  375. // },
  376. nextButton: '.swiper-button-next',
  377. prevButton: '.swiper-button-prev',
  378. });
  379. }
  380. },
  381. mounted:function(){
  382. this.getData();
  383. this.swiper()
  384. /* setTimeout(()=>{
  385. this.echart()
  386. },1000) */
  387. }
  388. }
  389. </script>
  390. <style scoped lang="less">
  391. .content{
  392. padding: 0.25rem .37rem;
  393. .number{
  394. background: white;
  395. padding: .33rem;
  396. border-radius: .05rem;
  397. font-size: .3rem;
  398. margin-bottom: .2rem;
  399. display: flex;
  400. justify-content: space-between;
  401. .swiper-container{
  402. width: 50%;
  403. height: 2.8rem;
  404. overflow: hidden;
  405. .swiper-slide{
  406. height: 1.2rem !important;
  407. margin-bottom: .2rem;
  408. background: #ebfaf9;
  409. align-items: center;
  410. display: flex;
  411. flex-wrap: wrap;
  412. text-align: center;
  413. div{
  414. width: 100%;
  415. p{
  416. display: block;
  417. text-align: center;
  418. }
  419. p:nth-of-type(1){
  420. font-size: .3rem;
  421. margin-bottom: .1rem;
  422. }
  423. p:nth-of-type(2){
  424. font-size: .24rem;
  425. }
  426. }
  427. }
  428. }
  429. #mychart{
  430. width: 50%;
  431. height: 2.8rem;
  432. }
  433. }
  434. .sm{
  435. margin-bottom: .2rem;
  436. /deep/.van-search{
  437. width: 100%;
  438. height: .76rem;
  439. border-radius: 25px;
  440. overflow: hidden;
  441. padding: 0rem;
  442. background-color: white;
  443. .van-search__content{
  444. background-color: white;
  445. }
  446. input{
  447. background-color: white;
  448. }
  449. }
  450. img{
  451. width:.4rem;
  452. height: .4rem;
  453. position: relative;
  454. top: .18rem;
  455. }
  456. }
  457. .jjlist {
  458. display: flex;
  459. align-items: center;
  460. font-size: .3rem;
  461. color: #999999;
  462. .listinfo {
  463. background: white;
  464. padding: .33rem .33rem .2rem;
  465. border-radius: .05rem;
  466. margin-bottom: .2rem;
  467. position: relative;
  468. .list_top {
  469. display: flex;
  470. justify-content: space-between;
  471. .list_top_left {
  472. img {
  473. display: inline-block;
  474. width: .9rem;
  475. height: .9rem;
  476. position: relative;
  477. top: -.1rem;
  478. }
  479. div {
  480. width: 3.5rem;
  481. margin-left: .2rem;
  482. display: inline-block;
  483. position: relative;
  484. p:nth-of-type(1) {
  485. font-size: .28rem;
  486. color: #333;
  487. font-weight: bold;
  488. }
  489. p:nth-of-type(2) {
  490. font-size: .22rem;
  491. margin: .1rem 0rem;
  492. display: flex;
  493. align-items: center;
  494. span{
  495. background: #fa9c22;
  496. color: white;
  497. border-radius:50% ;
  498. display: inline-block;
  499. width: .4rem;
  500. height: .4rem;
  501. text-align: center;
  502. line-height: .4rem;
  503. margin-right: .1rem;
  504. }
  505. }
  506. p:nth-of-type(3) {
  507. font-size: .22rem;
  508. }
  509. }
  510. }
  511. >p {
  512. font-size: .24rem;
  513. font-weight: bold;
  514. display: flex;
  515. align-items: center;
  516. }
  517. >p:after{
  518. display: none !important;
  519. content: "";
  520. width: .1rem;
  521. height: .1rem;
  522. display: inline-block;
  523. border-right: .01rem solid #7a7a7a;
  524. border-bottom: .01rem solid #7a7a7a;
  525. transform: rotate(45deg);
  526. position: relative;
  527. margin-left: .05rem;
  528. top: -.02rem;
  529. }
  530. .staus1{
  531. color: #f5693d;
  532. }
  533. .staus2{
  534. color: #3d82f5;
  535. }
  536. }
  537. }
  538. }
  539. }
  540. .whrite_add{
  541. width: 6.6rem;
  542. padding: .4rem .2rem;
  543. /deep/.van-field__value{
  544. input{
  545. text-align: right;
  546. }
  547. }
  548. /deep/.van-popup__close-icon--top-right{
  549. top: 5px;
  550. right: 10px;
  551. }
  552. }
  553. .whrite_add2{
  554. width: 6.6rem;
  555. padding: .4rem .2rem;
  556. font-size: .3rem;
  557. /deep/.van-field__value{
  558. input{
  559. text-align: right;
  560. }
  561. }
  562. /deep/.van-popup__close-icon--top-right{
  563. top: 5px;
  564. right: 10px;
  565. }
  566. ul{
  567. li{
  568. padding: 10px 36px 10px 16px;
  569. display: flex;
  570. justify-content: space-between;
  571. position: relative;
  572. i{
  573. position: absolute;
  574. right: 0px;
  575. top:.25rem
  576. }
  577. i:before{
  578. background: #00c4b8;
  579. color: white;
  580. border-radius: 50%;
  581. }
  582. }
  583. }
  584. }
  585. </style>