Commit 6282268f by LJM

bug

parent 5dd89ad9
<template> <template>
<view class="immediatelyStockIn"> <view class="immediatelyStockIn">
<!-- 仓库 -->
<view class="form-input row verCenter">
<text class="text row verCenter">仓 库</text>
<view class="row bothSide verCenter select-wrap">
<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] ? warehouse_id_data[warehouse_id_index].name : '' }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 入库批次号&旧标签 --> <!-- 入库批次号&旧标签 -->
<view class="form-input row verCenter"> <view class="form-input row verCenter">
<view class="pick-box row verCenter"> <view class="pick-box row verCenter">
...@@ -48,18 +60,6 @@ ...@@ -48,18 +60,6 @@
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_goods_name"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_goods_name"></text>
</view> </view>
</view> </view>
<!-- 仓库 -->
<view class="form-input row verCenter">
<text class="text row verCenter">仓 库</text>
<view class="row bothSide verCenter select-wrap">
<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] ? warehouse_id_data[warehouse_id_index].name : '' }}</view>
<view class="uni-arrow"></view>
</view>
</picker>
</view>
</view>
<!-- 库位 --> <!-- 库位 -->
<view class="form-input row verCenter" :class="{ 'error-style': !is_submit }"> <view class="form-input row verCenter" :class="{ 'error-style': !is_submit }">
<text class="text row verCenter">库 位</text> <text class="text row verCenter">库 位</text>
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
is_focus3: false, is_focus3: false,
is_focus4: false, is_focus4: false,
is_submit: true, is_submit: true,
index: 0,
item: ['货品编码', '自营货品ID'], item: ['货品编码', '自营货品ID'],
index: 0,
item_1: ['入库批次号', '旧标签'], item_1: ['入库批次号', '旧标签'],
index_1: 0, index_1: 0,
input_stock_in_batch_sn: false, input_stock_in_batch_sn: false,
...@@ -96,12 +96,12 @@ ...@@ -96,12 +96,12 @@
position_id_index: 0, position_id_index: 0,
warehouse_id_data: [], warehouse_id_data: [],
formParams: { formParams: {
stock_in_batch_sn: '', stock_in_batch_sn: '', //入库批次号
sku_id: '', sku_id: '', //自营货品ID
goods_sn: '', goods_sn: '', //货品编码
goods_name: '', goods_name: '', //货品名称
warehouse_id: '', warehouse_id: '', //仓库
position_code: '' position_code: '' //库位
} }
}; };
}, },
...@@ -128,9 +128,28 @@ ...@@ -128,9 +128,28 @@
this.index_1 = e.detail.value; this.index_1 = e.detail.value;
this.clearInputAndFocus(4); //再次获取焦点 this.clearInputAndFocus(4); //再次获取焦点
} else { } else {
//仓库选择 //仓库选择 如果仓库切换,就清空其他数据
this.warehouse_id_index = e.detail.value; this.warehouse_id_index = e.detail.value;
this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value; this.formParams.warehouse_id = this.warehouse_id_data[e.detail.value].value;
//货品编码&自营货品ID
this.formParams.goods_sn = '';
this.formParams.sku_id = '';
this.input_goods_sn = false;
// 货品名称
this.formParams.goods_name = '';
this.input_goods_name = false;
//库位
this.formParams.position_code = '';
this.input_position = false;
//入库批次号 旧标签
this.formParams.stock_in_batch_sn = '';
this.input_stock_in_batch_sn = false;
this.is_submit = true;
} }
console.log('picker发送选择改变,携带值为', e.detail.value); console.log('picker发送选择改变,携带值为', e.detail.value);
}, },
...@@ -157,6 +176,7 @@ ...@@ -157,6 +176,7 @@
this.formParams.position_code = ''; this.formParams.position_code = '';
this.input_position = false; this.input_position = false;
this.clearInputAndFocus(3); //再次获取焦点 this.clearInputAndFocus(3); //再次获取焦点
this.is_submit = true;
} else if (type == 4) { } else if (type == 4) {
//入库批次号 旧标签 //入库批次号 旧标签
this.formParams.stock_in_batch_sn = ''; this.formParams.stock_in_batch_sn = '';
...@@ -175,6 +195,7 @@ ...@@ -175,6 +195,7 @@
} else if (type == 2) { } else if (type == 2) {
this.input_goods_name = true; this.input_goods_name = true;
} else if (type == 3) { } else if (type == 3) {
//库位
this.input_position = true; this.input_position = true;
this.getWhPositionList(this.formParams.warehouse_id, 0); this.getWhPositionList(this.formParams.warehouse_id, 0);
} else if (type == 4) { } else if (type == 4) {
...@@ -191,14 +212,15 @@ ...@@ -191,14 +212,15 @@
this.input_stock_in_batch_sn = false; this.input_stock_in_batch_sn = false;
} }
} }
}, 500), }, 800),
/** /**
* 获取库存数据 * 获取库存数据
*/ */
getData() { getData() {
this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, false).then(res => { this.request(API.getWareHouselist, 'POST', { warehouse_status: 1 }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.formParams.warehouse_id = res.data.list[0].warehouse_id; this.formParams.warehouse_id = res.data.list[0].warehouse_id; //默认仓库
//仓库集合
this.warehouse_id_data = res.data.list.map(function(item) { this.warehouse_id_data = res.data.list.map(function(item) {
return { return {
name: item.warehouse_name, name: item.warehouse_name,
...@@ -208,7 +230,7 @@ ...@@ -208,7 +230,7 @@
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: 'error' icon: 'none'
}); });
} }
}); });
...@@ -217,9 +239,10 @@ ...@@ -217,9 +239,10 @@
* 获取库位 * 获取库位
*/ */
getWhPositionList(warehouse_id, stock_in_type) { getWhPositionList(warehouse_id, stock_in_type) {
this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, false).then(res => { this.request(API.getWhPositionList, 'POST', { warehouse_id: warehouse_id, stock_in_type: stock_in_type }, true).then(res => {
var position_code = this.formParams.position_code;
if (res.code === 0) { if (res.code === 0) {
var position_code = this.formParams.position_code;
//匹配是否正确的库位
this.is_submit = res.data.list.some(function(obj) { this.is_submit = res.data.list.some(function(obj) {
return obj.position_code === position_code; return obj.position_code === position_code;
}); });
...@@ -240,7 +263,7 @@ ...@@ -240,7 +263,7 @@
return false; return false;
} }
uni.navigateTo({ 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 + '&sku_id=' + this.formParams.sku_id + '&stock_in_batch_sn=' + this.formParams.stock_in_batch_sn url: '/pages/immediatelyStockIn/list?goods_sn=' + this.formParams.goods_sn + '&goods_name=' + this.formParams.goods_name + '&warehouse_id=' + this.formParams.warehouse_id + '&position_code=' + this.formParams.position_code + '&sku_id=' + this.formParams.sku_id + '&stock_in_batch_sn=' + this.formParams.stock_in_batch_sn
}); });
}, },
/** /**
...@@ -248,25 +271,25 @@ ...@@ -248,25 +271,25 @@
*/ */
clearInputAndFocus(type) { clearInputAndFocus(type) {
if (type == 1) { if (type == 1) {
this.input_flag = false; //关闭叉叉 this.input_goods_sn = false; //关闭叉叉
this.is_focus1 = false; this.is_focus1 = false;
setTimeout(() => { setTimeout(() => {
this.is_focus1 = true; this.is_focus1 = true;
}, 200); }, 200);
} else if (type == 2) { } else if (type == 2) {
this.input_flag = false; //关闭叉叉 this.input_goods_name = false;
this.is_focus2 = false; this.is_focus2 = false;
setTimeout(() => { setTimeout(() => {
this.is_focus2 = true; this.is_focus2 = true;
}, 200); }, 200);
} else if (type == 3) { } else if (type == 3) {
this.input_flag = false; //关闭叉叉 this.input_position = false;
this.is_focus3 = false; this.is_focus3 = false;
setTimeout(() => { setTimeout(() => {
this.is_focus3 = true; this.is_focus3 = true;
}, 200); }, 200);
} else if (type == 4) { } else if (type == 4) {
this.input_flag = false; //关闭叉叉 this.input_stock_in_batch_sn = false;
this.is_focus4 = false; this.is_focus4 = false;
setTimeout(() => { setTimeout(() => {
this.is_focus4 = true; this.is_focus4 = true;
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
return { return {
list: [], list: [],
checked: false, checked: false,
countList: '', countList: {},
page: 1, page: 1,
limit: 30, limit: 30,
count: 0, count: 0,
...@@ -197,6 +197,7 @@ ...@@ -197,6 +197,7 @@
this.formParams.sku_id = options.sku_id || ''; this.formParams.sku_id = options.sku_id || '';
}, },
onShow() { onShow() {
this.list = [];
this.getData(); this.getData();
}, },
methods: { methods: {
......
const API_BASE_USER = 'http://user.liexindev.net'; //用户系统 // const API_BASE_USER = 'http://user.liexindev.net'; //用户系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统 // const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE = 'http://wms.liexindev.net'; //WMS系统 // const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统 // const API_BASE_OSS = 'http://image.liexindev.net'; //oss系统
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统 const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统 const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE = 'https://wms.ichunt.net'; //WMS系统 const API_BASE = 'https://wms.ichunt.net'; //WMS系统
// const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统 const API_BASE_OSS = 'https://image.ichunt.net'; //oss系统
const API = { const API = {
......
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