|
|
@@ -699,25 +699,10 @@
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="技术资料附件" @click="showTable('技术资料附件')" name="fourth">
|
|
|
- <el-table ref="multipleTable"
|
|
|
- :row-style="{ height: '20px' }"
|
|
|
- :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :header-cell-style="{ padding: '0px' }"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- highlight-current-row="true"
|
|
|
- style="width: 100%;height: 40vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
- <!-- <el-table-column type="selection" width="55" />-->
|
|
|
- <el-table-column align="left" label="序号" prop="序号" width="120"/>
|
|
|
- <el-table-column align="left" label="适用工序" prop="适用工序" width="120" />
|
|
|
- <el-table-column align="left" label="备注" prop="备注" width="120" />
|
|
|
- <el-table-column align="left" label="文件类型" prop="文件类型" width="120"/>
|
|
|
- <el-table-column align="left" label="关联产品" prop="关联产品" width="360"/>
|
|
|
- <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>
|
|
|
- </el-tab-pane>
|
|
|
-
|
|
|
+ <div id="luckyexcel" style="width: 100%;height: 40vh;"></div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-button type="primary" class="bt" @click="ExcelShow()" >Excel</el-button>
|
|
|
+
|
|
|
</el-tabs>
|
|
|
|
|
|
<!-- 修改产品产品基本资料表格弹窗 -->
|
|
|
@@ -1471,14 +1456,20 @@ export default {
|
|
|
</script>
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
+import $script from 'scriptjs'
|
|
|
+import $ from 'jquery';
|
|
|
+import LuckyExcel from 'luckyexcel';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
//拖拽 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
-import { ref, reactive } from 'vue'
|
|
|
+import { ref, reactive, nextTick, } from 'vue'
|
|
|
import {
|
|
|
DataList,editGyName, editGyNo, editProduct,editProductYjInfo,getProductGyInfo,
|
|
|
getCustom,getDepartment,getProduct,editGy,getProductData,getProductYjInfo,
|
|
|
- getProductGy,editGyWaste,editGyMs,getStaffList,setProductStatus,getProductYjList,getProductZzList,addProductYjInfo,getDepartName,getProcess,getProcessLoss,addProductGyInfo} from "@/api/yunyin/yunying";
|
|
|
+ getProductGy,editGyWaste,editGyMs,getStaffList,setProductStatus,getProductYjList,
|
|
|
+ getProductZzList,addProductYjInfo,getDepartName,getProcess,getProcessLoss,
|
|
|
+ addProductGyInfo,getExcelInfo
|
|
|
+ } from "@/api/yunyin/yunying";
|
|
|
defineOptions({ name: 'Company'})
|
|
|
|
|
|
// =========== 导出Excel表格 ===========
|
|
|
@@ -2179,7 +2170,8 @@ const tableRowClick = async (row) => {
|
|
|
const res = await getProductData({product_code:_product_code.value});
|
|
|
yjtableData.splice(0, yjtableData.length, ...res.data.yjData);
|
|
|
gytableData.splice(0, gytableData.length, ...res.data.gyData);
|
|
|
- ybtableData.splice(0, ybtableData.length, ...res.data.ybData);
|
|
|
+ ybtableData.splice(0, ybtableData.length, ...res.data.ybData);
|
|
|
+ ExcelShow()
|
|
|
if(yjtableData.length==0)
|
|
|
{
|
|
|
yjzuidahaoma.value = 1
|
|
|
@@ -2841,6 +2833,83 @@ const tableDataCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
if (column.property === 'gyData' || column.property === 'yjData') {
|
|
|
return 'plan-usage-low';
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+//技术资料excel展示
|
|
|
+const ExcelShow = () =>{
|
|
|
+ $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
+ $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
+ fetch('/luckysheet/黄金叶(软大金圆)(二维码版).xlsx')
|
|
|
+ .then(response => response.blob())
|
|
|
+ .then(blob => {
|
|
|
+
|
|
|
+ const file = new File([blob], 'filename.xlsx', { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
+ createROLuckyExcel(file);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ })
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+let luckyExcel = null
|
|
|
+/**
|
|
|
+ * 只读版luckyExcel 创建
|
|
|
+ */
|
|
|
+const createROLuckyExcel = (files) => {
|
|
|
+ LuckyExcel.transformExcelToLucky(files, function (exportJson, luckysheetfile) {
|
|
|
+ console.log("transformExcelToLucky", files, exportJson)
|
|
|
+ if (exportJson.sheets == null || exportJson.sheets.length == 0) {
|
|
|
+ alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(luckyExcel) luckyExcel.destroy();
|
|
|
+ nextTick(() => {
|
|
|
+ $(function () {
|
|
|
+ luckysheet.create({
|
|
|
+ container: 'luckyexcel', //容器的ID
|
|
|
+ data: exportJson.sheets,
|
|
|
+ title: exportJson.info.name, // 工作簿名称
|
|
|
+ lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
+ // allowCopy: false, // 是否允许拷贝
|
|
|
+ showtoolbar: false, // 是否显示工具栏
|
|
|
+ showinfobar: false, // 是否显示顶部信息栏
|
|
|
+ // showsheetbar: false, // 是否显示底部sheet页按钮
|
|
|
+ // showstatisticBar: false, // 是否显示底部计数栏
|
|
|
+ // sheetBottomConfig: false, // sheet页下方的添加行按钮和回到顶部按钮配置
|
|
|
+ allowEdit: false, // 是否允许前台编辑
|
|
|
+ enableAddRow: false, // 允许增加行
|
|
|
+ enableAddCol: false, // 允许增加列
|
|
|
+ userInfo: false, // 右上角的用户信息展示样式
|
|
|
+ showRowBar: false, // 是否显示行号区域
|
|
|
+ showColumnBar: false, // 是否显示列号区域
|
|
|
+ sheetFormulaBar: false, // 是否显示公式栏
|
|
|
+ enableAddBackTop: false,//返回头部按钮
|
|
|
+ // rowHeaderWidth: 0,//纵坐标
|
|
|
+ // columnHeaderHeight: 0,//横坐标
|
|
|
+ // showstatisticBarConfig: {
|
|
|
+ // count:false,
|
|
|
+ // view:false,
|
|
|
+ // zoom:false,
|
|
|
+ // },
|
|
|
+ // showsheetbarConfig: {
|
|
|
+ // add: false, //新增sheet
|
|
|
+ // menu: false, //sheet管理菜单
|
|
|
+ // sheet: false, //sheet页显示
|
|
|
+ // },
|
|
|
+ // hook: {
|
|
|
+ // cellMousedown:this.cellMousedown,//绑定鼠标事件
|
|
|
+ // },
|
|
|
+ // forceCalculation: true,//强制计算公式
|
|
|
+ });
|
|
|
+ luckyExcel = luckysheet;
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
<style scoped>
|