<template>
|
<view>
|
<!-- 搜索框 -->
|
<view class="square-1">
|
<view class="searchBox">
|
<view class="searchIcon"><uni-icons type="search" size="20" color="#dadada"></uni-icons></view>
|
<view class="searchArea">
|
<input v-model="barcode" type="text" placeholder="托盘码" @input="searchByBarcode"
|
placeholder-style="line-height: 85rpx;">
|
</view>
|
<view class="closeIcon"><uni-icons type="closeempty" size="20" color="#dadada"
|
@click="removeBarcode"></uni-icons></view>
|
</view>
|
</view>
|
<!-- 列表头 -->
|
<view class="square-1">
|
<view class="square-title">
|
<view class="title-sign">
|
<view class="sign"></view>
|
</view>
|
<view class="title-text"><text>组托列表</text></view>
|
</view>
|
</view>
|
<scroll-view scroll-y>
|
<checkbox-group @change="checkbox">
|
<view v-for="(item,index) in matList" :key="index" class="data-list bg-false"
|
:class="'bg-'+item.checked">
|
<label class="left-check-box">
|
<!-- <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> -->
|
</label>
|
<view class="data-list-left">
|
<view class="matnr"><text style="width: 700rpx;">品号:{{item.matnr}}</text></view>
|
<view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view>
|
<view><text style="width: 700rpx;">批次:{{item.batch}}</text></view>
|
<view><text style="width: 700rpx;">单号:{{item.orderNo}}</text></view>
|
<view><text style="width: 700rpx;">型号:{{item.model}}</text></view>
|
<view><text style="width: 700rpx;">数量:{{item.anfme}}</text></view>
|
<view>
|
<text style="width: 700rpx;">辅数量:{{item.weight}}</text>
|
</view>
|
</view>
|
<view class="data-list-right">
|
<!-- <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> -->
|
<!-- list中删除键 -->
|
<!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> -->
|
</view>
|
</view>
|
</checkbox-group>
|
<!-- 无数据显示 -->
|
<view class="square-none" v-show="matList.length === 0">
|
<view class="v-show">暂无更多数据...</view>
|
</view>
|
</scroll-view>
|
|
<!-- 底部按钮 -->
|
<view class="footer flex justify-around">
|
<label class="label-btn">
|
<button class="cu-btn bg-blue " @click="uncomb()">取消组托</button>
|
</label>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
commonUrl: null,
|
matList: [],
|
barcode: null
|
|
}
|
},
|
mounted() {
|
const UIP = uni.getStorageSync('UIP');
|
this.baseIP = UIP;
|
const UPORT = uni.getStorageSync('UPORT');
|
this.basePORT = UPORT
|
const PROJ = uni.getStorageSync('UPROJ');
|
this.baseUrl = PROJ
|
this.getUrl()
|
},
|
methods: {
|
// 获取url
|
getUrl() {
|
this.commonUrl = this.baseHttp + this.baseIP + ':' + this.basePORT + "/" + this.baseUrl
|
},
|
checkbox: function() {
|
|
},
|
// 清空托盘码搜索框
|
removeBarcode() {
|
this.barcode = null
|
},
|
request() {
|
let that = this
|
if(that.barcode == null || that.barcode == "") {
|
that.matList = []
|
return;
|
}
|
|
uni.request({
|
url: that.commonUrl + '/waitPakin/list/auth',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
data: {
|
curr: 1,
|
limit: 100,
|
zpallet: that.barcode
|
},
|
method: "GET",
|
success(result) {
|
console.log(result)
|
let res = result.data
|
let records = res.data.records
|
if (res.code == 200) {
|
if (records) {
|
that.matList = records
|
console.log(that.matList)
|
} else {
|
uni.showToast({
|
title: "暂无更多数据",
|
position: 'top',
|
duration: 1000
|
});
|
}
|
} else if (res.code == 403) {
|
uni.showToast({
|
title: res.msg,
|
icon: "none",
|
position: 'top'
|
})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({
|
title: res.msg,
|
icon: "none",
|
position: 'top'
|
})
|
}
|
}
|
})
|
},
|
// 根据托盘码搜索
|
searchByBarcode() {
|
let that = this
|
that.request()
|
},
|
reset() {
|
this.matList = []
|
this.barcode = ""
|
},
|
uncomb() {
|
let that = this;
|
if (that.barcode === '') {
|
uni.showToast({title: '请扫描托盘条码', icon: "none", position: 'top'});
|
return;
|
}
|
uni.showLoading();
|
uni.request({
|
url: that.commonUrl + '/mobile/comb/cancel',
|
data: JSON.stringify({
|
barcode: that.barcode
|
}),
|
method: 'POST',
|
header: {
|
'token':uni.getStorageSync('token')
|
},
|
success(result) {
|
uni.hideLoading();
|
var res = result.data
|
if (res.code === 200) {
|
that.reset();
|
uni.showToast({
|
title: res.msg,
|
position: 'bottom',
|
duration: 1000
|
});
|
} else if (res.code == 403) {
|
uni.showToast({title: res.msg, icon: "none", position: 'top'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
}
|
}
|
});
|
}
|
},
|
}
|
</script>
|
|
<style>
|
.bg-false {
|
background-color: #FFFFFF;
|
}
|
|
.bg-true {
|
background-color: #ebebeb;
|
}
|
|
.data-list {
|
border-bottom: 1px solid #d8d8d8;
|
height: 410rpx;
|
margin: 15rpx;
|
border-radius: 20rpx;
|
}
|
|
.data-list:first-child {
|
margin-top: 20rpx;
|
}
|
|
.data-list:last-child {
|
margin-bottom: 160rpx;
|
}
|
|
/* .data-list-left {
|
display: inline-block;
|
float: left;
|
text-align: center;
|
width: 100rpx;
|
height: 180rpx;
|
line-height: 180rpx;
|
} */
|
.left-check-box {
|
display: inline-block;
|
/* background-color: #1E9FFF; */
|
float: left;
|
height: 100%;
|
width: 100rpx;
|
text-align: center;
|
line-height: 170rpx;
|
}
|
|
.data-list-left {
|
/* background-color: #ffff7f; */
|
display: inline-block;
|
float: left;
|
height: 280rpx;
|
width: 500rpx;
|
color: #676767;
|
}
|
|
.matnr {
|
padding-top: 10rpx;
|
}
|
|
.data-list-right {
|
/* background-color: #55ffff; */
|
display: inline-block;
|
float: right;
|
width: 100rpx;
|
height: 180rpx;
|
line-height: 450rpx;
|
}
|
|
.data-list-right label {
|
display: inline-block;
|
float: left;
|
width: 100rpx;
|
height: 180rpx;
|
}
|
|
.revise-box {
|
width: 500rpx;
|
height: 500rpx;
|
}
|
|
.revise-box-top {
|
width: 100%;
|
height: 100rpx;
|
background-color: #fff;
|
padding: 10rpx;
|
}
|
|
.changeBox {
|
width: 100%;
|
height: 100rpx;
|
line-height: 120rpx;
|
text-align: center;
|
background-color: #FFF;
|
margin-top: 20rpx;
|
border-bottom: 1px solid #e3e3e3;
|
}
|
|
.text-box {
|
width: 100%;
|
height: 100rpx;
|
line-height: 120rpx;
|
text-align: center;
|
/* padding-left: 120rpx; */
|
background-color: #FFF;
|
margin-top: 20rpx;
|
border-bottom: 1px solid #e3e3e3;
|
}
|
|
.changeBox .num-box {
|
display: inline-block;
|
float: left;
|
}
|
|
.changeBox button {
|
float: left;
|
}
|
|
.revise-box-buttom {
|
position: absolute;
|
width: 100%;
|
height: 100rpx;
|
line-height: 100rpx;
|
background-color: #FFFFFF;
|
bottom: 0;
|
text-align: center;
|
}
|
</style>
|