<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: 0rpx 0rpx">
|
<u-table>
|
<u-tr>
|
<u-td width="30%">手输轴承编号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_materielNumber" :border="true" placeholder="如需可以手动输入"
|
:focus="qrcodeFocus" />
|
</u-td>
|
<u-td style="width:80px">
|
<u-button style="width:100px" type="primary" @click="SelectZCXP">查询</u-button>
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">扫描轴承编号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_materielNumber" :border="true" placeholder="请扫描轴承编号"
|
@input="barcodeChange" :focus="qrcodeFocus" />
|
</u-td>
|
</u-tr>
|
|
<u-tr>
|
<u-td width="30%">轮对条码</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_ldNumber" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%" height="10px;">轮对号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_ldCode" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">轴承型号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_materielType" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">重量(克)</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_weight" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">托盘号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_barcode" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
<u-td width="30%">轴承类别</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_standa" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">车型</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_materielId" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">轴承品牌</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_madeUnit" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">工位</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_outstation" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">方向</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_direction" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%" height="50px;">轴颈平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_zjAVG_mes" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">轴颈过盈量</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_zjAVG_diff" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">防尘板座平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_fcbAVG_mes" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">轴承内径平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_zjAVG_wms" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">挡油环平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_ydAVG_wms" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">后挡平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.record_fcbAVG_wms" :border="false" :disabled="true"
|
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: '', //当前用户
|
recordInfo: {
|
record_id: '',
|
record_ldCode: '',
|
record_ldNumber: '',
|
record_materielId: '',
|
record_materielType: '',
|
record_materielNumber: '',
|
record_weight: '',
|
record_standa: '',
|
record_zjAVG_mes: '',
|
record_ydAVG_mes: '',
|
record_fcbAVG_mes: '',
|
record_zjAVG_wms: '',
|
record_ydAVG_wms: '',
|
record_fcbAVG_wms: '',
|
record_zjAVG_diff: '',
|
record_ydAVG_diff: '',
|
record_fcbAVG_diff: '',
|
record_barcode: '',
|
record_userName: '',
|
record_createTime: '',
|
record_locationId: '',
|
record_madeUnit: '',
|
record_checkUser: '',
|
record_checkTime: '',
|
record_direction: '',
|
record_outstation: '',
|
// record_hdAVG_wms: '',
|
// record_hdAVG_mes: ''
|
},
|
qrcodeFocus: false
|
}
|
},
|
methods: {
|
UserChange(value) {
|
|
},
|
setTimer() {
|
if (this.timer == null) {
|
this.timer = setInterval(() => {
|
this.date = this.$DateTool.getDate();
|
}, 1000)
|
}
|
|
},
|
SelectZCXP(){
|
if (_this.recordInfo.record_materielNumber == '' || _this.recordInfo.record_materielNumber == null) {
|
_this.initAVG();
|
return;
|
}
|
let data = {
|
MainData: {
|
record_materielNumber: _this.recordInfo.record_materielNumber
|
},
|
};
|
//console.log(data);
|
_this.$AjaxRequest.Params('post', 'ToAPP/QuerySelecttionInfo',
|
data, _user.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
_this.recordInfo = result.data.data;
|
_this.aaabb();
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: "请求错误:" + result.data.message,
|
duration: 2000
|
});
|
_this.initAVG();
|
}
|
}).catch(function(err) {
|
uni.showToast({
|
icon: 'none',
|
title: "请求后台异常,错误信息." + err.errMsg,
|
duration: 2000
|
});
|
_this.initAVG();
|
});
|
},
|
aaabb(){
|
var dict1 = {"2号压装位":"3线库压装台","1号压装位":"2线库压装台"}
|
var dict2 = {"R0":"新造","R1":"检修"}
|
_this.recordInfo.record_outstation = dict1[_this.recordInfo.record_outstation] ?? _this.recordInfo.record_outstation;
|
_this.recordInfo.record_standa = dict2[_this.recordInfo.record_standa] ?? _this.recordInfo.record_standa;
|
},
|
barcodeChange() {
|
if (_this.recordInfo.record_materielNumber == '' || _this.recordInfo.record_materielNumber == null) {
|
_this.initAVG();
|
return;
|
}
|
//alert('111')
|
if(this.recordInfo.record_materielNumber.length > 20){
|
const rawStr = _this.recordInfo.record_materielNumber;
|
// 2. 修复格式(单引号→双引号 + 删尾逗号)
|
const fixedStr = rawStr.replace(/'/g, '"').replace(/,\s*}/, '}');
|
console.log(fixedStr)
|
// 3. 解析为字典(对象)
|
const temp_dict = JSON.parse(fixedStr);
|
console.log(temp_dict)
|
// 4. 正确获取值
|
console.log(temp_dict['轴承条码']); // 输出:1(不再是undefined)
|
|
_this.recordInfo.record_materielNumber = temp_dict['轴承条码'];
|
}
|
|
let data = {
|
MainData: {
|
record_materielNumber: _this.recordInfo.record_materielNumber
|
},
|
};
|
//console.log(data);
|
_this.$AjaxRequest.Params('post', 'ToAPP/QuerySelecttionInfo',
|
data, _user.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
_this.recordInfo = result.data.data;
|
_this.aaabb();
|
} else {
|
uni.showToast({
|
icon: 'none',
|
title: "请求错误:" + result.data.message,
|
duration: 2000
|
});
|
_this.initAVG();
|
}
|
}).catch(function(err) {
|
uni.showToast({
|
icon: 'none',
|
title: "请求后台异常,错误信息." + err.errMsg,
|
duration: 2000
|
});
|
_this.initAVG();
|
});
|
},
|
initAVG() {
|
Object.keys(_this.recordInfo).map(key => _this.recordInfo[key] = '');
|
},
|
SaveInfomation() {
|
if (_this.recordInfo.record_materielNumber == '' || _this.recordInfo.record_record_id == '') {
|
uni.showToast({
|
icon: 'none',
|
title: "请扫描轴承编号获取信息.",
|
duration: 2000
|
});
|
return;
|
}
|
|
uni.showModal({
|
title: '提示',
|
content: '确认选配出库?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
MainData: {
|
record_id: _this.recordInfo.record_id
|
},
|
};
|
_this.$AjaxRequest.Params('post', 'ToAPP/OutboundCheckAction',
|
data, _user.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
if (result.data.status) {
|
uni.showToast({
|
title: "选配确认成功!",
|
duration: 2000
|
});
|
_this.initAVG();
|
_this.qrcodeFocus = 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.qrcodeFocus = true;
|
//_this.queryOrder();
|
},
|
|
|
}
|
</script>
|
|
<style scoped lang="scss">
|
|
</style>
|