Commit f3acfbde by LJM

终极优化

parent 68021581
......@@ -20,6 +20,7 @@
width: 164rpx;
height: 35rpx;
padding-left: 17rpx;
border-right: 1px solid #f0f0f2;
.uni-input {
font-size: 18rpx;
color: #292b33;
......@@ -37,6 +38,7 @@
padding-left: 17rpx;
padding-right: 18rpx;
width: calc(100% - 164rpx);
height: 60rpx;
.uni-input {
font-size: 18rpx;
}
......@@ -49,6 +51,7 @@
padding-left: 17rpx;
padding-right: 18rpx;
width: calc(100% - 164rpx);
height: 60rpx;
.uni-input {
font-size: 18rpx;
color: #484b59;
......
<template>
<view class="immediatelyStockIn">
<!-- 入库批次号&旧标签 -->
<view class="form-input row verCenter">
<view class="pick-box">
<view class="pick-box row verCenter">
<picker @change="bindPickerChange($event, 2)" :value="index" :range="item_1">
<view class="row verCenter">
<view class="uni-input">{{ item_1[index_1] }}</view>
......@@ -11,16 +12,17 @@
</view>
<view class="row bothSide verCenter input-wrap">
<template v-if="index_1 == 0">
<input type="text" placeholder="请输入入库批次号" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" :focus="is_focus" />
<input type="text" placeholder="请输入入库批次号" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" :focus="is_focus4" />
</template>
<template v-else-if="index_1 == 1">
<input type="text" placeholder="请输入旧标签查询" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" maxlength="8" :focus="is_focus" />
<input type="text" placeholder="请输入旧标签查询" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" maxlength="8" :focus="is_focus4" />
</template>
<text class="iconfont icon-a-juxing11" @click="clearInput(4)" v-if="input_stock_in_batch_sn"></text>
</view>
</view>
<!-- 货品编码&自营货品ID -->
<view class="form-input row verCenter">
<view class="pick-box">
<view class="pick-box row verCenter">
<picker @change="bindPickerChange($event, 1)" :value="index" :range="item">
<view class="row verCenter">
<view class="uni-input">{{ item[index] }}</view>
......@@ -30,36 +32,39 @@
</view>
<view class="row bothSide verCenter input-wrap">
<template v-if="index == 0">
<input type="text" placeholder="请输入货品编码" placeholder-style="color:#919399" class="uni-input" v-model="formParams.goods_sn" @input="handleInput(1, $event)" />
<input type="text" placeholder="请输入货品编码" placeholder-style="color:#919399" class="uni-input" v-model="formParams.goods_sn" @input="handleInput(1, $event)" :focus="is_focus1" />
</template>
<template v-else-if="index == 1">
<input type="text" placeholder="请输入自营货品ID" placeholder-style="color:#919399" class="uni-input" v-model="formParams.sku_id" @input="handleInput(1, $event)" />
<input type="text" placeholder="请输入自营货品ID" placeholder-style="color:#919399" class="uni-input" v-model="formParams.sku_id" @input="handleInput(1, $event)" :focus="is_focus1" />
</template>
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_goods_sn"></text>
</view>
</view>
<!-- 货品名称 -->
<view class="form-input row verCenter">
<text class="text row verCenter">货品名称</text>
<view class="row bothSide verCenter input-wrap">
<input type="text" placeholder="请输入货品名称" placeholder-style="color:#919399" class="uni-input" v-model="formParams.goods_name" @input="handleInput(2, $event)" />
<input type="text" placeholder="请输入货品名称" placeholder-style="color:#919399" class="uni-input" v-model="formParams.goods_name" @input="handleInput(2, $event)" :focus="is_focus2" />
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_goods_name"></text>
</view>
</view>
<!-- 仓库 -->
<view class="form-input row verCenter">
<text class="text row verCenter">仓 库</text>
<view class="row bothSide verCenter select-wrap">
<picker @change="bindPickerChange($event)" :value="warehouse_id_index" :range="warehouse_id_data" range-key="name" style="width: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input">{{ warehouse_id_data[warehouse_id_index].name }}</view>
<view class="uni-input">{{ warehouse_id_data[warehouse_id_index] ? warehouse_id_data[warehouse_id_index].name : '' }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 库位 -->
<view class="form-input row verCenter" :class="{ 'error-style': !is_submit }">
<text class="text row verCenter">库 位</text>
<view class="row bothSide verCenter input-wrap">
<input type="text" placeholder="请输入库位" placeholder-style="color:#919399" class="uni-input" v-model="formParams.position_code" @input="handleInput(3, $event)" />
<input type="text" placeholder="请输入库位" placeholder-style="color:#919399" class="uni-input" v-model="formParams.position_code" @input="handleInput(3, $event)" :focus="is_focus3" />
<text class="iconfont icon-a-juxing11" @click="clearInput(3)" v-if="input_position"></text>
</view>
</view>
......@@ -74,7 +79,10 @@
export default {
data() {
return {
is_focus: false, //获取焦点动态化
is_focus1: false, //获取焦点动态化
is_focus2: false,
is_focus3: false,
is_focus4: false,
is_submit: true,
index: 0,
item: ['货品编码', '自营货品ID'],
......@@ -107,15 +115,20 @@
*/
bindPickerChange: function(e, type) {
if (type == 1) {
//货品编码&自营货品ID
this.index = e.detail.value;
if (this.index == 0) {
this.formParams.sku_id = '';
} else if (this.index == 1) {
this.formParams.goods_sn = '';
}
this.clearInputAndFocus(1); //再次获取焦点
} else if (type == 2) {
//入库批次号&旧标签
this.index_1 = e.detail.value;
this.clearInputAndFocus(4); //再次获取焦点
} else {
//仓库选择
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
}
......@@ -126,23 +139,29 @@
*/
clearInput(type) {
if (type == 1) {
//货品编码&自营货品ID
if (this.index == 0) {
this.formParams.goods_sn = '';
} else if (this.index == 1) {
this.formParams.sku_id = '';
}
this.input_goods_sn = false;
this.clearInputAndFocus(1); //再次获取焦点
} else if (type == 2) {
// 货品名称
this.formParams.goods_name = '';
this.input_goods_name = false;
this.clearInputAndFocus(2); //再次获取焦点
} else if (type == 3) {
//库位
this.formParams.position_code = '';
this.input_position = false;
this.clearInputAndFocus(3); //再次获取焦点
} else if (type == 4) {
//入库批次号 旧标签
this.formParams.stock_in_batch_sn = '';
this.input_stock_in_batch_sn = false;
this.clearInputAndFocus();
this.clearInputAndFocus(4); //再次获取焦点
}
},
/**
......@@ -227,12 +246,32 @@
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
clearInputAndFocus(type) {
if (type == 1) {
this.input_flag = false; //关闭叉叉
this.is_focus1 = false;
setTimeout(() => {
this.is_focus1 = true;
}, 200);
} else if (type == 2) {
this.input_flag = false; //关闭叉叉
this.is_focus2 = false;
setTimeout(() => {
this.is_focus2 = true;
}, 200);
} else if (type == 3) {
this.input_flag = false; //关闭叉叉
this.is_focus3 = false;
setTimeout(() => {
this.is_focus3 = true;
}, 200);
} else if (type == 4) {
this.input_flag = false; //关闭叉叉
this.is_focus4 = false;
setTimeout(() => {
this.is_focus4 = true;
}, 200);
}
}
}
};
......
......@@ -98,6 +98,7 @@
}
},
onShow() {
this.resetChange();
this.getData();
},
methods: {
......
......@@ -162,6 +162,7 @@
setTimeout(() => {
this.resetChange();
this.clearInputAndFocus();
this.getData();
}, 2000);
} else {
uni.showModal({
......
......@@ -14,10 +14,10 @@
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
......@@ -142,13 +142,14 @@
export default {
data() {
return {
is_focus: true, //获取焦点动态化
index: 0,
array: ['全量搜索', '旧标签'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
all_flag: false, //全选标记
page: 1,
limit: 50,
limit: 30,
hasMoreData: true, //是否分页加载
list: [],
filter_list: [], //筛选已选中的列表
......@@ -180,6 +181,7 @@
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
this.clearInputAndFocus();
},
/**
* 全选
......@@ -224,6 +226,7 @@
this.resetChange();
this.searchParams.all_search_keyword = '';
this.input_flag = false;
this.clearInputAndFocus();
this.getData();
},
/**
......@@ -476,6 +479,16 @@
resetChange() {
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
}
}
};
......
......@@ -732,12 +732,12 @@
if (type == 1) {
this.input_flag_position_name = true;
this.getData();
//再次获取焦点
//焦点从库位移到入库批次号
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
this.$forceUpdate();
}, 1500);
}, 1000);
} else if (type == 2) {
//入库批次号为自营仓库的时候,旧标签开启状态,输入文本后自动截取前8位,。
if (this.warehouse_id == 9 && this.old_Label) {
......@@ -775,17 +775,9 @@
let index_history_id = this.history_id.indexOf(val);
this.history_id.splice(index_history_id, 1);
try {
//再次获取焦点
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
} catch (e) {
//TODO handle the exception
}
this.clearInputAndFocus(); //再次获取焦点
this.search_keyword = ''; //清空批量存储入库批次号
this.getData();
}
});
return false;
......@@ -795,17 +787,8 @@
});
}
//执行最后再次获取焦点
try {
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
this.search_keyword = ''; //清空入库批次号
this.$forceUpdate();
}, 500);
} catch (e) {
//TODO handle the exception
}
this.clearInputAndFocus(); //执行最后再次获取焦点
this.search_keyword = ''; //清空入库批次号
});
} else {
this.input_flag_stock_in_batch_sn = true;
......
<template>
<view class="repairPrint">
<!-- 入库标签&旧标签&库位标签&库区标签&区域标签&容器标签 -->
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="labelStyles" range-key="name">
......@@ -13,15 +14,28 @@
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<template v-if="index == 0">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="16" :focus="is_focus" />
<input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="16" :focus="is_focus1" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" :focus="is_focus" />
<input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" :focus="is_focus1" />
</template>
<template v-else-if="index == 2">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入库位标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" :focus="is_focus1" />
</template>
<template v-else-if="index == 3">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入库区标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" :focus="is_focus1" />
</template>
<template v-else-if="index == 4">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入区域标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" :focus="is_focus1" />
</template>
<template v-else-if="index == 5">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入容器标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" :focus="is_focus1" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view>
</view>
<!-- 数量 -->
<view class="search-box row bothSide verCenter" v-if="formParams.type == 5" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
......@@ -33,11 +47,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" type="number" v-model="formParams.tally_qty" placeholder="请输入数量" placeholder-style="color:#919399" @input="handleInput(2, formParams.tally_qty)" :focus="is_focus_num" />
<input class="uni-input" type="number" v-model="formParams.tally_qty" placeholder="请输入数量" placeholder-style="color:#919399" @input="handleInput(2, formParams.tally_qty)" :focus="is_focus2" />
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_num"></text>
</view>
</view>
<!-- 目标打印机 -->
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
......@@ -49,9 +64,9 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" type="text" v-model="formParams.target_printer_ip" placeholder="请输入目标打印机" placeholder-style="color:#919399" />
<input class="uni-input" type="text" v-model="formParams.target_printer_ip" placeholder="请输入目标打印机" placeholder-style="color:#919399" @input="handleInput(3, formParams.target_printer_ip)" :focus="is_focus3" />
</view>
<text class="iconfont icon-a-juxing11" v-if="false"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput(3)" v-if="input_flag_target_printer_ip"></text>
</view>
</view>
<!-- 标签版本 -->
......@@ -90,6 +105,7 @@
</picker>
</view>
</view>
<!-- 仓库 -->
<view class="search-box row bothSide verCenter" style="margin-bottom: 22rpx;">
<view class="sn row rowCenter verCenter">
<view>
......@@ -107,6 +123,7 @@
</picker>
</view>
</view>
<!-- 打印按钮 -->
<view class="fix-btn row rowCenter verCenter" @click="latePrint()">打印</view>
</view>
</template>
......@@ -118,11 +135,13 @@
export default {
data() {
return {
is_focus: false, //获取焦点动态化
is_focus_num: false,
is_focus1: false, //获取焦点动态化
is_focus2: false,
is_focus3: false,
company_id: 1,
input_flag: false, //入库标签叉叉
input_flag_num: false, //数量叉叉
input_flag_target_printer_ip: false, //目标打印机
index: 0,
print_language_index: 0,
print_language: ['中文', '英文'],
......@@ -157,20 +176,25 @@
}
},
methods: {
/**
* 清空数据
*/
clearInput(type) {
bindPickerChange: function(e, type) {
if (type == 1) {
//入库标签
this.formParams.sn = '';
this.input_flag = false;
//标签版本切换
this.print_language_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
} else if (type == 2) {
//数量
this.formParams.tally_qty = '';
this.input_flag_num = false;
//仓库
this.warehouse_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_arr[e.detail.value].value;
} else if (type == 3) {
//打印货品标签
this.print_type_index = e.detail.value;
this.formParams.print_type = Number(e.detail.value) + 1;
} else {
//入库标签 旧标签 容器标签 库位标签 库区标签 区域标签
this.index = e.detail.value;
this.formParams.type = this.labelStyles[e.detail.value].id;
this.clearInputAndFocus(1);
}
this.clearInputAndFocus();
},
/**
* 单号搜索
......@@ -179,35 +203,44 @@
handleInput: debounce(function(type, val) {
if (val) {
if (type == 1) {
//入库标签
this.input_flag = true;
} else if (type == 2) {
//数量
this.input_flag_num = true;
} else if (type == 3) {
//目标打印机
this.input_flag_target_printer_ip = true;
}
} else {
if (type == 1) {
this.input_flag = false;
} else if (type == 2) {
this.input_flag_num = false;
} else if (type == 2) {
this.input_flag_target_printer_ip = false;
}
}
}, 500),
bindPickerChange: function(e, type) {
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
//标签版本切换
this.print_language_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
//入库标签
this.formParams.sn = '';
this.input_flag = false;
this.clearInputAndFocus(1);
} else if (type == 2) {
//仓库
this.warehouse_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_arr[e.detail.value].value;
//数量
this.formParams.tally_qty = '';
this.input_flag_num = false;
this.clearInputAndFocus(2);
} else if (type == 3) {
//打印货品标签
this.print_type_index = e.detail.value;
this.formParams.print_type = Number(e.detail.value) + 1;
} else {
//入库标签 旧标签 容器标签 库位标签 库区标签 区域标签
this.index = e.detail.value;
this.formParams.type = this.labelStyles[e.detail.value].id;
//目标打印机
this.formParams.target_printer_ip = '';
this.input_flag_target_printer_ip = false;
this.clearInputAndFocus(3);
}
},
/**
......@@ -262,16 +295,23 @@
if (type == 1) {
//入库标签
this.input_flag = false; //关闭叉叉
this.is_focus = false;
this.is_focus1 = false;
setTimeout(() => {
this.is_focus = true;
this.is_focus1 = true;
}, 200);
} else {
} else if (type == 2) {
//数量
this.input_flag_num = false;
this.is_focus_num = false;
this.is_focus2 = false;
setTimeout(() => {
this.is_focus2 = true;
}, 200);
} else if (type == 3) {
//目标打印机
this.input_flag_target_printer_ip = false;
this.is_focus3 = false;
setTimeout(() => {
this.is_focus_num = true;
this.is_focus3 = true;
}, 200);
}
}
......
......@@ -121,7 +121,7 @@
<view class="select-box row">
<picker @change="bindPickerChange(1, $event)" :value="real_shipping_type_index" :range="real_shipping_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_type_index == -1 ? '请选择' : real_shipping_type_data[real_shipping_type_index].name }}</view>
<view class="uni-input">{{ real_shipping_type_index === -1 ? '请选择' : (real_shipping_type_data[real_shipping_type_index] ? real_shipping_type_data[real_shipping_type_index].name : '请选择') }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -135,7 +135,7 @@
<view class="select-box row">
<picker @change="bindPickerChange(2, $event)" :value="real_shipping_id_index" :range="real_shipping_id_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_id_index == -1 ? '请选择' : real_shipping_id_data[real_shipping_id_index].name }}</view>
<view class="uni-input">{{ real_shipping_id_index === -1 ? '请选择' : (real_shipping_id_data[real_shipping_id_index] ? real_shipping_id_data[real_shipping_id_index].name : '请选择') }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -148,7 +148,7 @@
<view class="select-box row">
<picker @change="bindPickerChange(3, $event)" :value="real_shipping_mode_index" :range="real_shipping_mode_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ real_shipping_mode_index == -1 ? '请选择' : real_shipping_mode_data[real_shipping_mode_index].name }}</view>
<view class="uni-input">{{ real_shipping_mode_index === -1 ? '请选择' : (real_shipping_mode_data[real_shipping_mode_index] ? real_shipping_mode_data[real_shipping_mode_index].name : '请选择') }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -172,7 +172,7 @@
<view class="select-box row">
<picker @change="bindPickerChange(4, $event)" :value="shipping_payment_type_index" :range="shipping_payment_type_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ shipping_payment_type_index == -1 ? '请选择' : shipping_payment_type_data[shipping_payment_type_index].name }}</view>
<view class="uni-input">{{ shipping_payment_type_index === -1 ? '请选择' : (shipping_payment_type_data[shipping_payment_type_index] ? shipping_payment_type_data[shipping_payment_type_index].name : '请选择') }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......
......@@ -13,10 +13,10 @@
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" />
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
......@@ -189,6 +189,7 @@
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
this.clearInputAndFocus(); //再次获取焦点
},
/**
* 清空数据
......@@ -197,7 +198,7 @@
this.resetChange();
this.searchParams.all_search_keyword = '';
this.input_flag = false;
this.clearInputAndFocus();
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
/**
......
......@@ -14,13 +14,13 @@
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput($event,1)" :focus="is_focus" />
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.keyword" @input="handleInput($event,1)" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput($event,1)" maxlength="8" :focus="is_focus" />
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.keyword" @input="handleInput($event,1)" maxlength="8" />
</template>
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" focus v-model="searchParams.goods_name" @input="handleInput($event,2)" :focus="is_focus" />
<input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.goods_name" @input="handleInput($event,2)" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
......@@ -325,7 +325,7 @@
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
page: 1,
limit: 50,
limit: 30,
hasMoreData: true, //是否分页加载
list: [],
detail: {},
......@@ -441,6 +441,7 @@
if (type == 1) {
//全量搜索
this.index = e.detail.value;
this.clearInputAndFocus(); //再次获取焦点
this.clearInputAndFocus();
} else if (type == 2) {
//补打入库标签
......@@ -485,6 +486,7 @@
clearInput() {
this.resetChange();
this.searchParams.keyword = '';
this.searchParams.goods_name = '';
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
this.getData();
......
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