deliver-record.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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. 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. .scroll-view{
  273. height: 100%;
  274. }
  275. }
  276. .record-content-empty{
  277. width: 100%;
  278. height: 100%;
  279. display: flex;
  280. align-items: center;
  281. justify-content: center;
  282. .record-container{
  283. width: 400rpx;
  284. height: auto;
  285. image{
  286. width: 400rpx;
  287. height: 400rpx;
  288. display: block;
  289. }
  290. .txt{
  291. font-size: $font-size-28;
  292. text-align: center;
  293. color: #333;
  294. line-height: 30rpx;
  295. margin-bottom: 20rpx;
  296. }
  297. .btn{
  298. width: 400rpx;
  299. height: 80rpx;
  300. background: $btn-confirm;
  301. border-radius: 40rpx;
  302. line-height: 80rpx;
  303. font-size: $font-size-28;
  304. text-align: center;
  305. color: #FFFFFF;
  306. }
  307. }
  308. }
  309. .record-list{
  310. width: 100%;
  311. height: auto;
  312. background-color: #F7F7F7;
  313. margin-bottom: 24rpx;
  314. .record-top{
  315. width: 702rpx;
  316. padding: 20rpx 24rpx;
  317. height: auto;
  318. border-bottom: 2px solid #FF9100;
  319. background-color: #FFF;
  320. .top-view{
  321. width: 100%;
  322. height: auto;
  323. float: left;
  324. line-height: 50rpx;
  325. font-size: $font-size-28;
  326. color: #333333;
  327. display: flex;
  328. .top-viewlabel{
  329. width: 130rpx;
  330. margin-right: 10rpx;
  331. }
  332. .top-viewtext{
  333. width:562rpx;
  334. height: auto;
  335. text{
  336. display: inline-block;
  337. margin-right: 30rpx;
  338. }
  339. }
  340. }
  341. }
  342. .goods-pros{
  343. width: 702rpx;
  344. padding: 0 24rpx;
  345. background: #FFFFFF;
  346. }
  347. .goods-pros-t{
  348. display: flex;
  349. width: 100%;
  350. height: auto;
  351. padding:20rpx 0;
  352. .pros-img{
  353. width: 210rpx;
  354. height: 210rpx;
  355. border-radius: 10rpx;
  356. margin:0 20rpx;
  357. border:1px solid #f3f3f3;
  358. margin-left: 0;
  359. image{
  360. width: 100%;
  361. height: 100%;
  362. border-radius: 10rpx;
  363. }
  364. }
  365. .pros-product{
  366. width: 492rpx;
  367. height: 100%;
  368. line-height: 36rpx;
  369. font-size: $font-size-28;
  370. position: relative;
  371. .producttitle{
  372. width: 100%;
  373. display: inline-block;
  374. height: auto;
  375. text-overflow:ellipsis;
  376. display: -webkit-box;
  377. word-break: break-all;
  378. -webkit-box-orient: vertical;
  379. -webkit-line-clamp: 2;
  380. overflow: hidden;
  381. margin-bottom: 8rpx;
  382. }
  383. .productspec{
  384. height: 44rpx;
  385. color: #999999;
  386. line-height: 44rpx;
  387. font-size: $font-size-26;
  388. }
  389. .product-view{
  390. width: 100%;
  391. height: auto;
  392. display: flex;
  393. .view-num{
  394. flex: 1;
  395. text-align: left;
  396. font-size: $font-size-26;
  397. color: #666666;
  398. line-height: 44rpx;
  399. }
  400. }
  401. }
  402. }
  403. .goods-pros-b{
  404. width:100%;
  405. height: auto;
  406. padding: 10rpx 0;
  407. border-top: 1px solid #F7F7F7;
  408. border-bottom: 1px solid #F7F7F7;
  409. position: relative;
  410. .b-label{
  411. width: 100%;
  412. line-height: 70rpx;
  413. font-size: $font-size-28;
  414. color: $text-color;
  415. }
  416. .b-photo{
  417. width: 100%;
  418. height: auto;
  419. padding: 10rpx 0;
  420. .b-imageView{
  421. width: 112rpx;
  422. height: 112rpx;
  423. margin: 0 20rpx 20rpx 0;
  424. float: left;
  425. image{
  426. width: 112rpx;
  427. height: 112rpx;
  428. display: block;
  429. }
  430. }
  431. .text{
  432. line-height: 44rpx;
  433. font-size: $font-size-28;
  434. color: $text-color;
  435. }
  436. }
  437. .goods-pros-m{
  438. width: 100%;
  439. height: auto;
  440. line-height: 76rpx;
  441. font-size: $font-size-26;
  442. color: $text-color;
  443. float: left;
  444. padding: 10rpx 0;
  445. border-top: 1px solid #F7F7F7;
  446. border-bottom: 1px solid #F7F7F7;
  447. .m-text{
  448. width: 62rpx;
  449. float: left;
  450. padding-right: 20rpx;
  451. font-weight:bold;
  452. }
  453. .m-input{
  454. display: -webkit-box;
  455. display: -webkit-flex;
  456. display: flex;
  457. -webkit-box-align: center;
  458. -webkit-align-items: center;
  459. align-items: center;
  460. position: relative;
  461. width: 620rpx;
  462. height: auto;
  463. padding: 20rpx 0 10rpx 0;
  464. background: #FFFFFF;
  465. .text{
  466. width: 100%;
  467. height: 100%;
  468. font-size: $font-size-26;
  469. line-height: 36rpx;
  470. color: #333333;
  471. }
  472. }
  473. }
  474. }
  475. }
  476. </style>