Commit c69eb413 by liangjianmin

feat(stockRecheck): 增加出库单多选及打印标签功能

- 列表项添加多选框及选中样式支持
- 新增筛选选中出库单ID数组filter_id管理选中状态
- 实现筛选选中/取消选择逻辑及辅助函数
- 添加底部固定打印按钮,只在列表存在时显示
- 实现打印物流标签功能,支持批量打印已选中出库单
- 列表分页加载时同步初始化筛选状态数组
- 重置操作时清空选中状态及筛选结果
- 样式调整,新增多选框icon及固定底部按钮样式
- 优化无数据页面底部间距,增强页面显示美观性
parent f537a0ca
.stockRecheck-print {
padding: 15rpx 22rpx;
.radio-search-box {
height: 57rpx;
}
.search-box {
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
.sn {
width: 164rpx;
height: 35rpx;
border-right: 1px solid #f0f0f2;
.uni-input {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
......@@ -25,26 +30,33 @@
margin-left: 12rpx;
}
}
.search-bar {
width: calc(100% - 164rpx);
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
margin-left: 17rpx;
margin-right: 13rpx;
}
.uni-input {
font-size: 18rpx;
color: #484b59;
}
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
}
}
}
.list {
margin-top: 15rpx;
padding-bottom: 150rpx;
.box {
position: relative;
padding: 15px 17rpx 20rpx 17rpx;
......@@ -53,47 +65,77 @@
border-radius: 10rpx;
margin-bottom: 15rpx;
flex-wrap: wrap;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
top: 17rpx;
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
}
&.curr {
border: 1px solid #1969f9;
.check-box-icon {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.bor {
height: 1px;
background-color: #f0f0f2;
color: #f0f0f2;
margin-bottom: 10rpx;
}
.input-box {
margin-bottom: 11rpx;
flex: 0 0 50%;
.label {
width: 110rpx;
font-size: 17rpx;
color: #919399;
white-space: nowrap;
}
.text {
font-size: 17rpx;
color: #484b59;
display: -webkit-box;
-webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
.tt {
font-size: 17rpx;
color: #1969f9;
}
}
.pick_img_list {
flex-wrap: wrap;
.default {
width: 120rpx;
height: 120rpx;
background: #f5f5f7;
border-radius: 10rpx;
margin-right: 15rpx;
.iconfont {
font-size: 60rpx;
color: #c6c7cc;
}
}
.img_list {
position: relative;
width: 120rpx;
......@@ -102,10 +144,12 @@
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
image {
width: 120rpx;
height: 120rpx;
}
.iconfont {
position: absolute;
right: 0;
......@@ -116,6 +160,7 @@
}
}
}
.btn {
width: 68rpx;
height: 30rpx;
......@@ -139,8 +184,10 @@
background-color: #ffffff;
padding: 22rpx 22rpx 10rpx 22rpx;
box-sizing: border-box;
.title {
position: relative;
.iconfont {
position: absolute;
left: 0;
......@@ -148,22 +195,27 @@
font-size: 30rpx;
color: #292b33;
}
.text {
font-size: 23rpx;
color: #292b33;
font-weight: bold;
}
}
.field-item {
flex-wrap: wrap;
.item {
flex: 0 0 50%;
margin-bottom: 8rpx;
.label {
width: 120rpx;
font-size: 16rpx;
color: #919399;
}
.text {
font-size: 16rpx;
color: #1969f9;
......@@ -173,6 +225,7 @@
overflow: hidden;
max-width: 176rpx;
}
.tt {
font-size: 16rpx;
color: #484b59;
......@@ -184,20 +237,24 @@
}
}
}
.form-input {
.input-title {
margin-bottom: 10rpx;
.input-title-t1 {
font-size: 16rpx;
color: #1969f9;
font-weight: bold;
}
.input-title-t2 {
font-size: 16rpx;
color: #484b59;
font-weight: bold;
}
}
.input-box {
.uni-input {
height: 40rpx;
......@@ -209,19 +266,23 @@
}
}
}
.select-box {
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
.wrap {
padding-left: 15rpx;
padding-right: 25rpx;
height: 40rpx;
}
.uni-input {
font-size: 17rpx;
color: #484b59;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
......@@ -230,19 +291,23 @@
margin-left: 12rpx;
}
}
.item-tit {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-bottom: 18rpx;
.text {
font-weight: normal;
margin-right: 160rpx;
.label {
width: 82rpx;
font-size: 16rpx;
color: #919399;
}
.tt {
font-size: 16rpx;
color: #484b59;
......@@ -254,33 +319,40 @@
}
}
}
.print {
margin-top: 16rpx;
margin-bottom: 27rpx;
.check-box-icon {
width: 20rpx;
height: 20rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/11/0bf30da3e8ce6c476c210173b5f13d51.png') no-repeat center;
background-size: contain;
display: block;
&.curr {
background: url('https://img.ichunt.com/images/ichunt/202304/11/71a74e52e94bcf2e89f8df9817d494c6.png') no-repeat center;
background-size: contain;
}
}
.tt {
font-size: 17rpx;
color: #484b59;
margin-left: 10rpx;
}
}
.bor {
height: 1px;
background-color: #f0f0f2;
margin-bottom: 17rpx;
}
.btn {
margin: 26rpx auto 0;
.btn1 {
width: 100%;
height: 75rpx;
......@@ -289,6 +361,7 @@
color: #ffffff;
font-weight: bold;
}
.btn2 {
width: 100%;
height: 75rpx;
......@@ -299,3 +372,25 @@
}
}
}
// 底部按钮样式
.fix-btn {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
z-index: 999;
.btn-print {
width: 100%;
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
}
// 无数据页面底部间距
.no-date {
padding-bottom: 150rpx;
}
\ No newline at end of file
......@@ -60,7 +60,8 @@
</view>
<!-- 列表 -->
<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" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="input-box row verCenter">
<text class="label">出库单号:</text>
<text class="tt">{{ item.stock_out_sn }}</text>
......@@ -164,6 +165,12 @@
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<!-- 底部按钮 -->
<view class="fix-btn row verCenter" v-if="list.length > 0">
<view class="btn-print row rowCenter verCenter" @click="printLogisticsLabels()">
打印物流标签<text v-if="filter_id.length > 0">({{ filter_id.length }})</text>
</view>
</view>
<!-- 打快递单弹窗 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-picking" v-if="detail.stock_out_info" style="height: 100%;">
......@@ -393,6 +400,8 @@
limit: 30,
is_focus: true,
list: [],
filter_list: [], // 筛选已选中的列表
filter_id: [], // 选中的出库单ID
index: 0,
array: ['出库单号', '物流单号', '回单号', '货品名称'],
detail: {},
......@@ -666,6 +675,40 @@
return result;
},
/**
* 筛选过滤出选中的元素
*/
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
var filter_arr = this.findIndexBoolean(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_out_id);
},
/**
* 找出布尔值对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndexBoolean(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
return result;
},
/**
* 创建数组
* @param {Object} length
* @param {Object} value
*/
createArray(length, value) {
var arr = [];
for (var i = 0; i < length; i++) {
arr.push(value);
}
return arr;
},
/**
* 单号搜索
* @param {Object} event
*/
......@@ -791,7 +834,14 @@
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
// 第一页直接赋值,分页时使用concat
if (this.page === 1) {
this.list = res.data.list;
this.filter_list = this.createArray(this.list.length, false);
} else {
this.list = this.list.concat(res.data.list);
this.filter_list = this.createArray(this.list.length, false);
}
} else {
this.hasMoreData = false;
}
......@@ -928,6 +978,7 @@
* 重置
*/
resetChange() {
this.filter_id = []; // 清空选中状态
this.list = [];
this.page = 1;
},
......@@ -1183,6 +1234,34 @@
}
}
});
},
/**
* 打印物流标签
*/
printLogisticsLabels() {
if (this.filter_id.length === 0) {
uni.showToast({
title: '请选择要打印的出库单',
icon: 'none'
});
return;
}
this.request(API.printLogisticsLabels, 'POST', {
stock_out_ids: this.filter_id.join(',')
}, true).then(response => {
if (response.code === 0) {
uni.showToast({
title: '打印任务已发送,请查看打印机',
icon: 'success'
});
} else {
uni.showToast({
title: response.msg || '打印失败',
icon: 'none'
});
}
});
}
}
};
......
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