Commit 3559ec05 by LJM

上架

parent 589666c3
......@@ -46,17 +46,16 @@
flex-wrap: wrap;
.box {
position: relative;
padding: 15rpx 17rpx 0 17rpx;
padding: 15rpx 17rpx 17rpx 17rpx;
width: 345rpx;
height: 160rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
margin-right: 15rpx;
margin-bottom: 15rpx;
border: 1px solid transparent;
&.box-width {
width: 345rpx;
height: 314rpx;
}
.check-box-icon {
position: absolute;
......@@ -220,7 +219,7 @@
}
.search {
padding-right: 18rpx;
width: 578rpx;
width: 398rpx;
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
......@@ -236,9 +235,17 @@
color: #c6c7cc;
}
.uni-input {
height: 100%;
font-size: 18rpx;
color: #484b59;
}
.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;
}
}
.tip-box {
margin-top: 18rpx;
......
......@@ -116,6 +116,36 @@
font-size: 16rpx;
}
}
.search {
padding-right: 18rpx;
width: 398rpx;
height: 55rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid #1969f9;
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
margin-left: 17rpx;
margin-right: 13rpx;
}
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
}
.uni-input {
height: 100%;
font-size: 18rpx;
color: #484b59;
}
.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;
}
}
}
.item-tit {
font-size: 20rpx;
......
......@@ -440,7 +440,6 @@
width: 114rpx;
font-size: 16rpx;
color: #919399;
text-align-last: justify;
}
.text {
font-size: 16rpx;
......
......@@ -86,7 +86,7 @@
}
.section {
margin-top: 15rpx;
padding: 18rpx 22rpx 23rpx 22rpx;
padding: 18rpx 22rpx 100px 22rpx;
background-color: #ffffff;
.field-item {
flex-wrap: wrap;
......
......@@ -2,7 +2,7 @@
<view class="putaway">
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<picker @change="bindPickerChange($event)" :value="index" :range="array">
<view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
......@@ -12,57 +12,66 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" />
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_batch_sn" @input="handleInput" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="list row bothSide">
<view class="box box-width" v-for="(item, index) in 10" :key="index">
<view class="check-box-icon"></view>
<view class="list row bothSide" v-if="list.length > 0">
<view class="box box-width" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="check-box-icon" @click="filterChange(index)"></view>
<view class="text-item row verCenter">
<text class="label">入库批次号:</text>
<text class="t1">A00001</text>
<text class="t1">{{ item.stock_in_batch_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">入仓号:</text>
<text class="t1">A00001</text>
<text class="t1">{{ item.inhouse }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">仓库:</text>
<text class="tt">{{ item.warehouse_name }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">货品名称:</text>
<text class="tt">ASD3DAADS22</text>
<text class="tt">{{ item.goods_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">标准品牌:</text>
<text class="tt">TI</text>
<text class="tt">{{ item.brand_name }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">D / C:</text>
<text class="tt">22+</text>
<text class="tt">{{ item.date_code }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">产 地:</text>
<text class="tt">美国</text>
<text class="tt">{{ item.coo }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">理货数量:</text>
<text class="tt" style="color: #F98119;">1000</text>
<text class="tt" style="color: #F98119;">{{ item.tally_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">待上架数量:</text>
<text class="tt" style="color: #F98119;">500</text>
<text class="tt" style="color: #F98119;">{{ item.pending_shelf_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">销 售 员:</text>
<text class="tt">元瑾晶</text>
<text class="tt">{{ item.sale_user }}</text>
</view>
<navigator class="btn-box row" :url="'/pages/putaway/single?stock_in_batch_sn=' + item.stock_in_batch_sn + '&tally_id=' + item.tally_id" hover-class="none"><view class="btn row rowCenter verCenter">上架</view></navigator>
</view>
<navigator class="btn-box row" url="/pages/putaway/single" hover-class="none"><view class="btn row rowCenter verCenter">上架</view></navigator>
</view>
<!-- 无数据展示 -->
<view class="no-date column rowCenter verCenter" v-else>
<text class="iconfont icon-a-juxing21"></text>
<text class="text">查不到当前数据</text>
</view>
<view class="fix-btn row verCenter">
<view class="btn1 row rowCenter verCenter">
<text class="check-box-icon curr"></text>
<view class="btn1 row rowCenter verCenter" @click="allChnage()">
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="showDrawer()">一键上架</view>
......@@ -76,17 +85,21 @@
</view>
<view class="p-text">
<text class="tt">您已选中</text>
<text class="ed">5</text>
<text class="ed">{{ filter_id.length }}</text>
<text class="tt">个上架任务</text>
</view>
<view class="pack">
<view class="h2">库位:</view>
<view class="search row bothSide verCenter">
<view class="row verCenter">
<view class="row verCenter bothSide">
<view class="search row bothSide verCenter" style="width: 100%;">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请输入库位" placeholder-style="color:#919399" />
<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>
<text class="iconfont icon-a-juxing11"></text>
</view>
<view class="tip-box row verCenter">
<text class="iconfont icon-a-juxing4"></text>
......@@ -96,7 +109,7 @@
</view>
<view class="btn row verCenter bothSide">
<view class="btn1 row rowCenter verCenter" @click="closeDrawer()">取 消</view>
<view class="btn2 row rowCenter verCenter">一键上架</view>
<view class="btn2 row rowCenter verCenter" @click="oneKeyPutawayAction()">一键上架</view>
</view>
</view>
</uni-drawer>
......@@ -105,11 +118,28 @@
<script>
import { API } from '@/util/api.js';
import { createArray } from '@/util/util.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 1000,
index: 0,
array: ['入库批次号']
array: ['入库批次号'],
indexPosition: -1,
list: [],
position: [], //库位
filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id
formParams: {
position_id: ''
},
searchParams: {
stock_in_batch_sn: '' //入库批次号
}
};
},
onNavigationBarButtonTap(e) {
......@@ -120,16 +150,164 @@ export default {
});
}
},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e) {
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
this.indexPosition = e.detail.value;
this.formParams.position_id = this.position[e.detail.value].value;
} else {
this.index = e.detail.value;
}
},
showDrawer() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
let filter_arr = this.findIndex(this.filter_list, true);
var warehouse_id = filter_arr.map(i => this.list[i].warehouse_id);
var stock_in_type = filter_arr.map(i => this.list[i].stock_in_type);
this.getWhPositionList(7, stock_in_type[0]);
this.$refs.showRight.open();
},
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 找出false对应的下标
* @param {Object} arr
* @param {Object} target
*/
findIndex(arr, target) {
const result = [];
arr.map((item, index) => {
if (item === target) {
result.push(index);
}
});
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].tally_id);
},
/**
* 全选
*/
allChnage() {
this.all_flag = !this.all_flag;
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.tally_id;
});
} else {
this.filter_id = [];
}
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_in_batch_sn = '';
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.getPendingShelfByBatchSn, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.filter_list = createArray(this.list.length, false);
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取库位
*/
getWhPositionList(warehouse_id, stock_in_type) {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => {
if (res.code === 0) {
this.position = res.data.list.map(function(item) {
return {
value: item.id,
name: item.position_code
};
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 查询可用的上架规则
*/
getWorkingRuleList() {},
/**
* 一键上架
*/
oneKeyPutawayAction() {
if (!this.formParams.position_id) {
uni.showToast({
title: '请选择库位',
icon: 'error'
});
return false;
}
this.request(API.oneKeyPutawayAction, 'POST', { position_id: this.formParams.position_id, tally_ids: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '一键上架成功',
icon: 'success'
});
setTimeout(() => {
this.closeDrawer();
this.filter_id = [];
this.getData();
}, 2000);
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
}
};
......
......@@ -2,7 +2,7 @@
<view class="putaway-single">
<view class="search-box row bothSide verCenter">
<view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array">
<picker @change="bindPickerChange($event)" :value="index" :range="array">
<view class="row verCenter">
<view class="uni-input">{{ array[index] }}</view>
<view class="uni-arrow"></view>
......@@ -12,28 +12,28 @@
<view class="search-bar row bothSide verCenter">
<view class="row verCenter">
<text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" />
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_batch_sn" @input="handleInput" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view>
</view>
<view class="section">
<view class="field-item row">
<view class="item row verCenter">
<text class="label">入库批次号:</text>
<text class="text">ASN2201010001</text>
<text class="text">{{ detail.stock_in_batch_sn }}</text>
</view>
<view class="item row verCenter">
<text class="label">入 仓 号:</text>
<text class="text">A65512</text>
<text class="text">{{ detail.inhouse }}</text>
</view>
<view class="item row verCenter">
<text class="label">入库单号:</text>
<text class="text">SF2135661465161</text>
<text class="text">{{ detail.stock_in_sn }}</text>
</view>
<view class="item row verCenter">
<text class="label">容 器:</text>
<text class="text">2023-04-01 11:28:59</text>
<text class="text">{{ detail.container_name }}</text>
</view>
</view>
<view class="bor"></view>
......@@ -41,122 +41,295 @@
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品编码:</text>
<text class="tt" style="max-width: 100%;">6546546416541654665</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_sn }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品名称:</text>
<text class="tt" style="max-width: 100%;">ASD3DAADS22</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_name }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">标准品牌:</text>
<text class="tt" style="max-width: 100%;">Nexperia</text>
<text class="tt" style="max-width: 100%;">{{ detail.brand_name }}</text>
</view>
<view class="item row verCenter">
<text class="label">D / C:</text>
<text class="tt">22+</text>
<text class="tt">{{ detail.date_code }}</text>
</view>
<view class="item row verCenter">
<text class="label">产 地:</text>
<text class="tt">美国</text>
<text class="tt">{{ detail.coo }}</text>
</view>
<view class="item row verCenter">
<text class="label">预期数量:</text>
<text class="tt">100000</text>
<text class="tt">{{ detail.expect_qty }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品品质:</text>
<text class="tt">良品</text>
<text class="tt">{{ detail.quality_cn }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">其他批次属性:</text>
<text class="tt">-</text>
<text class="tt">{{ detail.other_batch_attr }}</text>
</view>
</view>
<view class="bor"></view>
<view class="field-item row">
<view class="item row verCenter">
<text class="label">预期数量:</text>
<text class="tt">1000</text>
<text class="tt">{{ detail.expect_qty }}</text>
</view>
<view class="item row verCenter">
<text class="label">单 位:</text>
<text class="tt">PCS</text>
<text class="tt">{{ detail.goods_unit }}</text>
</view>
<view class="item row verCenter">
<text class="label">理货数量:</text>
<text class="tt" style="color: #F98119;">100000</text>
<text class="tt" style="color: #F98119;">{{ detail.tally_qty }}</text>
</view>
<view class="item row verCenter">
<text class="label">待上架数:</text>
<text class="tt" style="color: #F98119;">1212</text>
<text class="tt" style="color: #F98119;">{{ detail.pending_shelf_qty }}</text>
</view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t1">上架数量:</text></view>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" /></view>
<view class="input-box"><input type="number" class="uni-input" placeholder-style="color:#919399" placeholder="请输入上架数量" v-model="formParams.qty_on_shelf" @input="inputNumChange($event, detail.pending_shelf_qty)" /></view>
</view>
<view class="form-input">
<view class="input-title"><text class="input-title-t1">库位:</text></view>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入" /></view>
<view class="search row bothSide verCenter" style="width: 100%;">
<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 class="bor"></view>
<view class="field-item row">
<view class="item row verCenter">
<text class="label">销 售 员:</text>
<text class="tt">拾贰</text>
<text class="tt">{{ detail.sale_user }}</text>
</view>
<view class="item row verCenter">
<text class="label">采 购 员:</text>
<text class="tt">拾贰</text>
<text class="tt">{{ detail.purchase_user }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">客 户:</text>
<text class="tt">深圳市猎芯科技有限公司</text>
<text class="tt">{{ detail.customer_name }}</text>
</view>
</view>
<view class="bor"></view>
<view class="tip-box row verCenter">
<text class="iconfont icon-a-juxing4"></text>
<text class="t1">按数量推荐库位:</text>
<text class="t2">A001、A002、A003</text>
<text class="t2">--</text>
</view>
<view class="field-item row">
<view class="item row verCenter">
<text class="label">质检时间:</text>
<text class="tt">2023-04-01 11:28:59</text>
</view>
<view class="item row verCenter">
<text class="label">质 检 人:</text>
<text class="tt">拾贰</text>
</view>
<view class="item row verCenter">
<text class="label">理货时间:</text>
<text class="tt">2023-04-01 11:28:59</text>
<text class="tt">{{ detail.create_time }}</text>
</view>
<view class="item row verCenter">
<text class="label">理货时间</text>
<text class="tt">拾贰</text>
<text class="label">理货</text>
<text class="tt">{{ detail.create_name }}</text>
</view>
</view>
</view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter">上 架</view></view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" @click="stockShelfByBatchSnAction()">上 架</view></view>
</view>
</template>
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
index: 0,
array: ['入库批次号']
array: ['入库批次号'],
detail: {},
indexPosition: -1,
position: [], //库位
workingRuleList: [], //推荐库位
searchParams: {
stock_in_batch_sn: '' //入库批次
},
formParams: {
position_id: '',
qty_on_shelf: '',
tally_id: ''
}
};
},
onLoad(options) {
this.searchParams.stock_in_batch_sn = options.stock_in_batch_sn;
this.formParams.tally_id = options.tally_id;
},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e) {
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(event) {
var val = event.target.value;
if (val) {
this.input_flag = true;
} else {
this.input_flag = false;
}
this.getData();
}, 500),
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.stock_in_batch_sn = this.detail.stock_in_batch_sn;
this.getData();
},
/**
* 监听上架数量
*/
inputNumChange: debounce(function(event, pending_shelf_qty) {
if (this.formParams.position_id && this.formParams.qty_on_shelf) {
this.getWorkingRuleList();
}
var pending_shelf_qty = Number(pending_shelf_qty);
var val = event.target.value * 1;
if (val > pending_shelf_qty) {
this.formParams.qty_on_shelf = pending_shelf_qty;
}
}, 500),
bindPickerChange: function(e, type) {
console.log('picker发送选择改变,携带值为', e.detail.value);
if (type == 1) {
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;
}
},
/**
* 获取详情数据
*/
getData() {
this.request(API.getStockShelfInfoByBatchSn, 'POST', { ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.detail = res.data;
this.formParams.tally_id = res.data.tally_id;
this.getWhPositionList();
}
});
},
/**
* 获取库位
*/
getWhPositionList() {
this.request(API.getWhPositionList, 'POST', { warehouse_id: 7, stock_in_type: this.detail.stock_in_type }, false).then(res => {
if (res.code === 0) {
this.position = res.data.list.map(function(item) {
return {
value: item.id,
name: item.position_code
};
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 查询可用的上架规则
*/
getWorkingRuleList() {
var params = {
num: this.formParams.qty_on_shelf,
warehouse_id: 7,
com_name: '',
supplier_name: ''
};
this.request(API.getWorkingRuleList, 'POST', params, false).then(res => {
if (res.code === 0) {
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 上架
*/
stockShelfByBatchSnAction() {
if (!this.formParams.qty_on_shelf) {
uni.showToast({
title: '请填写上架数量',
icon: 'error'
});
return false;
}
if (!this.formParams.position_id) {
uni.showToast({
title: '请选择库位',
icon: 'error'
});
return false;
}
var pending_shelf_qty = Number(this.detail.pending_shelf_qty);
this.request(API.stockShelfByBatchSnAction, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
if (Number(this.formParams.qty_on_shelf) == pending_shelf_qty) {
uni.showToast({
title: '上架成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
} else {
uni.showModal({
title: '提示',
content: '上架成功,点击确定可继续上架',
showCancel: true,
success: res => {
if (res.confirm) {
this.getData();
} else if (res.cancel) {
uni.navigateBack({
delta: 1
});
}
}
});
}
} else {
uni.showModal({
itle: '提示',
content: res.msg,
showCancel: false
});
}
});
}
}
};
</script>
......
......@@ -32,7 +32,7 @@
<text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerContainChange($event, 1)" :value="indexContainer" :range="tallyContainer" range-key="name" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name || '请选择' }}</view>
<view class="uni-input row verCenter">{{ indexContainer == -1 ? '请选择' : tallyContainer[indexContainer].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -86,7 +86,7 @@
<text class="check-box-icon" :class="{ curr: filter_list.length > 0 && filter_list.length == filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive()">一键理货</view>
<view class="btn2 row rowCenter verCenter" @click="showDrawer()">一键理货</view>
</view>
<!-- 一键理货弹窗 -->
<uni-drawer ref="showRight" mode="right">
......@@ -107,7 +107,7 @@
<text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerContainChange($event, 2)" :value="indexContainer" :range="tallyContainer" :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">{{ tallyContainer[indexContainer].name }}</view>
<view class="uni-input row verCenter">{{ indexContainer == -1 ? '请选择' : tallyContainer[indexContainer].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -300,9 +300,6 @@ export default {
this.indexContainer = e.detail.value;
this.formParams.container_id = this.tallyContainer[e.detail.value].id;
this.searchParams.container_id = this.tallyContainer[e.detail.value].id;
if (type == 1) {
this.getData();
}
},
/**
* 获取列表数据
......@@ -336,27 +333,6 @@ export default {
});
},
/**
* 一键理货
*/
createTallyReceive() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
if (this.indexContainer == -1) {
uni.showToast({
title: '请选择容器',
icon: 'error'
});
return false;
}
this.formParams.container_id = this.tallyContainer[this.indexContainer].id;
this.showDrawer();
},
/**
* 一键理货提交
*/
createTallyReceiveSubmit() {
......@@ -371,6 +347,7 @@ export default {
});
setTimeout(() => {
this.closeDrawer();
this.getData();
}, 2000);
} else {
uni.showModal({
......@@ -382,6 +359,23 @@ export default {
});
},
showDrawer() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
if (this.indexContainer == -1) {
uni.showToast({
title: '请选择容器',
icon: 'error'
});
return false;
}
this.formParams.container_id = this.tallyContainer[this.indexContainer].id;
this.image_list = []; //每次打开先清空
this.formParams.tally_remark = ''; //每次打开先清空
this.$refs.showRight.open();
},
closeDrawer() {
......
......@@ -32,7 +32,7 @@
<text class="iconfont icon-juxing1"></text>
<picker @change="bindPickerContainChange" :value="indexContainer" :range="tallyContainer" range-key="name" style="width: 100%;height: 100%;">
<view class="row verCenter bothSide wrap">
<view class="uni-input row verCenter">{{ tallyContainer[indexContainer].name || '请选择' }}</view>
<view class="uni-input row verCenter">{{ indexContainer == -1 ? '请选择' : tallyContainer[indexContainer].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
......@@ -100,7 +100,7 @@
<text class="input-title-t1">*</text>
<text class="input-title-t2">理货数量:</text>
</view>
<view class="input-box"><input type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入理货数量" v-model="formParams.tally_qty" /></view>
<view class="input-box"><input type="number" class="uni-input" placeholder-style="color:#919399" placeholder="请输入理货数量" v-model="formParams.tally_qty" @input="handleInputNumber($event, detail.wait_tally_qty)" /></view>
</view>
<view class="row verCenter" style="flex: 0 0 278rpx;margin-top: 38rpx;">
<text class="input-title-p1">待理货数量:</text>
......@@ -230,9 +230,18 @@ export default {
this.indexContainer = e.detail.value;
this.formParams.container_id = this.tallyContainer[e.detail.value].id;
this.searchParams.container_id = this.tallyContainer[e.detail.value].id;
this.getData();
},
/**
* 监听理货数量
*/
handleInputNumber: debounce(function(event, wait_tally_qty) {
var wait_tally_qty = Number(wait_tally_qty);
var val = event.target.value * 1;
if (val > wait_tally_qty) {
this.formParams.tally_qty = wait_tally_qty;
}
}, 500),
/**
* 是否打印
*/
toggle(type) {
......@@ -429,6 +438,8 @@ export default {
return false;
}
var wait_tally_qty = Number(this.detail.wait_tally_qty);
var params = {
container_id: this.searchParams.container_id,
stock_in_id: this.stock_in_id,
......@@ -445,13 +456,34 @@ export default {
this.request(API.createTallyReceive, 'POST', params, true).then(res => {
if (res.code === 0) {
if (wait_tally_qty == this.formParams.tally_qty) {
uni.showToast({
title: '理货成功',
title: '全部理货成功',
icon: 'success'
});
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 2000);
} else {
uni.showModal({
itle: '提示',
title: '提示',
content: '理货成功,点击确定可继续理货',
showCancel: false,
success: res => {
if (res.confirm) {
this.getData();
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
}
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
......
......@@ -102,19 +102,19 @@
<view class="field-item row">
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品编码:</text>
<text class="tt">{{ detail.goods_sn }}</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_sn }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">货品名称:</text>
<text class="tt">{{ detail.goods_name }}</text>
<text class="tt" style="max-width: 100%;">{{ detail.goods_name }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">入库批次号:</text>
<text class="tt">{{ detail.stock_in_batch_sn }}</text>
<text class="tt" style="max-width: 100%;">{{ detail.stock_in_batch_sn }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;">
<text class="label">标准品牌:</text>
<text class="tt">{{ detail.brand_name }}</text>
<text class="tt" style="max-width: 100%;">{{ detail.brand_name }}</text>
</view>
<view class="item row verCenter">
<text class="label">D / C:</text>
......
......@@ -163,6 +163,30 @@ const API = {
* 标签补打
* */
latePrint: API_BASE + '/api/label/latePrint',
/**
* 按货品上架
* */
getPendingShelfByBatchSn: API_BASE + '/api/h5/stockIn/getPendingShelfByBatchSn',
/**
* 按货品上架_操作详情页面
* */
getStockShelfInfoByBatchSn: API_BASE + '/api/h5/stockIn/getStockShelfInfoByBatchSn',
/**
* 按货品上架_详情页上架按钮操作
* */
stockShelfByBatchSnAction: API_BASE + '/api/h5/stockIn/stockShelfByBatchSnAction',
/**
* 一键上架
* */
oneKeyPutawayAction: API_BASE + '/api/h5/stockIn/oneKeyPutawayAction',
/**
* 获取库位
* */
getWhPositionList: API_BASE + '/api/stockIn/stockShelf/getWhPositionList',
/**
* 查询可用上架规则
* */
getWorkingRuleList: API_BASE + '/api/shelf/getWorkingRuleList',
}
......
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