质量检验方案1
This commit is contained in:
@@ -1,280 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索部分 -->
|
||||
<div>
|
||||
<el-form :model="search" inline>
|
||||
<el-form-item label="年">
|
||||
<el-input v-model="search.year" placeholder="输入年份"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="周">
|
||||
<el-input v-model="search.week" placeholder="输入周"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<el-input v-model="search.date" placeholder="输入日期"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="search.workorderid" placeholder="输入工单号"></el-input>
|
||||
</el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="GetQualityStatisticsTable">搜索</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<vxe-table
|
||||
:data="QualityStatisticsTable"
|
||||
align="center"
|
||||
:loading="loading"
|
||||
border
|
||||
:column-config="{ resizable: true, useKey: true }"
|
||||
:row-config="{ useKey: true }"
|
||||
>
|
||||
<vxe-column type="seq" width="60"></vxe-column>
|
||||
<vxe-column field="id" title="id"></vxe-column>
|
||||
<vxe-column field="fkWorkorderId" title="工单id"></vxe-column>
|
||||
<vxe-column field="productName" title="产品名称"></vxe-column>
|
||||
<vxe-column field="color" title="颜色"></vxe-column>
|
||||
<vxe-column field="require" title="投入数"></vxe-column>
|
||||
<vxe-column field="left_right" title="左右产品"></vxe-column>
|
||||
<vxe-column field="team" title="班组"></vxe-column>
|
||||
<vxe-colgroup title="首检">
|
||||
<vxe-column field="qualifiedNum01" title="首检合格数量"></vxe-column>
|
||||
<vxe-column title="首检抛光数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="QualityAnalysis(row.fkWorkorderId, 1)">{{ row.defectNum01 }}</el-link>
|
||||
</template></vxe-column
|
||||
>
|
||||
<vxe-column title="首检打磨数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="warning" @click="QualityAnalysis(row.fkWorkorderId, 2)">{{ row.polishNum01 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="首检报废数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="danger" @click="QualityAnalysis(row.fkWorkorderId, 3)">{{ row.scrapNum01 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-colgroup>
|
||||
<vxe-colgroup title="二检">
|
||||
<vxe-column field="qualifiedNum02" title="二检合格数量"></vxe-column>
|
||||
<vxe-column title="二检打磨数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="warning" @click="QualityAnalysis(row.fkWorkorderId, 4)">{{ row.polishNum02 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="二检报废数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="danger" @click="QualityAnalysis(row.fkWorkorderId, 5)">{{ row.scrapNum02 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-colgroup>
|
||||
<vxe-colgroup title="三检">
|
||||
<vxe-column field="qualifiedNum03" title="三检合格数量"></vxe-column>
|
||||
<vxe-column title="三检打磨数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="warning" @click="QualityAnalysis(row.fkWorkorderId, 6)">{{ row.polishNum03 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column title="三检报废数量">
|
||||
<template #default="{ row }">
|
||||
<el-link type="danger" @click="QualityAnalysis(row.fkWorkorderId, 7)">{{ row.scrapNum03 }}</el-link>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-colgroup>
|
||||
<vxe-colgroup title="统计分析" fixed="right">
|
||||
<vxe-column field="firstgoodNum" title="一次合格数量"></vxe-column>
|
||||
<vxe-column field="firstgoodRate" title="一次合格率"></vxe-column>
|
||||
<vxe-column field="finalgoodNum" title="最终合格数量"></vxe-column>
|
||||
<vxe-column field="finalgoodRate" title="最终合格率"></vxe-column>
|
||||
<vxe-column field="scrapNum" title="报废数"></vxe-column>
|
||||
<vxe-column field="scrapRate" title="报废率"></vxe-column>
|
||||
</vxe-colgroup>
|
||||
</vxe-table>
|
||||
<pagination
|
||||
:total="pagination.total"
|
||||
:page.sync="pagination.pageNum"
|
||||
:limit.sync="pagination.pageSize"
|
||||
@pagination="GetQualityStatisticsTable()"
|
||||
/>
|
||||
|
||||
<!-- 弹窗-- 修改和删除 -->
|
||||
<el-dialog :title="DMLdialog.title" :visible.sync="DMLdialog.visiable" width="600px" append-to-body>
|
||||
<el-card class="box-card">
|
||||
<div class="container_grid">
|
||||
<div v-for="(item, index) in DefectDetails" :key="index" class="text item">
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-tag>{{ item.inspectionName }}</el-tag> {{ item.counter }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="margin-top: 5px"> <div id="chartColumn" style="width: 100%; height: 400px"></div></el-card>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="DMLdialog.visiable = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import { QueryQualityStatisticsTable, GetDetailsOfDetectionItems } from '@/api/operationManagement/quality/qualityStatistics.js'
|
||||
export default {
|
||||
name: 'qualityStatistics',
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
year: 2023,
|
||||
week: null,
|
||||
date: null,
|
||||
workorderid: '',
|
||||
},
|
||||
pagination: {
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loading: true,
|
||||
QualityStatisticsTable: [],
|
||||
DMLdialog: {
|
||||
title: '',
|
||||
visiable: false,
|
||||
},
|
||||
DefectDetails: [], //缺陷详情
|
||||
|
||||
option: {
|
||||
title: {
|
||||
text: '',
|
||||
subtext: '统计分析',
|
||||
left: 'center',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Access From',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [],
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)',
|
||||
},
|
||||
},
|
||||
label: {
|
||||
formatter: '{b}: {d}%',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.GetQualityStatisticsTable()
|
||||
},
|
||||
methods: {
|
||||
// todo 获取表格
|
||||
GetQualityStatisticsTable() {
|
||||
const query = { ...this.search, ...this.pagination }
|
||||
if (query.year == null || query.year == 0) query.year = -1
|
||||
if (query.week == null || query.week == 0) query.week = -1
|
||||
if (query.date == null || query.date == 0) query.date = -1
|
||||
if (query.date == null || query.date == 0) query.date = -1
|
||||
|
||||
QueryQualityStatisticsTable(query)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.QualityStatisticsTable = res.data.item1
|
||||
this.pagination.total = res.data.item2
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$notify.error('未知错误')
|
||||
})
|
||||
},
|
||||
// todo 统计分析详情
|
||||
QualityAnalysis(fkWorkorderId, index) {
|
||||
this.DMLdialog.visiable = true
|
||||
const query = {
|
||||
fkWorkorderId,
|
||||
index,
|
||||
}
|
||||
switch (index) {
|
||||
case 1:
|
||||
// 首检抛光数量
|
||||
this.DMLdialog.title = '首检抛光'
|
||||
this.option.title.text = '首检抛光'
|
||||
|
||||
break
|
||||
case 2:
|
||||
// 首检打磨数量
|
||||
this.DMLdialog.title = '首检打磨'
|
||||
this.option.title.text = '首检打磨'
|
||||
|
||||
break
|
||||
case 3:
|
||||
// 首检报废数量
|
||||
this.DMLdialog.title = '首检报废'
|
||||
this.option.title.text = '首检报废'
|
||||
break
|
||||
case 4:
|
||||
// 二检打磨数量
|
||||
this.DMLdialog.title = '二检打磨'
|
||||
this.option.title.text = '二检打磨'
|
||||
break
|
||||
case 5:
|
||||
// 二检报废数量
|
||||
this.DMLdialog.title = '二检报废'
|
||||
this.option.title.text = '二检报废'
|
||||
break
|
||||
case 6:
|
||||
// 三检打磨数量
|
||||
this.DMLdialog.title = '三检打磨'
|
||||
this.option.title.text = '三检打磨'
|
||||
break
|
||||
case 7:
|
||||
// 三检报废数量
|
||||
this.DMLdialog.title = '三检报废'
|
||||
this.option.title.text = '三检报废'
|
||||
break
|
||||
}
|
||||
//todo 获取检测项,详细信息
|
||||
GetDetailsOfDetectionItems(query).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.DefectDetails = res.data
|
||||
this.option.series[0].data.length = 0
|
||||
this.DefectDetails.forEach((item, index) => {
|
||||
this.option.series[0].data.push({
|
||||
name: item.inspectionName,
|
||||
value: item.counter,
|
||||
})
|
||||
})
|
||||
this.GetLoadEcharts()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//todo 加载echarts
|
||||
GetLoadEcharts() {
|
||||
let myChart = echarts.init(document.getElementById('chartColumn'))
|
||||
|
||||
myChart.setOption(this.option)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container_grid {
|
||||
display: grid;
|
||||
grid-template-columns: auto auto auto auto auto;
|
||||
grid-template-rows: auto auto auto auto auto auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user