Browse Source

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

liuhairui 1 year ago
parent
commit
d27b39eac1

+ 1 - 0
src/view/performance/09-workOrderVerification/index.vue

@@ -975,6 +975,7 @@ const gd_lcdCancel = async () => {
 			});
 			// dialogFormVisible.value = false
 		}
+		detailData.qczl_fp = 0
 	};
 	// 修改
 	const updateDetailData = async () => {

+ 44 - 20
src/view/performance/Dayreports.vue

@@ -3240,27 +3240,51 @@ const GetInfo = async (value) => {
     console.log(formData);
   }
 };
-const exportToExcel2 = () => {
-
-    const el = document.getElementById("tab");
-    // 文件名
-    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);
+
+    const exportToExcel2 = () => {
+  const el = document.getElementById("tab");
+
+        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) {
+    // 定义要处理的列的起始和结束字符
+    const startCol = 'G'.charCodeAt(0); // G 的 ASCII 码
+    const endCol = 'Q'.charCodeAt(0);   // Q 的 ASCII 码
+ 
+    // 遍历从 G 到 Q 的每一列
+    for (let colCode = startCol; colCode <= endCol; ++colCode) {
+        // 将 ASCII 码转换回列字母
+        const colLetter = String.fromCharCode(colCode);
+        const cell = ws[`${colLetter}${R}`];
+ 
+        // 检查单元格是否存在且其值是字符串类型
+        if (cell && typeof cell.v === 'string') {
+            const num = Number(cell.v);
+            if (!isNaN(num)) {
+                // 修改单元格类型为数字,并更新值
+                cell.t = 'n';
+                cell.v = num;
+            }
+        }
     }
-    return wbout;
-};
+}
+    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);
+    }
+    };
 // 导出excel
 // function exportExcel() {
 // 	Execelport()

+ 2 - 2
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -473,8 +473,8 @@
       </layout-header>
       <layout>
         <!-- 左侧树形结构 -->
-        <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
-          <div class="JKWTree-tree" style="height: 200px">
+        <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px">
+          <div class="JKWTree-tree" style="height: 200px;width:100vh">
             <h3>工单管理</h3>
             <el-tree :data="treeData.data" class="treecolor"   @node-click="handleNodeClick"></el-tree>
           </div>