Commit c45a04a6 by LJM

打印入仓号

parent 4f843677
...@@ -13,9 +13,12 @@ ...@@ -13,9 +13,12 @@
} }
.search-all { .search-all {
height: 60rpx; height: 60rpx;
background: #ffffff; .search-all-box {
border-radius: 10rpx; height: 60rpx;
padding-left: 17rpx; padding-left: 17rpx;
background: #ffffff;
border-radius: 10rpx;
}
.icon-juxing1 { .icon-juxing1 {
font-size: 30rpx; font-size: 30rpx;
color: #919399; color: #919399;
...@@ -33,11 +36,20 @@ ...@@ -33,11 +36,20 @@
margin-left: 13rpx; margin-left: 13rpx;
} }
} }
.print-btn {
font-size: 24rpx;
color: #1969f9;
}
.search-box { .search-box {
height: 60rpx; height: 60rpx;
background: #ffffff; .search-box-wrap {
border-radius: 10rpx; width: 80%;
padding: 0 18rpx 0 0; height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
}
.sn { .sn {
width: 164rpx; width: 164rpx;
height: 35rpx; height: 35rpx;
......
...@@ -42,22 +42,25 @@ ...@@ -42,22 +42,25 @@
<view class="total-text"><text>{{total}}</text>条数据</view> <view class="total-text"><text>{{total}}</text>条数据</view>
</view> </view>
<view class="search-all row verCenter bothSide"> <view class="search-all row verCenter bothSide">
<view class="row verCenter"> <view class="search-all-box row verCenter" style="width: 80%;">
<text class="iconfont icon-juxing1"></text> <view class="row verCenter">
<!-- 全量搜索 --> <text class="iconfont icon-juxing1"></text>
<template v-if="index == 0"> <!-- 全量搜索 -->
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_register_all_search" @input="handleInput(1, $event)" /> <template v-if="index == 0">
</template> <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 v-else-if="index == 1"> <!-- 入仓号 -->
<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 v-else-if="index == 1">
</template> <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" />
<!-- fedex --> </template>
<template v-else-if="index == 2"> <!-- fedex -->
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.tracking_no" @input="handleInput(3, $event)" /> <template v-else-if="index == 2">
</template> <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>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <view class="print-btn" @click="print()">打印入仓号</view>
</view> </view>
<!-- 列表数据 --> <!-- 列表数据 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
...@@ -484,6 +487,7 @@ ...@@ -484,6 +487,7 @@
export default { export default {
data() { data() {
return { return {
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
indicatorDots: true, indicatorDots: true,
autoplay: false, autoplay: false,
...@@ -1133,6 +1137,57 @@ ...@@ -1133,6 +1137,57 @@
} }
}, },
/** /**
* 打印入仓号
*/
print() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择入仓号',
icon: 'error'
});
return false;
}
const allElementsEqual = this.filter_id_warehouse_id.every(element => element === this.filter_id_warehouse_id[0]);
if (!allElementsEqual) {
uni.showModal({
title: '提示',
content: '请勾选状态相同仓库的数据',
showCancel: false
});
return false;
}
var ids = [];
this.filter_id.forEach(id => {
// 在 list 中查找与当前 stock_in_id 匹配的对象
var item = this.list.find(element => element.stock_in_id === id);
// 如果找到了匹配的对象
if (item) {
// 遍历匹配对象的 stock_in_items 数组
item.stock_in_items.forEach(stockItem => {
// 将 inhouse 值添加到 ids 数组中
ids.push(stockItem.inhouse);
});
}
});
// 去除重复值
ids = Array.from(new Set(ids));
this.request(API.printInhouse, 'POST', { inhouse_str: ids.join(','), user_email: this.user_email, warehouse_id: this.filter_id_warehouse_id[0] }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '打印成功',
icon: 'success'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
},
/**
* @param {Object} stock_in_sn * @param {Object} stock_in_sn
* @param {Object} type 1 第一次入库 * @param {Object} type 1 第一次入库
* 打开弹窗 * 打开弹窗
......
...@@ -2,26 +2,29 @@ ...@@ -2,26 +2,29 @@
<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="search-box-wrap row verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view> <text class="iconfont icon-juxing1"></text>
<view class="uni-arrow"></view> <template v-if="index == 0">
<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 v-else-if="index == 1">
<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>
</view> </view>
</picker> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<template v-if="index == 0">
<input class="uni-input" placeholder="请扫描或输入号码" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.mobile_register_all_search" @input="handleInput(1, $event)" />
</template>
<template v-else-if="index == 1">
<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>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
<view class="print-btn" @click="print()">打印入仓号</view>
</view> </view>
<!-- 列表 --> <!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0"> <view class="list row bothSide" v-if="list.length > 0">
...@@ -162,6 +165,7 @@ ...@@ -162,6 +165,7 @@
export default { export default {
data() { data() {
return { return {
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化 is_focus: true, //获取焦点动态化
input_flag: false, input_flag: false,
all_flag: false, //全选标记 all_flag: false, //全选标记
...@@ -172,6 +176,7 @@ ...@@ -172,6 +176,7 @@
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id filter_id: [], //过滤id
filter_id_warehouse_id: [], //过滤处理的仓库id
detail: {}, //详情的数据 detail: {}, //详情的数据
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
maxInputLength: 7, maxInputLength: 7,
...@@ -200,6 +205,10 @@ ...@@ -200,6 +205,10 @@
this.getData(); this.getData();
}, },
methods: { methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/** /**
* 找出false对应的下标 * 找出false对应的下标
* @param {Object} arr * @param {Object} arr
...@@ -221,6 +230,7 @@ ...@@ -221,6 +230,7 @@
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index])); this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true); let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_sn); this.filter_id = filter_arr.map(i => this.list[i].stock_in_sn);
this.filter_id_warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
}, },
/** /**
* 全选 * 全选
...@@ -372,9 +382,56 @@ ...@@ -372,9 +382,56 @@
} }
}); });
}, },
bindPickerChange: function(e) { /**
console.log('picker发送选择改变,携带值为', e.detail.value); * 打印入仓号
this.index = e.detail.value; */
print() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择入仓号',
icon: 'error'
});
return false;
}
const allElementsEqual = this.filter_id_warehouse_id.every(element => element === this.filter_id_warehouse_id[0]);
if (!allElementsEqual) {
uni.showModal({
title: '提示',
content: '请勾选状态相同仓库的数据',
showCancel: false
});
return false;
}
var ids = [];
this.filter_id.forEach(id => {
// 在 list 中查找与当前 stock_in_sn 匹配的对象
var item = this.list.find(element => element.stock_in_sn === id);
// 如果找到了匹配的对象
if (item) {
// 遍历匹配对象的 stock_in_items 数组
item.stock_in_items.forEach(stockItem => {
// 将 inhouse 值添加到 ids 数组中
ids.push(stockItem.inhouse);
});
}
});
// 去除重复值
ids = Array.from(new Set(ids));
this.request(API.printInhouse, 'POST', { inhouse_str: ids.join(','), user_email: this.user_email, warehouse_id: this.filter_id_warehouse_id[0] }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '打印成功',
icon: 'success'
});
} else {
uni.showToast({
title: res.msg,
icon: 'none'
});
}
});
}, },
/** /**
* 打开弹窗 * 打开弹窗
......
...@@ -259,6 +259,7 @@ ...@@ -259,6 +259,7 @@
stock_in_batch_sn: '' //入库批次号 stock_in_batch_sn: '' //入库批次号
}, },
formParams: { formParams: {
sku_id: '',
stock_id: '', stock_id: '',
transfer_qty: '', transfer_qty: '',
position_code: '' position_code: ''
...@@ -312,6 +313,9 @@ ...@@ -312,6 +313,9 @@
this.request(API.searchStockListByYW, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => { this.request(API.searchStockListByYW, 'GET', { 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;
if (res.data.list.length > 0) {
this.formParams.sku_id = res.data.list[0].sku_id; //赋值sku_id
}
this.single_style = Number(res.data.count) > 1 ? false : true; this.single_style = Number(res.data.count) > 1 ? false : true;
} else { } else {
uni.showToast({ uni.showToast({
......
// 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 = {
...@@ -355,7 +355,11 @@ const API = { ...@@ -355,7 +355,11 @@ const API = {
/** /**
* 修改理货照片 * 修改理货照片
* */ * */
changeStockTallyImages: API_BASE + '/api/stockIn/tallyReceive/changeStockTallyImages' changeStockTallyImages: API_BASE + '/api/stockIn/tallyReceive/changeStockTallyImages',
/**
* 标签-入仓号
* */
printInhouse: API_BASE + '/api/label/printInhouse'
} }
......
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