فهرست منبع

更新 我的日报;我的单据

wzh 3 سال پیش
والد
کامیت
78dcd13af1

+ 2 - 2
miniprogram/app.json

@@ -12,6 +12,7 @@
     "pages/sharePage/sharePage",
     "pages/voyageManage/createVoyage/createVoyage",
     "pages/voyageManage/myBills/myBills",
+    "pages/voyageManage/myBills/examine/examine",
     "pages/voyageManage/myDaily/myDaily",
     "pages/voyageManage/myVoyages/myVoyages",
     "pages/voyageManage/myDaily/examine/examine"
@@ -24,8 +25,7 @@
     "navigationBarTextStyle": "black"
   },
   "tabBar": {
-    "list": [
-      {
+    "list": [{
         "pagePath": "pages/index/index",
         "text": "首页",
         "iconPath": "images/tabBar/index.png",

+ 38 - 0
miniprogram/pages/voyageManage/myBills/examine/examine.js

@@ -0,0 +1,38 @@
+// pages/voyageManage/myDaily/examine/examine.js
+
+const {
+  postApi
+} = require("../../../../apis/api")
+
+const app = getApp()
+Page({
+  data: {
+    voyageId: 0,
+    currentBillItem: {},
+    tab: 0,
+  },
+
+  previewImage(e) {
+    let {
+      src
+    } = e.currentTarget.dataset
+    wx.previewImage({
+      current: src, // 当前显示图片的http链接
+      urls: [src] // 需要预览的图片http链接列表
+    })
+  },
+  changeTab(e) {
+    this.setData({
+      tab: e.currentTarget.dataset.tab
+    })
+  },
+  reject() {
+
+  },
+  onLoad(options) {
+    this.setData({
+      voyageId: options.id,
+      currentBillItem: app.globalData.currentBillItem
+    })
+  },
+})

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

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

+ 51 - 0
miniprogram/pages/voyageManage/myBills/examine/examine.wxml

@@ -0,0 +1,51 @@
+<view class="p20">
+  <view class="p20">航次信息</view>
+  <view class="box">
+    <view class="line">
+      <view class="line-full-item">
+        <view class="line-full-title">货主名称:</view>
+        <view class="line-full-text">{{currentBillItem.cargoOwner}}</view>
+      </view>
+    </view>
+    <view class="line">
+      <view class="line-full-item">
+        <view class="line-full-title">货种:</view>
+        <view class="line-full-text">{{currentBillItem.cargo}}</view>
+      </view>
+    </view>
+    <view class="line">
+      <view class="line-full-item">
+        <view class="line-full-title">开航时间:</view>
+        <view class="line-full-text">{{currentBillItem.setSailTime}}</view>
+      </view>
+    </view>
+    <view class="line">
+      <view class="line-full-item">
+        <view class="line-full-title">实际到港时间:</view>
+        <view class="line-text">{{currentBillItem.actualArrivalTime}}</view>
+      </view>
+    </view>
+  </view>
+  <view class="p20">单据</view>
+  <view class="df aic jcsa">
+    <image wx:for="{{currentBillItem.shipownerUploadFiles}}" bindtap="previewImage" wx:if="{{item.checked}}" style="height:200rpx;margin: 10rpx;" src="{{item.viewUrl}}" data-src="{{item.viewUrl}}" mode="aspectFill"></image>
+  </view>
+</view>
+<view class="p20">请选择分配单据类型</view>
+<view class="df aic jcsa">
+  <view class="tabsview" bindtap="changeTab" data-tab="{{1}}" style="color:{{tab==1?'#fff':'#0094FE'}};background:{{tab==1?'#0094FE':''}};border:{{tab==1?'':'1px solid #0094FE'}};">运单</view>
+  <view class="tabsview" bindtap="changeTab" data-tab="{{2}}" style="color:{{tab==2?'#fff':'#0094FE'}};background:{{tab==2?'#0094FE':''}};border:{{tab==2?'':'1px solid #0094FE'}};">磅单</view>
+  <view class="tabsview" bindtap="changeTab" data-tab="{{3}}" style="color:{{tab==3?'#fff':'#0094FE'}};background:{{tab==3?'#0094FE':''}};border:{{tab==3?'':'1px solid #0094FE'}};">汽车磅单</view>
+  <view class=" reject" bindtap="reject">不通过</view>
+</view>
+<block wx:if="{{tab==1}}">
+  上传运单
+</block>
+<block wx:if="{{tab==2}}">
+  上传磅单填写信息
+</block>
+<block wx:if="{{tab==3}}">
+  汽车磅单
+  识别
+  确认
+</block>

+ 46 - 0
miniprogram/pages/voyageManage/myBills/examine/examine.wxss

@@ -0,0 +1,46 @@
+/* pages/voyageManage/myDaily/examine/examine.wxss */
+.box {
+  width: 80vw;
+  border: 1rpx solid grey;
+  border-radius: 20rpx;
+  margin: 0 auto;
+  padding: 10rpx 20rpx;
+}
+
+.line {
+  font-size: 28rpx;
+  margin: 10rpx 20rpx;
+}
+
+.line-full-item {
+  display: flex;
+  justify-content: space-between;
+}
+
+
+line-full-title,
+.line-full-text {
+  width: 50%;
+}
+
+.line-full-text {
+  color: #444;
+}
+
+.tabsview {
+  font-size: 28rpx;
+  text-align: center;
+  color: #333;
+  border-radius: 10rpx;
+  padding: 10rpx 20rpx;
+}
+
+.reject {
+  font-size: 28rpx;
+  text-align: center;
+  color: #333;
+  padding: 10rpx 20rpx;
+  background: #d90024;
+  border-radius: 10rpx;
+  color: #fff;
+}

+ 44 - 56
miniprogram/pages/voyageManage/myBills/myBills.js

@@ -1,65 +1,53 @@
 // pages/voyageManage/myBills/myBills.js
-Page({
+const app = getApp()
+const {
+  postApi
+} = require("../../../apis/api")
 
-  /**
-   * 页面的初始数据
-   */
+Page({
   data: {
-
+    medias: [],
+    voyageId: 0,
+    trans: '',
+  },
+
+  check(e) {
+    let arr = this.data.currentBillItem.shipownerUploadFiles
+    let {
+      index
+    } = e.currentTarget.dataset
+    arr[index].checked = arr[index].checked ? false : true
+    this.data.currentBillItem.shipownerUploadFiles = arr
+    this.setData({
+      currentBillItem: this.data.currentBillItem
+    })
   },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
   onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide() {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
+    let currentBillItem = app.globalData.currentBillItem
+    this.setData({
+      currentBillItem,
+      voyageId: options.id
+    })
+
+  },
+  isTrue() {
+
+  },
+  examineMedia() {
+    let arr = this.data.currentBillItem.shipownerUploadFiles
+    if (!arr.some((e) => {
+        return e.checked
+      })) {
+      wx.showToast({
+        title: '至少选择一张单据',
+        icon: "error"
+      })
+      return
+    }
+    wx.navigateTo({
+      url: `/pages/voyageManage/myBills/examine/examine?id=${this.data.voyageId}`,
+    })
   },
-
-  /**
-   * 用户点击右上角分享
-   */
   onShareAppMessage() {
 
   }

+ 13 - 2
miniprogram/pages/voyageManage/myBills/myBills.wxml

@@ -1,2 +1,13 @@
-<!--pages/voyageManage/myBills/myBills.wxml-->
-<text>pages/voyageManage/myBills/myBills.wxml</text>
+<view class="p40">
+  <view class="m30">
+    请选择需要处理的单据(可多选):
+  </view>
+  <block wx:for="{{currentBillItem.shipownerUploadFiles}}">
+    <view class="df aic jcsb" style="margin: 30rpx 0;">
+      <checkbox bindtap="check" value="{{item.checked}}" checked="{{item.checked}}" data-index="{{index}}"></checkbox>
+      <image bindtap="check" style="width: 75vw;height: 260rpx;" src="{{item.viewUrl}}" data-index="{{index}}"></image>
+    </view>
+  </block>
+
+  <view bindtap="examineMedia" class="next">下一步</view>
+</view>

+ 1 - 1
miniprogram/pages/voyageManage/myDaily/myDaily.wxml

@@ -1,6 +1,6 @@
 <view class="p40">
   <view class="m30">
-    请选择需要处理的照片:
+    请选择需要处理的照片(单选):
   </view>
   <block wx:for="{{medias}}">
     <view class="df aic jcsb" style="margin: 30rpx 0;">

+ 15 - 6
miniprogram/pages/voyageManage/voyageManage.js

@@ -10,15 +10,14 @@ Page({
     defaultParams: {
       loginAccountId: wx.getStorageSync('loginAccountId')
     },
-    maintab: 2,
+    maintab: 3,
     status: 1,
     currentPage: 1,
     size: 20,
     list: [],
     total: 0,
     isFreshing: false,
-    currentApi: "/dayReport/list"
-    // currentApi: "/voyage/list"
+    apiArr: ['/voyage/list', '/dayReport/list', '/bill/list']
   },
   selectCargoOwner(e) {
     this.setData({
@@ -42,7 +41,7 @@ Page({
     this.setData({
       isFreshing: true
     })
-    let res = await postApi(this.data.currentApi, {
+    let res = await postApi(this.data.apiArr[this.data.maintab - 1], {
       loginAccountId: wx.getStorageSync('loginAccountId'),
       cargoOwnerId: this.data.cargoOwnerId,
       status: this.data.status,
@@ -108,7 +107,8 @@ Page({
         }
         let {
           medias,
-          trans
+          trans,
+          index
         } = e.currentTarget.dataset
         if (medias.length == 1) {
           app.globalData.currentExamineMedia = medias[0]
@@ -119,7 +119,16 @@ Page({
         break
       }
       case 3: {
-        url = `/pages/voyageManage/myBills/myBills?id=${id}`
+        let {
+          index
+        } = e.currentTarget.dataset
+        app.globalData.currentBillItem = this.data.list[index]
+
+        if (this.data.list[index].shipownerUploadFiles.length == 1) {
+          url = `/pages/voyageManage/myBills/examine/examine?id=${id}`
+        } else {
+          url = `/pages/voyageManage/myBills/myBills?id=${id}`
+        }
         break
       }
     }

+ 1 - 1
miniprogram/pages/voyageManage/voyageManage.wxml

@@ -10,7 +10,7 @@
   <view class="tabsview" bindtap="changeStatus" data-status="{{2}}" style="color:{{status==2?'#0d8fcc':''}};border-bottom:{{status==2?'4rpx solid #0d8fcc':''}}">{{maintab==1?'历史航次':'未拍照'}}</view>
 </view>
 <scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" style="height:calc(100vh - {{height}}rpx);background: #fff;">
-  <view class="df aic jcsb list" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goToDetail" data-medias="{{item.medias}}" data-trans="{{item.transStatusName}}">
+  <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>
     <view class="col-2">{{item.loadPort}}-{{item.discPort}}</view>
     <view class="col-3">{{item.cargo}}</view>

+ 7 - 0
project.private.config.json

@@ -29,6 +29,13 @@
           "query": "id=170",
           "launchMode": "default",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/voyageManage/myBills/myBills",
+          "query": "id=170",
+          "launchMode": "default",
+          "scene": null
         }
       ]
     }