Ver código fonte

更新 提单详情

wzh 3 anos atrás
pai
commit
8af120e965

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

@@ -1,10 +1,45 @@
+const {
+  postApi
+} = require("../../../../apis/api")
+
 // pages/voyageManage/myBills/labDetail.js
 const app = getApp()
 Page({
   data: {
 
+  },
+  preview(e) {
+    wx.previewImage({
+      urls: [e.currentTarget.dataset.url],
+    })
+  },
+  deleteLab(e) {
+    wx.showModal({
+      title: '提示',
+      content: '确认删除提单?',
+      success: async (res) => {
+        if (res.confirm) {
+          console.log('用户点击确定')
+          let res1 = await postApi('voyage/deleteLab', {
+            id: this.data.id
+          })
+          if (res1.data.status == 0) {
+            wx.showToast({
+              title: res1.data.msg,
+            })
+            wx.navigateBack()
+          }
+        } else if (res.cancel) {
+          console.log('用户点击取消')
+        }
+      }
+    })
+
   },
   onLoad(options) {
     console.log(app.globalData.currentLab)
+    this.setData({
+      ...app.globalData.currentLab
+    })
   },
 })

+ 55 - 1
miniprogram/pages/voyageManage/myBills/labDetail/labDetail.wxml

@@ -1,2 +1,56 @@
 <!--pages/voyageManage/myBills/labDetail.wxml-->
-<text>pages/voyageManage/myBills/labDetail.wxml</text>
+<view class="line1" style="font-size: 36rpx;margin: 20rpx 50rpx;">提单信息</view>
+<view style="border: 1px solid grey;border-radius: 20rpx;width: 90%;margin: 0 auto;padding:20rpx 10rpx">
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">提货单编号:</view>
+      <view class="line1-full-text">{{labNumber}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">开单日期:</view>
+      <view class="line1-full-text">{{billingDate}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">承运人:</view>
+      <view class="line1-full-text">{{carrier}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">产品名称:</view>
+      <view class="line1-full-text">{{cargo}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">应发数量:</view>
+      <view class="line1-full-text">{{sentTons}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">提货船舶:</view>
+      <view class="line1-full-text">{{pickUpShip}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">提货单位:</view>
+      <view class="line1-full-text">{{pickUpCompany}}</view>
+    </view>
+  </view>
+  <view class="line1">
+    <view class="line1-full-item">
+      <view class="line1-full-title">业务员:</view>
+      <view class="line1-full-text">{{salesman}}</view>
+    </view>
+  </view>
+</view>
+<view class="line1" style="font-size: 36rpx;margin: 20rpx 50rpx 40rpx 50rpx;">单据</view>
+<image src="{{file.viewUrl}}" mode="aspectFit" style="display:block;margin: 0 auto;width: 80vw;height: 80vw;" bindtap="preview" data-url="{{file.viewUrl}}"></image>
+<view class="next" bindtap="deleteLab">删除单据</view>
+<view style="height: 40rpx;"></view>

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

@@ -1 +1,54 @@
-/* pages/voyageManage/myBills/labDetail.wxss */
+/* pages/voyageManage/myBills/labDetail.wxss */
+
+.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;
+}
+
+.line1 {
+  display: flex;
+  font-size: 30rpx;
+}
+
+.line1-full-item {
+  display: flex;
+  margin: 16rpx 0 10rpx 32rpx;
+  width: 100%;
+}
+
+.line1-full-title {
+  width: 30%;
+}
+
+.next {
+  width: 50vw;
+  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;
+}

+ 4 - 1
miniprogram/pages/voyageManage/myBills/myLab/myLab.js

@@ -134,6 +134,9 @@ Page({
     this.setData({
       voyageId
     })
-    this.getVoyageDetail()
   },
+  onShow() {
+    this.getVoyageDetail()
+
+  }
 })

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

@@ -1,5 +1,5 @@
 <view class="line" style="font-size: 36rpx;">航次信息</view>
-<view style="border: 1px solid grey;border-radius: 20rpx;width: 90%;margin: 0 auto;">
+<view style="border: 1px solid grey;border-radius: 20rpx;width: 90%;margin: 0 auto;padding-bottom: 30rpx;">
   <view class="line">
     <view class="line-full-item">
       <view class="line-full-title">航次名称:</view>
@@ -31,7 +31,7 @@
 </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;">
+<scroll-view bindrefresherrefresh="scrollDownList" refresher-triggered="{{isFreshing}}" refresher-enabled="{{true}}" scroll-y="true" bindscrolltolower="scrollList" style="height:calc(100vh - 640rpx);padding-bottom: 100rpx;background: #fff;">
   <view class="df aic jcsb list" wx:for="{{labList}}" wx:key="index" data-item="{{item}}" bindtap="goToDetail" data-index="{{index}}">
     <view class="col-1">{{item.labNumber}}</view>
     <view class="col-2">{{item.billingDate}}</view>

+ 1 - 1
miniprogram/pages/voyageManage/myBills/myLab/myLab.wxss

@@ -238,6 +238,6 @@ picker,
 }
 
 .list {
-  padding: 20rpx;
+  padding: 20rpx 32rpx;
   font-size: 28rpx;
 }

+ 10 - 1
miniprogram/pages/voyageManage/voyageManage.js

@@ -58,7 +58,14 @@ Page({
     this.setData({
       isFreshing: true
     })
-    let res = await postApi(this.data.apiArr[this.data.maintab - 1], {
+    let url
+    console.log(this.data.maintab, this.data.status)
+    if (this.data.maintab == 3 && this.data.status == 2) {
+      url = '/voyage/wx/lab/list'
+    } else {
+      url = this.data.apiArr[this.data.maintab - 1]
+    }
+    let res = await postApi(url, {
       loginAccountId: wx.getStorageSync('loginAccountId'),
       // cargoOwnerId: this.data.cargoOwnerId,
       term: this.data.term,
@@ -148,6 +155,8 @@ Page({
       size: 20,
       total: 0
     })
+    this.getList()
+    return
     if (islab) {
       this.getLabList()
     } else {