zhaohuanhuan 4 месяцев назад
Родитель
Сommit
6d2daaa13f
1 измененных файлов с 17 добавлено и 5 удалено
  1. 17 5
      src/views/inventory/transfer/index.vue

+ 17 - 5
src/views/inventory/transfer/index.vue

@@ -1,6 +1,12 @@
 <template>
   <div class="transfer-container">
     <van-nav-bar title="移库" left-arrow fixed placeholder @click-left="goBack" @click-right="onConfirm">
+     <template #title>
+       <div @click="reset(1)">
+         移库
+         <van-icon name="replay" />
+       </div>
+     </template>
       <template #left>
         <van-icon name="arrow-left" size="25" />
         <div style="color: #fff">返回</div>
@@ -165,7 +171,7 @@
 </template>
 <script setup lang="ts">
 import { ref, onMounted, onUnmounted, nextTick } from 'vue'
-import { showConfirmDialog, showNotify } from 'vant'
+import { showConfirmDialog, showNotify, showToast } from 'vant'
 import nodataUrl from '@/assets/nodata.png'
 import { useRouter } from 'vue-router'
 import { useStore } from '@/store/modules/user'
@@ -278,13 +284,13 @@ const _handlerScan = (code) => {
         showNotify({ type: 'warning', duration: 3000, message: `暂未查询到《${code}》库存数据` })
         tips.value = `暂未查询到《${code}》库存数据`
         productBarcode.value = ''
-        reset()
+        reset(0)
       }
     }).catch((err) => {
       scanError()
       closeLoading()
       tips.value = err.message || '系统异常,请联系技术支持'
-      reset()
+      reset(0)
     })
   } else if (scanType.value == 3) {
     countRef.value?.blur()
@@ -364,7 +370,7 @@ const onConfirm = () => {
         tips.value = '操作成功,请继续扫描商品条码'
         scanType.value = 2
         productBarcode.value = ''
-        reset()
+        reset(0)
       }).catch(err => {
         scanError()
         closeLoading()
@@ -382,13 +388,19 @@ const onAsnCancel = () => {
     scanType.value = 2
   }
 }
-const reset = () => {
+const reset = (type) => {
+  productBarcode.value = ''
   productList.value = []
   sourceLocation.value = ''
   targetLocation.value = ''
   transferQuantity.value = ''
   oldProductBarcode.value = ''
   selectedProducts.value = {}
+  if(type==1){
+    scanType.value=2
+    tips.value = '请扫描商品条码/来源库位'
+    showToast({ message: `重置成功` })
+  }
 }
 const topRef = ref(null)
 const tableHeight = ref(261)