<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="materielNumber" :focus="qrcodeFocus" :border="true" placeholder="请扫描轴承编号"
|
@input="barcodeChange" />
|
</u-td>
|
</u-tr>
|
|
<u-tr>
|
<u-td width="30%">轴承型号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.containerdtl_type" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">重量(克)</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.containerdtl_goodsWeight" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">托盘号</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.containerhead_barcode" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
<u-td width="30%">选配标准</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.containerdtl_standard" :border="false" :disabled="true"
|
placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">车型</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.materiel_id" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
<u-td width="30%">厂家</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.containerdtl_madeUnit" :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.csize_in_value" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
<u-td width="30%">油档平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.csize_three_3" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">外径平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.csize_out_value" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
<u-td width="30%">后档平均值</u-td>
|
<u-td>
|
<u-input v-model="recordInfo.csize_four_3" :border="false" :disabled="true" placeholder="" />
|
</u-td>
|
</u-tr>
|
<u-tr>
|
<u-td width="30%">抽检结果:</u-td>
|
<u-td>
|
<xfl-select :list="checkResultList" :initValue="'请选择'" :clearable="false"
|
@change="checkResultChange">
|
</xfl-select>
|
</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: {
|
containerdtl_id: '',
|
containerdtl_type: '',
|
materiel_id: '',
|
containerdtl_goodsWeight: '',
|
containerhead_barcode: '',
|
containerdtl_standard: '',
|
containerdtl_madeUnit: '',
|
csize_in_value: '',
|
csize_out_value: '',
|
csize_three_3: '',
|
csize_four_3: '',
|
},
|
checkResultList: [{
|
label: '合格',
|
value: '合格'
|
}, {
|
label: '不合格',
|
value: '不合格'
|
}, ],
|
checkResult: '',
|
materielNumber: '',
|
qrcodeFocus: false,
|
}
|
},
|
methods: {
|
UserChange(value) {
|
|
},
|
setTimer() {
|
if (this.timer == null) {
|
this.timer = setInterval(() => {
|
this.date = this.$DateTool.getDate();
|
}, 1000)
|
}
|
|
},
|
checkResultChange(value) {
|
this.checkResult = value.orignItem.label;
|
},
|
barcodeChange() {
|
if (_this.materielNumber == '' || _this.materielNumber == null) {
|
_this.initAVG();
|
return;
|
}
|
let where =
|
"[" +
|
"{'name':'containerdtl_number','value':'" + _this.materielNumber + "'}]";
|
let data = {
|
page: 1,
|
rows: 1,
|
sort: 'containerhead_createtime',
|
order: 'sort',
|
wheres: where
|
}
|
//console.log(data);
|
_this.$AjaxRequest.Params('post', 'VV_ContainerInfo/getPageData',
|
data, _user.token);
|
_this.$AjaxRequest.Request().then(function(result) {
|
//debugger
|
if (result.data.status == 0) {
|
_this.recordInfo = result.data.rows[0];
|
} 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.materielNumber == '' || _this.recordInfo.containerdtl_id == '') {
|
uni.showToast({
|
icon: 'none',
|
title: "请扫描轴承编号获取信息.",
|
duration: 2000
|
});
|
return;
|
}
|
if (_this.checkResult == '') {
|
uni.showToast({
|
icon: 'none',
|
title: "请选择抽检结果.",
|
duration: 2000
|
});
|
return;
|
}
|
|
uni.showModal({
|
title: '提示',
|
content: '确认复核?',
|
success: function(res) {
|
if (res.confirm) {
|
let data = {
|
MainData: {
|
containerdtl_id: _this.recordInfo.containerdtl_id,
|
checkResult: _this.checkResult
|
},
|
};
|
_this.$AjaxRequest.Params('post', 'ToAPP/MeasureCheckAction',
|
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>
|