Commit cec9f027 by LJM

css

parent 964be966
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<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>
<input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" v-model="searchParams.position_name" @input="handleInput(1, searchParams.position_name)" /> <input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" focus v-model="searchParams.position_name" @input="handleInput(1, searchParams.position_name)" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag_position_name"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag_position_name"></text>
</view> </view>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<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>
<input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" /> <input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput(2, searchParams.stock_in_batch_sn)" maxlength="15" />
</view> </view>
<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>
...@@ -489,10 +489,18 @@ export default { ...@@ -489,10 +489,18 @@ export default {
if (val) { if (val) {
if (type == 1) { if (type == 1) {
this.input_flag_position_name = true; this.input_flag_position_name = true;
this.getData();
} else if (type == 2) { } else if (type == 2) {
this.input_flag_stock_in_batch_sn = true; this.input_flag_stock_in_batch_sn = true;
this.getData();
setTimeout(() => {
if (this.searchParams.stock_in_batch_sn.length == 15 && this.list.length == 1) {
this.showDrawer(1, this.list[0]);
}
}, 1000);
} else if (type == 3) { } else if (type == 3) {
this.input_flag_container_sn = true; this.input_flag_container_sn = true;
this.getData();
} }
} else { } else {
if (type == 1) { if (type == 1) {
...@@ -503,7 +511,6 @@ export default { ...@@ -503,7 +511,6 @@ export default {
this.input_flag_container_sn = false; this.input_flag_container_sn = false;
} }
} }
this.getData();
}, 500) }, 500)
} }
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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>
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_batch_sn" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_batch_sn" @input="handleInput" maxlength="15" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
...@@ -91,15 +91,7 @@ ...@@ -91,15 +91,7 @@
<view class="pack"> <view class="pack">
<view class="h2">库位:</view> <view class="h2">库位:</view>
<view class="row verCenter bothSide"> <view class="row verCenter bothSide">
<view class="search row bothSide verCenter" style="width: 100%;"> <view class="search row bothSide verCenter" :class="{ 'error-style': !is_submit }" style="width: 100%;"><input type="text" placeholder-style="color:#919399" class="uni-input" placeholder="请输入库位编码" @input="inputPositionCodeChange()" v-model="formParams.position_code" /></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> </view>
<view class="btn row verCenter bothSide"> <view class="btn row verCenter bothSide">
...@@ -119,18 +111,20 @@ import debounce from 'lodash/debounce'; ...@@ -119,18 +111,20 @@ import debounce from 'lodash/debounce';
export default { export default {
data() { data() {
return { return {
is_submit: true,
input_flag: false, input_flag: false,
page: 1, page: 1,
limit: 1000, limit: 1000,
index: 0, index: 0,
array: ['入库批次号'], array: ['入库批次号'],
indexPosition: -1,
list: [], list: [],
position: [], //库位 position: [], //库位
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
warehouse_id: '',
stock_in_type: '',
formParams: { formParams: {
position_id: '' position_code: ''
}, },
searchParams: { searchParams: {
stock_in_batch_sn: '' //入库批次号 stock_in_batch_sn: '' //入库批次号
...@@ -175,7 +169,8 @@ export default { ...@@ -175,7 +169,8 @@ export default {
if (isAllElementsEqual) { if (isAllElementsEqual) {
this.$refs.showRight.open(); this.$refs.showRight.open();
this.getWhPositionList(warehouse_id[0], stock_in_type[0]); this.warehouse_id = warehouse_id[0];
this.stock_in_type = stock_in_type[0];
} else { } else {
uni.showToast({ uni.showToast({
title: '请勾选相同仓库', title: '请勾选相同仓库',
...@@ -239,10 +234,23 @@ export default { ...@@ -239,10 +234,23 @@ export default {
var val = event.target.value; var val = event.target.value;
if (val) { if (val) {
this.input_flag = true; this.input_flag = true;
this.getData();
setTimeout(() => {
if (this.list.length == 1) {
uni.navigateTo({
url: '/pages/putaway/single?stock_in_batch_sn=' + this.list[0].stock_in_batch_sn + '&tally_id=' + this.list[0].tally_id
});
}
}, 1000);
} else { } else {
this.input_flag = false; this.input_flag = false;
} }
this.getData(); }, 500),
/**
* 监听库位编码
*/
inputPositionCodeChange: debounce(function(event) {
this.getWhPositionList();
}, 500), }, 500),
/** /**
* 获取列表数据 * 获取列表数据
...@@ -263,14 +271,12 @@ export default { ...@@ -263,14 +271,12 @@ export default {
/** /**
* 获取库位 * 获取库位
*/ */
getWhPositionList(warehouse_id, stock_in_type) { getWhPositionList() {
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: this.warehouse_id, stock_in_type: this.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({
...@@ -284,14 +290,14 @@ export default { ...@@ -284,14 +290,14 @@ export default {
* 一键上架 * 一键上架
*/ */
oneKeyPutawayAction() { oneKeyPutawayAction() {
if (!this.formParams.position_id) { if (!this.formParams.position_code) {
uni.showToast({ uni.showToast({
title: '请选择库位', title: '请输入库位编码',
icon: 'error' icon: 'error'
}); });
return false; return false;
} }
this.request(API.oneKeyPutawayAction, 'POST', { position_id: this.formParams.position_id, tally_ids: this.filter_id.join(',') }, true).then(res => { this.request(API.oneKeyPutawayAction, 'POST', { position_code: this.formParams.position_code, tally_ids: this.filter_id.join(',') }, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
uni.showToast({ uni.showToast({
title: '一键上架成功', title: '一键上架成功',
......
...@@ -100,6 +100,13 @@ export default { ...@@ -100,6 +100,13 @@ export default {
this.input_flag = false; this.input_flag = false;
} }
this.getData(); this.getData();
setTimeout(() => {
if (this.list.length == 1) {
uni.navigateTo({
url: '/pages/putaway/packSingle?container_id=' + this.list[0].container_id + '&container_sn=' + this.list[0].container_sn
});
}
}, 1000);
}, 500), }, 500),
/** /**
* 获取列表数据 * 获取列表数据
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="search-bar row bothSide verCenter" :class="{ 'error-style': !is_submit }"> <view class="search-bar row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<view class="row verCenter"> <view class="row verCenter">
<text class="iconfont icon-juxing1"></text> <text class="iconfont icon-juxing1"></text>
<input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" v-model="searchParams.position_code" @input="handleInput(2, $event)" /> <input class="uni-input" placeholder="请扫描或输入库位" placeholder-style="color:#919399" v-model="searchParams.position_code" @input="handleInput(2, $event)" focus />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_position"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_position"></text>
</view> </view>
......
...@@ -31,6 +31,26 @@ ...@@ -31,6 +31,26 @@
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
</view> </view>
<view class="radio-wrap row verCenter" style="padding-bottom: 0;">
<radio-group name="radio1">
<label>
<radio value="1" style="transform:scale(0.7)" :checked="filter_checkbox[0]" color="#1969f9" @click="toggle(0)" />
<text>采购入库</text>
</label>
</radio-group>
<radio-group name="radio2">
<label>
<radio value="4" style="transform:scale(0.7)" :checked="filter_checkbox[1]" color="#1969f9" @click="toggle(1)" />
<text>委托入库</text>
</label>
</radio-group>
<radio-group name="radio3">
<label>
<radio value="2" style="transform:scale(0.7)" :checked="filter_checkbox[2]" color="#1969f9" @click="toggle(2)" />
<text>退货入库</text>
</label>
</radio-group>
</view>
<view class="radio-wrap row verCenter"> <view class="radio-wrap row verCenter">
<radio-group name="radio" @change="radioChange"> <radio-group name="radio" @change="radioChange">
<label> <label>
...@@ -247,7 +267,9 @@ export default { ...@@ -247,7 +267,9 @@ export default {
filter_list: [], //筛选已选中的列表 filter_list: [], //筛选已选中的列表
filter_id: [], //过滤处理的id filter_id: [], //过滤处理的id
detail: {}, detail: {},
filter_checkbox: [true, true, true],
searchParams: { searchParams: {
stock_in_type: '1,4,2',
search_type: 1, search_type: 1,
search_keyword: '', search_keyword: '',
shelf_status: 0 shelf_status: 0
...@@ -309,6 +331,19 @@ export default { ...@@ -309,6 +331,19 @@ export default {
this.filter_id = []; this.filter_id = [];
} }
}, },
toggle(index) {
var ids = [1, 4, 2];
this.$set(this.filter_checkbox, index, (this.filter_checkbox[index] = !this.filter_checkbox[index]));
let filter_arr = this.findIndex(this.filter_checkbox, true);
var filteredIds = filter_arr.map(function(i) {
return ids[i];
});
this.searchParams.stock_in_type = filteredIds.join(',');
this.getData();
},
/** /**
* 清空数据 * 清空数据
*/ */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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>
<input class="uni-input" placeholder="请扫描或输入容器码" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_batch_sn" @input="handleInput" /> <input class="uni-input" placeholder="请扫描或输入入库批次号" placeholder-style="color:#919399" v-model="searchParams.stock_in_batch_sn" @input="handleInput" />
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text>
</view> </view>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
</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="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> <view class="input-box"><input focus :class="{ 'error-style': !is_submit }" type="text" class="uni-input" placeholder-style="color:#919399" placeholder="请输入库位编码" v-model="formParams.position_code" @input="inputPositionCodeChange()" /></view>
</view> </view>
<view class="bor"></view> <view class="bor"></view>
<view class="tip-box row verCenter" v-if="workingRule"> <view class="tip-box row verCenter" v-if="workingRule">
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" :class="{ 'btn-disabled': !is_submit }" @click="stockShelfByBatchSnAction()">上 架</view></view> <view class="fix-btn row verCenter"><view class="btn1 row rowCenter verCenter" @click="stockShelfByBatchSnAction()">上 架</view></view>
</view> </view>
</template> </template>
...@@ -290,13 +290,6 @@ export default { ...@@ -290,13 +290,6 @@ export default {
}); });
return false; return false;
} }
if (!this.is_submit) {
uni.showToast({
title: '请输入合适库位',
icon: 'error'
});
return false;
}
var pending_shelf_qty = Number(this.detail.pending_shelf_qty); var pending_shelf_qty = Number(this.detail.pending_shelf_qty);
this.request(API.stockShelfByBatchSnAction, 'POST', this.formParams, true).then(res => { this.request(API.stockShelfByBatchSnAction, 'POST', this.formParams, true).then(res => {
......
...@@ -315,10 +315,13 @@ export default { ...@@ -315,10 +315,13 @@ export default {
toggle(index) { toggle(index) {
var ids = [1, 4, 2]; var ids = [1, 4, 2];
this.$set(this.filter_checkbox, index, (this.filter_checkbox[index] = !this.filter_checkbox[index])); this.$set(this.filter_checkbox, index, (this.filter_checkbox[index] = !this.filter_checkbox[index]));
let filter_arr = this.findIndex(this.filter_checkbox, true); let filter_arr = this.findIndex(this.filter_checkbox, true);
var filteredIds = filter_arr.map(function(index) {
return ids[index]; var filteredIds = filter_arr.map(function(i) {
return ids[i];
}); });
this.searchParams.stock_tally_with_stock_in_stock_in_type_in = filteredIds.join(','); this.searchParams.stock_tally_with_stock_in_stock_in_type_in = filteredIds.join(',');
this.getData(); this.getData();
}, },
......
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