Merge remote-tracking branch 'origin/master'

master
mengjiao 2 months ago
commit 691430571f

@ -39,3 +39,11 @@ export function getPorOrderList(data) {
data: data
});
}
export function getProductionNumberPLC(data){
return request({
url: '/mes/mesborad/getProductionNumberPLC',
method: 'post',
data: data
});
}

@ -297,3 +297,21 @@ export function getDefectItemLinePC(query) {
params: query
});
}
//黑蚊香分类汇总头部
export function getCpDateTitle(query) {
return request({
url: '/quality/staticTable/getCpDateTitle',
method: 'get',
params: query
});
}
//黑蚊香分类汇总头部
export function getCpDefectDate(query) {
return request({
url: '/quality/staticTable/getCpDefectDate',
method: 'get',
params: query
});
}

@ -86,6 +86,7 @@ export default {
flex-direction: column;
box-sizing: border-box;
padding-left: 20px;
width:80%;
}
.block-top-content {

@ -373,12 +373,14 @@ import {
getProMonthNoOk,
getLineDayNoOk,
getMonthOfYearContrast,
} from "@/api/kanban/quality";
import {
getDictData,
getProduction15Days,
getProductionLineInfo,
getPorOrderList,
getProductionNumberPLC
} from "@/api/kanban/Packagingline";
import { getDeviceRefreshTime } from "@/api/kanban/equipment";
import * as echarts from "echarts";
@ -441,20 +443,28 @@ export default {
//
actProduction: [],
ceshitable: [{}, {}, {}, {}, {}, {}],
pollTimer: null,
timer: null
};
},
created() {},
destroyed() {
clearInterval(this.time1);
this.time1 = null;
if (this.timer) clearInterval(this.timer);
},
mounted() {
// this.datetime = moment().subtract(2, "day").format("yyyy-MM-DD");
//console.log('zhuanhuahou',this.dateRangeone)
// this.getdatalist(this.selectxt)
this.selectfactoryCodelist();
this.gettime();
this.timer = setInterval(() => {
this.getProductionNumberPLC();
}, 10000);
},
beforeDestroy() {
},
methods: {
back() {
@ -507,57 +517,36 @@ export default {
const _this = this;
_this.initChart1();
_this.piedata = [];
// getProductionLineInfo({
// equCode: _this.selectxtclasses,
// factoryCode: "ds_" + _this.selectxt,
// }).then((response) => {
// if (response) {
// _this.workOrder = response.data.workOrder;
// _this.taskNum = response.data.taskNum;
// _this.taskSampleNum = response.data.taskSampleNum;
// if (response.data.piedata.checkList) {
// response.data.piedata.checkList.forEach((item) => {
// let a = {};
// let b = {};
// if (item.checkResult == "") {
// a.name = item.checkResult;
// a.value = item.quality;
// _this.piedata[0] = a;
// }
// if (item.checkResult == "") {
// b.name = item.checkResult;
// b.value = item.quality;
// _this.piedata[1] = b;
// }
// });
// _this.initChart2();
// } else {
// _this.initChart3();
// }
// }
// });
getPorOrderList({
equCode: _this.selectxtclasses,
factoryCode: "ds_" + _this.selectxt,
}).then((response) => {
if (response) {
_this.orderdetail = response.data;
if(_this.datetime == 0){
_this.gudingworkorderCodeSap = _this.orderdetail[0].workorderCodeSap;
// _this.gudingworkorderCodeSap = _this.orderdetail[0].workorderCodeSap;
//
const w2Items = response.data.filter(item =>
item.status === 'w2'
);
this.actProduction = "000000"
if (w2Items.length) {
_this.gudingworkorderCodeSap = w2Items[0].workorderCodeSap;
_this.getorderdetail(_this.gudingworkorderCodeSap);
}
_this.datetime+=1;
// _this.getorderdetail(_this.gudingworkorderCodeSap);
if (_this.orderdetail.length == 0) {
_this.orderdetail = this.ceshitable;
}
}
});
},
//
getorderdetail(item) {
const _this = this;
const _this = this;
getProductionLineInfo({
equCode: _this.selectxtclasses,
factoryCode: "ds_" + _this.selectxt,
@ -586,9 +575,29 @@ export default {
} else {
//_this.initChart3();
}
_this.getProductionNumberPLC();
}
});
},
//PLC
getProductionNumberPLC(){
const _this = this;
getProductionNumberPLC({
equCode: _this.selectxtclasses,
factoryCode: "ds_" + _this.selectxt,
workorderCode: _this.workOrder.workorderCode
}).then((response) => {
if (response) {
let strQty = response.data.qty_total.toString();
if (strQty.length < 6) {
strQty = String(
strQty
).padStart(6, "0");
}
this.actProduction = strQty.split("");
}
})
},
//
selectline() {
const _this = this;
@ -754,6 +763,9 @@ export default {
],
};
myChart6.setOption(option6);
getProduction15Days({
equCode: _this.selectxtclasses,
factoryCode: "ds_" + _this.selectxt,
@ -764,13 +776,9 @@ export default {
response.data.planProduction
).padStart(6, "0");
}
if (response.data.actProduction.length < 6) {
response.data.actProduction = String(
response.data.actProduction
).padStart(6, "0");
}
this.planProduction = response.data.planProduction.split("");
this.actProduction = response.data.actProduction.split("");
let seriesdata1 = response.data.acts;
let seriesdata2 = response.data.plans;

@ -107,7 +107,7 @@
<el-table-column label="一线+辅助" align="center">
<el-table-column label="总工时" align="center" prop="hourSum" />
<el-table-column label="效率提升基数" align="center" prop="effUpBase" />
<el-table-column label="提升目标" align="center" prop="upGoal" />
<el-table-column label="提升目标" align="center" prop="upGoal" :formatter="(row, column, value) => `${(value * 100).toFixed(0)}%`"/>
<el-table-column label="目标效率" align="center" prop="goalRate" />
<el-table-column label="实际效率" align="center" prop="actRate" />
<el-table-column label="效率提升率" align="center" prop="effUpRate" />
@ -179,6 +179,10 @@ export default {
indexMethod(index) {
return index + 1;
},
formatUpGoal(row, column, value) {
if (value === null || value === undefined) return '0%'; //
return `${(parseFloat(value) * 100).toFixed(0)}%`; //
},
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate (0);

@ -156,9 +156,9 @@
<el-dialog :title="titleUserBind" :visible.sync="openUserBind" width="800px">
<el-table v-loading="userloading" :data="userList" ref="userBindTable" >
<el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="员工编号" align="center" prop="userCode" />
<el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="来料类别" align="center" prop="attr1" >
<el-table-column label="员工编号" align="center" prop="userCode" width="90"/>
<el-table-column label="姓名" align="center" prop="userName" width="90"/>
<el-table-column label="来料类别" align="center" prop="attr1" width="90">
<template slot-scope="scope">
<dict-tag
:options="dict.type.order_type_ll"
@ -168,7 +168,8 @@
</el-table-column>
<el-table-column label="所属线体/标准" align="center" prop="attr2List" >
<template slot-scope="scope">
<el-select v-model="scope.row.attr2List" placeholder="请选择" clearable @change="selectBelongTo(scope.row)" multiple>
<el-select v-model="scope.row.attr2List" placeholder="请选择" clearable @change="selectBelongTo(scope.row)" multiple
style="width:330px;">
<el-option
v-for="item in belongToOptions"
:key="item.typeCode"
@ -401,7 +402,7 @@ export default {
this.getUserParams.materialCode = row.orderCode;
if(row.orderCode == 'checkTypeSC'|| row.orderCode == 'checkTypeSCXJ' ||
row.orderCode=='checkTypeCPPC' || row.orderCode=='checkTypeCP'){
row.orderCode=='checkTypeCPPC' || row.orderCode=='checkTypeCP' || row.orderCode=='checkTypeCPCJ'){
this.belongToOptions = this.belongToLines;
}else if(row.orderCode == 'checkTypeLL'){
this.belongToOptions = this.belongToStandars;

@ -247,7 +247,7 @@ import {
import * as echarts from "echarts";
import moment from "moment/moment";
export default {
name: "qcAnalysis",
name: "qcTableDL",
dicts: ["check_type"],
data() {
return {

@ -46,7 +46,7 @@
import {getMonthOfDateTitle, getMonthOfDataDefect} from "@/api/quality/qcTable";
import moment from 'moment';
export default {
name: "BpReworkRate",
name: "BpDefect",
data() {
return {
//

@ -0,0 +1,215 @@
<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>
</el-form-item>
</el-form>
<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>
</div>
</template>
<script>
import {getCpDateTitle, getCpDefectDate} from "@/api/quality/qcTable";
import moment from 'moment';
export default {
name: "CpDefect",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
defectList: [],
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,
checkType: 'checkTypeCPCJ'
},
//
form: {},
// list
workShift: [],
equipmentTypeOption:[
],
spanArr: [],
position: 0
};
},
created() {
this.getDate();
this.getList();
},
//mounted() {
// this.$nextTick(() => {
// this.$refs.tableRef.doLayout();
// });
//},
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
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;
});
},
//
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: "CpSortChart",
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,getDefectItemData,getDefectItemLine} from "@/api/quality/qcTable";
import moment from 'moment';
import * as echarts from "echarts";
export default {
name: "CpTranChart",
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>

@ -134,12 +134,12 @@
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="抽样数量" align="center" prop="sampleQuality" width="100"/>
<el-table-column label="不合格数量" align="center" prop="noOkQuality" width="100"/>
<el-table-column label="不合格时间" align="center" prop="createTime" width="150">
<el-table-column label="不合格时间" align="center" prop="checkTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="不合格描述" align="center" prop="remark" width="300" :show-overflow-tooltip="true"/>
<el-table-column label="不合格描述" align="center" prop="attr1" width="300" :show-overflow-tooltip="true"/>
<el-table-column label="oa流程ID" align="center" prop="requestid" width="100" />
<el-table-column label="发起OA时间" align="center" prop="startTime" width="150">
<template slot-scope="scope">

Loading…
Cancel
Save