<template>
|
<view>
|
<view>
|
<u-table font-size="25">
|
<u-tr>
|
<u-td>
|
<xfl-select :list="UserArray" :initValue="this.$UserTool.UserInfo.userName" :clearable="false"
|
:disabled="true">
|
</xfl-select>
|
</u-td>
|
<u-td width="25%">现在时间:</u-td>
|
<u-td width="25%">{{date}}</u-td>
|
</u-tr>
|
</u-table>
|
</view>
|
|
<view style="padding: 20rpx 0rpx">
|
<u-table>
|
<u-tr>
|
<u-td width="30%">托盘RFID码</u-td>
|
<u-td>
|
<u-input v-model="value_rfid" :border="true" placeholder="托盘码" id="value_rfid"
|
:focus="value_rfidfocus" />
|
</u-td>
|
</u-tr>
|
|
</u-table>
|
</view>
|
<view style="padding: 0rpx 0rpx;">
|
<u-table>
|
<u-tr>
|
<u-td>
|
<u-button style="width:100px" type="primary" @click="SaveInfomation">确认</u-button>
|
</u-td>
|
</u-tr>
|
</u-table>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
var _this;
|
var _user;
|
export default {
|
data() {
|
return {
|
date: '',
|
CurrentUser: '', //当前用户
|
value_rfid: '',
|
value_qrcode: '',
|
value_rfidfocus: false
|
}
|
},
|
methods: {
|
UserChange(value) {
|
|
},
|
setTimer() {
|
if (this.timer == null) {
|
this.timer = setInterval(() => {
|
this.date = this.$DateTool.getDate();
|
}, 1000)
|
}
|
|
},
|
SaveInfomation() {
|
if (_this.value_rfid.length == 0) {
|
uni.showToast({
|
title: "托盘码不能为空",
|
duration: 2000
|
});
|
return;
|
}
|
if (_this.value_rfid.length > 6) {
|
uni.showToast({
|
title: "托盘长度不能大于6位数。",
|
duration: 2000,
|
icon: 'none',
|
});
|
return;
|
}
|
uni.showModal({
|
title: '提示',
|
content: '请核对托盘码是否正确?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
MainData: {
|
barcode: _this.value_rfid
|
},
|
};
|
_this.$AjaxRequest.Params('post', 'Dt_boxing_head/CreateEmptyPalletTask',
|
data, _user.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
uni.showToast({
|
title: "创建空托入库成功!",
|
duration: 2000
|
});
|
_this.value_rfid = "";
|
_this.value_qrcode = "";
|
_this.value_rfidfocus = true;
|
} else {
|
//console.log(result.data.message);
|
uni.showToast({
|
icon: 'none',
|
title: "请求错误:" + result.data.message,
|
duration: 2000
|
});
|
}
|
}).catch(function(err) {
|
uni.showToast({
|
icon: 'none',
|
title: "请求后台异常,错误信息." + err.errMsg,
|
duration: 2000
|
});
|
});
|
} else if (res.cancel) {
|
this.value_rfidfocus = true;
|
}
|
}
|
});
|
},
|
},
|
created: function() {
|
// 每次进入界面时,先清除之前的所有定时器,然后启动新的定时器
|
clearInterval(this.timer)
|
this.timer = null;
|
this.setTimer();
|
_user = this.$UserTool.UserInfo;
|
this.CurrentUser = _user.userName;
|
this.UserArray = [this.$UserTool.AllUserInfo];
|
this.value_rfidfocus = true;
|
},
|
destroyed: function() {
|
// 每次离开当前界面时,清除定时器
|
clearInterval(this.timer);
|
this.timer = null;
|
},
|
mounted() {
|
_this = this;
|
//_this.queryOrder();
|
},
|
|
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.tdHeight {
|
height: 80rpx;
|
}
|
|
.loopView {
|
height: 160px;
|
background-color: #f0f0f0;
|
margin-top: 10px;
|
}
|
|
.loopItem {
|
margin-top: 5px;
|
margin-left: 15px;
|
|
}
|
|
.deleteBtn {
|
margin-top: 25px;
|
margin-left: 10px;
|
width: 120px;
|
background-color: orangered;
|
}
|
</style>
|