Commit ca26039a by LJM

移动端--增加功能模块--分货查询

parent e25d2ff3
.splitGoods {
padding: 15rpx 22rpx;
.radio-search-box {
height: 57rpx;
.total-text {
font-size: 16rpx;
color: #919399;
text {
padding: 0 5rpx;
color: #1969f9;
}
}
}
.search-all-box {
height: 60rpx;
padding-left: 17rpx;
background: #ffffff;
border-radius: 10rpx;
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
}
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
width: 60rpx;
text-align: center;
}
.uni-input {
width: 465rpx;
font-size: 18rpx;
color: #484b59;
margin-left: 13rpx;
}
}
.print-btn {
font-size: 24rpx;
color: #1969f9;
}
.search-box {
height: 60rpx;
.search-box-wrap {
width: 80%;
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;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
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;
flex-wrap: wrap;
.box {
position: relative;
width: 100%;
padding: 18rpx 18rpx 18rpx 18rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
border: 1px solid #c6c7cc;
margin-bottom: 15rpx;
.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;
}
}
.wrap {
width: 100%;
}
.t1 {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
}
.t2 {
width: 100rpx;
font-size: 17rpx;
color: #1969f9;
font-weight: bold;
margin-left: 30rpx;
}
.t3 {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-left: 8rpx;
}
.t4 {
font-size: 16rpx;
color: #919399;
margin-right: 47rpx;
}
}
}
.fix-btn {
position: fixed;
bottom: 0;
width: 100%;
height: 75rpx;
left: 0;
.btn1 {
width: 128rpx;
height: 75rpx;
background: #ffffff;
border-right: 1px solid #f0f0f2;
.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;
font-weight: bold;
}
}
}
::v-deep .uni-drawer__content {
width: 85% !important;
}
.uni-drawer-layer {
width: 100%;
background-color: #ffffff;
padding: 22rpx 22rpx 0 22rpx;
.tip {
color: red;
font-size: 17rpx;
margin-top: 28rpx;
}
.title {
position: relative;
.iconfont {
position: absolute;
left: 0;
top: 0;
font-size: 30rpx;
color: #292b33;
}
.text {
font-size: 23rpx;
color: #292b33;
font-weight: bold;
}
}
.pp {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-bottom: 17rpx;
margin-top: 35rpx;
transition: all 0.2s ease;
&.pt {
margin-bottom: 35rpx;
}
text:first-child {
margin-right: 32rpx;
}
.curr {
position: relative;
color: #1969f9;
font-weight: bold;
&::after {
content: '';
background-color: #1969f9;
width: 51%;
height: 2px;
position: absolute;
bottom: -10rpx;
left: 0;
right: 0;
margin: 0 auto;
}
}
}
.field-item {
flex-wrap: wrap;
margin-top: 16rpx;
.item {
flex: 0 0 50%;
margin-bottom: 8rpx;
.label {
font-size: 16rpx;
color: #919399;
white-space: nowrap;
}
.text {
font-size: 16rpx;
color: #1969f9;
margin-left: 6rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 176rpx;
}
.tt {
font-size: 17rpx;
color: #484b59;
margin-left: 6rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 176rpx;
}
}
}
.drawer-list {
.box {
position: relative;
padding: 18rpx 18rpx 18rpx 18rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
border: 1px solid #c6c7cc;
margin-bottom: 15rpx;
.top {
margin-bottom: 10rpx;
.t1 {
font-size: 17rpx;
color: #1969f9;
font-weight: bold;
}
.t2 {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
margin-left: 8rpx;
}
.t3 {
font-size: 16rpx;
color: #919399;
}
.t4 {
font-size: 16rpx;
color: #484b59;
}
}
.bar {
line-height: 26rpx;
.tt {
font-size: 16rpx;
color: #919399;
white-space: nowrap;
}
.yy {
max-width: 55%;
font-size: 16rpx;
color: #484b59;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
}
.time {
margin-top: 8rpx;
font-size: 16rpx;
color: #919399;
}
.btn {
position: absolute;
bottom: 0;
left: 0;
right: 0;
width: 100%;
.btn1 {
height: 75rpx;
background: #1969f9;
font-size: 23rpx;
color: #ffffff;
}
.btn2 {
height: 75rpx;
background: #ffe0d7;
font-size: 23rpx;
color: #ff3700;
font-weight: bold;
}
}
.tip-box {
margin-top: 36rpx;
margin-bottom: 23rpx;
height: 60rpx;
background: #fff5ec;
border-radius: 30rpx 30rpx 30rpx 30rpx;
.iconfont {
font-size: 30rpx;
color: #f98119;
margin-left: 23rpx;
}
.tt {
margin-left: 12rpx;
font-size: 20rpx;
color: #f98119;
}
}
.input-wrap {
margin-bottom: 25rpx;
.label-title {
font-size: 20rpx;
color: #484b59;
font-weight: bold;
margin-bottom: 10rpx;
}
.input-box {
.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;
}
.uni-input {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
.uni-textarea {
width: 100%;
height: 110rpx;
background: #ffffff;
border-radius: 10px;
border: 1px solid #1969f9;
font-size: 17rpx;
padding: 18rpx;
}
}
.sel-box {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
.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-right: 12rpx;
}
}
}
.uni-swiper-wrap {
margin-top: 15rpx;
.uni-swiper-input {
margin-bottom: 15rpx;
.label {
width: 24%;
font-size: 16rpx;
color: #919399;
&.required:before {
content: ' *';
color: red;
}
}
.select-box {
position: relative;
width: 76%;
height: 45rpx;
.uni-arrow {
position: absolute;
right: 14rpx;
width: 14rpx;
height: 9rpx;
background: url('https://img.ichunt.com/images/ichunt/202304/10/e4c72319ad41ce1425f71cc6ec35f111.png') no-repeat center;
background-size: contain;
}
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
}
.input-box {
position: relative;
width: 76%;
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
}
}
.uni-swiper-input-multipl {
margin-bottom: 15rpx;
.label {
width: 24%;
.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-right: 10rpx;
}
.uni-input {
font-size: 17rpx;
}
}
.multipl-input {
width: 76%;
.uni-input {
width: 100%;
height: 45rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
font-size: 17rpx;
padding-left: 18rpx;
}
.timesSymbol {
padding: 0 14rpx;
font-size: 24rpx;
color: #292b33;
font-weight: bold;
}
.unit {
margin-left: 10rpx;
color: #919399;
font-size: 25rpx;
}
}
}
}
.swiper {
height: 790rpx;
}
}
...@@ -418,6 +418,11 @@ ...@@ -418,6 +418,11 @@
} }
} }
} }
}, {
"path": "pages/arrivalRegister/splitGoods",
"style": {
"navigationBarTitleText": "分货"
}
}], }],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
<template>
<view class="splitGoods">
<!-- 全量搜索 -->
<view class="radio-search-box row verCenter bothSide">
<view class="row verCente">
<radio-group @change="radioChange" class="row verCenter">
<label class="radio row verCenter">
<radio value="0" checked="true" style="transform:scale(0.7)" color="#1969F9" />
<text class="tt">全量搜索</text>
</label>
<label class="radio">
<radio value="2" style="transform:scale(0.7)" color="#1969F9" />
<text class="tt">FedEX</text>
</label>
</radio-group>
</view>
<view class="total-text"><text>{{total}}</text>条数据</view>
</view>
<view class="search-all-box row 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>
<!-- fedex -->
<template v-else-if="index == 1">
<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 class="list row bothSide" v-if="list.length > 0">
<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="wrap row verCenter bothSide">
<view class="row verCenter">
<text class="t1">{{index+1}}.</text>
<text class="t2">B315456</text>
<text class="t3">顺丰速运:SF12564564574878</text>
</view>
<text class="t4">采购员:张三</text>
</view>
</view>
<view class="row rowCenter verCenter" v-if="!hasMoreData && page > 1" style="color: #999;font-size: 16rpx;padding: 10px 0;flex: 0 0 100%;font-weight: normal;">--&nbsp;已经到底了&nbsp;--</view>
</view>
<!-- 无数据展示 -->
<view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<!-- 底部按钮bar部分 -->
<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>
<text class="text">{{ filter_id.length == 0 ? '全选' : filter_id.length }}</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="addStockInRegister(1)">打印入仓号</view>
</view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
user_email: uni.getStorageSync('name'),
is_focus: true, //获取焦点动态化
input_flag: false,
total: 0, //总数
page: 1,
limit: 30,
index: 0,
array: ['全量搜索', 'FedEx'],
list: [],
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
filter_id_warehouse_id: [], //过滤处理的仓库id
filter_id_stock_in_sn: [], //过滤处理的入库单号
detail: {}, //详情的数据
warehouse_id_index: 0,
warehouse_id_data: [],
hasMoreData: true, //是否分页加载
curr: 0
};
},
onReachBottom() {
if (!this.hasMoreData) {
return;
}
this.page++;
this.getData();
},
onShow() {
this.resetChange();
this.getData();
},
methods: {
/**
* @param {Object} index
* @param {Object} stock_in_sn 入库单号
* tab切换
*/
tab(index, stock_in_sn) {
this.curr = index;
if (index == 1) {
//获取自营货品信息
this.getZyGoodsData(stock_in_sn, 1);
}
},
/**
* 搜索条件切换
* @param {Object} e
*/
radioChange(e) {
this.index = e.detail.value;
},
/**
* 找出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].stock_in_id);
this.filter_id_warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
this.filter_id_stock_in_sn = filter_arr.map(i => this.list[i].stock_in_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.stock_in_id;
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput(type) {
this.resetChange();
if (type == 'start') {
//清除起始时间
this.searchParams.create_time_begin = '';
if (this.searchParams.mobile_register_all_search || this.searchParams.stock_in_with_stock_in_items_inhouse || this.searchParams.tracking_no || this.searchParams.box_sn) {
this.getData();
}
} else if (type == 'end') {
//清除结束时间
this.searchParams.create_time_end = '';
if (this.searchParams.mobile_register_all_search || this.searchParams.stock_in_with_stock_in_items_inhouse || this.searchParams.tracking_no || this.searchParams.box_sn) {
this.getData();
}
} else {
// 清除搜索条件
const fields = ['mobile_register_all_search', 'stock_in_with_stock_in_items_inhouse', 'tracking_no', 'box_sn'];
this.searchParams[fields[this.index]] = '';
this.input_flag = false;
this.clearInputAndFocus(); //再次获取焦点
}
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, event) {
var val = event.target.value;
this.resetChange();
this.searchParams.mobile_register_all_search = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
this.searchParams.tracking_no = '';
this.searchParams.box_sn = '';
if (val) {
if (type == 1) {
//全量搜索
this.searchParams.mobile_register_all_search = val;
} else if (type == 2) {
// 入仓号处理逻辑
var str = val;
if (str.startsWith('F')) {
// 如果以 'F' 开头,直接赋值给搜索参数
this.searchParams.stock_in_with_stock_in_items_inhouse = val;
} else {
// 否则去掉最后一个字符后赋值给搜索参数
this.searchParams.stock_in_with_stock_in_items_inhouse = str.slice(0, -1);
}
} else if (type == 3) {
//FedEx
if (val.length > 22) {
let last22 = val.slice(22); // 截取后22位
this.searchParams.tracking_no = last22;
} else {
this.searchParams.tracking_no = val;
}
} else if (type == 4) {
this.searchParams.box_sn = val;
}
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.total = res.data.total;
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'
});
}
});
},
/**
* 打印入仓号
*/
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'
});
}
});
},
/**
* 重置
*/
resetChange() {
this.filter_id = [];
this.list = [];
this.page = 1;
},
/**
* 再次获取焦点
*/
clearInputAndFocus() {
this.input_flag = false; //关闭叉叉
this.is_focus = false;
setTimeout(() => {
this.is_focus = true;
}, 200);
}
}
};
</script>
<style scoped lang="scss">
@import '@/assets/css/arrivalRegister/splitGoods.scss';
</style>
\ No newline at end of file
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
</view> </view>
<text class="text">标签补打</text> <text class="text">标签补打</text>
</navigator> </navigator>
<navigator class="box-li column rowCenter verCenter" url="/pages/arrivalRegister/splitGoods" hover-class="none">
<view class="box row rowCenter verCenter">
<image src="/static/home/@2x(5).png"></image>
</view>
<text class="text">分货</text>
</navigator>
</view> </view>
</view> </view>
</template> </template>
......
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