Commit eda27ca4 by LJM

移动端--出库拣货、复核,支持入库批次号、型号等查询。

parent d4579db3
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描出库单号" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.stock_out_sn" /> <template v-if="index == 0">
<input class="uni-input" placeholder="请扫描出库单号" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.stock_out_sn" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入关键词" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.search_keyword" />
</template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
...@@ -76,9 +81,11 @@ ...@@ -76,9 +81,11 @@
index: 0, index: 0,
page: 1, page: 1,
limit: 30, limit: 30,
array: ['出库单号'], array: ['出库单号', '全量搜索'],
list: [], list: [],
searchParams: { searchParams: {
search_mod: 0,
search_keyword: '',
stock_out_sn: '' stock_out_sn: ''
} }
}; };
...@@ -149,7 +156,8 @@ ...@@ -149,7 +156,8 @@
*/ */
clearInput() { clearInput() {
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
...@@ -158,16 +166,33 @@ ...@@ -158,16 +166,33 @@
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
var val = event.target.value; // 重置搜索参数
this.resetSearchParams();
this.resetChange(); this.resetChange();
var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
// 根据当前选择的模式进行赋值
if (this.index == 0) {
this.searchParams.stock_out_sn = val;
} else if (this.index == 1) {
this.searchParams.search_mod = 1;
this.searchParams.search_keyword = val;
}
} else { } else {
this.input_flag = false; this.input_flag = false;
} }
this.getData(); this.getData();
}, 500), }, 500),
/** /**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置 * 重置
*/ */
resetChange() { resetChange() {
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" v-model="searchParams.stock_out_sn" @input="handleInput" :focus="is_focus" /> <template v-if="index == 0">
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" v-model="searchParams.stock_out_sn" @input="handleInput" :focus="is_focus" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入关键词" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.search_keyword" />
</template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
...@@ -90,12 +95,14 @@ ...@@ -90,12 +95,14 @@
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
input_flag: false, input_flag: false,
index: 0, index: 0,
array: ['出库单号'], array: ['出库单号', '全量搜索'],
list: [], list: [],
page: 1, page: 1,
limit: 100, limit: 100,
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
searchParams: { searchParams: {
search_mod: 0,
search_keyword: '',
stock_out_sn: '' //出库单号 stock_out_sn: '' //出库单号
} }
}; };
...@@ -127,9 +134,9 @@ ...@@ -127,9 +134,9 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
...@@ -138,12 +145,20 @@ ...@@ -138,12 +145,20 @@
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
// 重置搜索参数
this.resetSearchParams();
this.resetChange(); this.resetChange();
var val = event.target.value; var val = event.target.value;
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
this.searchParams.stock_out_sn = val; // 根据当前选择的模式进行赋值
if (this.index == 0) {
this.searchParams.stock_out_sn = val;
} else if (this.index == 1) {
this.searchParams.search_mod = 1;
this.searchParams.search_keyword = val;
}
} else { } else {
this.input_flag = false; this.input_flag = false;
} }
...@@ -194,6 +209,14 @@ ...@@ -194,6 +209,14 @@
}); });
}, },
/** /**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置 * 重置
*/ */
resetChange() { resetChange() {
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_out_sn" @input="handleInput" /> <template v-if="index == 0">
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_out_sn" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入关键词" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.search_keyword" />
</template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
...@@ -92,14 +97,16 @@ ...@@ -92,14 +97,16 @@
page: 1, page: 1,
limit: 30, limit: 30,
index: 0, index: 0,
array: ['出库单号'], array: ['出库单号', '全量搜索'],
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
searchParams: { searchParams: {
stock_out_status: '5,6,7', //出库单状态 stock_out_status: '5,6,7', //出库单状态
stock_out_sn: '' //出库单号 stock_out_sn: '', //出库单号
search_mod: 0,
search_keyword: '',
} }
}; };
}, },
...@@ -158,9 +165,9 @@ ...@@ -158,9 +165,9 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点 this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
...@@ -169,10 +176,19 @@ ...@@ -169,10 +176,19 @@
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
// 重置搜索参数
this.resetSearchParams();
this.resetChange(); this.resetChange();
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
// 根据当前选择的模式进行赋值
if (this.index == 0) {
this.searchParams.stock_out_sn = val;
} else if (this.index == 1) {
this.searchParams.search_mod = 1;
this.searchParams.search_keyword = val;
}
this.getData((data, msg) => { this.getData((data, msg) => {
if (data.length == 1) { if (data.length == 1) {
uni.navigateTo({ uni.navigateTo({
...@@ -183,7 +199,6 @@ ...@@ -183,7 +199,6 @@
} else { } else {
this.input_flag = false; this.input_flag = false;
} }
this.getData();
}, 500), }, 500),
/** /**
* 获取列表数据 * 获取列表数据
...@@ -198,7 +213,7 @@ ...@@ -198,7 +213,7 @@
} else { } else {
this.hasMoreData = false; this.hasMoreData = false;
} }
typeof callback == 'function' && callback(res.data.list, res.data.msg); typeof callback == 'function' && callback(res.data.list);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
...@@ -245,6 +260,14 @@ ...@@ -245,6 +260,14 @@
}); });
}, },
/** /**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置 * 重置
*/ */
resetChange() { resetChange() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment