deliver-record.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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. shopOrderId:'',
  100. lgisList:[],
  101. ramkesList:[],
  102. RecordList:[], //发货记录
  103. pageNum:1,
  104. pageSize:10,
  105. hasNextPage:false,
  106. loadding: false,
  107. pullUpOn: true,
  108. pullFlag: true,
  109. isEmpty:false,
  110. nomoreText: '上拉显示更多',
  111. scrollHeight: '',
  112. windowHeight: '',
  113. }
  114. },
  115. onLoad(option){
  116. this.shopOrderId = option.shopOrderId
  117. this.setScrollHeight()
  118. this.initShopShipmentsRecord();
  119. },
  120. computed: {
  121. ...mapState(['hasLogin','userInfo'])
  122. },
  123. methods:{
  124. initShopShipmentsRecord(){//初始化发货记录 index:1
  125. this.ShopService.ShopShipmentsRecord({ shopOrderId : this.shopOrderId,pageSize:this.pageSize,pageNum:this.pageNum }).then(response =>{
  126. console.log(response)
  127. let responseData = response.data.logisticsBatchPage
  128. if(responseData.results&&responseData.results.length > 0){
  129. this.isEmpty = false
  130. this.hasNextPage = responseData.hasNextPage
  131. this.RecordList =responseData.results
  132. this.pullFlag = false;
  133. setTimeout(()=>{this.pullFlag = true;},500)
  134. if(this.hasNextPage){
  135. this.pullUpOn = false
  136. this.nomoreText = '上拉显示更多'
  137. }else{
  138. if(this.RecordList.length < 2){
  139. this.pullUpOn = true
  140. this.loadding = false
  141. }else{
  142. this.pullUpOn = false
  143. this.loadding = false
  144. this.nomoreText = '已至底部'
  145. }
  146. }
  147. }else{
  148. this.isEmpty = true
  149. }
  150. }).catch(error =>{
  151. this.$util.msg(error.msg,2000);
  152. })
  153. },
  154. getOnReachBottomData(){
  155. this.ShopService.ShopShipmentsRecord({ shopOrderId : this.shopOrderId,pageSize:this.pageSize,pageNum:this.pageNum+=1 }).then(response =>{
  156. let responseData = response.data.logisticsBatchPage
  157. if(responseData.results&&responseData.results.length > 0){
  158. this.hasNextPage = responseData.hasNextPage
  159. this.RecordList = this.RecordList.concat(responseData.results)
  160. this.pullFlag = false;// 防上拉暴滑
  161. setTimeout(()=>{this.pullFlag = true;},500)
  162. if(this.hasNextPage){
  163. this.pullUpOn = false
  164. this.nomoreText = '上拉显示更多'
  165. }else{
  166. this.pullUpOn = false
  167. this.loadding = false
  168. this.nomoreText = '已至底部'
  169. }
  170. }
  171. }).catch(error =>{
  172. this.$util.msg(error.msg,2000)
  173. })
  174. },
  175. setHeaderBtnPosi(){// 获得胶囊按钮位置信息
  176. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  177. return headerBtnPosi
  178. },
  179. setSysteminfo(){ // 获取设备信息
  180. let systeminfo;
  181. uni.getSystemInfo({
  182. success: (res) => {
  183. systeminfo = res
  184. },
  185. })
  186. return systeminfo
  187. },
  188. setScrollHeight() {
  189. const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
  190. this.windowHeight = windowHeight - 1;
  191. this.scrollHeight = windowHeight - 1;
  192. },
  193. previewImg (index,previewUrls) {//顶部商品图片预览
  194. isPreviewImg = true
  195. uni.previewImage({
  196. current: index, //图片索引
  197. urls: previewUrls, //必须是http图片,本地图片无效
  198. longPressActions:''
  199. })
  200. },
  201. handButtonConfirm(data){//监听点击时间的按钮类型并执行...
  202. // console.log(data)
  203. this.handShowAlert(data)
  204. },
  205. handShowAlert(data){//判断点击的按钮类型并执行...
  206. let hanldType = data.hanldType
  207. let hanldData = data.hanldData
  208. console.log(hanldData);
  209. switch(hanldType){
  210. case 'cancel':
  211. this.handCenceConfirm(hanldData)
  212. break
  213. case 'add':
  214. let setProductList =[]
  215. let repleArray =hanldData.logisticsRecordList
  216. repleArray.forEach(el=>{
  217. let elObject = {
  218. orderProductId:el.orderProductID.toString(),
  219. num:el.num.toString()
  220. }
  221. setProductList.push(elObject)
  222. })
  223. let data = {
  224. logisticsBatchId:hanldData.id,
  225. logisticsBatchData:setProductList
  226. }
  227. this.$api.navigateTo(`/pages/supplier/deliver/add-logistics?type=reple&shopOrderId=${this.shopOrderId}&data=${JSON.stringify(data)}`)
  228. break
  229. case 'qualifications':
  230. this.$api.navigateTo(`/pages/supplier/deliver/qualifications-details?logisticsBatchId=${hanldData.id}&shopOrderId=${this.shopOrderId}`)
  231. break
  232. }
  233. },
  234. handCenceConfirm(data){//取消订单
  235. this.$util.modal('提示','确定要撤销本次发货吗?撤销后需重新发货','确定','取消',true,() =>{
  236. this.ShopService.ShopCancelShipment({ logisticsBatchId : data.id }).then(response =>{
  237. this.$util.msg('撤销成功',2000,true,'success');
  238. setTimeout(()=>{
  239. this.initShopShipmentsRecord()
  240. },2000)
  241. }).catch(error =>{
  242. this.$util.msg(error.msg,2000)
  243. })
  244. })
  245. },
  246. pageGoLink(){
  247. this.$api.navigateTo('/pages/supplier/deliver/deliver-goods?shopOrderId='+this.shopOrderId)
  248. },
  249. hanldPageDetails(){
  250. this.$api.navigateTo('/pages/supplier/order/order-details?shopOrderId='+this.shopOrderId)
  251. }
  252. },
  253. onPullDownRefresh() {//下拉刷新
  254. this.initShopShipmentsRecord()
  255. uni.stopPullDownRefresh()
  256. },
  257. onReachBottom() {
  258. if(this.hasNextPage){
  259. this.loadding = true
  260. this.pullUpOn = true
  261. this.getOnReachBottomData()
  262. }
  263. },
  264. onShow(){
  265. },
  266. }
  267. </script>
  268. <style lang="scss">
  269. page{
  270. background: #f7f7f7;
  271. height: auto;
  272. }
  273. .record-content{
  274. position: relative;
  275. border-top: 1px solid #EBEBEB;
  276. .scroll-view{
  277. height: 100%;
  278. }
  279. }
  280. .record-content-empty{
  281. width: 100%;
  282. height: 100%;
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. .record-container{
  287. width: 400rpx;
  288. height: auto;
  289. image{
  290. width: 400rpx;
  291. height: 400rpx;
  292. display: block;
  293. }
  294. .txt{
  295. font-size: $font-size-28;
  296. text-align: center;
  297. color: #333;
  298. line-height: 30rpx;
  299. margin-bottom: 20rpx;
  300. }
  301. .btn{
  302. width: 400rpx;
  303. height: 80rpx;
  304. background: $btn-confirm;
  305. border-radius: 40rpx;
  306. line-height: 80rpx;
  307. font-size: $font-size-28;
  308. text-align: center;
  309. color: #FFFFFF;
  310. }
  311. }
  312. }
  313. .record-list{
  314. width: 100%;
  315. height: auto;
  316. background-color: #F7F7F7;
  317. margin-bottom: 24rpx;
  318. .record-top{
  319. width: 702rpx;
  320. padding: 20rpx 24rpx;
  321. height: auto;
  322. background-color: #FFF;
  323. margin-bottom: 20rpx;
  324. .top-view{
  325. width: 100%;
  326. height: auto;
  327. float: left;
  328. line-height: 50rpx;
  329. font-size: $font-size-28;
  330. color: #333333;
  331. display: flex;
  332. .top-viewlabel{
  333. width: 130rpx;
  334. margin-right: 10rpx;
  335. color: #999999;
  336. }
  337. .top-viewtext{
  338. width:562rpx;
  339. height: auto;
  340. text{
  341. display: inline-block;
  342. margin-right: 30rpx;
  343. }
  344. }
  345. }
  346. }
  347. .goods-pros{
  348. width: 702rpx;
  349. padding: 0 24rpx;
  350. background: #FFFFFF;
  351. }
  352. .goods-pros-t{
  353. display: flex;
  354. width: 100%;
  355. height: auto;
  356. padding:20rpx 0;
  357. .pros-img{
  358. width: 210rpx;
  359. height: 210rpx;
  360. border-radius: 10rpx;
  361. margin:0 20rpx;
  362. border:1px solid #f3f3f3;
  363. margin-left: 0;
  364. image{
  365. width: 100%;
  366. height: 100%;
  367. border-radius: 10rpx;
  368. }
  369. }
  370. .pros-product{
  371. width: 492rpx;
  372. height: 100%;
  373. line-height: 36rpx;
  374. font-size: $font-size-28;
  375. position: relative;
  376. .producttitle{
  377. width: 100%;
  378. display: inline-block;
  379. height: auto;
  380. text-overflow:ellipsis;
  381. display: -webkit-box;
  382. word-break: break-all;
  383. -webkit-box-orient: vertical;
  384. -webkit-line-clamp: 2;
  385. overflow: hidden;
  386. margin-bottom: 8rpx;
  387. }
  388. .productspec{
  389. height: 44rpx;
  390. color: #999999;
  391. line-height: 44rpx;
  392. font-size: $font-size-26;
  393. }
  394. .product-view{
  395. width: 100%;
  396. height: auto;
  397. display: flex;
  398. .view-num{
  399. flex: 1;
  400. text-align: left;
  401. font-size: $font-size-26;
  402. color: #666666;
  403. line-height: 44rpx;
  404. }
  405. }
  406. }
  407. }
  408. .goods-pros-b{
  409. width:100%;
  410. height: auto;
  411. padding: 10rpx 0;
  412. border-top: 1px solid #F7F7F7;
  413. border-bottom: 1px solid #F7F7F7;
  414. position: relative;
  415. .b-label{
  416. width: 100%;
  417. line-height: 70rpx;
  418. font-size: $font-size-28;
  419. color: $text-color;
  420. }
  421. .b-photo{
  422. width: 100%;
  423. height: auto;
  424. padding: 10rpx 0;
  425. .b-imageView{
  426. width: 112rpx;
  427. height: 112rpx;
  428. margin: 0 20rpx 20rpx 0;
  429. float: left;
  430. image{
  431. width: 112rpx;
  432. height: 112rpx;
  433. display: block;
  434. }
  435. }
  436. .text{
  437. line-height: 44rpx;
  438. font-size: $font-size-28;
  439. color: $text-color;
  440. }
  441. }
  442. .goods-pros-m{
  443. width: 100%;
  444. height: auto;
  445. line-height: 76rpx;
  446. font-size: $font-size-26;
  447. color: $text-color;
  448. float: left;
  449. padding: 10rpx 0;
  450. border-top: 1px solid #F7F7F7;
  451. border-bottom: 1px solid #F7F7F7;
  452. .m-text{
  453. width: 62rpx;
  454. float: left;
  455. padding-right: 20rpx;
  456. font-weight:bold;
  457. }
  458. .m-input{
  459. display: -webkit-box;
  460. display: -webkit-flex;
  461. display: flex;
  462. -webkit-box-align: center;
  463. -webkit-align-items: center;
  464. align-items: center;
  465. position: relative;
  466. width: 620rpx;
  467. height: auto;
  468. padding: 20rpx 0 10rpx 0;
  469. background: #FFFFFF;
  470. .text{
  471. width: 100%;
  472. height: 100%;
  473. font-size: $font-size-26;
  474. line-height: 36rpx;
  475. color: #333333;
  476. }
  477. }
  478. }
  479. }
  480. }
  481. </style>