Commit 0a311305 by LJM

到货登记

parent d8989c37
......@@ -214,6 +214,11 @@
width: 100%;
background-color: #ffffff;
padding: 22rpx 22rpx 0 22rpx;
.tip {
color: red;
font-size: 17rpx;
margin-top: 28rpx;
}
.title {
position: relative;
.iconfont {
......@@ -235,10 +240,30 @@
font-weight: bold;
margin-bottom: 17rpx;
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 {
flex-wrap: wrap;
margin-top: 36rpx;
margin-top: 16rpx;
.item {
flex: 0 0 50%;
margin-bottom: 8rpx;
......@@ -269,6 +294,7 @@
}
.drawer-list {
.box {
position: relative;
padding: 18rpx 18rpx 0 18rpx;
height: 94rpx;
background: #ffffff;
......@@ -293,8 +319,13 @@
font-size: 16rpx;
color: #919399;
}
.t4 {
font-size: 16rpx;
color: #484b59;
}
}
.bar {
line-height: 26rpx;
.tt {
font-size: 16rpx;
color: #919399;
......@@ -312,7 +343,7 @@
}
}
.time {
margin-top: 34rpx;
margin-top: 8rpx;
font-size: 16rpx;
color: #919399;
}
......
......@@ -83,6 +83,10 @@
<text class="label">物流单号:</text>
<text class="t1">{{ item.tracking_no }}</text>
</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">
<text class="label">采购员:</text>
<text class="t1">{{ item.stock_in_items[0].purchase_user }}</text>
......@@ -157,10 +161,19 @@
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<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 class="pp">
<template v-if="detail.stock_in_items[0].sku_id > 0">
<text v-for="(v, index) in item" :key="index" :class="{ curr: curr == index }" @click="tab(index, detail.stock_in_sn)">{{ v }}</text>
</template>
<template v-else>
<text>货品信息</text>
</template>
</view>
<view class="pp">货品详情</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">
......@@ -189,6 +202,64 @@
</scroll-view>
</view>
<view class="time">创建时间:{{ detail.create_time_cn }}</view>
</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 class="row verCenter">
<view class="bar row verCenter" style="width: 50%;">
<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 class="row verCenter">
<view class="bar row verCenter" style="width: 50%;">
<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>
</scroll-view>
</view>
</template>
<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>
</uni-drawer>
......@@ -232,6 +303,38 @@
</view>
</view>
</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>
</template>
......@@ -251,10 +354,15 @@ export default {
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,
item: ['货品信息', '其他信息'],
zyGoodsData: [], //自营货品信息
searchParams: {
create_time_begin: '',
create_time_end: '',
......@@ -293,9 +401,30 @@ export default {
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);
}
},
radioChange(e) {
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 {
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() {
......@@ -355,12 +494,20 @@ export default {
});
},
/**
* 筛选过滤出选中的元素
* @param {Object} stock_in_sn 入库单号
*
*/
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);
getZyGoodsData(stock_in_sn) {
this.request(API.getZyGoodsData, 'GET', { stock_in_sn: stock_in_sn, is_first_check: 1 }, true).then(res => {
if (res.code === 0) {
this.zyGoodsData = res.data;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 全选
......@@ -525,6 +672,22 @@ export default {
stock_in_id[0] = id;
}
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.data.length > 0) {
this.showDrawer(decodeURIComponent(this.filter_id_stock_in_sn.join(',')), 1);
} else {
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(stock_in_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
......@@ -536,6 +699,7 @@ export default {
this.getData();
this.closeDrawer();
this.filter_id = [];
this.filter_id_warehouse_id = [];
}, 2000);
} else {
uni.showModal({
......@@ -545,19 +709,29 @@ export default {
});
}
});
},
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;
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
showDrawer(stock_in_sn) {
this.$refs.showRight.open();
/**
* @param {Object} stock_in_sn
*/
showDrawer(stock_in_sn, type) {
this.curr = 0;
//区分深圳自营和非深圳自营
if (type) {
this.getZyGoodsData(stock_in_sn);
this.$refs.showRightZyGoodsDat.open();
} else {
this.getDetail(stock_in_sn);
this.$refs.showRight.open();
}
},
showDrawers() {
this.$refs.showRightAdd.open();
......@@ -565,6 +739,7 @@ export default {
closeDrawer() {
this.$refs.showRight.close();
this.$refs.showRightAdd.close();
this.$refs.showRightZyGoodsDat.close();
},
/**
* 重置
......
......@@ -323,9 +323,9 @@ export default {
limit: 1,
index: 0,
curr: 0,
item: ['货品信息', '其他信息'],
print_style: ['基本样式', '不带D/C'],
print_style_index: 0,
item: ['货品信息', '其他信息'],
indexContainer: -1,
array: ['物流单号', '入库单号', '入仓号'],
tallyContainer: [], //容器列表
......
......@@ -260,6 +260,10 @@ const API = {
* */
getWareHouselist: API_BASE + '/api/warehouse/getWareHouselist',
/**
* 获取自营货品信息
* */
getZyGoodsData: API_BASE + '/api/stockIn/stockInDetail/getZyGoodsData',
/**
* 库存查询
* */
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