Commit eda27ca4 by LJM

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

parent d4579db3
......@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<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>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -76,9 +81,11 @@
index: 0,
page: 1,
limit: 30,
array: ['出库单号'],
array: ['出库单号', '全量搜索'],
list: [],
searchParams: {
search_mod: 0,
search_keyword: '',
stock_out_sn: ''
}
};
......@@ -149,7 +156,8 @@
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_out_sn = '';
this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
......@@ -158,16 +166,33 @@
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
// 重置搜索参数
this.resetSearchParams();
this.resetChange();
var val = event.target.value;
if (val) {
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 {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置
*/
resetChange() {
......
......@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<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>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -90,12 +95,14 @@
is_focus: true, //获取焦点动态化
input_flag: false,
index: 0,
array: ['出库单号'],
array: ['出库单号', '全量搜索'],
list: [],
page: 1,
limit: 100,
hasMoreData: true, //是否分页加载
searchParams: {
search_mod: 0,
search_keyword: '',
stock_out_sn: '' //出库单号
}
};
......@@ -127,9 +134,9 @@
* 清空数据
*/
clearInput() {
this.resetChange();
this.input_flag = false;
this.searchParams.stock_out_sn = '';
this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
......@@ -138,12 +145,20 @@
* @param {Object} event
*/
handleInput: debounce(function(event) {
// 重置搜索参数
this.resetSearchParams();
this.resetChange();
var val = event.target.value;
this.searchParams.stock_out_sn = '';
if (val) {
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 {
this.input_flag = false;
}
......@@ -194,6 +209,14 @@
});
},
/**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置
*/
resetChange() {
......
......@@ -13,7 +13,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<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>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -92,14 +97,16 @@
page: 1,
limit: 30,
index: 0,
array: ['出库单号'],
array: ['出库单号', '全量搜索'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
hasMoreData: true, //是否分页加载
searchParams: {
stock_out_status: '5,6,7', //出库单状态
stock_out_sn: '' //出库单号
stock_out_sn: '', //出库单号
search_mod: 0,
search_keyword: '',
}
};
},
......@@ -158,9 +165,9 @@
* 清空数据
*/
clearInput() {
this.resetChange();
this.input_flag = false;
this.searchParams.stock_out_sn = '';
this.resetChange();
this.resetSearchParams();
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
......@@ -169,10 +176,19 @@
* @param {Object} event
*/
handleInput: debounce(function(event) {
// 重置搜索参数
this.resetSearchParams();
this.resetChange();
var val = event.target.value;
if (val) {
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) => {
if (data.length == 1) {
uni.navigateTo({
......@@ -183,7 +199,6 @@
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
......@@ -198,7 +213,7 @@
} else {
this.hasMoreData = false;
}
typeof callback == 'function' && callback(res.data.list, res.data.msg);
typeof callback == 'function' && callback(res.data.list);
} else {
uni.showToast({
title: res.msg,
......@@ -245,6 +260,14 @@
});
},
/**
* 重置参数
*/
resetSearchParams() {
this.searchParams.search_mod = 0;
this.searchParams.stock_out_sn = '';
this.searchParams.search_keyword = '';
},
/**
* 重置
*/
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