|
|
|
@ -0,0 +1,473 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
size="small"
|
|
|
|
|
:inline="true"
|
|
|
|
|
v-show="showSearch"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
class="edit-el-form"
|
|
|
|
|
>
|
|
|
|
|
<el-form-item label="报表类型" prop="tableType">
|
|
|
|
|
<el-select clearable v-model="queryParams.tableType" @change="changeYM">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in tableTypeList"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.lable"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="生产时间" prop="incomeTimeArray">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.incomeTimeArray"
|
|
|
|
|
format="yyyy-MM"
|
|
|
|
|
type="monthrange"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
v-if = "ym"
|
|
|
|
|
/>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.incomeTimeArray"
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
type="daterange"
|
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
v-if = "!ym"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="线体" prop="checkLoc">
|
|
|
|
|
<el-select clearable v-model="queryParams.checkLoc">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in prodLineList"
|
|
|
|
|
:key="item.lineCode"
|
|
|
|
|
:label="item.lineName"
|
|
|
|
|
:value="item.lineCode"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="CPK品类" prop="cpkType">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.cpkType"
|
|
|
|
|
placeholder="请选择品类"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.qms_category"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="检验类型" prop="typeCode">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.typeCode"
|
|
|
|
|
placeholder="必选检验类型"
|
|
|
|
|
@change="getCheckTypeList"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.check_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="检验节点" prop="checkType">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.checkType"
|
|
|
|
|
placeholder="必选检验节点"
|
|
|
|
|
@change="getProjectListFunc"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in checkTypeList"
|
|
|
|
|
:key="dict.checkType"
|
|
|
|
|
:label="dict.checkName"
|
|
|
|
|
:value="dict.checkType"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="定量检测项" prop="projectId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.projectId"
|
|
|
|
|
filterable
|
|
|
|
|
collapse-tags
|
|
|
|
|
placeholder="必选定量检测项"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in projectNoOptions"
|
|
|
|
|
:key="item.recordId"
|
|
|
|
|
:label="item.ruleName"
|
|
|
|
|
:value="item.recordId"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleQuery"
|
|
|
|
|
>搜索</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
<el-button icon="el-icon-download" size="mini" @click="handleExport" type="warning">导出</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick" style="height:400px;overflow-y: auro;">
|
|
|
|
|
<el-tab-pane label="报表数据" name="first" >
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" height="400">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column type="index" width="50" align="center" :index="indexMethod" label="序号"/>
|
|
|
|
|
<el-table-column label="CPK品类" align="center" prop="cpkTypeName" width="100" />
|
|
|
|
|
<template v-for="(column, index) in showTitles">
|
|
|
|
|
<el-table-column align="center" width="100" :prop="column.id" :key="column.id" :label="column.titleName"/>
|
|
|
|
|
</template>
|
|
|
|
|
<el-table-column label="平均值" align="center" prop="cpkAvg" width="100" />
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<!--
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total > 0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>-->
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="折线图分析" name="second">
|
|
|
|
|
<div id="echartsCPK" style="width:1200px;height:390px;"></div>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
getTableCPKTitle,getTableCPKList,
|
|
|
|
|
getDLTableMXList,
|
|
|
|
|
getCheckTypeList,
|
|
|
|
|
getProjectOptionList,
|
|
|
|
|
getProdLineList
|
|
|
|
|
} from "@/api/quality/qcTable";
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
import moment from "moment/moment";
|
|
|
|
|
export default {
|
|
|
|
|
name: "QcTableCPK",
|
|
|
|
|
dicts: ["check_type","qms_category"],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
prodLineList:[],
|
|
|
|
|
activeName:'first',
|
|
|
|
|
detailListLoading: true,
|
|
|
|
|
refreshNewWorkerTable: true,
|
|
|
|
|
// 选择领料单
|
|
|
|
|
selectPrepare: [],
|
|
|
|
|
tableTypeList: [{value:"mm",lable:"月报"},{value:"day",lable:"日报"}],
|
|
|
|
|
// 打印
|
|
|
|
|
formRef: "form",
|
|
|
|
|
validateRules: [],
|
|
|
|
|
printDialogVisible: false,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 表格数据
|
|
|
|
|
tableList: [],
|
|
|
|
|
showTitles:[],
|
|
|
|
|
xData:[],
|
|
|
|
|
detailTitleCol2: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
ym:true,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
checkNo: null,
|
|
|
|
|
typeCode: null,
|
|
|
|
|
checkType: null,
|
|
|
|
|
orderNo: null,
|
|
|
|
|
productId: null,
|
|
|
|
|
materialCode: null,
|
|
|
|
|
prodType: null,
|
|
|
|
|
materialName: null,
|
|
|
|
|
productSpc: null,
|
|
|
|
|
wetDetailPlanId: null,
|
|
|
|
|
incomeTime: null,
|
|
|
|
|
incomeBatchNo: null,
|
|
|
|
|
incomeTimeArray: [],
|
|
|
|
|
ymArrayStart: null,
|
|
|
|
|
ymArrayEnd: null,
|
|
|
|
|
cpkType:"cate1",
|
|
|
|
|
tableType:"mm"
|
|
|
|
|
},
|
|
|
|
|
workCenterList: [],
|
|
|
|
|
checkTypeList: [],
|
|
|
|
|
projectNoOptions: [],
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {},
|
|
|
|
|
openReport: false,
|
|
|
|
|
titleReport: "工单报工详情",
|
|
|
|
|
legenddata: [],
|
|
|
|
|
seriesdata: [],
|
|
|
|
|
xAxisdata: [],
|
|
|
|
|
detailechartslist: [],
|
|
|
|
|
titledata: "",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
getProdLineList().then(response => {
|
|
|
|
|
this.prodLineList = response
|
|
|
|
|
})
|
|
|
|
|
this.getDate();
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/**获取默认查询时间段**/
|
|
|
|
|
getDate() {
|
|
|
|
|
let start = this.Fungetdate(0);
|
|
|
|
|
let end = this.Fungetdate(0);
|
|
|
|
|
this.queryParams.incomeTimeArray.push(start, end);
|
|
|
|
|
},
|
|
|
|
|
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 ;
|
|
|
|
|
},
|
|
|
|
|
/**获取车间数据**/
|
|
|
|
|
getWorkCenterList() {
|
|
|
|
|
getWorkcenterList(this.queryParams).then((response) => {
|
|
|
|
|
this.workCenterList = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getCheckTypeList(val) {
|
|
|
|
|
//获取检验节点
|
|
|
|
|
getCheckTypeList(val).then((response) => {
|
|
|
|
|
this.checkTypeList = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
//获取定量检测项
|
|
|
|
|
getProjectListFunc(val) {
|
|
|
|
|
getProjectOptionList(val).then((response) => {
|
|
|
|
|
this.projectNoOptions = response;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
changeYM(val) {
|
|
|
|
|
if(val == 'mm'){
|
|
|
|
|
this.ym = true;
|
|
|
|
|
}else{
|
|
|
|
|
this.ym = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
indexMethod(index) {
|
|
|
|
|
return index + 1;
|
|
|
|
|
},
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
|
|
if (this.queryParams.incomeTimeArray.length > 0) {
|
|
|
|
|
if(this.ym){
|
|
|
|
|
this.queryParams.ymArrayStart = moment(this.queryParams.incomeTimeArray[0]).format("YYYY-MM");
|
|
|
|
|
this.queryParams.ymArrayEnd = moment(this.queryParams.incomeTimeArray[1]).format("YYYY-MM");
|
|
|
|
|
}else{
|
|
|
|
|
this.queryParams.ymArrayStart = moment(this.queryParams.incomeTimeArray[0]).format("YYYY-MM-DD");
|
|
|
|
|
this.queryParams.ymArrayEnd = moment(this.queryParams.incomeTimeArray[1]).format("YYYY-MM-DD");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getTableCPKTitle(this.queryParams).then((response) => {
|
|
|
|
|
this.showTitles = [];
|
|
|
|
|
//echart图
|
|
|
|
|
this.xData= response.titleCol1;
|
|
|
|
|
|
|
|
|
|
let col1 = response.titleCol1;
|
|
|
|
|
if(col1 != null){
|
|
|
|
|
for (let i = 1; i <= col1.length; i++) {
|
|
|
|
|
var titleobj1 = {};
|
|
|
|
|
titleobj1.id = "date" + i;
|
|
|
|
|
titleobj1.titleName = col1[i-1];
|
|
|
|
|
this.showTitles.push(titleobj1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
getTableCPKList(this.queryParams);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getTableCPKList(this.queryParams).then((response) => {
|
|
|
|
|
this.tableList = response.tableData;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
|
|
//echart图
|
|
|
|
|
let yData= response.echartData;
|
|
|
|
|
this.getEchartCPK(this.xData,yData);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.openReport = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
prepareId: null,
|
|
|
|
|
checkNo: null,
|
|
|
|
|
workorderName: null,
|
|
|
|
|
parentOrder: null,
|
|
|
|
|
orderId: null,
|
|
|
|
|
orderNo: null,
|
|
|
|
|
productId: null,
|
|
|
|
|
materialCode: null,
|
|
|
|
|
prodType: null,
|
|
|
|
|
materialName: null,
|
|
|
|
|
productSpc: null,
|
|
|
|
|
wetDetailPlanId: null,
|
|
|
|
|
incomeTime: null,
|
|
|
|
|
incomeBatchNo: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.getDate();
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map((item) => item.prepareId);
|
|
|
|
|
this.single = selection.length !== 1;
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
this.selectPrepare = selection;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download(
|
|
|
|
|
"quality/staticTable/exportCPKList",
|
|
|
|
|
{
|
|
|
|
|
...this.queryParams,
|
|
|
|
|
},
|
|
|
|
|
`CPK_${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
// 取消
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
},
|
|
|
|
|
getEchartCPK(xData,yData){
|
|
|
|
|
var _this=this
|
|
|
|
|
var chartDomj = document.getElementById('echartsCPK');
|
|
|
|
|
var myChartj = echarts.init(chartDomj);
|
|
|
|
|
var optionj;
|
|
|
|
|
optionj = {
|
|
|
|
|
grid: {
|
|
|
|
|
y: '5%',
|
|
|
|
|
x:'1%',
|
|
|
|
|
y2: '6%',
|
|
|
|
|
x2: '1%',
|
|
|
|
|
width:'96%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
//name:_this.tableType=='dd'?'时':_this.tableType=='mm'?'日':'月',
|
|
|
|
|
splitLine: {
|
|
|
|
|
show: true //分隔线,默认数值轴显示,类目轴不显示
|
|
|
|
|
},
|
|
|
|
|
axisTick:{
|
|
|
|
|
show:false,
|
|
|
|
|
inside:true,
|
|
|
|
|
},
|
|
|
|
|
axisLabel:{
|
|
|
|
|
rotate: _this.queryParams.tableType=='mm'?0:50,
|
|
|
|
|
fontSize:11
|
|
|
|
|
},
|
|
|
|
|
data: xData
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
|
show:true,
|
|
|
|
|
axisLine:{
|
|
|
|
|
},
|
|
|
|
|
axisLabel:{
|
|
|
|
|
formatter:'{value}'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: yData
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
optionj && myChartj.setOption(optionj);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.my-print-head {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
.my-print-nav {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|
}
|
|
|
|
|
.my-print-table {
|
|
|
|
|
}
|
|
|
|
|
.my-print-foot {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
#.el-table .cell {
|
|
|
|
|
white-space: pre-line !important;
|
|
|
|
|
}
|
|
|
|
|
.el-table .cell.el-tooltip {
|
|
|
|
|
white-space: pre-wrap; /*这是重点。文本换行*/
|
|
|
|
|
}
|
|
|
|
|
/deep/ .el-table__expand-icon {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
.expandClass .el-table__expand-icon {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
</style>
|