Commit 200cffbe by LJM

到货登记

parent 3f15e2e9
......@@ -434,4 +434,96 @@
}
}
}
.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;
}
}
......@@ -299,7 +299,7 @@
</view>
<view class="row bothSide btn">
<view class="btn2 row rowCenter verCenter" @click="closeDrawer()" style="width: 50%;">关 闭</view>
<view class="btn1 row rowCenter verCenter" @click="addStockInRegisterSubmit()" style="width:50%;">登记</view>
<view class="btn1 row rowCenter verCenter" @click="withoutTrackingNumberRecord()" style="width:50%;">登记</view>
</view>
</view>
</uni-drawer>
......@@ -311,27 +311,139 @@
<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>
<swiper class="swiper" @change="swiperChange" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
<swiper-item v-for="(item, index) in zyGoodsData" :key="index">
<view class="swiper-item">
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">自营货品ID:</text>
<text class="tt">{{ item.sku_id }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">入库单号:</text>
<text class="tt">{{ item.stock_in_sn }}</text>
</view>
<view class="item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">{{ item.goods_name }}</text>
</view>
<view class="item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">{{ item.brand_name }}</text>
</view>
</view>
<view class="uni-swiper-wrap">
<!-- 包装方式 -->
<view class="uni-swiper-input row verCenter bothSide">
<text class="label required">包装方式:</text>
<view class="select-box row verCenter">
<picker @change="bindPickerZYChange($event, 1, index)" :value="saveZyGoodsParams[index].packing" :range="packingSet" :range-key="'name'" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter">{{ saveZyGoodsParams[index].packing == 0 ? '请选择' : packingSet[saveZyGoodsParams[index].packing - 5].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 标准包装量 -->
<view class="uni-swiper-input row verCenter bothSide">
<text class="label required">标准包装量:</text>
<view class="input-box row verCenter"><input type="number" inputmode="numeric" class="uni-input" v-model="saveZyGoodsParams[index].mpq" /></view>
</view>
<!-- 拣货方式 -->
<view class="uni-swiper-input row verCenter bothSide">
<text class="label required">拣货方式:</text>
<view class="select-box row verCenter">
<picker @change="bindPickerZYChange($event, 2)" :value="saveZyGoodsParams[index].picking_mode" :range="pickingModeSet" :range-key="'name'" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter">{{ saveZyGoodsParams[index].picking_mode == 0 ? '请选择' : pickingModeSet[saveZyGoodsParams[index].picking_mode - 1].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 标准包装长宽高 -->
<view class="uni-swiper-input-multipl row verCenter bothSide">
<view class="label row">
<picker @change="bindPickerZYChange($event, 3)" :value="standardSizeIndex" :range="standardSize" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter" style="color: #919399;">{{ standardSizeIndex == -1 ? '请选择' : standardSize[standardSizeIndex] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="multipl-input row verCenter bothSide">
<view class="row verCenter">
<input type="text" class="uni-input" placeholder="长" style="width: 100rpx;" v-model="saveZyGoodsParams[index].standard_length" />
<text class="timesSymbol"></text>
<input type="text" class="uni-input" placeholder="宽" style="width: 100rpx;" v-model="saveZyGoodsParams[index].standard_width" />
<text class="timesSymbol"></text>
<input type="text" class="uni-input" placeholder="高" style="width: 100rpx;" v-model="saveZyGoodsParams[index].standard_high" />
</view>
<view class="multipl-input-select row"><text class="unit">cm</text></view>
</view>
</view>
<!-- 标准包净重 -->
<view class="uni-swiper-input-multipl row verCenter bothSide">
<view class="label row">
<picker @change="bindPickerZYChange($event, 5)" :value="netWeightIndex" :range="netWeight" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter" style="color: #919399;">{{ netWeight[netWeightIndex] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="multipl-input row verCenter">
<view class="row verCenter" style="width: 86%;"><input type="text" class="uni-input" placeholder="净重" v-model="saveZyGoodsParams[index].standard_net_weight" /></view>
<view class="multipl-input-select row">
<picker @change="bindPickerZYChange($event, 6)" :value="netWeightSizeIndex" :range="netWeightSize" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row rowCenter verCenter" style="padding-left: 9rpx;padding-right: 9rpx;border-left: none;width: 80rpx;">{{ netWeightSize[netWeightSizeIndex] }}</view>
</view>
</picker>
</view>
</view>
</view>
<!-- 标准包毛重 -->
<view class="uni-swiper-input-multipl row verCenter bothSide">
<view class="label row">
<picker @change="bindPickerZYChange($event, 7)" :value="grossWeightIndex" :range="grossWeight" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter" style="color: #919399;">{{ grossWeight[grossWeightIndex] }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
<view class="multipl-input row verCenter">
<view class="row verCenter" style="width:86%;"><input type="text" class="uni-input" placeholder="毛重" v-model="saveZyGoodsParams[index].standard_gross_weight" /></view>
<view class="multipl-input-select row">
<picker @change="bindPickerZYChange($event, 8)" :value="grossWeightSizeIndex" :range="grossWeightSize" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row rowCenter verCenter" style="padding-left: 9rpx;padding-right: 9rpx;border-left: none;width: 80rpx;">{{ grossWeightSize[grossWeightSizeIndex] }}</view>
</view>
</picker>
</view>
</view>
</view>
<view class="uni-swiper-input row verCenter bothSide">
<text class="label">其他属性:</text>
<view class="select-box row verCenter">
<picker @change="bindPickerZYChange($event, 9, index)" :value="saveZyGoodsParams[index].picking_other_attr_index" :range="otherAttrList" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input row verCenter">{{ saveZyGoodsParams[index].picking_other_attr_index == '' ? '请选择' : saveZyGoodsParams[index].picking_other_attr }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
</view>
<view class="status-num row rowCenter verCenter" style="color: #1969f9;font-size: 23rpx;margin-top: 20rpx;">{{ swiperCurr + 1 }}/{{ zyGoodsData.length }}</view>
</view>
</swiper-item>
</swiper>
<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 class="row btn1 row rowCenter verCenter" style="width:50%" @click="saveZyGoodsDataSubmit()">到货登记</view>
</view>
</view>
</uni-drawer>
......@@ -346,6 +458,10 @@ import debounce from 'lodash/debounce';
export default {
data() {
return {
indicatorDots: true,
autoplay: false,
interval: 2000,
duration: 500,
input_flag: false,
page: 1,
limit: 50,
......@@ -363,7 +479,7 @@ export default {
curr: 0,
item: ['货品信息', '其他信息'],
zyGoodsData: [], //自营货品信息
list_param: [], //自营数据参数集合
saveZyGoodsParams: [], //自营数据参数集合
searchParams: {
create_time_begin: '',
create_time_end: '',
......@@ -377,7 +493,21 @@ export default {
logistics_company: '',
logistics_sn: '',
other_info: ''
}
},
packingSet: [{ name: '编带', value: 5 }, { name: '袋', value: 6 }, { name: '盒', value: 7 }, { name: '管', value: 8 }, { name: '托盘', value: 9 }, { name: '卷', value: 10 }, { name: '其他', value: 11 }],
pickingModeSet: [{ name: '裁剪', value: 1 }, { name: '称重', value: 2 }, { name: '计数', value: 3 }],
standardSize: ['标准包装长宽高', '单位包装长宽高'],
standardSizeIndex: 0,
netWeight: ['标准包装净重', '单位净重'],
netWeightIndex: 0,
grossWeight: ['标准包装毛重', '单位毛重'],
grossWeightIndex: 0,
netWeightSize: ['kg', 'g'], //净重尺寸 1kg 2g
netWeightSizeIndex: 0,
grossWeightSize: ['kg', 'g'], //毛重尺寸 1kg 2g
grossWeightSizeIndex: 0,
otherAttrList: [], //其他属性
swiperCurr: 0
};
},
onReachBottom() {
......@@ -417,6 +547,61 @@ export default {
radioChange(e) {
this.index = e.detail.value;
},
/**
* 轮播图切换监听
*/
swiperChange(e) {
console.log('swiper发送选择改变,携带值为', e);
this.swiperCurr = e.detail.current;
},
/**监听包装信息
* @param {Object} e
* @param {Object} type
*/
bindPickerZYChange: function(e, type, index) {
console.log('picker发送选择改变,携带值为', e.detail.value);
switch (type) {
//包装方式
case 1:
this.saveZyGoodsParams[index].packing = this.packingSet[e.detail.value].value;
break;
//拣货方式
case 2:
this.saveZyGoodsParams[index].picking_mode = this.pickingModeSet[e.detail.value].value;
break;
//选择标准包装长宽高
case 3:
this.standardSizeIndex = e.detail.value;
break;
//选择标标准包净重
case 5:
this.netWeightIndex = e.detail.value;
break;
//选择标标准包净重-单位
case 6:
this.netWeightSizeIndex = e.detail.value;
break;
//选择标准包毛重
case 7:
this.grossWeightIndex = e.detail.value;
break;
//选择标准包毛重-单位
case 8:
this.grossWeightSizeIndex = e.detail.value;
break;
//其他属性
case 9:
this.saveZyGoodsParams[index].picking_other_attr_index = e.detail.value;
this.saveZyGoodsParams[index].picking_other_attr = this.otherAttrList[e.detail.value];
break;
default:
break;
}
},
/**
* @param {Object} e
* @param {Object} type
*/
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
......@@ -474,43 +659,6 @@ export default {
this.filter_id_stock_in_sn = filter_arr.map(i => this.list[i].stock_in_sn);
},
/**
* 获取仓库
*/
getWareHouselist() {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => {
if (res.code === 0) {
this.formParams.warehouse_id = res.data.list[0].warehouse_id;
this.warehouse_id_data = res.data.list.map(function(item) {
return {
name: item.warehouse_name,
value: item.warehouse_id
};
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* @param {Object} stock_in_sn 入库单号
*
*/
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'
});
}
});
},
/**
* 全选
*/
allChnage() {
......@@ -577,6 +725,64 @@ export default {
this.getData();
}, 800),
/**
* 获取仓库
*/
getWareHouselist() {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => {
if (res.code === 0) {
this.formParams.warehouse_id = res.data.list[0].warehouse_id;
this.warehouse_id_data = res.data.list.map(function(item) {
return {
name: item.warehouse_name,
value: item.warehouse_id
};
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取其他属性
*/
getOtherAttrList() {
this.request(API.getOtherAttrList, 'POST', {}, true).then(res => {
if (res.code === 0) {
this.otherAttrList = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* @param {Object} stock_in_sn 入库单号
*
*/
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;
this.saveZyGoodsParams = res.data; //赋值自营数据
// 添加 picking_other_attr_index 到每个对象并设置默认值为 0
this.saveZyGoodsParams = res.data.map(item => ({
...item,
picking_other_attr_index: 0
}));
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取列表数据
*/
getData() {
......@@ -614,9 +820,45 @@ export default {
});
},
/**
* 修改自营数据
*/
saveZyGoodsDataSubmit() {
this.request(API.saveZyGoodsData, 'POST', { list: JSON.stringify(this.saveZyGoodsParams) }, true).then(res => {
if (res.code === 0) {
this.request(API.addStockInRegister, 'POST', { stock_in_id: JSON.stringify(this.filter_id) }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '登记成功',
icon: 'success'
});
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 {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 无单号登记
*/
addStockInRegisterSubmit() {
withoutTrackingNumberRecord() {
if (!this.formParams.logistics_company) {
uni.showToast({
title: '请填写物流公司',
......@@ -654,21 +896,6 @@ export default {
});
},
/**
* 修改自营数据
*/
saveZyGoodsData() {
this.request(API.saveZyGoodsData, 'GET', { list: this.list_param }, true).then(res => {
if (res.code === 0) {
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 到货登记
* @param {Object} type 1无单号登记 2详情登记
* @param {Object} id
......@@ -702,6 +929,7 @@ export default {
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.getOtherAttrList();
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 => {
......
......@@ -264,6 +264,10 @@ const API = {
* */
getZyGoodsData: API_BASE + '/api/stockIn/stockInDetail/getZyGoodsData',
/**
* 其他属性
* */
getOtherAttrList: API_BASE + '/api/dictionary/getOtherAttrList',
/**
* 修改自营数据
* */
saveZyGoodsData: API_BASE + '/api/stockIn/stockInDetail/saveZyGoodsData',
......
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