Selaa lähdekoodia

新增 提单

wzh 3 vuotta sitten
vanhempi
commit
103aebd1ae

+ 4 - 3
miniprogram/app.json

@@ -22,7 +22,9 @@
     "pages/index/declarePort/voyageList",
     "pages/index/weather/weatherList",
     "pages/index/declarePort/detail",
-    "pages/index/security/security"
+    "pages/index/security/security",
+    "pages/voyageManage/myBills/myLab/myLab",
+    "pages/voyageManage/myBills/labDetail/labDetail"
   ],
   "window": {
     "backgroundColor": "#F6F6F6",
@@ -32,8 +34,7 @@
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
-    "list": [
-      {
+    "list": [{
         "pagePath": "pages/index/index",
         "text": "首页",
         "iconPath": "images/tabBar/index.png",

+ 66 - 0
miniprogram/pages/voyageManage/myBills/labDetail/labDetail.js

@@ -0,0 +1,66 @@
+// pages/voyageManage/myBills/labDetail.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
miniprogram/pages/voyageManage/myBills/labDetail/labDetail.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 2 - 0
miniprogram/pages/voyageManage/myBills/labDetail/labDetail.wxml

@@ -0,0 +1,2 @@
+<!--pages/voyageManage/myBills/labDetail.wxml-->
+<text>pages/voyageManage/myBills/labDetail.wxml</text>

+ 1 - 0
miniprogram/pages/voyageManage/myBills/labDetail/labDetail.wxss

@@ -0,0 +1 @@
+/* pages/voyageManage/myBills/labDetail.wxss */

+ 103 - 0
miniprogram/pages/voyageManage/myBills/myLab/myLab.js

@@ -0,0 +1,103 @@
+const {
+  postApi
+} = require("../../../../apis/api")
+
+// pages/voyageManage/myBills/myLab.js
+Page({
+  data: {
+    currentPortId: -1,
+    currentPage: 1,
+    size: 20,
+    isFreshing: false,
+    total: 0,
+    labList: []
+  },
+  async getVoyageDetail() {
+    let res = await postApi('voyage/detail', {
+      voyageId: this.data.voyageId
+    })
+    let {
+      voyage,
+    } = res.data.result
+
+    this.setData({
+      ...voyage,
+      currentPortId: voyage?.voyageDetails[0].portId
+    })
+    this.getLabList()
+  },
+
+
+  changePort(e) {
+    let currentPortId = e.target.dataset.id
+    this.setData({
+      currentPortId,
+    })
+    this.getLabList()
+  },
+  scrollDownList() {
+    this.setData({
+      total: 0,
+      currentPage: 1,
+      labList: []
+    })
+    this.getLabList()
+  },
+  scrollList() {
+    if (this.data.total == 0 || this.data.total <= this.data.size * this.data.currentPage) return
+    this.data.currentPage += 1
+    this.getLabList(true)
+  },
+
+  async getLabList(isScroll) {
+    this.setData({
+      isFreshing: true
+    })
+    let res = await postApi('voyage/getLabList', {
+      voyageId: this.data.voyageId,
+      portId: this.data.currentPortId,
+      currentPage: this.data.currentPage,
+      size: this.data.size
+    })
+    this.setData({
+      currentPage: this.data.currentPage,
+      isFreshing: false
+    })
+
+    if (res.data.status == 0) {
+      console.log(res.data.result)
+      for (let i of res.data.result) {
+        i.billingDate = i.billingDate.substring(0, 10)
+      }
+      if (isScroll) {
+        this.setData({
+          labList: [...this.data.labList, ...res.data.result],
+          total: res.data.total
+        })
+      } else {
+        this.setData({
+          labList: res.data.result,
+          total: res.data.total
+        })
+      }
+    } else {
+      this.setData({
+        labList: [],
+        total: 0
+      })
+      wx.showToast({
+        icon: "none",
+        title: res.data.msg,
+      })
+    }
+  },
+  onLoad(options) {
+    let {
+      id: voyageId
+    } = options
+    this.setData({
+      voyageId
+    })
+    this.getVoyageDetail()
+  },
+})

+ 3 - 0
miniprogram/pages/voyageManage/myBills/myLab/myLab.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 43 - 0
miniprogram/pages/voyageManage/myBills/myLab/myLab.wxml

@@ -0,0 +1,43 @@
+<view class="line" style="font-size: 36rpx;">航次信息</view>
+<view style="border: 1px solid grey;border-radius: 20rpx;width: 90%;margin: 0 auto;">
+  <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">航次名称:</view>
+      <view class="line-full-text">{{voyageName}}</view>
+    </view>
+  </view>
+  <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">货主:</view>
+      <view class="line-text">{{cargoOwnerName}}</view>
+    </view>
+  </view>
+  <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">开航时间:</view>
+      <view class="line-full-text">{{startTime}}</view>
+    </view>
+  </view>
+  <!-- <view class="line">
+    <view class="line-full-item">
+      <view class="line-full-title">实际到港时间:</view>
+      <view class="line-full-text">{{actualArrivalTime}}</view>
+    </view>
+  </view> -->
+</view>
+
+<scroll-view scroll-x="{{true}}" style="white-space: nowrap;width: 90%;margin: 20rpx auto;">
+  <view class="{{['port-btns',currentPortId == item.portId?'current-port-btn':'','mr20']}}" wx:for="{{voyageDetails}}" bindtap="changePort" wx:key="portId" data-id="{{item.portId}}">{{item.portName}}</view>
+</scroll-view>
+
+
+<scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" bindscrolltolower="scrollList" style="height:calc(100vh - 600rpx);padding-bottom: 100rpx;background: #fff;">
+  <view class="df aic jcsb list" wx:for="{{labList}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail" data-index="{{index}}">
+    <view class="col-1">{{item.labNumber}}</view>
+    <view class="col-2">{{item.billingDate}}</view>
+    <view class="col-3">{{item.cargo}}</view>
+    <view class="col-4">{{item.sentTons}}</view>
+  </view>
+  <view bindtap="scrollList" class="bottom-text">{{total==0?'暂无数据':(total>size*currentPage?'点击或滑动加载更多...':'已加载完毕')}}</view>
+</scroll-view>
+<view class="next" style="width: 50vw;">上传提单</view>

+ 243 - 0
miniprogram/pages/voyageManage/myBills/myLab/myLab.wxss

@@ -0,0 +1,243 @@
+/* pages/voyageManage/myBills/myLab.wxss */
+page {
+  background: #fff;
+}
+
+.df {
+  display: flex;
+}
+
+.jcsb {
+  justify-content: space-between;
+}
+
+.jcc {
+  justify-content: center;
+}
+
+.jcfe {
+  justify-content: flex-end;
+}
+
+.jcsa {
+  justify-content: space-around;
+}
+
+.aic {
+  align-items: center;
+}
+
+.search {
+  border: 1rpx solid grey;
+  width: 80%;
+  background: #fff;
+}
+
+.tabs {
+  width: 100%;
+  height: 100rpx;
+  background: #fff;
+  box-shadow: rgb(209, 206, 206) 5rpx 5rpx 10rpx;
+  border-bottom: 2rpx solid grey;
+}
+
+.tabsview {
+  width: 130rpx;
+  height: 50rpx;
+  font-size: 28rpx;
+  text-align: center;
+  color: #333;
+}
+
+.line {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 30rpx;
+  color: #333;
+}
+
+.line-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  width: 45%;
+}
+
+.line-full-item {
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+
+.line-full-title {
+  width: 25%;
+}
+
+
+.line-title,
+.line-text {
+  width: 50%;
+}
+
+.line-title,
+.line-full-title {
+  color: #444;
+}
+
+.type2 .line-full-title {
+  width: 50%;
+}
+
+.ship-discharge-list>view:first-child {
+  font-size: 26rpx;
+}
+
+.ship-discharge-list>view>view {
+  width: 160rpx;
+  text-align: center;
+  color: #444;
+}
+
+.truck-load-list>view:first-child {
+  font-size: 26rpx;
+}
+
+.truck-load-list>view>view {
+  width: 160rpx;
+  text-align: center;
+  color: #444;
+}
+
+
+.bottom-text {
+  text-align: center;
+  padding-top: 30rpx;
+  padding-bottom: 50rpx;
+  font-size: 22rpx;
+  color: #777;
+}
+
+.port-btns {
+  width: 180rpx !important;
+  height: 70rpx;
+  line-height: 70rpx;
+  text-align: center;
+  margin-bottom: 20rpx;
+  border-radius: 10rpx;
+  border: 1rpx solid grey;
+  display: inline-block;
+}
+
+.current-port-btn {
+  color: #fff;
+  background: #008ebd;
+  border: none;
+}
+
+.voyage-btn {
+  height: 70rpx;
+  line-height: 70rpx;
+  border-radius: 10rpx;
+  padding: 0 30rpx;
+  margin-right: 20rpx;
+  color: #fff;
+  font-size: 30rpx;
+}
+
+.line {
+  width: 80%;
+  margin: 30rpx auto;
+  font-size: 28rpx;
+  position: relative;
+}
+
+.next {
+  text-align: center;
+  color: #fff;
+  background: #0094FE;
+  border-radius: 10rpx;
+  margin: 20rpx auto;
+  height: 70rpx;
+  line-height: 70rpx;
+  border-radius: 10rpx;
+  padding: 0 30rpx;
+  font-size: 30rpx;
+}
+
+.delete {
+  position: absolute;
+  right: 10rpx;
+  top: 14rpx;
+  width: 52rpx;
+  height: 52rpx;
+  z-index: 5;
+}
+
+.mask {
+  position: absolute;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 5;
+
+}
+
+.mask>view {
+  width: 80vw;
+  height: 35vw;
+  border-radius: 3vw;
+  box-shadow: 2rpx 2rpx 10rpx 1rpx rgb(175, 172, 172);
+  position: fixed;
+  bottom: 400rpx;
+  left: 10vw;
+  background: #fff;
+}
+
+picker,
+.d-input {
+  border: 1rpx solid grey;
+  padding: 0rpx 10rpx;
+}
+
+.upload {
+  width: 60%;
+  height: 100rpx;
+  text-align: center;
+  line-height: 100rpx;
+  border: 1px solid grey;
+  margin: 3vw auto;
+}
+
+.upload-bill-visable {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  background: #fff;
+}
+
+
+.col-1 {
+  width: 29vw;
+}
+
+.col-2 {
+  width: 29vw;
+}
+
+
+.col-3 {
+  width: 15vw;
+}
+
+.col-4 {
+  width: 15vw;
+}
+
+.list {
+  padding: 20rpx;
+  font-size: 28rpx;
+}

+ 65 - 11
miniprogram/pages/voyageManage/voyageManage.js

@@ -93,9 +93,54 @@ Page({
       })
     }
   },
+  async getLabList(isScroll) {
+    if (!wx.getStorageSync('loginAccountId')) {
+      wx.showToast({
+        title: '尚未登录',
+        icon: "error"
+      })
+      return
+    }
+    this.setData({
+      isFreshing: true
+    })
+    let res = await postApi('/voyage/wx/lab/list', {
+      loginAccountId: wx.getStorageSync('loginAccountId'),
+      term: this.data.term,
+      currentPage: this.data.currentPage,
+      size: this.data.size,
+    })
+    this.setData({
+      currentPage: this.data.currentPage,
+      isFreshing: false
+    })
+    if (res.data.status == 0) {
+      if (isScroll) {
+        this.setData({
+          list: [...this.data.list, ...res.data.result],
+          total: res.data.total
+        })
+      } else {
+        this.setData({
+          list: res.data.result,
+          total: res.data.total
+        })
+      }
+    } else {
+      this.setData({
+        list: [],
+        total: 0
+      })
+      wx.showToast({
+        icon: "none",
+        title: res.data.msg,
+      })
+    }
+  },
   changeStatus(e) {
     let {
-      status
+      status,
+      islab
     } = e.currentTarget.dataset
     this.setData({
       status,
@@ -103,7 +148,11 @@ Page({
       size: 20,
       total: 0
     })
-    this.getList()
+    if (islab) {
+      this.getLabList()
+    } else {
+      this.getList()
+    }
   },
   goToDetail(e) {
     let {
@@ -139,17 +188,22 @@ Page({
         break
       }
       case 3: {
-        let {
-          index
-        } = e.currentTarget.dataset
-        if (this.data.list[index].shipownerUploadFiles.length == 1) {
-          this.data.list[index].shipownerUploadFiles[0].checked = true
-          app.globalData.currentBillItem = this.data.list[index]
-          url = `/pages/voyageManage/myBills/examine/examine?id=${id}`
+        if (this.data.status == 1) {
+          let {
+            index
+          } = e.currentTarget.dataset
+          if (this.data.list[index].shipownerUploadFiles.length == 1) {
+            this.data.list[index].shipownerUploadFiles[0].checked = true
+            app.globalData.currentBillItem = this.data.list[index]
+            url = `/pages/voyageManage/myBills/examine/examine?id=${id}`
+          } else {
+            app.globalData.currentBillItem = this.data.list[index]
+            url = `/pages/voyageManage/myBills/myBills?id=${id}`
+          }
         } else {
-          app.globalData.currentBillItem = this.data.list[index]
-          url = `/pages/voyageManage/myBills/myBills?id=${id}`
+          url = `/pages/voyageManage/myBills/myLab/myLab?id=${id}`
         }
+
         break
       }
     }

+ 4 - 0
miniprogram/pages/voyageManage/voyageManage.wxml

@@ -12,6 +12,10 @@
   <view class="tabsview" bindtap="changeStatus" data-status="{{1}}" style="color:{{status==1?'#0d8fcc':''}};border-bottom:{{status==1?'4rpx solid #0d8fcc':''}}">{{maintab==1?'执行中':'已提交日报'}}</view>
   <view class="tabsview" bindtap="changeStatus" data-status="{{2}}" style="color:{{status==2?'#0d8fcc':''}};border-bottom:{{status==2?'4rpx solid #0d8fcc':''}}">{{maintab==1?'历史航次':'未提交日报'}}</view>
 </view>
+<view class="df aic jcsa tabs" wx:else>
+  <view class="tabsview" bindtap="changeStatus" data-status="{{1}}" style="color:{{status==1?'#0d8fcc':''}};border-bottom:{{status==1?'4rpx solid #0d8fcc':''}}">单据</view>
+  <view class="tabsview" bindtap="changeStatus" data-status="{{2}}" data-islab="{{true}}" style="color:{{status==2?'#0d8fcc':''}};border-bottom:{{status==2?'4rpx solid #0d8fcc':''}}">提单</view>
+</view>
 <scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" bindscrolltolower="scrollList" style="height:calc(100vh - 140rpx);padding-bottom: 200rpx;background: #fff;">
   <view class="df aic jcsb list" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail" data-index="{{index}}" data-medias="{{item.medias}}" data-trans="{{item.transStatusName}}">
     <view class="col-1">{{item.shipName}}</view>

+ 2 - 72
project.private.config.json

@@ -4,78 +4,8 @@
       "list": [
         {
           "name": "",
-          "pathName": "pages/voyages/detail/detail",
-          "query": "id=170",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyages/uploadCarLoadRecord/uploadCarLoadRecord",
-          "query": "voyageId=170&portId=4",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyages/uploadDischarge/uploadDischarge",
-          "query": "voyageId=170&portId=1",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyageManage/myDaily/examine/examine",
-          "query": "id=170&trans=%E8%BF%90%E8%BE%93%E4%B8%AD",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyageManage/myDaily/examine/examine",
-          "query": "id=170&trans=%E5%8D%B8%E8%B4%A7%E4%B8%AD",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/shipOwnerManage/addShipOnwer/addShipOnwer",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/declarePort/voyageList",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/declarePort/detail",
-          "query": "id=244",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/index/weather/weatherList",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/voyageManage/createVoyage/createVoyage",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/shipOwnerManage/shipOwnerList/shipOwnerList",
-          "query": "",
+          "pathName": "pages/voyageManage/myBills/myLab/myLab",
+          "query": "id=266",
           "launchMode": "default",
           "scene": null
         }