Parcourir la source

新增 卸货信息多港口

wzh il y a 3 ans
Parent
commit
f050112cb3

+ 21 - 3
miniprogram/pages/voyages/detail/detail.js

@@ -5,7 +5,7 @@ import {
 Page({
   data: {
     id: '',
-    tab: 1,
+    tab: 4,
     shipDischargeCurrentPage: 1,
     truckLoadCurrentPage: 1,
     coordinates: [],
@@ -29,6 +29,7 @@ Page({
     pageSize: 20,
     latitude: 31.891992,
     longitude: 120.551369,
+    currentPortId: 0
   },
   changeTab(e) {
     let {
@@ -102,7 +103,10 @@ Page({
       policys,
       voyage,
       waybills,
+      currentPortId: voyage?.voyageDetails[0].portId
     })
+    this.getCarLoadRecordList()
+    this.getDischargeList()
   },
   subTimeStr(str) {
     if (!str || typeof str != "string") return;
@@ -118,6 +122,7 @@ Page({
       this.data.truckLoadCurrentPage = 1
     }
     let res = await postApi("/voyage/getCarLoadRecordList", {
+      portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.truckLoadCurrentPage,
@@ -164,6 +169,7 @@ Page({
       this.data.shipDischargeCurrentPage = 1
     }
     let res = await postApi("/voyage/getDischargeList", {
+      portId: this.data.currentPortId,
       voyageId: this.data.id,
       size: this.data.pageSize,
       currentPage: this.data.shipDischargeCurrentPage,
@@ -254,6 +260,19 @@ Page({
     this.getCarLoadRecordList(true)
   },
 
+  changePort(e) {
+    let currentPortId = e.target.dataset.id
+    this.setData({
+      currentPortId
+    })
+    if (this.data.infoType == "ship") {
+      this.getDischargeList()
+    } else {
+      this.getCarLoadRecordList()
+    }
+
+  },
+
 
   onShareAppMessage() {
     let id = wx.getStorageSync('voyageDetailId')
@@ -273,7 +292,6 @@ Page({
       id
     })
     this.getVoyageDetail()
-    this.getCarLoadRecordList()
-    this.getDischargeList()
+
   },
 })

+ 5 - 0
miniprogram/pages/voyages/detail/detail.wxml

@@ -128,6 +128,11 @@
     </view>
   </view>
   <view wx:if="{{tab==4}}">
+    <scroll-view scroll-x="true">
+      <view class=" df jcsa">
+        <view class="{{['port-btns',currentPortId == item.portId?'current-port-btn':'']}}" wx:for="{{voyage.voyageDetails}}" bindtap="changePort" data-id="{{item.portId}}">{{item.portName}}</view>
+      </view>
+    </scroll-view>
     <view class="df aic jcsb pb20" style="border-bottom: 2rpx solid #ddd;">
       <view bindtap="changeInfoType" data-type="ship" style="color:{{infoType=='ship'?'#0d8fcc':''}};border-bottom:{{infoType=='ship'?'2rpx solid #0d8fcc':''}}">船舶卸货记录</view>
       <view bindtap="changeInfoType" data-type="truck" style="color:{{infoType=='truck'?'#0d8fcc':''}};border-bottom:{{infoType=='truck'?'2rpx solid #0d8fcc':''}}">汽车装货记录</view>

+ 16 - 0
miniprogram/pages/voyages/detail/detail.wxss

@@ -116,4 +116,20 @@ page {
   padding-bottom: 50rpx;
   font-size: 22rpx;
   color: #777;
+}
+
+.port-btns {
+  width: 200rpx;
+  height: 70rpx;
+  line-height: 70rpx;
+  text-align: center;
+  margin-bottom: 20rpx;
+  border-radius: 10rpx;
+  border: 1rpx solid grey
+}
+
+.current-port-btn {
+  color: #fff;
+  background: #008ebd;
+  border: none;
 }