Merge remote-tracking branch 'origin/master'

master
Yangwl 3 months ago
commit 00844f837e

@ -208,3 +208,92 @@ export function getTableCPKList(query) {
params: query
});
}
//白坯质量报表头部
export function getMonthOfDateTitle(query) {
return request({
url: '/quality/staticTable/getMonthOfDateTitle',
method: 'get',
params: query
});
}
export function getMonthOfData(query) {
return request({
url: '/quality/staticTable/getMonthOfData',
method: 'get',
params: query
});
}
export function getMonthOfLine(query) {
return request({
url: '/quality/staticTable/getMonthOfLine',
method: 'get',
params: query
});
}
export function getMonthOfDataRework(query) {
return request({
url: '/quality/staticTable/getMonthOfDataRework',
method: 'get',
params: query
});
}
export function getMonthOfLineRework(query) {
return request({
url: '/quality/staticTable/getMonthOfLineRework',
method: 'get',
params: query
});
}
export function getMonthOfDataDefect(query) {
return request({
url: '/quality/staticTable/getMonthOfDataDefect',
method: 'get',
params: query
});
}
export function getDefectItemTitle(query) {
return request({
url: '/quality/staticTable/getDefectItemTitle',
method: 'get',
params: query
});
}
export function getDefectItemData(query) {
return request({
url: '/quality/staticTable/getDefectItemData',
method: 'get',
params: query
});
}
export function getDefectItemLine(query) {
return request({
url: '/quality/staticTable/getDefectItemLine',
method: 'get',
params: query
});
}
export function getDefectItemDataPC(query) {
return request({
url: '/quality/staticTable/getDefectItemDataPC',
method: 'get',
params: query
});
}
export function getDefectItemLinePC(query) {
return request({
url: '/quality/staticTable/getDefectItemLinePC',
method: 'get',
params: query
});
}

@ -144,12 +144,13 @@
top: 28px;
font-size: 5px;
"
v-model="ymdArray"
v-model="ymdArray1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
@change="noOkTimeChange"
>
</el-date-picker>
</div>
@ -173,7 +174,7 @@
{{ n.projectName }}
</div>
<div class="itemname2">
{{ n.checkManName }} {{ n.checkTime }}
{{ n.checkManName }} {{ n.checkTime }}|{{ n.className }}|{{ n.defectSubclass }}
</div>
</div>
</div>
@ -193,12 +194,13 @@
top: 28px;
font-size: 5px;
"
v-model="ymdArray"
v-model="ymdArray2"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
@change="noOkRadioTimeChange"
>
</el-date-picker>
</div>
@ -220,7 +222,7 @@
<div class="itembottom">
<div class="item-table item-table1">
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">年各日产品异常趋势</div>
<div class="titlename">月每日线体异常趋势</div>
</div>
<div
id="echart5"
@ -231,8 +233,7 @@
<div class="titlebox" style="margin-bottom: 14px">
<div class="titlename">产品不合格率同期对比</div>
</div>
<div
id="echart6"
<div id="echart6"
style="margin: auto; width: 900px; height: 304.15px"
></div>
</div>
@ -311,9 +312,12 @@ export default {
yearShow: false,
monthShow: true,
dateShow: false,
ymdArray: [],
ymdStart: null,
ymdEnd: null,
ymdArray1: [],
ymdStart1: null,
ymdEnd1: null,
ymdArray2: [],
ymdStart2: null,
ymdEnd2: null,
};
},
created() {
@ -333,17 +337,17 @@ export default {
getDate() {
let start = this.Fungetdate(0);
let end = this.Fungetdate(0);
this.ymdArray.push(start, end);
this.ymdArray1.push(start, end);
this.ymdArray2.push(start, end);
this.optionDatalist1 = [];
this.optionDatalist2 = [];
this.optionDatalist3 = [];
this.optionDatalist4 = [];
this.ymdStart = moment(this.ymdArray[0]).format("YYYY-MM-DD");
this.ymdEnd = moment(this.ymdArray[1]).format("YYYY-MM-DD");
this.getdatalist(
moment(this.ymdArray[0]).format("YYYY-MM-DD"),
moment(this.ymdArray[1]).format("YYYY-MM-DD")
);
this.ymdStart1 = moment(this.ymdArray1[0]).format("YYYY-MM-DD");
this.ymdEnd1 = moment(this.ymdArray1[1]).format("YYYY-MM-DD");
this.ymdStart2 = moment(this.ymdArray2[0]).format("YYYY-MM-DD");
this.ymdEnd2 = moment(this.ymdArray2[1]).format("YYYY-MM-DD");
this.getdatalist();
this.initChart1();
},
@ -381,11 +385,12 @@ export default {
getDeviceRefreshTime() {
const _this = this;
getDeviceRefreshTime().then((response) => {
if (response.data) {
// console.log(response.data)
this.RefreshTime = response.data;
this.time1 = setInterval(() => {
_this.getdatalist(_this.ymdStart, _this.ymdEnd);
_this.getdatalist();
_this.initChart1();
}, 1000 * 60 * this.RefreshTime);
}
@ -409,6 +414,45 @@ export default {
// }
// });
// },
noOkTimeChange(){
this.ymdStart1 = moment(this.ymdArray1[0]).format("YYYY-MM-DD");
this.ymdEnd1 = moment(this.ymdArray1[1]).format("YYYY-MM-DD");
//
getProduceNoOkList({
typeCode: "produce",
ymdType: this.selectxtclasses,
productDateStart: this.ymdStart1,
productDateEnd: this.ymdEnd1,
factoryCode: "ds_" + this.selectxt,
}).then((response) => {
if (response) {
this.Qualitylist = response;
}
});
},
noOkRadioTimeChange(){
this.ymdStart2 = moment(this.ymdArray2[0]).format("YYYY-MM-DD");
this.ymdEnd2 = moment(this.ymdArray2[1]).format("YYYY-MM-DD");
//
getCheckProjectsPie({
typeCode: "produce",
ymdType: this.selectxtclasses,
productDateStart: this.ymdStart2,
productDateEnd: this.ymdEnd2,
factoryCode: "ds_" + this.selectxt,
}).then((response) => {
if (response) {
this.optionDatalist2 = [];
response.forEach((item) => {
let a = {};
a.name = item.projectName;
a.value = item.quality;
this.optionDatalist2.push(a);
});
this.initChart3();
}
});
},
getdatalist() {
const _this = this;
@ -428,8 +472,8 @@ export default {
getProduceNoOkList({
typeCode: "produce",
ymdType: _this.selectxtclasses,
productDateStart: this.ymdStart,
productDateEnd: this.ymdEnd,
productDateStart: this.ymdStart1,
productDateEnd: this.ymdEnd1,
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
@ -440,8 +484,8 @@ export default {
getCheckProjectsPie({
typeCode: "produce",
ymdType: _this.selectxtclasses,
productDateStart: this.ymdStart,
productDateEnd: this.ymdEnd,
productDateStart: this.ymdStart2,
productDateEnd: this.ymdEnd2,
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
@ -549,7 +593,7 @@ export default {
position: "right",
distance: 10, //
show: true,
},
}
},
data: [], // value<EFBFBD>
tooltip: {
@ -662,6 +706,10 @@ export default {
tooltip: {
show: true,
trigger: "item",
formatter: function(params) {
const value = parseInt(params.value) || params.value;
return `${params.seriesName}<br/>${params.name}: ${value} PC`;
}
},
legend: {
show: true,
@ -802,7 +850,7 @@ export default {
crossStyle: {
color: "#999",
},
},
}
},
legend: {
show: true,
@ -906,9 +954,9 @@ export default {
],
series: [
{
name: "不合格比例",
name: "去年不合格率(%)",
type: "line",
stack: "总量",
stack: "",
symbol: "circle",
symbolSize: 8,
yAxisIndex: 1,
@ -921,17 +969,17 @@ export default {
},
},
},
label: {
show: true, //
position: "top", // 'top', 'bottom', 'left', 'right'
formatter: "{c}", // {c}
},
//label: {
// show: true, //
// position: "top", // 'top', 'bottom', 'left', 'right'
// formatter: "{c}", // {c}
//},
data: [],
},
{
name: "本年",
name: "本年不合格率(%)",
type: "line",
stack: "总量",
stack: "",
symbol: "circle",
symbolSize: 8,
yAxisIndex: 1,
@ -944,12 +992,25 @@ export default {
},
},
},
//label: {
// show: true, //
// position: "bottom", // 'top', 'bottom', 'left', 'right'
// formatter: "{c}", // {c}
//},
data: [],
},
{
name: "上年",
name: "去年不合格数量(PC)",
data: [],
type: "bar",
label: { //
show: true,
position: 'top', //
formatter: function(params) {//
const value = parseInt(params.value) || params.value;
return `${value} PC`;
}
},
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
@ -965,9 +1026,17 @@ export default {
},
},
{
name: "不合格数量",
name: "本年不合格数量(PC)",
data: [],
type: "bar",
label: { //
show: true,
position: 'top', //
formatter: function(params) {//
const value = parseInt(params.value) || params.value;
return `${value} PC`;
}
},
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
@ -1001,8 +1070,10 @@ export default {
let max4 = Math.max(...seriesdata4) + 5;
let legenddata = [];
legenddata.push("上年");
legenddata.push("本年");
legenddata.push("去年不合格数量(PC)");
legenddata.push("本年不合格数量(PC)");
legenddata.push("去年不合格率(%)");
legenddata.push("本年不合格率(%)");
let yAxismax1 = 0;
let yAxismax2 = 0;
if (max1 > max2) {
@ -1508,6 +1579,7 @@ export default {
//
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c}PC"
},
grid: {
top: "60",
@ -1520,7 +1592,7 @@ export default {
rich: {
a: {
color: "#FFFFFF",
width: 30,
width: 70,
fontSize: 13,
},
b: {
@ -1542,7 +1614,7 @@ export default {
var index;
for (var i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value;
target = data[i].value+"PC";
title = data[i].label;
index = i < 6 ? i : 5;
}
@ -1633,16 +1705,19 @@ export default {
radius: ["44%", "63%"],
center: ["50%", "40%"],
roseType: "radius",
// itemStyle: {
// normal: {
// color: function (params) {
// return colorList[params.dataIndex]
// }
// }
// },
//label: {
// formatter: function(params) {
// // params
// return `${params.name}: ${params.value}PC (${params.percent}%)`;
// }
//},
label: {
show: false,
},
tooltip: {
trigger: 'item', // 使'item'
formatter: '{b}: {c}PC ({d}%)' //
},
emphasis: {
label: {
show: false,

@ -0,0 +1,211 @@
<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-table v-loading="loading" :data="hourProList" 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 label="累计" align="center" prop="rowSum" min-width="100"/>
</el-table>
</div>
</template>
<script>
import {getMonthOfDateTitle, getMonthOfDataDefect} from "@/api/quality/qcTable";
import moment from 'moment';
export default {
name: "BpReworkRate",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
hourProList: [],
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:[
],
spanArr: [],
position: 0
};
},
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.loading = true;
//Table
getMonthOfDateTitle(this.queryParams).then(response => {
this.showTitles = [];
for(let i=0;i<=response.length-1;i++){
var pobj={};
pobj.id="monthNum"+i;
pobj.titleName = response[i];
this.showTitles.push(pobj)
}
});
//Table
getMonthOfDataDefect(this.queryParams).then(response => {
this.hourProList = response;
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.spanArr = [];
this.position = 0;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/staticTable/getMonthOfDataDefectExport', {
...this.queryParams
}, `bpDefect_${new Date().getTime()}.xlsx`)
},
//
indexMethod(index) {
return index + 1;
},
}
};
</script>

@ -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,getDefectItemData,getDefectItemLine} from "@/api/quality/qcTable";
import moment from 'moment';
import * as echarts from "echarts";
export default {
name: "BpDefectItem",
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
getDefectItemData(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/getDefectItemDataExport', {
...this.queryParams
}, `bpDefectItem_${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
getDefectItemLine(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>

@ -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>

@ -0,0 +1,358 @@
<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-table v-loading="loading" :data="hourProList" :span-method="objectSpanMethod" border>
<el-table-column label="序号" type="index" align="center" :index="indexMethod" fixed/>
<el-table-column label="白坯名称" align="center" prop="materialName" min-width="100" 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>
</el-tab-pane>
<el-tab-pane label="图表" name="second">
<div id="echartss" style="width:1200px;height:450px;"></div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {getMonthOfDateTitle, getMonthOfData,getMonthOfLine} from "@/api/quality/qcTable";
import moment from 'moment';
import * as echarts from "echarts";
export default {
name: "BpNookRate",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
hourProList: [],
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
};
},
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
getMonthOfDateTitle(this.queryParams).then(response => {
this.showTitles = [];
for(let i=0;i<=response.length-1;i++){
var pobj={};
pobj.id="monthNum"+i;
pobj.titleName = response[i];
this.showTitles.push(pobj)
}
});
//Table
getMonthOfData(this.queryParams).then(response => {
this.hourProList = response;
this.rowspan();
this.loading = false;
});
//
this.getTbody();
},
//
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/getMonthOfDataExport', {
...this.queryParams
}, `bpNoOkRate_${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
let xData=[]
let yData=[]
getMonthOfLine(this.queryParams).then(response => {
response.map((item,index)=>{
xData.push(item.ymdms),
yData.push(item.noOkBatchRate)
})
_this.getEcharts(xData,yData)
});
},
getEcharts(xData,yData){
var _this=this
var chartDom = document.getElementById('echartss');
var myChart = echarts.init(chartDom);
var option;
option = {
grid: {
y: '5%',
x:'1%',
y2: '6%',
x2: '1%',
width:'96%',
containLabel: true
},
xAxis: {
type: 'category',
name: '日',
splitLine: {
show: true //线
},
axisTick:{
show:false,
inside:true,
},
axisLabel:{
rotate: 50,
fontSize:11
},
data: xData
},
yAxis: {
type: 'value',
show:true,
// boundaryGap:true,
axisLine:{
// show:true,
},
axisLabel:{
formatter:'{value}%'
}
},
series: [
{
name:'不良率%',
data: yData,
type: 'line',
symbol: "circle",
symbolSize: 5,
label:{
show:true,
fontSize:11
},
lineStyle: {
color: "rgba(12, 115, 242, 1)"
},
areaStyle:{
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
offset: 0,
color: "#fff" // 0%
}, {
offset: 1,
color: "rgba(12, 115, 242, 1)" // 100%
}], false)
},
}
}
]
};
option && myChart.setOption(option);
},
//
indexMethod(index) {
return index + 1;
},
/**
* 1. 若是objectSpanMethod不返回任何东西表格不会变化
* 2. 最外层的判断一般是先从第几列开始合并
* 3. 这次从第0行合并2个下次就要从第3行开始合并0行加俩就到3行了
* 4. 这种方式是有多少条数据合并多少条数据比如本案例中有7条数据从第0条合并到第7条
* 5. return { rowspan: 0, colspan: 0 } //
* */
rowspan() {
this.hourProList.forEach((item, index) => {
if (index === 0) {
this.spanArr.push(1);
this.position = 0;
} else {
if (
this.hourProList[index].materialName ===
this.hourProList[index - 1].materialName
) {
this.spanArr[this.position] += 1;
this.spanArr.push(0);
} else {
this.spanArr.push(1);
this.position = index;
}
}
});
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
const _row = this.spanArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
};
}
},
}
};
</script>

@ -0,0 +1,358 @@
<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-table v-loading="loading" :data="hourProList" :span-method="objectSpanMethod" border>
<el-table-column label="序号" type="index" align="center" :index="indexMethod" fixed/>
<el-table-column label="白坯名称" align="center" prop="materialName" min-width="100" 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>
</el-tab-pane>
<el-tab-pane label="图表" name="second">
<div id="echartss" style="width:1200px;height:450px;"></div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import {getMonthOfDateTitle, getMonthOfDataRework,getMonthOfLineRework} from "@/api/quality/qcTable";
import moment from 'moment';
import * as echarts from "echarts";
export default {
name: "BpReworkRate",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
hourProList: [],
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
};
},
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
getMonthOfDateTitle(this.queryParams).then(response => {
this.showTitles = [];
for(let i=0;i<=response.length-1;i++){
var pobj={};
pobj.id="monthNum"+i;
pobj.titleName = response[i];
this.showTitles.push(pobj)
}
});
//Table
getMonthOfDataRework(this.queryParams).then(response => {
this.hourProList = response;
this.rowspan();
this.loading = false;
});
//
this.getTbody();
},
//
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.spanArr = [];
this.position = 0;
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 导出按钮操作 */
handleExport() {
this.download('quality/staticTable/getMonthOfDataReworkExport', {
...this.queryParams
}, `bpReworkRate_${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
let xData=[]
let yData=[]
getMonthOfLineRework(this.queryParams).then(response => {
response.map((item,index)=>{
xData.push(item.ymdms),
yData.push(item.noOkBatchRate)
})
_this.getEcharts(xData,yData)
});
},
getEcharts(xData,yData){
var _this=this
var chartDom = document.getElementById('echartss');
var myChart = echarts.init(chartDom);
var option;
option = {
grid: {
y: '5%',
x:'1%',
y2: '6%',
x2: '1%',
width:'96%',
containLabel: true
},
xAxis: {
type: 'category',
name: '日',
splitLine: {
show: true //线
},
axisTick:{
show:false,
inside:true,
},
axisLabel:{
rotate: 50,
fontSize:11
},
data: xData
},
yAxis: {
type: 'value',
show:true,
// boundaryGap:true,
axisLine:{
// show:true,
},
axisLabel:{
formatter:'{value}%'
}
},
series: [
{
name:'不良率%',
data: yData,
type: 'line',
symbol: "circle",
symbolSize: 5,
label:{
show:true,
fontSize:11
},
lineStyle: {
color: "rgba(12, 115, 242, 1)"
},
areaStyle:{
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
offset: 0,
color: "#fff" // 0%
}, {
offset: 1,
color: "rgba(12, 115, 242, 1)" // 100%
}], false)
},
}
}
]
};
option && myChart.setOption(option);
},
//
indexMethod(index) {
return index + 1;
},
/**
* 1. 若是objectSpanMethod不返回任何东西表格不会变化
* 2. 最外层的判断一般是先从第几列开始合并
* 3. 这次从第0行合并2个下次就要从第3行开始合并0行加俩就到3行了
* 4. 这种方式是有多少条数据合并多少条数据比如本案例中有7条数据从第0条合并到第7条
* 5. return { rowspan: 0, colspan: 0 } //
* */
rowspan() {
this.hourProList.forEach((item, index) => {
if (index === 0) {
this.spanArr.push(1);
this.position = 0;
} else {
if (
this.hourProList[index].materialName ===
this.hourProList[index - 1].materialName
) {
this.spanArr[this.position] += 1;
this.spanArr.push(0);
} else {
this.spanArr.push(1);
this.position = index;
}
}
});
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1) {
const _row = this.spanArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col,
};
}
},
}
};
</script>
Loading…
Cancel
Save