Commit 7836ed72 by LJM

优化

parent 6bb64fef
...@@ -15,9 +15,11 @@ ...@@ -15,9 +15,11 @@
.icon-a-juxing11 { .icon-a-juxing11 {
font-size: 30rpx; font-size: 30rpx;
color: #c6c7cc; color: #c6c7cc;
width: 60rpx;
text-align: center;
} }
.uni-input { .uni-input {
width: 600rpx; width: 465rpx;
font-size: 18rpx; font-size: 18rpx;
color: #484b59; color: #484b59;
margin-left: 13rpx; margin-left: 13rpx;
...@@ -157,6 +159,7 @@ ...@@ -157,6 +159,7 @@
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 75rpx;
left: 0; left: 0;
.btn1 { .btn1 {
width: 248rpx; width: 248rpx;
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
margin-top: 15rpx; margin-top: 15rpx;
label { label {
margin-right: 10rpx; margin-right: 10rpx;
font-size: 24rpx; font-size: 16rpx;
color: #1969f9;
} }
} }
.list { .list {
......
...@@ -92,6 +92,7 @@ ...@@ -92,6 +92,7 @@
overflow: hidden; overflow: hidden;
} }
.desc { .desc {
width: 60%;
font-size: 17rpx; font-size: 17rpx;
color: #484b59; color: #484b59;
word-break: break-all; word-break: break-all;
......
...@@ -38,17 +38,22 @@ ...@@ -38,17 +38,22 @@
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="search-all row verCenter"> <view class="search-all row verCenter bothSide">
<text class="iconfont icon-juxing1"></text> <view class="row verCenter">
<template v-if="index == 0"> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" focus v-model="searchParams.mobile_register_all_search" @input="handleInput(1, $event)" /> <!-- 全量搜索 -->
</template> <template v-if="index == 0">
<template v-else-if="index == 1"> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_register_all_search" @input="handleInput(1, $event)" />
<input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" :maxlength="maxInputLength" /> </template>
</template> <!-- 入仓号 -->
<template v-else-if="index == 2"> <template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" focus v-model="searchParams.tracking_no" @input="handleInput(3, $event)" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" :maxlength="maxInputLength" />
</template> </template>
<!-- fedex -->
<template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.tracking_no" @input="handleInput(3, $event)" />
</template>
</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>
<!-- 列表数据 --> <!-- 列表数据 -->
...@@ -475,6 +480,7 @@ ...@@ -475,6 +480,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
indicatorDots: true, indicatorDots: true,
autoplay: false, autoplay: false,
interval: 2000, interval: 2000,
...@@ -561,6 +567,10 @@ ...@@ -561,6 +567,10 @@
this.getZyGoodsData(stock_in_sn, 1); this.getZyGoodsData(stock_in_sn, 1);
} }
}, },
/**
* 搜索条件切换
* @param {Object} e
*/
radioChange(e) { radioChange(e) {
this.index = e.detail.value; this.index = e.detail.value;
}, },
...@@ -732,20 +742,23 @@ ...@@ -732,20 +742,23 @@
*/ */
clearInput(type) { clearInput(type) {
if (type == 'start') { if (type == 'start') {
//清除起始时间
this.searchParams.create_time_begin = ''; this.searchParams.create_time_begin = '';
} else if (type == 'end') { } else if (type == 'end') {
//清除结束时间
this.searchParams.create_time_end = ''; this.searchParams.create_time_end = '';
} else { } else {
this.input_flag = false;
this.resetChange(); this.resetChange();
//搜索条件清空
if (this.index == 0) { if (this.index == 0) {
this.searchParams.mobile_register_all_search = ''; this.searchParams.mobile_register_all_search = ''; //全量搜索
} else if (this.index == 1) { } else if (this.index == 1) {
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = ''; //入仓号
} else if (this.index == 2) { } else if (this.index == 2) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = ''; //Fedex
} }
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
} }
this.getData(); this.getData();
}, },
...@@ -987,6 +1000,7 @@ ...@@ -987,6 +1000,7 @@
this.resetChange(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.clearInputAndFocus();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -1048,6 +1062,7 @@ ...@@ -1048,6 +1062,7 @@
this.resetChange(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
this.filter_id = []; this.filter_id = [];
this.filter_id_warehouse_id = []; this.filter_id_warehouse_id = [];
}, 2000); }, 2000);
...@@ -1080,6 +1095,7 @@ ...@@ -1080,6 +1095,7 @@
this.resetChange(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
this.filter_id = []; this.filter_id = [];
this.filter_id_warehouse_id = []; this.filter_id_warehouse_id = [];
}, 2000); }, 2000);
...@@ -1130,6 +1146,16 @@ ...@@ -1130,6 +1146,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);
} }
} }
}; };
......
<template> <template>
<view class="arrivalRegister"> <view class="arrivalRegister">
<!-- 搜索条件 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,15 +14,16 @@ ...@@ -13,15 +14,16 @@
<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.mobile_register_all_search" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_register_all_search" @input="handleInput(1, $event)" />
</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.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" :maxlength="maxInputLength" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" :maxlength="maxInputLength" />
</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>
</view> </view>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }"> <view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view> <view class="check-box-icon" @click="filterChange(index)"></view>
...@@ -73,6 +75,7 @@ ...@@ -73,6 +75,7 @@
<text class="iconfont icon-a-juxing21"></text> <text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text> <text class="text">查不到当前数据</text>
</view> </view>
<!-- 底部操作按钮 -->
<view class="fix-btn row verCenter"> <view class="fix-btn row verCenter">
<view class="btn3 row rowCenter verCenter" @click="allChnage()"> <view class="btn3 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text> <text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
...@@ -143,248 +146,272 @@ ...@@ -143,248 +146,272 @@
<text class="tt">{{ detail.arrival_name }}</text> <text class="tt">{{ detail.arrival_name }}</text>
</view> </view>
</view> </view>
<view class="btn row rowCenter verCenter"><view class="btn2 row rowCenter verCenter" @click="closeStockInRegister(2, detail.stock_in_sn)" style="width: 100%;">取消登记</view></view> <view class="btn row rowCenter verCenter">
<view class="btn2 row rowCenter verCenter" @click="closeStockInRegister(2, detail.stock_in_sn)" style="width: 100%;">取消登记</view>
</view>
</view> </view>
</uni-drawer> </uni-drawer>
</view> </view>
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js'; import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
input_flag: false, is_focus: true, //获取焦点动态化
all_flag: false, //全选标记 input_flag: false,
page: 1, all_flag: false, //全选标记
limit: 50, page: 1,
index: 0, limit: 50,
array: ['全量搜索', '入仓号'], index: 0,
list: [], array: ['全量搜索', '入仓号'],
filter_list: [], //筛选已选中的列表 list: [],
filter_id: [], //过滤id filter_list: [], //筛选已选中的列表
detail: {}, //详情的数据 filter_id: [], //过滤id
hasMoreData: true, //是否分页加载 detail: {}, //详情的数据
maxInputLength: 7, hasMoreData: true, //是否分页加载
searchParams: { maxInputLength: 7,
mobile_register_all_search: '', //全量搜索 searchParams: {
stock_in_with_stock_in_items_inhouse: '' //入仓单号 mobile_register_all_search: '', //全量搜索
} stock_in_with_stock_in_items_inhouse: '' //入仓单号
};
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onShow() {
this.resetChange();
this.getData();
},
methods: {
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
} }
}); };
return result;
}, },
/** onNavigationBarButtonTap(e) {
* 筛选过滤出选中的元素 if (e.index == 0) {
*/ uni.reLaunch({
filterChange(index) { url: '/pages/index/index'
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_sn);
},
/**
* 全选
*/
allChnage() {
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.stock_in_sn;
}); });
} else {
this.filter_id = [];
} }
}, },
/** onReachBottom() {
* 清空数据 if (!this.hasMoreData) {
*/ return;
clearInput() {
this.input_flag = false;
this.resetChange();
if (this.index == 0) {
this.searchParams.mobile_register_all_search = '';
} else if (this.index == 1) {
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
} }
this.page++;
this.getData(); this.getData();
}, },
/** onShow() {
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, event) {
this.resetChange(); this.resetChange();
var val = event.target.value;
this.searchParams.mobile_register_all_search = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
if (val) {
if (type == 1) {
this.searchParams.mobile_register_all_search = val;
} else if (type == 2) {
//入仓号
var str = val;
if (str.startsWith('F')) {
this.maxInputLength = 8;
} else {
this.maxInputLength = 7;
}
this.searchParams.stock_in_with_stock_in_items_inhouse = val;
}
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData(); this.getData();
}, 500), },
/** methods: {
* 获取列表数据 /**
*/ * 找出false对应的下标
getData() { * @param {Object} arr
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 1, ...this.searchParams }, true).then(res => { * @param {Object} target
if (res.code === 0) { */
if (res.data.total > 0) { findIndex(arr, target) {
this.hasMoreData = true; const result = [];
this.list = this.list.concat(res.data.list); arr.map((item, index) => {
this.filter_list = createArray(this.list.length, false); if (item === target) {
} else { result.push(index);
this.hasMoreData = false;
} }
} else { });
uni.showToast({ return result;
title: res.msg, },
icon: 'error' /**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_sn);
},
/**
* 全选
*/
allChnage() {
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.stock_in_sn;
}); });
}
});
},
/**
* 获取详情
* @param {Object} stock_in_sn 入库单号
*/
getDetail(stock_in_sn) {
this.request(API.stockInMobileRegisterList, 'POST', { page: 1, limit: this.limit, stock_in_sn: stock_in_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data.list[0];
} else { } else {
uni.showToast({ this.filter_id = [];
title: res.msg,
icon: 'error'
});
} }
}); },
}, /**
/** * 清空数据
* 取消登记 */
* @param {Object} type clearInput() {
* @param {Object} id this.input_flag = false;
*/ this.clearInputAndFocus(); //再次获取焦点
closeStockInRegister(type, id) { this.resetChange();
var stock_in_sn = []; if (this.index == 0) {
if (type == 1) { //全量搜索
if (this.filter_id.length == 0) { this.searchParams.mobile_register_all_search = '';
uni.showToast({ } else if (this.index == 1) {
title: '请选择货品', //入仓号
icon: 'error' this.searchParams.stock_in_with_stock_in_items_inhouse = '';
});
return false;
} }
stock_in_sn = this.filter_id; this.getData();
} else if (type == 2) { },
stock_in_sn[0] = id; /**
} * 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, event) {
this.resetChange();
var val = event.target.value;
this.searchParams.mobile_register_all_search = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
uni.showModal({ if (val) {
title: '提示', if (type == 1) {
content: '确定要取消登记吗?', //全量搜索
showCancel: true, this.searchParams.mobile_register_all_search = val;
success: res => { } else if (type == 2) {
if (res.confirm) { //入仓号
this.request(API.closeStockInRegister, 'POST', { stock_in_sn: JSON.stringify(stock_in_sn) }, true).then(res => { var str = val;
if (res.code === 0) { if (str.startsWith('F')) {
uni.showToast({ this.maxInputLength = 8;
title: '取消成功', } else {
icon: 'success' this.maxInputLength = 7;
}); }
setTimeout(() => { this.searchParams.stock_in_with_stock_in_items_inhouse = val;
this.filter_id = []; }
this.resetChange(); this.input_flag = true;
this.closeDrawer(); } else {
this.getData(); this.input_flag = false;
}, 2000); }
} else { this.getData();
uni.showModal({ }, 500),
title: '提示', /**
content: res.msg, * 获取列表数据
showCancel: false */
}); getData() {
} this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 1, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.total > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取详情
* @param {Object} stock_in_sn 入库单号
*/
getDetail(stock_in_sn) {
this.request(API.stockInMobileRegisterList, 'POST', { page: 1, limit: this.limit, stock_in_sn: stock_in_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data.list[0];
} else {
uni.showToast({
title: res.msg,
icon: 'error'
}); });
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
} }
});
},
/**
* 取消登记
* @param {Object} type
* @param {Object} id
*/
closeStockInRegister(type, id) {
var stock_in_sn = [];
if (type == 1) {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
stock_in_sn = this.filter_id;
} else if (type == 2) {
stock_in_sn[0] = id;
} }
});
}, uni.showModal({
bindPickerChange: function(e) { title: '提示',
console.log('picker发送选择改变,携带值为', e.detail.value); content: '确定要取消登记吗?',
this.index = e.detail.value; showCancel: true,
}, success: res => {
showDrawer(stock_in_sn) { if (res.confirm) {
this.$refs.showRight.open(); this.request(API.closeStockInRegister, 'POST', { stock_in_sn: JSON.stringify(stock_in_sn) }, true).then(res => {
this.getDetail(stock_in_sn); if (res.code === 0) {
}, uni.showToast({
closeDrawer() { title: '取消成功',
this.$refs.showRight.close(); icon: 'success'
}, });
/** setTimeout(() => {
* 重置 this.resetChange();
*/ this.getData();
resetChange() { this.closeDrawer();
this.list = []; this.clearInputAndFocus(); //再次获取焦点
this.page = 1; }, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 打开弹窗
* @param {Object} stock_in_sn
*/
showDrawer(stock_in_sn) {
this.$refs.showRight.open();
this.getDetail(stock_in_sn);
},
/**
* 关闭弹窗
*/
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
}
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/arrivalRegister/index.scss'; @import '@/assets/css/arrivalRegister/index.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="page-container"> <view class="page-container">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,18 +14,19 @@ ...@@ -13,18 +14,19 @@
<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.container_sn" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描或输入容器编码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.container_sn" @input="handleInput(1, $event)" />
</template> </template>
<template v-if="index == 1"> <template v-if="index == 1">
<input class="uni-input" placeholder="请输入创建人" placeholder-style="color:#919399" focus v-model="searchParams.create_name" @input="handleInput(2, $event)" /> <input class="uni-input" placeholder="请输入创建人" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.create_name" @input="handleInput(2, $event)" />
</template> </template>
<template v-if="index == 2"> <template v-if="index == 2">
<input class="uni-input" placeholder="请输入更新人" placeholder-style="color:#919399" focus v-model="searchParams.update_name" @input="handleInput(3, $event)" /> <input class="uni-input" placeholder="请输入更新人" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.update_name" @input="handleInput(3, $event)" />
</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>
</view> </view>
</view> </view>
<!-- 筛选 -->
<view class="radio-wrap row verCenter"> <view class="radio-wrap row verCenter">
<radio-group name="radio" @change="radioChange($event, 1)"> <radio-group name="radio" @change="radioChange($event, 1)">
<label> <label>
...@@ -41,6 +43,7 @@ ...@@ -41,6 +43,7 @@
</label> </label>
</radio-group> </radio-group>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }" style="padding-bottom: 50rpx;"> <view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }" style="padding-bottom: 50rpx;">
<view class="check-box-icon" @click="filterChange(index)"></view> <view class="check-box-icon" @click="filterChange(index)"></view>
...@@ -89,14 +92,18 @@ ...@@ -89,14 +92,18 @@
<text class="label">备注:</text> <text class="label">备注:</text>
<text class="desc">{{ item.remark }}</text> <text class="desc">{{ item.remark }}</text>
</view> </view>
<view class="btn-box row"><view class="btn row rowCenter verCenter" @click="showDrawer(item)">修改</view></view> <view class="btn-box row">
<view class="btn row rowCenter verCenter" @click="showDrawer(item)">修改</view>
</view>
</view> </view>
</view> </view>
<view class="no-date column rowCenter verCenter" v-else> <view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text> <text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text> <text class="text">查不到当前数据</text>
</view> </view>
<view class="fix-btn row verCenter"><view class="btn row rowCenter verCenter" @click="exportContainerStock()">导出容器库存</view></view> <view class="fix-btn row verCenter">
<view class="btn row rowCenter verCenter" @click="exportContainerStock()">导出容器库存</view>
</view>
<!-- 理货详情弹窗 --> <!-- 理货详情弹窗 -->
<uni-drawer ref="showRight" mode="right"> <uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-container" v-if="detail"> <view class="uni-drawer-container" v-if="detail">
...@@ -160,297 +167,312 @@ ...@@ -160,297 +167,312 @@
<text class="tt">{{ detail.create_name }}</text> <text class="tt">{{ detail.create_name }}</text>
</view> </view>
</view> </view>
<view class="btn row verCenter bothSide"><view class="btn1 row rowCenter verCenter" @click="update()">保存</view></view> <view class="btn row verCenter bothSide">
<view class="btn1 row rowCenter verCenter" @click="update()">保存</view>
</view>
</view> </view>
</uni-drawer> </uni-drawer>
</view> </view>
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import { createArray } from '@/util/util.js'; import { createArray } from '@/util/util.js';
export default {
data() {
return {
page: 1,
limit: 50,
input_flag: false,
index: 0,
array: ['容器编码', '创建人', '更新人'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], ///筛选已选中id
detail: {}, //详情的数据
hasMoreData: true, //是否分页加载
searchParams: {
search_date: '', //日期
container_sn: '', //容器编码
create_name: '', //创建人
update_name: '' //更新人
},
foramParams: {
id: '',
container_name: '',
length: '',
width: '',
height: '',
rough_weight: '',
actual_weight: '',
remark: ''
}
};
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
onShow() {
this.resetChange();
this.searchParams.search_date = this.getRecentMonthDateRange(0);
this.getData();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 日期
*/
getRecentMonthDateRange(val) {
// 获取当前日期
const currentDate = new Date();
// 获取一个月前的日期 export default {
const oneMonthAgoDate = new Date(currentDate); data() {
if (val == 0) { return {
oneMonthAgoDate.setMonth(oneMonthAgoDate.getMonth() - 1); is_focus: true, //获取焦点动态化
} else if (val == 1) { page: 1,
oneMonthAgoDate.setMonth(oneMonthAgoDate.getMonth() - 3); limit: 50,
} input_flag: false,
index: 0,
// 格式化日期为 "yyyy-MM-dd" 格式 array: ['容器编码', '创建人', '更新人'],
const formatDate = date => { list: [],
const year = date.getFullYear(); filter_list: [], //筛选已选中的列表
const month = (date.getMonth() + 1).toString().padStart(2, '0'); filter_id: [], ///筛选已选中id
const day = date detail: {}, //详情的数据
.getDate() hasMoreData: true, //是否分页加载
.toString() searchParams: {
.padStart(2, '0'); search_date: '', //日期
return `${year}-${month}-${day}`; container_sn: '', //容器编码
create_name: '', //创建人
update_name: '' //更新人
},
foramParams: {
id: '',
container_name: '',
length: '',
width: '',
height: '',
rough_weight: '',
actual_weight: '',
remark: ''
}
}; };
// 连接两个格式化后的日期,用 '~' 分隔
return `${formatDate(oneMonthAgoDate)} ~ ${formatDate(currentDate)}`;
}, },
/** onReachBottom() {
* 时间切换 if (!this.hasMoreData) {
* @param {Object} e return;
* @param {Object} type
*/
radioChange(e, type) {
this.resetChange();
if (type == 1) {
if (e.detail.value == 2) {
this.searchParams.search_date = '';
} else {
this.searchParams.search_date = this.getRecentMonthDateRange(e.detail.value);
}
} }
this.page++;
this.getData(); this.getData();
}, },
/** onNavigationBarButtonTap(e) {
* 导出 if (e.index == 0) {
*/ uni.reLaunch({
exportContainerStock() { url: '/pages/index/index'
var params = Object.assign({}, this.searchParams, { });
container_ids: this.filter_id.join(',') }
});
this.request(API.exportContainerStock, 'POST', params, true).then(res => {
if (res.code === 0) {
uni.downloadFile({
url: res.data.oss_file_url,
success: function(res) {
const filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
console.log('打开文档成功');
},
fail: function() {
uni.showModal({
title: '提示',
content: '暂不支持该文件类型预览',
showCancel: false
});
console.log('打开文档失败');
}
});
},
fail(error) {
console.log(error);
}
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].id);
}, },
/** onShow() {
* 清空数据
*/
clearInput() {
this.resetChange(); this.resetChange();
this.input_flag = false; this.searchParams.search_date = this.getRecentMonthDateRange(0);
if (this.index == 0) {
this.searchParams.container_sn = '';
} else if (this.index == 1) {
this.searchParams.create_name = '';
} else if (this.index == 2) {
this.searchParams.update_name = '';
}
this.getData(); this.getData();
}, },
/** methods: {
* 单号搜索 bindPickerChange: function(e) {
* @param {Object} event console.log('picker发送选择改变,携带值为', e.detail.value);
*/ this.index = e.detail.value;
handleInput: debounce(function(type, event) { },
this.resetChange(); /**
var val = event.target.value; * 日期
this.searchParams.container_sn = ''; */
this.searchParams.create_name = ''; getRecentMonthDateRange(val) {
this.searchParams.update_name = ''; // 获取当前日期
if (val) { const currentDate = new Date();
// 获取一个月前的日期
const oneMonthAgoDate = new Date(currentDate);
if (val == 0) {
oneMonthAgoDate.setMonth(oneMonthAgoDate.getMonth() - 1);
} else if (val == 1) {
oneMonthAgoDate.setMonth(oneMonthAgoDate.getMonth() - 3);
}
// 格式化日期为 "yyyy-MM-dd" 格式
const formatDate = date => {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date
.getDate()
.toString()
.padStart(2, '0');
return `${year}-${month}-${day}`;
};
// 连接两个格式化后的日期,用 '~' 分隔
return `${formatDate(oneMonthAgoDate)} ~ ${formatDate(currentDate)}`;
},
/**
* 时间切换
* @param {Object} e
* @param {Object} type
*/
radioChange(e, type) {
this.resetChange();
if (type == 1) { if (type == 1) {
this.searchParams.container_sn = val; if (e.detail.value == 2) {
} else if (type == 2) { this.searchParams.search_date = '';
this.searchParams.create_name = val; } else {
} else if (type == 3) { this.searchParams.search_date = this.getRecentMonthDateRange(e.detail.value);
this.searchParams.update_name = val; }
} }
this.input_flag = true; this.getData();
} else { },
this.input_flag = false; /**
} * 导出
this.getData(); */
}, 500), exportContainerStock() {
/** var params = Object.assign({}, this.searchParams, {
* 打开弹窗 container_ids: this.filter_id.join(',')
* @param {Object} data });
*/ this.request(API.exportContainerStock, 'POST', params, true).then(res => {
showDrawer(data) { if (res.code === 0) {
this.detail = data; uni.downloadFile({
this.foramParams.id = data.id; url: res.data.oss_file_url,
this.foramParams.container_name = data.container_name; success: function(res) {
this.foramParams.length = data.length; const filePath = res.tempFilePath;
this.foramParams.width = data.width; uni.openDocument({
this.foramParams.height = data.height; filePath: filePath,
this.foramParams.actual_weight = data.actual_weight; showMenu: true,
this.foramParams.rough_weight = data.rough_weight; success: function(res) {
this.foramParams.remark = data.remark; console.log('打开文档成功');
this.$refs.showRight.open(); },
}, fail: function() {
/** uni.showModal({
* 关闭弹窗 title: '提示',
*/ content: '暂不支持该文件类型预览',
closeDrawer() { showCancel: false
this.$refs.showRight.close(); });
}, console.log('打开文档失败');
/** }
* 获取列表数据 });
*/ },
getData() { fail(error) {
this.request(API.getContainerList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { console.log(error);
if (res.code === 0) { }
if (res.data.list.length > 0) { });
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
this.filter_list = createArray(this.list.length, false);
} else { } else {
this.hasMoreData = false; uni.showToast({
title: res.msg,
icon: 'none'
});
} }
} else { });
uni.showToast({ },
title: res.msg, /**
icon: 'none' * 找出false对应的下标
}); * @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].id);
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.input_flag = false;
if (this.index == 0) {
this.searchParams.container_sn = '';
} else if (this.index == 1) {
this.searchParams.create_name = '';
} else if (this.index == 2) {
this.searchParams.update_name = '';
} }
}); this.clearInputAndFocus(); //再次获取焦点
}, this.getData();
/** },
* 更新 /**
*/ * 单号搜索
update() { * @param {Object} event
this.request(API.containerUpdate, 'POST', this.foramParams, true).then(res => { */
if (res.code === 0) { handleInput: debounce(function(type, event) {
uni.showToast({ this.resetChange();
title: '保存成功', var val = event.target.value;
icon: 'success' this.searchParams.container_sn = '';
}); this.searchParams.create_name = '';
this.searchParams.update_name = '';
setTimeout(() => { if (val) {
this.resetChange(); if (type == 1) {
this.closeDrawer(); this.searchParams.container_sn = val;
this.getData(); } else if (type == 2) {
}, 2000); this.searchParams.create_name = val;
} else if (type == 3) {
this.searchParams.update_name = val;
}
this.input_flag = true;
} else { } else {
uni.showToast({ this.input_flag = false;
title: res.msg,
icon: 'none'
});
} }
}); this.getData();
}, }, 500),
/** /**
* 重置 * 打开弹窗
*/ * @param {Object} data
resetChange() { */
this.list = []; showDrawer(data) {
this.page = 1; this.detail = data;
this.foramParams.id = data.id;
this.foramParams.container_name = data.container_name;
this.foramParams.length = data.length;
this.foramParams.width = data.width;
this.foramParams.height = data.height;
this.foramParams.actual_weight = data.actual_weight;
this.foramParams.rough_weight = data.rough_weight;
this.foramParams.remark = data.remark;
this.$refs.showRight.open();
},
/**
* 关闭弹窗
*/
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getContainerList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 更新
*/
update() {
this.request(API.containerUpdate, 'POST', this.foramParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.closeDrawer();
this.getData();
this.clearInputAndFocus(); //再次获取焦点
}, 2000);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
}
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/container/index.scss'; @import '@/assets/css/container/index.scss';
</style> </style>
\ No newline at end of file
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
</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)" /> <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" />
</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" /> <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" />
</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>
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: false, //获取焦点动态化
is_submit: true, is_submit: true,
index: 0, index: 0,
item: ['货品编码', '自营货品ID'], item: ['货品编码', '自营货品ID'],
...@@ -138,8 +139,10 @@ ...@@ -138,8 +139,10 @@
this.formParams.position_code = ''; this.formParams.position_code = '';
this.input_position = false; this.input_position = false;
} 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();
} }
}, },
/** /**
...@@ -220,6 +223,16 @@ ...@@ -220,6 +223,16 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/immediatelyStockIn/list?goods_sn=' + this.formParams.goods_sn + '&goods_name=' + this.formParams.goods_name + '&warehouse_id=' + this.formParams.warehouse_id + '&position_id=' + this.formParams.position_id + '&sku_id=' + this.formParams.sku_id + '&stock_in_batch_sn=' + this.formParams.stock_in_batch_sn url: '/pages/immediatelyStockIn/list?goods_sn=' + this.formParams.goods_sn + '&goods_name=' + this.formParams.goods_name + '&warehouse_id=' + this.formParams.warehouse_id + '&position_id=' + this.formParams.position_id + '&sku_id=' + this.formParams.sku_id + '&stock_in_batch_sn=' + this.formParams.stock_in_batch_sn
}); });
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
<template> <template>
<view class="picking"> <view class="picking">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -12,11 +13,12 @@ ...@@ -12,11 +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" @input="handleInput" v-model="searchParams.stock_out_sn" /> <input class="uni-input" placeholder="请扫描出库单号" placeholder-style="color:#919399" :focus="is_focus" @input="handleInput($event)" v-model="searchParams.stock_out_sn" />
</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>
</view> </view>
<!-- 列表区 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index"> <view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter"> <view class="text-item row verCenter">
...@@ -48,7 +50,9 @@ ...@@ -48,7 +50,9 @@
<text class="label">销售员:</text> <text class="label">销售员:</text>
<text class="tt">{{ item.sale_name }}</text> <text class="tt">{{ item.sale_name }}</text>
</view> </view>
<view class="btn-box row"><view class="btn row rowCenter verCenter" @click="take(item.stock_out_id, item.stock_out_sn, item.warehouse_id)">领取</view></view> <view class="btn-box row">
<view class="btn row rowCenter verCenter" @click="take(item.stock_out_id, item.stock_out_sn, item.warehouse_id)">领取</view>
</view>
</view> </view>
</view> </view>
<!-- 无数据展示 --> <!-- 无数据展示 -->
...@@ -60,96 +64,116 @@ ...@@ -60,96 +64,116 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
input_flag: false, is_focus: true, //获取焦点动态化
index: 0, input_flag: false,
page: 1, index: 0,
limit: 1000, page: 1,
array: ['出库单号'], limit: 1000,
list: [], array: ['出库单号'],
searchParams: { list: [],
stock_out_sn: '' searchParams: {
} stock_out_sn: ''
};
},
onShow() {
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/picking/me'
});
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getNoTakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 领取
*/
take(stock_out_id, stock_out_sn, warehouse_id) {
this.request(API.take, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.navigateTo({
url: '/pages/picking/sort?stock_out_id=' + stock_out_id + '&stock_out_sn=' + stock_out_sn + '&warehouse_id=' + warehouse_id
});
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
} }
}); };
}, },
/** onShow() {
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_out_sn = '';
this.getData(); this.getData();
}, },
/** onNavigationBarButtonTap(e) {
* 单号搜索 if (e.index == 0) {
* @param {Object} event uni.navigateTo({
*/ url: '/pages/picking/me'
handleInput: debounce(function(event) { });
var val = event.target.value; }
if (val) { },
this.input_flag = true; methods: {
} else { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getNoTakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 领取
*/
take(stock_out_id, stock_out_sn, warehouse_id) {
this.request(API.take, 'POST', { stock_out_id: stock_out_id }, true).then(res => {
if (res.code === 0) {
uni.navigateTo({
url: '/pages/picking/sort?stock_out_id=' + stock_out_id + '&stock_out_sn=' + stock_out_sn + '&warehouse_id=' + warehouse_id
});
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
this.resetChange();
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
this.getData(); }
}, 500) };
}
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/picking/index.scss'; @import '@/assets/css/picking/index.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="picking-me"> <view class="picking-me">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -12,11 +13,12 @@ ...@@ -12,11 +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" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" v-model="searchParams.stock_out_sn" @input="handleInput" :focus="is_focus" />
</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>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index"> <view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter"> <view class="text-item row verCenter">
...@@ -85,6 +87,7 @@ ...@@ -85,6 +87,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
input_flag: false, input_flag: false,
index: 0, index: 0,
array: ['出库单号'], array: ['出库单号'],
...@@ -112,7 +115,7 @@ ...@@ -112,7 +115,7 @@
this.getData(); this.getData();
}, },
onShow() { onShow() {
this.list = []; this.resetChange();
this.getData(); this.getData();
}, },
methods: { methods: {
...@@ -124,8 +127,10 @@ ...@@ -124,8 +127,10 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -136,7 +141,6 @@ ...@@ -136,7 +141,6 @@
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; this.searchParams.stock_out_sn = val;
...@@ -156,9 +160,8 @@ ...@@ -156,9 +160,8 @@
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.list = []; this.resetChange();
this.getData(); this.clearInputAndFocus();
this.filter_id = [];
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -195,6 +198,16 @@ ...@@ -195,6 +198,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);
} }
} }
}; };
......
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<!-- 批量扫描 --> <!-- 批量扫描 -->
<template v-if="is_batch"> <template v-if="is_batch">
<input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="16" ref="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="is_focus" v-model="search_keyword" @input="handleInput(2, search_keyword)" maxlength="16" ref="myInput" />
</template> </template>
<template v-else> <template v-else>
<input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="16" ref="myInput" /> <input class="uni-input" placeholder="请扫描入库标签" :disabled="searchParams.position_name == '' ? true : false" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="16" ref="myInput" />
</template> </template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text>
...@@ -604,7 +604,7 @@ ...@@ -604,7 +604,7 @@
isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios', isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios',
is_print: true, //是否打印货品标签 is_print: true, //是否打印货品标签
old_Label: false, //旧标签默认false old_Label: false, //旧标签默认false
isFocus: false, is_focus: false, //获取焦点动态化
is_batch: true, //是否开启批量 is_batch: true, //是否开启批量
is_batch_active: false, //是否开启批量激活s is_batch_active: false, //是否开启批量激活s
history_id: [], //批量记录id history_id: [], //批量记录id
...@@ -733,9 +733,9 @@ ...@@ -733,9 +733,9 @@
this.input_flag_position_name = true; this.input_flag_position_name = true;
this.getData(); this.getData();
//再次获取焦点 //再次获取焦点
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
this.$forceUpdate(); this.$forceUpdate();
}, 1500); }, 1500);
} else if (type == 2) { } else if (type == 2) {
...@@ -777,9 +777,9 @@ ...@@ -777,9 +777,9 @@
try { try {
//再次获取焦点 //再次获取焦点
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
this.search_keyword = ''; //清空入库批次号 this.search_keyword = ''; //清空入库批次号
this.$forceUpdate(); this.$forceUpdate();
}, 500); }, 500);
...@@ -797,9 +797,9 @@ ...@@ -797,9 +797,9 @@
//执行最后再次获取焦点 //执行最后再次获取焦点
try { try {
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
this.search_keyword = ''; //清空入库批次号 this.search_keyword = ''; //清空入库批次号
this.$forceUpdate(); this.$forceUpdate();
}, 500); }, 500);
...@@ -1087,15 +1087,19 @@ ...@@ -1087,15 +1087,19 @@
*/ */
clearInput(type) { clearInput(type) {
if (type == 1) { if (type == 1) {
//库位
this.searchParams.position_name = ''; this.searchParams.position_name = '';
this.input_flag_position_name = false; this.input_flag_position_name = false;
} else if (type == 2) { } else if (type == 2) {
//入库标签
this.searchParams.stock_in_batch_sn = ''; this.searchParams.stock_in_batch_sn = '';
this.input_flag_stock_in_batch_sn = false; this.input_flag_stock_in_batch_sn = false;
} else if (type == 3) { } else if (type == 3) {
//容器
this.searchParams.container_sn = ''; this.searchParams.container_sn = '';
this.input_flag_container_sn = false; this.input_flag_container_sn = false;
} }
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -1303,6 +1307,16 @@ ...@@ -1303,6 +1307,16 @@
}); });
} }
}); });
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<template v-if="index == 0"> <template v-if="index == 0">
<template v-if="is_batch"> <template v-if="is_batch">
<input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="search_keyword" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="is_focus" v-model="search_keyword" @input="handleInput(1, $event)" />
</template> </template>
<template v-else> <template v-else>
<input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="isFocus" v-model="searchParams.search_keyword" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描入库标签" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.search_keyword" @input="handleInput(1, $event)" />
</template> </template>
</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.search_keyword" @input="handleInput(2, $event)" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.search_keyword" @input="handleInput(2, $event)" />
</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>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
data() { data() {
return { return {
isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios', isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios',
isFocus: true, is_focus: true, //获取焦点动态化
is_batch: false, //是否开启批量 is_batch: false, //是否开启批量
history_id: [], history_id: [],
search_keyword: '', search_keyword: '',
...@@ -186,7 +186,6 @@ ...@@ -186,7 +186,6 @@
this.getData(); this.getData();
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
console.log(e);
if (e.index == 0) { if (e.index == 0) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/putaway/record' url: '/pages/putaway/record'
...@@ -201,9 +200,9 @@ ...@@ -201,9 +200,9 @@
// 重置全局变量或执行其他操作 // 重置全局变量或执行其他操作
getApp().globalData.fromPage = null; getApp().globalData.fromPage = null;
//再次获取焦点 //再次获取焦点
that.isFocus = false; that.is_focus = false;
setTimeout(() => { setTimeout(() => {
that.isFocus = true; that.is_focus = true;
}, 1000); }, 1000);
} }
this.resetChange(); this.resetChange();
...@@ -223,7 +222,10 @@ ...@@ -223,7 +222,10 @@
} else { } else {
this.index = e.detail.value; this.index = e.detail.value;
this.searchParams.search_type = Number(e.detail.value) + 1; this.searchParams.search_type = Number(e.detail.value) + 1;
this.search_keyword = '';
this.searchParams.search_keyword = '';
this.clearInputAndFocus();
//批量扫描关闭 //批量扫描关闭
if (this.index == 1) { if (this.index == 1) {
this.is_batch = false; this.is_batch = false;
...@@ -248,9 +250,9 @@ ...@@ -248,9 +250,9 @@
this.search_keyword = ''; this.search_keyword = '';
this.searchParams.search_keyword = ''; this.searchParams.search_keyword = '';
//再次获取焦点 //再次获取焦点
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
}, 800); }, 800);
this.getData(); this.getData();
}, },
...@@ -366,6 +368,7 @@ ...@@ -366,6 +368,7 @@
this.search_keyword = ''; this.search_keyword = '';
} }
this.searchParams.search_keyword = ''; this.searchParams.search_keyword = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -411,9 +414,9 @@ ...@@ -411,9 +414,9 @@
this.history_id.splice(index_history_id, 1); this.history_id.splice(index_history_id, 1);
try { try {
//再次获取焦点 //再次获取焦点
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
this.search_keyword = ''; //清空入库批次号 this.search_keyword = ''; //清空入库批次号
this.$forceUpdate(); this.$forceUpdate();
}, 500); }, 500);
...@@ -431,9 +434,9 @@ ...@@ -431,9 +434,9 @@
//执行最后再次获取焦点 //执行最后再次获取焦点
try { try {
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
this.search_keyword = ''; //清空入库批次号 this.search_keyword = ''; //清空入库批次号
this.$forceUpdate(); this.$forceUpdate();
}, 500); }, 500);
...@@ -463,7 +466,7 @@ ...@@ -463,7 +466,7 @@
this.getData(); this.getData();
this.input_flag = false; this.input_flag = false;
} }
}, 800), }, 500),
/** /**
* 监听库位编码 * 监听库位编码
*/ */
...@@ -547,9 +550,9 @@ ...@@ -547,9 +550,9 @@
this.closeDrawer(); this.closeDrawer();
this.getData(); this.getData();
//再次获取焦点 //再次获取焦点
this.isFocus = false; this.is_focus = false;
setTimeout(() => { setTimeout(() => {
this.isFocus = true; this.is_focus = true;
}, 500); }, 500);
}, 2000); }, 2000);
} else { } else {
...@@ -567,6 +570,16 @@ ...@@ -567,6 +570,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);
} }
} }
}; };
......
<template> <template>
<view class="putaway"> <view class="putaway">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -12,11 +13,12 @@ ...@@ -12,11 +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.container_sn" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.container_sn" @input="handleInput" />
</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>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index"> <view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter"> <view class="text-item row verCenter">
...@@ -36,7 +38,9 @@ ...@@ -36,7 +38,9 @@
<text class="label">待上架数量:</text> <text class="label">待上架数量:</text>
<text class="tt">{{ item.total_pending_shelf_qty }}</text> <text class="tt">{{ item.total_pending_shelf_qty }}</text>
</view> </view>
<navigator class="btn-box row" :url="'/pages/putaway/packSingle?container_id=' + item.container_id + '&container_sn=' + item.container_sn" hover-class="none"><view class="btn row rowCenter verCenter">选择</view></navigator> <navigator class="btn-box row" :url="'/pages/putaway/packSingle?container_id=' + item.container_id + '&container_sn=' + item.container_sn" hover-class="none">
<view class="btn row rowCenter verCenter">选择</view>
</navigator>
</view> </view>
</view> </view>
<!-- 无数据展示 --> <!-- 无数据展示 -->
...@@ -48,85 +52,107 @@ ...@@ -48,85 +52,107 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
input_flag: false, is_focus: true, //获取焦点动态化
page: 1, input_flag: false,
limit: 1000, page: 1,
index: 0, limit: 1000,
array: ['容器'], index: 0,
list: [], array: ['容器'],
searchParams: { list: [],
container_sn: '' searchParams: {
container_sn: ''
}
};
},
onNavigationBarButtonTap(e) {
console.log(e);
if (e.index == 0) {
uni.navigateTo({
url: '/pages/putaway/record'
});
} }
};
},
onNavigationBarButtonTap(e) {
console.log(e);
if (e.index == 0) {
uni.navigateTo({
url: '/pages/putaway/record'
});
}
},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
}, },
/** onShow() {
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.container_sn = '';
this.getData(); this.getData();
}, },
/** methods: {
* 单号搜索 bindPickerChange: function(e) {
* @param {Object} event console.log('picker发送选择改变,携带值为', e.detail.value);
*/ this.index = e.detail.value;
handleInput: debounce(function(event) { },
var val = event.target.value; /**
if (val) { * 清空数据
this.input_flag = true; */
} else { clearInput() {
this.resetChange();
this.searchParams.container_sn = '';
this.input_flag = false; this.input_flag = false;
} this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
setTimeout(() => { },
if (this.list.length == 1) { /**
uni.navigateTo({ * 单号搜索
url: '/pages/putaway/packSingle?container_id=' + this.list[0].container_id + '&container_sn=' + this.list[0].container_sn * @param {Object} event
}); */
} handleInput: debounce(function(event) {
}, 1000); var val = event.target.value;
}, 500), this.resetChange();
/** if (val) {
* 获取列表数据 this.input_flag = true;
*/
getData() {
this.request(API.onShelfByContainerCountList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else { } else {
uni.showToast({ this.input_flag = false;
title: res.msg,
icon: 'error'
});
} }
}); this.getData((data, msg) => {
if (data.length == 1) {
uni.navigateTo({
url: '/pages/putaway/packSingle?container_id=' + this.list[0].container_id + '&container_sn=' + this.list[0].container_sn
});
}
});
}, 500),
/**
* 获取列表数据
*/
getData(callback) {
this.request(API.onShelfByContainerCountList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
typeof callback == 'function' && callback(res.data.list, res.data.msg);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
}
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/putaway/index.scss'; @import '@/assets/css/putaway/index.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="packSingle"> <view class="packSingle">
<!-- 搜索部分 -->
<view class="search-type row bothSide verCenter"> <view class="search-type row bothSide verCenter">
<view class="left"> <view class="left">
<view class="title">容器:</view> <view class="title">容器:</view>
...@@ -12,16 +13,19 @@ ...@@ -12,16 +13,19 @@
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="row bothSide verCenter" style="margin-bottom: 10rpx;"><view class="title" style="margin-bottom: 0;">库位:</view></view> <view class="row bothSide verCenter" style="margin-bottom: 10rpx;">
<view class="title" style="margin-bottom: 0;">库位:</view>
</view>
<view class="search-bar row bothSide verCenter" :class="{ 'error-style': !is_submit }"> <view class="search-bar row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<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.position_code" @input="handleInput(2, $event)" focus /> <input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" v-model="searchParams.position_code" @input="handleInput(2, $event)" :focus="is_focus" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_position"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_position"></text>
</view> </view>
</view> </view>
</view> </view>
<!-- 容器信息 -->
<view class="info-box row"> <view class="info-box row">
<view class="text-item row verCenter" style="flex: 0 0 100%;" v-if="info"> <view class="text-item row verCenter" style="flex: 0 0 100%;" v-if="info">
<text class="label">容 器:</text> <text class="label">容 器:</text>
...@@ -40,6 +44,7 @@ ...@@ -40,6 +44,7 @@
<text class="tt">{{ info.total_pending_shelf_qty }}</text> <text class="tt">{{ info.total_pending_shelf_qty }}</text>
</view> </view>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box box-width" v-for="(item, index) in list" :key="index"> <view class="box box-width" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter" v-if="item.sku_id"> <view class="text-item row verCenter" v-if="item.sku_id">
...@@ -95,7 +100,9 @@ ...@@ -95,7 +100,9 @@
<text class="label">明细备注:</text> <text class="label">明细备注:</text>
<text class="desc">{{ item.remark }}</text> <text class="desc">{{ item.remark }}</text>
</view> </view>
<view class="btn-box row"><view class="btn row rowCenter verCenter" @click="showDrawer(item.stock_in_batch_sn)">详情</view></view> <view class="btn-box row">
<view class="btn row rowCenter verCenter" @click="showDrawer(item.stock_in_batch_sn)">详情</view>
</view>
</view> </view>
</view> </view>
<!-- 无数据展示 --> <!-- 无数据展示 -->
...@@ -103,7 +110,9 @@ ...@@ -103,7 +110,9 @@
<text class="iconfont icon-a-juxing21"></text> <text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text> <text class="text">查不到当前数据</text>
</view> </view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" :class="{ 'btn-disabled': !is_submit }" @click="oneKeyPutawayAction">上 架</view></view> <view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter" :class="{ 'btn-disabled': !is_submit }" @click="oneKeyPutawayAction">上 架</view>
</view>
<!-- 上架记录详情弹窗 --> <!-- 上架记录详情弹窗 -->
<uni-drawer ref="showRight" mode="right"> <uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-tally-receive-detail" v-if="detail"> <view class="uni-drawer-tally-receive-detail" v-if="detail">
...@@ -220,175 +229,199 @@ ...@@ -220,175 +229,199 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
is_submit: true, is_focus: true, //获取焦点动态化
input_flag: false, is_submit: true,
input_position: false, input_flag: false,
page: 1, input_position: false,
limit: 1000, page: 1,
index: 0, limit: 1000,
list: [], index: 0,
info: {}, list: [],
detail: {}, info: {},
position_code: [], //存储库位编码 detail: {},
searchParams: { position_code: [], //存储库位编码
container_sn: '', //容器编码 searchParams: {
position_code: '' //库位编码 container_sn: '', //容器编码
position_code: '' //库位编码
}
};
},
onNavigationBarButtonTap(e) {
console.log(e);
if (e.index == 0) {
uni.navigateTo({
url: '/pages/putaway/record'
});
} }
};
},
onNavigationBarButtonTap(e) {
console.log(e);
if (e.index == 0) {
uni.navigateTo({
url: '/pages/putaway/record'
});
}
},
onLoad(options) {
this.searchParams.container_sn = options.container_sn || '';
},
onShow() {
this.getData();
},
methods: {
showDrawer(stock_in_batch_sn) {
this.getStockShelfInfoByBatchSn(stock_in_batch_sn);
}, },
closeDrawer() { onLoad(options) {
this.$refs.showRight.close(); this.searchParams.container_sn = options.container_sn || '';
}, },
/** onShow() {
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.input_flag = false;
this.searchParams.container_sn = '';
} else if (type == 2) {
this.input_position = false;
this.searchParams.position_code = '';
}
this.getData(); this.getData();
}, },
/** methods: {
* 单号搜索 showDrawer(stock_in_batch_sn) {
* @param {Object} event this.getStockShelfInfoByBatchSn(stock_in_batch_sn);
*/ },
handleInput: debounce(function(type, event) { closeDrawer() {
var val = event.target.value; this.$refs.showRight.close();
if (val) { },
if (type == 1) { /**
this.searchParams.container_sn = val; * 清空数据
this.input_flag = true; */
} else if (type == 2) { clearInput(type) {
this.searchParams.position_code = val; this.resetChange();
this.input_position = true;
this.getWhPositionList(this.list[0].warehouse_id, this.list[0].stock_in_type);
}
} else {
if (type == 1) { if (type == 1) {
//容器
this.input_flag = false; this.input_flag = false;
this.searchParams.container_sn = ''; this.searchParams.container_sn = '';
} else if (type == 2) { } else if (type == 2) {
//库位
this.input_position = false; this.input_position = false;
this.searchParams.position_code = ''; this.searchParams.position_code = '';
this.clearInputAndFocus(); //再次获取焦点
} }
} this.getData();
this.getData(); },
}, 500), /**
/** * 单号搜索
* 获取列表数据 * @param {Object} event
*/ */
getData() { handleInput: debounce(function(type, event) {
this.request(API.onShelfByContainerListAction, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { var val = event.target.value;
if (res.code === 0) { this.resetChange();
this.list = res.data.list; if (val) {
this.info = res.data.info; if (type == 1) {
this.searchParams.container_sn = val;
this.input_flag = true;
} else if (type == 2) {
this.searchParams.position_code = val;
this.input_position = true;
this.getWhPositionList(this.list[0].warehouse_id, this.list[0].stock_in_type);
}
} else { } else {
this.list = []; if (type == 1) {
this.info = {}; this.input_flag = false;
this.searchParams.container_sn = '';
} else if (type == 2) {
this.input_position = false;
this.searchParams.position_code = '';
}
} }
}); this.getData();
}, }, 500),
/** /**
* 获取库位 * 获取列表数据
*/ */
getWhPositionList(warehouse_id, stock_in_type) { getData() {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => { this.request(API.onShelfByContainerListAction, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
var position_code = this.searchParams.position_code; if (res.code === 0) {
if (res.code === 0) { this.list = res.data.list;
this.is_submit = res.data.list.some(function(obj) { this.info = res.data.info;
return obj.position_code === position_code; } else {
}); this.list = [];
} else { this.info = {};
}
});
},
/**
* 获取库位
*/
getWhPositionList(warehouse_id, stock_in_type) {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => {
var position_code = this.searchParams.position_code;
if (res.code === 0) {
this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code;
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取详情数据
*/
getStockShelfInfoByBatchSn(stock_in_batch_sn) {
this.request(API.getStockShelfInfoByBatchSn, 'POST', { stock_in_batch_sn: stock_in_batch_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data;
this.$refs.showRight.open();
}
});
},
/**
* 上架
*/
oneKeyPutawayAction() {
if (!this.searchParams.position_code) {
uni.showToast({ uni.showToast({
title: res.msg, title: '请输入库位',
icon: 'error' icon: 'error'
}); });
return false;
} }
}); if (!this.is_submit) {
}, uni.showToast({
/** title: '请输入合适库位',
* 获取详情数据 icon: 'error'
*/ });
getStockShelfInfoByBatchSn(stock_in_batch_sn) { return false;
this.request(API.getStockShelfInfoByBatchSn, 'POST', { stock_in_batch_sn: stock_in_batch_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data;
this.$refs.showRight.open();
} }
});
}, var tally_ids = this.list.map(function(item) {
/** return item.tally_id;
* 上架
*/
oneKeyPutawayAction() {
if (!this.searchParams.position_code) {
uni.showToast({
title: '请输入库位',
icon: 'error'
}); });
return false; this.request(API.oneKeyPutawayAction, 'POST', { position_code: this.searchParams.position_code, tally_ids: tally_ids.join(',') }, true).then(res => {
} if (res.code === 0) {
if (!this.is_submit) { uni.showToast({
uni.showToast({ title: '上架成功',
title: '请输入合适库位', icon: 'success'
icon: 'error' });
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
}); });
return false; },
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
var tally_ids = this.list.map(function(item) {
return item.tally_id;
});
this.request(API.oneKeyPutawayAction, 'POST', { position_code: this.searchParams.position_code, tally_ids: tally_ids.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '上架成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/putaway/packSingle.scss'; @import '@/assets/css/putaway/packSingle.scss';
</style> </style>
\ No newline at end of file
<template> <template>
<view class="putaway-record"> <view class="putaway-record">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,12 +14,13 @@ ...@@ -13,12 +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" v-model="searchParams.search_keyword" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或者输入" placeholder-style="color:#919399" v-model="searchParams.search_keyword" @input="handleInput" :focus="is_focus" />
</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>
</view> </view>
</view> </view>
<!-- 筛选部分 -->
<view class="radio-wrap row verCenter" style="padding-bottom: 0;"> <view class="radio-wrap row verCenter" style="padding-bottom: 0;">
<radio-group name="radio1" @change="radioChange($event, 1)"> <radio-group name="radio1" @change="radioChange($event, 1)">
<label> <label>
...@@ -51,6 +53,7 @@ ...@@ -51,6 +53,7 @@
</label> </label>
</radio-group> </radio-group>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }"> <view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view> <view class="check-box-icon" @click="filterChange(index)"></view>
...@@ -252,6 +255,7 @@ ...@@ -252,6 +255,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 50, limit: 50,
...@@ -352,6 +356,7 @@ ...@@ -352,6 +356,7 @@
this.resetChange(); this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.search_keyword = ''; this.searchParams.search_keyword = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -539,6 +544,16 @@ ...@@ -539,6 +544,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);
} }
} }
}; };
......
<template> <template>
<view class="putaway-single"> <view class="putaway-single">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange($event)" :value="index" :range="array"> <picker @change="bindPickerChange($event)" :value="index" :range="array">
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
<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>
</view> </view>
<!-- 列表 -->
<view class="section"> <view class="section">
<view class="field-item row"> <view class="field-item row">
<view class="item row verCenter"> <view class="item row verCenter">
...@@ -201,6 +203,7 @@ ...@@ -201,6 +203,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
isFirst: false, isFirst: false,
isZY: false, //区分是否自营 isZY: false, //区分是否自营
isInputFocus: false, isInputFocus: false,
...@@ -256,8 +259,10 @@ ...@@ -256,8 +259,10 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.input_flag = false;
this.searchParams.stock_in_batch_sn = ''; this.searchParams.stock_in_batch_sn = '';
this.resetChange();
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -446,6 +451,23 @@ ...@@ -446,6 +451,23 @@
}); });
} }
}); });
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
...@@ -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" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="16" /> <input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="16" :focus="is_focus" />
</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" /> <input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" :focus="is_focus" />
</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>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<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)" /> <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" />
</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>
...@@ -118,9 +118,11 @@ ...@@ -118,9 +118,11 @@
export default { export default {
data() { data() {
return { return {
is_focus: false, //获取焦点动态化
is_focus_num: false,
company_id: 1, company_id: 1,
input_flag: false, input_flag: false, //入库标签叉叉
input_flag_num: false, input_flag_num: false, //数量叉叉
index: 0, index: 0,
print_language_index: 0, print_language_index: 0,
print_language: ['中文', '英文'], print_language: ['中文', '英文'],
...@@ -160,12 +162,15 @@ ...@@ -160,12 +162,15 @@
*/ */
clearInput(type) { clearInput(type) {
if (type == 1) { if (type == 1) {
//入库标签
this.formParams.sn = ''; this.formParams.sn = '';
this.input_flag = false; this.input_flag = false;
} else if (type == 2) { } else if (type == 2) {
//数量
this.formParams.tally_qty = ''; this.formParams.tally_qty = '';
this.input_flag_num = false; this.input_flag_num = false;
} }
this.clearInputAndFocus();
}, },
/** /**
* 单号搜索 * 单号搜索
...@@ -249,6 +254,26 @@ ...@@ -249,6 +254,26 @@
}); });
} }
}); });
},
/**
* 再次获取焦点
*/
clearInputAndFocus(type) {
if (type == 1) {
//入库标签
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} else {
//数量
this.input_flag_num = false;
this.is_focus_num = false;
setTimeout(() => {
this.is_focus_num = true;
}, 200);
}
} }
} }
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<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 v-model="searchParams.stock_out_sn" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_out_sn" @input="handleInput" />
</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>
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 1000, limit: 1000,
...@@ -113,6 +114,7 @@ ...@@ -113,6 +114,7 @@
methods: { methods: {
checkboxChange(e) { checkboxChange(e) {
console.log('checkbox发送选择改变,携带值为', e.detail.value); console.log('checkbox发送选择改变,携带值为', e.detail.value);
this.resetChange();
this.searchParams.stock_out_status = e.detail.value.join(','); this.searchParams.stock_out_status = e.detail.value.join(',');
this.getData(); this.getData();
}, },
...@@ -146,8 +148,10 @@ ...@@ -146,8 +148,10 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -155,16 +159,17 @@ ...@@ -155,16 +159,17 @@
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
setTimeout(() => { this.getData((data, msg) => {
if (this.list.length == 1) { if (data.length == 1) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/stockRecheck/sort?stock_out_id=' + this.list[0].stock_out_id + '&stock_out_sn=' + this.searchParams.stock_out_sn url: '/pages/stockRecheck/sort?stock_out_id=' + this.list[0].stock_out_id + '&stock_out_sn=' + this.searchParams.stock_out_sn
}); });
} }
}, 800); });
} else { } else {
this.input_flag = false; this.input_flag = false;
} }
...@@ -173,11 +178,12 @@ ...@@ -173,11 +178,12 @@
/** /**
* 获取列表数据 * 获取列表数据
*/ */
getData() { getData(callback) {
this.request(API.getToCheckList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(API.getToCheckList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.list = res.data.list; this.list = res.data.list;
this.filter_list = createArray(this.list.length, false); this.filter_list = createArray(this.list.length, false);
typeof callback == 'function' && callback(res.data.list, res.data.msg);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
...@@ -222,6 +228,24 @@ ...@@ -222,6 +228,24 @@
}); });
} }
}); });
},
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<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" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" v-model="searchParams.stock_out_sn" @input="handleInput" :focus="is_focus" />
</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>
...@@ -273,6 +273,7 @@ ...@@ -273,6 +273,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
company_id: uni.getStorageSync('company_id') || 1, company_id: uni.getStorageSync('company_id') || 1,
input_flag: false, input_flag: false,
flag: false, flag: false,
...@@ -422,8 +423,10 @@ ...@@ -422,8 +423,10 @@
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_out_sn = ''; this.searchParams.stock_out_sn = '';
this.clearInputAndFocus();
this.getData(); this.getData();
}, },
/** /**
...@@ -611,6 +614,16 @@ ...@@ -611,6 +614,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);
} }
} }
}; };
......
...@@ -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 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>
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
<text class="iconfont icon-a-juxing21"></text> <text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text> <text class="text">查不到当前数据</text>
</view> </view>
<!-- 底部按钮操作栏 -->
<view class="fix-btn row verCenter"> <view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter" @click="allChnage()"> <view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text> <text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
...@@ -143,6 +144,7 @@ ...@@ -143,6 +144,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
index: 0, index: 0,
array: ['全量搜索', '旧标签'], array: ['全量搜索', '旧标签'],
input_flag: false, input_flag: false,
...@@ -195,6 +197,7 @@ ...@@ -195,6 +197,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();
}, },
/** /**
...@@ -295,8 +298,8 @@ ...@@ -295,8 +298,8 @@
}); });
setTimeout(() => { setTimeout(() => {
this.resetChange(); this.resetChange();
this.filter_id = [];
this.getData(); this.getData();
this.clearInputAndFocus();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -480,8 +483,19 @@ ...@@ -480,8 +483,19 @@
* 重置 * 重置
*/ */
resetChange() { resetChange() {
this.filter_id = [];
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);
} }
} }
}; };
......
<template> <template>
<view class="picking"> <view class="picking">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -12,11 +13,12 @@ ...@@ -12,11 +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" @input="handleInput" v-model="searchParams.stocktake_sn" /> <input class="uni-input" placeholder="请扫描盘点单号" placeholder-style="color:#919399" @input="handleInput" v-model="searchParams.stocktake_sn" :focus="is_focus" />
</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>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index"> <view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter"> <view class="text-item row verCenter">
...@@ -36,7 +38,9 @@ ...@@ -36,7 +38,9 @@
<text class="label">创建时间:</text> <text class="label">创建时间:</text>
<text class="tt">{{ item.create_time }}</text> <text class="tt">{{ item.create_time }}</text>
</view> </view>
<view class="btn-box row"><navigator class="btn row rowCenter verCenter" :url="'/pages/stocktake/operate?stocktake_id=' + item.stocktake_id + '&stocktake_sn=' + item.stocktake_sn">选择</navigator></view> <view class="btn-box row">
<navigator class="btn row rowCenter verCenter" :url="'/pages/stocktake/operate?stocktake_id=' + item.stocktake_id + '&stocktake_sn=' + item.stocktake_sn">选择</navigator>
</view>
</view> </view>
</view> </view>
<!-- 无数据展示 --> <!-- 无数据展示 -->
...@@ -48,78 +52,98 @@ ...@@ -48,78 +52,98 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
input_flag: false, input_flag: false,
index: 0, index: 0,
page: 1, page: 1,
limit: 1000, limit: 1000,
array: ['盘点单号'], array: ['盘点单号'],
list: [], list: [],
searchParams: { searchParams: {
stocktake_sn: '' stocktake_sn: ''
}
};
},
onShow() {
this.getData();
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/picking/me'
});
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getStocktakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
} }
}); };
}, },
/** onShow() {
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stocktake_sn = '';
this.getData(); this.getData();
}, },
/** onNavigationBarButtonTap(e) {
* 单号搜索 if (e.index == 0) {
* @param {Object} event uni.navigateTo({
*/ url: '/pages/picking/me'
handleInput: debounce(function(event) { });
var val = event.target.value; }
if (val) { },
this.input_flag = true; methods: {
} else { bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getStocktakeList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.stocktake_sn = '';
this.clearInputAndFocus(); //再次获取焦点
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
this.getData(); }
}, 500) };
}
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/stocktake/list.scss'; @import '@/assets/css/stocktake/list.scss';
</style> </style>
\ No newline at end of file
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<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.position_code" @input="handleInput($event, 1)" focus /> <input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" v-model="searchParams.position_code" @input="handleInput($event, 1)" :focus="is_focus" />
</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>
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,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_batch_sn == 0"> <template v-if="index_batch_sn == 0">
<input class="uni-input" placeholder="请输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event, 2)" :focus="is_focus" /> <input class="uni-input" placeholder="请输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event, 2)" :focus="is_focus_batch_sn" />
</template> </template>
<template v-else-if="index_batch_sn == 1"> <template v-else-if="index_batch_sn == 1">
<input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" v-model="searchParams.goods_name" @input="handleInput($event, 2)" :focus="is_focus" /> <input class="uni-input" placeholder="请输入货品名称" placeholder-style="color:#919399" v-model="searchParams.goods_name" @input="handleInput($event, 2)" :focus="is_focus_batch_sn" />
</template> </template>
<template v-else-if="index_batch_sn == 2"> <template v-else-if="index_batch_sn == 2">
<input class="uni-input" placeholder="请输入旧标签" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event, 2)" maxlength="8" :focus="is_focus" /> <input class="uni-input" placeholder="请输入旧标签" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event, 2)" maxlength="8" :focus="is_focus_batch_sn" />
</template> </template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_stock_in_batch_sn"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_stock_in_batch_sn"></text>
...@@ -208,6 +208,10 @@ ...@@ -208,6 +208,10 @@
<text class="label">盘点数量:</text> <text class="label">盘点数量:</text>
<input type="number" placeholder="请输入盘点数量" class="uni-input" v-model="stocktake_qty" /> <input type="number" placeholder="请输入盘点数量" class="uni-input" v-model="stocktake_qty" />
</view> </view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">盘点备注:</text>
<input type="text" placeholder="请输入盘点备注" class="uni-input" v-model="remark" />
</view>
</view> </view>
<view class="btn row rowCenter verCenter"> <view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view> <view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view>
...@@ -320,8 +324,9 @@ ...@@ -320,8 +324,9 @@
export default { export default {
data() { data() {
return { return {
is_focus: false, //获取焦点动态化 is_focus: true, //获取焦点动态化
input_flag: false, //库位 input_flag: false, //库位
is_focus_batch_sn: false,
input_stock_in_batch_sn: false, //入库批次号 input_stock_in_batch_sn: false, //入库批次号
index: 0, index: 0,
total: 0, //待盘点任务数 total: 0, //待盘点任务数
...@@ -333,6 +338,7 @@ ...@@ -333,6 +338,7 @@
array_batch_sn: ['入库批次号', '货品名称', '旧标签'], array_batch_sn: ['入库批次号', '货品名称', '旧标签'],
index_batch_sn: 0, index_batch_sn: 0,
stocktake_qty: '', //盘点数量 stocktake_qty: '', //盘点数量
remark: '', //盘点备注
list: [], list: [],
page: 1, page: 1,
limit: 50, limit: 50,
...@@ -494,9 +500,12 @@ ...@@ -494,9 +500,12 @@
*/ */
clearInput(type) { clearInput(type) {
if (type == 1) { if (type == 1) {
//库位
this.input_flag = false; this.input_flag = false;
this.searchParams.position_code = ''; this.searchParams.position_code = '';
this.clearInputAndFocus(1);
} else if (type == 2) { } else if (type == 2) {
//入库批次号
this.input_stock_in_batch_sn = false; this.input_stock_in_batch_sn = false;
if (this.index_batch_sn == 0 || this.index_batch_sn == 2) { if (this.index_batch_sn == 0 || this.index_batch_sn == 2) {
//入库批次号++旧标签 //入库批次号++旧标签
...@@ -505,6 +514,7 @@ ...@@ -505,6 +514,7 @@
//货品名称 //货品名称
this.searchParams.goods_name = ''; this.searchParams.goods_name = '';
} }
this.clearInputAndFocus(2);
} }
this.getData(); this.getData();
}, },
...@@ -627,7 +637,7 @@ ...@@ -627,7 +637,7 @@
* 更新操作 * 更新操作
*/ */
updateStocktakeItemQty() { updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => { this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty, remark: this.remark }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '操作成功', title: '操作成功',
...@@ -643,10 +653,7 @@ ...@@ -643,10 +653,7 @@
this.getData(); this.getData();
//入库批次号重新获取焦点 //入库批次号重新获取焦点
this.is_focus = false; this.clearInputAndFocus(2);
setTimeout(() => {
this.is_focus = true; //再次获取焦点
}, 500);
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -664,6 +671,28 @@ ...@@ -664,6 +671,28 @@
this.list = []; this.list = [];
this.page = 1; this.page = 1;
this.filter_id = []; this.filter_id = [];
},
/**
* 再次获取焦点
*/
clearInputAndFocus(type) {
if (type == 1) {
//库位
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} else if (type == 2) {
//入库批次号
this.input_stock_in_batch_sn = false; //关闭叉叉
this.is_focus_batch_sn = false;
setTimeout(() => {
this.is_focus_batch_sn = true;
}, 200);
}
} }
} }
}; };
......
...@@ -14,10 +14,13 @@ ...@@ -14,10 +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" /> <input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput($event,1)" :focus="is_focus" />
</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" maxlength="8" /> <input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput($event,1)" maxlength="8" :focus="is_focus" />
</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" />
</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>
...@@ -96,6 +99,10 @@ ...@@ -96,6 +99,10 @@
<text class="tt">{{ item.stocktake_qty }}</text> <text class="tt">{{ item.stocktake_qty }}</text>
</view> </view>
<view class="input-box row"> <view class="input-box row">
<text class="label">盘点备注:</text>
<text class="desc">{{ item.remark}}</text>
</view>
<view class="input-box row">
<text class="label">盘点人:</text> <text class="label">盘点人:</text>
<text class="tt">{{ item.stocktake_user }}</text> <text class="tt">{{ item.stocktake_user }}</text>
</view> </view>
...@@ -201,6 +208,10 @@ ...@@ -201,6 +208,10 @@
<text class="label">盘点数量:</text> <text class="label">盘点数量:</text>
<input type="number" placeholder="请输入盘点数量" class="uni-input" v-model="stocktake_qty" /> <input type="number" placeholder="请输入盘点数量" class="uni-input" v-model="stocktake_qty" />
</view> </view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">盘点备注:</text>
<input type="text" placeholder="请输入盘点备注" class="uni-input" v-model="remark" />
</view>
</view> </view>
<view class="bor"></view> <view class="bor"></view>
<view class="field-item row"> <view class="field-item row">
...@@ -307,9 +318,10 @@ ...@@ -307,9 +318,10 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
isZy: false, //区分是否是自营 isZy: false, //区分是否是自营
index: 0, index: 0,
array: ['全量搜索', '旧标签'], array: ['全量搜索', '旧标签', '货品名称'],
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false, input_flag: false,
page: 1, page: 1,
...@@ -320,13 +332,15 @@ ...@@ -320,13 +332,15 @@
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
stocktake_qty: '', //盘点数量 stocktake_qty: '', //盘点数量
remark: '', //盘点备注
tag_version: ['中文标签', '英文标签'], tag_version: ['中文标签', '英文标签'],
tag_version_index: 0, tag_version_index: 0,
print_style: ['基本样式', '不带D/C'], print_style: ['基本样式', '不带D/C'],
print_style_index: -1, print_style_index: -1,
searchParams: { searchParams: {
stocktake_id: '', stocktake_id: '',
keyword: '' keyword: '',
goods_name: ''
}, },
formParams: { formParams: {
stocktake_id: '', stocktake_id: '',
...@@ -386,6 +400,8 @@ ...@@ -386,6 +400,8 @@
//详情 //详情
this.$refs.showRight.open(); this.$refs.showRight.open();
this.detail = data; this.detail = data;
this.remark = data.remark; //赋值盘点备注
//盘点数量
if (data.is_stocktake == 0) { if (data.is_stocktake == 0) {
this.stocktake_qty = ''; this.stocktake_qty = '';
} else { } else {
...@@ -425,6 +441,7 @@ ...@@ -425,6 +441,7 @@
if (type == 1) { if (type == 1) {
//全量搜索 //全量搜索
this.index = e.detail.value; this.index = e.detail.value;
this.clearInputAndFocus();
} else if (type == 2) { } else if (type == 2) {
//补打入库标签 //补打入库标签
this.tag_version_index = e.detail.value; this.tag_version_index = e.detail.value;
...@@ -469,21 +486,31 @@ ...@@ -469,21 +486,31 @@
this.resetChange(); this.resetChange();
this.searchParams.keyword = ''; this.searchParams.keyword = '';
this.input_flag = false; this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
* 全量搜索 * 全量搜索
* @param {Object} event * @param {Object} event
*/ */
handleInput: debounce(function(event) { handleInput: debounce(function(event, type) {
this.resetChange(); this.resetChange();
var val = event.target.value; var val = event.target.value;
this.searchParams.goods_name = '';
this.searchParams.keyword = '';
if (val) { if (val) {
this.input_flag = true; if (type == 1) {
this.searchParams.keyword = val; //全量搜索 旧标签
this.input_flag = true;
this.searchParams.keyword = val;
} else if (type == 2) {
//货品名称
this.input_flag = true;
this.searchParams.goods_name = val;
}
} else { } else {
this.input_flag = false; this.input_flag = false;
this.searchParams.keyword = '';
} }
this.getData(); this.getData();
}, 500), }, 500),
...@@ -513,16 +540,18 @@ ...@@ -513,16 +540,18 @@
* 更新盘点数量 * 更新盘点数量
*/ */
updateStocktakeItemQty() { updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => { this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty, remark: this.remark }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '操作成功', title: '操作成功',
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.searchParams.keyword = '';
this.resetChange(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.clearInputAndFocus();
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -575,6 +604,16 @@ ...@@ -575,6 +604,16 @@
this.list = []; this.list = [];
this.page = 1; this.page = 1;
this.filter_id = []; this.filter_id = [];
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
<template> <template>
<view class="tallyReceive"> <view class="tallyReceive">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter" style="margin-bottom: 20rpx;"> <view class="search-box row bothSide verCenter" style="margin-bottom: 20rpx;">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,25 +14,25 @@ ...@@ -13,25 +14,25 @@
<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.mobile_wait_tally_all_search" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描或输入查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_wait_tally_all_search" @input="handleInput(1, $event)" />
</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.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" maxlength="8" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" maxlength="8" />
</template> </template>
<template v-else-if="index == 2"> <template v-else-if="index == 2">
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" focus v-model="searchParams.tracking_no" @input="handleInput(0, $event)" style="width: 400rpx;" /> <input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.tracking_no" @input="handleInput(0, $event)" style="width: 400rpx;" />
</template> </template>
<template v-else-if="index == 3"> <template v-else-if="index == 3">
<input class="uni-input" placeholder="请输入DigKey" placeholder-style="color:#919399" focus v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" /> <input class="uni-input" placeholder="请输入DigKey" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" />
</template> </template>
<template v-else-if="index == 4"> <template v-else-if="index == 4">
<input class="uni-input" placeholder="请输入Rochester" placeholder-style="color:#919399" focus v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" /> <input class="uni-input" placeholder="请输入Rochester" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" />
</template> </template>
<template v-else-if="index == 5"> <template v-else-if="index == 5">
<input class="uni-input" placeholder="请输入TME" placeholder-style="color:#919399" focus v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" /> <input class="uni-input" placeholder="请输入TME" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" />
</template> </template>
<template v-else-if="index == 6"> <template v-else-if="index == 6">
<input class="uni-input" placeholder="请输入Chip1stop" placeholder-style="color:#919399" focus v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" /> <input class="uni-input" placeholder="请输入Chip1stop" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.code_type" @input="handleInputChange($event)" style="width: 400rpx;" />
</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>
...@@ -51,6 +52,7 @@ ...@@ -51,6 +52,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }"> <view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="is-watch row rowCenter verCenter" v-if="item.is_watch == 1">看货</view> <view class="is-watch row rowCenter verCenter" v-if="item.is_watch == 1">看货</view>
...@@ -202,6 +204,7 @@ ...@@ -202,6 +204,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
timer: null, // 用于存储计时器 timer: null, // 用于存储计时器
is_submit: true, is_submit: true,
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
...@@ -349,7 +352,6 @@ ...@@ -349,7 +352,6 @@
clearInput(type) { clearInput(type) {
this.resetChange(); this.resetChange();
if (type == 1) { if (type == 1) {
this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
//清空全量搜索 //清空全量搜索
this.searchParams.mobile_wait_tally_all_search = ''; this.searchParams.mobile_wait_tally_all_search = '';
...@@ -376,6 +378,8 @@ ...@@ -376,6 +378,8 @@
this.searchParams.code_type = ''; this.searchParams.code_type = '';
this.searchParams.goods_name = ''; this.searchParams.goods_name = '';
} }
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
} else { } else {
//容器以及一键理货里面的容器 //容器以及一键理货里面的容器
this.input_contaion = false; this.input_contaion = false;
...@@ -484,6 +488,7 @@ ...@@ -484,6 +488,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();
}, },
//设置默认的容器 //设置默认的容器
getTallyContainerDefault() { getTallyContainerDefault() {
...@@ -614,10 +619,10 @@ ...@@ -614,10 +619,10 @@
icon: 'success' icon: 'success'
}); });
setTimeout(() => { setTimeout(() => {
this.filter_id = []; //清空选中状态
this.resetChange(); this.resetChange();
this.getData(); this.getData();
this.closeDrawer(); this.closeDrawer();
this.clearInputAndFocus(); //再次获取焦点
}, 2000); }, 2000);
} else { } else {
uni.showModal({ uni.showModal({
...@@ -759,8 +764,19 @@ ...@@ -759,8 +764,19 @@
* 重置 * 重置
*/ */
resetChange() { resetChange() {
this.filter_id = []; //清空选中状态
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);
} }
} }
}; };
......
<template> <template>
<view class="tallyReceive"> <view class="tallyReceive">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter" style="margin-bottom: 20rpx;"> <view class="search-box row bothSide verCenter" style="margin-bottom: 20rpx;">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,13 +14,13 @@ ...@@ -13,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.tracking_no" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请输入物流单号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.tracking_no" @input="handleInput(1, $event)" />
</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.stock_in_sn" @input="handleInput(2, $event)" /> <input class="uni-input" placeholder="请输入入库单号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_sn" @input="handleInput(2, $event)" />
</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.stock_in_with_stock_in_items_inhouse" @input="handleInput(3, $event)" maxlength="7" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(3, $event)" maxlength="7" />
</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>
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 详情 -->
<view class="section"> <view class="section">
<view class="field-item row" v-if="detail"> <view class="field-item row" v-if="detail">
<view class="is-watch row rowCenter verCenter" v-if="is_watch">看货</view> <view class="is-watch row rowCenter verCenter" v-if="is_watch">看货</view>
...@@ -290,6 +292,7 @@ ...@@ -290,6 +292,7 @@
</view> </view>
</template> </template>
</view> </view>
<!-- 底部操作栏 -->
<view class="fix-btn row verCenter"> <view class="fix-btn row verCenter">
<!--区分深圳自营和非深圳自营--> <!--区分深圳自营和非深圳自营-->
<template v-if="warehouse_id == 9"> <template v-if="warehouse_id == 9">
...@@ -325,6 +328,7 @@ ...@@ -325,6 +328,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
is_watch: false, //是否看货 is_watch: false, //是否看货
is_print: false, //查询该销售单是否需要打印客户标签 is_print: false, //查询该销售单是否需要打印客户标签
coo: '', //产地 coo: '', //产地
...@@ -334,8 +338,8 @@ ...@@ -334,8 +338,8 @@
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
print_flag: true, //是否打印 print_flag: true, //是否打印
pic_flag: false, //是否整单照片 pic_flag: false, //是否整单照片
input_flag: true, input_flag: false,
input_contaion: true, input_contaion: false,
company_id: uni.getStorageSync('company_id') || 1, //公司组织 company_id: uni.getStorageSync('company_id') || 1, //公司组织
page: 1, page: 1,
limit: 1, limit: 1,
...@@ -462,7 +466,7 @@ ...@@ -462,7 +466,7 @@
*/ */
clearInput(type) { clearInput(type) {
if (type == 1) { if (type == 1) {
this.input_flag = false; //搜索部分清空
if (this.index == 0) { if (this.index == 0) {
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
} else if (this.index == 1) { } else if (this.index == 1) {
...@@ -470,8 +474,11 @@ ...@@ -470,8 +474,11 @@
} else if (this.index == 2) { } else if (this.index == 2) {
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
} }
this.input_flag = false;
this.stock_in_item_id = this.detail.stock_in_item_id; this.stock_in_item_id = this.detail.stock_in_item_id;
this.clearInputAndFocus(); //再次获取焦点
} else { } else {
//容器以及一键理货里面的容器
this.input_contaion = false; this.input_contaion = false;
this.searchParams.container_name = ''; this.searchParams.container_name = '';
this.searchParams.container_id = ''; this.searchParams.container_id = '';
...@@ -510,6 +517,7 @@ ...@@ -510,6 +517,7 @@
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
if (type == 1) { if (type == 1) {
//物流单号
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
...@@ -518,6 +526,7 @@ ...@@ -518,6 +526,7 @@
this.input_flag = true; this.input_flag = true;
this.getData(); this.getData();
} else if (type == 2) { } else if (type == 2) {
//入库单号
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
...@@ -526,6 +535,7 @@ ...@@ -526,6 +535,7 @@
this.input_flag = true; this.input_flag = true;
this.getData(); this.getData();
} else if (type == 3) { } else if (type == 3) {
//fedex
this.searchParams.tracking_no = ''; this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
...@@ -534,6 +544,7 @@ ...@@ -534,6 +544,7 @@
this.input_flag = true; this.input_flag = true;
this.getData(); this.getData();
} else if (type == 4) { } else if (type == 4) {
//容器
this.searchParams.container_name = val; this.searchParams.container_name = val;
this.input_contaion = true; this.input_contaion = true;
this.getTallyContainer(); this.getTallyContainer();
...@@ -847,6 +858,16 @@ ...@@ -847,6 +858,16 @@
}, },
closeDrawer() { closeDrawer() {
this.$refs.showRight.close(); this.$refs.showRight.close();
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,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.mobile_have_tally_all_search" @input="handleInput(1, $event)" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_have_tally_all_search" @input="handleInput(1, $event)" />
</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.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(2, $event)" />
</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>
...@@ -407,6 +407,7 @@ ...@@ -407,6 +407,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
page: 1, page: 1,
limit: 50, //分页限制数量 limit: 50, //分页限制数量
input_flag: false, input_flag: false,
...@@ -548,6 +549,7 @@ ...@@ -548,6 +549,7 @@
} else { } else {
//全量搜索 //全量搜索
this.index = e.detail.value; this.index = e.detail.value;
this.clearInputAndFocus();
} }
}, },
/** /**
...@@ -638,12 +640,13 @@ ...@@ -638,12 +640,13 @@
this.searchParams.create_time_end = ''; this.searchParams.create_time_end = '';
} else { } else {
this.resetChange(); this.resetChange();
this.input_flag = false;
if (this.index == 0) { if (this.index == 0) {
this.searchParams.mobile_have_tally_all_search = ''; this.searchParams.mobile_have_tally_all_search = '';
} else if (this.index == 1) { } else if (this.index == 1) {
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; this.searchParams.stock_in_with_stock_in_items_inhouse = '';
} }
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
} }
}, },
...@@ -972,6 +975,16 @@ ...@@ -972,6 +975,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);
} }
} }
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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 v-model="searchParams.transfer_sn" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.transfer_sn" @input="handleInput" />
</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>
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
<text class="label">创建时间:</text> <text class="label">创建时间:</text>
<text class="tt">{{ item.create_time }}</text> <text class="tt">{{ item.create_time }}</text>
</view> </view>
<navigator class="btn-box row" :url="'/pages/transfer/task?transfer_id=' + item.transfer_id + '&transfer_sn=' + item.transfer_sn" hover-class="none"><view class="btn row rowCenter verCenter">选择</view></navigator> <navigator class="btn-box row" :url="'/pages/transfer/task?transfer_id=' + item.transfer_id + '&transfer_sn=' + item.transfer_sn" hover-class="none">
<view class="btn row rowCenter verCenter">选择</view>
</navigator>
</view> </view>
</view> </view>
<!-- 无数据展示 --> <!-- 无数据展示 -->
...@@ -52,80 +54,102 @@ ...@@ -52,80 +54,102 @@
</template> </template>
<script> <script>
import { API } from '@/util/api.js'; import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js'; import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
input_flag: false, is_focus: true, //获取焦点动态化
page: 1, input_flag: false,
limit: 1000, page: 1,
index: 0, limit: 1000,
array: ['移位单号'], index: 0,
list: [], array: ['移位单号'],
searchParams: { list: [],
transfer_sn: '' //移位单号 searchParams: {
} transfer_sn: '' //移位单号
}; }
}, };
onShow() { },
this.getData(); onShow() {
}, this.getData();
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
}, },
/** methods: {
* 获取列表数据 bindPickerChange: function(e) {
*/ console.log('picker发送选择改变,携带值为', e.detail.value);
getData() { this.index = e.detail.value;
this.request(API.getTransferList, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { },
if (res.code === 0) { /**
this.list = res.data.list; * 获取列表数据
*/
getData() {
this.request(API.getTransferList, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
} else { } else {
uni.showToast({ this.input_flag = false;
title: res.msg,
icon: 'error'
});
} }
}); this.getData();
}, }, 500),
/** /**
* 单号搜索 * 筛选过滤出选中的元素
* @param {Object} event */
*/ filterChange(index) {
handleInput: debounce(function(event) { this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
var val = event.target.value; let filter_arr = this.findIndex(this.filter_list, true);
if (val) { this.filter_id = filter_arr.map(i => this.list[i].stock_in_id);
this.input_flag = true; },
} else { /**
* 清空数据
*/
clearInput() {
this.resetChange();
this.input_flag = false; this.input_flag = false;
this.searchParams.transfer_sn = '';
this.clearInputAndFocus();
this.getData();
},
/**
* 重置
*/
resetChange() {
this.filter_id = []; //清空选中状态
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
this.getData();
}, 500),
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id);
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.transfer_sn = '';
this.getData();
} }
} };
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '@/assets/css/transfer/index.scss'; @import '@/assets/css/transfer/index.scss';
</style> </style>
\ No newline at end of file
...@@ -398,7 +398,18 @@ ...@@ -398,7 +398,18 @@
this.input_flag = false; this.input_flag = false;
this.searchParams.stock_in_batch_sn = ''; this.searchParams.stock_in_batch_sn = '';
this.list = []; this.list = [];
this.clearInputAndFocus();
} }
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
} }
} }
}; };
......
<template> <template>
<view class="stockRecheck-record"> <view class="stockRecheck-record">
<!-- 搜索部分 -->
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
...@@ -13,15 +14,16 @@ ...@@ -13,15 +14,16 @@
<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.search_val" @input="handleInput" /> <input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.search_val" @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.search_val" @input="handleInput" maxlength="8" /> <input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.search_val" @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>
</view> </view>
</view> </view>
<!-- 列表 -->
<view class="list" v-if="list.length > 0"> <view class="list" v-if="list.length > 0">
<view class="box row" v-for="(item, index) in list" :key="index"> <view class="box row" v-for="(item, index) in list" :key="index">
<view class="input-box row verCenter"> <view class="input-box row verCenter">
...@@ -133,6 +135,7 @@ ...@@ -133,6 +135,7 @@
export default { export default {
data() { data() {
return { return {
is_focus: true, //获取焦点动态化
index: 0, index: 0,
array: ['全量搜索', '旧标签'], array: ['全量搜索', '旧标签'],
input_flag: false, input_flag: false,
...@@ -174,6 +177,7 @@ ...@@ -174,6 +177,7 @@
this.resetChange(); this.resetChange();
this.searchParams.search_val = ''; this.searchParams.search_val = '';
this.input_flag = false; this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
this.getData(); this.getData();
}, },
/** /**
...@@ -218,6 +222,16 @@ ...@@ -218,6 +222,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);
} }
} }
}; };
......
// const API_BASE_USER = 'http://user.liexindev.net'; //用户系统 const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
// const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统 const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
// const API_BASE = 'http://wms.liexindev.net'; //WMS系统 const API_BASE = 'http://wms.liexindev.net'; //WMS系统
// const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统 const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统 // const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统 // const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
const API_BASE = 'https://wms.ichunt.net'; //WMS系统 // const API_BASE = 'https://wms.ichunt.net'; //WMS系统
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统 // const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = { const API = {
......
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