Merge pull request 'projects/mesxc-zhp' (#348) from projects/mesxc-zhp into projects/mesxc-test

Reviewed-on: #348
This commit is contained in:
朱菊兰 2024-04-23 14:42:19 +08:00
commit d302179f6f
7 changed files with 578 additions and 101 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-12 14:30:48 # @Date: 2024-04-12 14:30:48
# @LastEditTime: 2024-04-22 16:16:52 # @LastEditTime: 2024-04-23 13:52:57
# @LastEditors: zhp # @LastEditors: zhp
# @Description: # @Description:
### ###
@ -13,8 +13,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.0.33:48082' VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.20:48080' # VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# 积木报表指向地址 # 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' VUE_APP_JIMU_API = 'http://192.168.0.33:48082'

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 09:27:54 * @Date: 2024-04-18 09:27:54
* @LastEditTime: 2024-04-22 16:21:26 * @LastEditTime: 2024-04-23 13:37:12
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -62,3 +62,19 @@ export function updateAutoDailyData(data) {
data: data data: data
}) })
} }
export function getCWSectionList(query) {
return request({
url: 'base/core-production-line/listAll',
method: 'get',
params: query
})
}
export function getCuttingReportDataList(data) {
return request({
url: 'extend/customized-reports/cuttingReport',
method: 'post',
data: data
})
}

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-24 15:15:24 * @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-04-22 16:14:19 * @LastEditTime: 2024-04-23 09:05:08
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -16,9 +16,9 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" <el-button type="primary" size="small"
@click="getDataList">查询</el-button> @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small" <el-button type="primary" size="small"
plain @click="handleExport">导出</el-button> plain @click="handleExport">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -1,10 +1,22 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-23 13:46:29
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData"> <el-table :header-cell-style="{
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" background: '#F2F4F9',
@clickBtn="handleClick" /> --> color: '#606266'
</base-table> }" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%">
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
<el-table-column v-for="it in item.children" :prop="it.prop" :label="it.label" align="center">
</el-table-column>
</el-table-column>
</el-table>
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@pagination="getDataList" /> --> @pagination="getDataList" /> -->
<!-- <base-dialog <!-- <base-dialog
@ -24,7 +36,8 @@
// import basicPage from '../../../core/mixins/basic-page'; // import basicPage from '../../../core/mixins/basic-page';
// import { parseTime } from '../../../core/mixins/code-filter'; // import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getOriginalData getCWSectionList,
getCuttingReportDataList
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
@ -35,41 +48,65 @@ const tableProps = [
// label: '', // label: '',
// filter: parseTime // filter: parseTime
// }, // },
{
prop: '',
label: '切割堆垛日报',
children:[
{ {
prop: 'lineName', prop: 'lineName',
label: '产线' label: '产线'
}, },
{ {
prop: 'equipmentName', prop: 'className',
label: '' label: '班组'
}, },
{ {
prop: 'num', prop: 'groupName',
label: '片数' label: '班次'
},
{
prop: 'area',
label: '面积'
},
{
prop: 'countNum',
label: '托数',
// filter: (val) => val == false ? '' : '',
}, },
{ {
prop: 'size', prop: 'size',
label: '规格', label: '规格 mm 长*宽'
// filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
}, },
// { {
// prop: 'checkerName', prop: 'thickness',
// label: '' label: '厚度'
// }, },
// { {
// prop: 'checkTime', prop: 'glassCode',
// label: '', label: '周转编号',
// filter: parseTime },
// }, {
prop: 'stackingType',
label: '堆垛方式',
filter: (val) => val == 1 ? '集装架' : '堵头箱',
},
{
prop: 'pieces',
label: '片数',
},
{
prop: 'originCode',
label: '堆垛工位',
},
{
prop: 'endTime',
label: '堆垛时间',
},
{
prop: 'dusting',
label: '堆垛情况',
},
{
prop: 'palletNumber',
label: '堆垛时间',
},
{
prop: 'endTime',
label: '集装架号',
},
]
}
]; ];
export default { export default {
@ -77,15 +114,18 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getOriginalData, getDataListURL: getCuttingReportDataList,
// deleteURL: deleteQualityHotMaterial, // deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
tableProps, tableProps,
tableData: [], tableData: [],
mergeArr: [],//
pos: 0,
listQuery: { listQuery: {
startTime: undefined, startTime: undefined,
endTime:undefined endTime: undefined,
lineId: null,
}, },
formConfig: [ formConfig: [
// { // {
@ -108,16 +148,25 @@ export default {
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss', format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: "yyyy-MM-dd HH:mm:ss", valueFormat: "timestamp",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 250 width: 250
}, },
{ {
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '', type: 'select',
label: '产线',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'lineId',
filterable: true
},
{
type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -127,7 +176,7 @@ export default {
// // type: 'separate', // // type: 'separate',
// }, // },
{ {
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '', type: 'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'success', color: 'success',
@ -141,12 +190,79 @@ export default {
}, },
created() { }, created() { },
mounted() { mounted() {
// this.formConfig[1].defaultSelect[]
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList() this.getDataList()
this.getDict()
// this.getSpanArr(this.tableData)
// this.getDict(); // this.getDict();
}, },
methods: { methods: {
async getDict() {
const res = await getCWSectionList()
console.log(res)
this.formConfig[1].selectOptions = res.data
},
// getSummaries(param) {
// console.log(columns)
// const { columns, data } = param;
// const sums = [];
// columns.forEach((column, index) => {
// if (index === 0) {
// sums[index] = '';
// return;
// }
// const values = data.map(item => Number(item[column.property]));
// // const data = data.map(item => !Number(item[column.property]));
// if (!values.every(value => isNaN(value))) {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr);
// if (!isNaN(value)) {
// return prev + curr;
// } else {
// return prev;
// }
// }, 0);
// sums[index] += ' ';
// } else {
// sums[index] = '-';
// }
// });
// return sums;
// },
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
this.tableData.map((item, index) => {
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.lineName === this.tableData[index - 1].lineName) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
handleExport() { handleExport() {
// //
console.log(this.$refs);
var xlsxParam = { raw: true }; var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */ /* 从表生成工作簿对象 */
import('xlsx').then(excel => { import('xlsx').then(excel => {
@ -190,10 +306,39 @@ export default {
// //
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.listQuery.startTime = '1711095616000'; // this.listQuery.startTime = '1711095616000';
this.listQuery.endTime = '1711183743000'; // this.listQuery.endTime = '1711183743000';
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.getSpanArr(this.tableData)
// response.data.forEach((ele) => {
// console.log(ele.size.substring(2, ele.size.length - 2))
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
this.tableData = response.data this.tableData = response.data
// let obj = {}
// response.data.reduce((prev, curr) => {
// console.log(prev, curr)
// })
// this.tableData.forEach((ele) => {
// ele.size.substring(2, ele.size.length - 2)
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
// let obj = {}
// this.tableData.forEach(ele => {
// obj.num += ele.num
// obj.area += ele.num
// obj.count += ele.num
// })
// console.log(obj);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
this.dataListLoading = false; this.dataListLoading = false;
}); });
@ -233,6 +378,7 @@ export default {
// this.listQuery.endTime = '1706230804000'; // this.listQuery.endTime = '1706230804000';
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.listQuery.lineId = val.lineId ? val.lineId : undefined
this.getDataList(); this.getDataList();
break; break;
// case 'reset': // case 'reset':
@ -259,3 +405,13 @@ export default {
}, },
}; };
</script> </script>
<style>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -1,13 +1,35 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 14:08:46 * @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-22 17:10:49 * @LastEditTime: 2024-04-23 13:51:05
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="日" prop="startTime">
<el-date-picker v-model="listQuery.startTime" value-format="timestamp" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="产线" prop="productionLineId">
<el-select v-model="listQuery.productionLineId" placeholder="请选择">
<el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="" prop="">
<el-radio-group v-model="radio" @input="handleGetClass">
<el-radio-button label="早班查询"></el-radio-button>
<el-radio-button label="晚班查询"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getDataList">查询</el-button>
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
<!-- <el-table show-summary :header-cell-style="{ <!-- <el-table show-summary :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -24,19 +46,29 @@
</el-table-column> </el-table-column>
</el-table> --> </el-table> -->
<el-table class="baseTable" :span-method="objectSpanMethod" :data="tableData" style="width: 100%"> <el-table class="baseTable" :data="tableData" style="width: 100%">
<el-table-column label="原料样式" align="right" width="150"> <el-table-column label="时间" align="right" width="150">
<el-table-column prop="className" label="时间" width="120"> <el-table-column prop="name" label="缺陷" width="120">
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="putType" label="" width="180"> <!-- <el-table-column prop="putType" label="" width="180">
</el-table-column> </el-table-column> -->
<!-- <el-table-column prop label="参考标准及评价方法"> <!-- <el-table-column prop label="参考标准及评价方法">
<el-table-column prop="activityName"></el-table-column> <el-table-column prop="activityName"></el-table-column>
<el-table-column prop="message"></el-table-column> <el-table-column prop="message"></el-table-column>
</el-table-column> --> </el-table-column> -->
<el-table-column v-for="(item, index) in codeList " :prop="item" :label="item"> <el-table-column v-for="(item, index) in codeList " :prop="item.prop" :label="item.label">
</el-table-column> </el-table-column>
<div slot="append" v-if="this.tableData.length != 0" style="text-align: center">
<!--在此处添加你想要插入在表格最后一行的内容-->
<el-col :span="8">
合计
</el-col>
<el-col :span="8">
{{ sum }}
</el-col>
</div>
</el-table> </el-table>
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
@pagination="getDataList" /> --> @pagination="getDataList" /> -->
@ -57,7 +89,8 @@
// import basicPage from '../../../core/mixins/basic-page'; // import basicPage from '../../../core/mixins/basic-page';
// import { parseTime } from '../../../core/mixins/code-filter'; // import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getQualityRecordReport getQualityRecordReport,
getCWSectionList
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
@ -114,7 +147,68 @@ export default {
// deleteURL: deleteQualityHotMaterial, // deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel, // exportURL: exportFactoryExcel,
}, },
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'], listQuery: {
startTime: null,
productionLineId:null,
},
sum:null,
radio:'晚班查询',
lineList:[],
codeList: [
{
label: '19:00',
prop: 'num0'
},
{
label: '20:00',
prop: 'num1'
},
{
label: '21:00',
prop: 'num2'
},
{
label: '22:00',
prop: 'num3'
},
{
label: '23:00',
prop: 'num4'
},
{
label: '00:00',
prop: 'num5'
},
{
label: '01:00',
prop: 'num6'
},
{
label: '02:00',
prop: 'num7'
},
{
label: '03:00',
prop: 'num8'
},
{
label: '04:00',
prop: 'num9'
},
{
label: '05:00',
prop: 'num10'
},
{
label: '06:00',
prop: 'num11'
},
{
label: '合计',
prop: 'sum'
}
],
tableData: [], tableData: [],
formConfig: [ formConfig: [
{ {
@ -156,35 +250,186 @@ export default {
// this.listQuery.startTime = this.formConfig[0].defaultSelect[0] // this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
// this.listQuery.endTime = this.formConfig[0].defaultSelect[1] // this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime()
this.getDataList() this.getDataList()
this.getDict()
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
// this.getDict(); // this.getDict();
}, },
methods: { methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) { async getDict() {
let spanOneArr = [], concatOne = 0; const res = await getCWSectionList()
this.tableData.map((item, index) => { console.log(res)
if (index === 0) { this.lineList = res.data
spanOneArr.push(1); },
} else { // objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// // let spanOneArr = [], concatOne = 0;
if (item.className === this.tableData[index - 1].className) { // this.tableData.map((item, index) => {
spanOneArr[concatOne] += 1; // if (index === 0) {
spanOneArr.push(0); // spanOneArr.push(1);
} else { // } else {
spanOneArr.push(1); // //
concatOne = index; // if (item.className === this.tableData[index - 1].className) {
}; // spanOneArr[concatOne] += 1;
} // spanOneArr.push(0);
}); // } else {
// spanOneArr.push(1);
// concatOne = index;
// };
// }
// });
if (columnIndex === 0) { // if (columnIndex === 0) {
const _row = spanOneArr[rowIndex]; // const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0; // const _col = _row > 0 ? 1 : 0;
return { // return {
rowspan: _row, // rowspan: _row,
colspan: _col // colspan: _col
// }
// }
// },
formatDateTime(time) {
var date = new Date(time);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? ('0' + m) : m;
var d = date.getDate();
d = d < 10 ? ('0' + d) : d;
var h = date.getHours();
h = h < 10 ? ('0' + h) : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? ('0' + minute) : minute;
second = second < 10 ? ('0' + second) : second;
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
},
handleGetClass(e) {
this.listQuery.startTime = new Date(new Date().setHours(0, 7, 0, 0)).getTime()
// console.log(startTime1)
this.codeList = []
if (e === '早班查询') {
let arr = [
{
label: '07:00',
prop:'num0'
},
{
label: '08:00',
prop: 'num1'
},
{
label: '09:00',
prop: 'num2'
},
{
label: '10:00',
prop: 'num3'
},
{
label: '11:00',
prop: 'num4'
},
{
label: '12:00',
prop: 'num5'
},
{
label: '13:00',
prop: 'num6'
},
{
label: '14:00',
prop: 'num7'
},
{
label: '15:00',
prop: 'num8'
},
{
label: '16:00',
prop: 'num9'
},
{
label: '17:00',
prop: 'num10'
},
{
label: '18:00',
prop: 'num11'
},
{
label: '合计',
prop: 'sum'
} }
]
arr.forEach((ele,index) => [
this.codeList.push(ele)
])
this.getDataList()
} else {
// this.codeList = []
this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime()
let arr = [
{
label: '19:00',
prop: 'num0'
},
{
label: '20:00',
prop: 'num1'
},
{
label: '21:00',
prop: 'num2'
},
{
label: '22:00',
prop: 'num3'
},
{
label: '23:00',
prop: 'num4'
},
{
label: '00:00',
prop: 'num5'
},
{
label: '01:00',
prop: 'num6'
},
{
label: '02:00',
prop: 'num7'
},
{
label: '03:00',
prop: 'num8'
},
{
label: '04:00',
prop: 'num9'
},
{
label: '05:00',
prop: 'num10'
},
{
label: '06:00',
prop: 'num11'
},
{
label: '合计',
prop: 'sum'
}
]
arr.forEach((ele, index) => [
this.codeList.push(ele)
])
this.getDataList()
} }
}, },
handleExport() { handleExport() {
@ -236,10 +481,35 @@ export default {
// this.listQuery.startTime = '1713197388000'; // this.listQuery.startTime = '1713197388000';
// this.listQuery.endTime = '1713254961000'; // this.listQuery.endTime = '1713254961000';
this.urlOptions.getDataListURL({ this.urlOptions.getDataListURL({
productionLineId: '1696716506443354114', // productionLineId: '1696716506443354114',
startTime: '1705618800000' // startTime: '1705618800000'
productionLineId: this.listQuery.productionLineId,
startTime:this.listQuery.startTime
},).then(res => { },).then(res => {
console.log(res.data); let count = 0
let arr = []
console.log(res.data)
this.sum = res.data.allSum
for (let i in res.data.qualityInspectionRecordReportLineVOMap) {
count ++,
console.log(res.data.qualityInspectionRecordReportLineVOMap[i])
// arr.push({
// })
// console.log(arr)
let obj = {
name: res.data.qualityInspectionRecordReportLineVOMap[i].content,
sum: res.data.qualityInspectionRecordReportLineVOMap[i].sum,
}
res.data.qualityInspectionRecordReportLineVOMap[i].nums.forEach((ele, index) => {
obj['num' +index] = ele
// console.log(arr[count])
// arr[count]['num'+index] = ele
})
arr.push(obj)
}
console.log(arr);
this.tableData = arr
// console.log(res) // console.log(res)
// console.log(res.data) // console.log(res.data)
// let arr = [ // let arr = [

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 10:01:33 * @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-22 14:42:31 * @LastEditTime: 2024-04-23 13:51:30
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -35,7 +35,8 @@
// import basicPage from '../../../core/mixins/basic-page'; // import basicPage from '../../../core/mixins/basic-page';
// import { parseTime } from '../../../core/mixins/code-filter'; // import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getOriginalData getOriginalData,
getCWSectionList
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
@ -98,7 +99,8 @@ export default {
pos: 0, pos: 0,
listQuery: { listQuery: {
startTime: undefined, startTime: undefined,
endTime:undefined endTime: undefined,
lineId:null,
}, },
formConfig: [ formConfig: [
// { // {
@ -129,6 +131,15 @@ export default {
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 250 width: 250
}, },
{
type: 'select',
label: '产线',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'lineId',
filterable: true
},
{ {
type:'button', type:'button',
btnName: '查询', btnName: '查询',
@ -159,10 +170,16 @@ export default {
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList() this.getDataList()
this.getDict()
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
// this.getDict(); // this.getDict();
}, },
methods: { methods: {
async getDict() {
const res = await getCWSectionList()
console.log(res)
this.formConfig[1].selectOptions = res.data
},
// getSummaries(param) { // getSummaries(param) {
// console.log(columns) // console.log(columns)
@ -264,8 +281,8 @@ export default {
// //
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.listQuery.startTime = '1711095616000'; // this.listQuery.startTime = '1711095616000';
this.listQuery.endTime = '1711183743000'; // this.listQuery.endTime = '1711183743000';
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
// response.data.forEach((ele) => { // response.data.forEach((ele) => {
@ -346,6 +363,7 @@ export default {
// this.listQuery.endTime = '1706230804000'; // this.listQuery.endTime = '1706230804000';
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.listQuery.lineId = val.lineId ? val.lineId : undefined
this.getDataList(); this.getDataList();
break; break;
// case 'reset': // case 'reset':

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 15:07:53 * @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-18 15:26:50 * @LastEditTime: 2024-04-23 13:51:20
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -35,7 +35,8 @@
// import basicPage from '../../../core/mixins/basic-page'; // import basicPage from '../../../core/mixins/basic-page';
// import { parseTime } from '../../../core/mixins/code-filter'; // import { parseTime } from '../../../core/mixins/code-filter';
import { import {
getCuttingtData getCuttingtData,
getCWSectionList
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
@ -97,7 +98,8 @@ export default {
pos: 0, pos: 0,
listQuery: { listQuery: {
startTime: undefined, startTime: undefined,
endTime:undefined endTime: undefined,
lineId:null
}, },
formConfig: [ formConfig: [
// { // {
@ -128,6 +130,15 @@ export default {
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 250 width: 250
}, },
{
type: 'select',
label: '产线',
selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'lineId',
filterable: true
},
{ {
type:'button', type:'button',
btnName: '查询', btnName: '查询',
@ -158,10 +169,16 @@ export default {
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
this.getDataList() this.getDataList()
this.getDict()
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
// this.getDict(); // this.getDict();
}, },
methods: { methods: {
async getDict() {
const res = await getCWSectionList()
console.log(res)
this.formConfig[1].selectOptions = res.data
},
getSummaries(param) { getSummaries(param) {
console.log(columns) console.log(columns)
@ -281,8 +298,8 @@ export default {
// //
getDataList() { getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
this.listQuery.startTime = '1706144404000'; // this.listQuery.startTime = '1706144404000';
this.listQuery.endTime = '1706230804000'; // this.listQuery.endTime = '1706230804000';
this.urlOptions.getDataListURL(this.listQuery).then(response => { this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.getSpanArr(this.tableData) // this.getSpanArr(this.tableData)
// response.data.forEach((ele) => { // response.data.forEach((ele) => {
@ -368,6 +385,7 @@ export default {
// this.listQuery.endTime = '1706230804000'; // this.listQuery.endTime = '1706230804000';
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.listQuery.lineId = val.lineId ? val.lineId : undefined
this.getDataList(); this.getDataList();
break; break;
// case 'reset': // case 'reset':