|
@@ -6,7 +6,7 @@
|
|
|
<!-- 按钮部分-->
|
|
<!-- 按钮部分-->
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Download" @click="ExportSummaryToExcel" style="margin: 5px">导出到Excel(汇总)</el-button>
|
|
<el-button type="primary" icon="Download" @click="ExportSummaryToExcel" style="margin: 5px">导出到Excel(汇总)</el-button>
|
|
|
- <!-- <el-button type="primary" icon="Download" @click="ExportDetailsToExcel" class="bt" >导出到Excel(明细)</el-button> -->
|
|
|
|
|
|
|
+ <el-button type="primary" icon="Download" @click="ExportDetailsToExcel" class="bt" >导出到Excel(明细)</el-button>
|
|
|
<!-- <el-button disabled type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">导出到Excel(色张汇总)</el-button> -->
|
|
<!-- <el-button disabled type="primary" icon="Download" @click="exportToExcel2" style="margin: 5px;float: right;">导出到Excel(色张汇总)</el-button> -->
|
|
|
<!-- <el-button type="primary" icon="edit" @click="gd_gxclhconClick" class="bt" >月度色度数核查</el-button> -->
|
|
<!-- <el-button type="primary" icon="edit" @click="gd_gxclhconClick" class="bt" >月度色度数核查</el-button> -->
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -28,7 +28,49 @@
|
|
|
|
|
|
|
|
<el-main>
|
|
<el-main>
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
|
|
+ <el-tab-pane label="直方图" @click="showTable('直方图')" name="first">
|
|
|
<div ref="chart" style="width: 100%; height: 35vh;margin-left: -100px;"></div>
|
|
<div ref="chart" style="width: 100%; height: 35vh;margin-left: -100px;"></div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="数据透视图" @click="showTable('数据透视图')" name="second">
|
|
|
|
|
+ <el-table ref="multipleTable"
|
|
|
|
|
+ highlight-current-row="true"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
|
|
+ @row-dblclick="ybupdateCompanyFunc"
|
|
|
|
|
+ @row-click="ybClick"
|
|
|
|
|
+ style="width: 100%;height: 35vh" border tooltip-effect="dark" :data="gxtjData" row-key="ID" @selection-change="handleSelectionChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column type="selection" width="30" />
|
|
|
|
|
+ <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="110"/>
|
|
|
|
|
+ <el-table-column align="left" label="工序名称" prop="工序名称" width="440"/>
|
|
|
|
|
+ <el-table-column align="left" label="班组编号" prop="班组编号" width="110"/>
|
|
|
|
|
+ <el-table-column align="left" label="班组实际产量" prop="班组产量" width="120" />
|
|
|
|
|
+ <el-table-column align="left" label="班组制程废品" prop="班组制程废品" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="班组质检废品" prop="班组质检废品" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="联数" prop="联数" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="印刷方式" prop="印刷方式" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="版距" prop="版距" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="工序类型" prop="type_name" width="160" />
|
|
|
|
|
+ <el-table-column align="left" label="完工年月" prop="完工年月" width="160" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
|
+ <div class="gva-pagination">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ :current-page="page"
|
|
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="total">
|
|
|
|
|
+ </el-pagination>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
</el-tabs>
|
|
|
<div class="gva-table-box">
|
|
<div class="gva-table-box">
|
|
|
<!-- 表格数据 -->
|
|
<!-- 表格数据 -->
|
|
@@ -56,13 +98,7 @@
|
|
|
<el-table-column align="left" label="12月" prop="12月" width="100" />
|
|
<el-table-column align="left" label="12月" prop="12月" width="100" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
- <!-- 分页 -->
|
|
|
|
|
- <div class="gva-pagination">
|
|
|
|
|
- <el-pagination layout="total" :current-page="page" :page-size="pageSize"
|
|
|
|
|
- :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />
|
|
|
|
|
- <!-- <el-pagination layout="total, sizes, prev, pager, next, jumper" :current-page="page" :page-size="pageSize" :page-sizes="[10, 30, 50, 100]"-->
|
|
|
|
|
- <!-- :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" />-->
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
@@ -96,12 +132,31 @@
|
|
|
import * as XLSX from 'xlsx';
|
|
import * as XLSX from 'xlsx';
|
|
|
import FileSaver from 'file-saver';
|
|
import FileSaver from 'file-saver';
|
|
|
import {ref, reactive,watchEffect} from 'vue';
|
|
import {ref, reactive,watchEffect} from 'vue';
|
|
|
- import {GetYear,ProcessOutputRate} from '@/api/mes/job'
|
|
|
|
|
|
|
+ import {GetYear,ProcessOutputRate,PoductData} from '@/api/mes/job'
|
|
|
import {getCustom, getDepartment, getProductData,getStaffInfo, getStaffList, ygjbzledit,clockUpdate} from '@/api/yunyin/yunying';
|
|
import {getCustom, getDepartment, getProductData,getStaffInfo, getStaffList, ygjbzledit,clockUpdate} from '@/api/yunyin/yunying';
|
|
|
import {ElMessage} from "element-plus";
|
|
import {ElMessage} from "element-plus";
|
|
|
defineOptions({name: 'Company'})
|
|
defineOptions({name: 'Company'})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ // =========== 分页 ===========
|
|
|
|
|
+// 分页相关的响应式变量
|
|
|
|
|
+const page = ref(1)
|
|
|
|
|
+const total = ref(0)
|
|
|
|
|
+const pageSize = ref(50)
|
|
|
|
|
+// 分页
|
|
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
|
|
+ page.value = val;
|
|
|
|
|
+ getPoductData();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 修改页面容量 点击多少条/页
|
|
|
|
|
+const handleSizeChange = (val) => {
|
|
|
|
|
+ page.value = 1;//默认显示
|
|
|
|
|
+ pageSize.value = val;
|
|
|
|
|
+ getPoductData();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//=========工单打印===========
|
|
//=========工单打印===========
|
|
|
const printPageRef = ref()
|
|
const printPageRef = ref()
|
|
|
const cp_gdprintonClick = () => {
|
|
const cp_gdprintonClick = () => {
|
|
@@ -109,39 +164,12 @@ const cp_gdprintonClick = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- // =========== 导出Excel表格 ===========
|
|
|
|
|
- const exportToExcel = () => {
|
|
|
|
|
- console.log('点击了导出按钮')
|
|
|
|
|
- }
|
|
|
|
|
- const ExportSummaryToExcel = ()=>{
|
|
|
|
|
- const el = document.getElementById('Summarytable');
|
|
|
|
|
- // 文件名
|
|
|
|
|
- const filename = '导出到EXCEL(汇总).xlsx';
|
|
|
|
|
- const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
|
|
- const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
|
|
- try {
|
|
|
|
|
- FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.log(e);
|
|
|
|
|
- }
|
|
|
|
|
- return wbout;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const ExportDetailsToExcel = ()=>{
|
|
|
|
|
- const el = document.getElementById('Detailstable');
|
|
|
|
|
- // 文件名
|
|
|
|
|
- const filename = '导出到EXCEL(明细).xlsx';
|
|
|
|
|
- const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
|
|
- const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
|
|
- try {
|
|
|
|
|
- FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.log(e);
|
|
|
|
|
- }
|
|
|
|
|
- return wbout;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//=========工序产量核查===========
|
|
//=========工序产量核查===========
|
|
|
|
|
|
|
|
|
|
|
|
@@ -194,13 +222,23 @@ getDepartmentdata();
|
|
|
|
|
|
|
|
//点击左侧树形 获取右侧table列表
|
|
//点击左侧树形 获取右侧table列表
|
|
|
const tableData = reactive([]);
|
|
const tableData = reactive([]);
|
|
|
|
|
+ const gxtjData = reactive([]);
|
|
|
|
|
+ const nodedata = ref()
|
|
|
|
|
+ const getPoductData = async () => {
|
|
|
|
|
+ const PoductDatadata = await PoductData({ year: nodedata.value,page:page.value, limit:pageSize.value });
|
|
|
|
|
+ console.log(PoductDatadata);
|
|
|
|
|
+ gxtjData.splice(0, gxtjData.length,...PoductDatadata.data.data);
|
|
|
|
|
+ total.value = PoductDatadata.total;
|
|
|
|
|
+ }
|
|
|
// 点击树节点时的处理函数
|
|
// 点击树节点时的处理函数
|
|
|
const handleNodeClick = async (data) => {
|
|
const handleNodeClick = async (data) => {
|
|
|
|
|
+ nodedata.value = data.label;
|
|
|
// 获取数据
|
|
// 获取数据
|
|
|
- const ProcessOutputRatedata = await ProcessOutputRate({ year: data.label });
|
|
|
|
|
|
|
+ const ProcessOutputRatedata = await ProcessOutputRate({ year: nodedata.value });
|
|
|
tableData.splice(0, tableData.length, ...ProcessOutputRatedata.data);
|
|
tableData.splice(0, tableData.length, ...ProcessOutputRatedata.data);
|
|
|
console.log(ProcessOutputRatedata);
|
|
console.log(ProcessOutputRatedata);
|
|
|
|
|
|
|
|
|
|
+ getPoductData();
|
|
|
// 初始化柱状图
|
|
// 初始化柱状图
|
|
|
if (!mCharts && chart.value) {
|
|
if (!mCharts && chart.value) {
|
|
|
mCharts = echarts.init(chart.value);
|
|
mCharts = echarts.init(chart.value);
|
|
@@ -295,6 +333,86 @@ const tableRowClick = async (row) => {
|
|
|
_getStaffList();
|
|
_getStaffList();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ // =========== 导出Excel表格 ===========
|
|
|
|
|
+ const exportToExcel = () => {
|
|
|
|
|
+ console.log('点击了导出按钮')
|
|
|
|
|
+ }
|
|
|
|
|
+ const ExportSummaryToExcel = ()=>{
|
|
|
|
|
+ const el = document.getElementById('Summarytable');
|
|
|
|
|
+ // 文件名
|
|
|
|
|
+ const filename = '导出到EXCEL(汇总).xlsx';
|
|
|
|
|
+ const wb = XLSX.utils.table_to_book(el, { raw: true });
|
|
|
|
|
+ const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
|
|
|
|
|
+ try {
|
|
|
|
|
+ FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), filename);
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ return wbout;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const ExportDetailsToExcel = async () => {
|
|
|
|
|
+ // 检查是否选择了年份
|
|
|
|
|
+ if(nodedata.value === null || nodedata.value === '' || nodedata.value === undefined){
|
|
|
|
|
+ ElMessage({type: 'warning',message: '请选择具体的年份,在进行操作'})
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 获取产品数据
|
|
|
|
|
+ const PoductDatadata = await PoductData({ year: nodedata.value });
|
|
|
|
|
+
|
|
|
|
|
+ // 验证数据是否存在
|
|
|
|
|
+ if (!PoductDatadata || !PoductDatadata.data || !PoductDatadata.data.data) {
|
|
|
|
|
+ console.error('没有数据可以导出');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const data = PoductDatadata.data.data;
|
|
|
|
|
+
|
|
|
|
|
+ // 定义Excel表格列配置
|
|
|
|
|
+ const columns = [
|
|
|
|
|
+ { key: '机台编号', label: '机台编号', width: 100 },
|
|
|
|
|
+ { key: '工单编号', label: '工单编号', width: 100 },
|
|
|
|
|
+ { key: '工序号', label: '印件号', width: 100 },
|
|
|
|
|
+ { key: '工序', label: '工序号', width: 100 },
|
|
|
|
|
+ { key: '工序名称', label: '工序名称', width: 440 },
|
|
|
|
|
+ { key: '班组编号', label: '班组编号', width: 100 },
|
|
|
|
|
+ { key: '班组产量', label: '班组实际产量', width: 120 },
|
|
|
|
|
+ { key: '班组制程废品', label: '班组制程废品', width: 120 },
|
|
|
|
|
+ { key: '班组质检废品', label: '班组质检废品', width: 120 },
|
|
|
|
|
+ { key: '联数', label: '联数', width: 100 },
|
|
|
|
|
+ { key: '印刷方式', label: '印刷方式', width: 100 },
|
|
|
|
|
+ { key: '版距', label: '版距', width: 100 },
|
|
|
|
|
+ { key: '工序类型', label: '工序类型', width: 100 },
|
|
|
|
|
+ { key: '完工年月', label: '完工年月', width: 100 }
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 准备工作表数据
|
|
|
|
|
+ const wsData = [
|
|
|
|
|
+ columns.map(col => col.label), // 表头行
|
|
|
|
|
+ ...data.map(item => columns.map(col => item[col.key] || '')) // 数据行
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 创建新的工作簿
|
|
|
|
|
+ const wb = XLSX.utils.book_new();
|
|
|
|
|
+ // 将数据转换为工作表
|
|
|
|
|
+ const ws = XLSX.utils.aoa_to_sheet(wsData);
|
|
|
|
|
+
|
|
|
|
|
+ // 设置列宽(将像素宽度转换为Excel字符宽度)
|
|
|
|
|
+ ws['!cols'] = columns.map(col => ({ width: col.width / 7 }));
|
|
|
|
|
+
|
|
|
|
|
+ // 将工作表添加到工作簿
|
|
|
|
|
+ XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
|
|
|
|
+
|
|
|
|
|
+ // 生成并下载Excel文件
|
|
|
|
|
+ const filename = '导出到EXCEL(明细).xlsx';
|
|
|
|
|
+ XLSX.writeFile(wb, filename);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出过程中出错:', e);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
//获取右侧表格列表
|
|
//获取右侧表格列表
|
|
|
const _getStaffList = async ()=>{
|
|
const _getStaffList = async ()=>{
|
|
@@ -316,22 +434,6 @@ const tableRowClick = async (row) => {
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 分页相关的响应式变量
|
|
|
|
|
- const page = ref(1)
|
|
|
|
|
- const total = ref(0)
|
|
|
|
|
- const pageSize = ref(10)
|
|
|
|
|
- // 分页
|
|
|
|
|
- const handleCurrentChange = (val) => {
|
|
|
|
|
- page.value = val;
|
|
|
|
|
- _getStaffList();
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 修改页面容量 点击多少条/页
|
|
|
|
|
- const handleSizeChange = (val) => {
|
|
|
|
|
- page.value = 50;//默认显示
|
|
|
|
|
- pageSize.value = val;
|
|
|
|
|
- _getStaffList();
|
|
|
|
|
- };
|
|
|
|
|
|
|
|
|
|
// 弹窗控制标记
|
|
// 弹窗控制标记
|
|
|
const dialogFormVisible = ref(false)
|
|
const dialogFormVisible = ref(false)
|