|
|
|
@ -0,0 +1,342 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
|
|
|
|
|
<el-form-item label="检验月份" prop="yearMonthDate">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.yearMonthDate"
|
|
|
|
|
type="month"
|
|
|
|
|
placeholder="选择月">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="白坯名称" prop="materialName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialName"
|
|
|
|
|
placeholder="请输入白坯名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
<span style="color:firebrick;font-size: small; text-align: center;padding-left:30px">说明:空白处表示当日未生产。</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
|
|
|
|
|
<el-tab-pane label="图表" name="first">
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24" style="text-align:center">
|
|
|
|
|
<h2>{{form.column080090}} 年 {{form.column090100}}月 黑蚊香白坯性能不良排列图</h2>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-descriptions title="" border :column="3" :contentStyle="content_style" :label-style="label_style">
|
|
|
|
|
<el-descriptions-item label="产品名称" class="my-description-item1">{{form.materialName}}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="抽检批次" class="my-description-item1">{{form.sampleQty}}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="生产车间" class="my-description-item1">{{form.workCenter}}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="不合格批次" class="my-description-item1">{{form.noOkQty}}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="批次不合格率" class="my-description-item1">{{form.noOkNumRate}}</el-descriptions-item>
|
|
|
|
|
<el-descriptions-item label="批次合格率" class="my-description-item1">{{form.okNumRate}}</el-descriptions-item>
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div id="echartss" style="width:1200px;height:450px;"></div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="报表" name="second">
|
|
|
|
|
<el-table v-loading="loading" :data="itemProList" border>
|
|
|
|
|
<el-table-column label="序号" type="index" align="center" :index="indexMethod" fixed/>
|
|
|
|
|
<el-table-column label="项目" align="center" prop="dataType" min-width="100" fixed/>
|
|
|
|
|
<template v-for="(column, index) in showTitles">
|
|
|
|
|
<el-table-column align="center" min-width="120" :prop="column.id" :key="column.id" :label="column.titleName"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getDefectItemTitle,getDefectItemDataPC,getDefectItemLinePC} from "@/api/quality/qcTable";
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
export default {
|
|
|
|
|
name: "BpDefectItemPC",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 备料单表格数据
|
|
|
|
|
itemProList: [],
|
|
|
|
|
activeName: 'first',
|
|
|
|
|
showTitles:[],//列表展示的小时段
|
|
|
|
|
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
yearMonthDate:null,
|
|
|
|
|
yearMonth:null,
|
|
|
|
|
productDateArray: [],
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
workorderCode: null,
|
|
|
|
|
workorderName: null,
|
|
|
|
|
parentOrder: null,
|
|
|
|
|
orderId: null,
|
|
|
|
|
orderCode: null,
|
|
|
|
|
productId: null,
|
|
|
|
|
productCode: null,
|
|
|
|
|
prodType: null,
|
|
|
|
|
productName: null,
|
|
|
|
|
productSpc: null,
|
|
|
|
|
productDate: null,
|
|
|
|
|
equTypeCode: "equ_type_hf"
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 班次list
|
|
|
|
|
workShift: [],
|
|
|
|
|
equipmentTypeOption:[
|
|
|
|
|
{equipmentTypeCode:"equ_type_cxj",equipmentTypeName:"成型机"},
|
|
|
|
|
{equipmentTypeCode:"equ_type_hf",equipmentTypeName:"烘房"}
|
|
|
|
|
],
|
|
|
|
|
spanArr: [],
|
|
|
|
|
position: 0,
|
|
|
|
|
content_style: {
|
|
|
|
|
'text-align': 'center',
|
|
|
|
|
'min-width': '200px',
|
|
|
|
|
'word-break': 'break-all'
|
|
|
|
|
},
|
|
|
|
|
label_style: {
|
|
|
|
|
'color': '#000',
|
|
|
|
|
'text-align': 'center',
|
|
|
|
|
'font-weight': '600',
|
|
|
|
|
'height': '40px',
|
|
|
|
|
'background-color': '#d6dbe1',
|
|
|
|
|
'min-width': '100px',
|
|
|
|
|
'word-break': 'keep-all'
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getDate();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/**获取默认查询时间段**/
|
|
|
|
|
getDate() {
|
|
|
|
|
let start = this.Fungetdate (0);
|
|
|
|
|
this.queryParams.yearMonthDate = start;
|
|
|
|
|
},
|
|
|
|
|
Fungetdate (num) {
|
|
|
|
|
var dd = new Date();
|
|
|
|
|
dd.setDate(dd.getDate() + num);
|
|
|
|
|
var y = dd.getFullYear();
|
|
|
|
|
var m = dd.getMonth() + 1;//获取当前月份的日期
|
|
|
|
|
return y + "-" + m ;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 查询设备小时产量列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
|
|
|
|
|
if(this.queryParams.yearMonthDate!=null){
|
|
|
|
|
this.queryParams.yearMonth = moment(this.queryParams.yearMonthDate).format('YYYY-MM');
|
|
|
|
|
}else{
|
|
|
|
|
this.$message.error("请填写月份");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.spanArr = [];
|
|
|
|
|
this.position = 0;
|
|
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
//获取Table表头
|
|
|
|
|
getDefectItemTitle(this.queryParams).then(response => {
|
|
|
|
|
this.showTitles = [];
|
|
|
|
|
for(let i=0;i<=response.length-1;i++){
|
|
|
|
|
var pobj={};
|
|
|
|
|
pobj.id="item"+i;
|
|
|
|
|
pobj.titleName = response[i];
|
|
|
|
|
this.showTitles.push(pobj)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//获取Table数据
|
|
|
|
|
getDefectItemDataPC(this.queryParams).then(response => {
|
|
|
|
|
this.itemProList = response;
|
|
|
|
|
this.getTbody();
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
prepareId: null,
|
|
|
|
|
workorderCode: null,
|
|
|
|
|
workorderName: null,
|
|
|
|
|
parentOrder: null,
|
|
|
|
|
orderId: null,
|
|
|
|
|
orderCode: null,
|
|
|
|
|
productId: null,
|
|
|
|
|
productCode: null,
|
|
|
|
|
prodType: null,
|
|
|
|
|
productName: null,
|
|
|
|
|
productSpc: null,
|
|
|
|
|
wetDetailPlanId: null,
|
|
|
|
|
productDate: null,
|
|
|
|
|
shiftId: null,
|
|
|
|
|
ancestors: null,
|
|
|
|
|
status: null,
|
|
|
|
|
remark: null,
|
|
|
|
|
attr1: null,
|
|
|
|
|
attr2: null,
|
|
|
|
|
attr3: null,
|
|
|
|
|
attr4: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
factoryCode: null
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
this.spanArr = [];
|
|
|
|
|
this.position = 0;
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('quality/staticTable/getDefectItemDataPCExport', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `bpDefectItemPC_${new Date().getTime()}.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleClick(){
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
this.$refs.tables.doLayout()//对table进行重新布局
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getTbody(){
|
|
|
|
|
this.loading=true
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
this.$refs.tables.doLayout()//对table进行重新布局
|
|
|
|
|
})
|
|
|
|
|
let _this = this
|
|
|
|
|
getDefectItemLinePC(this.queryParams).then(response => {
|
|
|
|
|
_this.form = response;
|
|
|
|
|
_this.getEcharts(response.supplierCodes,response.columns1,response.columns2)
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getEcharts(xData,yDataLeft,yDdataRight){
|
|
|
|
|
var _this=this
|
|
|
|
|
var chartDom = document.getElementById('echartss');
|
|
|
|
|
var myChart = echarts.init(chartDom);
|
|
|
|
|
var option;
|
|
|
|
|
option = {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: 'cross',
|
|
|
|
|
crossStyle: {
|
|
|
|
|
color: '#999'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: ['不良率', '累计不良率']
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: xData//['断片', '断裂', '变形', '干料', '杂质']
|
|
|
|
|
},
|
|
|
|
|
yAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: 'value',
|
|
|
|
|
name: '不良率(%)',
|
|
|
|
|
min: 0,
|
|
|
|
|
max: 100,
|
|
|
|
|
interval: 5,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
formatter: '{value} %'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
type: 'value',
|
|
|
|
|
name: '累计不良率',
|
|
|
|
|
min: 0,
|
|
|
|
|
//max: 100,
|
|
|
|
|
interval: 20,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
formatter: '{value} %'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: '不良率',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: yDataLeft, //[15, 10, 8, 5, 2],
|
|
|
|
|
label: {
|
|
|
|
|
show: true, // 开启显示
|
|
|
|
|
position: 'top', // 显示位置,可以是'top', 'bottom', 'left', 'right'等
|
|
|
|
|
formatter: '{c}%' // {c} 表示系列中的当前数据值
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '累计不良率',
|
|
|
|
|
type: 'line',
|
|
|
|
|
yAxisIndex: 1,
|
|
|
|
|
data: yDdataRight //[15, 25, 33, 38, 40]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
option && myChart.setOption(option);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 生成表头序号
|
|
|
|
|
indexMethod(index) {
|
|
|
|
|
return index + 1;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
.my-description-item1 {
|
|
|
|
|
width: 200px; /* 或者你想要的任何宽度 */
|
|
|
|
|
}
|
|
|
|
|
</style>
|