Commit 0a311305 by LJM

到货登记

parent d8989c37
...@@ -214,6 +214,11 @@ ...@@ -214,6 +214,11 @@
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 22rpx 22rpx 0 22rpx; padding: 22rpx 22rpx 0 22rpx;
.tip {
color: red;
font-size: 17rpx;
margin-top: 28rpx;
}
.title { .title {
position: relative; position: relative;
.iconfont { .iconfont {
...@@ -235,10 +240,30 @@ ...@@ -235,10 +240,30 @@
font-weight: bold; font-weight: bold;
margin-bottom: 17rpx; margin-bottom: 17rpx;
margin-top: 35rpx; margin-top: 35rpx;
transition: all 0.2s ease;
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 { .field-item {
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 36rpx; margin-top: 16rpx;
.item { .item {
flex: 0 0 50%; flex: 0 0 50%;
margin-bottom: 8rpx; margin-bottom: 8rpx;
...@@ -269,6 +294,7 @@ ...@@ -269,6 +294,7 @@
} }
.drawer-list { .drawer-list {
.box { .box {
position: relative;
padding: 18rpx 18rpx 0 18rpx; padding: 18rpx 18rpx 0 18rpx;
height: 94rpx; height: 94rpx;
background: #ffffff; background: #ffffff;
...@@ -293,8 +319,13 @@ ...@@ -293,8 +319,13 @@
font-size: 16rpx; font-size: 16rpx;
color: #919399; color: #919399;
} }
.t4 {
font-size: 16rpx;
color: #484b59;
}
} }
.bar { .bar {
line-height: 26rpx;
.tt { .tt {
font-size: 16rpx; font-size: 16rpx;
color: #919399; color: #919399;
...@@ -312,7 +343,7 @@ ...@@ -312,7 +343,7 @@
} }
} }
.time { .time {
margin-top: 34rpx; margin-top: 8rpx;
font-size: 16rpx; font-size: 16rpx;
color: #919399; color: #919399;
} }
......
...@@ -83,6 +83,10 @@ ...@@ -83,6 +83,10 @@
<text class="label">物流单号:</text> <text class="label">物流单号:</text>
<text class="t1">{{ item.tracking_no }}</text> <text class="t1">{{ item.tracking_no }}</text>
</view> </view>
<view class="text-item row verCenter" v-if="item.stock_in_items[0].sku_id > 0">
<text class="label" style="width: 99rpx;">自营货品ID:</text>
<text class="t1">{{ item.stock_in_items[0].sku_id }}</text>
</view>
<view class="text-item row verCenter"> <view class="text-item row verCenter">
<text class="label">采购员:</text> <text class="label">采购员:</text>
<text class="t1">{{ item.stock_in_items[0].purchase_user }}</text> <text class="t1">{{ item.stock_in_items[0].purchase_user }}</text>
...@@ -157,38 +161,105 @@ ...@@ -157,38 +161,105 @@
</view> </view>
<view class="item row verCenter" style="flex: 0 0 100%;"> <view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">供应商:</text> <text class="label">供应商:</text>
<text class="text" style="max-width: 500rpx;">{{ detail.supplier_name }}</text> <text class="tt" style="max-width: 500rpx;">{{ detail.supplier_name }}</text>
</view> </view>
</view> </view>
<view class="pp">货品详情</view> <view class="pp">
<view class="drawer-list" v-if="detail.stock_in_items"> <template v-if="detail.stock_in_items[0].sku_id > 0">
<scroll-view style="max-height: 755rpx" scroll-y="true"> <text v-for="(v, index) in item" :key="index" :class="{ curr: curr == index }" @click="tab(index, detail.stock_in_sn)">{{ v }}</text>
<view class="box" v-for="(item, index) in detail.stock_in_items" :key="index"> </template>
<view class="row bothSide vverCenter top"> <template v-else>
<text>货品信息</text>
</template>
</view>
<!-- 区分深圳自营和非深圳自营 -->
<template v-if="curr == 0">
<view class="drawer-list" v-if="detail.stock_in_items">
<scroll-view style="max-height: 755rpx" scroll-y="true">
<view class="box" v-for="(item, index) in detail.stock_in_items" :key="index">
<view class="row bothSide vverCenter top">
<view class="row verCenter">
<text class="t1">{{ index + 1 }}.</text>
<text class="t2">{{ item.goods_name }}</text>
</view>
<text class="t3">销售员:{{ item.sale_user }}</text>
</view>
<view class="row verCenter"> <view class="row verCenter">
<text class="t1">{{ index + 1 }}.</text> <view class="bar row verCenter" style="width: 40%;">
<text class="t2">{{ item.goods_name }}</text> <text class="tt">标准品牌:</text>
<text class="yy">{{ item.brand_name }}</text>
</view>
<view class="bar row verCenter" style="width: 20%;">
<text class="tt">数量:</text>
<text class="yy">{{ item.expect_qty }}</text>
</view>
<view class="bar row verCenter" style="width: 40%;">
<text class="tt">入仓号:</text>
<text class="yy">{{ item.inhouse }}</text>
</view>
</view> </view>
<text class="t3">销售员:{{ item.sale_user }}</text>
</view> </view>
<view class="row verCenter"> </scroll-view>
<view class="bar row verCenter" style="width: 40%;"> </view>
<text class="tt">标准品牌:</text> <view class="time">创建时间:{{ detail.create_time_cn }}</view>
<text class="yy">{{ item.brand_name }}</text> </template>
<template v-else>
<view class="drawer-list" v-if="zyGoodsData">
<scroll-view style="max-height: 755rpx" scroll-y="true">
<view class="box" v-for="(item, index) in zyGoodsData" :key="index" style="padding: 18rpx 18rpx 10rpx 24rpx;height: auto;">
<view class="row bothSide vverCenter top">
<view class="row verCenter">
<text class="t1" style="position: absolute;left: 2px;">{{ index + 1 }}.</text>
<text class="t3">自营商品ID:</text>
<text class="t4" style="font-weight: normal;">{{ item.sku_id }}</text>
</view>
</view> </view>
<view class="bar row verCenter" style="width: 20%;"> <view class="row verCenter">
<text class="tt">数量:</text> <view class="bar row verCenter" style="width: 50%;">
<text class="yy">{{ item.expect_qty }}</text> <text class="tt">货品名称:</text>
<text class="yy">{{ item.goods_name }}</text>
</view>
<view class="bar row verCenter" style="width: 50%;">
<text class="tt">标准品牌:</text>
<text class="yy">{{ item.brand_name }}</text>
</view>
</view> </view>
<view class="bar row verCenter" style="width: 40%;"> <view class="row verCenter">
<text class="tt">入仓号:</text> <view class="bar row verCenter" style="width: 50%;">
<text class="yy">{{ item.inhouse }}</text> <text class="tt">包装方式:</text>
<text class="yy">{{ item.packing_cn }}</text>
</view>
<view class="bar row verCenter" style="width: 50%;">
<text class="tt">标准包装量:</text>
<text class="yy">{{ item.mpq }}</text>
</view>
</view>
<view class="row verCenter">
<view class="bar row verCenter" style="width: 100%;">
<text class="tt">标准包装长宽高:</text>
<text class="yy">{{ item.standard_length }}&nbsp;*&nbsp;{{ item.standard_width }}&nbsp;*&nbsp;{{ item.standard_high }}</text>
</view>
</view>
<view class="row verCenter">
<view class="bar row verCenter" style="width: 50%;">
<text class="tt">标准包装净重:</text>
<text class="yy">{{ item.standard_net_weight }}</text>
</view>
<view class="bar row verCenter" style="width: 50%;">
<text class="tt">标准包装毛重:</text>
<text class="yy">{{ item.standard_gross_weight }}</text>
</view>
</view>
<view class="row verCenter">
<view class="bar row verCenter" style="width: 100%;">
<text class="tt">其 他 属 性:</text>
<text class="yy">{{ item.picking_other_attr }}</text>
</view>
</view> </view>
</view> </view>
</view> </scroll-view>
</scroll-view> </view>
</view> </template>
<view class="time">创建时间:{{ detail.create_time_cn }}</view>
<view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="addStockInRegister(2, detail.stock_in_id)">到货登记</view></view> <view class="btn row rowCenter verCenter"><view class="row btn1 row rowCenter verCenter" style="width:100%" @click="addStockInRegister(2, detail.stock_in_id)">到货登记</view></view>
</view> </view>
</uni-drawer> </uni-drawer>
...@@ -232,6 +303,38 @@ ...@@ -232,6 +303,38 @@
</view> </view>
</view> </view>
</uni-drawer> </uni-drawer>
<!--到货登记(自营) -->
<uni-drawer ref="showRightZyGoodsDat" mode="right">
<view class="uni-drawer-layer" v-if="zyGoodsData">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">到货登记</text>
</view>
<view class="tip">共有 {{ zyGoodsData.length }} 个货品为第一次入库,请确认物料信息!</view>
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">自营货品ID:</text>
<text class="tt">{{ zyGoodsData[0].sku_id }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">入库单号:</text>
<text class="tt">L-ASN2202270001</text>
</view>
<view class="item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">ASD5A4S5D4ASDSA</text>
</view>
<view class="item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">TI</text>
</view>
</view>
<view class="btn row rowCenter verCenter">
<view class="btn2 row rowCenter verCenter" @click="closeDrawer()" style="width: 50%;">关 闭</view>
<view class="row btn1 row rowCenter verCenter" style="width:50%" @click="addStockInRegister(2, detail.stock_in_id)">到货登记</view>
</view>
</view>
</uni-drawer>
</view> </view>
</template> </template>
...@@ -251,10 +354,15 @@ export default { ...@@ -251,10 +354,15 @@ export default {
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
filter_id_warehouse_id: [], //过滤处理的仓库id
filter_id_stock_in_sn: [], //过滤处理的入库单号
detail: {}, //详情的数据 detail: {}, //详情的数据
warehouse_id_index: 0, warehouse_id_index: 0,
warehouse_id_data: [], warehouse_id_data: [],
hasMoreData: true, //是否分页加载 hasMoreData: true, //是否分页加载
curr: 0,
item: ['货品信息', '其他信息'],
zyGoodsData: [], //自营货品信息
searchParams: { searchParams: {
create_time_begin: '', create_time_begin: '',
create_time_end: '', create_time_end: '',
...@@ -293,9 +401,30 @@ export default { ...@@ -293,9 +401,30 @@ export default {
this.getData(); this.getData();
}, },
methods: { 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);
}
},
radioChange(e) { radioChange(e) {
this.index = e.detail.value; this.index = e.detail.value;
}, },
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
} else {
this.index = e.detail.value;
}
},
/** /**
* 时间选择 * 时间选择
*/ */
...@@ -334,6 +463,16 @@ export default { ...@@ -334,6 +463,16 @@ export default {
return result; 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);
},
/**
* 获取仓库 * 获取仓库
*/ */
getWareHouselist() { getWareHouselist() {
...@@ -355,12 +494,20 @@ export default { ...@@ -355,12 +494,20 @@ export default {
}); });
}, },
/** /**
* 筛选过滤出选中的元素 * @param {Object} stock_in_sn 入库单号
*
*/ */
filterChange(index) { getZyGoodsData(stock_in_sn) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index])); this.request(API.getZyGoodsData, 'GET', { stock_in_sn: stock_in_sn, is_first_check: 1 }, true).then(res => {
let filter_arr = this.findIndex(this.filter_list, true); if (res.code === 0) {
this.filter_id = filter_arr.map(i => this.list[i].stock_in_id); this.zyGoodsData = res.data;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}, },
/** /**
* 全选 * 全选
...@@ -525,46 +672,74 @@ export default { ...@@ -525,46 +672,74 @@ export default {
stock_in_id[0] = id; stock_in_id[0] = id;
} }
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => { 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;
}
//先判断一下自营货品信息
this.request(API.getZyGoodsData, 'GET', { stock_in_sn: this.filter_id_stock_in_sn.join(','), is_first_check: 1 }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ if (res.data.length > 0) {
title: '登记成功', this.showDrawer(decodeURIComponent(this.filter_id_stock_in_sn.join(',')), 1);
icon: 'success' } else {
}); this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
setTimeout(() => { if (res.code === 0) {
this.resetChange(); uni.showToast({
this.getData(); title: '登记成功',
this.closeDrawer(); icon: 'success'
this.filter_id = []; });
}, 2000); setTimeout(() => {
this.resetChange();
this.getData();
this.closeDrawer();
this.filter_id = [];
this.filter_id_warehouse_id = [];
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
} else { } else {
uni.showModal({ uni.showModal({
itle: '提示', title: '提示',
content: res.msg, content: res.msg,
showCancel: false showCancel: false
}); });
} }
}); });
}, },
bindPickerChange: function(e, type) { /**
console.log('picker发送选择改变,携带值为', e.detail.value); * @param {Object} stock_in_sn
if (type == 1) { */
this.warehouse_id_index = e.detail.value; showDrawer(stock_in_sn, type) {
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value; this.curr = 0;
//区分深圳自营和非深圳自营
if (type) {
this.getZyGoodsData(stock_in_sn);
this.$refs.showRightZyGoodsDat.open();
} else { } else {
this.index = e.detail.value; this.getDetail(stock_in_sn);
this.$refs.showRight.open();
} }
}, },
showDrawer(stock_in_sn) {
this.$refs.showRight.open();
this.getDetail(stock_in_sn);
},
showDrawers() { showDrawers() {
this.$refs.showRightAdd.open(); this.$refs.showRightAdd.open();
}, },
closeDrawer() { closeDrawer() {
this.$refs.showRight.close(); this.$refs.showRight.close();
this.$refs.showRightAdd.close(); this.$refs.showRightAdd.close();
this.$refs.showRightZyGoodsDat.close();
}, },
/** /**
* 重置 * 重置
......
...@@ -323,9 +323,9 @@ export default { ...@@ -323,9 +323,9 @@ export default {
limit: 1, limit: 1,
index: 0, index: 0,
curr: 0, curr: 0,
item: ['货品信息', '其他信息'],
print_style: ['基本样式', '不带D/C'], print_style: ['基本样式', '不带D/C'],
print_style_index: 0, print_style_index: 0,
item: ['货品信息', '其他信息'],
indexContainer: -1, indexContainer: -1,
array: ['物流单号', '入库单号', '入仓号'], array: ['物流单号', '入库单号', '入仓号'],
tallyContainer: [], //容器列表 tallyContainer: [], //容器列表
......
...@@ -260,6 +260,10 @@ const API = { ...@@ -260,6 +260,10 @@ const API = {
* */ * */
getWareHouselist: API_BASE + '/api/warehouse/getWareHouselist', getWareHouselist: API_BASE + '/api/warehouse/getWareHouselist',
/** /**
* 获取自营货品信息
* */
getZyGoodsData: API_BASE + '/api/stockIn/stockInDetail/getZyGoodsData',
/**
* 库存查询 * 库存查询
* */ * */
searchStockList: API_BASE + '/api/h5/stockIn/searchStockList', searchStockList: API_BASE + '/api/h5/stockIn/searchStockList',
......
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