Commit dd3ec76a by LJM

库存查询

parent 2f87ba70
......@@ -5,6 +5,7 @@
background: #ffffff;
border-radius: 10rpx;
margin-bottom: 15rpx;
border: 1px solid transparent;
.text {
padding-left: 17rpx;
width: 164rpx;
......@@ -74,8 +75,7 @@
}
.list {
.box {
padding: 15px 17rpx;
height: 283rpx;
padding: 15rpx 17rpx 10rpx 17rpx;
background: #ffffff;
box-shadow: 0px 3rpx 3rpx 0px rgba(198, 199, 204, 0.3);
border-radius: 10rpx;
......
......@@ -7,6 +7,7 @@
padding-right: 17rpx;
background: #ffffff;
border-radius: 10rpx;
border: 1px solid transparent;
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
......
......@@ -87,7 +87,7 @@
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "wx61a41a064fa2fb3c",
"appid": "wx060bcd34e30d0db2",
"setting": {
"urlCheck": false,
"postcss": true,
......
......@@ -17,7 +17,7 @@
<view class="form-input row verCenter">
<text class="text row verCenter">仓 库</text>
<view class="row bothSide verCenter select-wrap">
<picker @change="bindPickerChange(1, $event)" :value="warehouse_id_index" :range="warehouse_id_data" :range-key="'name'" style="width: 100%;">
<picker @change="bindPickerChange($event)" :value="warehouse_id_index" :range="warehouse_id_data" range-key="name" style="width: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input">{{ warehouse_id_data[warehouse_id_index].name }}</view>
<view class="uni-arrow"></view>
......@@ -25,18 +25,14 @@
</picker>
</view>
</view>
<view class="form-input row verCenter">
<view class="form-input row verCenter" :class="{ 'error-style': !is_submit }">
<text class="text row verCenter">库 位</text>
<view class="row bothSide verCenter select-wrap">
<picker @change="bindPickerChange(2, $event)" :value="position_id_index" :range="position_id_data" :range-key="'name'" style="width: 100%;">
<view class="row verCenter bothSide">
<view class="uni-input">{{ position_id_data[position_id_index].name }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
<view class="row bothSide verCenter input-wrap">
<input type="text" placeholder="请输入库位" placeholder-style="color:#919399" class="uni-input" v-model="formParams.position_code" @input="handleInput(3, $event)" />
<text class="iconfont icon-a-juxing11" @click="clearInput(3)" v-if="input_position"></text>
</view>
</view>
<view class="fix-btn row rowCenter verCenter" @click="search()">查询</view>
<view class="fix-btn row rowCenter verCenter" @click="search()" :class="{ 'btn-disabled': !is_submit }">查询</view>
</view>
</template>
......@@ -47,32 +43,29 @@ import debounce from 'lodash/debounce';
export default {
data() {
return {
is_submit: true,
index: 0,
array: ['深圳现货仓', '深圳自营仓'],
input_goods_sn: false,
input_goods_name: false,
input_position: false,
warehouse_id_index: 0,
position_id_index: 0,
warehouse_id_data: [{ name: '深圳现货仓', value: 1 }, { name: '深圳自营仓', value: 2 }],
position_id_data: [{ name: '库位1', value: 1 }, { name: '库位2', value: 2 }],
warehouse_id_data: [],
formParams: {
goods_sn: '',
goods_name: '',
warehouse_id: '',
position_id: ''
position_code: ''
}
};
},
onLoad() {},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(type, e) {
if (type == 1) {
bindPickerChange: function(e) {
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
} else if (type == 2) {
this.position_id_index = e.detail.value;
this.formParams.position_id = this.position_id_data[e.detail.value].value;
}
console.log('picker发送选择改变,携带值为', e.detail.value);
},
/**
......@@ -85,6 +78,9 @@ export default {
} else if (type == 2) {
this.formParams.goods_name = '';
this.input_goods_name = false;
} else if (type == 3) {
this.formParams.position_code = '';
this.input_position = false;
}
},
/**
......@@ -97,12 +93,17 @@ export default {
this.input_goods_sn = true;
} else if (type == 2) {
this.input_goods_name = true;
} else if (type == 3) {
this.input_position = true;
this.getWhPositionList(this.formParams.warehouse_id, 0);
}
} else {
if (type == 1) {
this.input_goods_sn = false;
} else if (type == 2) {
this.input_goods_name = false;
} else if (type == 3) {
this.input_position = false;
}
}
}, 500),
......@@ -110,9 +111,34 @@ export default {
* 获取库存数据
*/
getData() {
this.request(API.stockInMobileRegisterList, 'POST', { page: this.page, limit: this.limit, is_register: 0, ...this.searchParams }, false).then(res => {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
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'
});
}
});
},
/**
* 获取库位
*/
getWhPositionList(warehouse_id, stock_in_type) {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => {
var position_code = this.formParams.position_code;
if (res.code === 0) {
this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code;
});
} else {
uni.showToast({
title: res.msg,
......@@ -122,6 +148,13 @@ export default {
});
},
search() {
if (!this.is_submit) {
uni.showToast({
title: '请选择合适库位',
icon: 'error'
});
return false;
}
uni.navigateTo({
url: '/pages/immediatelyStockIn/list?goods_sn=' + this.formParams.goods_sn + '&goods_name=' + this.formParams.goods_name + '&warehouse_id=' + this.formParams.warehouse_id + '&position_id=' + this.formParams.position_id
});
......
<template>
<view class="immediatelyStockIn">
<view class="top row bothSide verCenter">
<view class="top row bothSide verCenter" v-if="countList">
<view class="column rowCenter verCenter box">
<text class="t1">60990</text>
<text class="t1">{{ countList.useable_qtys || 0 }}</text>
<text class="t2">可用库存数量</text>
</view>
<view class="column rowCenter verCenter box">
<text class="t1">103290</text>
<text class="t1">{{ countList.total_qtys || 0 }}</text>
<text class="t2">库存总数量</text>
</view>
</view>
......@@ -15,65 +15,65 @@
<view class="row wrap">
<view class="input-box row verCenter">
<text class="label">库 位:</text>
<text class="text">A65512</text>
<text class="text">{{ item.position_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">容器:</text>
<text class="text">RQ0001</text>
<text class="text">{{ item.container_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">入库批次号:</text>
<text class="text">L-ASN2201010001</text>
<text class="text">{{ item.stock_in_batch_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">库 存 I D:</text>
<text class="text">A65512</text>
<text class="text">{{ item.id }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">入 仓 号:</text>
<text class="text">C12345</text>
<text class="text">--</text>
</view>
<view class="input-box row verCenter">
<text class="label">识 别 码:</text>
<text class="text">2121</text>
<text class="text" style="max-width: 205rpx;">{{ item.identify_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品编码:</text>
<text class="text">C12345</text>
<text class="text">{{ item.goods_sn }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品名称:</text>
<text class="text">2121</text>
<text class="text">{{ item.goods_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">标准品牌:</text>
<text class="text">C12345</text>
<text class="text">{{ item.brand_name }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">D / C:</text>
<text class="text">2121</text>
<text class="text">{{ item.date_code }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">产 地:</text>
<text class="text">美国</text>
<text class="text">{{ item.coo }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">货品品质:</text>
<text class="text">良品</text>
<text class="text">{{ item.quality_format }}</text>
</view>
<view class="input-box row verCenter" style="flex: 0 0 100%;">
<text class="label">其他批次属性:</text>
<text class="text">-</text>
<text class="text">{{ item.other_batch_attr }}</text>
</view>
</view>
<view class="bottom row">
<view class="input-box row verCenter">
<text class="label">库存总数量:</text>
<text class="tt">10000</text>
<text class="tt">{{ item.total_qty }}</text>
</view>
<view class="input-box row verCenter">
<text class="label">可用库存数量:</text>
<text class="tt">1000</text>
<text class="tt">{{ item.useable_qty }}</text>
</view>
</view>
</view>
......@@ -92,11 +92,12 @@ export default {
data() {
return {
list: [],
countList: '',
formParams: {
goods_sn: '',
goods_name: '',
warehouse_id: '',
position_id: ''
position_code: ''
}
};
},
......@@ -104,7 +105,7 @@ export default {
this.formParams.goods_sn = options.goods_sn || '';
this.formParams.goods_name = options.goods_name || '';
this.formParams.warehouse_id = options.warehouse_id || '';
this.formParams.position_id = options.position_id || '';
this.formParams.position_code = options.position_code || '';
},
onShow() {
this.getData();
......@@ -114,9 +115,10 @@ export default {
* 获取列表数据
*/
getData() {
this.request(API.getToPrintList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
this.request(API.searchStockList, 'POST', this.formParams, true).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.countList = res.data.countList;
} else {
uni.showToast({
title: res.msg,
......
......@@ -12,65 +12,56 @@
<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" v-model="searchParams.container_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 curr">
<view class="check-box-icon"></view>
<view class="list row bothSide" v-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index">
<view class="text-item row verCenter">
<text class="label">容器:</text>
<text class="t1">A00001</text>
<text class="t1">{{ item.container_sn }}</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">任 务 数:</text>
<text class="tt">8</text>
<text class="tt">{{ item.total_tally_ids }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">理货数量:</text>
<text class="tt">500</text>
<text class="tt">{{ item.total_tally_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">待上架数量:</text>
<text class="tt">500</text>
<text class="tt">{{ item.total_pending_shelf_qty }}</text>
</view>
<navigator class="btn-box row" url="/pages/putaway/packSingle" hover-class="none"><view class="btn row rowCenter verCenter">选择</view></navigator>
<navigator class="btn-box row" :url="'/pages/putaway/packSingle?container_id=' + item.container_id + '&container_sn=' + item.container_sn" hover-class="none"><view class="btn row rowCenter verCenter">选择</view></navigator>
</view>
<view class="box" v-for="(item, index) in 10">
<view class="check-box-icon"></view>
<view class="text-item row verCenter">
<text class="label">容器:</text>
<text class="t1">A00001</text>
</view>
<view class="bor row"></view>
<view class="text-item row verCenter">
<text class="label">任 务 数:</text>
<text class="tt">8</text>
</view>
<view class="text-item row verCenter">
<text class="label">理货数量:</text>
<text class="tt">500</text>
</view>
<view class="text-item row verCenter">
<text class="label">待上架数量:</text>
<text class="tt">500</text>
</view>
<navigator class="btn-box row" url="/pages/putaway/packSingle" 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>
</template>
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {
input_flag: false,
page: 1,
limit: 1000,
index: 0,
array: ['容器']
array: ['容器'],
list: [],
searchParams: {
container_sn: ''
}
};
},
onNavigationBarButtonTap(e) {
......@@ -81,10 +72,49 @@ export default {
});
}
},
onShow() {
this.getData();
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 清空数据
*/
clearInput() {
this.input_flag = false;
this.searchParams.container_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.onShelfByContainerCountList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
}
}
};
......
......@@ -6,94 +6,91 @@
<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" v-model="searchParams.container_sn" @input="handleInput(1, $event)" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view>
</view>
<view class="right">
<view class="row bothSide verCenter" style="margin-bottom: 10rpx;">
<view class="title" style="margin-bottom: 0;">库位:</view>
<view class="tip-box row verCenter">
<text class="iconfont icon-a-juxing4"></text>
<text class="t1">推荐库位:</text>
<text class="t2">A001 A货架01位</text>
</view>
</view>
<view class="search-bar row bothSide verCenter">
<view class="row bothSide verCenter" style="margin-bottom: 10rpx;"><view class="title" style="margin-bottom: 0;">库位:</view></view>
<view class="search-bar row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<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" v-model="searchParams.position_code" @input="handleInput(2, $event)" />
</view>
<text class="iconfont icon-a-juxing11"></text>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_position"></text>
</view>
</view>
</view>
<view class="info-box row">
<view class="text-item row verCenter" style="flex: 0 0 100%;">
<view class="text-item row verCenter" style="flex: 0 0 100%;" v-if="info">
<text class="label">容 器:</text>
<text class="t1">A00001</text>
<text class="t1">{{ info.container_sn }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">任 务 数:</text>
<text class="tt">8</text>
<text class="tt">{{ info.total_tally_ids }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">理货数量:</text>
<text class="tt">5000</text>
<text class="tt">{{ info.total_tally_qty }}</text>
</view>
<view class="text-item row verCenter">
<text class="label">待上架数量:</text>
<text class="tt">5000</text>
<text class="tt">{{ info.total_pending_shelf_qty }}</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">
<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="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>
<view class="btn-box row" @click="showDrawer()"><view class="btn row rowCenter verCenter">详情</view></view>
<view class="btn-box row" @click="showDrawer(item.stock_in_batch_sn)"><view class="btn row rowCenter verCenter">详情</view></view>
</view>
</view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter">上 架</view></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" :class="{ 'btn-disabled': !is_submit }" @click="oneKeyPutawayAction">上 架</view></view>
<!-- 上架记录详情弹窗 -->
<uni-drawer ref="showRight" mode="right">
<view class="uni-drawer-tally-receive-detail">
<view class="uni-drawer-tally-receive-detail" v-if="detail">
<view class="title row rowCenter verCenter">
<text class="iconfont icon-juxing2" @click="closeDrawer()"></text>
<text class="text">详情</text>
......@@ -101,19 +98,19 @@
<view class="field-item row" style="margin-top: 39rpx;">
<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">A00001</text>
<text class="text">{{ detail.container_name }}</text>
</view>
</view>
<view class="bor"></view>
......@@ -121,100 +118,78 @@
<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" style="flex: 0 0 100%;">
<text class="label">货品品质:</text>
<text class="tt">良品</text>
<text class="tt">{{ detail.quality_format }}</text>
</view>
<view class="item row verCenter" style="flex: 0 0 100%;margin-bottom: 17rpx;">
<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">100000</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;">5000</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>
</view>
<text class="tt" style="color: #F98119;">{{ detail.pending_shelf_qty }}</text>
</view>
<view class="bor"></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>
<view class="bor"></view>
<view class="field-item row">
<view class="item row verCenter">
<text class="label">销 售 员:</text>
<text class="tt">100000</text>
<text class="tt">{{ detail.sale_user }}</text>
</view>
<view class="item row verCenter">
<text class="label">采 购 员:</text>
<text class="tt">PCS</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="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>
</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="tt">{{ detail.create_name }}</text>
</view>
</view>
<view class="btn row verCenter bothSide"><view class="btn1 row rowCenter verCenter">提交</view></view>
</view>
</uni-drawer>
</view>
......@@ -222,9 +197,26 @@
<script>
import { API } from '@/util/api.js';
import debounce from 'lodash/debounce';
export default {
data() {
return {};
return {
is_submit: true,
input_flag: false,
input_position: false,
page: 1,
limit: 1000,
index: 0,
list: [],
info: {},
detail: {},
position_code: [], //存储库位编码
searchParams: {
container_sn: '', //容器编码
position_code: '' //库位编码
}
};
},
onNavigationBarButtonTap(e) {
console.log(e);
......@@ -234,12 +226,137 @@ export default {
});
}
},
onLoad(options) {
this.searchParams.container_sn = options.container_sn || '';
},
onShow() {
this.getData();
},
methods: {
showDrawer() {
this.$refs.showRight.open();
showDrawer(stock_in_batch_sn) {
this.getStockShelfInfoByBatchSn(stock_in_batch_sn);
},
closeDrawer() {
this.$refs.showRight.close();
},
/**
* 清空数据
*/
clearInput(type) {
if (type == 1) {
this.input_flag = false;
this.searchParams.container_sn = '';
} else if (type == 2) {
this.input_position = false;
this.searchParams.position_code = '';
}
this.getData();
},
/**
* 单号搜索
* @param {Object} event
*/
handleInput: debounce(function(type, event) {
var val = event.target.value;
if (val) {
if (type == 1) {
this.searchParams.container_sn = val;
this.input_flag = true;
} else if (type == 2) {
this.searchParams.position_code = val;
this.input_position = true;
this.getWhPositionList(this.list[0].warehouse_id, this.list[0].stock_in_type);
}
} else {
if (type == 1) {
this.input_flag = false;
this.searchParams.container_sn = '';
} else if (type == 2) {
this.input_position = false;
this.searchParams.position_code = '';
}
}
this.getData();
}, 500),
/**
* 获取列表数据
*/
getData() {
this.request(API.onShelfByContainerListAction, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
this.list = res.data.list;
this.info = res.data.info;
}
});
},
/**
* 获取库位
*/
getWhPositionList(warehouse_id, stock_in_type) {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => {
var position_code = this.searchParams.position_code;
if (res.code === 0) {
this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code;
});
} else {
uni.showToast({
title: res.msg,
icon: 'error'
});
}
});
},
/**
* 获取详情数据
*/
getStockShelfInfoByBatchSn(stock_in_batch_sn) {
this.request(API.getStockShelfInfoByBatchSn, 'POST', { stock_in_batch_sn: stock_in_batch_sn }, true).then(res => {
if (res.code === 0) {
this.detail = res.data;
this.$refs.showRight.open();
}
});
},
/**
* 上架
*/
oneKeyPutawayAction() {
if (!this.searchParams.position_code) {
uni.showToast({
title: '请输入库位',
icon: 'error'
});
return false;
}
if (!this.is_submit) {
uni.showToast({
title: '请输入合适库位s',
icon: 'error'
});
return false;
}
var tally_ids = this.list.map(function(item) {
return item.tally_id;
});
this.request(API.oneKeyPutawayAction, 'POST', { position_code: this.searchParams.position_code, tally_ids: tally_ids.join(',') }, true).then(res => {
if (res.code === 0) {
uni.showToast({
title: '上架成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
}
}
};
......
......@@ -127,3 +127,11 @@ image {
color: #484b59;
}
}
.error-style {
border: 1px solid #f00000 !important;
}
.btn-disabled {
opacity: 0.5;
}
......@@ -202,7 +202,23 @@ const API = {
/**
* 提交上架
* */
submitOnShelf: API_BASE + '/api/h5/stockIn/submitOnShelf'
submitOnShelf: API_BASE + '/api/h5/stockIn/submitOnShelf',
/**
* 按容器上架列表
* */
onShelfByContainerCountList: API_BASE + '/api/h5/stockIn/onShelfByContainerCountList',
/**
* 按容器上架操作页面
* */
onShelfByContainerListAction: API_BASE + '/api/h5/stockIn/onShelfByContainerListAction',
/**
* 获取仓库
* */
getWareHouselist: API_BASE + '/api/warehouse/getWareHouselist',
/**
* 库存查询
* */
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