Ver Fonte

更新 单据;样式

王智慧 há 3 anos atrás
pai
commit
a3f5239850

+ 1 - 1
miniprogram/components/portsBar/portsBar.wxml

@@ -1,3 +1,3 @@
 <view class="ports df jcc">
-  <view wx:for="{{arr}}" wx:key="{{key}}" class="port {{index==0?'first-port':''}} {{index==arr.length-1?'last-port':''}} {{currentIndex==index?'current-port':''}} {{arr.length==1?'one-port':''}}" catchtap="changeTab" data-index="{{index}}">{{item[label]}}</view>
+  <view wx:for="{{arr}}" wx:key="index" class="view port {{index==0?'first-port':''}} {{index==arr.length-1?'last-port':''}} {{currentIndex==index?'current-port':''}} {{arr.length==1?'one-port':''}}" catchtap="changeTab" data-index="{{index}}">{{item[label]}}</view>
 </view>

+ 3 - 3
miniprogram/components/portsBar/portsBar.wxss

@@ -4,7 +4,7 @@
   margin: 40rpx 0 39rpx 0;
 }
 
-.ports>view {
+.ports>.view {
   width: 150rpx;
   height: 60rpx;
   font-size: 26rpx;
@@ -38,10 +38,10 @@
   border-radius: 20rpx 20rpx 20rpx 20rpx;
 }
 
-.df{
+.df {
   display: flex;
 }
 
-.jcc{
+.jcc {
   justify-content: center;
 }

+ 0 - 4
miniprogram/components/voyageCard/voyageCard.wxss

@@ -1,7 +1,3 @@
-view {
-  box-sizing: border-box;
-}
-
 .df {
   display: flex;
 }

+ 31 - 3
miniprogram/pages/voyageManage/myBills/examine/examine.js

@@ -12,7 +12,7 @@ Page({
     tab: -1,
     currentDischargeIndex: 0,
     dischargeTime: "",
-    ocrList: [],
+    ocrList: [{}],
     isAcc: false
   },
 
@@ -100,15 +100,31 @@ Page({
       })
     }
   },
+
+  addOne() {
+    this.data.ocrList.push({})
+    this.setData({
+      ocrList: this.data.ocrList
+    })
+  },
+  deleteOne(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    this.data.ocrList.splice(index, 1)
+    this.setData({
+      ocrList: this.data.ocrList
+    })
+  },
   async distributeBills() {
     let arr = []
     for (let i of this.data.currentBillItem.shipownerUploadFiles) {
       if (i.checked) arr.push(i.id)
     }
     let type = this.data.tab
-
+    let recordIds = arr.join(',')
     let postData = {
-      recordIds: arr.join(','),
+      recordIds,
       voyageId: this.data.voyageId,
       type,
     }
@@ -136,8 +152,20 @@ Page({
         currentDischargeIndex,
         currentBillItem
       } = this.data
+      ocrList = ocrList.filter(item => {
+        return JSON.stringify(item) != "{}"
+      })
+
+      if (ocrList.length == 0) {
+        wx.showToast({
+          title: '记录不能为空!',
+          icon: "error"
+        })
+        return
+      }
       for (let i of ocrList) {
         i.portId = currentBillItem.discPorts[currentDischargeIndex].portId
+        i.recordId = recordIds
       }
       postData.carLoadDatas = ocrList
     }

+ 37 - 35
miniprogram/pages/voyageManage/myBills/examine/examine.wxml

@@ -35,9 +35,9 @@
     </view>
 
     <view class="df line2 disc" style="padding: 20rpx;border-bottom: 2rpx solid #ddd;margin-top: 30rpx;" wx:if="{{tab==2||tab==4}}">
-      <view class="box-title">卸货港</view>
+      <view class="tab-title">卸货港</view>
       <view>
-        <picker class="picker0" bindchange="bindDiscPortChange" value="{{currentDischargeIndex}}" range="{{currentBillItem.discPorts}}" range-key="portName">
+        <picker class="picker0 tab-ipt" bindchange="bindDiscPortChange" value="{{currentDischargeIndex}}" range="{{currentBillItem.discPorts}}" range-key="portName">
           <view class="text">
             {{currentBillItem.discPorts[currentDischargeIndex].portName||'请选择卸货港'}}
           </view>
@@ -47,9 +47,9 @@
     <block wx:if="{{tab==2}}">
       <view class="p20 box2" wx:if="{{currentDischargeIndex!=-1}}">
         <view class="df line2">
-          <view class="box-title ">卸货时间</view>
+          <view class="tab-title">卸货时间</view>
           <view>
-            <picker class="picker2" mode="date" style="border-radius: 0;" model:value="{{dischargeTime}}">
+            <picker class="picker2 tab-ipt" mode="date" style="border-radius: 0;" model:value="{{dischargeTime}}">
               <view class="text" style="color:#6C6C6C">
                 {{dischargeTime||'选择卸货时间'}}
               </view>
@@ -57,46 +57,48 @@
           </view>
         </view>
         <view class="df  line2">
-          <view class="box-title">卸货吨位(吨)</view>
-          <view><input model:value="{{dischargeTons}}" type="digit" placeholder="必填" /></view>
+          <view class="tab-title">卸货吨位(吨)</view>
+          <view><input class="tab-ipt" model:value="{{dischargeTons}}" type="digit" placeholder="必填" /></view>
         </view>
         <view class="df  line2">
-          <view class="box-title">卸货件数</view>
-          <view class="text"><input model:value="{{dischargePieces}}" type="number" /></view>
+          <view class="tab-title">卸货件数</view>
+          <view class="text"><input class="tab-ipt" model:value="{{dischargePieces}}" type="number" /></view>
         </view>
         <view class="primary" bindtap="distributeBills">确认</view>
       </view>
 
     </block>
     <block wx:if="{{tab==4}}">
-      <view wx:if="{{ocrList.length==0}}" class="primary" bindtap="ocr">开始识别</view>
-      <view wx:else>
-        <block wx:for="{{ocrList}}" wx:key="viewUrl">
-          <view class="p20 box2" wx:if="{{currentDischargeIndex!=-1&&ocrList.length}}">
-            <view class="df jcsb line2">
-              <view>车牌</view>
-              <view><input bindblur="ocrInputBlur" data-index="{{index}}" data-param="carNum" value="{{item.carNum}}" type="text" placeholder="" /></view>
-            </view>
-            <view class="df jcsb line2">
-              <view>收货单位</view>
-              <view><input bindblur="ocrInputBlur" data-index="{{index}}" data-param="receivingUnit" value="{{item.receivingUnit}}" type="text" /></view>
-            </view>
-            <view class="df jcsb line2">
-              <view>毛重</view>
-              <view><input bindblur="ocrInputBlur" data-index="{{index}}" data-param="grossWeight" value="{{item.grossWeight}}" type="digit" /></view>
-            </view>
-            <view class="df jcsb line2">
-              <view>皮重</view>
-              <view><input bindblur="ocrInputBlur" data-index="{{index}}" data-param="tare" value="{{item.tare}}" type="digit" /></view>
-            </view>
-            <view class="df jcsb line2">
-              <view>净重</view>
-              <view><input bindblur="ocrInputBlur" data-index="{{index}}" data-param="netWeight" value="{{item.netWeight}}" type="digit" /></view>
-            </view>
+      <block wx:for="{{ocrList}}" wx:key="viewUrl">
+        <view class="p20 box2 tab4" wx:if="{{currentDischargeIndex!=-1}}">
+          <view class="df aib jcsb">
+            <view style="color: #666;">记录 #{{index+1}}</view>
+            <view class="delete-one" data-index="{{index}}" bindtap="deleteOne">移除</view>
           </view>
-        </block>
-      </view>
-      <view wx:if="{{currentDischargeIndex!=-1&&ocrList.length}}" class="primary" bindtap="distributeBills">确认</view>
+          <view class="df line2">
+            <view class="tab-title">车牌</view>
+            <view><input class="tab-ipt" bindblur="ocrInputBlur" data-index="{{index}}" data-param="carNum" value="{{item.carNum}}" type="text" placeholder="" /></view>
+          </view>
+          <view class="df line2">
+            <view class="tab-title">收货单位</view>
+            <view><input class="tab-ipt" bindblur="ocrInputBlur" data-index="{{index}}" data-param="receivingUnit" value="{{item.receivingUnit}}" type="text" /></view>
+          </view>
+          <view class="df line2">
+            <view class="tab-title">毛重</view>
+            <view><input class="tab-ipt" bindblur="ocrInputBlur" data-index="{{index}}" data-param="grossWeight" value="{{item.grossWeight}}" type="digit" /></view>
+          </view>
+          <view class="df line2">
+            <view class="tab-title">皮重</view>
+            <view><input class="tab-ipt" bindblur="ocrInputBlur" data-index="{{index}}" data-param="tare" value="{{item.tare}}" type="digit" /></view>
+          </view>
+          <view class="df line2">
+            <view class="tab-title">净重</view>
+            <view><input class="tab-ipt" bindblur="ocrInputBlur" data-index="{{index}}" data-param="netWeight" value="{{item.netWeight}}" type="digit" /></view>
+          </view>
+        </view>
+      </block>
+      <view class="add-one" bindtap="addOne">添加一条记录</view>
+      <view wx:if="{{currentDischargeIndex!=-1}}" class="primary" bindtap="distributeBills">确认</view>
       <view style="height: 30rpx;"></view>
     </block>
   </block>

+ 25 - 2
miniprogram/pages/voyageManage/myBills/examine/examine.wxss

@@ -73,9 +73,7 @@
 }
 
 .line2 {
-  margin-bottom: 30rpx;
   border-bottom: 2rpx solid #ddd;
-  padding-bottom: 30rpx;
 }
 
 .box2 .line2 view:first-child {
@@ -112,4 +110,29 @@
 
 .text {
   color: #6C6C6C;
+}
+
+.tab-title {
+  line-height: 84rpx;
+  width: 200rpx;
+}
+
+.tab-ipt {
+  height: 84rpx;
+  line-height: 84rpx;
+}
+
+.add-one {
+  color: #0089FD;
+  text-align: center;
+}
+
+.delete-one {
+  color: #0089FD;
+  font-size: 28rpx;
+}
+
+.tab4 {
+  padding-bottom: 40rpx;
+  margin-bottom: 10rpx;
 }

+ 10 - 2
miniprogram/pages/voyageManage/myBills/myBills.js

@@ -14,9 +14,17 @@ Page({
   check(e) {
     let arr = this.data.currentBillItem.shipownerUploadFiles
     let {
-      index
+      index,
+      index: checkedIndex
     } = e.currentTarget.dataset
-    arr[index].checked = arr[index].checked ? false : true
+    // arr[index].checked = arr[index].checked ? false : true
+    for (let i in arr) {
+      if (i == checkedIndex) {
+        arr[i].checked = true
+      } else {
+        arr[i].checked = false
+      }
+    }
     this.data.currentBillItem.shipownerUploadFiles = arr
     this.setData({
       currentBillItem: this.data.currentBillItem

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

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