Commit c80c1180 by LJM

js

parent dd3ec76a
.tallyReceive { .tallyReceive {
padding: 15rpx 22rpx; padding: 15rpx 22rpx;
.search-box { .search-box {
border: 1px solid transparent;
height: 60rpx; height: 60rpx;
background: #ffffff; background: #ffffff;
border-radius: 10rpx; border-radius: 10rpx;
...@@ -39,6 +40,16 @@ ...@@ -39,6 +40,16 @@
color: #c6c7cc; color: #c6c7cc;
} }
} }
.text {
padding-left: 30rpx;
width: 164rpx;
height: 35rpx;
line-height: 35rpx;
border-right: 1px solid #f0f0f2;
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
} }
.search-type { .search-type {
margin-top: 10rpx; margin-top: 10rpx;
...@@ -280,6 +291,58 @@ ...@@ -280,6 +291,58 @@
} }
} }
} }
.search-box {
border: 1px solid transparent;
height: 60rpx;
background: #ffffff;
border-radius: 10rpx;
padding: 0 18rpx 0 0;
border: 1px solid #1969f9;
.sn {
width: 164rpx;
height: 35rpx;
border-right: 1px solid #f0f0f2;
.uni-input {
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
.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;
}
}
.search-bar {
width: calc(100% - 164rpx);
.icon-juxing1 {
font-size: 30rpx;
color: #919399;
margin-left: 17rpx;
margin-right: 13rpx;
}
.uni-input {
font-size: 18rpx;
color: #484b59;
}
.icon-a-juxing11 {
font-size: 30rpx;
color: #c6c7cc;
}
}
.text {
padding-left: 30rpx;
width: 164rpx;
height: 35rpx;
line-height: 35rpx;
border-right: 1px solid #f0f0f2;
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
}
.search { .search {
padding-right: 18rpx; padding-right: 18rpx;
width: 398rpx; width: 398rpx;
......
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
color: #c6c7cc; color: #c6c7cc;
} }
} }
.text {
padding-left: 30rpx;
width: 164rpx;
height: 35rpx;
line-height: 35rpx;
border-right: 1px solid #f0f0f2;
font-size: 18rpx;
color: #292b33;
font-weight: bold;
}
} }
.search-type { .search-type {
margin-top: 10rpx; margin-top: 10rpx;
......
<template> <template>
<view class="tallyReceive"> <view class="tallyReceive">
<view class="search-box row bothSide verCenter"> <view class="search-box row bothSide verCenter" style="margin-bottom: 20rpx;">
<view class="sn row rowCenter verCenter"> <view class="sn row rowCenter verCenter">
<picker @change="bindPickerChange" :value="index" :range="array"> <picker @change="bindPickerChange" :value="index" :range="array">
<view class="row verCenter"> <view class="row verCenter">
...@@ -22,20 +22,18 @@ ...@@ -22,20 +22,18 @@
<input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(3, $event)" /> <input class="uni-input" placeholder="请输入入仓号" placeholder-style="color:#919399" focus v-model="searchParams.stock_in_with_stock_in_items_inhouse" @input="handleInput(3, $event)" />
</template> </template>
</view> </view>
<text class="iconfont icon-a-juxing11" @click="clearInput()" v-if="input_flag"></text> <text class="iconfont icon-a-juxing11" @click="clearInput(1)" v-if="input_flag"></text>
</view> </view>
</view> </view>
<!-- 容器选择 --> <!-- 容器选择 -->
<view class="search-type row verCenter bothSide"> <view class="search-box row bothSide verCenter" :class="{ 'error-style': !is_submit }">
<view class="text">容 器</view> <view class="text">容 器</view>
<view class="search-width row verCenter" v-if="tallyContainer.length > 0"> <view class="search-bar row bothSide verCenter">
<text class="iconfont icon-juxing1"></text> <view class="row verCenter">
<picker @change="bindPickerContainChange" :value="indexContainer" :range="tallyContainer" range-key="name" style="width: 100%;height: 100%;"> <text class="iconfont icon-juxing1"></text>
<view class="row verCenter bothSide wrap"> <input class="uni-input" placeholder="请输入容器编码" placeholder-style="color:#919399" focus v-model="searchParams.container_name" @input="handleInput(4, $event)" />
<view class="uni-input row verCenter">{{ indexContainer == -1 ? '请选择' : tallyContainer[indexContainer].name }}</view> </view>
<view class="uni-arrow"></view> <text class="iconfont icon-a-juxing11" @click="clearInput(2)" v-if="input_contaion"></text>
</view>
</picker>
</view> </view>
</view> </view>
<view class="section"> <view class="section">
...@@ -156,7 +154,7 @@ ...@@ -156,7 +154,7 @@
<text class="check-box-icon" :class="{ curr: print_flag }"></text> <text class="check-box-icon" :class="{ curr: print_flag }"></text>
<text class="text">打印入库标签</text> <text class="text">打印入库标签</text>
</view> </view>
<view class="btn2 row rowCenter verCenter" @click="createTallyReceive">理 货</view> <view class="btn2 row rowCenter verCenter" @click="createTallyReceive" :class="{ 'btn-disabled': !is_submit }">理 货</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -169,6 +167,7 @@ import w_md5 from '@/util/md5.js'; ...@@ -169,6 +167,7 @@ import w_md5 from '@/util/md5.js';
export default { export default {
data() { data() {
return { return {
is_submit: true,
stock_in_item_id: '', stock_in_item_id: '',
stock_in_id: '', stock_in_id: '',
noexebshowFalg: true, //控制是否会触发生命周期 noexebshowFalg: true, //控制是否会触发生命周期
...@@ -188,7 +187,8 @@ export default { ...@@ -188,7 +187,8 @@ export default {
stock_in_sn: '', //入库单号 stock_in_sn: '', //入库单号
tracking_no: '', //物流单号 tracking_no: '', //物流单号
stock_in_with_stock_in_items_inhouse: '', //入仓单号 stock_in_with_stock_in_items_inhouse: '', //入仓单号
container_id: '' //容器 container_name: '', //容器编码
container_id: '' //容器id
}, },
formParams: { formParams: {
tally_qty: '', //理货数量, tally_qty: '', //理货数量,
...@@ -205,11 +205,12 @@ export default { ...@@ -205,11 +205,12 @@ export default {
onLoad(options) { onLoad(options) {
this.stock_in_item_id = options.stock_in_item_id || ''; this.stock_in_item_id = options.stock_in_item_id || '';
this.stock_in_id = options.stock_in_id || ''; this.stock_in_id = options.stock_in_id || '';
this.searchParams.container_name = options.container_name || '';
this.searchParams.container_id = options.container_id || '';
}, },
onShow() { onShow() {
if (this.noexebshowFalg) { if (this.noexebshowFalg) {
this.getData(); this.getData();
this.getTallyContainer();
} }
}, },
watch: { watch: {
...@@ -264,16 +265,22 @@ export default { ...@@ -264,16 +265,22 @@ export default {
/** /**
* 清空数据 * 清空数据
*/ */
clearInput() { clearInput(type) {
this.input_flag = false; if (type == 1) {
if (this.index == 0) { this.input_flag = false;
this.searchParams.tracking_no = ''; if (this.index == 0) {
} else if (this.index == 1) { this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = ''; } else if (this.index == 1) {
} else if (this.index == 2) { this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = ''; } else if (this.index == 2) {
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
}
this.stock_in_item_id = this.detail.stock_in_item_id;
} else {
this.input_contaion = false;
this.searchParams.container_name = '';
this.searchParams.container_id = '';
} }
this.stock_in_item_id = this.detail.stock_in_item_id;
this.getData(); this.getData();
}, },
/** /**
...@@ -282,24 +289,44 @@ export default { ...@@ -282,24 +289,44 @@ export default {
*/ */
handleInput: debounce(function(type, event) { handleInput: debounce(function(type, event) {
var val = event.target.value; var val = event.target.value;
this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
if (val) { if (val) {
this.stock_in_item_id = '';
if (type == 1) { if (type == 1) {
this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
this.searchParams.tracking_no = val; this.searchParams.tracking_no = val;
this.input_flag = true;
this.getData();
} else if (type == 2) { } else if (type == 2) {
this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
this.searchParams.stock_in_sn = val; this.searchParams.stock_in_sn = val;
this.input_flag = true;
this.getData();
} else if (type == 3) { } else if (type == 3) {
this.searchParams.tracking_no = '';
this.searchParams.stock_in_sn = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = '';
this.searchParams.stock_in_with_stock_in_items_inhouse = val; this.searchParams.stock_in_with_stock_in_items_inhouse = val;
this.input_flag = true;
this.getData();
} else if (type == 4) {
this.searchParams.container_name = val;
this.input_contaion = true;
this.getTallyContainer();
} }
this.input_flag = true;
} else { } else {
this.stock_in_item_id = this.detail.stock_in_item_id; if (type == 1 || type == 2 || type == 3) {
this.input_flag = false; this.input_flag = false;
this.getData();
} else if (type == 4) {
this.input_contaion = false;
}
} }
this.getData();
}, 500), }, 500),
/** /**
* 获取详情数据 * 获取详情数据
...@@ -334,7 +361,24 @@ export default { ...@@ -334,7 +361,24 @@ export default {
getTallyContainer() { getTallyContainer() {
this.request(API.getTallyContainer, 'GET', {}, false).then(res => { this.request(API.getTallyContainer, 'GET', {}, false).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tallyContainer = res.data.list; var name = this.searchParams.container_name;
this.is_submit = res.data.list.some(function(obj) {
return obj.name === name;
});
if (this.is_submit) {
var id = res.data.list.filter(function(item) {
if (item.name == name) {
return {
id: item.id
};
}
});
this.searchParams.container_id = id[0].id;
this.formParams.container_id = id[0].id;
} else {
this.searchParams.container_id = '';
this.formParams.container_id = '';
}
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
...@@ -420,11 +464,17 @@ export default { ...@@ -420,11 +464,17 @@ export default {
* 理货提交 * 理货提交
*/ */
createTallyReceive() { createTallyReceive() {
if (this.searchParams.container_id == '') { if (!this.searchParams.container_id) {
uni.showModal({ uni.showToast({
itle: '提示', title: '请输入容器',
content: '请选择容器', icon: 'error'
showCancel: false });
return false;
}
if (!this.is_submit) {
uni.showToast({
title: '请输入正确容器',
icon: 'error'
}); });
return false; return false;
} }
......
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