Răsfoiți Sursa

关联公共wbs模板修改

duy 1 zi în urmă
părinte
comite
8358d1c4e0
1 a modificat fișierele cu 92 adăugiri și 6 ștergeri
  1. 92 6
      src/views/exctab/ElementIdentification/index.vue

+ 92 - 6
src/views/exctab/ElementIdentification/index.vue

@@ -466,7 +466,7 @@
         append-to-body
         :close-on-click-modal="false"
       >
-        <el-row :gutter="20">
+        <el-row :gutter="20" >
           <el-col :span="12">
             <el-select
               style="width: 100%"
@@ -482,7 +482,7 @@
               >
               </el-option>
             </el-select>
-            <el-scrollbar style="height: 50vh">
+     
               <div class="flex" style="margin-top: 10px" v-if="isShowInput">
                 <el-input
                   size="small"
@@ -496,7 +496,9 @@
                   >搜索</el-button
                 >
               </div>
-              <el-tree
+
+            <div style="max-height: 500px; overflow-y: auto; width: auto">
+                <el-tree
                 v-if="GLExcelFromtag"
                 @node-click="handleNodeClickExcel"
                 ref="tree"
@@ -529,9 +531,9 @@
                 :default--checked-keys="selectNodeIds"
               >
               </el-tree>
-            </el-scrollbar>
+            </div>
           </el-col>
-          <el-col :span="12" v-if="addElementForm.wbsId">
+          <el-col :span="12" v-if="addElementForm.wbsId" >
             <el-tabs v-model="activeName" type="card">
               <el-tab-pane label="关联元素表" name="link">
                 <el-table
@@ -539,6 +541,7 @@
                   border
                   style="width: 100%"
                   class="martop20"
+                  height="500"
                 >
                   <el-table-column
                     prop="tableName"
@@ -604,6 +607,35 @@
                     ></el-option>
                   </el-select>
                 </div>
+                <div class="martop10 text-green" v-if="!addinfoShow">
+                  系统检测:当前节点不存在当前元素表,允许新增
+                </div>
+                <div class="martop10 text-red" v-else>
+                  系统检测:当前节点已存在当前元素表,不允许新增,请请联系项目负责人处理!!!
+                </div>
+                <div class="martop20">已有元素表</div>
+                <div style="max-height: 350px;overflow-y: auto;">
+                           <template v-if="tableListByType.length > 0">
+                                    <div class="category-section"  v-for="(item, index) in tableListByType" :key="index">
+                                        <div class="category-header">{{item.title}}</div>
+                                        <el-table
+                                            :data="item.list"
+                                            border
+                                            style="width: 100%"
+                                           
+                                        >
+                                            <el-table-column
+                                                align="center"
+                                                prop="tableName"
+                                                label="元素表名称"
+                                            ></el-table-column>
+                                  
+                                        </el-table>
+                                    </div>
+                         </template>
+                         <el-empty description="暂无数据" v-else ></el-empty>
+
+                </div>
               </el-tab-pane>
             </el-tabs>
           </el-col>
@@ -689,6 +721,8 @@ import {
   exctabcellSave,
   exctabcellRemove,
   exctabcellUpdate,
+  getNodeGroupTables,
+  checkTableExist
 } from "@/api/exctab/excelmodel";
 import { dictionarydataType } from "@/api/exctab/editelement";
 import { getColByTabId } from "@/api/manager/AdjustForm";
@@ -798,7 +832,10 @@ export default {
         tableType:'',
         tableOwner:""
       },
-      clickData:{}
+      clickData:{},
+      addTableTreeId:'',
+      addinfoShow:false,//新增元素是否显示
+      tableListByType:[],
 
     };
   },
@@ -1275,10 +1312,42 @@ export default {
     },
     handleNodeClickExcel(data) {
       //点击节点事件
+      this.addTableTreeId=data.id
       this.addElementForm.wbsId = this.GLExcelFrom.name;
       this.addElementForm.parentId = data.id;
       //this.selectByNodeTable(data.id)
       this.searchNodeTables(data.id);
+      this.getTipsInfo()
+      this.getTableListByType()
+    },
+  async  getTipsInfo(){
+            const { data: res } = await checkTableExist({
+              nodeId: this.addTableTreeId,
+              tableName: this.addElementForm.nodeName
+            });
+            console.log(res);
+            if (res.code == 200) {
+             console.log(res.data,'res.data');
+              this.addinfoShow=res.data
+             
+            }else{
+              this.addinfoShow=false
+            }
+    },
+    async getTableListByType() { 
+            const { data: res } = await getNodeGroupTables({
+              nodeId: this.addTableTreeId,
+              excelTabId: this.from.id
+            });
+            console.log(res);
+            if (res.code == 200) {
+    
+              this.tableListByType=res.data
+             
+            }else{
+              this.tableListByType=[]
+            }
+
     },
     async selectByNodeTable(id) {
       //获取清表信息
@@ -1799,6 +1868,23 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+  .category-section {
+            margin-bottom: 20px;
+    }
+        .category-header {
+            padding: 12px 20px;
+            background-color: #E8E8E8;
+       
+            margin: 15px 0;
+            font-weight: bold;
+            font-size: 16px;
+        }
+.text-green{
+  color:rgba(82, 178, 0, 1);
+}
+.text-red{
+  color:red;
+}
 .boxswai {
   padding: 0px 14px 10px 14px !important;
 }