projects/mesxc-zhp #354

Merged
juzi merged 4 commits from projects/mesxc-zhp into projects/mesxc-test 2024-04-24 13:50:45 +08:00
5 changed files with 89 additions and 87 deletions

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 14:08:46 * @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-23 16:18:27 * @LastEditTime: 2024-04-24 13:49:09
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -24,19 +24,20 @@
</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" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
<el-table-column label="原料样式" align="right" width="150"> <el-table-column prop="" label="配料日报" width="120">
<el-table-column prop="className" label="时间" width="120"> <el-table-column label="原料样式" align="right" width="150">
<el-table-column prop="className" 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 style="text-align: center;" v-for="(item,index) in codeList " :prop="item" :label="item"> <el-table-column style="text-align: center;" v-for="(item,index) in codeList " :prop="item" :label="item">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<el-col :span="12"> <el-col :span="12">
{{ codeList[index] }} {{ codeList[index] }}
</el-col> </el-col>
@ -49,6 +50,7 @@
</el-col> </el-col>
</el-row> </el-row>
</template> --> </template> -->
</el-table-column>
</el-table-column> </el-table-column>
</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"
@ -145,7 +147,7 @@ export default {
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'checkTime', param: 'checkTime',
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
width: 250 width: 350
}, },
{ {
type:'button', type:'button',
@ -157,7 +159,7 @@ export default {
type:'button', type:'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'success', color: 'primary',
plain: true plain: true
}, },
], ],
@ -212,7 +214,7 @@ export default {
} }
} }
if (columnIndex === 1) { if (columnIndex === 1) {
if (rowIndex === 1 || rowIndex === 3 || rowIndex === 5 || rowIndex === 7 || rowIndex === 9 || rowIndex === 11) { if (rowIndex %2 == 1) {
return { return {
rowspan: 1, rowspan: 1,
colspan: 2 colspan: 2
@ -220,7 +222,7 @@ export default {
} }
} }
if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13) { if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13) {
if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) { if (rowIndex % 2 == 0) {
return { return {
rowspan: 2, rowspan: 2,
colspan: 1 colspan: 1
@ -252,7 +254,7 @@ export default {
// Blob // Blob
new Blob([wbout], { type: "application/octet-stream" }), new Blob([wbout], { type: "application/octet-stream" }),
// //
"原片各线堆垛表.xlsx" "切割堆垛日报表.xlsx"
); );
} catch (e) { } catch (e) {
if (typeof console !== "undefined") console.log(e, wbout); if (typeof console !== "undefined") console.log(e, wbout);
@ -558,11 +560,13 @@ export default {
background: none; background: none;
} }
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type { /* ::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type {
border-bottom: none;
} */
::v-deep.el-table thead.is-group tr:nth-child(2) th:nth-child(1) {
border-bottom: none; border-bottom: none;
} }
::v-deep.el-table thead.is-group tr:nth-child(2) th:first-of-type:before {
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before {
content: ''; content: '';
position: absolute; position: absolute;
width: 1px; width: 1px;
@ -578,7 +582,7 @@ export default {
transform-origin: top; transform-origin: top;
} }
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before { ::v-deep.el-table thead.is-group tr:nth-child(3) th:first-of-type:before {
content: ''; content: '';
position: absolute; position: absolute;
width: 1px; width: 1px;

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-23 15:15:22 * @LastEditTime: 2024-04-24 09:34:36
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -41,6 +41,7 @@ import {
} 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'
import { parseTime } from '../../../core/mixins/code-filter';
// import { getList, } from "@/api/base/qualityScrapType"; // import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [ const tableProps = [
// { // {
@ -70,7 +71,7 @@ const tableProps = [
}, },
{ {
prop: 'thickness', prop: 'thickness',
label: '厚度' label: '厚度mm'
}, },
{ {
prop: 'glassCode', prop: 'glassCode',
@ -79,7 +80,9 @@ const tableProps = [
{ {
prop: 'stackingType', prop: 'stackingType',
label: '堆垛方式', label: '堆垛方式',
filter: (val) => val == 1 ? '集装架' : '堵头箱', // filter: (val) =>
// val != null ? ['', ''][val] : '',
// filter: ((val) => { val == 1 ? '' : '' }),
}, },
{ {
prop: 'pieces', prop: 'pieces',
@ -95,16 +98,16 @@ const tableProps = [
}, },
{ {
prop: 'dusting', prop: 'dusting',
label: '堆垛情况', label: '喷粉情况',
}, },
{ {
prop: 'palletNumber', prop: 'palletNumber',
label: '堆垛时间',
},
{
prop: 'endTime',
label: '集装架号', label: '集装架号',
}, },
{
prop: 'remark',
label: '备注',
}
] ]
} }
]; ];
@ -318,7 +321,23 @@ export default {
// // console.log(); // // console.log();
// // } // // }
// }) // })
this.tableData = response.data this.tableData = response.data.map((ele) => {
return {
lineName: ele.lineName,
className: ele.className,
groupName: ele.groupName,
size: ele.size,
thickness: ele.thickness,
glassCode: ele.glassCode,
stackingType: ele.stackingType == 1 ? '集装架' : '堵头箱',
pieces: ele.pieces,
originCode: ele.originCode,
endTime: parseTime(ele.endTime),
dusting: ele.dusting,
palletNumber: ele.palletNumber,
remark:ele.remark
}
})
// let obj = {} // let obj = {}
// response.data.reduce((prev, curr) => { // response.data.reduce((prev, curr) => {
// console.log(prev, curr) // console.log(prev, curr)
@ -405,12 +424,12 @@ export default {
}, },
}; };
</script> </script>
<style> <style scoped>
.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }
.baseTable .el-table .el-table__cell { ::v-deep .baseTable .el-table .el-table__cell {
padding: 0; padding: 0;
height: 35px; height: 35px;
} }

View File

@ -1,14 +1,14 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 14:08:46 * @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-23 15:08:44 * @LastEditTime: 2024-04-24 08:58:26
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="" prop="startTime"> <el-form-item label="时间" prop="startTime">
<el-date-picker v-model="listQuery.startTime" value-format="timestamp" type="date" placeholder="选择日期"> <el-date-picker v-model="listQuery.startTime" value-format="timestamp" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -205,7 +205,7 @@ export default {
prop: 'num11' prop: 'num11'
}, },
{ {
label: '合计', label: '不良合计',
prop: 'sum' prop: 'sum'
} }
], ],
@ -234,7 +234,7 @@ export default {
type: 'button', type: 'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'success', color: 'primary',
plain: true plain: true
}, },
], ],
@ -360,7 +360,7 @@ export default {
prop: 'num11' prop: 'num11'
}, },
{ {
label: '合计', label: '不良合计',
prop: 'sum' prop: 'sum'
} }
] ]
@ -422,7 +422,7 @@ export default {
prop: 'num11' prop: 'num11'
}, },
{ {
label: '合计', label: '不良合计',
prop: 'sum' prop: 'sum'
} }
] ]

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-23 15:15:45 * @LastEditTime: 2024-04-24 09:56:20
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -11,9 +11,10 @@
<el-table :header-cell-style="{ <el-table :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%" }" class="baseTable" border :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
:span-method="objectSpanMethod"> :span-method="objectSpanMethod">
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center"> <el-table-column :width="item.width" v-for="item in tableProps" :prop="item.prop" :label="item.label"
align="center">
</el-table-column> </el-table-column>
</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"
@ -39,6 +40,7 @@ import {
getOriginalLineDataList getOriginalLineDataList
} from '@/api/report/qcReport'; } from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { width } from '@antv/x6-common/lib/dom/position';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
// import { getList, } from "@/api/base/qualityScrapType"; // import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [ const tableProps = [
@ -49,11 +51,13 @@ const tableProps = [
// }, // },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线' label: '产线',
width:'100'
}, },
{ {
prop: 'equipmentName', prop: 'equipmentName',
label: '' label: '',
width: '200'
}, },
{ {
prop: 'num', prop: 'num',
@ -122,7 +126,7 @@ export default {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: "timestamp",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
@ -154,7 +158,7 @@ export default {
type:'button', type:'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'success', color: 'primary',
plain: true plain: true
}, },
], ],

View File

@ -1,19 +1,19 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-18 15:07:53 * @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-23 15:15:52 * @LastEditTime: 2024-04-24 09:58:07
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @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" />
<el-table show-summary :header-cell-style="{ <el-table :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%" }" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod">
:span-method="objectSpanMethod"> <el-table-column :width="item.width" v-for="item in tableProps" :prop="item.prop" :label="item.label"
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center"> align="center">
</el-table-column> </el-table-column>
</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"
@ -49,11 +49,13 @@ const tableProps = [
// }, // },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线' label: '产线',
width:'150',
}, },
{ {
prop: 'dataType', prop: 'dataType',
label: '' label: '',
width: '150',
}, },
{ {
prop: 'type', prop: 'type',
@ -69,7 +71,7 @@ const tableProps = [
}, },
{ {
prop: 'rate', prop: 'rate',
label: '占比', label: '占比%',
// filter: (val) => val == false ? '' : '', // filter: (val) => val == false ? '' : '',
}, },
// { // {
@ -121,7 +123,7 @@ export default {
type: 'datePicker', type: 'datePicker',
label: '时间段', label: '时间段',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp", valueFormat: "timestamp",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
@ -153,7 +155,7 @@ export default {
type:'button', type:'button',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'success', color: 'primary',
plain: true plain: true
}, },
], ],
@ -179,34 +181,6 @@ export default {
console.log(res) console.log(res)
this.formConfig[1].selectOptions = res.data 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]));
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 }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0; let spanOneArr = [], concatOne = 0;
let spanTwoArr = [], concatTwo = 0; let spanTwoArr = [], concatTwo = 0;
@ -276,7 +250,7 @@ export default {
// Blob // Blob
new Blob([wbout], { type: "application/octet-stream" }), new Blob([wbout], { type: "application/octet-stream" }),
// //
"原片各线堆垛表.xlsx" "原片各线优化切割堆垛表.xlsx"
); );
} catch (e) { } catch (e) {
if (typeof console !== "undefined") console.log(e, wbout); if (typeof console !== "undefined") console.log(e, wbout);
@ -319,7 +293,7 @@ export default {
type: ele.type, type: ele.type,
pieces: ele.pieces, pieces: ele.pieces,
area: ele.area, area: ele.area,
rate: ele.rate rate: (ele.rate * 100).toFixed(2)
// useNum: ele.useNum, // useNum: ele.useNum,
// num: ele.num, // num: ele.num,
// size: typeof (ele.size) // size: typeof (ele.size)
@ -412,13 +386,14 @@ export default {
}, },
}; };
</script> </script>
<style> <style scoped>
.baseTable .el-table__body tr.current-row>td.el-table__cell { ::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC; background-color: #EAF1FC;
} }
.baseTable .el-table .el-table__cell { ::v-deep .baseTable .el-table .el-table__cell {
padding: 0; padding: 0;
height: 35px; height: 35px;
} }
</style> </style>