Commit a3fbc118 by LJM

货品上

parent 82f62083
...@@ -59,11 +59,18 @@ ...@@ -59,11 +59,18 @@
color: #c6c7cc; color: #c6c7cc;
} }
} }
.title { .box-info {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
margin-bottom: 10rpx; margin-bottom: 10rpx;
.title {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.info {
color: #1969f9;
font-size: 22rpx;
margin-right: 16rpx;
}
} }
} }
.fix-btn { .fix-btn {
...@@ -482,4 +489,54 @@ ...@@ -482,4 +489,54 @@
} }
} }
} }
&.box-drawer {
.box-list {
margin-top: 50rpx;
.box-title {
margin-bottom: 18rpx;
.t1 {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.uni-input-show {
font-size: 20rpx;
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;
}
}
.box-row {
margin-bottom: 10rpx;
.text {
flex: 0 0 20%;
color: #484b59;
font-size: 22rpx;
}
}
.box-wrap {
padding: 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;
.uni-input {
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
text-indent: 15rpx;
font-size: 16rpx;
margin-right: 10rpx;
}
}
}
}
} }
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
} }
if (!this.is_submit) { if (!this.is_submit) {
uni.showToast({ uni.showToast({
title: '请输入合适库位s', title: '请输入合适库位',
icon: 'error' icon: 'error'
}); });
return false; return false;
......
...@@ -97,17 +97,14 @@ ...@@ -97,17 +97,14 @@
</view> </view>
<view class="form-input"> <view class="form-input">
<view class="input-title"><text class="input-title-t1">库位:</text></view> <view class="input-title"><text class="input-title-t1">库位:</text></view>
<view class="search row bothSide verCenter" style="width: 100%;"> <view class="input-box"><input :class="{ 'error-style': !is_submit }" type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入库位编码" v-model="formParams.position_code" @input="inputPositionCodeChange()" /></view>
<text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerChange($event, 1)" :value="indexPosition" :range="position" :range-key="'name'" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide wrap" style="width: 100%;height: 55rpx;">
<view class="uni-input row verCenter">{{ indexPosition == -1 ? '请选择库位' : position[indexPosition].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view> </view>
<view class="bor"></view> <view class="bor"></view>
<view class="tip-box row verCenter" v-if="workingRule">
<text class="iconfont icon-a-juxing4"></text>
<text class="t1">{{ workingRuleList.prefix }}{{ workingRuleList.execute_type_val }}库位:</text>
<text class="t2">{{ workingRule }}</text>
</view>
<view class="field-item row"> <view class="field-item row">
<view class="item row verCenter"> <view class="item row verCenter">
<text class="label">销 售 员:</text> <text class="label">销 售 员:</text>
...@@ -123,11 +120,6 @@ ...@@ -123,11 +120,6 @@
</view> </view>
</view> </view>
<view class="bor"></view> <view class="bor"></view>
<view class="tip-box row verCenter" v-if="workingRule">
<text class="iconfont icon-a-juxing4"></text>
<text class="t1">{{ workingRuleList.prefix }}推荐库位:</text>
<text class="t2">{{ workingRule }}</text>
</view>
<view class="field-item row"> <view class="field-item row">
<view class="item row verCenter"> <view class="item row verCenter">
<text class="label">理货时间:</text> <text class="label">理货时间:</text>
...@@ -139,7 +131,7 @@ ...@@ -139,7 +131,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" @click="stockShelfByBatchSnAction()">上 架</view></view> <view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" :class="{ 'btn-disabled': !is_submit }" @click="stockShelfByBatchSnAction()">上 架</view></view>
</view> </view>
</template> </template>
...@@ -150,19 +142,18 @@ import debounce from 'lodash/debounce'; ...@@ -150,19 +142,18 @@ import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
is_submit: true,
input_flag: false, input_flag: false,
index: 0, index: 0,
array: ['入库批次号'], array: ['入库批次号'],
detail: {}, detail: {},
indexPosition: -1,
position: [], //库位
workingRuleList: {}, //,//推荐库位 workingRuleList: {}, //,//推荐库位
workingRule: '', //推荐库位 workingRule: '', //推荐库位
searchParams: { searchParams: {
stock_in_batch_sn: '' //入库批次 stock_in_batch_sn: '' //入库批次
}, },
formParams: { formParams: {
position_id: '', position_code: '', //库位编码
qty_on_shelf: '', qty_on_shelf: '',
tally_id: '' tally_id: ''
} }
...@@ -201,7 +192,7 @@ export default { ...@@ -201,7 +192,7 @@ export default {
* 监听上架数量 * 监听上架数量
*/ */
inputNumChange: debounce(function(event, pending_shelf_qty) { inputNumChange: debounce(function(event, pending_shelf_qty) {
if (this.formParams.position_id && this.formParams.qty_on_shelf) { if (this.formParams.position_code && this.formParams.qty_on_shelf) {
this.getWorkingRuleList(); this.getWorkingRuleList();
} }
var pending_shelf_qty = Number(pending_shelf_qty); var pending_shelf_qty = Number(pending_shelf_qty);
...@@ -210,17 +201,18 @@ export default { ...@@ -210,17 +201,18 @@ export default {
this.formParams.qty_on_shelf = pending_shelf_qty; this.formParams.qty_on_shelf = pending_shelf_qty;
} }
}, 500), }, 500),
/**
* 监听库位编码
*/
inputPositionCodeChange: debounce(function(event) {
this.getWhPositionList();
if (this.formParams.position_code && this.formParams.qty_on_shelf) {
this.getWorkingRuleList();
}
}, 500),
bindPickerChange: function(e, type) { bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) { this.index = e.detail.value;
this.indexPosition = e.detail.value;
this.formParams.position_id = this.position[e.detail.value].value;
if (this.formParams.position_id && this.formParams.qty_on_shelf) {
this.getWorkingRuleList();
}
} else {
this.index = e.detail.value;
}
}, },
/** /**
* 获取详情数据 * 获取详情数据
...@@ -229,8 +221,9 @@ export default { ...@@ -229,8 +221,9 @@ export default {
this.request(API.getStockShelfInfoByBatchSn, 'POST', { ...this.searchParams }, false).then(res => { this.request(API.getStockShelfInfoByBatchSn, 'POST', { ...this.searchParams }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.detail = res.data; this.detail = res.data;
this.formParams.qty_on_shelf = res.data.pending_shelf_qty;
this.formParams.tally_id = res.data.tally_id; this.formParams.tally_id = res.data.tally_id;
this.getWhPositionList(); this.getWorkingRuleList();
} }
}); });
}, },
...@@ -240,11 +233,9 @@ export default { ...@@ -240,11 +233,9 @@ export default {
getWhPositionList() { getWhPositionList() {
this.request(API.getWhPositionList, 'POST', { warehouse_id: this.detail.warehouse_id, stock_in_type: this.detail.stock_in_type }, false).then(res => { this.request(API.getWhPositionList, 'POST', { warehouse_id: this.detail.warehouse_id, stock_in_type: this.detail.stock_in_type }, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.position = res.data.list.map(function(item) { var position_code = this.formParams.position_code;
return { this.is_submit = res.data.list.some(function(obj) {
value: item.id, return obj.position_code === position_code;
name: item.position_code
};
}); });
} else { } else {
uni.showToast({ uni.showToast({
...@@ -268,7 +259,7 @@ export default { ...@@ -268,7 +259,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
this.workingRuleList = res.data; this.workingRuleList = res.data;
this.workingRule = res.data.list.map(item => item.position_name).join(','); this.workingRule = res.data.list.map(item => item.position_code).join(',');
} else { } else {
this.workingRuleList = ''; this.workingRuleList = '';
this.workingRule = ''; this.workingRule = '';
...@@ -292,9 +283,16 @@ export default { ...@@ -292,9 +283,16 @@ export default {
}); });
return false; return false;
} }
if (!this.formParams.position_id) { if (!this.formParams.position_code) {
uni.showToast({
title: '请输入库位编码',
icon: 'error'
});
return false;
}
if (!this.is_submit) {
uni.showToast({ uni.showToast({
title: '请选择库位', title: '请输入合适库位',
icon: 'error' icon: 'error'
}); });
return false; return false;
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
<view class="picking-sort-wrap"> <view class="picking-sort-wrap">
<view class="search-type row bothSide verCenter"> <view class="search-type row bothSide verCenter">
<view class="left"> <view class="left">
<view class="title">打包箱号:</view> <view class="box-info row bothSide">
<view class="title row bothSide verCenter">打包箱号:</view>
<view class="info" @click="showBox()">箱信息</view>
</view>
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
...@@ -20,7 +23,7 @@ ...@@ -20,7 +23,7 @@
</view> </view>
<view class="right"> <view class="right">
<template v-if="curr == 0"> <template v-if="curr == 0">
<view class="title">入库批次号:</view> <view class="box-info row bothSide"><view class="title row bothSide verCenter">入库批次号:</view></view>
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
...@@ -29,8 +32,8 @@ ...@@ -29,8 +32,8 @@
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_flag_stock_in_batch_sn"></text>
</view> </view>
</template> </template>
<template v-else-if="curr == 1" s> <template v-else-if="curr == 1">
<view class="title">容器:</view> <view class="box-info row bothSide"><view class="title row bothSide verCenter">容器:</view></view>
<view class="search-bar row bothSide verCenter"> <view class="search-bar row bothSide verCenter">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
...@@ -379,6 +382,72 @@ ...@@ -379,6 +382,72 @@
</view> </view>
</view> </view>
</uni-drawer> </uni-drawer>
<!-- 箱信息 -->
<uni-drawer ref="showBoxInfo" mode="right">
<view class="uni-drawer-picking box-drawer">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeBox()"></text>
<text class="text">箱信息</text>
</view>
<view class="box-list">
<view class="box-wrap" v-for="(item, i) in packList" :key="i">
<view class="box-title row bothSide verCenter">
<text class="t1">打包箱号:{{ item.box_name }}</text>
<view>
<picker @change="bindPickerBoxChange($event, i)" :value="index" :range="packConfigList" :range-key="'name'">
<view class="row verCenter">
<view class="uni-input-show">{{ index == -1 ? '请选择' : packConfigList[index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<view class="row avarage verCenter box-row">
<template v-if="company_id == 1">
<text>长cm</text>
<text>宽cm</text>
<text>高cm</text>
<text>净重kg</text>
<text>毛量kg</text>
</template>
<template v-else>
<view class="text">
<text style="color:red">*</text>
<text>长cm</text>
</view>
<view class="text">
<text style="color:red">*</text>
<text>宽cm</text>
</view>
<view class="text">
<text style="color:red">*</text>
<text>高cm</text>
</view>
<view class="text">
<text style="color:red">*</text>
<text>净重kg</text>
</view>
<view class="text">
<text style="color:red">*</text>
<text>毛量kg</text>
</view>
</template>
</view>
<view class="row avarage verCenter">
<input type="text" placeholder="长cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].length" />
<input type="text" placeholder="宽cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].width" />
<input type="text" placeholder="高cm" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].hight" />
<input type="text" placeholder="净重kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].net_weight" />
<input type="text" placeholder="毛量kg" placeholder-style="color:#919399" class="uni-input" v-model="packList[i].gross_weight" />
</view>
</view>
</view>
<view class="btn row verCenter bothSide">
<view class="btn0 row rowCenter verCenter" @click="closeBox()">取 消</view>
<view class="btn1 row rowCenter verCenter" style="width: 50%;" @click="updatePackInfo()">确认</view>
</view>
</view>
</uni-drawer>
</view> </view>
</template> </template>
...@@ -390,6 +459,7 @@ import debounce from 'lodash/debounce'; ...@@ -390,6 +459,7 @@ import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
company_id: uni.getStorageSync('company_id') || '',
stock_out_sn: '', //标题显示出库单号 stock_out_sn: '', //标题显示出库单号
lock_ids: [], //出库id集合 lock_ids: [], //出库id集合
all_flag: false, //全选标记 all_flag: false, //全选标记
...@@ -399,6 +469,8 @@ export default { ...@@ -399,6 +469,8 @@ export default {
page: 1, page: 1,
limit: 1000, limit: 1000,
curr: 0, curr: 0,
index: -1,
array: ['深圳市猎芯科技有限公司', '深贸电子有限公司'],
itemArr: ['按货品复核', '按容器复核'], itemArr: ['按货品复核', '按容器复核'],
list: [], list: [],
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
...@@ -406,6 +478,8 @@ export default { ...@@ -406,6 +478,8 @@ export default {
detail: {}, //按货品拣货详情 detail: {}, //按货品拣货详情
detailContainer: {}, //按容器拣货详情 detailContainer: {}, //按容器拣货详情
stock_out_item_ids: '', //复核任务ids stock_out_item_ids: '', //复核任务ids
packList: [], //箱信息
packConfigList: [], //箱配置列表
searchParams: { searchParams: {
stock_out_id: '', stock_out_id: '',
box_name: '001', box_name: '001',
...@@ -429,8 +503,18 @@ export default { ...@@ -429,8 +503,18 @@ export default {
}, },
onShow() { onShow() {
this.getData(); this.getData();
this.getPackList();
this.getBoxConfigList();
}, },
methods: { methods: {
bindPickerBoxChange: function(e, index) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
var packConfigList = this.packConfigList[e.detail.value];
this.$set(this.packList[index], 'length', packConfigList.length);
this.$set(this.packList[index], 'width', packConfigList.width);
this.$set(this.packList[index], 'hight', packConfigList.hight);
},
/** /**
* 找出false对应的下标 * 找出false对应的下标
* @param {Object} arr * @param {Object} arr
...@@ -475,6 +559,36 @@ export default { ...@@ -475,6 +559,36 @@ export default {
return String(num + 1).padStart(3, '0'); return String(num + 1).padStart(3, '0');
}, },
/** /**
* 获取箱信息
*/
getPackList() {
this.request(API.getPackList, 'POST', { stock_out_id: this.searchParams.stock_out_id }, false).then(res => {
if (res.code === 0) {
this.packList = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取箱配置
*/
getBoxConfigList() {
this.request(API.getBoxConfigList, 'POST', { stock_out_id: this.searchParams.stock_out_id }, false).then(res => {
if (res.code === 0) {
this.packConfigList = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 刷新数字 * 刷新数字
*/ */
refresh() { refresh() {
...@@ -520,6 +634,10 @@ export default { ...@@ -520,6 +634,10 @@ export default {
} }
this.getData(); this.getData();
}, 500), }, 500),
/**
* tab切换
* @param {Object} index
*/
tab(index) { tab(index) {
this.curr = index; this.curr = index;
this.getData(); this.getData();
...@@ -605,6 +723,97 @@ export default { ...@@ -605,6 +723,97 @@ export default {
} }
}); });
}, },
/**
* 保存打包信息
*/
updatePackInfo() {
var parmas = {
pack_list: JSON.stringify(this.packList)
};
if (this.company_id == 2) {
var hasEmptyWidth = this.packList.some(function(item) {
return item.width === '';
});
var hasEmptyLength = this.packList.some(function(item) {
return item.length === '';
});
var hasEmptyHight = this.packList.some(function(item) {
return item.hight === '';
});
var hasEmptynetWeight = this.packList.some(function(item) {
return item.net_weight === '';
});
var hasEmptygrossWeight = this.packList.some(function(item) {
return item.gross_weight === '';
});
if (hasEmptyLength) {
uni.showModal({
itle: '提示',
content: '请输入宽',
showCancel: false
});
return false;
}
if (hasEmptyWidth) {
uni.showModal({
itle: '提示',
content: '请输入长',
showCancel: false
});
return false;
}
if (hasEmptyHight) {
uni.showModal({
itle: '提示',
content: '请输入高',
showCancel: false
});
return false;
}
if (hasEmptynetWeight) {
uni.showModal({
itle: '提示',
content: '请输入净重',
showCancel: false
});
return false;
}
if (hasEmptygrossWeight) {
uni.showModal({
itle: '提示',
content: '请输入毛重',
showCancel: false
});
return false;
}
}
this.request(API.updatePackInfo, 'POST', parmas, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.closeBox();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 展示箱信息
*/
showBox() {
this.$refs.showBoxInfo.open();
},
closeBox() {
this.$refs.showBoxInfo.close();
},
showDrawer(type, data) { showDrawer(type, data) {
if (type == 1) { if (type == 1) {
//按货品复核 //按货品复核
......
...@@ -230,7 +230,19 @@ const API = { ...@@ -230,7 +230,19 @@ const API = {
/** /**
* 库存查询 * 库存查询
* */ * */
searchStockList: API_BASE + '/api/h5/stockIn/searchStockList' searchStockList: API_BASE + '/api/h5/stockIn/searchStockList',
/**
* 箱信息
* */
getPackList: API_BASE + '/api/stockRecheck/getPackList',
/**
* 箱配置信息
* */
getBoxConfigList: API_BASE + '/api/stockRecheck/getBoxConfigList',
/**
* 保存打包信息
* */
updatePackInfo: API_BASE + '/api/stockRecheck/updatePackInfo'
} }
......
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