修改bug
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 10:01:33
 | 
			
		||||
 * @LastEditTime: 2024-04-24 09:34:36
 | 
			
		||||
 * @LastEditTime: 2024-04-25 09:54:55
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -17,6 +17,12 @@
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <el-table class="baseTable" :max-height="tableH" id="exportTableChild" :data="tableDataChild" style="width: 100%">
 | 
			
		||||
      <el-table-column v-for="item in tablePropsChild" :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="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
@@ -42,6 +48,37 @@ import {
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
const tablePropsChild = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '人工堆垛人员'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
]
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  // {
 | 
			
		||||
@@ -121,8 +158,10 @@ export default {
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      tablePropsChild,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableDataChild:[],
 | 
			
		||||
      mergeArr: [],//记录合并行数
 | 
			
		||||
      pos: 0,
 | 
			
		||||
      listQuery: {
 | 
			
		||||
@@ -295,7 +334,35 @@ export default {
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTableChild"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "原片各线堆垛表.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user