Commit 689b0854 by LJM

bug

parent 201c6c8d
......@@ -43,7 +43,7 @@
}
.list {
margin-top: 15rpx;
padding-bottom: 150rpx;
padding-bottom: 50rpx;
flex-wrap: wrap;
.box {
position: relative;
......
......@@ -52,6 +52,23 @@
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;
}
}
.input-box {
margin-bottom: 11rpx;
flex: 0 0 50%;
......@@ -102,6 +119,51 @@
}
}
}
.fix-btn {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
z-index: 999;
.btn1 {
width: 128rpx;
height: 75rpx;
background: #ffffff;
.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;
}
}
.text {
margin-left: 10rpx;
font-size: 20rpx;
color: #484b59;
}
}
.btn2 {
width: calc(100% - 128rpx);
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
.btn3 {
width: 180rpx;
height: 75rpx;
background: #ffffff;
font-size: 23rpx;
color: #ff3700;
border-left: 1px solid #f0f0f2;
font-weight: bold;
}
}
}
::v-deep .uni-drawer__content {
......@@ -127,6 +189,19 @@
font-weight: bold;
}
}
.p-text {
margin-top: 38rpx;
margin-bottom: 18rpx;
.tt {
font-size: 20rpx;
color: #484b59;
}
.ed {
font-weight: bold;
font-size: 20rpx;
color: #1969f9;
}
}
.field-item {
flex-wrap: wrap;
.item {
......@@ -168,6 +243,9 @@
}
.form-input {
margin-bottom: 18rpx;
.mb0 {
margin-bottom: 0 !important;
}
.input-title {
margin-bottom: 10rpx;
.input-title-t1 {
......@@ -175,6 +253,11 @@
color: #484b59;
font-weight: bold;
}
.input-title-t2 {
font-size: 16rpx;
color: #484b59;
font-weight: bold;
}
}
.input-box {
.uni-input {
......@@ -185,6 +268,36 @@
text-indent: 15rpx;
font-size: 16rpx;
}
.uni-list-cell {
margin-right: 24rpx;
.text {
font-size: 16rpx;
color: #484b59;
}
}
}
}
.select-box {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
margin-bottom: 18rpx;
.wrap {
padding-left: 15rpx;
padding-right: 25rpx;
height: 55rpx;
}
.uni-input {
font-size: 17rpx;
color: #484b59;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
}
.item-tit {
......@@ -218,4 +331,41 @@
font-weight: bold;
}
}
.uni-table {
margin-top: 20rpx;
width: 100%;
height: 100%;
overflow-y: auto;
border-top: 1px solid #f0f0f2;
border-left: 1px solid #f0f0f2;
border-right: 1px solid #f0f0f2;
.uni-tr {
.uni-td {
width: 33.3%;
height: 50rpx;
font-size: 18rpx;
color: #292b33;
border-bottom: 1px solid #f0f0f2;
border-right: 1px solid #f0f0f2;
&:last-child {
border-right: none;
}
.sn {
margin-left: 6rpx;
height: 35rpx;
.uni-input {
font-size: 18rpx;
color: #292b33;
}
.uni-arrow {
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
margin-left: 12rpx;
}
}
}
}
}
}
......@@ -49,8 +49,7 @@
</view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter">
<text class="label">任务ID:</text>
<text class="t1">{{ item.stocktake_items_id }}</text>
......@@ -120,6 +119,7 @@
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<!--
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
......@@ -127,6 +127,7 @@
</view>
<view class="btn2 row rowCenter verCenter" @click="showDrawer('', 2)">补打入库标签</view>
</view>
-->
<!-- 详情 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-detail" v-if="detail">
......@@ -398,7 +399,6 @@ export default {
return false;
}
var filteredList = this.list.filter(item => this.filter_id.includes(item.stocktake_items_id));
console.log(filteredList);
if (this.filter_id.length > 1) {
//如果勾选的是多个,则显示两个单选项:按库存数量、按盘点数据
this.formParams.label_num = this.filter_id.length;
......
......@@ -2,7 +2,7 @@
<view class="stocktake-record">
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<picker @change="bindPickerChange($event, 1)" :value="index" :range="array">
<view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
......@@ -18,7 +18,8 @@
</view>
</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 curr">
<text class="label">任务ID:</text>
<text class="tt">{{ item.stocktake_items_id }}</text>
......@@ -84,7 +85,7 @@
<text class="tt">{{ item.stocktake_qty }}</text>
</view>
<template v-if="item.stocktake_status == 3">
<view class="btn row rowCenter verCenter" @click="showDrawer(item)">修改</view>
<view class="btn row rowCenter verCenter" @click="showDrawer(item, 1)">修改</view>
</template>
</view>
</view>
......@@ -93,6 +94,13 @@
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<view class="fix-btn row verCenter" v-if="list.length > 1">
<view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="showDrawer('', 2)">补打入库标签</view>
</view>
<!-- 详情 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-detail" v-if="detail">
......@@ -185,6 +193,59 @@
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="updateStocktakeItemQty()">确认</view></view>
</view>
</uni-drawer>
<!-- 补打入库标签 -->
<uni-drawer ref="showRightPrintLabel" mode="right">
<view class="uni-drawer-detail">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">补打入库标签</text>
</view>
<view class="p-text">
<text class="tt">您已选中</text>
<text class="ed">{{ filter_id.length }}</text>
<text class="tt">条数据</text>
</view>
<view class="form-input">
<view class="input-title" :class="{ mb0: filter_id.length > 1 }"><text class="input-title-t2">标签货品数量:</text></view>
<view class="input-box">
<template v-if="filter_id.length == 1">
<input type="number" inputmode="numeric" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" v-model="formParams.label_num" />
</template>
<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>
<text class="text">按库存数量</text>
</label>
<label class="uni-list-cell row verCenter">
<view><radio value="2" style="transform:scale(0.7)" color="#1969f9" /></view>
<text class="text">按盘点数量</text>
</label>
</radio-group>
</template>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t2">目标打印机:</text></view>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入目标打印机IP (比如:192.168.2.1)" v-model="formParams.ip" /></view>
</view>
<view class="form-input">
<view class="input-title">
<text class="input-title-t1">*</text>
<text class="input-title-t2">标签版本:</text>
</view>
<view class="select-box row">
<picker @change="bindPickerChange($event, 2)" :value="tag_version_index" :range="tag_version" style="width: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input">{{ tag_version_index == -1 ? '请选择' : tag_version[tag_version_index] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</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>
......@@ -205,10 +266,22 @@ export default {
hasMoreData: true, //是否分页加载
list: [],
detail: {},
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
stocktake_qty: '', //盘点数量
tag_version: ['中文标签', '英文标签'],
tag_version_index: 0,
searchParams: {
stocktake_id: '',
keyword: ''
},
formParams: {
stocktake_id: '',
stocktake_items_ids: '',
label_num: '', //标签货品数量
label_num_type: 1, //标签类型
ip: '', //目标打印机
print_language: 1 //标签版本
}
};
},
......@@ -236,7 +309,27 @@ export default {
}
},
methods: {
showDrawer(data) {
/**
* 找出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) {
......@@ -244,13 +337,69 @@ export default {
} 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();
}
},
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightPrintLabel.close();
},
bindPickerChange: function(e) {
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;
}
},
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 = [];
}
},
/**
* 清空数据
......@@ -287,6 +436,7 @@ export default {
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;
}
......@@ -323,11 +473,47 @@ export default {
});
},
/**
* 盘点标签补打
*/
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
});
}
});
},
/**
* 重置
*/
resetChange() {
this.list = [];
this.page = 1;
this.filter_id = [];
}
}
};
......
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