Browse Source

绑定托盘号数据展示修复

GGDemo 3 weeks ago
parent
commit
38458272a1
1 changed files with 19 additions and 27 deletions
  1. 19 27
      src/pages/scanLotno/scanLotno.vue

+ 19 - 27
src/pages/scanLotno/scanLotno.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="container">
     <uni-forms
-      ref="valiForm"
+      ref="valiFormRef"
       label-align="right"
       :label-width="80"
       :rules="rules"
@@ -28,7 +28,6 @@
         </uni-easyinput>
       </uni-forms-item>
       <!-- <text class='weight-tip'>复称重量作用是确保句惠完整,防止工作人员计费称車后进行的其他操作引起的物品丢失问题</text> -->
-      <!-- <uni-section title="绑定批托盘号" type="line" padding style="height: calc(100vh - 100px)"> -->
       <uni-forms-item label="绑定批次号" name="batchNum" class="select-item">
         <uni-data-select
           v-if="!editBatchNum"
@@ -48,17 +47,13 @@
           popup-title="绑定托盘号"
           :localdata="options.pallet"
           v-model="valiFormData.palletNum"
-          @change="onchange"
-          @nodeclick="onnodeclick"
-          @popupopened="onpopupopened"
-          @popupclosed="onpopupclosed"
+          :clear-icon="false"
         ></uni-data-picker>
 
         <uni-easyinput v-if="editPalletNum" :value="palletNum" :disabled="editPalletNum" />
         <button v-if="!editPalletNum" type="primary" @click="submitPalletNum">确认</button>
         <button v-if="editPalletNum" type="primary" @click="editPalletNum = false">修改</button>
       </uni-forms-item>
-      <!-- </uni-section> -->
     </uni-forms>
     <view class="button-group">
       <button type="info" @click="reset">重置</button>
@@ -117,7 +112,7 @@ import {
 import { checkPermission } from '@/utils'
 import { bindShipping, getBindParams, getWaybills } from '@/services/scanLotno'
 
-const token = ref()
+const valiFormRef = ref()
 const loading = ref(false)
 const hidePage = ref(false)
 const focusType = ref(true)
@@ -133,7 +128,7 @@ const valiFormData = ref({
   orderNum: '',
   weight: '',
   batchNum: '',
-  palletNum: '',
+  palletNum: '0',
 })
 
 const rules = reactive({
@@ -152,11 +147,6 @@ const options = reactive({
   pallet: [] as any,
 })
 
-const onnodeclick = () => {}
-const onpopupopened = () => {}
-const onpopupclosed = () => {}
-const onchange = () => {}
-
 const scanInput = async () => {
   // #ifdef APP-PLUS
   let status = await checkPermission()
@@ -332,11 +322,10 @@ const onsubmit = async () => {
   }, 1000)
 }
 
-const getHistory = () => {
-  lotnoLogHistory.value = uni.getStorageSync('lotnoLogHistory') || []
-}
+// const getHistory = () => {
+//   lotnoLogHistory.value = uni.getStorageSync('lotnoLogHistory') || []
+// }
 const keypress = (e: any) => {
-  console.log(e, '按键码')
   // 102  左侧    103  右侧   104  中间按键
   if (e.keyCode === 102 || e.keyCode === 103 || e.keyCode === 104) {
     //这里按键成功
@@ -387,9 +376,8 @@ onBackPress(() => {
 })
 onShow(() => {
   hidePage.value = false
-  token.value = uni.getStorageSync('token')
   _getBindParams()
-  getHistory()
+  // getHistory()
 })
 const setFocus = () => {
   if (hidePage.value) {
@@ -403,8 +391,8 @@ const setFocus = () => {
 const _getBindParams = async () => {
   const res = await getBindParams()
 
-  if (res.data.code === 1) {
-    options.batch = res.data.data.batch_number.map((item: any) => {
+  if (res.code === 1) {
+    options.batch = res.data.batch_number.map((item: any) => {
       return { text: item.name, value: item.id }
     })
     // eslint-disable-next-line no-inner-declarations
@@ -420,7 +408,9 @@ const _getBindParams = async () => {
         }
       })
     }
-    const shipping = transformData(res.data.data.shipping)
+    const shipping = transformData(res.data.shipping)
+    console.log('shipping', shipping)
+
     options.pallet = shipping
   }
 }
@@ -442,14 +432,16 @@ onNavigationBarButtonTap((event) => {
 
 .weight-right {
   padding-right: 10rpx;
-  font-size: 14rpx;
 }
 
 .weight-tip {
   color: gray;
   font-size: 12rpx;
 }
-
+:deep(.selected-area) {
+  flex: 0 1 auto;
+  height: auto;
+}
 .select-item {
   :deep(.uni-forms-item__content) {
     display: flex !important;
@@ -461,7 +453,7 @@ onNavigationBarButtonTap((event) => {
 
   button {
     height: 35px;
-    font-size: 16rpx;
+    font-size: 24rpx;
     margin-left: 10rpx;
   }
 }
@@ -479,7 +471,7 @@ onNavigationBarButtonTap((event) => {
     height: 35px;
     width: 50%;
     margin-left: 10px;
-    font-size: 16rpx;
+    font-size: 24rpx;
   }
 
   .uni-icons {