deliver-record.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. <template>
  2. <view class="container record clearfix" :style="{paddingTop:CustomBar+'px'}">
  3. <cd-custom :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi" :page='1' @pageDetails="hanldPageDetails"></cd-custom>
  4. <view class="record-content-empty" v-if="isEmpty" :style="{'height': windowHeight ? windowHeight - CustomBar+'px' : 'auto'}">
  5. <view class="record-container clearfix">
  6. <image class="club-empty-image" src="https://img.caimei365.com/group1/M00/03/B7/Cmis2178OfaAEjhLAABqsz9OXM0847.png" mode="aspectFit"></image>
  7. <view class="txt">此订单暂无发货记录~</view>
  8. <view class="btn" @click="pageGoLink">去发货</view>
  9. </view>
  10. </view>
  11. <view class="record-content" v-else>
  12. <scroll-view scroll-y="true" class="scroll-view">
  13. <view class="record-list clearfix" v-for="(item,index) in RecordList" :key="index">
  14. <view class="record-top clearfix">
  15. <view class="top-view">
  16. <view class="top-viewlabel">发货时间:</view>
  17. <view class="top-viewtext">{{item.deliveryTime}}</view>
  18. </view>
  19. <view class="top-view" v-for="(logist,idx) in item.logisticsInformationList" :key="logist.id">
  20. <view class="top-viewlabel">{{logist.logisticsCompanyName}}:</view>
  21. <view class="top-viewtext">
  22. <text>{{logist.nu}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="goods-pros">
  27. <view class="goods-pros-t" v-for="(pros,idx) in item.logisticsRecordList" :key="pros.id">
  28. <view class="pros-img"><image :src="pros.image ? pros.image:''" alt="" mode="aspectFill"/></view>
  29. <view class="pros-product">
  30. <view class="producttitle">{{pros.productName}}</view>
  31. <view class="productspec">规格:{{pros.unit ? pros.unit : ''}}</view>
  32. <view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
  33. <view class="product-view">
  34. <view class="view-num">数量:{{pros.buyNum}}</view>
  35. </view>
  36. <view class="product-view">
  37. <view class="view-num">本次发货:{{pros.num}}</view>
  38. <view class="view-num">已发货:{{pros.shipmentsNum}}</view>
  39. </view>
  40. <view class="product-view">
  41. <view class="view-num">未发货:{{pros.notShippedNum}}</view>
  42. <view class="view-num">已退货:{{pros.returnedNum}}</view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="goods-pros-b clearfix" v-show="item.remarkImages.length>0">
  47. <view class="b-label">拍照备注</view>
  48. <view class="b-photo">
  49. <view class="b-imageView" v-for="(imgItem,imgIdx) in item.remarkImages" :key="imgIdx" >
  50. <image :src="imgItem" mode="aspectFill" @click="previewImg(imgIdx,item.remarkImages)"></image>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="goods-pros-b clearfix" v-if="item.remark!=''">
  55. <view class="b-label">文字备注</view>
  56. <view class="b-photo">
  57. <view class="text">{{item.remark ? item.remark : ''}}</view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 底部button -->
  62. <order-button ref="orderButton"
  63. :hanldData="item"
  64. @buttonConfirm="handButtonConfirm">
  65. </order-button>
  66. </view>
  67. <!--加载loadding-->
  68. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  69. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  70. <!--加载loadding-->
  71. </scroll-view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import { mapState,mapMutations } from 'vuex';
  77. import orderButton from '@/components/cm-module/orderDetails/supplierRecorgButton.vue' //底部按钮
  78. import tuiLoadmore from "@/components/tui-components/loadmore/loadmore"
  79. import tuiNomore from "@/components/tui-components/nomore/nomore"
  80. import cdCustom from "@/components/cm-custom/custom-d"
  81. var isPreviewImg
  82. export default{
  83. components:{
  84. orderButton,
  85. tuiLoadmore,
  86. tuiNomore,
  87. cdCustom
  88. },
  89. data(){
  90. return{
  91. nvabarData: {//顶部自定义导航
  92. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
  93. title: '发货记录', // 导航栏 中间的标题
  94. },
  95. headerBtnPosi: this.setHeaderBtnPosi(),//获取设备顶部胶囊高度
  96. systeminfo:this.setSysteminfo(), //获取设备信息
  97. CustomBar:this.CustomBar,// 顶部导航栏高度
  98. isIphoneX:this.$store.state.isIphoneX,
  99. listQuery:{
  100. shopOrderId:0,
  101. pageNum:1,
  102. pageSize:10,
  103. },
  104. lgisList:[],
  105. ramkesList:[],
  106. RecordList:[], //发货记录
  107. hasNextPage:false,
  108. loadding: false,
  109. pullUpOn: true,
  110. pullFlag: true,
  111. isEmpty:false,
  112. nomoreText: '上拉显示更多',
  113. scrollHeight: '',
  114. windowHeight: '',
  115. mobile:0
  116. }
  117. },
  118. onLoad(option){
  119. this.listQuery.shopOrderId = option.shopOrderId
  120. this.setScrollHeight()
  121. this.initShopShipmentsRecord();
  122. },
  123. computed: {
  124. ...mapState(['hasLogin','userInfo'])
  125. },
  126. methods:{
  127. initShopShipmentsRecord(){//初始化发货记录 index:1
  128. this.ShopService.ShopShipmentsRecord(this.listQuery).then(response =>{
  129. console.log(response)
  130. let data = response.data
  131. let logisticsBatchPage = data.logisticsBatchPage
  132. this.mobile = data.userInfo.mobile
  133. if(logisticsBatchPage.list&&logisticsBatchPage.list.length > 0){
  134. this.isEmpty = false
  135. this.hasNextPage = logisticsBatchPage.hasNextPage
  136. this.RecordList =logisticsBatchPage.list
  137. this.pullFlag = false;
  138. setTimeout(()=>{this.pullFlag = true;},500)
  139. if(this.hasNextPage){
  140. this.pullUpOn = false
  141. this.nomoreText = '上拉显示更多'
  142. }else{
  143. if(this.RecordList.length < 2){
  144. this.pullUpOn = true
  145. this.loadding = false
  146. }else{
  147. this.pullUpOn = false
  148. this.loadding = false
  149. this.nomoreText = '已至底部'
  150. }
  151. }
  152. }else{
  153. this.isEmpty = true
  154. }
  155. }).catch(error =>{
  156. this.$util.msg(error.msg,2000);
  157. })
  158. },
  159. getOnReachBottomData(){
  160. this.listQuery.pageNum+=1
  161. this.ShopService.ShopShipmentsRecord(this.listQuery).then(response =>{
  162. let data = response.data.logisticsBatchPage
  163. if(data.list&&data.list.length > 0){
  164. this.hasNextPage = data.hasNextPage
  165. this.RecordList = this.RecordList.concat(data.list)
  166. this.pullFlag = false;// 防上拉暴滑
  167. setTimeout(()=>{this.pullFlag = true;},500)
  168. if(this.hasNextPage){
  169. this.pullUpOn = false
  170. this.nomoreText = '上拉显示更多'
  171. }else{
  172. this.pullUpOn = false
  173. this.loadding = false
  174. this.nomoreText = '已至底部'
  175. }
  176. }
  177. }).catch(error =>{
  178. this.$util.msg(error.msg,2000)
  179. })
  180. },
  181. setHeaderBtnPosi(){// 获得胶囊按钮位置信息
  182. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  183. return headerBtnPosi
  184. },
  185. setSysteminfo(){ // 获取设备信息
  186. let systeminfo;
  187. uni.getSystemInfo({
  188. success: (res) => {
  189. systeminfo = res
  190. },
  191. })
  192. return systeminfo
  193. },
  194. setScrollHeight() {
  195. const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
  196. this.windowHeight = windowHeight - 1;
  197. this.scrollHeight = windowHeight - 1;
  198. },
  199. previewImg (index,previewUrls) {//顶部商品图片预览
  200. isPreviewImg = true
  201. uni.previewImage({
  202. current: index, //图片索引
  203. urls: previewUrls, //必须是http图片,本地图片无效
  204. longPressActions:''
  205. })
  206. },
  207. handButtonConfirm(data){//监听点击时间的按钮类型并执行...
  208. // console.log(data)
  209. this.handShowAlert(data)
  210. },
  211. handShowAlert(data){//判断点击的按钮类型并执行...
  212. let hanldType = data.hanldType
  213. let hanldData = data.hanldData
  214. console.log(hanldData);
  215. switch(hanldType){
  216. case 'cancel':
  217. this.handCenceConfirm(hanldData)
  218. break
  219. case 'add':
  220. let setProductList =[]
  221. let repleArray =hanldData.logisticsRecordList
  222. repleArray.forEach(el=>{
  223. let elObject = {
  224. orderProductId:el.orderProductId,
  225. num:el.num
  226. }
  227. setProductList.push(elObject)
  228. })
  229. let data = {
  230. logisticsBatchId:hanldData.id,
  231. logisticsBatchData:setProductList
  232. }
  233. this.$api.navigateTo(`/pages/supplier/deliver/add-logistics?type=reple&mobile=${this.mobile}&shopOrderId=${this.listQuery.shopOrderId}&data=${JSON.stringify(data)}`)
  234. break
  235. case 'qualifications':
  236. this.$api.navigateTo(`/pages/supplier/deliver/qualifications-details?logisticsBatchId=${hanldData.id}&shopOrderId=${this.listQuery.shopOrderId}`)
  237. break
  238. }
  239. },
  240. handCenceConfirm(data){//取消订单
  241. this.$util.modal('提示','确定要撤销本次发货吗?撤销后需重新发货','确定','取消',true,() =>{
  242. this.ShopService.ShopCancelShipment({ logisticsBatchId : data.id }).then(response =>{
  243. this.$util.msg('撤销成功',2000,true,'success');
  244. setTimeout(()=>{
  245. this.initShopShipmentsRecord()
  246. },2000)
  247. }).catch(error =>{
  248. this.$util.msg(error.msg,2000)
  249. })
  250. })
  251. },
  252. pageGoLink(){
  253. this.$api.navigateTo('/pages/supplier/deliver/deliver-goods?shopOrderId='+this.listQuery.shopOrderId)
  254. },
  255. hanldPageDetails(){
  256. this.$api.navigateTo('/pages/supplier/order/order-details?shopOrderId='+this.listQuery.shopOrderId)
  257. }
  258. },
  259. onPullDownRefresh() {//下拉刷新
  260. this.initShopShipmentsRecord()
  261. uni.stopPullDownRefresh()
  262. },
  263. onReachBottom() {
  264. if(this.hasNextPage){
  265. this.loadding = true
  266. this.pullUpOn = true
  267. this.getOnReachBottomData()
  268. }
  269. },
  270. onShow(){
  271. },
  272. }
  273. </script>
  274. <style lang="scss">
  275. page{
  276. background: #f7f7f7;
  277. height: auto;
  278. }
  279. .record-content{
  280. position: relative;
  281. border-top: 1px solid #EBEBEB;
  282. .scroll-view{
  283. height: 100%;
  284. }
  285. }
  286. .record-content-empty{
  287. width: 100%;
  288. height: 100%;
  289. display: flex;
  290. align-items: center;
  291. justify-content: center;
  292. .record-container{
  293. width: 400rpx;
  294. height: auto;
  295. image{
  296. width: 400rpx;
  297. height: 400rpx;
  298. display: block;
  299. }
  300. .txt{
  301. font-size: $font-size-28;
  302. text-align: center;
  303. color: #333;
  304. line-height: 30rpx;
  305. margin-bottom: 20rpx;
  306. }
  307. .btn{
  308. width: 400rpx;
  309. height: 80rpx;
  310. background: $btn-confirm;
  311. border-radius: 40rpx;
  312. line-height: 80rpx;
  313. font-size: $font-size-28;
  314. text-align: center;
  315. color: #FFFFFF;
  316. }
  317. }
  318. }
  319. .record-list{
  320. width: 100%;
  321. height: auto;
  322. background-color: #F7F7F7;
  323. margin-bottom: 24rpx;
  324. .record-top{
  325. width: 702rpx;
  326. padding: 20rpx 24rpx;
  327. height: auto;
  328. background-color: #FFF;
  329. margin-bottom: 20rpx;
  330. .top-view{
  331. width: 100%;
  332. height: auto;
  333. float: left;
  334. line-height: 50rpx;
  335. font-size: $font-size-28;
  336. color: #333333;
  337. display: flex;
  338. .top-viewlabel{
  339. width: 130rpx;
  340. margin-right: 10rpx;
  341. color: #999999;
  342. }
  343. .top-viewtext{
  344. width:562rpx;
  345. height: auto;
  346. text{
  347. display: inline-block;
  348. margin-right: 30rpx;
  349. }
  350. }
  351. }
  352. }
  353. .goods-pros{
  354. width: 702rpx;
  355. padding: 0 24rpx;
  356. background: #FFFFFF;
  357. }
  358. .goods-pros-t{
  359. display: flex;
  360. width: 100%;
  361. height: auto;
  362. padding:20rpx 0;
  363. .pros-img{
  364. width: 210rpx;
  365. height: 210rpx;
  366. border-radius: 10rpx;
  367. margin:0 20rpx;
  368. border:1px solid #f3f3f3;
  369. margin-left: 0;
  370. image{
  371. width: 100%;
  372. height: 100%;
  373. border-radius: 10rpx;
  374. }
  375. }
  376. .pros-product{
  377. width: 492rpx;
  378. height: 100%;
  379. line-height: 36rpx;
  380. font-size: $font-size-28;
  381. position: relative;
  382. .producttitle{
  383. width: 100%;
  384. display: inline-block;
  385. height: auto;
  386. text-overflow:ellipsis;
  387. display: -webkit-box;
  388. word-break: break-all;
  389. -webkit-box-orient: vertical;
  390. -webkit-line-clamp: 2;
  391. overflow: hidden;
  392. margin-bottom: 8rpx;
  393. }
  394. .productspec{
  395. height: 44rpx;
  396. color: #999999;
  397. line-height: 44rpx;
  398. font-size: $font-size-26;
  399. }
  400. .product-view{
  401. width: 100%;
  402. height: auto;
  403. display: flex;
  404. .view-num{
  405. flex: 1;
  406. text-align: left;
  407. font-size: $font-size-26;
  408. color: #666666;
  409. line-height: 44rpx;
  410. }
  411. }
  412. }
  413. }
  414. .goods-pros-b{
  415. width:100%;
  416. height: auto;
  417. padding: 10rpx 0;
  418. border-top: 1px solid #F7F7F7;
  419. border-bottom: 1px solid #F7F7F7;
  420. position: relative;
  421. .b-label{
  422. width: 100%;
  423. line-height: 70rpx;
  424. font-size: $font-size-28;
  425. color: $text-color;
  426. }
  427. .b-photo{
  428. width: 100%;
  429. height: auto;
  430. padding: 10rpx 0;
  431. .b-imageView{
  432. width: 112rpx;
  433. height: 112rpx;
  434. margin: 0 20rpx 20rpx 0;
  435. float: left;
  436. image{
  437. width: 112rpx;
  438. height: 112rpx;
  439. display: block;
  440. }
  441. }
  442. .text{
  443. line-height: 44rpx;
  444. font-size: $font-size-28;
  445. color: $text-color;
  446. }
  447. }
  448. .goods-pros-m{
  449. width: 100%;
  450. height: auto;
  451. line-height: 76rpx;
  452. font-size: $font-size-26;
  453. color: $text-color;
  454. float: left;
  455. padding: 10rpx 0;
  456. border-top: 1px solid #F7F7F7;
  457. border-bottom: 1px solid #F7F7F7;
  458. .m-text{
  459. width: 62rpx;
  460. float: left;
  461. padding-right: 20rpx;
  462. font-weight:bold;
  463. }
  464. .m-input{
  465. display: -webkit-box;
  466. display: -webkit-flex;
  467. display: flex;
  468. -webkit-box-align: center;
  469. -webkit-align-items: center;
  470. align-items: center;
  471. position: relative;
  472. width: 620rpx;
  473. height: auto;
  474. padding: 20rpx 0 10rpx 0;
  475. background: #FFFFFF;
  476. .text{
  477. width: 100%;
  478. height: 100%;
  479. font-size: $font-size-26;
  480. line-height: 36rpx;
  481. color: #333333;
  482. }
  483. }
  484. }
  485. }
  486. }
  487. </style>