|
|
@@ -9,7 +9,7 @@
|
|
|
<el-input v-model="searchInfo" placeholder="搜索工单编号" clearable style="width: 200px;margin: 5px"></el-input>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="hzToExcel" >导出到Excel(汇总)</el-button>
|
|
|
<el-button type="primary" class="bt" icon="download" @click="mxToExcel" >导出到Excel(明细)</el-button>
|
|
|
- <el-button type="primary" class="bt" icon="download" @click="sdToExcel" >按时段导出明细</el-button>
|
|
|
+ <el-button type="primary" class="bt" icon="download" @click="rqToExcel" >按时段导出明细</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
@@ -42,30 +42,30 @@
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="pchzRowClick"
|
|
|
highlight-current-row="true" @row-dblclick="gytableDatadoubleClick" id="pchztable"
|
|
|
style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="pchztableData" row-key="ID" >
|
|
|
- <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="300"/>
|
|
|
+ <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="110"/>
|
|
|
<el-table-column fixed align="left" label="机台名称" prop="机台名称" width="170"/>
|
|
|
- <el-table-column fixed align="left" label="班组" prop="班组" width="100"/>
|
|
|
- <el-table-column align="left" label="近7天综合达成率" prop="近7天综合达成率" width="85"/>
|
|
|
+ <el-table-column fixed align="left" label="班组" prop="班组" width="60"/>
|
|
|
+ <el-table-column align="left" label="近7天综合达成率" prop="近7天综合达成率" width="135"/>
|
|
|
<!-- 近七天列表 -->
|
|
|
<template v-for="item in datelist">
|
|
|
- <el-table-column align="left" sortable :label="item.display" :prop="item.prop" width="80"/>
|
|
|
+ <el-table-column align="left" :label="item.display" :prop="item.prop" width="80"/>
|
|
|
</template>
|
|
|
- <el-table-column align="left" label="实际总产量" prop="实际总产量" width="85"/>
|
|
|
- <el-table-column align="left" label="排产总产量" prop="排产总产量" width="80"/>
|
|
|
- <el-table-column align="left" label="实际产量1" prop="实际产量1" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量1" prop="排产产量1" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量2" prop="实际产量2" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量2" prop="排产产量2" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量3" prop="实际产量3" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量3" prop="排产产量3" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量4" prop="实际产量4" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量4" prop="排产产量4" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量5" prop="实际产量5" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量5" prop="排产产量5" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量6" prop="实际产量6" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量6" prop="排产产量6" width="85"/>
|
|
|
- <el-table-column align="left" label="实际产量7" prop="实际产量7" width="85"/>
|
|
|
- <el-table-column align="left" label="排产产量7" prop="排产产量7" width="85"/>
|
|
|
+ <el-table-column align="left" label="实际总产量" prop="实际总产量" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产总产量" prop="排产总产量" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量1" prop="实际产量1" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量1" prop="排产产量1" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量2" prop="实际产量2" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量2" prop="排产产量2" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量3" prop="实际产量3" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量3" prop="排产产量3" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量4" prop="实际产量4" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量4" prop="排产产量4" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量5" prop="实际产量5" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量5" prop="排产产量5" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量6" prop="实际产量6" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量6" prop="排产产量6" width="100"/>
|
|
|
+ <el-table-column align="left" label="实际产量7" prop="实际产量7" width="100"/>
|
|
|
+ <el-table-column align="left" label="排产产量7" prop="排产产量7" width="100"/>
|
|
|
</el-table>
|
|
|
|
|
|
<el-table ref="JPmultipleTable"
|
|
|
@@ -77,30 +77,30 @@
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="pcmxtable"
|
|
|
style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="pcmxtableData" row-key="ID" >
|
|
|
- <el-table-column align="left" fixed label="日期" prop="日期" 机台编号="300"/>
|
|
|
- <el-table-column align="left" fixed label="机台编号" prop="机台编号" width="150"/>
|
|
|
+ <el-table-column align="left" fixed label="日期" prop="日期" width="110"/>
|
|
|
+ <el-table-column align="left" fixed label="机台编号" prop="机台编号" width="90"/>
|
|
|
<el-table-column align="left" fixed label="班组" prop="班组" width="70"/>
|
|
|
<el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
|
|
|
- <el-table-column align="left" label="印件号" prop="印件号" width="90"/>
|
|
|
- <el-table-column align="left" label="印件名称" prop="印件名称" width="80"/>
|
|
|
- <el-table-column align="left" label="工序号" prop="工序号" width="80"/>
|
|
|
- <el-table-column align="left" label="工序名称" prop="工序名称" width="90"/>
|
|
|
- <el-table-column align="left" label="实际产量" prop="实际产量" width="100"/>
|
|
|
- <el-table-column align="left" label="排产标准产能" prop="排产标准产能" width="90"/>
|
|
|
+ <el-table-column align="left" label="印件号" prop="印件号" width="70"/>
|
|
|
+ <el-table-column align="left" label="印件名称" prop="印件名称" width="120"/>
|
|
|
+ <el-table-column align="left" label="工序号" prop="工序号" width="70"/>
|
|
|
+ <el-table-column align="left" label="工序名称" prop="工序名称" width="120"/>
|
|
|
+ <el-table-column align="left" label="实际产量" prop="实际产量" width="90"/>
|
|
|
+ <el-table-column align="left" label="排产标准产能" prop="排产标准产能" width="110"/>
|
|
|
<el-table-column align="left" label="排产产量" prop="排产产量" width="90"/>
|
|
|
- <el-table-column align="left" label="上报运行工时" prop="上报运行工时" width="170"/>
|
|
|
- <el-table-column align="left" label="运行工时" prop="运行工时" width="170"/>
|
|
|
- <el-table-column align="left" label="工序计划辅助工时" prop="工序计划辅助工时" width="170"/>
|
|
|
- <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="170"/>
|
|
|
- <el-table-column align="left" label="保养工时" prop="保养工时" width="170"/>
|
|
|
- <el-table-column align="left" label="打样工时" prop="打样工时" width="170"/>
|
|
|
- <el-table-column align="left" label="版距" prop="版距" width="170"/>
|
|
|
- <el-table-column align="left" label="机台名称" prop="机台名称" width="90"/>
|
|
|
+ <el-table-column align="left" label="上报运行工时" prop="上报运行工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="工序计划辅助工时" prop="工序计划辅助工时" width="140"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="打样工时" prop="打样工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="版距" prop="版距" width="110"/>
|
|
|
+ <el-table-column align="left" label="机台名称" prop="机台名称" width="130"/>
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
<el-table ref="multipleTable"
|
|
|
- v-else
|
|
|
+ v-if="ismachine"
|
|
|
:show-overflow-tooltip="true"
|
|
|
@selection-change="selectionChange($event)"
|
|
|
:row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
@@ -108,24 +108,25 @@
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="sbhzRowClick"
|
|
|
highlight-current-row="true" @row-dblclick="gytableDatadoubleClick" id="sbhztable"
|
|
|
style="width: 100%;height: 30vh" border tooltip-effect="dark" :data="sbhztableData" row-key="ID" >
|
|
|
- <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="300"/>
|
|
|
- <el-table-column fixed align="left" label="班组" prop="班组" width="100"/>
|
|
|
+ <el-table-column fixed align="left" label="机台编号" prop="机台编号" width="90"/>
|
|
|
+ <el-table-column fixed align="left" label="班组" prop="班组" width="70"/>
|
|
|
<el-table-column align="left" label="实际产量" prop="实际产量" width="85"/>
|
|
|
<el-table-column align="left" label="目标产量" prop="目标产量" width="85"/>
|
|
|
- <el-table-column align="left" label="负荷产量" prop="负荷产量" width="80"/>
|
|
|
+ <el-table-column align="left" label="负荷产量" prop="负荷产量" width="85"/>
|
|
|
<el-table-column align="left" label="目标达成" prop="目标达成" width="85"/>
|
|
|
- <el-table-column align="left" label="综合利用率" prop="综合利用率" width="85"/>
|
|
|
- <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="85"/>
|
|
|
- <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="85"/>
|
|
|
- <el-table-column align="left" label="保养工时" prop="保养工时" width="85"/>
|
|
|
- <el-table-column align="left" label="打样总工时" prop="打样总工时" width="85"/>
|
|
|
- <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="85"/>
|
|
|
- <el-table-column align="left" label="异常总工时" prop="异常总工时" width="85"/>
|
|
|
- <el-table-column align="left" label="异常补时" prop="异常补时" width="85"/>
|
|
|
- <el-table-column align="left" label="运行工时" prop="运行工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="综合利用率" prop="综合利用率" width="95"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="打样总工时" prop="打样总工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="异常补时" prop="异常补时" width="110"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="110"/>
|
|
|
</el-table>
|
|
|
|
|
|
<el-table ref="JPmultipleTable"
|
|
|
+ v-if="ismachine"
|
|
|
:show-overflow-tooltip="true"
|
|
|
@selection-change="selectionChange($event)"
|
|
|
:row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
@@ -133,34 +134,66 @@
|
|
|
:header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick" id="sbmxtable"
|
|
|
style="width: 100%;height: 45vh" border tooltip-effect="dark" :data="sbmxtableData" row-key="ID" >
|
|
|
- <el-table-column align="left" fixed label="机台编号" prop="机台编号" width="150"/>
|
|
|
- <el-table-column align="left" fixed label="日期" prop="日期" 机台编号="300"/>
|
|
|
+ <el-table-column align="left" fixed label="机台编号" prop="机台编号" width="90"/>
|
|
|
+ <el-table-column align="left" fixed label="日期" prop="日期" width="110"/>
|
|
|
<el-table-column align="left" fixed label="班组" prop="班组" width="70"/>
|
|
|
<el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
|
|
|
- <el-table-column align="left" label="印件名称" prop="印件名称" width="80"/>
|
|
|
- <el-table-column align="left" label="印件工序" prop="工序名称" width="90"/>
|
|
|
+ <el-table-column align="left" label="印件名称" prop="印件名称" width="110"/>
|
|
|
+ <el-table-column align="left" label="印件工序" prop="工序名称" width="110"/>
|
|
|
<el-table-column align="left" label="实际产量" prop="实际产量" width="100"/>
|
|
|
- <el-table-column align="left" label="目标产量" prop="排产标准产能" width="90"/>
|
|
|
- <el-table-column align="left" label="负荷产量" prop="排产产量" width="90"/>
|
|
|
- <el-table-column align="left" label="目标达成" prop="上报运行工时" width="170"/>
|
|
|
- <el-table-column align="left" label="综合利用率" prop="运行工时" width="170"/>
|
|
|
- <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="85"/>
|
|
|
- <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="85"/>
|
|
|
- <el-table-column align="left" label="保养工时" prop="保养工时" width="85"/>
|
|
|
- <el-table-column align="left" label="打样总工时" prop="打样总工时" width="85"/>
|
|
|
- <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="85"/>
|
|
|
- <el-table-column align="left" label="异常总工时" prop="异常总工时" width="85"/>
|
|
|
- <el-table-column align="left" label="异常补时" prop="异常补时" width="85"/>
|
|
|
- <el-table-column align="left" label="运行工时" prop="运行工时" width="85"/>
|
|
|
- <el-table-column align="left" label="小时产能" prop="工序计划辅助工时" width="170"/>
|
|
|
- <el-table-column align="left" label="最高限速" prop="装版实际工时" width="170"/>
|
|
|
- <el-table-column align="left" label="理论生产效率" prop="保养工时" width="170"/>
|
|
|
- <el-table-column align="left" label="难度系数" prop="打样工时" width="170"/>
|
|
|
- <el-table-column align="left" label="版距" prop="版距" width="170"/>
|
|
|
+ <el-table-column align="left" label="目标产量" prop="目标产量" width="90"/>
|
|
|
+ <el-table-column align="left" label="负荷产量" prop="负荷产量" width="90"/>
|
|
|
+ <el-table-column align="left" label="目标达成" prop="目标达成" width="90"/>
|
|
|
+ <el-table-column align="left" label="综合利用率" prop="综合利用率" width="100"/>
|
|
|
+ <el-table-column align="left" label="装版实际工时" prop="装版实际工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="装版补产工时" prop="装版补产工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="打样总工时" prop="打样总工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="打样补产工时" prop="打样补产工时" width="110"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="异常补时" prop="异常补时" width="100"/>
|
|
|
+ <el-table-column align="left" label="运行工时" prop="运行工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="小时产能" prop="小时产能" width="100"/>
|
|
|
+ <el-table-column align="left" label="最高限速" prop="最高限速" width="100"/>
|
|
|
+ <el-table-column align="left" label="理论生产效率" prop="理论生产效率" width="110"/>
|
|
|
+ <el-table-column align="left" label="难度系数" prop="难度系数" width="100"/>
|
|
|
+ <el-table-column align="left" label="版距" prop="版距" width="100"/>
|
|
|
</el-table>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
+ <!-- 按时段导出弹窗 -->
|
|
|
+ <el-dialog v-model="onrqexcel" title="达成率明细导出" destroy-on-close style="height: 30%;width: 20%;">
|
|
|
+
|
|
|
+ <el-form-item label="部门" label-width="100px">
|
|
|
+ <el-select v-model="excelbm" placeholder="选择部门">
|
|
|
+ <el-option
|
|
|
+ v-for="item in bmoptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="选择年月" label-width="100px">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="excelrq"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :default-value="new Date()"
|
|
|
+ @change="onchange_data"
|
|
|
+ style="width: 200px;"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="text-align: right;">
|
|
|
+ <el-button @click="rqexcelcloseDialog">取消</el-button>
|
|
|
+ <el-button type="primary" @click="rqexcelonDialog">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -173,11 +206,12 @@
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
- import {PARLeftmenu,PARlist,PARDetail,PARlistpro,PARDetailpro} from "@/api/mes/job.js"
|
|
|
+ import {PARLeftmenu,PARlist,PARDetail,PARlistpro,PARDetailpro,PARDateExcel} from "@/api/mes/job.js"
|
|
|
import {ref, reactive} from 'vue'
|
|
|
import * as XLSX from 'xlsx'
|
|
|
import { exportExcelFile } from '@/utils/excel'
|
|
|
import {ElMessage} from "element-plus";
|
|
|
+import { start } from 'nprogress';
|
|
|
defineOptions({name: 'Company'})
|
|
|
|
|
|
const treeData = ref([]);
|
|
|
@@ -316,7 +350,7 @@ const pchzRowClick = async (row) => {
|
|
|
// 排产表格行点击事件处理
|
|
|
const sbhzRowClick = async (row) => {
|
|
|
console.log('行点击:', row)
|
|
|
- const response = await PARDetailpro({jtbh:row.机台编号,bz:row.班组})
|
|
|
+ const response = await PARDetailpro({jtbh:row.机台编号,bz:row.班组,rq:row.sczl_rq})
|
|
|
if (response?.code === 0 && Array.isArray(response.data)) {
|
|
|
sbmxtableData.value = response.data;
|
|
|
console.log('表格数据更新成功:', response.data);
|
|
|
@@ -401,10 +435,101 @@ const hzToExcel = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const onrqexcel = ref(false);
|
|
|
+const excelbm = ref(''); // 部门
|
|
|
+const excelrq = ref([]); // 初始化为数组,用于存储日期范围
|
|
|
+const bmoptions = ref([]); // 部门下拉选项
|
|
|
|
|
|
-
|
|
|
+// 打开导出弹窗时
|
|
|
+const rqToExcel = async () => {
|
|
|
+ //动态加载部门数据
|
|
|
+ if (treeData.value[0]?.children) {
|
|
|
+ bmoptions.value = treeData.value[0].children.map(item => ({
|
|
|
+ label: item.label,
|
|
|
+ value: item.label,
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ onrqexcel.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const onchange_data = (val) => {
|
|
|
+ if (val && val.length === 2) {
|
|
|
+ // 格式化单个日期为 "YYYY-MM-DD"
|
|
|
+ const formatDate = (date) => {
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
+ const day = String(date.getDate()).padStart(2, '0'); // 获取日,并补零
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
+ };
|
|
|
|
|
|
+ // 分别格式化开始日期和结束日期
|
|
|
+ excelrq.value = [formatDate(val[0]), formatDate(val[1])];
|
|
|
+ } else {
|
|
|
+ excelrq.value = []; // 清空选择
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 确定导出
|
|
|
+const rqexcelonDialog = async () => {
|
|
|
+ if (excelrq.value.length !== 2) {
|
|
|
+ ElMessage.warning('请选择完整的日期范围');
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+ try {
|
|
|
+ // 获取数据
|
|
|
+ const response = await PARDateExcel({
|
|
|
+ start_rq: excelrq.value[0],
|
|
|
+ end_rq: excelrq.value[1],
|
|
|
+ bm: excelbm.value
|
|
|
+ });
|
|
|
+
|
|
|
+ const data = response.data; // 假设返回的是数组格式的数据
|
|
|
+
|
|
|
+ // 1. 准备表头
|
|
|
+ const headers = Object.keys(data[0] || {});
|
|
|
+
|
|
|
+ // 2. 准备工作表数据(包含表头和数据行)
|
|
|
+ const wsData = [
|
|
|
+ headers, // 表头行
|
|
|
+ ...data.map(row => headers.map(key => row[key])) // 数据行
|
|
|
+ ];
|
|
|
+
|
|
|
+ // 3. 创建工作表
|
|
|
+ const worksheet = XLSX.utils.aoa_to_sheet(wsData);
|
|
|
+
|
|
|
+ // 4. 数字类型转换(从第5列开始,索引4)
|
|
|
+ const range = XLSX.utils.decode_range(worksheet['!ref']);
|
|
|
+ for (let col = 4; col <= range.e.c; col++) {
|
|
|
+ for (let row = range.s.r + 1; row <= range.e.r; row++) {
|
|
|
+ const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
|
|
|
+ if (worksheet[cellAddress]) {
|
|
|
+ const cellValue = worksheet[cellAddress].v;
|
|
|
+ const numValue = Number(cellValue);
|
|
|
+ if (!isNaN(numValue)) {
|
|
|
+ worksheet[cellAddress].t = 'n';
|
|
|
+ worksheet[cellAddress].v = numValue;
|
|
|
+ worksheet[cellAddress].z = '0';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 5. 创建并导出工作簿
|
|
|
+ const wb = XLSX.utils.book_new();
|
|
|
+ XLSX.utils.book_append_sheet(wb, worksheet, 'Sheet1');
|
|
|
+ XLSX.writeFile(wb, '生产效率统计按时段明细导出.xlsx');
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出失败:', error);
|
|
|
+ ElMessage.error('导出数据失败,请重试');
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 关闭弹窗
|
|
|
+const rqexcelcloseDialog = () => {
|
|
|
+ onrqexcel.value = false;
|
|
|
+};
|
|
|
|
|
|
|
|
|
|