deliver-record.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  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+'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" >
  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">
  20. <view class="top-viewlabel">申通快递:</view>
  21. <view class="top-viewtext">
  22. <text v-for="(logist,idx) in item.logisticsInformationList" :key="logist.id">{{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">
  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" bgcolor="#F7F7F7" :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. switch(hanldType){
  209. case 'cancel':
  210. this.handCenceConfirm(hanldData)
  211. break
  212. case 'add':
  213. let setProductList =[]
  214. let repleArray =hanldData.logisticsRecordList
  215. repleArray.forEach(el=>{
  216. let elObject = {
  217. orderProductId:el.orderProductID.toString(),
  218. num:el.num.toString()
  219. }
  220. setProductList.push(elObject)
  221. })
  222. let data = {
  223. logisticsBatchId:hanldData.id,
  224. logisticsBatchData:setProductList
  225. }
  226. this.$api.navigateTo(`/supplier/pages/deliver/add-logistics?type=reple&shopOrderId=${this.shopOrderId}&data=${JSON.stringify(data)}`)
  227. break
  228. }
  229. },
  230. handCenceConfirm(data){//取消订单
  231. this.$util.modal('提示','确定要撤销本次发货吗?撤销后需重新发货','确定','取消',true,() =>{
  232. this.ShopService.ShopCancelShipment({ logisticsBatchId : data.id }).then(response =>{
  233. this.$util.msg('撤销成功',2000,true,'success');
  234. setTimeout(()=>{
  235. this.initShopShipmentsRecord()
  236. },2000)
  237. }).catch(error =>{
  238. this.$util.msg(error.msg,2000)
  239. })
  240. })
  241. },
  242. pageGoLink(){
  243. this.$api.navigateTo('/supplier/pages/deliver/deliver-goods?shopOrderId='+this.shopOrderId)
  244. },
  245. hanldPageDetails(){
  246. this.$api.navigateTo('/supplier/pages/order/order-details?shopOrderId='+this.shopOrderId)
  247. }
  248. },
  249. onPullDownRefresh() {//下拉刷新
  250. this.initShopShipmentsRecord()
  251. uni.stopPullDownRefresh()
  252. },
  253. onReachBottom() {
  254. if(this.hasNextPage){
  255. this.loadding = true
  256. this.pullUpOn = true
  257. this.getOnReachBottomData()
  258. }
  259. },
  260. onShow(){
  261. },
  262. }
  263. </script>
  264. <style lang="scss">
  265. page{
  266. background: #f7f7f7;
  267. height: auto;
  268. }
  269. .record-content{
  270. position: relative;
  271. border-top: 1px solid #EBEBEB;
  272. }
  273. .record-content-empty{
  274. width: 100%;
  275. height: 100%;
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. .record-container{
  280. width: 400rpx;
  281. height: auto;
  282. image{
  283. width: 400rpx;
  284. height: 400rpx;
  285. display: block;
  286. }
  287. .txt{
  288. font-size: $font-size-28;
  289. text-align: center;
  290. color: #333;
  291. line-height: 30rpx;
  292. margin-bottom: 20rpx;
  293. }
  294. .btn{
  295. width: 400rpx;
  296. height: 80rpx;
  297. background: $btn-confirm;
  298. border-radius: 10rpx;
  299. line-height: 80rpx;
  300. font-size: $font-size-28;
  301. text-align: center;
  302. color: #FFFFFF;
  303. }
  304. }
  305. }
  306. .record-list{
  307. width: 100%;
  308. height: auto;
  309. background-color: #F7F7F7;
  310. margin-bottom: 24rpx;
  311. .record-top{
  312. width: 702rpx;
  313. padding: 20rpx 24rpx;
  314. height: auto;
  315. border-bottom: 2px solid #FF9100;
  316. background-color: #FFF;
  317. .top-view{
  318. width: 100%;
  319. height: auto;
  320. float: left;
  321. line-height: 50rpx;
  322. font-size: $font-size-28;
  323. color: #333333;
  324. display: flex;
  325. .top-viewlabel{
  326. width: 130rpx;
  327. margin-right: 10rpx;
  328. }
  329. .top-viewtext{
  330. width:562rpx;
  331. height: auto;
  332. text{
  333. display: inline-block;
  334. margin-right: 30rpx;
  335. }
  336. }
  337. }
  338. }
  339. .goods-pros{
  340. width: 702rpx;
  341. padding: 0 24rpx;
  342. background: #FFFFFF;
  343. }
  344. .goods-pros-t{
  345. display: flex;
  346. width: 100%;
  347. height: auto;
  348. padding:20rpx 0;
  349. .pros-img{
  350. width: 210rpx;
  351. height: 210rpx;
  352. border-radius: 10rpx;
  353. margin:0 20rpx;
  354. border:1px solid #f3f3f3;
  355. margin-left: 0;
  356. image{
  357. width: 100%;
  358. height: 100%;
  359. border-radius: 10rpx;
  360. }
  361. }
  362. .pros-product{
  363. width: 492rpx;
  364. height: 100%;
  365. line-height: 36rpx;
  366. font-size: $font-size-28;
  367. position: relative;
  368. .producttitle{
  369. width: 100%;
  370. display: inline-block;
  371. height: auto;
  372. text-overflow:ellipsis;
  373. display: -webkit-box;
  374. word-break: break-all;
  375. -webkit-box-orient: vertical;
  376. -webkit-line-clamp: 2;
  377. overflow: hidden;
  378. margin-bottom: 8rpx;
  379. }
  380. .productspec{
  381. height: 44rpx;
  382. color: #999999;
  383. line-height: 44rpx;
  384. font-size: $font-size-26;
  385. }
  386. .product-view{
  387. width: 100%;
  388. height: auto;
  389. display: flex;
  390. .view-num{
  391. flex: 1;
  392. text-align: left;
  393. font-size: $font-size-26;
  394. color: #666666;
  395. line-height: 44rpx;
  396. }
  397. }
  398. }
  399. }
  400. .goods-pros-b{
  401. width:100%;
  402. height: auto;
  403. padding: 10rpx 0;
  404. border-top: 1px solid #F7F7F7;
  405. border-bottom: 1px solid #F7F7F7;
  406. position: relative;
  407. .b-label{
  408. width: 100%;
  409. line-height: 70rpx;
  410. font-size: $font-size-28;
  411. color: $text-color;
  412. }
  413. .b-photo{
  414. width: 100%;
  415. height: auto;
  416. padding: 10rpx 0;
  417. .b-imageView{
  418. width: 112rpx;
  419. height: 112rpx;
  420. margin: 0 20rpx 20rpx 0;
  421. float: left;
  422. image{
  423. width: 112rpx;
  424. height: 112rpx;
  425. display: block;
  426. }
  427. }
  428. .text{
  429. line-height: 44rpx;
  430. font-size: $font-size-28;
  431. color: $text-color;
  432. }
  433. }
  434. .goods-pros-m{
  435. width: 100%;
  436. height: auto;
  437. line-height: 76rpx;
  438. font-size: $font-size-26;
  439. color: $text-color;
  440. float: left;
  441. padding: 10rpx 0;
  442. border-top: 1px solid #F7F7F7;
  443. border-bottom: 1px solid #F7F7F7;
  444. .m-text{
  445. width: 62rpx;
  446. float: left;
  447. padding-right: 20rpx;
  448. font-weight:bold;
  449. }
  450. .m-input{
  451. display: -webkit-box;
  452. display: -webkit-flex;
  453. display: flex;
  454. -webkit-box-align: center;
  455. -webkit-align-items: center;
  456. align-items: center;
  457. position: relative;
  458. width: 620rpx;
  459. height: auto;
  460. padding: 20rpx 0 10rpx 0;
  461. background: #FFFFFF;
  462. .text{
  463. width: 100%;
  464. height: 100%;
  465. font-size: $font-size-26;
  466. line-height: 36rpx;
  467. color: #333333;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. </style>