duy 1 өдөр өмнө
parent
commit
948ef18f6a

+ 16 - 0
src/api/exctab/excelmodel.js

@@ -289,4 +289,20 @@ export const exctabSort = (form) => {
         method: 'post',
         params: form
     })
+}
+//元素识别关联公共WBS模板-查询节点下已关联的所有表单并按照所属方分组
+export const getNodeGroupTables = (form) => {
+    return request({
+        url: '/api//blade-manager/wbsFormElement/get-group-node-tables',
+        method: 'get',
+        params: form
+    })
+}
+//元素识别关联公共WBS模板-查询节点下是否存在当前元素表
+export const checkTableExist = (form) => {
+    return request({
+        url: '/api/blade-manager/wbsFormElement/checkTableExist',
+        method: 'get',
+        params: form
+    })
 }

+ 76 - 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">
+            <el-scrollbar >
               <div class="flex" style="margin-top: 10px" v-if="isShowInput">
                 <el-input
                   size="small"
@@ -531,7 +531,7 @@
               </el-tree>
             </el-scrollbar>
           </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
@@ -604,13 +604,35 @@
                     ></el-option>
                   </el-select>
                 </div>
-                <div class="martop10 text-green">
+                <div class="martop10 text-green" v-if="!addinfoShow">
                   系统检测:当前节点不存在当前元素表,允许新增
                 </div>
-                <div class="martop10 text-red">
+                <div class="martop10 text-red" v-else>
                   系统检测:当前节点已存在当前元素表,不允许新增,请请联系项目负责人处理!!!
                 </div>
                 <div class="martop20">已有元素表</div>
+                <div>
+                           <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>
@@ -696,6 +718,8 @@ import {
   exctabcellSave,
   exctabcellRemove,
   exctabcellUpdate,
+  getNodeGroupTables,
+  checkTableExist
 } from "@/api/exctab/excelmodel";
 import { dictionarydataType } from "@/api/exctab/editelement";
 import { getColByTabId } from "@/api/manager/AdjustForm";
@@ -805,7 +829,10 @@ export default {
         tableType:'',
         tableOwner:""
       },
-      clickData:{}
+      clickData:{},
+      addTableTreeId:'',
+      addinfoShow:false,//新增元素是否显示
+      tableListByType:[],
 
     };
   },
@@ -1282,10 +1309,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) {
       //获取清表信息
@@ -1806,6 +1865,17 @@ 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);
 }