deliver-record.vue 13 KB

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