first commit
This commit is contained in:
546
src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue
Normal file
546
src/views/QualityAssurance/AssemblyQualitydataQuery/index.vue
Normal file
@@ -0,0 +1,546 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<div>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
@change="getMeasuringPosition();getTraceabilityCode();getBatchBarcode();getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">机型:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择机型" filterable clearable size="small" style="width: 240px" @change="getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">精确追溯码:</span>
|
||||
<el-select v-model="traceabilityCode" placeholder="请选择精确追溯码" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in traceabilityCodeArr"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">总成编号:</span>
|
||||
<el-select v-model="assemblyNumberValue" placeholder="请选择总成编号" filterable clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in assemblyNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<!-- <span style="margin-left: 10px">总成编号:</span>-->
|
||||
<!-- <el-input v-model="assemblyNumber" style="width:150px;" placeholder="总成编号" size="small" clearable/>-->
|
||||
<span style="margin-left: 10px">测量位置:</span>
|
||||
<el-select v-model="measuringPositionValue" placeholder="请选择测量位置" filterable clearable size="small" style="width: 200px" @change="getMeasuringProject()">
|
||||
<el-option
|
||||
v-for="item in measuringPosition"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<span style="margin-left: 10px">订单号:</span>
|
||||
<el-select v-model="orderNumberValue" placeholder="请选择订单" clearable filterable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in orderNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getOrderNumber();getTraceabilityCode();getBatchBarcode();getAssemblyNumber()"/>
|
||||
<span style="margin-left: 10px">批次条码:</span>
|
||||
<el-select v-model="batchBarcodeValue" placeholder="请选择批次条码" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in batchBarcode"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">是否合格:</span>
|
||||
<el-select v-model="isQualifiedValue" placeholder="请选择是否合格" clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in isQualified"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">测量项目:</span>
|
||||
<el-select v-model="measuringProjectValue" placeholder="请选择测量项目" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in measuringProject"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin: 10px 0 0 89%">
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="selectDate()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="660px"
|
||||
style="width: 100%;max-height: 700px"
|
||||
border
|
||||
size="mini">
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量位置">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量位置 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量项目">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量项目 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量值" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量单位" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="理论值" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.理论值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="值上限" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.上限值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="值下限" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.下限值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生产日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.生产日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合格标志" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合格标志 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
traceabilityCodeArr: [], // 精确追溯码数组
|
||||
traceabilityCode: '', // 精确追溯码
|
||||
assemblyNumber: [], // 总成编号
|
||||
assemblyNumberValue: '', // 总成编号
|
||||
orderNumberValue: '', // 订单号
|
||||
orderNumber: [], // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
measuringPosition: [], // 测量位置
|
||||
measuringPositionValue: '', // 测量位置
|
||||
measuringProject: [], // 测量项目
|
||||
measuringProjectValue: '', // 测量项目
|
||||
engineTypeValue: '', // 机型
|
||||
engineType: [], // 机型
|
||||
batchBarcode: [], // 批次条码
|
||||
batchBarcodeValue: '', // 批次条码
|
||||
isQualified: [
|
||||
{
|
||||
label: '合格',
|
||||
value: 1
|
||||
}, {
|
||||
label: '不合格',
|
||||
value: 2
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 0
|
||||
}
|
||||
], // 是否合格
|
||||
isQualifiedValue: 1, // 是否合格
|
||||
dateTime: '', // 时间
|
||||
loading: false, // 时间
|
||||
tableData: [], // 时间
|
||||
date: new Date(),
|
||||
timer: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getEngineType()
|
||||
},
|
||||
mounted() {
|
||||
this.getOrderNumber()
|
||||
this.getTraceabilityCode()
|
||||
this.getAssemblyNumber()
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.stationNumberValue = response.data[0].工位号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getBatchBarcode()
|
||||
this.getMeasuringPosition()
|
||||
})
|
||||
},
|
||||
// 机型
|
||||
getEngineType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.engineTypeValue = response.data[0].发动机型号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 订单号
|
||||
getOrderNumber() {
|
||||
this.orderNumber = []
|
||||
var isQualifiedValue
|
||||
if (!this.isQualifiedValue) {
|
||||
isQualifiedValue = null
|
||||
} else {
|
||||
isQualifiedValue = this.isQualifiedValue
|
||||
}
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['合格标志', isQualifiedValue]
|
||||
var Data = this.CreateData('11', '测量数据合格索引_订单号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.orderNumberValue = response.data[0].订单号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderNumber.push({
|
||||
label: response.data[i].订单号,
|
||||
value: response.data[i].订单号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 追溯
|
||||
getTraceabilityCode() {
|
||||
this.traceabilityCodeArr = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 1]
|
||||
var Data = this.CreateData('11', '初始化二维码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.traceabilityCode = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.traceabilityCodeArr.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAssemblyNumber() {
|
||||
this.assemblyNumber = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 1]
|
||||
var Data = this.CreateData('11', '测量数据合格索引_发动机号_发动机型号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.assemblyNumberValue = response.data[0].发动机号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.assemblyNumber.push({
|
||||
label: response.data[i].发动机号,
|
||||
value: response.data[i].发动机号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getBatchBarcode() {
|
||||
this.batchBarcode = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '物料数据_视图_物料条码批次号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.batchBarcodeValue = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.batchBarcode.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMeasuringPosition() {
|
||||
this.measuringPosition = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量位置 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.measuringPositionValue = response.data[0].测量位置 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringPosition.push({
|
||||
label: response.data[i].测量位置,
|
||||
value: response.data[i].测量位置
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getMeasuringProject()
|
||||
})
|
||||
},
|
||||
getMeasuringProject() {
|
||||
this.measuringProject = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['测量位置', this.measuringPositionValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量项目 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.measuringProjectValue = response.data[0].测量项目 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringProject.push({
|
||||
label: response.data[i].测量项目,
|
||||
value: response.data[i].测量项目
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDate() {
|
||||
this.tableData = []
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, measuringPositionValue_check, measuringProjectValue_check, traceabilityCode_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.measuringPositionValue ? measuringPositionValue_check = 1 : (measuringPositionValue_check = 0, this.measuringPositionValue = '')
|
||||
this.measuringProjectValue ? measuringProjectValue_check = 1 : (measuringProjectValue_check = 0, this.measuringProjectValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['测量位置_ischeck', measuringPositionValue_check]
|
||||
param[9] = ['测量位置', this.measuringPositionValue]
|
||||
param[10] = ['测量项目_ischeck', measuringProjectValue_check]
|
||||
param[11] = ['测量项目', this.measuringProjectValue]
|
||||
param[12] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[13] = ['订单号', this.orderNumberValue]
|
||||
param[14] = ['批次条码_ischeck', traceabilityCode_check]
|
||||
param[15] = ['批次条码', this.traceabilityCode]
|
||||
param[16] = ['合格标志', this.isQualifiedValue]
|
||||
param[17] = ['PageCurrent', this.pageCurrent]
|
||||
param[18] = ['PageSize', this.pageSize]
|
||||
param[19] = ['PageCount', '1111', 'int', '1']
|
||||
param[20] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '质量数据_发动机质量数据_各个工位_视图_发动机型号_综合查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, measuringPositionValue_check, measuringProjectValue_check, traceabilityCode_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.measuringPositionValue ? measuringPositionValue_check = 1 : (measuringPositionValue_check = 0, this.measuringPositionValue = '')
|
||||
this.measuringProjectValue ? measuringProjectValue_check = 1 : (measuringProjectValue_check = 0, this.measuringProjectValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['测量位置_ischeck', measuringPositionValue_check]
|
||||
param[9] = ['测量位置', this.measuringPositionValue]
|
||||
param[10] = ['测量项目_ischeck', measuringProjectValue_check]
|
||||
param[11] = ['测量项目', this.measuringProjectValue]
|
||||
param[12] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[13] = ['订单号', this.orderNumberValue]
|
||||
param[14] = ['批次条码_ischeck', traceabilityCode_check]
|
||||
param[15] = ['批次条码', this.traceabilityCode]
|
||||
param[16] = ['合格标志', this.isQualifiedValue]
|
||||
var Data = this.CreateData('2001', '质量数据查询_综合查询', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selectDate()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selectDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
367
src/views/QualityAssurance/InquiryTransitInformation/index.vue
Normal file
367
src/views/QualityAssurance/InquiryTransitInformation/index.vue
Normal file
@@ -0,0 +1,367 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<div>
|
||||
<span style="margin-left: 10px">开始工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">结束工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValueN"
|
||||
placeholder="请选择工位号"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in stationNumberN"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">总成编号:</span>
|
||||
<el-select v-model="assemblyNumberValue" placeholder="请选择总成编号" filterable clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in assemblyNumber"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">订单号:</span>
|
||||
<el-select v-model="orderNumberValue" placeholder="请选择订单" clearable filterable size="small" style="width: 200px" @change="getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in orderNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getOrderNumber();getAssemblyNumber()"/>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="selectDate()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="760px"
|
||||
style="width: 100%;max-height: 700px;margin-top: 10px"
|
||||
border
|
||||
size="mini">
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到达时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到达时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="离开时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离开时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="在线时间min">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.在线时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="是否合格" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否合格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
traceabilityCodeArr: [], // 精确追溯码数组
|
||||
traceabilityCode: '', // 精确追溯码
|
||||
assemblyNumber: [], // 总成编号
|
||||
assemblyNumberValue: '', // 总成编号
|
||||
orderNumberValue: '', // 订单号
|
||||
orderNumber: [], // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
stationNumberValueN: '', // 工位号N
|
||||
stationNumberN: [], // 工位号N
|
||||
measuringPosition: [], // 测量位置
|
||||
measuringPositionValue: '', // 测量位置
|
||||
measuringProject: [], // 测量项目
|
||||
measuringProjectValue: '', // 测量项目
|
||||
engineTypeValue: '', // 机型
|
||||
engineType: [], // 机型
|
||||
batchBarcode: [], // 批次条码
|
||||
batchBarcodeValue: '', // 批次条码
|
||||
isQualified: [
|
||||
{
|
||||
label: '合格',
|
||||
value: 1
|
||||
}, {
|
||||
label: '不合格',
|
||||
value: 2
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 0
|
||||
}
|
||||
], // 是否合格
|
||||
isQualifiedValue: 1, // 是否合格
|
||||
dateTime: '', // 时间
|
||||
loading: false, // 时间
|
||||
tableData: [], // 时间
|
||||
date: new Date(),
|
||||
timer: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getStationNumberN()
|
||||
},
|
||||
mounted() {
|
||||
this.getOrderNumber()
|
||||
this.getAssemblyNumber()
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.stationNumberValue = response.data[0].工位号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 工位号N
|
||||
getStationNumberN() {
|
||||
this.stationNumberN = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.stationNumberValueN = response.data[0].工位号
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumberN.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 订单号
|
||||
getOrderNumber() {
|
||||
this.orderNumber = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
var Data = this.CreateData('11', '测量数据发动机在线状态_订单号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.orderNumberValue = response.data[0].订单号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderNumber.push({
|
||||
label: response.data[i].订单号,
|
||||
value: response.data[i].订单号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAssemblyNumber() {
|
||||
this.assemblyNumber = []
|
||||
var orderNumberValue_check
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : orderNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[3] = ['订单号', this.orderNumberValue]
|
||||
var Data = this.CreateData('11', '测量数据发动机在线状态_发动机号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.assemblyNumberValue = response.data[0].发动机号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.assemblyNumber.push({
|
||||
label: response.data[i].发动机号,
|
||||
value: response.data[i].发动机号,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDate() {
|
||||
this.tableData = []
|
||||
let orderNumberValue_check, stationNumberValue_check, stationNumberValueN_check, assemblyNumberValue_check
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.stationNumberValueN ? stationNumberValueN_check = 1 : (stationNumberValueN_check = 0, this.stationNumberValueN = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号N_ischeck', stationNumberValueN_check]
|
||||
param[3] = ['工位号N', this.stationNumberValueN]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[9] = ['订单号', this.orderNumberValue]
|
||||
param[10] = ['PageCurrent', this.pageCurrent]
|
||||
param[11] = ['PageSize', this.pageSize]
|
||||
param[12] = ['PageCount', '1111', 'int', '1']
|
||||
param[13] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '质量数据查询_测量数据发动机在线状态_查询_NEW', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let orderNumberValue_check, stationNumberValue_check, stationNumberValueN_check, assemblyNumberValue_check
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.stationNumberValueN ? stationNumberValueN_check = 1 : (stationNumberValueN_check = 0, this.stationNumberValueN = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号N_ischeck', stationNumberValueN_check]
|
||||
param[3] = ['工位号N', this.stationNumberValueN]
|
||||
param[4] = ['发动机号_check', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_check', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[9] = ['订单号', this.orderNumberValue]
|
||||
var Data = this.CreateData('2001', '质量数据查询_测量数据发动机在线状态_报表_NEW', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selectDate()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selectDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
489
src/views/QualityAssurance/LineItemQuery/index.vue
Normal file
489
src/views/QualityAssurance/LineItemQuery/index.vue
Normal file
@@ -0,0 +1,489 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<div>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px; margin-left: 13px"
|
||||
@change="getPartName();getBatchBarcode();getAssemblyNumber();getTraceabilityCode()">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">机型:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择机型" filterable clearable size="small" style="width: 240px" @change="getPartName();getAssemblyNumber">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">精确追溯码:</span>
|
||||
<el-select v-model="traceabilityCode" placeholder="请选择精确追溯码" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in traceabilityCodeArr"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">分总成编号:</span>
|
||||
<el-select v-model="assemblyNumberValue" placeholder="请选择总成编号" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in assemblyNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<span style="margin-left: 10px">零件名称:</span>
|
||||
<el-select v-model="partNameValue" placeholder="请选择零件名称" filterable clearable size="small" style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in partName"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getTraceabilityCode();getBatchBarcode();getAssemblyNumber()"/>
|
||||
<span style="margin-left: 10px">批次条码:</span>
|
||||
<el-select v-model="batchBarcodeValue" placeholder="请选择批次条码" clearable filterable size="small" style="width: 200px;margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in batchBarcode"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin: 10px 0 0 89%">
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="selectDate()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="660px"
|
||||
style="width: 100%;max-height: 700px"
|
||||
border
|
||||
size="mini">
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="分总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生产厂家">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.生产厂家 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料条码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料条码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料条码批次">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料条码批次 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
traceabilityCodeArr: [], // 精确追溯码数组
|
||||
traceabilityCode: '', // 精确追溯码
|
||||
assemblyNumber: [], // 总成编号
|
||||
assemblyNumberValue: '', // 总成编号
|
||||
orderNumberValue: '', // 订单号
|
||||
orderNumber: [], // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
measuringPosition: [], // 测量位置
|
||||
measuringPositionValue: '', // 测量位置
|
||||
measuringProject: [], // 测量项目
|
||||
measuringProjectValue: '', // 测量项目
|
||||
engineTypeValue: '', // 机型
|
||||
engineType: [], // 机型
|
||||
batchBarcode: [], // 批次条码
|
||||
batchBarcodeValue: '', // 批次条码
|
||||
partName: [], // 零件名称
|
||||
partNameValue: '', // 零件名称
|
||||
isQualified: [
|
||||
{
|
||||
label: '合格',
|
||||
value: 1
|
||||
}, {
|
||||
label: '不合格',
|
||||
value: 2
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 0
|
||||
}
|
||||
], // 是否合格
|
||||
isQualifiedValue: 1, // 是否合格
|
||||
dateTime: '', // 时间
|
||||
loading: false, // 时间
|
||||
tableData: [], // 时间
|
||||
date: new Date(),
|
||||
timer: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getEngineType()
|
||||
},
|
||||
mounted() {
|
||||
this.getTraceabilityCode()
|
||||
this.getAssemblyNumber()
|
||||
setTimeout(() => { this.getPartName() }, 200)
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) {
|
||||
this.stationNumberValue = response.data[0].工位号
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getBatchBarcode()
|
||||
})
|
||||
},
|
||||
// 机型
|
||||
getEngineType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) {
|
||||
this.engineTypeValue = response.data[0].发动机型号
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 零件名称
|
||||
getPartName() {
|
||||
this.partName = []
|
||||
var param = []
|
||||
param[0] = ['发动机型号', this.engineTypeValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '电子看板装配零件_零件名称_初始化查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.partNameValue = response.data[0].零件名称 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partName.push({
|
||||
label: response.data[i].零件名称,
|
||||
value: response.data[i].零件名称,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 追溯
|
||||
getTraceabilityCode() {
|
||||
this.traceabilityCodeArr = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 2]
|
||||
var Data = this.CreateData('11', '初始化二维码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.traceabilityCode = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.traceabilityCodeArr.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAssemblyNumber() {
|
||||
this.assemblyNumber = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 2]
|
||||
var Data = this.CreateData('11', '测量数据合格索引_发动机号_发动机型号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) {
|
||||
this.assemblyNumberValue = response.data[0].发动机号
|
||||
}
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.assemblyNumber.push({
|
||||
label: response.data[i].发动机号,
|
||||
value: response.data[i].发动机号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getBatchBarcode() {
|
||||
this.batchBarcode = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号', this.stationNumberValue]
|
||||
console.log(param, 'param')
|
||||
var Data = this.CreateData('11', '物料数据分线_视图_物料条码批次号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.batchBarcodeValue = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.batchBarcode.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMeasuringProject() {
|
||||
this.measuringProject = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['测量位置', this.measuringPositionValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量项目 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
this.measuringProjectValue = response.data[0].测量项目
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringProject.push({
|
||||
label: response.data[i].测量项目,
|
||||
value: response.data[i].测量项目
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDate() {
|
||||
this.tableData = []
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, partNameValue_check, traceabilityCode_check, batchBarcodeValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.partNameValue ? partNameValue_check = 1 : (partNameValue_check = 0, this.partNameValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.batchBarcodeValue ? batchBarcodeValue_check = 1 : (batchBarcodeValue_check = 0, this.batchBarcodeValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['零件名称_ischeck', partNameValue_check]
|
||||
param[9] = ['零件名称', this.partNameValue]
|
||||
param[10] = ['二维码_ischeck', traceabilityCode_check]
|
||||
param[11] = ['二维码', this.traceabilityCode]
|
||||
param[12] = ['物料条码批次_ischeck', batchBarcodeValue_check]
|
||||
param[13] = ['物料条码批次', this.batchBarcodeValue]
|
||||
param[14] = ['PageCurrent', this.pageCurrent]
|
||||
param[15] = ['PageSize', this.pageSize]
|
||||
param[16] = ['PageCount', '1111', 'int', '1']
|
||||
param[17] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '物料数据分线_视图_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, partNameValue_check, traceabilityCode_check, batchBarcodeValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.partNameValue ? partNameValue_check = 1 : (partNameValue_check = 0, this.partNameValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.batchBarcodeValue ? batchBarcodeValue_check = 1 : (batchBarcodeValue_check = 0, this.batchBarcodeValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['零件名称_ischeck', partNameValue_check]
|
||||
param[9] = ['零件名称', this.partNameValue]
|
||||
param[10] = ['二维码_ischeck', traceabilityCode_check]
|
||||
param[11] = ['二维码', this.traceabilityCode]
|
||||
param[12] = ['物料条码批次_ischeck', batchBarcodeValue_check]
|
||||
param[13] = ['物料条码批次', this.batchBarcodeValue]
|
||||
var Data = this.CreateData('2001', '物料数据分线查询_报表', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selectDate()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selectDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
539
src/views/QualityAssurance/LineQualityQuery/index.vue
Normal file
539
src/views/QualityAssurance/LineQualityQuery/index.vue
Normal file
@@ -0,0 +1,539 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<div>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select
|
||||
v-model="stationNumberValue"
|
||||
placeholder="请选择工位号"
|
||||
filterable
|
||||
clearable
|
||||
size="small"
|
||||
style="width: 200px"
|
||||
@change="getMeasuringPosition();getTraceabilityCode();getBatchBarcode();getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">机型:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择机型" filterable clearable size="small" style="width: 240px" @change="getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">精确追溯码:</span>
|
||||
<el-select v-model="traceabilityCode" placeholder="请选择精确追溯码" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in traceabilityCodeArr"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">总成编号:</span>
|
||||
<el-select v-model="assemblyNumberValue" placeholder="请选择总成编号" filterable clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in assemblyNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<!-- <span style="margin-left: 10px">总成编号:</span>-->
|
||||
<!-- <el-input v-model="assemblyNumber" style="width:150px;" placeholder="总成编号" size="small" clearable/>-->
|
||||
<span style="margin-left: 10px">测量位置:</span>
|
||||
<el-select v-model="measuringPositionValue" placeholder="请选择测量位置" filterable clearable size="small" style="width: 200px" @change="getMeasuringProject()">
|
||||
<el-option
|
||||
v-for="item in measuringPosition"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<span style="margin-left: 10px">订单号:</span>
|
||||
<el-select v-model="orderNumberValue" placeholder="请选择订单" clearable filterable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in orderNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getOrderNumber();getTraceabilityCode();getBatchBarcode();getAssemblyNumber()"/>
|
||||
<span style="margin-left: 10px">批次条码:</span>
|
||||
<el-select v-model="batchBarcodeValue" placeholder="请选择批次条码" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in batchBarcode"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">是否合格:</span>
|
||||
<el-select v-model="isQualifiedValue" placeholder="请选择是否合格" clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in isQualified"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">测量项目:</span>
|
||||
<el-select v-model="measuringProjectValue" placeholder="请选择测量项目" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in measuringProject"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin: 10px 0 0 89%">
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="selectDate()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="660px"
|
||||
style="width: 100%;max-height: 700px"
|
||||
border
|
||||
size="mini">
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量位置">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量位置 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量项目">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量项目 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量值" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="测量单位" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.测量单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="理论值" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.理论值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="值上限" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.上限值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="值下限" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.下限值 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生产日期">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.生产日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="合格标志" width="80px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.合格标志 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
traceabilityCodeArr: [], // 精确追溯码数组
|
||||
traceabilityCode: '', // 精确追溯码
|
||||
assemblyNumber: [], // 总成编号
|
||||
assemblyNumberValue: '', // 总成编号
|
||||
orderNumberValue: '', // 订单号
|
||||
orderNumber: [], // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
measuringPosition: [], // 测量位置
|
||||
measuringPositionValue: '', // 测量位置
|
||||
measuringProject: [], // 测量项目
|
||||
measuringProjectValue: '', // 测量项目
|
||||
engineTypeValue: '', // 机型
|
||||
engineType: [], // 机型
|
||||
batchBarcode: [], // 批次条码
|
||||
batchBarcodeValue: '', // 批次条码
|
||||
isQualified: [
|
||||
{
|
||||
label: '合格',
|
||||
value: 1
|
||||
}, {
|
||||
label: '不合格',
|
||||
value: 0
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 2
|
||||
}
|
||||
], // 是否合格
|
||||
isQualifiedValue: 2, // 是否合格
|
||||
dateTime: '', // 时间
|
||||
loading: false, // 时间
|
||||
tableData: [], // 时间
|
||||
date: new Date(),
|
||||
timer: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getEngineType()
|
||||
},
|
||||
mounted() {
|
||||
this.getOrderNumber()
|
||||
this.getTraceabilityCode()
|
||||
this.getAssemblyNumber()
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.stationNumberValue = response.data[0].工位号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getBatchBarcode()
|
||||
this.getMeasuringPosition()
|
||||
})
|
||||
},
|
||||
// 机型
|
||||
getEngineType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.engineTypeValue = response.data[0].发动机型号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 订单号
|
||||
getOrderNumber() {
|
||||
this.orderNumber = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
var Data = this.CreateData('11', '测量数据发动机在线状态_订单号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.orderNumberValue = response.data[0].订单号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderNumber.push({
|
||||
label: response.data[i].订单号,
|
||||
value: response.data[i].订单号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 追溯
|
||||
getTraceabilityCode() {
|
||||
this.traceabilityCodeArr = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 2]
|
||||
var Data = this.CreateData('11', '初始化二维码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.traceabilityCode = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.traceabilityCodeArr.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAssemblyNumber() {
|
||||
this.assemblyNumber = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 2]
|
||||
var Data = this.CreateData('11', '测量数据合格索引_发动机号_发动机型号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.assemblyNumberValue = response.data[0].发动机号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.assemblyNumber.push({
|
||||
label: response.data[i].发动机号,
|
||||
value: response.data[i].发动机号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getBatchBarcode() {
|
||||
this.batchBarcode = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '物料数据分线_视图_物料条码批次号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.batchBarcodeValue = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.batchBarcode.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMeasuringPosition() {
|
||||
this.measuringPosition = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量位置 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.measuringPositionValue = response.data[0].测量位置 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringPosition.push({
|
||||
label: response.data[i].测量位置,
|
||||
value: response.data[i].测量位置
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getMeasuringProject()
|
||||
})
|
||||
},
|
||||
getMeasuringProject() {
|
||||
this.measuringProject = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['测量位置', this.measuringPositionValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量项目 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.measuringProjectValue = response.data[0].测量项目 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringProject.push({
|
||||
label: response.data[i].测量项目,
|
||||
value: response.data[i].测量项目
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDate() {
|
||||
this.tableData = []
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, measuringPositionValue_check, measuringProjectValue_check, traceabilityCode_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.measuringPositionValue ? measuringPositionValue_check = 1 : (measuringPositionValue_check = 0, this.measuringPositionValue = '')
|
||||
this.measuringProjectValue ? measuringProjectValue_check = 1 : (measuringProjectValue_check = 0, this.measuringProjectValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['测量位置_ischeck', measuringPositionValue_check]
|
||||
param[9] = ['测量位置', this.measuringPositionValue]
|
||||
param[10] = ['测量项目_ischeck', measuringProjectValue_check]
|
||||
param[11] = ['测量项目', this.measuringProjectValue]
|
||||
param[12] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[13] = ['订单号', this.orderNumberValue]
|
||||
param[14] = ['批次条码_ischeck', traceabilityCode_check]
|
||||
param[15] = ['批次条码', this.traceabilityCode]
|
||||
param[16] = ['合格标志', this.isQualifiedValue]
|
||||
param[17] = ['PageCurrent', this.pageCurrent]
|
||||
param[18] = ['PageSize', this.pageSize]
|
||||
param[19] = ['PageCount', '1111', 'int', '1']
|
||||
param[20] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '质量数据_发动机分线质量数据_综合查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, measuringPositionValue_check, measuringProjectValue_check, traceabilityCode_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.measuringPositionValue ? measuringPositionValue_check = 1 : (measuringPositionValue_check = 0, this.measuringPositionValue = '')
|
||||
this.measuringProjectValue ? measuringProjectValue_check = 1 : (measuringProjectValue_check = 0, this.measuringProjectValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['测量位置_ischeck', measuringPositionValue_check]
|
||||
param[9] = ['测量位置', this.measuringPositionValue]
|
||||
param[10] = ['测量项目_ischeck', measuringProjectValue_check]
|
||||
param[11] = ['测量项目', this.measuringProjectValue]
|
||||
param[12] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[13] = ['订单号', this.orderNumberValue]
|
||||
param[14] = ['批次条码_ischeck', traceabilityCode_check]
|
||||
param[15] = ['批次条码', this.traceabilityCode]
|
||||
param[16] = ['合格标志', this.isQualifiedValue]
|
||||
var Data = this.CreateData('2001', '质量数据分线_导出', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selectDate()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selectDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
493
src/views/QualityAssurance/MaterialDataQuery/index.vue
Normal file
493
src/views/QualityAssurance/MaterialDataQuery/index.vue
Normal file
@@ -0,0 +1,493 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<div>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" filterable clearable size="small" style="width: 200px; margin-left: 13px" @change="getPartName();getBatchBarcode();getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">机型:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择机型" filterable clearable size="small" style="width: 240px" @change="getPartName();getAssemblyNumber()">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">精确追溯码:</span>
|
||||
<el-select v-model="traceabilityCode" placeholder="请选择精确追溯码" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in traceabilityCodeArr"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">总成编号:</span>
|
||||
<el-select v-model="assemblyNumberValue" placeholder="请选择总成编号" filterable clearable size="small" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in assemblyNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<span style="margin-left: 10px">零件名称:</span>
|
||||
<el-select v-model="partNameValue" placeholder="请选择零件名称" filterable clearable size="small" style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in partName"
|
||||
:key="item.ID"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getTraceabilityCode();getBatchBarcode();getAssemblyNumber()"/>
|
||||
<span style="margin-left: 10px">批次条码:</span>
|
||||
<el-select v-model="batchBarcodeValue" placeholder="请选择批次条码" clearable filterable size="small" style="width: 200px;margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in batchBarcode"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin: 10px 0 0 89%">
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="selectDate()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="660px"
|
||||
style="width: 100%;max-height: 700px"
|
||||
border
|
||||
size="mini">
|
||||
<!-- <el-table-column :selectable="selectable" type="selection" width="45" align="center"/>-->
|
||||
<el-table-column type="index" width="60" label="序号" align="center"/>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机型号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="工位名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工序名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="零件图号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.零件图号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="生产厂家">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.生产厂家 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料条码">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料条码 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="物料条码批次">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料条码批次 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.操作时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
traceabilityCodeArr: [], // 精确追溯码数组
|
||||
traceabilityCode: '', // 精确追溯码
|
||||
assemblyNumber: [], // 总成编号
|
||||
assemblyNumberValue: '', // 总成编号
|
||||
orderNumberValue: '', // 订单号
|
||||
orderNumber: [], // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
measuringPosition: [], // 测量位置
|
||||
measuringPositionValue: '', // 测量位置
|
||||
measuringProject: [], // 测量项目
|
||||
measuringProjectValue: '', // 测量项目
|
||||
engineTypeValue: '', // 机型
|
||||
engineType: [], // 机型
|
||||
batchBarcode: [], // 批次条码
|
||||
batchBarcodeValue: '', // 批次条码
|
||||
partName: [], // 零件名称
|
||||
partNameValue: '', // 零件名称
|
||||
isQualified: [
|
||||
{
|
||||
label: '合格',
|
||||
value: 1
|
||||
}, {
|
||||
label: '不合格',
|
||||
value: 2
|
||||
}, {
|
||||
label: '全部',
|
||||
value: 0
|
||||
}
|
||||
], // 是否合格
|
||||
isQualifiedValue: 1, // 是否合格
|
||||
dateTime: '', // 时间
|
||||
loading: false, // 时间
|
||||
tableData: [], // 时间
|
||||
date: new Date(),
|
||||
timer: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 30, // 每页显示条数
|
||||
pageSize: 30, // 每页显示条数
|
||||
pageCurrent: 1 // 后台获取页
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getStationNumber()
|
||||
this.getEngineType()
|
||||
},
|
||||
mounted() {
|
||||
this.getTraceabilityCode()
|
||||
this.getAssemblyNumber()
|
||||
setTimeout(() => { this.getPartName() }, 200)
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.stationNumberValue = response.data[0].工位号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getBatchBarcode()
|
||||
this.getMeasuringPosition()
|
||||
})
|
||||
},
|
||||
// 机型
|
||||
getEngineType() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.engineTypeValue = response.data[0].发动机型号 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 零件名称
|
||||
getPartName() {
|
||||
this.partName = []
|
||||
var param = []
|
||||
param[0] = ['发动机型号', this.engineTypeValue]
|
||||
param[1] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '电子看板装配零件_零件名称_初始化查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.partNameValue = response.data[0].零件名称 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.partName.push({
|
||||
label: response.data[i].零件名称,
|
||||
value: response.data[i].零件名称,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 追溯
|
||||
getTraceabilityCode() {
|
||||
this.traceabilityCodeArr = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 1]
|
||||
var Data = this.CreateData('11', '初始化二维码_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) { this.traceabilityCode = response.data[0].物料条码 }
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.traceabilityCodeArr.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码,
|
||||
ID: response.data[i].ID
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAssemblyNumber() {
|
||||
this.assemblyNumber = []
|
||||
var engineTypeValue_check, stationNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : engineTypeValue_check = 0
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : stationNumberValue_check = 0
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[5] = ['工位号', this.stationNumberValue]
|
||||
param[6] = ['分线总线', 1]
|
||||
var Data = this.CreateData('11', '测量数据合格索引_发动机号_发动机型号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) this.assemblyNumberValue = response.data[0].发动机号
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.assemblyNumber.push({
|
||||
label: response.data[i].发动机号,
|
||||
value: response.data[i].发动机号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getBatchBarcode() {
|
||||
this.batchBarcode = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '物料数据_视图_物料条码批次号_查询 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) this.batchBarcodeValue = response.data[0].物料条码
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.batchBarcode.push({
|
||||
label: response.data[i].物料条码,
|
||||
value: response.data[i].物料条码
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getMeasuringPosition() {
|
||||
this.measuringPosition = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量位置 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) this.measuringPositionValue = response.data[0].测量位置
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringPosition.push({
|
||||
label: response.data[i].测量位置,
|
||||
value: response.data[i].测量位置
|
||||
})
|
||||
}
|
||||
}).then(() => {
|
||||
this.getMeasuringProject()
|
||||
})
|
||||
},
|
||||
getMeasuringProject() {
|
||||
this.measuringProject = []
|
||||
var param = []
|
||||
param[0] = ['工位号', this.stationNumberValue]
|
||||
param[1] = ['测量位置', this.measuringPositionValue]
|
||||
var Data = this.CreateData('11', '质量数据查询_测量项目 ', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length) this.measuringProjectValue = response.data[0].测量项目
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.measuringProject.push({
|
||||
label: response.data[i].测量项目,
|
||||
value: response.data[i].测量项目
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
selectDate() {
|
||||
this.tableData = []
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, partNameValue_check, traceabilityCode_check, batchBarcodeValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.partNameValue ? partNameValue_check = 1 : (partNameValue_check = 0, this.partNameValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.batchBarcodeValue ? batchBarcodeValue_check = 1 : (batchBarcodeValue_check = 0, this.batchBarcodeValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['零件名称_ischeck', partNameValue_check]
|
||||
param[9] = ['零件名称', this.partNameValue]
|
||||
param[10] = ['二维码_ischeck', traceabilityCode_check]
|
||||
param[11] = ['二维码', this.traceabilityCode]
|
||||
param[12] = ['物料条码批次_ischeck', batchBarcodeValue_check]
|
||||
param[13] = ['物料条码批次', this.batchBarcodeValue]
|
||||
param[14] = ['PageCurrent', this.pageCurrent]
|
||||
param[15] = ['PageSize', this.pageSize]
|
||||
param[16] = ['PageCount', '1111', 'int', '1']
|
||||
param[17] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', '物料数据_视图_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let engineTypeValue_check, assemblyNumberValue_check, stationNumberValue_check, partNameValue_check, traceabilityCode_check, batchBarcodeValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.assemblyNumberValue ? assemblyNumberValue_check = 1 : (assemblyNumberValue_check = 0, this.assemblyNumberValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.partNameValue ? partNameValue_check = 1 : (partNameValue_check = 0, this.partNameValue = '')
|
||||
this.traceabilityCode ? traceabilityCode_check = 1 : (traceabilityCode_check = 0, this.traceabilityCode = '')
|
||||
this.batchBarcodeValue ? batchBarcodeValue_check = 1 : (batchBarcodeValue_check = 0, this.batchBarcodeValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['发动机型号_ischeck', engineTypeValue_check]
|
||||
param[3] = ['发动机型号', this.engineTypeValue]
|
||||
param[4] = ['发动机号_ischeck', assemblyNumberValue_check]
|
||||
param[5] = ['发动机号', this.assemblyNumberValue]
|
||||
param[6] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[7] = ['工位号', this.stationNumberValue]
|
||||
param[8] = ['零件名称_ischeck', partNameValue_check]
|
||||
param[9] = ['零件名称', this.partNameValue]
|
||||
param[10] = ['二维码_ischeck', traceabilityCode_check]
|
||||
param[11] = ['二维码', this.traceabilityCode]
|
||||
param[12] = ['物料条码批次_ischeck', batchBarcodeValue_check]
|
||||
param[13] = ['物料条码批次', this.batchBarcodeValue]
|
||||
var Data = this.CreateData('2001', '物料数据查询_报表', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.selectDate()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.selectDate()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,456 @@
|
||||
<!--<script src="../../../utils/setMethods.js"></script>-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="topCard">
|
||||
<div class="topDiv">
|
||||
<span style="margin-left: 10px">生产时间:</span>
|
||||
<el-date-picker
|
||||
v-model="dateTime"
|
||||
size="small"
|
||||
type="daterange"
|
||||
align="center"
|
||||
style="width: 240px;"
|
||||
value-format="yyyy-MM-dd"
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="getOrderNumber()"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" filterable clearable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
v-for="item in stationNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">产品型号:</span>
|
||||
<el-select v-model="engineTypeValue" placeholder="请选择产品型号" clearable size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in engineType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<span style="margin-left: 10px">订单号:</span>
|
||||
<el-select v-model="orderNumberValue" placeholder="请选择订单" clearable size="small" style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in orderNumber"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
size="mini"/>
|
||||
</el-select>
|
||||
<el-button type="primary" plain size="small" icon="el-icon-search" style="margin-left: 5px" @click="pageSize=15;pageCurrent=1;searchOrder();searchOrder1()">查询</el-button>
|
||||
<el-button type="info" size="small" icon="el-icon-download" @click="exportExcel()">Excel</el-button>
|
||||
</div>
|
||||
<div style="border: 1px solid #EBEEF5;width: 100%;height: 400px;">
|
||||
<div id="myChart" style="width: 100%;height: 380px;float: right;"/>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
ref="multipleTable"
|
||||
:data="tableData"
|
||||
:header-cell-style="{background:'#eef1f6',color:'#606266'}"
|
||||
:cell-class-name="tableRowClassName"
|
||||
element-loading-text="数据加载中"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.2)"
|
||||
stripe
|
||||
class="main"
|
||||
tooltip-effect="dark"
|
||||
height="350px"
|
||||
style="width: 100%;"
|
||||
border
|
||||
size="mini">
|
||||
<el-table-column align="center" label="工位号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.工位号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="订单号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.订单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="机型">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.机型 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="总成编号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发动机号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" width="80px" label="合格状态">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.是否合格 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="到达时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到达时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="离开时间">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.离开时间 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block" style="margin-top: 10px;">
|
||||
<el-pagination
|
||||
v-if="!loading"
|
||||
:current-page="pageCurrent"
|
||||
:page-sizes="[15, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: [],
|
||||
tableData: [], // 总数据数组
|
||||
tableData1: [], // 总数据数组
|
||||
xData: [], // echars x轴
|
||||
yData: [], // echars y轴
|
||||
engineTypeValue: '', // 产品型号
|
||||
engineType: [], // 产品型号数组
|
||||
orderNumber: [], // 订单号
|
||||
orderNumberValue: '', // 订单号
|
||||
stationNumberValue: '', // 工位号
|
||||
stationNumber: [], // 工位号
|
||||
statePlan: [], // 计划状态数组
|
||||
statePlanValue: '', // 计划状态
|
||||
importTime: '', // 计划状态
|
||||
releaseTime: '', // 计划状态
|
||||
dateTime: '',
|
||||
total: 0, // 总条数
|
||||
pageList: 15, // 每页显示条数
|
||||
pageSize: 15, // 每页显示条数
|
||||
pageCurrent: 1, // 后台获取页
|
||||
mid: [], // id
|
||||
loading: false,
|
||||
timer_1: null,
|
||||
MIDGroup: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.getOrderNumber()
|
||||
this.getEndStation()
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
if (rowIndex % 2 === 0) {
|
||||
return 'black'
|
||||
} else {
|
||||
return 'red'
|
||||
}
|
||||
},
|
||||
// 初始化获取产品型号
|
||||
getEndStation() {
|
||||
this.engineType = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_基本变量_机型代码_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.engineType.push({
|
||||
label: response.data[i].发动机型号,
|
||||
value: response.data[i].发动机型号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 初始化获取订单号
|
||||
getOrderNumber() {
|
||||
this.orderNumber = []
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
var Data = this.CreateData('11', '测量数据发动机在线状态_订单号_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.orderNumber.push({
|
||||
label: response.data[i].订单号,
|
||||
value: response.data[i].订单号
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 工位号
|
||||
getStationNumber() {
|
||||
this.stationNumber = []
|
||||
this.xData = []
|
||||
var param = []
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_工位与名称_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.stationNumber.push({
|
||||
label: response.data[i].工位号,
|
||||
value: response.data[i].工位号
|
||||
})
|
||||
this.xData.push(response.data[i].工位号)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 实时扭矩曲线
|
||||
drawLine() {
|
||||
// 基于准备好的dom,初始化echarts实例
|
||||
const myChart = this.$echarts.init(document.getElementById('myChart'))
|
||||
myChart.clear()
|
||||
myChart.setOption({
|
||||
title: {
|
||||
left: 'center',
|
||||
text: '生产订单完工统计'
|
||||
},
|
||||
toolbox: {// echart保存为图片
|
||||
show: true,
|
||||
feature: {
|
||||
mark: {
|
||||
show: true
|
||||
},
|
||||
saveAsImage: {
|
||||
show: true,
|
||||
pixelRatio: 1,
|
||||
title: '保存为图片',
|
||||
type: 'png',
|
||||
lang: ['点击保存']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: this.xData,
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 30
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'PASS',
|
||||
data: this.number,
|
||||
type: 'bar',
|
||||
showBackground: true,
|
||||
backgroundStyle: {
|
||||
color: 'rgba(180, 180, 180, 0.2)'
|
||||
},
|
||||
itemStyle: { // 上方显示数值
|
||||
normal: {
|
||||
label: {
|
||||
show: true, // 开启显示
|
||||
position: 'top', // 在上方显示
|
||||
textStyle: { // 数值样式
|
||||
color: 'black',
|
||||
fontSize: 16
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'NO',
|
||||
data: this.yData,
|
||||
type: 'bar',
|
||||
showBackground: true,
|
||||
backgroundStyle: {
|
||||
color: 'rgba(180, 180, 180, 0.2)'
|
||||
},
|
||||
itemStyle: { // 上方显示数值
|
||||
normal: {
|
||||
label: {
|
||||
show: true, // 开启显示
|
||||
position: 'top', // 在上方显示
|
||||
textStyle: { // 数值样式
|
||||
color: 'black',
|
||||
fontSize: 16
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
legend: {
|
||||
data: ['PASS', 'NO'],
|
||||
bottom: 0
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder() {
|
||||
this.tableData = []
|
||||
let engineTypeValue_check, stationNumberValue_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[5] = ['订单号', this.orderNumberValue]
|
||||
param[6] = ['产品型号_ischeck', engineTypeValue_check]
|
||||
param[7] = ['产品型号', this.engineTypeValue]
|
||||
param[8] = ['PageCurrent', this.pageCurrent]
|
||||
param[9] = ['PageSize', this.pageSize]
|
||||
param[10] = ['PageCount', '1111', 'int', '1']
|
||||
param[11] = ['ItemCount', '1111', 'int', '1']
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_发动机订单计划_订单完工_查询', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
console.log(response, 66)
|
||||
if (response.data.result.length !== 0) {
|
||||
this.tableData = response.data.result
|
||||
}
|
||||
this.total = parseInt(response.data.output[0].ItemCount)
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 查询订单
|
||||
searchOrder1() {
|
||||
this.yData = []
|
||||
this.number = []
|
||||
if (this.stationNumberValue) {
|
||||
this.xData = []
|
||||
this.xData.push(this.stationNumberValue)
|
||||
} else {
|
||||
this.getStationNumber()
|
||||
}
|
||||
this.tableData1 = []
|
||||
let engineTypeValue_check, stationNumberValue_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[5] = ['订单号', this.orderNumberValue]
|
||||
param[6] = ['产品型号_ischeck', engineTypeValue_check]
|
||||
param[7] = ['产品型号', this.engineTypeValue]
|
||||
var Data = this.CreateData('11', 'MES_计划BOM_发动机订单计划_订单完工_报表', param)
|
||||
this.ExecDatabase(Data).then(response => {
|
||||
if (response.data.length !== 0) {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
for (let j = 0; j < this.xData.length; j++) {
|
||||
if (!this.number[j]) {
|
||||
this.number[j] = 0
|
||||
}
|
||||
if (!this.yData[j]) {
|
||||
this.yData[j] = 0
|
||||
}
|
||||
if (this.xData[j] === response.data[i].工位号) {
|
||||
if (response.data[i].是否合格 === 'PASS') {
|
||||
this.number[j]++
|
||||
} else if (response.data[i].是否合格 === 'FAIL') {
|
||||
this.yData[j]++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}).then(() => {
|
||||
this.drawLine()
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.tableData.length !== 0) {
|
||||
let engineTypeValue_check, stationNumberValue_check, orderNumberValue_check
|
||||
this.engineTypeValue ? engineTypeValue_check = 1 : (engineTypeValue_check = 0, this.engineTypeValue = '')
|
||||
this.stationNumberValue ? stationNumberValue_check = 1 : (stationNumberValue_check = 0, this.stationNumberValue = '')
|
||||
this.orderNumberValue ? orderNumberValue_check = 1 : (orderNumberValue_check = 0, this.orderNumberValue = '')
|
||||
var param = []
|
||||
param[0] = ['开始时间', this.dateTime[0]]
|
||||
param[1] = ['结束时间', this.dateTime[1]]
|
||||
param[2] = ['工位号_ischeck', stationNumberValue_check]
|
||||
param[3] = ['工位号', this.stationNumberValue]
|
||||
param[4] = ['订单号_ischeck', orderNumberValue_check]
|
||||
param[5] = ['订单号', this.orderNumberValue]
|
||||
param[6] = ['产品型号_ischeck', engineTypeValue_check]
|
||||
param[7] = ['产品型号', this.engineTypeValue]
|
||||
var Data = this.CreateData('2001', 'MES_计划BOM_发动机订单计划_订单完工_报表', param)
|
||||
this.exportExcel_NPOI(Data)
|
||||
} else {
|
||||
this.$message.warning('暂无数据')
|
||||
}
|
||||
},
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageCurrent = 1
|
||||
this.pageSize = val
|
||||
this.searchOrder()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageCurrent = val
|
||||
this.searchOrder()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.topCard{
|
||||
margin: 5px;
|
||||
}
|
||||
.topDiv{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.el-select{
|
||||
width:200px
|
||||
}
|
||||
.el-input{
|
||||
width:200px
|
||||
}
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 80px;
|
||||
width: 300px;
|
||||
}
|
||||
.el-table .warning-row {
|
||||
background: oldlace;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
background: #f0f9eb;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user