Commit f3acfbde by LJM

终极优化

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