质量看板修改,成品推移图修改。

master
杨万里 7 days ago
parent 89faff5618
commit 7318c21d08

@ -1,169 +0,0 @@
<template>
<div id="data-view">
<dv-full-screen-container>
<div class="main-header">
<top-header />
</div>
<dv-border-box-1 class="main-container">
<dv-border-box-3 class="left-chart-container">
<Left-Chart-1 />
<Left-Chart-2 />
<Left-Chart-3 />
</dv-border-box-3>
<div class="right-main-container">
<div class="rmc-top-container">
<dv-border-box-3 class="rmctc-left-container">
<Center-Cmp />
</dv-border-box-3>
<div class="rmctc-right-container">
<dv-border-box-3 class="rmctc-chart-1">
<Right-Chart-1 />
</dv-border-box-3>
<dv-border-box-4 class="rmctc-chart-2" :reverse="true">
<Right-Chart-2 />
</dv-border-box-4>
</div>
</div>
<dv-border-box-4 class="rmc-bottom-container">
<Bottom-Charts />
</dv-border-box-4>
</div>
</dv-border-box-1>
</dv-full-screen-container>
</div>
</template>
<script>
import LeftChart1 from './index7/LeftChart1'
import LeftChart2 from './index7/LeftChart2'
import LeftChart3 from './index7/LeftChart3'
import CenterCmp from './index7/CenterCmp'
import RightChart1 from './index7/RightChart1'
import RightChart2 from './index7/RightChart2'
import BottomCharts from './index7/BottomCharts'
import topHeader from './index7/topHeader'
export default {
name: 'DataView',
components: {
topHeader,
LeftChart1,
LeftChart2,
LeftChart3,
CenterCmp,
RightChart1,
RightChart2,
BottomCharts
},
data () {
return {}
}
}
</script>
<style lang="less">
#data-view {
width: 100%;
height: 100%;
background-color: #030409;
color: #fff;
#dv-full-screen-container {
background-image: url("~@/assets/board/cs7/bg.png");
background-size: 100% 100%;
box-shadow: 0 0 3px blue;
display: flex;
flex-direction: column;
}
.main-header {
height: 80px;
display: flex;
justify-content: space-between;
align-items: flex-end;
.mh-left {
font-size: 20px;
color: rgb(1,134,187);
a:visited {
color: rgb(1,134,187);
}
}
.mh-middle {
font-size: 30px;
}
.mh-left, .mh-right {
width: 450px;
}
}
.main-container {
height: calc(~"100% - 80px");
margin-left: 0px;
.border-box-content {
//padding: 20px;
box-sizing: border-box;
display: flex;
}
}
.left-chart-container {
width: 22%;
padding: 10px;
box-sizing: border-box;
.border-box-content {
flex-direction: column;
}
}
.right-main-container {
width: 78%;
padding-left: 5px;
box-sizing: border-box;
}
.rmc-top-container {
height: 65%;
display: flex;
}
.rmctc-left-container {
width: 65%;
}
.rmctc-right-container {
width: 35%;
}
.rmc-bottom-container {
height: 35%;
}
.rmctc-chart-1, .rmctc-chart-2 {
height: 50%;
}
}
</style>

@ -108,7 +108,7 @@
<td style="width: 8%">工单号</td>
<!-- <td style="width: 8%;">异常单号</td> -->
<td style="width: 16%">产品名称</td>
<td style="width: 14%">批次号</td>
<!-- <td style="width: 14%">批次号</td>-->
<td style="width: 8%">计划数量</td>
<td style="width: 8%">报工数量</td>
</tr>
@ -134,7 +134,7 @@
<td style="width: 8%">{{ n.workorderCodeSap }}</td>
<!-- <td style="width: 8%;">{{ n.orderNo }}</td> -->
<td style="width: 16%">{{ n.productName }}</td>
<td style="width: 12%">{{ n.batchCode }}</td>
<!-- <td style="width: 12%">{{ n.batchCode }}</td>-->
<td style="width: 8%">{{ n.quantitySplit }}</td>
<td style="width: 8%">{{ n.quantityProduced }}</td>
</tr>

@ -336,10 +336,9 @@ export default {
methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate(0);
let end = this.Fungetdate(0);
this.ymdArray1.push(start, end);
this.ymdArray2.push(start, end);
let dates = this.getMonthDates();
this.ymdArray1 = [dates.start, dates.end];
this.ymdArray2 = [dates.start, dates.end];
this.optionDatalist1 = [];
this.optionDatalist2 = [];
this.optionDatalist3 = [];
@ -352,13 +351,28 @@ export default {
this.initChart1();
},
Fungetdate(num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1; //
var d = dd.getDate();
return y + "-" + m + "-" + d;
// Fungetdate(num) {
// var dd = new Date();
// dd.setDate(dd.getDate() + num);
// var y = dd.getFullYear();
// var m = dd.getMonth() + 1; //
// var d = dd.getDate();
// return y + "-" + m + "-" + d;
// },
getMonthDates() {
const now = new Date();
const start = new Date(now.getFullYear(), now.getMonth(), 1);
const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
return {
start: this.formatDate(start),
end: this.formatDate(end)
};
},
formatDate(date) {
const y = date.getFullYear();
const m = date.getMonth() + 1;
const d = date.getDate();
return `${y}-${m < 10 ? '0' + m : m}-${d < 10 ? '0' + d : d}`;
},
back() {
this.$router.push({ path: "/index" });
@ -384,22 +398,19 @@ export default {
},
getDeviceRefreshTime() {
const _this = this;
getDeviceRefreshTime().then((response) => {
if (response.data) {
// console.log(response.data)
this.RefreshTime = response.data;
this.RefreshTime = 5;
this.time1 = setInterval(() => {
_this.getdatalist();
_this.initChart1();
}, 1000 * 60 * this.RefreshTime);
}
});
},
noOkTimeChange(){
this.ymdStart1 = moment(this.ymdArray1[0]).format("YYYY-MM-DD");
this.ymdEnd1 = moment(this.ymdArray1[1]).format("YYYY-MM-DD");
const now = moment();
this.ymdStart1 = now.startOf('month').format("YYYY-MM-DD");
this.ymdEnd1 = now.endOf('month').format("YYYY-MM-DD");
//
getProduceNoOkList({
typeCode: "produce",
@ -442,7 +453,8 @@ export default {
//
getProduceStaticInfo({
ymdType: _this.selectxtclasses,
typeCode: "produce",
typeCode: "product",
checkType: "checkTypeCPPC",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
@ -769,7 +781,7 @@ export default {
};
myChart5.setOption(option5);
getLineDayNoOk({
typeCode: "produce",
typeCode: "product",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
@ -1038,7 +1050,7 @@ export default {
};
myChart6.setOption(option6);
getMonthOfYearContrast({
typeCode: "produce",
typeCode: "product",
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {

@ -103,6 +103,7 @@
<el-table-column prop="quantityAct" label="产量(PC)" width="80"/>
<el-table-column prop="completeRate" label="订单完成率(%)" width="80"/>
<el-table-column prop="efficiency" label="产线标准效率(PC/H)" width="100"/>
<el-table-column prop="standProduce" label="标准产能" width="100"/>
<el-table-column prop="manStandard" label="标准用人" width="80"/>
<el-table-column prop="useMan" label="实际用人" width="80"/>
<el-table-column prop="workTimeStandard" label="标准工时" width="80"></el-table-column>

@ -8,14 +8,14 @@
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 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>
@ -32,7 +32,7 @@
<el-table v-loading="loading" :data="defectList" border height="500px" ref="tableRef">
<el-table-column label="序号" type="index" align="center" :index="indexMethod"/>
<el-table-column label="不良项目" align="center" prop="dataType" min-width="100"/>
<el-table-column label="日期/不良项目" align="center" prop="dataType" min-width="100"/>
<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>
@ -143,9 +143,39 @@ export default {
});
//Table
getCpDefectDate(this.queryParams).then(response => {
this.defectList = response;
this.defectList = response;
this.loading = false;
});
// function calculateDefectData(defectList) {
// if (!defectList || !Array.isArray(defectList)) {
// console.error('defectList');
// return;
// }
//
// defectList.forEach(item => {
// //
// const dataTitle7 = parseFloat(item.dataTitle7) || 0;
// const dataTitle8 = parseFloat(item.dataTitle8) || 0;
// const dataTitle9 = parseFloat(item.dataTitle9) || 0;
// const dataTitle10 = parseFloat(item.dataTitle10) || 0;
//
// //
// if (dataTitle7 === 0) {
// console.warn('dataTitle70');
// item.dataTitle12 = '0';
// return;
// }
//
// // dataTitle8 * 1 + dataTitle9 * 0.65 + dataTitle10 * 0.35
// const weightedSum = (dataTitle8 * 1) + (dataTitle9 * 0.65) + (dataTitle10 * 0.35);
//
// // dataTitle7
// const percentage = (weightedSum / dataTitle7) * 100;
// item.dataTitle12 = percentage.toFixed(2) + '%';
// });
//
// return defectList;
// }
},

@ -45,7 +45,7 @@
<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-item label="合格率" class="my-description-item1">{{form.okNumRate}}</el-descriptions-item>
</el-descriptions>
</el-form>
<div id="echartss" style="width:1200px;height:450px;"></div>
@ -59,7 +59,7 @@
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</div>
</template>
@ -325,7 +325,7 @@ export default {
]
};
option && myChart.setOption(option);
option && myChart.setOption(option);
},
//
@ -339,4 +339,4 @@ export default {
.my-description-item1 {
width: 200px; /* 或者你想要的任何宽度 */
}
</style>
</style>

@ -8,14 +8,6 @@
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>
@ -29,43 +21,40 @@
<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-tabs v-model="activeName" type="card">
<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>
<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>
<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-table v-loading="loading" :data="defectList" border height="500px" ref="tableRef">
<el-table-column label="序号" type="index" align="center" :index="indexMethod"/>
<el-table-column label="日期/不良项目" align="center" prop="dataType" min-width="100"/>
<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 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 { getCpDateTitle,getCpDefectDate} from "@/api/quality/qcTable";
import moment from 'moment';
import * as echarts from "echarts";
export default {
@ -74,8 +63,6 @@ export default {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
@ -85,8 +72,8 @@ export default {
//
itemProList: [],
activeName: 'first',
showTitles:[],//
showTitles:[],//
defectList: [],
//
title: "",
//
@ -94,31 +81,13 @@ export default {
//
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"
checkType: 'checkTypeCPPC'
},
//
form: {},
// list
workShift: [],
equipmentTypeOption:[
{equipmentTypeCode:"equ_type_cxj",equipmentTypeName:"成型机"},
{equipmentTypeCode:"equ_type_hf",equipmentTypeName:"烘房"}
],
spanArr: [],
position: 0,
content_style: {
@ -156,86 +125,135 @@ export default {
},
/** 查询设备小时产量列表 */
getList() {
getList() {
if(this.queryParams.yearMonthDate!=null){
this.queryParams.yearMonth = moment(this.queryParams.yearMonthDate).format('YYYY-MM');
} else {
this.$message.error("请填写月份");
return;
}
if(this.queryParams.yearMonthDate!=null){
this.queryParams.yearMonth = moment(this.queryParams.yearMonthDate).format('YYYY-MM');
}else{
this.$message.error("请填写月份");
return
}
this.loading = true;
//Table
getCpDateTitle(this.queryParams).then(response => {
this.showTitles = [];
for(let i=0;i<=response.length-1;i++){
var pobj={};
pobj.id="dataTitle"+i;
pobj.titleName = response[i];
this.showTitles.push(pobj)
}
});
// Table
getCpDefectDate(this.queryParams).then(response => {
this.defectList = response;
this.loading = false;
this.spanArr = [];
this.position = 0;
//
this.initChart();
});
},
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;
});
},
initChart() {
var chartDom = document.getElementById('echartss');
if (!chartDom) {
console.error('图表容器不存在');
return;
}
//
cancel() {
this.open = false;
this.reset();
},
var myChart = echarts.init(chartDom);
// XY
const xAxisData = this.defectList.map(item => item.dataType);
const yAxisData = this.defectList.map(item => parseFloat(item.dataTitle13.replace('%', '')));
var option = {
title: {
text: '不良率数据趋势分析',
left: 'center',
textStyle: {
fontSize: 16,
fontWeight: 'bold'
}
},
legend: {
right: '5%', // 5%
top: '5%', // 5%
orient: 'vertical' //
},
tooltip: {
trigger: 'axis',
formatter: function(params) {
return `${params[0].name}<br/>${params[0].marker} 不良率: ${params[0].value}%`;
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
data: xAxisData,
axisLabel: {
rotate: 45, // X45
interval: 0 //
}
},
yAxis: {
type: 'value',
min: 0.00,
max: 10.00,
axisLabel: {
formatter: '{value}%'
},
name: '不良率',
nameLocation: 'end'
},
series: [
{
name: '不良率',
data: yAxisData,
type: 'line',
label: {
show: true,
position: 'top'
},
// smooth: true, // 线
symbol: 'circle', //
symbolSize: 8,
lineStyle: {
width: 3,
color: '#5470c6'
},
itemStyle: {
color: '#5470c6'
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(84, 112, 198, 0.3)' },
{ offset: 1, color: 'rgba(84, 112, 198, 0.1)' }
])
}
}
]
};
// 使
option && myChart.setOption(option);
//
window.addEventListener('resize', function() {
myChart.resize();
});
},
//
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() {
@ -244,94 +262,6 @@ export default {
}, `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>
@ -339,4 +269,4 @@ export default {
.my-description-item1 {
width: 200px; /* 或者你想要的任何宽度 */
}
</style>
</style>

@ -356,15 +356,15 @@
v-model="rightList"
style="text-align: left"
>
<template #left-footer>
<el-pagination
small
:current-page="teamQueryParams.pageNum"
:page-size="teamQueryParams.pageSize"
:total="teamQueryParams.total"
@current-change="handlePageChange"
/>
</template>
<!-- <template #left-footer>-->
<!-- <el-pagination-->
<!-- small-->
<!-- :current-page="teamQueryParams.pageNum"-->
<!-- :page-size="teamQueryParams.pageSize"-->
<!-- :total="teamQueryParams.total"-->
<!-- @current-change="handlePageChange"-->
<!-- />-->
<!-- </template>-->
</el-transfer>
</template>
</div>
@ -445,7 +445,7 @@ export default {
},
teamQueryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 3000,
total:0
},
options: [

Loading…
Cancel
Save