更新
This commit is contained in:
@@ -27,11 +27,6 @@
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班次开始时间" prop="startTime">
|
||||
<el-time-picker
|
||||
@@ -64,6 +59,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
|
||||
code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
|
||||
startTime: [
|
||||
{ required: true, message: '请输入生效时间', trigger: 'change' },
|
||||
{ required: true, message: '请选择班次开始时间', trigger: 'change' },
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: '请选择班次结束时间', trigger: 'change' },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2024-07-01 14:53:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-01-15 13:15:05
|
||||
* @LastEditTime: 2025-02-24 16:02:39
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -257,8 +257,12 @@ export default {
|
||||
type: 'warning',
|
||||
}
|
||||
).then(function () {
|
||||
return _this.$modal
|
||||
.delConfirm(row.name)
|
||||
return _this
|
||||
.$confirm(`是否确认删除 ${row.name} 的数据项?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(function () {
|
||||
return deleteGroupClasses(row.id);
|
||||
})
|
||||
|
||||
@@ -236,6 +236,11 @@ export default {
|
||||
.baseTable .el-icon-refresh {
|
||||
cursor: pointer;
|
||||
}
|
||||
.baseTable >>> .el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
border: 1px solid rgb(220, 220, 220);
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.baseTable .el-table__body tr.current-row > td.el-table__cell {
|
||||
|
||||
@@ -2,30 +2,36 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-24 14:47:58
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-01-15 10:20:20
|
||||
* @LastEditTime: 2025-02-25 14:03:40
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<el-table
|
||||
id="detail"
|
||||
:data="tableData"
|
||||
:header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266',
|
||||
}"
|
||||
border
|
||||
:span-method="arraySpanMethod"
|
||||
:span-method="arraySpanMethod"
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%"
|
||||
ref="dataList">
|
||||
<el-table-column prop="lineName" label="产线" />
|
||||
<el-table-column prop="lineName" label="产线" align="center" />
|
||||
<el-table-column
|
||||
prop="sizes"
|
||||
width="105"
|
||||
showOverflowtooltip
|
||||
align="center"
|
||||
label="规格" />
|
||||
<el-table-column prop="process" label="产品工艺" />
|
||||
<el-table-column prop="inputN" label="投入">
|
||||
<el-table-column prop="process" label="产品工艺" align="center" />
|
||||
<el-table-column prop="inputN" label="投入" align="center">
|
||||
<el-table-column prop="inputNum" label="投入数量/片" />
|
||||
<el-table-column prop="inputArea" label="投入面积/m²">
|
||||
<template v-slot="scope">
|
||||
@@ -39,7 +45,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="outputN" label="产出">
|
||||
<el-table-column prop="outputN" label="产出" align="center">
|
||||
<el-table-column prop="outputNum" label="产出数量/片" />
|
||||
<el-table-column prop="outputArea" label="产出面积/m²">
|
||||
<template v-slot="scope">
|
||||
@@ -53,151 +59,147 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lossN" label="不良">
|
||||
<el-table-column prop="lossN" label="不良" align="center">
|
||||
<el-table-column prop="lossNum" label="不良数量/片" />
|
||||
<el-table-column prop="lossArea" label="不良面积/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.lossArea != null
|
||||
? scope.row.lossArea.toFixed(2)
|
||||
: '-'
|
||||
scope.row.lossArea != null ? scope.row.lossArea.toFixed(2) : '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lossRatio" label="不良率/%">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.lossRatio != null
|
||||
? scope.row.lossRatio.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.lossRatio != null ? scope.row.lossRatio.toFixed(2) : '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="outputRatio" label="投入产出率/%">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.outputRatio != null
|
||||
? scope.row.outputRatio.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.outputRatio != null
|
||||
? scope.row.outputRatio.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="processingRatio" label="加工成品率/%">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.processingRatio != null
|
||||
? scope.row.processingRatio.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lossD" label="不良详情">
|
||||
<el-table-column prop="original" label="原片">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.processingRatio != null
|
||||
? scope.row.processingRatio.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lossD" label="不良详情" align="center">
|
||||
<el-table-column prop="original" label="原片" align="center">
|
||||
<el-table-column prop="originalLossNum" label="原片不良/片" />
|
||||
<el-table-column prop="originalLossArea" label="原片不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.originalLossArea != null
|
||||
? scope.row.originalLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.originalLossArea != null
|
||||
? scope.row.originalLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="edge" label="磨边">
|
||||
<el-table-column prop="edge" label="磨边" align="center">
|
||||
<el-table-column prop="edgeLossNum" label="磨边不良/片" />
|
||||
<el-table-column prop="edgeLossArea" label="磨边不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.edgeLossArea != null
|
||||
? scope.row.edgeLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.edgeLossArea != null
|
||||
? scope.row.edgeLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="drill" label="打孔">
|
||||
<el-table-column prop="drill" label="打孔" align="center">
|
||||
<el-table-column prop="drillLossNum" label="打孔不良/片" />
|
||||
<el-table-column prop="drillLossArea" label="打孔不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.drillLossArea != null
|
||||
? scope.row.drillLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.drillLossArea != null
|
||||
? scope.row.drillLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="coating" label="镀膜">
|
||||
<el-table-column prop="coating" label="镀膜" align="center">
|
||||
<el-table-column prop="coatingLossNum" label="镀膜不良/片" />
|
||||
<el-table-column prop="coatingLossArea" label="镀膜不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.coatingLossArea != null
|
||||
? scope.row.coatingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.coatingLossArea != null
|
||||
? scope.row.coatingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="silk" label="丝印">
|
||||
<el-table-column prop="silk" label="丝印" align="center">
|
||||
<el-table-column prop="silkLossNum" label="丝印不良/片" />
|
||||
<el-table-column prop="silkLossArea" label="丝印不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.silkLossArea != null
|
||||
? scope.row.silkLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.silkLossArea != null
|
||||
? scope.row.silkLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tempering" label="钢化">
|
||||
<el-table-column prop="tempering" label="钢化" align="center">
|
||||
<el-table-column prop="temperingLossNum" label="钢化不良/片" />
|
||||
<el-table-column prop="temperingLossArea" label="钢化不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.temperingLossArea != null
|
||||
? scope.row.temperingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.temperingLossArea != null
|
||||
? scope.row.temperingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column prop="packing" label="包装">
|
||||
<el-table-column prop="packing" label="包装" align="center">
|
||||
<el-table-column prop="packingLossNum" label="包装不良/片" />
|
||||
<el-table-column prop="packingLossArea" label="包装不良/m²">
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.packingLossArea != null
|
||||
? scope.row.packingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot="scope">
|
||||
<span>
|
||||
{{
|
||||
scope.row.packingLossArea != null
|
||||
? scope.row.packingLossArea.toFixed(2)
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -206,6 +208,8 @@
|
||||
|
||||
<script>
|
||||
import { getTeamReportPageDet } from '@/api/core/monitoring/auto';
|
||||
import * as XLSX from 'xlsx';
|
||||
import FileSaver from 'file-saver';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
@@ -213,6 +217,15 @@ export default {
|
||||
return {
|
||||
tableData: [],
|
||||
dataListLoading: false,
|
||||
formConfig: [
|
||||
{
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
@@ -238,25 +251,57 @@ export default {
|
||||
item.temperingLossArea = item.tempering?.lossArea;
|
||||
item.packingLossNum = item.packing?.lossNum;
|
||||
item.packingLossArea = item.packing?.lossArea;
|
||||
if(item.isSummaryReport){
|
||||
item.lineName = '合计'
|
||||
}
|
||||
if (item.isSummaryReport) {
|
||||
item.lineName = '合计';
|
||||
}
|
||||
return item;
|
||||
});
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
if (row.isSummaryReport) {
|
||||
if (columnIndex === 0) {
|
||||
return [1, 3];
|
||||
} else if (columnIndex === 1) {
|
||||
return [0, 0];
|
||||
}else if (columnIndex === 2) {
|
||||
return [0, 0];
|
||||
}
|
||||
}
|
||||
},
|
||||
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
if (row.isSummaryReport) {
|
||||
if (columnIndex === 0) {
|
||||
return [1, 3];
|
||||
} else if (columnIndex === 1) {
|
||||
return [0, 0];
|
||||
} else if (columnIndex === 2) {
|
||||
return [0, 0];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
let tables = document.querySelector('#detail').cloneNode(true);
|
||||
let exportTable = XLSX.utils.table_to_book(tables);
|
||||
|
||||
var exportTableOut = XLSX.write(exportTable, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: true,
|
||||
type: 'array',
|
||||
});
|
||||
// sheetjs.xlsx为导出表格的标题名称
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
new Blob([exportTableOut], {
|
||||
type: 'application/octet-stream',
|
||||
}),
|
||||
'班组生产报表-详情.xlsx'
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') console.log(e, exportTableOut);
|
||||
}
|
||||
return exportTableOut;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-08-29 14:59:29
|
||||
* @LastEditTime: 2025-01-15 10:24:05
|
||||
* @LastEditTime: 2025-02-25 14:26:04
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
-->
|
||||
@@ -65,69 +65,81 @@ import { getGroupTeamPage } from '@/api/base/groupTeam';
|
||||
import * as XLSX from 'xlsx';
|
||||
import FileSaver from 'file-saver';
|
||||
import baseTableS from './baseTable.vue';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'reportType',
|
||||
label: '报表类型',
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
prop: 'reportStartTime',
|
||||
prop: 'reportName',
|
||||
label: '日期',
|
||||
filter: (val) => (val ? parseTime(val, '{y}-{m}-{d}') : '-'),
|
||||
width: 130,
|
||||
width: 180,
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
prop: 'factoryName',
|
||||
label: '工厂',
|
||||
fixed: true
|
||||
},
|
||||
{
|
||||
prop: 'teamName',
|
||||
label: '班组',
|
||||
fixed: true
|
||||
},
|
||||
|
||||
{
|
||||
prop: 'inputN',
|
||||
label: '投入',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'inputNum',
|
||||
label: '投入数量/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'inputArea',
|
||||
label: '投入面积/m²',
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'outputN',
|
||||
label: '产出',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'outputNum',
|
||||
label: '产出数量/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'outputArea',
|
||||
label: '产出面积/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'lossN',
|
||||
label: '不良',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'lossNum',
|
||||
label: '不良数量/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'lossArea',
|
||||
label: '不良面积/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -135,123 +147,148 @@ const tableProps = [
|
||||
prop: 'lossRatio',
|
||||
label: '不良率/%',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'outputRatio',
|
||||
label: '投入产出率/%',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:110
|
||||
},
|
||||
{
|
||||
prop: 'processingRatio',
|
||||
label: '加工成品率/%',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:110
|
||||
},
|
||||
{
|
||||
prop: 'lossD',
|
||||
label: '不良详情',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'original',
|
||||
label: '原片',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'originalLossNum',
|
||||
label: '原片不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'originalLossArea',
|
||||
label: '原片不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'edge',
|
||||
label: '磨边',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'edgeLossNum',
|
||||
label: '磨边不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'edgeLossArea',
|
||||
label: '磨边不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'drill',
|
||||
label: '打孔',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'drillLossNum',
|
||||
label: '打孔不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'drillLossArea',
|
||||
label: '打孔不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'coating',
|
||||
label: '镀膜',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'coatingLossNum',
|
||||
label: '镀膜不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'coatingLossArea',
|
||||
label: '镀膜不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'silk',
|
||||
label: '丝印',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'silkLossNum',
|
||||
label: '丝印不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'silkLossArea',
|
||||
label: '丝印不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'tempering',
|
||||
label: '钢化',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'temperingLossNum',
|
||||
label: '钢化不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'temperingLossArea',
|
||||
label: '钢化不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'packing',
|
||||
label: '包装',
|
||||
align: 'center',
|
||||
children: [
|
||||
{
|
||||
prop: 'packingLossNum',
|
||||
label: '包装不良/片',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
prop: 'packingLossArea',
|
||||
label: '包装不良/㎡',
|
||||
filter: (val) => (val != null ? val.toFixed(2) : '-'),
|
||||
width:100
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -270,6 +307,7 @@ export default {
|
||||
getDataListURL: getTeamReportPage,
|
||||
},
|
||||
listQuery: {
|
||||
reportType: 1,
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
@@ -291,7 +329,12 @@ export default {
|
||||
label: '工厂',
|
||||
selectOptions: [],
|
||||
param: 'factoryId',
|
||||
onchange: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '班组',
|
||||
selectOptions: [],
|
||||
param: 'teamId',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -314,20 +357,15 @@ export default {
|
||||
name: '年',
|
||||
},
|
||||
],
|
||||
defaultSelect: 1,
|
||||
param: 'reportType',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '班组',
|
||||
selectOptions: [],
|
||||
param: 'teamId',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '报表开始时间',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
@@ -364,15 +402,9 @@ export default {
|
||||
// 设置为23:59:59
|
||||
const end = new Date(yesterday.getTime());
|
||||
end.setHours(23, 59, 59, 59);
|
||||
this.listQuery.reportStartTime = [
|
||||
parseTime(yesterday, '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
parseTime(end, '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
];
|
||||
this.listQuery.reportStartTime = [yesterday.getTime(),end.getTime()];
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm.formInline.timeVal = [
|
||||
parseTime(yesterday, '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
parseTime(end, '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
];
|
||||
this.$refs.searchBarForm.formInline.timeVal = [yesterday.getTime(),end.getTime()];
|
||||
});
|
||||
this.getDataList();
|
||||
this.getPdLineList();
|
||||
@@ -389,6 +421,7 @@ export default {
|
||||
tables.removeChild(tables.querySelector('.el-table__fixed-right'));
|
||||
}
|
||||
let exportTable = XLSX.utils.table_to_book(tables);
|
||||
exportTable.Sheets.Sheet1.A1.v = '序号' //导出表格第一列表头为序号
|
||||
|
||||
var exportTableOut = XLSX.write(exportTable, {
|
||||
bookType: 'xlsx',
|
||||
@@ -414,7 +447,7 @@ export default {
|
||||
pageNo: 1,
|
||||
};
|
||||
getGroupTeamPage(params).then((res) => {
|
||||
this.formConfig[2].selectOptions = res.data.list || [];
|
||||
this.formConfig[1].selectOptions = res.data.list || [];
|
||||
});
|
||||
getFactoryPage(params).then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data.list || [];
|
||||
@@ -445,11 +478,11 @@ export default {
|
||||
this.dataListLoading = true;
|
||||
const arr = ['日', '周', '月', '年'];
|
||||
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
|
||||
if(!response.data.list){
|
||||
this.showData = []
|
||||
this.dataListLoading = false;
|
||||
return
|
||||
}
|
||||
if (!response.data.list) {
|
||||
this.showData = [];
|
||||
this.dataListLoading = false;
|
||||
return;
|
||||
}
|
||||
this.tableData = response.data?.list.map((item, index) => {
|
||||
item.reportType = arr[item.reportType - 1];
|
||||
item.originalLossNum = item.original?.lossNum;
|
||||
@@ -475,13 +508,16 @@ export default {
|
||||
},
|
||||
handleClick(val) {
|
||||
this.addOrUpdateVisible = true;
|
||||
const time = val.data.reportName?val.data.reportName:'- '
|
||||
const teamName = val.data.teamName?val.data.teamName:'- '
|
||||
const teamLeader = val.data.teamLeader?val.data.teamLeader:'- '
|
||||
this.addOrEditTitle =
|
||||
'时间:' +
|
||||
val.data?.reportName +
|
||||
'时间:' +
|
||||
time +
|
||||
' 班组:' +
|
||||
val.data?.teamName +
|
||||
teamName +
|
||||
' 组长:' +
|
||||
val.data?.teamLeader +
|
||||
teamLeader +
|
||||
' 详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.grDetail.init(val.data.id);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2024-07-01 14:54:06
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-01-15 13:23:17
|
||||
* @LastEditTime: 2025-02-26 15:12:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -438,7 +438,8 @@ export default {
|
||||
}
|
||||
.class1,
|
||||
.class2,
|
||||
.class3 {
|
||||
.class3,
|
||||
.class4 {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
margin-bottom: 2px;
|
||||
@@ -528,6 +529,22 @@ export default {
|
||||
background-color: #e0ffee;
|
||||
}
|
||||
}
|
||||
.class4 {
|
||||
.selectDiv {
|
||||
.toggle-icon,
|
||||
.toggle-icon-hide {
|
||||
background-color: #5c2fb1;
|
||||
}
|
||||
.el-input--small .el-input__inner {
|
||||
color: #381689;
|
||||
background-color: #e2a6eb;
|
||||
}
|
||||
}
|
||||
.labelClass {
|
||||
color: #381689;
|
||||
background-color: #e2a6eb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-01-15 11:20:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-02-25 09:37:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
@@ -24,7 +31,7 @@
|
||||
<script>
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||
import { schedulingPage } from '@/api/base/groupTeamScheduling';
|
||||
import { schedulingPage,exportSchedulingExcel } from '@/api/base/groupTeamScheduling';
|
||||
import { getFactoryPage } from '@/api/core/base/factory';
|
||||
import {
|
||||
getGroupClassesPage,
|
||||
@@ -139,36 +146,20 @@ export default {
|
||||
this.getPdLineList();
|
||||
},
|
||||
methods: {
|
||||
handleExport() {
|
||||
let tables = document.querySelector('.el-table').cloneNode(true);
|
||||
const fix = tables.querySelector('.el-table__fixed');
|
||||
const fixRight = tables.querySelector('.el-table__fixed-right');
|
||||
if (fix) {
|
||||
tables.removeChild(tables.querySelector('.el-table__fixed'));
|
||||
}
|
||||
if (fixRight) {
|
||||
tables.removeChild(tables.querySelector('.el-table__fixed-right'));
|
||||
}
|
||||
let exportTable = XLSX.utils.table_to_book(tables);
|
||||
|
||||
var exportTableOut = XLSX.write(exportTable, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: true,
|
||||
type: 'array',
|
||||
});
|
||||
// sheetjs.xlsx为导出表格的标题名称
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
new Blob([exportTableOut], {
|
||||
type: 'application/octet-stream',
|
||||
}),
|
||||
this.fileName + '班组上班记录.xlsx'
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') console.log(e, exportTableOut);
|
||||
}
|
||||
return exportTableOut;
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportSchedulingExcel(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '上班记录报表.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => { });
|
||||
},
|
||||
getPdLineList() {
|
||||
const params = {
|
||||
pageSize: 100,
|
||||
@@ -197,6 +188,13 @@ export default {
|
||||
this.getList();
|
||||
break;
|
||||
case 'export':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.factoryId = val.factoryId || undefined;
|
||||
this.queryParams.classesId = val.classesId || undefined;
|
||||
this.queryParams.teamName = val.teamId || undefined;
|
||||
this.queryParams.startDay = val.timeVal
|
||||
? val.timeVal
|
||||
: undefined;
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user