Commit c45a04a6 by LJM

打印入仓号

parent 4f843677
......@@ -13,9 +13,12 @@
}
.search-all {
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding-left: 17rpx;
.search-all-box {
height: 60rpx;
padding-left: 17rpx;
background: #ffffff;
border-radius: 10rpx;
}
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
......@@ -33,11 +36,20 @@
margin-left: 13rpx;
}
}
.print-btn {
font-size: 24rpx;
color: #1969f9;
}
.search-box {
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
.search-box-wrap {
width: 80%;
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
}
.sn {
width: 164rpx;
height: 35rpx;
......
......@@ -42,22 +42,25 @@
<view class="total-text"><text>{{total}}</text>条数据</view>
</view>
<view class="search-all row verCenter bothSide">
<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>
<!-- 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 class="search-all-box row verCenter" style="width: 80%;">
<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>
<!-- 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>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
<view class="print-btn" @click="print()">打印入仓号</view>
</view>
<!-- 列表数据 -->
<view class="list row bothSide" v-if="list.length > 0">
......@@ -484,6 +487,7 @@
export default {
data() {
return {
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化
indicatorDots: true,
autoplay: false,
......@@ -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} type 1 第一次入库
* 打开弹窗
......
......@@ -2,26 +2,29 @@
<view class="arrivalRegister">
<!-- 搜索条件 -->
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="search-box-wrap row verCenter">
<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="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
<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>
</picker>
</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>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
<view class="print-btn" @click="print()">打印入仓号</view>
</view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0">
......@@ -162,6 +165,7 @@
export default {
data() {
return {
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化
input_flag: false,
all_flag: false, //全选标记
......@@ -172,6 +176,7 @@
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤id
filter_id_warehouse_id: [], //过滤处理的仓库id
detail: {}, //详情的数据
hasMoreData: true, //是否分页加载
maxInputLength: 7,
......@@ -200,6 +205,10 @@
this.getData();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 找出false对应的下标
* @param {Object} arr
......@@ -221,6 +230,7 @@
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);
this.filter_id_warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
},
/**
* 全选
......@@ -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 @@
stock_in_batch_sn: '' //入库批次号
},
formParams: {
sku_id: '',
stock_id: '',
transfer_qty: '',
position_code: ''
......@@ -312,6 +313,9 @@
this.request(API.searchStockListByYW, 'GET', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
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;
} else {
uni.showToast({
......
// const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
// const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
// const API_BASE = 'http://wms.liexindev.net'; //WMS系统
// const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
const API_BASE = 'https://wms.ichunt.net'; //WMS系统
const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
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