<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" :focus="rfidFocus" placeholder="RFID"
|
@input="value_rfidChange" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">轴承条码</u-td>
|
<u-td>
|
<u-input v-model="value_qrcode" :border="true" :focus="qrcodeFocus"
|
placeholder="轴承条码" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">轴承型号</u-td>
|
<u-td>
|
<u-input v-model="materielType" :border="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">厂家</u-td>
|
<u-td>
|
<u-input v-model="madeUnit" :border="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">车型</u-td>
|
<u-td>
|
<u-input v-model="materielId" :border="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">轴承类别</u-td>
|
<u-td>
|
<u-input v-model="NewOrOld" :border="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">轴承单号</u-td>
|
<u-td>
|
<u-input v-model="LotNumber" :border="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">生产日期</u-td>
|
<u-td>
|
<u-input v-model="ProductDate" :border="true" :focus="prdateFocus" placeholder="生产日期" />
|
</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: '',
|
//厂家
|
madeUnit: '',
|
//车型
|
materielId: '',
|
//轴承型号
|
materielType: '',
|
//检修类型
|
NewOrOld: '',
|
//批次 --2024.6.20新增
|
LotNumber: '',
|
//生产日期 --2024.6.20新增
|
ProductDate: '',
|
rfidFocus: false,
|
qrcodeFocus: false,
|
prdateFocus: false
|
}
|
},
|
methods: {
|
UserChange(value) {
|
|
},
|
setTimer() {
|
if (this.timer == null) {
|
this.timer = setInterval(() => {
|
this.date = this.$DateTool.getDate();
|
}, 1000)
|
}
|
|
},
|
value_rfidChange() {
|
if (_this.value_rfid.length == 6) {
|
_this.qrcodeFocus = true;
|
}
|
},
|
initInfo() {
|
_this.madeUnit = '';
|
_this.materielId = '';
|
_this.materielType = '';
|
_this.NewOrOld = '';
|
_this.LotNumber = '';
|
_this.ProductDate = '';
|
},
|
SaveInfomation() {
|
//_this.LotNumber == '' ||
|
if (_this.value_rfid.length == 0 || _this.value_qrcode.length == 0 ||
|
_this.madeUnit == '' || _this.materielId == '' ||
|
_this.materielType == '' || _this.NewOrOld == '' ||
|
_this.ProductDate == '') {
|
|
uni.showToast({
|
title: "组盘信息不能为空",
|
duration: 2000,
|
icon: 'none',
|
});
|
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: {
|
rfid: _this.value_rfid,
|
qrcode: _this.value_qrcode,
|
madeUnit: _this.madeUnit,
|
materielId: _this.materielId,
|
materielType: _this.materielType,
|
NewOrOld: _this.NewOrOld,
|
LotNumber: _this.LotNumber,
|
ProductDate: _this.ProductDate
|
},
|
};
|
_this.$AjaxRequest.Params('post', 'ToAPP/InboundBoxingAction',
|
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.initInfo();
|
_this.rfidFocus = true;
|
} else {
|
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) {}
|
}
|
});
|
},
|
},
|
created: function() {
|
// 每次进入界面时,先清除之前的所有定时器,然后启动新的定时器
|
clearInterval(this.timer)
|
this.timer = null;
|
this.setTimer();
|
_user = this.$UserTool.UserInfo;
|
this.CurrentUser = _user.userName;
|
this.UserArray = [this.$UserTool.AllUserInfo];
|
},
|
destroyed: function() {
|
// 每次离开当前界面时,清除定时器
|
clearInterval(this.timer);
|
this.timer = null;
|
},
|
mounted() {
|
_this = this;
|
_this.rfidFocus = true;
|
},
|
|
|
}
|
</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>
|