Browse Source

大废品奖惩 统计 表格宽度优化

zck 1 year ago
parent
commit
815b51b929
2 changed files with 49 additions and 49 deletions
  1. 2 2
      src/view/DecisionSupport/Processwaste.vue
  2. 47 47
      src/view/job/rewards/rewards.vue

+ 2 - 2
src/view/DecisionSupport/Processwaste.vue

@@ -2,7 +2,7 @@
   <div>
     <el-container>
       <el-aside width="200px">
-        <div class="JKWTree-tree">
+        <div class="JKWTree-tree" style="height: 70vh;width:100vh" >
           <h3>工序大废品统计</h3>
           <el-tree :data="treeData" :props="defaultProps" node-key="id" @node-click="handleNodeClick"></el-tree>
         </div>
@@ -15,7 +15,7 @@
 			  :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
 			  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
 			  border :show-overflow-tooltip="true" :cell-class-name="planUsageCellClass"
-			  style="width: 100%;height: 65vh" ref="tablesczl_gxmc"
+			  style="width: 100%;height: 72vh" ref="tablesczl_gxmc"
 			  @row-dblclick="gyscbzSelectClick">
 			  <el-table-column align="left"  label="所在部门" 	width="100"	prop="所在部门" />
 			  <el-table-column align="left"  label="员工编号" 	width="100"	prop="员工编号" />

+ 47 - 47
src/view/job/rewards/rewards.vue

@@ -45,8 +45,8 @@
 							<el-table-column align="left" label="奖励班组" prop="Jl_bzdh" width="110" sortable />
 							<el-table-column align="left" label="检验员工" prop="JL_bh1" width="110" sortable />
 							<el-table-column align="left" label="责任班组" prop="sczl_bzdh" width="120" sortable />
-							<el-table-column align="left" label="责任员工1" prop="sczl_bh1" width="120" sortable />
-							<el-table-column align="left" label="责任员工2" prop="sczl_bh2" width="120" sortable />
+							<el-table-column align="left" label="责任员工1" prop="sczl_bh1" width="130" sortable />
+							<el-table-column align="left" label="责任员工2" prop="sczl_bh2" width="130" sortable />
 							<el-table-column align="left" label="创建用户" prop="sys_id" width="120" sortable />
 							<el-table-column align="left" label="创建时间" prop="sys_rq" width="160" sortable />
 							<el-table-column align="left" label="UNIQID" prop="UniqId" width="90" />
@@ -1497,51 +1497,51 @@ import LuckyExcel from 'luckyexcel';
 	}
 
   //导出到Excel按钮
-    const jcToExcel = () => {
-    const el = document.getElementById('Exceltable');
-        if (!el) {
-            console.error('Table element not found!');
-            return;
-        }
-    const filename = '工序大废品.xlsx';
-    const wb = XLSX.utils.table_to_book(el, { raw: true });
-    const ws = wb.Sheets[wb.SheetNames[0]]; // 获取第一个工作表
-
-    // 获取工作表的范围
-    const range = XLSX.utils.decode_range(ws['!ref']);
-
-    // 遍历每一行(从第二行开始)
-    for (let R = range.s.r + 1; R <= range.e.r + 1; ++R) {
-    // 直接通过单元格地址访问F列和H列的单元格
-    const cellF = ws[`F${R}`];
-    const cellH = ws[`H${R}`];
-
-    // 检查F列的单元格是否存在且其值是字符串类型
-    if (cellF && typeof cellF.v === 'string') {
-        const numF = Number(cellF.v);
-        if (!isNaN(numF)) {
-            // 修改单元格类型为数字,并更新值
-            cellF.t = 'n';
-            cellF.v = numF;
-        }
-    }
-    // 检查H列的单元格是否存在且其值是字符串类型
-    if (cellH && typeof cellH.v === 'string') {
-        console.log(`H${R}: ${cellH.v}, Type before: ${cellH.t}`);
-        const numH = Number(cellH.v);
-        if (!isNaN(numH)) {
-            // 修改单元格类型为数字,并更新值
-            cellH.t = 'n';
-            cellH.v = numH;
-        }
-    }
-    }
-    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.error('Error saving file:', e);
-    }
+    const jcToExcel = () => {
+    const el = document.getElementById('Exceltable');
+        if (!el) {
+            console.error('Table element not found!');
+            return;
+        }
+    const filename = '工序大废品.xlsx';
+    const wb = XLSX.utils.table_to_book(el, { raw: true });
+    const ws = wb.Sheets[wb.SheetNames[0]]; // 获取第一个工作表
+
+    // 获取工作表的范围
+    const range = XLSX.utils.decode_range(ws['!ref']);
+
+    // 遍历每一行(从第二行开始)
+    for (let R = range.s.r + 1; R <= range.e.r + 1; ++R) {
+    // 直接通过单元格地址访问F列和H列的单元格
+    const cellF = ws[`F${R}`];
+    const cellH = ws[`H${R}`];
+
+    // 检查F列的单元格是否存在且其值是字符串类型
+    if (cellF && typeof cellF.v === 'string') {
+        const numF = Number(cellF.v);
+        if (!isNaN(numF)) {
+            // 修改单元格类型为数字,并更新值
+            cellF.t = 'n';
+            cellF.v = numF;
+        }
+    }
+    // 检查H列的单元格是否存在且其值是字符串类型
+    if (cellH && typeof cellH.v === 'string') {
+        console.log(`H${R}: ${cellH.v}, Type before: ${cellH.t}`);
+        const numH = Number(cellH.v);
+        if (!isNaN(numH)) {
+            // 修改单元格类型为数字,并更新值
+            cellH.t = 'n';
+            cellH.v = numH;
+        }
+    }
+    }
+    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.error('Error saving file:', e);
+    }
     };
 
 	//日报表上传