<template>
|
<div class="app-container">
|
<div style="width: 100%">
|
<el-card class="box-card" >
|
<el-form :model="from" size="large" :inline="true" label-width="78px" @submit.native.prevent>
|
<el-form-item label-width="200" label="连杆码" :prop="from.scanObject2" style="align-content: center">
|
<input v-model="from.scanObject2"
|
ref="inputdata1"
|
style="height: 39px; width: 300px"
|
placeholder="请输入连杆码"
|
/>
|
</el-form-item>
|
</el-form>
|
</el-card>
|
<el-row :gutter="0">
|
<el-col :span="6">
|
<div >
|
<el-card style="height: 500px">
|
<el-descriptions class="margin-top" :column="1" direction="horizontal">
|
<el-descriptions-item label="机型">{{queryParams.productSeries}}</el-descriptions-item>
|
<el-descriptions-item label="发动机编号">{{queryParams.sfcCode}}</el-descriptions-item>
|
<el-descriptions-item label="曲轴码">{{queryParams.scanObject1}}</el-descriptions-item>
|
<el-descriptions-item label="连杆码">{{queryParams.scanObject2}}</el-descriptions-item>
|
<el-descriptions-item label="瓦名称">{{queryParams.tileName}}</el-descriptions-item>
|
<!-- <el-descriptions-item label="缸体编号">{{queryParams.axisName}}</el-descriptions-item>-->
|
<el-descriptions-item label="1缸配瓦颜色"><span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor1 }">{{queryParams.tileColor1}}</span></el-descriptions-item>
|
<el-descriptions-item label="2缸配瓦颜色"><span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor2 }">{{queryParams.tileColor2}}</span></el-descriptions-item>
|
<el-descriptions-item label="3缸配瓦颜色"><span style="color: #FFFFFF;" :style="{ backgroundColor: queryParams.tileColor3 }">{{queryParams.tileColor3}}</span></el-descriptions-item>
|
</el-descriptions>
|
</el-card>
|
</div>
|
</el-col>
|
<el-col :span="18">
|
<div>
|
<el-card style="height: 500px; overflow: auto">
|
<el-table border :data="tileMatchMiddlewareList">
|
<el-table-column
|
type="index"
|
label="序号"
|
width="50"
|
align="center"></el-table-column>
|
<el-table-column label="发动机号" align="center" prop="sfcCode" width="180"></el-table-column>
|
<el-table-column label="曲轴码" align="center" prop="crankshaftNo" width="250"></el-table-column>
|
<el-table-column label="连杆码" align="center" prop="connectingrodNo" width="250"></el-table-column>
|
<el-table-column label="气缸编号" align="center" prop="cylinder" width="100"></el-table-column>
|
<el-table-column label="状态" align="center" prop="state" width="100">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.corod" :value="scope.row.state"/>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getListData"
|
/>
|
</el-card>
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
</div>
|
</template>
|
<script>
|
import VueQr from 'vue-qr'
|
import {setBarcode} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
|
import {listTileMatchRules2} from "@/api/main/bs/tileMatchRules/tileMatchRules";
|
import {listTileMatchMiddleware} from "@/api/main/da/tileMatchMiddleware/tileMatchMiddleware";
|
import {getSumDataMethod} from "@/api/main/bs/orderScheduling/orderScheduling";
|
export default {
|
name: "index",
|
dicts: ['colour_hex','productseries','axisname','neckname','tilename','corod'],
|
components: {
|
VueQr,
|
},
|
data(){
|
return{
|
total: 0,
|
scannerFlag: false,
|
loading: true,
|
tileMatchKbList: [],
|
tileMatchMiddlewareList: [],
|
qrCode: '',
|
// 查询参数
|
from:{
|
locationCode: 'CR010',
|
pageNum: 1,
|
pageSize: 10,
|
productSeries:'',
|
scanObject1: null,
|
scanObject2: null,
|
axisName: null,
|
neckName: null,
|
tileName: '连杆瓦',
|
axisParameterNoPosition: null,
|
neckParameterPosition: null,
|
axisValue: null,
|
neckValue: null,
|
createUser: null,
|
updateUser: null,
|
state: null,
|
weight: null,
|
},
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
productSeries: null,
|
scanObject1: null,
|
scanObject2: null,
|
axisName: null,
|
neckName: null,
|
tileName: null,
|
axisParameterNoPosition: null,
|
neckParameterPosition: null,
|
axisValue: null,
|
neckValue: null,
|
tileColor1: null,
|
tileColor2: null,
|
tileColor3: null,
|
tileColor4: null,
|
createUser: null,
|
updateUser: null,
|
state: null,
|
weight: null,
|
sfcCode:null,
|
},
|
}
|
},
|
mounted() {
|
this.setFocus1()
|
this.getListData()
|
this.$refs.inputdata1.addEventListener('keydown',this.handleScannerInput1)
|
},
|
beforeDestroy() {
|
this.$refs.inputdata1.removeEventListener('keydown',this.handleScannerInput1)
|
},
|
methods:{
|
refresh() {
|
location.reload();
|
},
|
setFocus1(){
|
this.$nextTick(()=>{
|
this.$refs.inputdata1.focus()
|
})
|
},
|
handleScannerInput1(event){
|
if (this.scannerFlag){
|
this.$refs.inputdata1.value = ''
|
this.scannerFlag = false
|
}
|
const input = event.target
|
const inputValue = input.value
|
this.from.scanObject2 = inputValue
|
if (event.key === 'Enter'){
|
this.scannerFlag = true
|
//扫描完成
|
console.log('sssss',this.from.scanObject2)
|
if (this.from.scanObject2 !== null && this.from.scanObject2 !== '') {
|
console.log('r22222222222222222')
|
if (this.from.scanObject2.indexOf(";") !== -1){
|
const parts1 = this.from.scanObject2.split(";");
|
console.log('paes',parts1)
|
if (parts1.length >= 3) {
|
setBarcode({barcode:this.from.scanObject2,locationCode:this.from.locationCode}).then(res =>{
|
console.log('res123456',res)
|
if (res.id !== null && res.id !== ''){
|
this.$message({
|
message: '配瓦成功',
|
type: 'success'
|
});
|
this.from.productSeries = res.productType
|
this.queryParams.productSeries = res.productType
|
this.queryParams.sfcCode=res.sfcCode;
|
this.from.scanObject1=res.crankshaftNo;
|
this.from.connectingrodNo=res.connectingrodNo;
|
this.queryParams.axisName=res.cylinder;
|
if (res.checkFlag === "1"){
|
this.queryParams.tileColor2 = null
|
this.queryParams.tileColor3 = null
|
}
|
this.handleQuery()
|
}
|
//this.queryParams.scanObject1=this.from.scanObject1
|
})
|
} else {
|
this.$message({
|
message: '连杆码格式错误,请检查',
|
type: 'error'
|
});
|
}
|
}else {
|
this.$message({
|
message: '连杆码格式错误,请检查',
|
type: 'error'
|
});
|
}
|
|
}else {
|
this.$message({
|
message: '连杆码格式错误,请检查',
|
type: 'error'
|
});
|
console.log('3232323')
|
// this.handleQuery()
|
}
|
|
}
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.clear();
|
console.log("1111")
|
if(this.from.scanObject2 !== null && this.from.productSeries !== null && this.from.productSeries !== "")
|
{
|
console.log("222")
|
this.axisValueextracted();
|
this.neckValueextracted();
|
console.log('this.queryParams.axisValue',this.queryParams.axisValue)
|
console.log('this.queryParams.neckValue',this.queryParams.neckValue)
|
if(this.queryParams.axisValue !== null && this.queryParams.neckValue !== null){
|
console.log('77777')
|
console.log('this.queryParams.axisValue',this.queryParams.axisValue)
|
console.log('this.queryParams.neckValue',this.queryParams.neckValue)
|
this.insetFromToQueryParams();
|
this.getList();
|
}
|
else{
|
console.log('000000')
|
const h = this.$createElement;
|
this.$message({
|
message: h('p',null, [
|
h('span', null, '警告 '),
|
h('i', { style: 'color: black' }, '箱体码或曲轴码输入有误'),
|
h()]),
|
type: 'error',
|
center: true,
|
offset:300
|
});
|
}
|
}
|
else{
|
const h = this.$createElement;
|
this.$message({
|
message: h('p',null, [
|
h('span', null, '警告 '),
|
h('i', { style: 'color: black' }, '请填写所有搜索条件'),
|
h()]),
|
type: 'error',
|
center: true,
|
offset:300
|
});
|
}
|
},
|
|
// 取箱体码第三段为配瓦值
|
axisValueextracted() {
|
console.log("33")
|
if (this.from.scanObject2.indexOf(";") !== -1){
|
const parts1 = this.from.scanObject2.split(";");
|
if (parts1.length >= 3) {
|
console.log("44",parts1)
|
//const axisValueextracted = parts1[2].substring(3,4);
|
const axisValueextracted = parts1[2];
|
return this.queryParams.axisValue= axisValueextracted;
|
|
}
|
}
|
},
|
|
//取曲轴码第三段为配瓦值
|
neckValueextracted() {
|
console.log('4432')
|
console.log('scanObject1',this.from.scanObject1)
|
if (this.from.scanObject1.indexOf(";") !== -1){
|
const parts2 = this.from.scanObject1.split(";");
|
if (parts2.length >= 3) {
|
//const neckValueextracted = parts2[2].substring(3,4);
|
const neckValueextracted = parts2[2];
|
return this.queryParams.neckValue= neckValueextracted;
|
}
|
} else if (this.from.scanObject1.indexOf(",") !== -1){
|
const parts2 = this.from.scanObject1.split(",");
|
if (parts2.length >= 2) {
|
//const neckValueextracted = parts2[2].substring(3,4);
|
const neckValueextracted = parts2[1];
|
return this.queryParams.neckValue= neckValueextracted;
|
}
|
}
|
},
|
//取配瓦颜色
|
getList() {
|
let queryParams = {
|
productSeries : this.queryParams.productSeries,
|
axisName : this.queryParams.axisName,
|
// neckName : this.queryParams.neckName,
|
tileName : this.queryParams.tileName,
|
axisValue: this.queryParams.axisValue,
|
neckValue: this.queryParams.neckValue,
|
}
|
console.log('参数:',queryParams)
|
listTileMatchRules2(queryParams).then(response => {
|
console.log('this.queryParams',this.queryParams);
|
console.log('res',response)
|
if (response.rows.length>0){
|
if(this.queryParams.axisName===1){
|
this.queryParams.tileColor1 = response.rows[0].tileColor;
|
}
|
if(this.queryParams.axisName===2){
|
this.queryParams.tileColor2 = response.rows[0].tileColor;
|
}
|
if(this.queryParams.axisName===3){
|
this.queryParams.tileColor3 = response.rows[0].tileColor;
|
}
|
}
|
|
console.log(this.queryParams);
|
this.getListData();
|
});
|
},
|
clear(){
|
this.queryParams.axisValue=null;
|
this.queryParams.neckValue=null;
|
},
|
insetFromToQueryParams(){
|
this.queryParams.productSeries=this.from.productSeries;
|
this.queryParams.neckName=this.from.neckName;
|
this.queryParams.tileName=this.from.tileName;
|
this.queryParams.scanObject1=this.from.scanObject1;
|
},
|
//查询列表
|
getListData(){
|
console.log('this.queryParams111',this.dataList)
|
const query = {
|
pageNum:this.queryParams.pageNum,
|
pageSize:this.queryParams.pageSize
|
}
|
listTileMatchMiddleware(query).then(res => {
|
console.log('resssss',res)
|
if (res.code === 200){
|
// this.$message({
|
// message: '查询成功',
|
// type: 'success'
|
// });
|
this.tileMatchMiddlewareList = res.rows
|
this.total = res.total
|
}
|
})
|
}
|
|
},
|
}
|
</script>
|
|
<style scoped>
|
::v-deep .el-form-item__label{
|
font-size: large;
|
}
|
::v-deep .el-card__body{
|
padding: 15px 20px 0px 20px;
|
}
|
::v-deep .el-input .el-input--medium .el-input--suffix{
|
width: 200px;
|
}
|
|
</style>
|