From bb40eba5dd2ec75a6fa2cd2c8eb41d769c092fca Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期五, 05 十二月 2025 09:33:40 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI

---
 src/views/gyMaterial/GyMaterial.vue |  147 +++++++++++++++++++++---------------------------
 1 files changed, 64 insertions(+), 83 deletions(-)

diff --git a/src/views/gyMaterial/GyMaterial.vue b/src/views/gyMaterial/GyMaterial.vue
index ae7d9d9..3b24fb6 100644
--- a/src/views/gyMaterial/GyMaterial.vue
+++ b/src/views/gyMaterial/GyMaterial.vue
@@ -1,5 +1,5 @@
 <template>
-  <div style="padding: 10px; position: relative;">
+  <div style="padding: 10px">
     <el-card style="margin-bottom: 10px;">
       <el-form :inline="true" :model="queryParams" ref="queryForm" class="mb8">
         <el-form-item label="鐗╂枡浠g爜" prop="HNumber">
@@ -50,11 +50,11 @@
             placeholder="璇疯緭鍏ョ墿鏂欎唬鐮�"
             style="width: 160px"
           />
-          <el-button type="primary" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
+          <el-button type="primary" size="mini" @click="handleResCnz" style="margin-left: 10px">閲嶆柊鍚屾</el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" icon="el-icon-search" @click="handleQuery">鎼滅储</el-button>
-          <el-button @click="resetQuery">閲嶇疆</el-button>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+          <el-button size="mini" @click="resetQuery">閲嶇疆</el-button>
         </el-form-item>
       </el-form>
       <el-form :model="queryParams" ref="filterForm">
@@ -78,7 +78,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in visibleColumns"
                           :key="index"
@@ -93,7 +93,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="0" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in comparatorList"
                           :key="index"
@@ -120,7 +120,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="0" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in visibleColumns"
                           :key="index"
@@ -135,7 +135,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="0" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in comparatorList"
                           :key="index"
@@ -162,7 +162,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="0" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in visibleColumns"
                           :key="index"
@@ -177,7 +177,7 @@
                         placeholder="璇烽�夋嫨"
                         style="width: 100%"
                       >
-                        <el-option value="0" label=""></el-option>
+                        <!-- <el-option value="0" label=""></el-option> -->
                         <el-option
                           v-for="(item, index) in comparatorList"
                           :key="index"
@@ -208,9 +208,8 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
           >瀵煎叆</el-button
@@ -218,9 +217,8 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
+          type="primary"
           plain
-          icon="el-icon-download"
           size="mini"
           @click="handleExport"
           >瀵煎嚭</el-button
@@ -229,8 +227,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-document"
           size="mini"
           @click="handleNumAdd"
           >娴佹按鍙锋柊澧�</el-button
@@ -239,8 +235,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
           >鏂板</el-button
@@ -248,9 +242,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="success"
-          plain
-          icon="el-icon-document-copy"
           size="mini"
           :disabled="single"
           @click="handleCopy"
@@ -259,9 +250,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
           size="mini"
           :disabled="single"
           @click="handleEdit"
@@ -271,8 +259,6 @@
       <el-col :span="1.5">
         <el-button
           type="danger"
-          plain
-          icon="el-icon-delete"
           size="mini"
           :disabled="single"
           @click="handleDelete"
@@ -281,9 +267,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="success"
-          plain
-          icon="el-icon-check"
           size="mini"
           :disabled="single"
           @click="handleAudit(0)"
@@ -292,9 +275,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="success"
-          plain
-          icon="el-icon-close"
           size="mini"
           :disabled="single"
           @click="handleAudit(1)"
@@ -303,9 +283,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
-          plain
-          icon="el-icon-turn-off"
           size="mini"
           :disabled="single"
           @click="handleStop(0)"
@@ -314,9 +291,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="warning"
-          plain
-          icon="el-icon-open"
           size="mini"
           :disabled="single"
           @click="handleStop(1)"
@@ -325,9 +299,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="info"
-          plain
-          icon="el-icon-setting"
           size="mini"
           @click="handleColumnSetting"
           >鍒楄缃�</el-button
@@ -335,9 +306,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="info"
-          plain
-          icon="el-icon-s-operation"
           size="mini"
           @click="handleButtonSetting"
           >鎸夐挳璁剧疆</el-button
@@ -346,8 +314,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-folder-checked"
           size="mini"
           @click="handleSaveScheme"
           >淇濆瓨鏂规</el-button
@@ -356,8 +322,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-folder-opened"
           size="mini"
           @click="handleReadScheme"
           >璇诲彇鏂规</el-button
@@ -365,9 +329,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="info"
-          plain
-          icon="el-icon-refresh"
           size="mini"
           @click="handleRefresh"
           >鍒锋柊</el-button
@@ -375,9 +336,6 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
-          type="info"
-          plain
-          icon="el-icon-close"
           size="mini"
           @click="handleExit"
           >閫�鍑�</el-button
@@ -386,8 +344,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-edit"
           size="mini"
           @click="handleCorrect"
           >鎵规敼</el-button
@@ -396,8 +352,6 @@
       <el-col :span="1.5">
         <el-button
           type="primary"
-          plain
-          icon="el-icon-edit"
           size="mini"
           @click="handleCorrect2"
           >鎵规敼(鏂规2)</el-button
@@ -583,8 +537,8 @@
       append-to-body
     >
       <div style="margin-top: -20px">
-        <el-button type="primary" @click="handleImportSubmit">瀵煎叆鏁版嵁</el-button>
-        <el-button type="primary" @click="upload.open = false">閫� 鍑�</el-button>
+        <el-button type="primary" size="mini" @click="handleImportSubmit">瀵煎叆鏁版嵁</el-button>
+        <el-button type="primary" size="mini" @click="upload.open = false">閫� 鍑�</el-button>
         <el-upload
           ref="upload"
           :limit="1"
@@ -595,7 +549,7 @@
           :on-progress="handleFileUploadProgress"
           :on-success="handleFileSuccess"
         >
-          <el-button type="primary">鏂囦欢涓婁紶</el-button>
+          <el-button type="primary" size="mini">鏂囦欢涓婁紶</el-button>
         </el-upload>
       </div>
       <el-table
@@ -688,12 +642,12 @@
         HModel: null,
         HOrgID: null,
         HProject: null,
-        ColName: "0",
-        ColName1: "0",
-        ColName2: "0",
-        Comparator: "0",
-        Comparator1: "0",
-        Comparator2: "0",
+        ColName: "",
+        ColName1: "",
+        ColName2: "",
+        Comparator: "",
+        Comparator1: "",
+        Comparator2: "",
         ColContent: "",
         ColContent1: "",
         ColContent2: "",
@@ -759,11 +713,13 @@
         .then((response) => {
           let data = response.data.data[0];
           this.user = data.Czymc;
+          
           this.getOrganizations();
+          this.queryParams.HOrgID = data.HUSEORGID;
           this.getTreeData();
           this.getProjectOptions();
           this.getList();
-          this.getDefaultFilterScheme();
+          //this.getDefaultFilterScheme();
         })
         .catch((error) => {
           this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
@@ -776,9 +732,9 @@
         .then((response) => {
           if (response.data.count == 1) {
             this.organizationOptions = response.data.data;
-            if (this.organizationOptions.length > 0) {
-              this.queryParams.HOrgID = this.organizationOptions[0].ID;
-            }
+            // if (this.organizationOptions.length > 0) {
+            //   this.queryParams.HOrgID = this.organizationOptions[0].ID;
+            // }
           }
         })
         .catch((error) => {
@@ -1174,6 +1130,14 @@
     },
     
     handleRefresh() {
+      // 鍒锋柊鏃舵竻闄よ〃鏍奸�夋嫨骞堕噸缃浉鍏崇姸鎬侊紝淇濊瘉澶嶅埗/缂栬緫/鍒犻櫎/瀹℃牳绛夋寜閽绂佺敤
+      if (this.$refs.tableData && this.$refs.tableData.clearSelection) {
+        this.$refs.tableData.clearSelection();
+      }
+      this.selectedRow = null;
+      this.ids = [];
+      this.single = true;
+      this.multiple = true;
       this.getList();
     },
     
@@ -1190,7 +1154,7 @@
     },
     
     // 鐗╂枡浠g爜鐐瑰嚮
-     handleMaterialCodeClick(row) {
+    handleMaterialCodeClick(row) {
     this.selectedRow = row;
     this.OperationType = 3;
     this.currentEditId = row.HItemID;
@@ -1201,12 +1165,16 @@
     
 
     handleRowClick(row, column, event) {
+        if(this.openPage){
+        this.$emit('deptEmit', row, 3)
+      }
+      if (this.checkIsIframe()) {
+        // 灏嗗綋鍓嶉�変腑鐨勬暟鎹毚闇插埌window涓�
+        window.selectedRow = row;
+      }
       this.$refs.tableData.toggleRowSelection(row);
       this.selectedRow = row;
       this.getFileList(row.鐗╂枡浠g爜);
-       if (this.openPage) {
-        this.$emit('deptEmit', row, 3)
-      }
     },
     
 
@@ -1265,28 +1233,35 @@
     
     // 琛屾牱寮�
     rowStyle({ row, rowIndex }) {
-      if (this.ids.includes(row.HItemID)) {
-        return { background: "#ecf5ff" };
+      if (this.ids.includes(row.hmainid)) {
+        return {  };
+        // background: "#ecf5ff"
       }
     },
     
     // 鍙屽嚮琛�
     handleDblclick(row, column, cell, event) {
-       if (this.openPage) {
+      if(this.openPage){
         this.$emit('deptEmitDb', row, 3)
-      } else {
-      this.handleMaterialCodeClick(row);
       }
+      if (this.checkIsIframe()) {
+        // IFrame 鍙屽嚮 杩斿洖褰撳墠鍙屽嚮鐨勬暟鎹�
+        window.parent.iFrameMaterialCallback(row);
+        return;
+      }
+      this.handleMaterialCodeClick(row);
     },
 
     handleSelectionChange(selection) {
-      console.log(selection)
-      this.ids = selection.map((item) => item.HItemID);
+      this.ids = selection.map((item) => item.hmainid);
       this.single = selection.length != 1;
       this.multiple = !selection.length;
       if (!this.single) {
         this.selectedRow = selection[0];
       }
+      //   if(this.openPage){
+      //   this.$emit('deptEmit', this.selectedRow, 3)
+      // }
     },
       // 缂栬緫鍏抽棴鍥炶皟
   handleEditClose() {
@@ -1392,7 +1367,13 @@
     
     getDefaultFilterScheme() {
       this.currentFilterScheme = "褰撳墠杩囨护鏂规锛氶粯璁ゆ柟妗�";
-    }
+    },
+    checkIsIframe() {
+      if (window.self == window.top) {
+        return false;
+      }
+      return true;
+    },
   },
 };
 </script>

--
Gitblit v1.9.1