|
@@ -3,7 +3,7 @@
|
|
|
:title="title" left-arrow left-text="返回" right-text="扫描" fixed placeholder @click-left="goBack()"
|
|
:title="title" left-arrow left-text="返回" right-text="扫描" fixed placeholder @click-left="goBack()"
|
|
|
@click-right="goTakePhoto"
|
|
@click-right="goTakePhoto"
|
|
|
/>
|
|
/>
|
|
|
- <van-search v-model="stockOutSearch" placeholder="请输入搜索关键词" @search="searchStockOut" />
|
|
|
|
|
|
|
+ <van-search v-model="stockOutSearch" placeholder="请输入搜索关键词" @search="searchStockOut" @input="searchStockOut" />
|
|
|
<div class="content">
|
|
<div class="content">
|
|
|
<div>
|
|
<div>
|
|
|
<van-list
|
|
<van-list
|
|
@@ -76,7 +76,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted } from 'vue';
|
|
|
|
|
|
|
+import {ref, onMounted, onUnmounted} from 'vue';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
import PositionSelector from './PositionSelector.vue';
|
|
import PositionSelector from './PositionSelector.vue';
|
|
|
import { processException } from '../common/Common.js';
|
|
import { processException } from '../common/Common.js';
|
|
@@ -126,6 +126,11 @@ onMounted(() => {
|
|
|
title.value = route.query.warehouseName ? '出库 - ' + route.query.warehouseName : '出库';
|
|
title.value = route.query.warehouseName ? '出库 - ' + route.query.warehouseName : '出库';
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+// 在组件卸载时清除定时器(避免内存泄漏)
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ clearTimeout(timer);
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const isShowStockOut = ref(false);
|
|
const isShowStockOut = ref(false);
|
|
|
const isShowTransfer = ref(false);
|
|
const isShowTransfer = ref(false);
|
|
|
const isShowUsing = ref(false);
|
|
const isShowUsing = ref(false);
|
|
@@ -134,8 +139,21 @@ const goBack = () => {
|
|
|
router.push('/warehouse-selector?page=stock-out&warehouseId=' + warehouseId.value);
|
|
router.push('/warehouse-selector?page=stock-out&warehouseId=' + warehouseId.value);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+let timer = null;
|
|
|
|
|
+
|
|
|
// 搜索出库物料
|
|
// 搜索出库物料
|
|
|
const searchStockOut = value => {
|
|
const searchStockOut = value => {
|
|
|
|
|
+ clearTimeout(timer);
|
|
|
|
|
+ timer = setTimeout(() =>{
|
|
|
|
|
+ page.value = 1;
|
|
|
|
|
+ total.value = 0;
|
|
|
|
|
+ stockOutList.value = [];
|
|
|
|
|
+ loadStockOutList();
|
|
|
|
|
+ },1000);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 搜索出库物料 无防抖
|
|
|
|
|
+const serchStockOutNotDebounce = value => {
|
|
|
page.value = 1;
|
|
page.value = 1;
|
|
|
total.value = 0;
|
|
total.value = 0;
|
|
|
stockOutList.value = [];
|
|
stockOutList.value = [];
|
|
@@ -266,7 +284,7 @@ const submitStockOut = () => {
|
|
|
if (success.errorCode === 0) {
|
|
if (success.errorCode === 0) {
|
|
|
const filter = stockOutSearch.value;
|
|
const filter = stockOutSearch.value;
|
|
|
clearFormData();
|
|
clearFormData();
|
|
|
- searchStockOut(filter);
|
|
|
|
|
|
|
+ serchStockOutNotDebounce(filter);
|
|
|
showSuccessToast('出库成功');
|
|
showSuccessToast('出库成功');
|
|
|
} else {
|
|
} else {
|
|
|
showFailToast(success.errorMessage);
|
|
showFailToast(success.errorMessage);
|