Просмотр исходного кода

立库-立库快上-增加上架区域选择

zhaohuanhuan 3 недель назад
Родитель
Сommit
493af0c207
2 измененных файлов с 64 добавлено и 4 удалено
  1. 7 0
      src/types/haikang.ts
  2. 57 4
      src/views/haikang/putaway/dispatch/index.vue

+ 7 - 0
src/types/haikang.ts

@@ -27,6 +27,9 @@ export interface getWaitPutawayListType {
   [property: string]: any;
 }
 
+/** 推荐区域:拣货区 / 存储区 / 挂装区 */
+export type PutawayArea = 'PICKING' | 'STORAGE' | 'HANGING'
+
 /**
  * 推荐库位
  * @param warehouse 仓库
@@ -44,6 +47,10 @@ export interface getRecommendedLocationType {
    * 仓库
    */
   warehouse?: string;
+  /**
+   * 推荐区域
+   */
+  putawayArea?: PutawayArea;
   [property: string]: any;
 }
 

+ 57 - 4
src/views/haikang/putaway/dispatch/index.vue

@@ -55,6 +55,9 @@
             left-icon=""
           >
           </van-search>
+          <div v-if="mode" class="putaway-area-row">
+            <van-cell title="上架区域:" :value="putawayAreaLabel" is-link @click="putawayAreaSheetShow = true" />
+          </div>
         </div>
       </div>
       <van-divider :style="{ color: '#333', borderColor: '#1989fa', padding: '0 16px',margin:'5px 0' }">上架库位
@@ -107,10 +110,17 @@
         </van-cell>
       </van-cell-group>
     </van-action-sheet>
+    <van-action-sheet v-if="mode" v-model:show="putawayAreaSheetShow" cancel-text="取消" description="上架区域"
+                      close-on-click-action>
+      <van-cell-group>
+        <van-cell title="全部" @click="onSelectPutawayArea()" />
+        <van-cell title="挂装区" @click="onSelectPutawayArea('HANGING')" />
+      </van-cell-group>
+    </van-action-sheet>
   </div>
 </template>
 <script setup lang="ts">
-import { onMounted, onUnmounted, ref } from 'vue'
+import { computed, onMounted, onUnmounted, ref } from 'vue'
 import { showConfirmDialog, showNotify, showToast } from 'vant'
 import { androidFocus, getHeader, goBack, playVoiceBin, scanError, scanSuccess } from '@/utils/android'
 import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
@@ -156,6 +166,7 @@ const location=ref('')
 //库位类型
 const locationType = {
   'EA': '件拣货库位',
+  'GY': '挂装区',
   'AP': '补充拣货位',
   'CS': '箱拣货库位',
   'HP': '快拣补货位',
@@ -171,6 +182,19 @@ const bin = ref('') //当前格口
 //推荐库位
 const locationList = ref([])
 const dataMap = ref({})
+// 上架区域(立库V4),默认全部
+const putawayArea = ref('')
+const putawayAreaSheetShow = ref(false)
+const putawayAreaMap = { HANGING: '挂装区' }
+const putawayAreaLabel = computed(() => putawayAreaMap[putawayArea.value] || '全部')
+const onSelectPutawayArea = (value = '') => {
+  const prev = putawayArea.value
+  putawayArea.value = value
+  putawayAreaSheetShow.value = false
+  if (value !== prev && barcodeActive.value?.lotNumber) {
+    _getRecommendedLocation(barcodeActive.value.lotNumber, barcodeActive.value.owner)
+  }
+}
 
 // 设置容器号
 const setBarcode = (code) => {
@@ -284,13 +308,14 @@ const matchingBarcodeItem = (data, barcode) => {
 // 获取库存数据
 const _getRecommendedLocation = async (lotNum, owner) => {
   try {
-    const params = { warehouse, lotNum, owner,zoneGroup:mode.value?'WH01-3':'WH01-01' }
+    const params = { warehouse, lotNum, owner, zoneGroup: mode.value ? 'WH01-3' : 'WH01-01' }
+    if (mode.value && putawayArea.value) params.putawayArea = putawayArea.value
     const res = await getRecommendedLocation(params)
     locationList.value = res.data
     //  'EA'数据
-    const eaItems = res.data.filter(item => item.type === 'EA')
+    const eaItems = res.data.filter(item => {return item.type === 'EA' || item.type === 'GY'})
     // 获取 quantity < 300 的
-    let result = eaItems.find(item => item.quantity !== null && item.quantity < 1000)
+    let result = eaItems.find(item => item.quantity !== null && item.quantity < 10000)
     // 获取 quantity 为 null 的
     if (!result) {
       result = eaItems.find(item => item.quantity === null)
@@ -396,6 +421,7 @@ const reset=()=>{
   searchBarcode.value = ''
   bin.value=''
   locationActive.value = []
+  putawayArea.value = ''
   tips.value='请扫描容器号'
 }
 window.onRefresh = loadData
@@ -462,6 +488,33 @@ window.onRefresh = loadData
             border-bottom: 2px solid #0077ff
             z-index: 2
 
+        .putaway-area-row
+          ::v-deep(.van-cell)
+            padding: 0 12px 0 15px
+            height: 50px
+            align-items: center
+            background: #fff
+
+          ::v-deep(.van-cell__title)
+            width: 80px
+            min-width: 80px
+            max-width: 80px
+            flex: none
+            display: flex
+            align-items: center
+            justify-content: flex-end
+            font-size: 16px
+            text-align: right
+
+          ::v-deep(.van-cell__value)
+            flex: 1
+            font-size: 16px
+            text-align: right
+
+          ::v-deep(.van-cell::after)
+            left: 80px
+            right: 0
+            border-bottom: 2px solid #efefef
 
       .code-tips
         color: #ed6a0c