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) {
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;
}
bindPickerChange: function(e) {
this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_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>
</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>
<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>
<!-- 无数据展示 -->
<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'
});
}
});
}
}
};
......
......@@ -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