质量统计完成

This commit is contained in:
qianhao.xu
2024-02-19 20:05:43 +08:00
parent 079a7ba091
commit b9d789b524
6 changed files with 566 additions and 241 deletions

View File

@@ -11,152 +11,163 @@
<el-date-picker v-model="search.endtime" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="班组">
<el-input v-model="search.team" placeholder="输入班组"></el-input>
</el-form-item>
<el-form-item label="工单号">
<el-input v-model="search.workorderid" placeholder="输入工单号"></el-input>
</el-form-item>
<el-form-item label="零件号">
<el-input v-model="search.partnumber" placeholder="输入零件号"></el-input>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="GetQualityStatisticsTable">搜索</el-button>
<el-button type="warning" >EXCEL导出</el-button>
<el-form-item label="产品描述">
<el-input v-model="search.product_description" placeholder="输入产品描述"></el-input>
</el-form-item>
<el-form-item label="班组">
<el-select v-model="search.team" placeholder="输入班组">
<el-option label="A班" value="A班"> </el-option>
<el-option label="B班" value="B班"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="报表类型">
<el-select v-model="search.reportType" placeholder="请选择">
<el-option v-for="item in reportType_options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
<el-button type="warning">EXCEL导出</el-button>
</el-form>
</div>
<div style="width: 100%">
<div style="font-size: 20px;text-align: center; margin 0 auto">{{ reportType_options[search.reportType].label }}</div>
</div>
<!-- 表格部分 -->
<vxe-table
:data="QualityStatisticsTable"
align="center"
:loading="loading"
border
:column-config="{ resizable: true, useKey: true }"
:row-config="{ useKey: true }"
resizable
show-overflow
ref="xTable"
:column-config="{ resizable: true }"
:row-config="{ isHover: true }"
v-loading="loading"
height="800"
:data="QualityStatisticsTable"
:merge-cells="mergeCells"
>
<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 title="订单信息" align="center">
<vxe-column field="workorderId" title="工单号"></vxe-column>
<vxe-column field="finishedPartNumber" title="零件号"></vxe-column>
<vxe-column field="productDescription" title="描述"></vxe-column>
<vxe-column field="requireNumber" title="生产投入数"></vxe-column>
<vxe-column field="team" title="班次"></vxe-column>
<vxe-column field="qualifiedNumber" title="合格数"></vxe-column>
<vxe-column field="qualifiedRate" title="合格率"></vxe-column>
<vxe-column field="paoguangTotal" title="抛光总数"></vxe-column>
<vxe-column field="damoTotal" title="打磨总数"></vxe-column>
<vxe-column field="baofeiTotal" title="报废总数"></vxe-column>
<vxe-column field="startTime" title="开始时间"></vxe-column>
<vxe-column field="endTime" title="结束时间"></vxe-column>
<vxe-column field="remark" title="备注" width="80"></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 title="油漆" align="center">
<vxe-column field="paintSuokong" title="缩孔"></vxe-column>
<vxe-column field="paintZhengkong" title="针孔"></vxe-column>
<vxe-column field="paintShiguang" title="失光"></vxe-column>
<vxe-column field="paintSecha" title="色差"></vxe-column>
<vxe-column field="paintDianzi" title="点子"></vxe-column>
<vxe-column field="paintOther" title="其他"></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 title="设备" align="center">
<vxe-column field="deviceShuiban" title="水斑"></vxe-column>
<vxe-column field="deviceZandian" title="脏点"></vxe-column>
<vxe-column field="deviceBianxing" title="变形"></vxe-column>
<vxe-column field="deviceYouzhu" title="油珠"></vxe-column>
<vxe-column field="deviceTuoluo" title="脱落"></vxe-column>
<vxe-column field="deviceZhuangshang" title="撞伤"></vxe-column>
<vxe-column field="deviceOther" title="其他"></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 title="毛坯" align="center">
<vxe-column field="blankMaoci" title="毛刺"></vxe-column>
<vxe-column field="blankSuoyin" title="缩印"></vxe-column>
<vxe-column field="blankCanshuang" title="擦伤"></vxe-column>
<vxe-column field="blankShaying" title="砂印"></vxe-column>
<vxe-column field="blankZangdian" title="脏点"></vxe-column>
<vxe-column field="blankDamo" title="打磨"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="程序" align="center">
<vxe-column field="programLiuguang" title="流挂"></vxe-column>
<vxe-column field="programSeqiqueqi" title="色漆缺漆"></vxe-column>
<vxe-column field="programQingqiqueqi" title="清漆缺漆"></vxe-column>
<vxe-column field="programJupi" title="桔皮"></vxe-column>
<vxe-column field="programOther" title="其他"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="班组操作" align="center">
<vxe-column field="teamTuoluocanshuang" title="脱落擦伤"></vxe-column>
<vxe-column field="teamQingqiqikuai" title="清漆漆块"></vxe-column>
<vxe-column field="teamSeqiqikuai" title="色漆漆块"></vxe-column>
<vxe-column field="teamFahua" title="发花"></vxe-column>
<vxe-column field="teamLiangbang" title="亮斑"></vxe-column>
<vxe-column field="teamPenglou" 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>
<pagination :total="pagination.total" :page.sync="pagination.pageNum" :limit.sync="pagination.pageSize" @pagination="getList" />
</div>
</template>
<script>
import * as echarts from 'echarts'
import { QueryQualityStatisticsTable, GetDetailsOfDetectionItems } from '@/api/qualityManagement/qualityStatistics.js'
import {
GetQualityStatisticsTable_first,
GetQualityStatisticsTable_again,
GetQualityStatisticsTable_final,
GetQualityStatisticsTable_total,
} from '@/api/qualityManagement/qualityStatistics_V2'
export default {
name: 'qualityStatistics',
data() {
return {
pickerOptions: {
shortcuts: [{
shortcuts: [
{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
picker.$emit('pick', new Date())
},
},
{
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24)
picker.$emit('pick', date)
},
},
{
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
search: {
starttime:null,
endtime:null,
team:null,
workorderid:null,
partnumber:null
const date = new Date()
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', date)
},
},
],
},
search: {
starttime: null,
endtime: null,
team: null,
workorderid: null,
partnumber: null,
reportType: 0,
product_description: '',
},
reportType_options: [
{ label: '首检报表', value: 0 },
{ label: '抛光报表', value: 1 },
{ label: '包装报表', value: 2 },
{ label: '总报表', value: 3 },
],
pagination: {
total: 0,
pageNum: 1,
@@ -164,146 +175,98 @@ export default {
},
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}%',
},
},
],
},
mergeCells: [
// { row: 0, col: 0, rowspan: 3, colspan: 0 },
// { row: 0, col: 1, rowspan: 3, colspan: 0 },
// { row: 0, col: 2, rowspan: 3, colspan: 0 },
// { row: 0, col: 3, rowspan: 3, colspan: 0 },
// { row: 0, col: 4, rowspan: 3, colspan: 0 },
// { row: 0, col: 5, rowspan: 3, colspan: 0 },
// { row: 0, col: 6, rowspan: 3, colspan: 0 },
// { row: 0, col: 7, rowspan: 3, colspan: 0 },
// { row: 0, col: 8, rowspan: 3, colspan: 0 },
// { row: 0, col: 9, rowspan: 3, colspan: 0 },
// { row: 0, col: 10, rowspan: 3, colspan: 0 },
// { row: 0, col: 11, rowspan: 3, colspan: 0 },
],
}
},
mounted() {
this.GetQualityStatisticsTable()
this.getList()
},
created() {},
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,
//todo 设置表合并行
mergeTable(num){
for(let i=0;i<this.QualityStatisticsTable.length;i=i+num){
this.mergeCells.push({row:i,col:0,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:1,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:2,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:3,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:4,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:5,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:6,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:7,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:8,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:9,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:10,rowspan:num,colspan:0})
this.mergeCells.push({row:i,col:11,rowspan:num,colspan:0})
}
switch (index) {
case 1:
// 首检抛光数量
this.DMLdialog.title = '首检抛光'
this.option.title.text = '首检抛光'
},
//todo 获取统计数据
getList() {
let query = { ...this.search, ...this.pagination }
delete query['reportType']
delete query['total']
console.log('query', query)
switch (this.search.reportType) {
case 0:
GetQualityStatisticsTable_first(query).then((res) => {
if (res.code == 200) {
this.loading = false
this.QualityStatisticsTable = res.data.item1
this.pagination.total = res.data.item2
this.mergeTable(3)
}
})
break
case 1:
GetQualityStatisticsTable_again(query).then((res) => {
if (res.code == 200) {
this.loading = false
this.QualityStatisticsTable = res.data.item1
this.pagination.total = res.data.item2
this.mergeTable(2)
}
})
break
case 2:
// 首检打磨数量
this.DMLdialog.title = '首检打磨'
this.option.title.text = '首检打磨'
GetQualityStatisticsTable_final(query).then((res) => {
if (res.code == 200) {
this.loading = false
this.QualityStatisticsTable = res.data.item1
this.pagination.total = res.data.item2
this.mergeTable(2)
}
})
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 = '三检报废'
GetQualityStatisticsTable_total(query).then((res) => {
if (res.code == 200) {
this.loading = false
this.QualityStatisticsTable = res.data.item1
this.pagination.total = res.data.item2
this.mergeTable()
}
})
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>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,309 @@
<template>
<div class="app-container">
<!-- 搜索部分 -->
<div>
<el-form :model="search" inline>
<el-form-item label="开始日期">
<el-date-picker v-model="search.starttime" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker v-model="search.endtime" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="班组">
<el-input v-model="search.team" placeholder="输入班组"></el-input>
</el-form-item>
<el-form-item label="工单号">
<el-input v-model="search.workorderid" placeholder="输入工单号"></el-input>
</el-form-item>
<el-form-item label="零件号">
<el-input v-model="search.partnumber" placeholder="输入零件号"></el-input>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="GetQualityStatisticsTable">搜索</el-button>
<el-button type="warning" >EXCEL导出</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/qualityManagement/qualityStatistics.js'
export default {
name: 'qualityStatistics',
data() {
return {
pickerOptions: {
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
search: {
starttime:null,
endtime:null,
team:null,
workorderid:null,
partnumber:null
},
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>

View File

@@ -692,6 +692,7 @@ import {
accumulator_query,
calculate_packagingInvestment,
update_workorder_status,
generateQualityStatisticsTable
} from '@/api/qualityManagement/thirtyFQC.js'
export default {
name: 'firstFQC',
@@ -907,8 +908,18 @@ export default {
.then((res) => {
if (res.code == 200) {
this.$notify.success('工单完成')
//todo 生成质量统计表 !!!!需要工单和班组
let query={
workorderID: this.CurrentWorkorder.clientWorkorder,
team:this.CurrentWorkorder.team
}
return generateQualityStatisticsTable(query)
}
}).then((res)=>{
if(res.code==200){
this.$notify.success('质量统计表生成成功')
}
})
},
//todo 获取下一个工单号