黑蚊香分类汇总报表
parent
656201cd77
commit
1ade256261
@ -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>
|
Loading…
Reference in New Issue