Commit b52ca95f by LJM

移动端--自营仓相关入库批次号扫描处增加截取部分文本功能

parent 7fa92228
......@@ -33,7 +33,7 @@
.search-type {
margin-bottom: 15rpx;
.search-bar {
width: 345rpx;
width: 100%;
height: 60rpx;
padding-right: 17rpx;
background: #ffffff;
......@@ -57,6 +57,14 @@
font-size: 18rpx;
color: #292b33;
font-weight: bold;
white-space: nowrap;
}
.custom-switch {
width: 74rpx;
transform: scale(0.5);
}
.android-switch {
transform: scale(0.7);
}
}
.list {
......
......@@ -33,7 +33,7 @@
.search-type {
margin-bottom: 15rpx;
.search-bar {
width: 345rpx;
width: 100%;
height: 60rpx;
padding-right: 17rpx;
background: #ffffff;
......@@ -65,6 +65,7 @@
.title {
font-size: 18rpx;
color: #292b33;
white-space: nowrap;
font-weight: bold;
}
.info {
......@@ -72,6 +73,13 @@
font-size: 22rpx;
margin-right: 16rpx;
}
.custom-switch {
width: 74rpx;
transform: scale(0.5);
}
.android-switch {
transform: scale(0.7);
}
}
}
.fix-btn {
......
<template>
<view class="immediatelyStockIn">
<view class="form-input row verCenter">
<text class="text row verCenter">入库批次号</text>
<view class="pick-box">
<picker @change="bindPickerChange($event, 2)" :value="index" :range="item_1">
<view class="row verCenter">
<view class="uni-input">{{ item_1[index_1] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="row bothSide verCenter input-wrap">
<input type="text" placeholder="请输入入库批次号" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" />
<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)" />
</template>
<template v-else-if="index_1 == 1">
<input type="text" placeholder="请输入旧标签查询" placeholder-style="color:#919399" class="uni-input" v-model="formParams.stock_in_batch_sn" @input="handleInput(4, $event)" maxlength="8" />
</template>
<text class="iconfont icon-a-juxing11" @click="clearInput(4)" v-if="input_stock_in_batch_sn"></text>
</view>
</view>
......@@ -56,155 +68,163 @@
</template>
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
is_submit: true,
index: 0,
item: ['货品编码', '自营货品ID'],
input_stock_in_batch_sn: false,
input_goods_sn: false,
input_goods_name: false,
input_position: false,
warehouse_id_index: 0,
position_id_index: 0,
warehouse_id_data: [],
formParams: {
stock_in_batch_sn: '',
sku_id: '',
goods_sn: '',
goods_name: '',
warehouse_id: '',
position_code: ''
}
};
},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e, type) {
if (type == 1) {
this.index = e.detail.value;
if (this.index == 0) {
this.formParams.sku_id = '';
} else if (this.index == 1) {
this.formParams.goods_sn = '';
export default {
data() {
return {
is_submit: true,
index: 0,
item: ['货品编码', '自营货品ID'],
item_1: ['入库批次号', '旧标签'],
index_1: 0,
input_stock_in_batch_sn: false,
input_goods_sn: false,
input_goods_name: false,
input_position: false,
warehouse_id_index: 0,
position_id_index: 0,
warehouse_id_data: [],
formParams: {
stock_in_batch_sn: '',
sku_id: '',
goods_sn: '',
goods_name: '',
warehouse_id: '',
position_code: ''
}
} else {
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
}
console.log('picker发送选择改变,携带值为', e.detail.value);
};
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
if (this.index == 0) {
this.formParams.goods_sn = '';
} else if (this.index == 1) {
this.formParams.sku_id = '';
}
this.input_goods_sn = false;
} else if (type == 2) {
this.formParams.goods_name = '';
this.input_goods_name = false;
} else if (type == 3) {
this.formParams.position_code = '';
this.input_position = false;
} else if (type == 4) {
this.formParams.stock_in_batch_sn = '';
this.input_stock_in_batch_sn = false;
}
onShow() {
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, val) {
if (val) {
methods: {
/**
* @param {Object} e
* @param {Object} type 1(货品编码,sku_id) 2(入库批次号,旧标签)
*/
bindPickerChange: function(e, type) {
if (type == 1) {
this.input_goods_sn = true;
this.index = e.detail.value;
if (this.index == 0) {
this.formParams.sku_id = '';
} else if (this.index == 1) {
this.formParams.goods_sn = '';
}
} else if (type == 2) {
this.input_goods_name = true;
} else if (type == 3) {
this.input_position = true;
this.getWhPositionList(this.formParams.warehouse_id, 0);
} else if (type == 4) {
this.input_stock_in_batch_sn = true;
this.index_1 = e.detail.value;
} else {
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
}
} else {
console.log('picker发送选择改变,携带值为', e.detail.value);
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
if (this.index == 0) {
this.formParams.goods_sn = '';
} else if (this.index == 1) {
this.formParams.sku_id = '';
}
this.input_goods_sn = false;
} else if (type == 2) {
this.formParams.goods_name = '';
this.input_goods_name = false;
} else if (type == 3) {
this.formParams.position_code = '';
this.input_position = false;
} else if (type == 4) {
this.formParams.stock_in_batch_sn = '';
this.input_stock_in_batch_sn = false;
}
}
}, 500),
/**
* 获取库存数据
*/
getData() {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => {
if (res.code === 0) {
this.formParams.warehouse_id = res.data.list[0].warehouse_id;
this.warehouse_id_data = res.data.list.map(function(item) {
return {
name: item.warehouse_name,
value: item.warehouse_id
};
});
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, val) {
if (val) {
if (type == 1) {
this.input_goods_sn = true;
} else if (type == 2) {
this.input_goods_name = true;
} else if (type == 3) {
this.input_position = true;
this.getWhPositionList(this.formParams.warehouse_id, 0);
} else if (type == 4) {
this.input_stock_in_batch_sn = true;
}
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
if (type == 1) {
this.input_goods_sn = false;
} else if (type == 2) {
this.input_goods_name = false;
} else if (type == 3) {
this.input_position = false;
} else if (type == 4) {
this.input_stock_in_batch_sn = false;
}
}
});
},
/**
* 获取库位
*/
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.formParams.position_code;
if (res.code === 0) {
this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code;
});
} else {
}, 500),
/**
* 获取库存数据
*/
getData() {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => {
if (res.code === 0) {
this.formParams.warehouse_id = res.data.list[0].warehouse_id;
this.warehouse_id_data = res.data.list.map(function(item) {
return {
name: item.warehouse_name,
value: item.warehouse_id
};
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取库位
*/
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.formParams.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'
});
}
});
},
search() {
if (!this.is_submit) {
uni.showToast({
title: res.msg,
title: '请选择合适库位',
icon: 'error'
});
return false;
}
});
},
search() {
if (!this.is_submit) {
uni.showToast({
title: '请选择合适库位',
icon: 'error'
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
});
return false;
}
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
});
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/immediatelyStockIn/index.scss';
</style>
@import '@/assets/css/immediatelyStockIn/index.scss';
</style>
\ No newline at end of file
......@@ -12,7 +12,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -99,7 +104,9 @@
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">拣货照片:</text>
<view class="pick_img_list row"><image :lazy-load="true" @click="previewChange(item.pick_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.pick_img_list" :key="i" mode="aspectFill"></image></view>
<view class="pick_img_list row">
<image :lazy-load="true" @click="previewChange(item.pick_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.pick_img_list" :key="i" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
......@@ -119,204 +126,204 @@
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
index: 0,
array: ['全量搜索'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
all_flag: false, //全选标记
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id
searchParams: {
stock_out_sn: '',
all_search_keyword: ''
}
};
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onLoad(options) {
this.searchParams.stock_out_sn = options.stock_out_sn || '';
},
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 全选
*/
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.id;
});
} else {
this.filter_id = [];
}
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
export default {
data() {
return {
index: 0,
array: ['全量搜索', '旧标签'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
all_flag: false, //全选标记
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id
searchParams: {
stock_out_sn: '',
all_search_keyword: ''
}
});
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.searchParams.all_search_keyword = '';
this.searchParams.stock_out_sn = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
}, 500),
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 取消拣货
*/
cancelPicking() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选货物',
icon: 'error'
});
return false;
onLoad(options) {
this.searchParams.stock_out_sn = options.stock_out_sn || '';
},
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
uni.showModal({
title: '提示',
content: '确定要取消拣货吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelPicking, 'POST', { pick_id: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.filter_id = [];
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllPickedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).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;
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 全选
*/
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.id;
});
} else {
this.filter_id = [];
}
},
/**
* 找出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.searchParams.all_search_keyword = '';
this.searchParams.stock_out_sn = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
}
this.getData();
}, 500),
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 取消拣货
*/
cancelPicking() {
if (this.filter_id.length == 0) {
uni.showToast({
title: res.msg,
title: '请勾选货物',
icon: 'error'
});
return false;
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
uni.showModal({
title: '提示',
content: '确定要取消拣货吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelPicking, 'POST', { pick_id: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.filter_id = [];
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllPickedList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).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: 'error'
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/picking/record.scss';
</style>
@import '@/assets/css/picking/record.scss';
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
</view>
<view class="picking-sort-wrap">
<view class="search-type row bothSide verCenter">
<view class="left">
<view class="left" style="width: 49%;">
<view class="title row verCenter" style="height: 45rpx;">库 位:</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
......@@ -15,12 +15,16 @@
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag_position_name"></text>
</view>
</view>
<view class="right">
<view class="right" style="width: 49%;">
<template v-if="curr == 0">
<view class="row bothSide verCenter" style="height: 45rpx;">
<view class="title">入库批次号:</view>
<view class="row verCenter">
<switch @change="switchChange" :checked="is_batch" color="#1969f9" style="transform:scale(0.7);width: 77rpx;" />
<view class="title rpw">入库批次号:</view>
<view class="row verCenter rowCenter">
<template v-if="warehouse_id == 9">
<switch @change="switchChange($event,1)" :checked="old_Label" color="#1969f9" :class="isApp ? 'android-switch' : 'custom-switch'" />
<text style="font-size: 18rpx;white-space: nowrap;">旧标签</text>
</template>
<switch @change="switchChange" :checked="is_batch" color="#1969f9" :class="isApp ? 'android-switch' : 'custom-switch'" />
<text style="font-size: 18rpx;white-space: nowrap;">批量扫描</text>
</view>
</view>
......@@ -533,6 +537,8 @@
export default {
data() {
return {
isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios',
old_Label: false, //旧标签默认false
isFocus: false,
is_batch: true, //是否开启批量
is_batch_active: false, //是否开启批量激活s
......@@ -589,6 +595,11 @@
this.stock_out_sn = options.stock_out_sn || '';
this.searchParams.stock_out_id = options.stock_out_id || '';
this.warehouse_id = options.warehouse_id || '';
//深圳自营仓-默认选择旧标签
if (this.warehouse_id == 9) {
this.old_Label = true;
}
},
onShow() {
if (this.noexebshowFalg) {
......@@ -606,23 +617,26 @@
this.rePrintTagParams.print_type = e.detail.value;
},
/**
* 批量扫描监听
* @param {Object} e
* @param {Object} type 1旧标签 批量扫描监听
*/
switchChange(e) {
switchChange(e, type) {
console.log('switch 发生 change 事件,携带值为', e.detail.value);
this.is_batch = e.detail.value;
//重置相关数据
this.history_id = [];
this.list = [];
this.page = 1;
this.filter_id = [];
this.is_batch_active = false;
if (type == 1) {
this.search_keyword = '';
this.searchParams.stock_in_batch_sn = '';
} else {
this.is_batch = e.detail.value;
//重置相关数据
this.history_id = [];
this.list = [];
this.page = 1;
this.filter_id = [];
this.is_batch_active = false;
this.search_keyword = '';
this.searchParams.stock_in_batch_sn = '';
this.getData();
}
this.getData();
},
/**
* 单号搜索
......@@ -1009,8 +1023,15 @@
title: this.stock_out_sn + '拣货'
});
//入库批次号为自营仓库的时候,输入文本后自动截取前8位,作为入库批次号传给后台进行校验。
if (this.warehouse_id == 9 && this.old_Label) {
this.searchParams.stock_in_batch_sn = this.searchParams.stock_in_batch_sn.substring(0, 8);
}
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
//过滤出应拣数量不为0的数据
if (this.curr == 0) {
var filteredList = res.data.list.filter(item => item.lock_qty - item.pick_qty > 0);
......
......@@ -12,7 +12,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="15" />
<template v-if="index == 0">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入入库标签" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="15" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" v-model="formParams.sn" placeholder="请输入旧标签查询" placeholder-style="color:#919399" @input="handleInput(1, formParams.sn)" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view>
......@@ -121,27 +126,7 @@
print_language: ['中文', '英文'],
print_type: ['基本样式', '不带D/C'],
print_type_index: 0,
labelStyles: [{
id: 5,
name: '入库标签'
},
{
id: 1,
name: '库位标签'
},
{
id: 2,
name: '库区标签'
},
{
id: 3,
name: '区域标签'
},
{
id: 4,
name: '容器标签'
}
],
labelStyles: [{ id: 5, name: '入库标签' }, { id: 5, name: '旧标签' }, { id: 1, name: '库位标签' }, { id: 2, name: '库区标签' }, { id: 3, name: '区域标签' }, { id: 4, name: '容器标签' }],
warehouse_arr: [],
warehouse_index: 0,
formParams: {
......@@ -212,6 +197,7 @@
this.print_type_index = e.detail.value;
this.formParams.print_type = Number(e.detail.value) + 1;
} else {
//入库标签 旧标签 容器标签 库位标签 库区标签 区域标签
this.index = e.detail.value;
this.formParams.type = this.labelStyles[e.detail.value].id;
}
......
......@@ -12,7 +12,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.all_search_keyword" @input="handleInput" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -90,7 +95,9 @@
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">复核照片:</text>
<view class="pick_img_list row"><image @click="previewChange(item.recheck_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.recheck_img_list" :key="i" mode="aspectFill"></image></view>
<view class="pick_img_list row">
<image @click="previewChange(item.recheck_img_list, i)" class="img_list" :src="v.small_image_url" v-for="(v, i) in item.recheck_img_list" :key="i" mode="aspectFill"></image>
</view>
</view>
<view class="input-box row" style="flex: 0 0 100%;">
<text class="label">主单仓库备注:</text>
......@@ -118,208 +125,208 @@
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
index: 0,
array: ['全量搜索'],
input_flag: false,
noexebshowFalg: true, //控制是否会触发生命周期
page: 1,
limit: 50,
list: [],
hasMoreData: true, //是否分页加载
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
searchParams: {
stock_out_sn: '',
all_search_keyword: ''
}
};
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onLoad(options) {
this.searchParams.stock_out_sn = options.stock_out_sn || '';
},
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
export default {
data() {
return {
index: 0,
array: ['全量搜索', '旧标签'],
input_flag: false,
noexebshowFalg: true, //控制是否会触发生命周期
page: 1,
limit: 50,
list: [],
hasMoreData: true, //是否分页加载
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
searchParams: {
stock_out_sn: '',
all_search_keyword: ''
}
};
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.all_search_keyword = '';
this.input_flag = false;
this.getData();
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
}, 500),
/**
* 找出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].recheck_item_id);
onLoad(options) {
this.searchParams.stock_out_sn = options.stock_out_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.recheck_item_id;
});
} else {
this.filter_id = [];
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllCheckedItemList, '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;
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.all_search_keyword = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.all_search_keyword = val;
} else {
this.input_flag = false;
this.searchParams.all_search_keyword = '';
}
this.getData();
}, 500),
/**
* 找出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].recheck_item_id);
},
/**
* 全选
*/
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.recheck_item_id;
});
} else {
this.filter_id = [];
}
},
/**
* 预览图片
* @param {Object} img
* @param {Object} index
*/
previewChange(arr, index) {
var data = arr.map(item => {
return item.big_image_url;
});
this.noexebshowFalg = false;
uni.previewImage({
current: index,
urls: data
});
},
/**
* 获取列表数据
*/
getData() {
this.request(API.getAllCheckedItemList, '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: 'error'
});
}
});
},
/**
* 取消复核
*/
cancelCheck() {
if (this.filter_id.length == 0) {
uni.showToast({
title: res.msg,
title: '请选择货品',
icon: 'error'
});
return false;
}
});
},
/**
* 取消复核
*/
cancelCheck() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
uni.showModal({
title: '提示',
content: '确定要取消复核吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelCheck, 'POST', { recheck_item_id: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消复核成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.filter_id = [];
this.getData();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
return false;
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
}
uni.showModal({
title: '提示',
content: '确定要取消复核吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelCheck, 'POST', { recheck_item_id: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消复核成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.filter_id = [];
this.getData();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/stockRecheck/record.scss';
</style>
@import '@/assets/css/stockRecheck/record.scss';
</style>
\ No newline at end of file
......@@ -5,7 +5,7 @@
</view>
<view class="picking-sort-wrap">
<view class="search-type row bothSide verCenter">
<view class="left">
<view class="left" style="width: 49%;">
<view class="box-info row bothSide verCenter">
<view class="title row bothSide verCenter">打包箱号:</view>
<view class="info" @click="showBox()">箱信息</view>
......@@ -21,12 +21,16 @@
</view>
</view>
</view>
<view class="right">
<view class="right" style="width: 49%;">
<template v-if="curr == 0">
<view class="box-info row bothSide verCenter">
<view class="title">入库批次号:</view>
<view class="row verCenter">
<switch @change="switchChange" :checked="is_batch" color="#1969f9" style="transform:scale(0.7);width: 77rpx;" />
<template v-if="warehouse_id == 9">
<switch @change="switchChange($event,1)" :checked="old_Label" color="#1969f9" :class="isApp ? 'android-switch' : 'custom-switch'" />
<text style="font-size: 18rpx;white-space: nowrap;">旧标签</text>
</template>
<switch @change="switchChange" :checked="is_batch" color="#1969f9" :class="isApp ? 'android-switch' : 'custom-switch'" />
<text style="font-size: 18rpx;white-space: nowrap;">批量扫描</text>
</view>
</view>
......@@ -500,10 +504,6 @@
</scroll-view>
</view>
<view class="btn row verCenter bothSide">
<!-- <view class="btn2 row rowCenter verCenter">
<text class="check-box-icon curr"></text>
<text class="text">打印客户专属标签</text>
</view> -->
<view class="btn1 row rowCenter verCenter" style="width: 100%;" @click="multiMarkChecked()">复 核</view>
</view>
</view>
......@@ -554,10 +554,6 @@
</template>
<view class="default row rowCenter verCenter" @click="chooseImageChange()" v-if="image_list.length < maxNum"><text class="iconfont icon-a-juxing3"></text></view>
</view>
<!-- <view class="print row verCenter">
<text class="check-box-icon curr"></text>
<text class="tt">打印客户专属标签</text>
</view> -->
<view class="btn row verCenter bothSide">
<view class="btn0 row rowCenter verCenter" @click="closeDrawer(0)">取 消</view>
<view class="btn1 row rowCenter verCenter" style="width: 50%;" @click="multiMarkChecked">一键复核</view>
......@@ -623,6 +619,8 @@
export default {
data() {
return {
isApp: uni.getSystemInfoSync().platform === 'android' || uni.getSystemInfoSync().platform === 'ios',
old_Label: false, //旧标签默认false
isFocus: true,
is_batch: true, //是否开启批量
history_id: [], //批量记录id
......@@ -682,6 +680,10 @@
this.searchParams.stock_out_id = options.stock_out_id || '';
this.warehouse_id = options.warehouse_id || '';
this.stock_out_sn = options.stock_out_sn || '';
//深圳自营仓-默认选择旧标签
if (this.warehouse_id == 9) {
this.old_Label = true;
}
},
onShow() {
if (this.noexebshowFalg) {
......@@ -690,28 +692,31 @@
},
methods: {
/**
* 批量扫描监听
* @param {Object} e
* @param {Object} type 1旧标签 批量扫描监听
*/
switchChange(e) {
console.log('switch 发生 change 事件,携带值为', e.detail.value);
this.is_batch = e.detail.value;
//重置相关数据
this.history_id = [];
this.list = [];
this.page = 1;
this.filter_id = [];
if (type == 1) {
this.search_keyword = '';
this.searchParams.stock_in_batch_sn = '';
} else {
this.is_batch = e.detail.value;
//重置相关数据
this.history_id = [];
this.list = [];
this.page = 1;
this.filter_id = [];
//再次获取焦点
this.isFocus = false;
setTimeout(() => {
this.isFocus = true;
}, 1000);
this.search_keyword = '';
this.searchParams.stock_in_batch_sn = '';
this.getData();
//再次获取焦点
this.isFocus = false;
setTimeout(() => {
this.isFocus = true;
}, 1000);
this.getData();
}
},
/**
* 打印货品标签样式切换监听
......@@ -1111,6 +1116,12 @@
uni.setNavigationBarTitle({
title: this.stock_out_sn + '复核'
});
//入库批次号为自营仓库的时候,输入文本后自动截取前8位,作为入库批次号传给后台进行校验。
if (this.warehouse_id == 9 && this.old_Label) {
this.searchParams.stock_in_batch_sn = this.searchParams.stock_in_batch_sn.substring(0, 8);
}
this.request(URL, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
//过滤出待复核不为0的数据
......
......@@ -33,11 +33,14 @@
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<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)" />
<input class="uni-input" placeholder="请输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event, 2)" />
</template>
<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)" />
</template>
<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" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_stock_in_batch_sn"></text>
</view>
......@@ -115,7 +118,9 @@
<text class="label">库存总数量:</text>
<text class="t1">{{ item.stock_qty }}</text>
</view>
<view class="btn-box row verCenter"><view class="btn3 row rowCenter verCenter" @click="showDrawer(item, 1)">选择</view></view>
<view class="btn-box row verCenter">
<view class="btn3 row rowCenter verCenter" @click="showDrawer(item, 1)">选择</view>
</view>
</view>
</view>
<!-- 无数据展示 -->
......@@ -204,7 +209,9 @@
<input type="number" placeholder="请输入盘点数量" class="uni-input" v-model="stocktake_qty" />
</view>
</view>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view></view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view>
</view>
</view>
</uni-drawer>
<!-- 库位列表弹窗 -->
......@@ -236,7 +243,9 @@
<view class="uni-td row verCenter rowCenter">{{ item.greater_than_zero }}</view>
</view>
</view>
<view class="btn row rowCenter verCenter"><view class="row btn2 row rowCenter verCenter" style="width:100%" @click="closeDrawer()">关闭</view></view>
<view class="btn row rowCenter verCenter">
<view class="row btn2 row rowCenter verCenter" style="width:100%" @click="closeDrawer()">关闭</view>
</view>
</view>
</uni-drawer>
<!-- 补打入库标签 -->
......@@ -260,11 +269,15 @@
<template v-else>
<radio-group @change="radioChange" class="row verCenter">
<label class="uni-list-cell row verCenter">
<view><radio value="1" checked="checked" style="transform:scale(0.7)" color="#1969f9" /></view>
<view>
<radio value="1" checked="checked" style="transform:scale(0.7)" color="#1969f9" />
</view>
<text class="text">按库存数量</text>
</label>
<label class="uni-list-cell row verCenter">
<view><radio value="2" style="transform:scale(0.7)" color="#1969f9" /></view>
<view>
<radio value="2" style="transform:scale(0.7)" color="#1969f9" />
</view>
<text class="text">按盘点数量</text>
</label>
</radio-group>
......@@ -289,351 +302,355 @@
</picker>
</view>
</view>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="printLabelChange()">打印</view></view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="printLabelChange()">打印</view>
</view>
</view>
</uni-drawer>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false, //库位
input_stock_in_batch_sn: false, //入库批次号
index: 0,
array: ['库位'],
filterArr: ['全部', '已盘完', '未盘完'],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
indexFilter: 0,
array_batch_sn: ['入库批次号', '货品名称'],
index_batch_sn: 0,
stocktake_qty: '',
list: [],
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
stocktake_sn: '',
detail: {},
positionListCount: [],
tag_version: ['中文标签', '英文标签'],
tag_version_index: 0,
searchParams: {
stocktake_id: '', //盘点单主键id
position_code: '', //库位编码
stock_in_batch_sn: '', //入库批次号
goods_name: '' //货品名称
},
formParams: {
stocktake_id: '',
stocktake_items_ids: '',
label_num: '', //标签货品数量
label_num_type: 1, //标签类型
ip: '', //目标打印机
print_language: 1 //标签版本
}
};
},
onLoad(options) {
this.searchParams.stocktake_id = options.stocktake_id || '';
this.stocktake_sn = options.stocktake_sn || '';
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/stocktake/record?stocktake_id=' + this.searchParams.stocktake_id
});
}
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onShow() {
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;
},
/**
* @param {Object} data
* @param {Object} type 1 选择详情 2 补打入库标签
*/
showDrawer(data, type) {
if (type == 1) {
//详情
this.$refs.showRight.open();
this.detail = data;
if (data.is_stocktake == 0) {
this.stocktake_qty = '';
} else {
this.stocktake_qty = data.stocktake_qty;
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false, //库位
input_stock_in_batch_sn: false, //入库批次号
index: 0,
array: ['库位'],
filterArr: ['全部', '已盘完', '未盘完'],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
indexFilter: 0,
array_batch_sn: ['入库批次号', '货品名称', '旧标签'],
index_batch_sn: 0,
stocktake_qty: '',
list: [],
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
stocktake_sn: '',
detail: {},
positionListCount: [],
tag_version: ['中文标签', '英文标签'],
tag_version_index: 0,
searchParams: {
stocktake_id: '', //盘点单主键id
position_code: '', //库位编码
stock_in_batch_sn: '', //入库批次号
goods_name: '' //货品名称
},
formParams: {
stocktake_id: '',
stocktake_items_ids: '',
label_num: '', //标签货品数量
label_num_type: 1, //标签类型
ip: '', //目标打印机
print_language: 1 //标签版本
}
} else if (type == 2) {
//补打入库标签
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选盘点任务',
icon: 'none'
});
return false;
}
var filteredList = this.list.filter(item => this.filter_id.includes(item.stocktake_items_id));
if (this.filter_id.length > 1) {
//如果勾选的是多个,则显示两个单选项:按库存数量、按盘点数据
this.formParams.label_num = this.filter_id.length;
} else {
//若勾选的是单个,则显示输入框,默认带入库存数量。
this.formParams.label_num = filteredList[0].stock_qty;
}
this.formParams.stocktake_id = this.searchParams.stocktake_id; //盘点单id
this.formParams.stocktake_items_ids = filteredList.map(item => item.stocktake_items_id).join(','); //任务id 多个英文逗号隔开
this.$refs.showRightPrintLabel.open();
}
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightPosition.close();
this.$refs.showRightPrintLabel.close();
},
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
//库位
this.index = e.detail.value;
} else if (type == 2) {
//入库批次号 && 货品名称
this.index_batch_sn = e.detail.value;
if (this.index_batch_sn == 0) {
//入库批次号
this.searchParams.goods_name = '';
} else if (this.index_batch_sn == 1) {
//货品名称
this.searchParams.stock_in_batch_sn = '';
}
} else if (type == 3) {
//库位编码筛选
this.indexFilter = e.detail.value;
this.getPositionListCount(parseInt(e.detail.value) + 1);
} else if (type == 4) {
//补打入库标签
this.tag_version_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
}
},
radioChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.formParams.label_num_type = e.detail.value;
};
},
/**
* 筛选过滤出选中的元素
*/
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].stocktake_items_id);
onLoad(options) {
this.searchParams.stocktake_id = options.stocktake_id || '';
this.stocktake_sn = options.stocktake_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.stocktake_items_id;
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.navigateTo({
url: '/pages/stocktake/record?stocktake_id=' + this.searchParams.stocktake_id
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.input_flag = false;
this.searchParams.position_code = '';
} else if (type == 2) {
this.input_stock_in_batch_sn = false;
if (this.index_batch_sn == 0) {
//入库批次号
this.searchParams.stock_in_batch_sn = '';
} else if (this.index_batch_sn == 1) {
//货品名称
this.searchParams.goods_name = '';
}
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event, type) {
this.resetChange();
var val = event.target.value;
if (type == 1) {
this.searchParams.position_code = '';
if (val) {
this.input_flag = true;
this.searchParams.position_code = val;
} else {
this.input_flag = false;
onShow() {
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;
},
/**
* @param {Object} data
* @param {Object} type 1 选择详情 2 补打入库标签
*/
showDrawer(data, type) {
if (type == 1) {
//详情
this.$refs.showRight.open();
this.detail = data;
if (data.is_stocktake == 0) {
this.stocktake_qty = '';
} else {
this.stocktake_qty = data.stocktake_qty;
}
} else if (type == 2) {
//补打入库标签
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选盘点任务',
icon: 'none'
});
return false;
}
var filteredList = this.list.filter(item => this.filter_id.includes(item.stocktake_items_id));
if (this.filter_id.length > 1) {
//如果勾选的是多个,则显示两个单选项:按库存数量、按盘点数据
this.formParams.label_num = this.filter_id.length;
} else {
//若勾选的是单个,则显示输入框,默认带入库存数量。
this.formParams.label_num = filteredList[0].stock_qty;
}
this.formParams.stocktake_id = this.searchParams.stocktake_id; //盘点单id
this.formParams.stocktake_items_ids = filteredList.map(item => item.stocktake_items_id).join(','); //任务id 多个英文逗号隔开
this.$refs.showRightPrintLabel.open();
}
} else if (type == 2) {
this.searchParams.stock_in_batch_sn = '';
this.searchParams.goods_name = '';
if (val) {
this.input_stock_in_batch_sn = true;
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightPosition.close();
this.$refs.showRightPrintLabel.close();
},
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
//库位
this.index = e.detail.value;
} else if (type == 2) {
//入库批次号 && 货品名称
this.index_batch_sn = e.detail.value;
if (this.index_batch_sn == 0) {
//入库批次号
this.searchParams.stock_in_batch_sn = val;
setTimeout(() => {
this.showDrawer(this.list[0], 1);
}, 500);
this.searchParams.goods_name = '';
} else if (this.index_batch_sn == 1) {
//货品名称
this.searchParams.goods_name = val;
this.searchParams.stock_in_batch_sn = '';
}
} else if (type == 3) {
//库位编码筛选
this.indexFilter = e.detail.value;
this.getPositionListCount(parseInt(e.detail.value) + 1);
} else if (type == 4) {
//补打入库标签
this.tag_version_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
}
},
radioChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.formParams.label_num_type = e.detail.value;
},
/**
* 筛选过滤出选中的元素
*/
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].stocktake_items_id);
},
/**
* 全选
*/
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.stocktake_items_id;
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.input_flag = false;
this.searchParams.position_code = '';
} else if (type == 2) {
this.input_stock_in_batch_sn = false;
if (this.index_batch_sn == 0 || this.index_batch_sn == 2) {
//入库批次号++旧标签
this.searchParams.stock_in_batch_sn = '';
} else if (this.index_batch_sn == 1) {
//货品名称
this.searchParams.goods_name = '';
}
}
}
this.getData();
}, 500),
/**
* 库位列表
*/
getPositionListCount(type) {
this.$refs.showRightPosition.open();
this.request(API.positionListCount, 'POST', { stocktake_id: this.searchParams.stocktake_id, type: type || 1 }, true).then(res => {
if (res.code === 0) {
this.positionListCount = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event, type) {
this.resetChange();
var val = event.target.value;
if (type == 1) {
this.searchParams.position_code = '';
if (val) {
this.input_flag = true;
this.searchParams.position_code = val;
} else {
this.input_flag = false;
}
} else if (type == 2) {
this.searchParams.stock_in_batch_sn = '';
this.searchParams.goods_name = '';
if (val) {
this.input_stock_in_batch_sn = true;
if (this.index_batch_sn == 0 || this.index_batch_sn == 2) {
//入库批次号 ++旧标签
this.searchParams.stock_in_batch_sn = val;
setTimeout(() => {
if (this.list.length > 0) {
this.showDrawer(this.list[0], 1);
}
}, 500);
} else if (this.index_batch_sn == 1) {
//货品名称
this.searchParams.goods_name = val;
}
} else {
this.input_stock_in_batch_sn = false;
}
}
});
},
/**
* 获取盘点操作列表
*/
getData() {
this.request(API.stocktakeOperateList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
uni.setNavigationBarTitle({
title: this.stocktake_sn
});
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
this.getData();
}, 500),
/**
* 库位列表
*/
getPositionListCount(type) {
this.$refs.showRightPosition.open();
this.request(API.positionListCount, 'POST', { stocktake_id: this.searchParams.stocktake_id, type: type || 1 }, true).then(res => {
if (res.code === 0) {
this.positionListCount = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 获取盘点操作列表
*/
getData() {
this.request(API.stocktakeOperateList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
uni.setNavigationBarTitle({
title: this.stocktake_sn
});
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'
});
}
});
},
/**
* 盘点标签补打
*/
printLabelChange() {
//选中一条数据的时候
if (this.filter_id.length == 1) {
if (!this.formParams.label_num) {
uni.showToast({
title: '请填写标签货品数量',
icon: 'none'
});
return false;
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* 盘点标签补打
*/
printLabelChange() {
//选中一条数据的时候
if (this.filter_id.length == 1) {
if (!this.formParams.label_num) {
uni.showToast({
title: '请填写标签货品数量',
icon: 'none'
});
return false;
}
}
this.request(API.printLabel, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 更新操作
*/
updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.filter_id = [];
this.request(API.printLabel, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 更新操作
*/
updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.filter_id = [];
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/stocktake/operate.scss';
</style>
@import '@/assets/css/stocktake/operate.scss';
</style>
\ No newline at end of file
......@@ -12,7 +12,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请输入查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" focus v-model="searchParams.keyword" @input="handleInput" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -198,7 +203,9 @@
</view>
</view>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view></view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view>
</view>
</view>
</uni-drawer>
<!-- 补打入库标签 -->
......@@ -222,11 +229,15 @@
<template v-else>
<radio-group @change="radioChange" class="row verCenter">
<label class="uni-list-cell row verCenter">
<view><radio value="1" checked="checked" style="transform:scale(0.7)" color="#1969f9" /></view>
<view>
<radio value="1" checked="checked" style="transform:scale(0.7)" color="#1969f9" />
</view>
<text class="text">按库存数量</text>
</label>
<label class="uni-list-cell row verCenter">
<view><radio value="2" style="transform:scale(0.7)" color="#1969f9" /></view>
<view>
<radio value="2" style="transform:scale(0.7)" color="#1969f9" />
</view>
<text class="text">按盘点数量</text>
</label>
</radio-group>
......@@ -269,293 +280,295 @@
</view>
</view>
</template>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="printLabelChange()">打印</view></view>
<view class="btn row rowCenter verCenter">
<view class="row btn1 row rowCenter verCenter" style="width:100%" @click="printLabelChange()">打印</view>
</view>
</view>
</uni-drawer>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
isZy: false, //区分是否是自营
index: 0,
array: ['全量搜索'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
list: [],
detail: {},
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
stocktake_qty: '', //盘点数量
tag_version: ['中文标签', '英文标签'],
tag_version_index: 0,
print_style: ['基本样式', '不带D/C'],
print_style_index: -1,
searchParams: {
stocktake_id: '',
keyword: ''
},
formParams: {
stocktake_id: '',
stocktake_items_ids: '',
label_num: '', //标签货品数量
label_num_type: 1, //标签类型
ip: '', //目标打印机
print_language: 1, //标签版本
print_style: ''
}
};
},
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onLoad(options) {
this.searchParams.stocktake_id = options.stocktake_id || '';
},
onShow() {
if (this.noexebshowFalg) {
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);
export default {
data() {
return {
isZy: false, //区分是否是自营
index: 0,
array: ['全量搜索', '旧标签'],
noexebshowFalg: true, //控制是否会触发生命周期
input_flag: false,
page: 1,
limit: 50,
hasMoreData: true, //是否分页加载
list: [],
detail: {},
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
stocktake_qty: '', //盘点数量
tag_version: ['中文标签', '英文标签'],
tag_version_index: 0,
print_style: ['基本样式', '不带D/C'],
print_style_index: -1,
searchParams: {
stocktake_id: '',
keyword: ''
},
formParams: {
stocktake_id: '',
stocktake_items_ids: '',
label_num: '', //标签货品数量
label_num_type: 1, //标签类型
ip: '', //目标打印机
print_language: 1, //标签版本
print_style: ''
}
});
return result;
};
},
/**
* @param {Object} data
* @param {Object} type 1 选择详情 2 补打入库标签
*/
showDrawer(data, type) {
if (type == 1) {
//详情
this.$refs.showRight.open();
this.detail = data;
if (data.is_stocktake == 0) {
this.stocktake_qty = '';
} else {
this.stocktake_qty = data.stocktake_qty;
}
} else if (type == 2) {
//补打入库标签
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选盘点任务',
icon: 'none'
});
return false;
}
var filteredList = this.list.filter(item => this.filter_id.includes(item.stocktake_items_id));
//根据盘点单的仓库展示不同标签模板下拉选择框
this.isZy = filteredList[0].is_zy == 0 ? false : true;
if (this.filter_id.length > 1) {
//如果勾选的是多个,则显示两个单选项:按库存数量、按盘点数据
this.formParams.label_num = this.filter_id.length;
} else {
//若勾选的是单个,则显示输入框,默认带入库存数量。
this.formParams.label_num = filteredList[0].stock_qty;
}
this.formParams.stocktake_id = this.searchParams.stocktake_id; //盘点单id
this.formParams.stocktake_items_ids = filteredList.map(item => item.stocktake_items_id).join(','); //任务id 多个英文逗号隔开
this.$refs.showRightPrintLabel.open();
onNavigationBarButtonTap(e) {
if (e.index == 0) {
uni.reLaunch({
url: '/pages/index/index'
});
}
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightPrintLabel.close();
},
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
//全量搜索
this.index = e.detail.value;
} else if (type == 2) {
//补打入库标签
this.tag_version_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
} else if (type == 3) {
//打印样式
this.print_style_index = e.detail.value;
this.formParams.print_style = Number(e.detail.value) + 1;
this.formParams.print_language = 1;
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
radioChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.formParams.label_num_type = e.detail.value;
},
/**
* 筛选过滤出选中的元素
*/
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].stocktake_items_id);
onLoad(options) {
this.searchParams.stocktake_id = options.stocktake_id || '';
},
/**
* 全选
*/
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.stocktake_items_id;
});
} else {
this.filter_id = [];
onShow() {
if (this.noexebshowFalg) {
this.resetChange();
this.getData();
}
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.keyword = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.keyword = val;
} else {
this.input_flag = false;
this.searchParams.keyword = '';
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getStockTakeRecord, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).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);
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;
},
/**
* @param {Object} data
* @param {Object} type 1 选择详情 2 补打入库标签
*/
showDrawer(data, type) {
if (type == 1) {
//详情
this.$refs.showRight.open();
this.detail = data;
if (data.is_stocktake == 0) {
this.stocktake_qty = '';
} else {
this.hasMoreData = false;
this.stocktake_qty = data.stocktake_qty;
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
} else if (type == 2) {
//补打入库标签
if (this.filter_id.length == 0) {
uni.showToast({
title: '请勾选盘点任务',
icon: 'none'
});
return false;
}
var filteredList = this.list.filter(item => this.filter_id.includes(item.stocktake_items_id));
//根据盘点单的仓库展示不同标签模板下拉选择框
this.isZy = filteredList[0].is_zy == 0 ? false : true;
if (this.filter_id.length > 1) {
//如果勾选的是多个,则显示两个单选项:按库存数量、按盘点数据
this.formParams.label_num = this.filter_id.length;
} else {
//若勾选的是单个,则显示输入框,默认带入库存数量。
this.formParams.label_num = filteredList[0].stock_qty;
}
this.formParams.stocktake_id = this.searchParams.stocktake_id; //盘点单id
this.formParams.stocktake_items_ids = filteredList.map(item => item.stocktake_items_id).join(','); //任务id 多个英文逗号隔开
this.$refs.showRightPrintLabel.open();
}
});
},
/**
* 更新盘点数量
*/
updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightPrintLabel.close();
},
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
//全量搜索
this.index = e.detail.value;
} else if (type == 2) {
//补打入库标签
this.tag_version_index = e.detail.value;
this.formParams.print_language = Number(e.detail.value) + 1;
} else if (type == 3) {
//打印样式
this.print_style_index = e.detail.value;
this.formParams.print_style = Number(e.detail.value) + 1;
this.formParams.print_language = 1;
}
},
radioChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.formParams.label_num_type = e.detail.value;
},
/**
* 筛选过滤出选中的元素
*/
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].stocktake_items_id);
},
/**
* 全选
*/
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.stocktake_items_id;
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
this.filter_id = [];
}
});
},
/**
* 盘点标签补打
*/
printLabelChange() {
//选中一条数据的时候
if (this.filter_id.length == 1) {
if (!this.formParams.label_num) {
uni.showToast({
title: '请填写标签货品数量',
icon: 'none'
});
return false;
},
/**
* 清空数据
*/
clearInput() {
this.resetChange();
this.searchParams.keyword = '';
this.input_flag = false;
this.getData();
},
/**
* 全量搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
this.resetChange();
var val = event.target.value;
if (val) {
this.input_flag = true;
this.searchParams.keyword = val;
} else {
this.input_flag = false;
this.searchParams.keyword = '';
}
}
this.getData();
}, 500),
this.request(API.printLabel, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
/**
* 获取列表数据
*/
getData() {
this.request(API.getStockTakeRecord, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).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'
});
}
});
},
/**
* 更新盘点数量
*/
updateStocktakeItemQty() {
this.request(API.updateStocktakeItemQty, 'POST', { stocktake_items_id: this.detail.stocktake_items_id, stocktake_qty: this.stocktake_qty }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 盘点标签补打
*/
printLabelChange() {
//选中一条数据的时候
if (this.filter_id.length == 1) {
if (!this.formParams.label_num) {
uni.showToast({
title: '请填写标签货品数量',
icon: 'none'
});
return false;
}
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.filter_id = [];
this.request(API.printLabel, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '操作成功',
icon: 'success'
});
setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.filter_id = [];
}
}
}
};
};
</script>
<style scoped lang="scss">
@import '@/assets/css/stocktake/record.scss';
</style>
@import '@/assets/css/stocktake/record.scss';
</style>
\ No newline at end of file
......@@ -12,7 +12,12 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描入库批次号" placeholder-style="color:#919399" :focus="is_focus" bindfocus="onFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event)" />
<template v-if="index == 0">
<input class="uni-input" placeholder="请扫描入库批次号" placeholder-style="color:#919399" :focus="is_focus" bindfocus="onFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event)" />
</template>
<template v-else-if="index == 1">
<input class="uni-input" placeholder="请输入旧标签查询" placeholder-style="color:#919399" :focus="is_focus" bindfocus="onFocus" v-model="searchParams.stock_in_batch_sn" @input="handleInput($event)" maxlength="8" />
</template>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
......@@ -244,7 +249,7 @@
page: 1,
limit: 1000,
index: 0,
array: ['入库批次号'],
array: ['入库批次号', '旧标签'],
list: [],
searchParams: {
stock_in_batch_sn: '' //入库批次号
......
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