Commit a56b497b by LJM

分货

parent ca26039a
......@@ -92,8 +92,8 @@
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
border: 1px solid #c6c7cc;
margin-bottom: 15rpx;
border: 1px solid transparent;
.check-box-icon {
position: absolute;
right: 18rpx;
......@@ -115,25 +115,28 @@
width: 100%;
}
.t1 {
font-size: 20rpx;
color: #292b33;
font-weight: bold;
min-width: 32rpx;
font-size: 18rpx;
color: #919399;
}
.t2 {
width: 100rpx;
font-size: 17rpx;
min-width: 100rpx;
font-size: 18rpx;
color: #1969f9;
font-weight: bold;
margin-left: 30rpx;
margin-left: 5rpx;
}
.t3 {
font-size: 20rpx;
font-size: 18rpx;
color: #292b33;
font-weight: bold;
margin-left: 8rpx;
max-width: 340rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.t4 {
font-size: 16rpx;
font-size: 18rpx;
color: #919399;
margin-right: 47rpx;
}
......
......@@ -9,38 +9,38 @@
<text class="tt">全量搜索</text>
</label>
<label class="radio">
<radio value="2" style="transform:scale(0.7)" color="#1969F9" />
<radio value="1" 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 class="total-text" v-if="list.length > 0"><text>{{total}}</text>条数据</view>
</view>
<view class="search-all-box row verCenter">
<view class="row verCenter">
<view class="row verCenter" style="width: 90%;">
<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)" />
<input class="uni-input" placeholder="请扫描或输入物流单号" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(1, $event)" maxlength="-1" />
</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)" />
<input class="uni-input" placeholder="请输入FedEx" placeholder-style="color:#919399" :focus="is_focus" v-model="searchParams.shipment_number" @input="handleInput(2, $event)" maxlength="-1" />
</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="box row" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }" @click="filterChange(index)">
<view class="check-box-icon"></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>
<text class="t2">{{item.warehouse_receipt_sn}}</text>
<text class="t3">{{item.shipping_name}}:{{item.shipment_number}}</text>
</view>
<text class="t4">采购员:张三</text>
<text class="t4">{{item.purchase_name}}</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>
......@@ -56,7 +56,7 @@
<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 class="btn2 row rowCenter verCenter" @click="print()">打印入仓号</view>
</view>
</view>
</template>
......@@ -74,46 +74,23 @@
input_flag: false,
total: 0, //总数
page: 1,
limit: 30,
limit: 100,
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;
curr: 0,
searchParams: {
shipment_number: '' //物流单号
}
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
*/
......@@ -140,9 +117,7 @@
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);
this.filter_id = filter_arr.map(i => this.list[i].warehouse_receipt_sn);
},
/**
* 全选
......@@ -152,7 +127,7 @@
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;
return item.warehouse_receipt_sn;
});
} else {
this.filter_id = [];
......@@ -161,27 +136,10 @@
/**
* 清空数据
*/
clearInput(type) {
clearInput() {
this.searchParams.shipment_number = '';
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(); //再次获取焦点
}
this.clearInputAndFocus();
},
/**
* 单号搜索
......@@ -190,34 +148,18 @@
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;
this.searchParams.shipment_number = 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;
this.searchParams.shipment_number = last22;
} else {
this.searchParams.tracking_no = val;
this.searchParams.shipment_number = val;
}
} else if (type == 4) {
this.searchParams.box_sn = val;
}
this.input_flag = true;
} else {
......@@ -229,12 +171,12 @@
* 获取列表数据
*/
getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, true).then(res => {
this.request(API.getShipmentList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, true).then(res => {
if (res.code === 0) {
if (res.data.list.length > 0) {
this.total = res.data.total;
if (res.data.length > 0) {
this.total = res.data.length;
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
this.list = this.list.concat(res.data);
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
......@@ -253,37 +195,17 @@
print() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择入仓号',
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));
var ids = Array.from(new Set(this.filter_id));
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 => {
this.request(API.printInhouse, 'POST', { inhouse_str: ids.join(','), user_email: this.user_email, warehouse_id: 10 }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '打印成功',
......
......@@ -28,6 +28,10 @@ const API = {
* */
stockInMobileRegisterList: API_BASE + '/api/stockIn/stockInRegister/stockInMobileRegisterList',
/**
* 根据物流单号获取物流信息
* */
getShipmentList: API_BASE + '/open/stockIn/getShipmentList',
/**
* 新增到货记录
* */
addStockInRegister: API_BASE + '/api/stockIn/stockInRegister/addStockInRegister',
......
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