Browse Source

Merge branch 'master' of http://47.110.251.215:3000/web/saber into master

yangyj 2 years ago
parent
commit
b3b3c652b8

+ 22 - 0
src/api/manager/wbsprivate.js

@@ -200,4 +200,26 @@ export const delAprojectTab = (primaryKeyIds,projectId) => {
       projectId
       projectId
     }
     }
   })
   })
+}
+//新增元素业务时间表
+export const saveTabusstime = (colId,colKey,tableId) => {
+  return request({
+    url: '/api/blade-manager/tabbusstimeinfo/save-tabusstime-info',
+    method: 'post',
+    data: {
+      colId,
+      colKey,
+      tableId
+    }
+  })
+}
+//删除元素业务时间表
+export const removeTabusstime = (ids) => {
+  return request({
+    url: '/api/blade-manager/tabbusstimeinfo/remove',
+    method: 'post',
+    params: {
+      ids
+    }
+  })
 }
 }

+ 9 - 0
src/router/views/index.js

@@ -274,6 +274,15 @@ export default [{
                 },
                 },
                 component: () =>
                 component: () =>
                     import ( /* webpackChunkName: "views" */ '@/views/manager/projectinfo/independent')
                     import ( /* webpackChunkName: "views" */ '@/views/manager/projectinfo/independent')
+            },
+            {
+                path: 'archiveTime',
+                name: '归档文件时间设置',
+                meta: {
+                    i18n: 'archiveTime'
+                },
+                component: () =>
+                    import ( /* webpackChunkName: "views" */ '@/views/manager/projectinfo/archiveTime')
             }
             }
         ]
         ]
     }, {
     }, {

+ 3 - 2
src/views/formula/edit.vue

@@ -1324,7 +1324,7 @@ export default {
     //把公式文本还原数组
     //把公式文本还原数组
     async formulaStringToArray(){
     async formulaStringToArray(){
       let detail = (await formulaDetail({elementId:this.eleid,scope:this.globaltype,nodeId:this.nodeid,projectId:this.curProjiect.id||this.pid})).data.data;
       let detail = (await formulaDetail({elementId:this.eleid,scope:this.globaltype,nodeId:this.nodeid,projectId:this.curProjiect.id||this.pid})).data.data;
-      console.log(detail);
+      console.log(detail,'detail');
       if(detail.id){
       if(detail.id){
         this.formulaid = detail.id;
         this.formulaid = detail.id;
         //let formula = formulaStringToArray('FC.sum(FC.repeat(E[测试测试_222]))+FC.ifelse(3<E[测试测试_333]&&E[测试测试_333]<10,E[测试测试_222]+E[测试测试_333],E[测试测试_333])',detail.map,this.formulaMap);
         //let formula = formulaStringToArray('FC.sum(FC.repeat(E[测试测试_222]))+FC.ifelse(3<E[测试测试_333]&&E[测试测试_333]<10,E[测试测试_222]+E[测试测试_333],E[测试测试_333])',detail.map,this.formulaMap);
@@ -1490,7 +1490,8 @@ export default {
           if(res.data.data.tabData.length){
           if(res.data.data.tabData.length){
             this.eleTableListComp = res.data.data.tabData;
             this.eleTableListComp = res.data.data.tabData;
 
 
-            this.eleTableIdComp = this.eleTableListComp[0].initTableId;
+            // this.eleTableIdComp = this.eleTableListComp[0].initTableId;
+            this.eleTableIdComp = this.eleTableListComp[0].pkeyId;
             this.getTableEleComp(this.eleTableIdComp);
             this.getTableEleComp(this.eleTableIdComp);
           }else{
           }else{
             this.eleTableListComp = [];
             this.eleTableListComp = [];

+ 24 - 8
src/views/manager/archivetree.vue

@@ -293,7 +293,7 @@
               v-model="form.postType"
               v-model="form.postType"
               placeholder="请选择岗位"
               placeholder="请选择岗位"
               style="width:400px;"
               style="width:400px;"
-              disabled
+              
             >
             >
               <el-option
               <el-option
                 v-for="item in JobTypeList"
                 v-for="item in JobTypeList"
@@ -701,6 +701,7 @@ export default {
       filterText: '',//筛选条件
       filterText: '',//筛选条件
       rulefilterText:'',
       rulefilterText:'',
       treeNode: {},
       treeNode: {},
+      treeParent:{},//选中节点的父级
       nodeNames: '',
       nodeNames: '',
       token: '',
       token: '',
       props: {
       props: {
@@ -1253,7 +1254,8 @@ export default {
       }
       }
       this.treeTap = true
       this.treeTap = true
     },
     },
-    async edittree (data) {//编辑树
+    async edittree (data,node) {//编辑树
+      console.log(node,'node');
       if (this.JobTypeList.length == 0) {
       if (this.JobTypeList.length == 0) {
         this.roletree()
         this.roletree()
       }
       }
@@ -1267,6 +1269,7 @@ export default {
       this.form.id = data.id
       this.form.id = data.id
       this.form.parentId = ''
       this.form.parentId = ''
       this.treeNode = data
       this.treeNode = data
+      this.treeParent=node.parent.data
       this.treeTap = true
       this.treeTap = true
     },
     },
     deletetree (node) {//删除树
     deletetree (node) {//删除树
@@ -1315,7 +1318,7 @@ export default {
         this.form.isInterfaceNode = res.data.isInterfaceNode   //是否接口节点
         this.form.isInterfaceNode = res.data.isInterfaceNode   //是否接口节点
         this.form.interfaceType = res.data.interfaceType   //选择接口类型
         this.form.interfaceType = res.data.interfaceType   //选择接口类型
         this.form.associationType = res.data.associationType   //关联类型
         this.form.associationType = res.data.associationType   //关联类型
-        this.form.majorDataType = res.data.majorDataType.split(',')   //内业资料类型
+        // this.form.majorDataType = res.data.majorDataType.split(',')   //内业资料类型
         this.form.displayHierarchy = res.data.displayHierarchy   //显示层级
         this.form.displayHierarchy = res.data.displayHierarchy   //显示层级
         
         
         this.form.projectType = res.data.projectType   //工程类型
         this.form.projectType = res.data.projectType   //工程类型
@@ -1326,6 +1329,11 @@ export default {
         }else{
         }else{
           this.form.expDataType = [];
           this.form.expDataType = [];
         }
         }
+        if(res.data.majorDataType){
+          this.form.majorDataType = res.data.majorDataType.split(',')   //文件类型
+        }else{
+          this.form.majorDataType = [];
+        }
       }
       }
     },
     },
     async archiveTreetree4 () {//全加载左侧树
     async archiveTreetree4 () {//全加载左侧树
@@ -1404,7 +1412,12 @@ export default {
       }
       }
     },
     },
     saveTree () {//保存按钮
     saveTree () {//保存按钮
-      this.$refs.form.validate(val => {
+      console.log(this.form.postType,'post');
+      console.log(this.treeParent,'treeParent');
+      if(this.treeParent.postType&&this.treeParent.postType!= this.form.postType){
+        this.$message.warning('岗位类型必须和父级节点岗位类型一直')
+      }else{
+         this.$refs.form.validate(val => {
         if (val) {
         if (val) {
           if (this.form.nodeType == 2) {
           if (this.form.nodeType == 2) {
             if (this.form.isStorageNode == 1) {
             if (this.form.isStorageNode == 1) {
@@ -1494,11 +1507,14 @@ export default {
             }
             }
           }
           }
         }
         }
-      })
-      if(this.menuKey='edit'){
-        //刷新页面
-       window.location.reload()
+         })
+         if(this.menuKey='edit'){
+          //刷新页面
+           window.location.reload()
+        }
       }
       }
+     
+    
        
        
        
        
     },
     },

+ 425 - 0
src/views/manager/projectinfo/archiveTime.vue

@@ -0,0 +1,425 @@
+<template>
+    <div style="height: 100%" class="flexStar">
+        <div class="boxswai" style="width: 15%;">
+            <div class="boxnei" style="display: flex; flex-direction: column">
+                <el-menu :default-active="activeIndex" class="el-menu-vertical-demo" @select="selectMajorDataType">
+                    <el-menu-item :index="item.dictKey" v-for="(item, index) in majorDataTypeList">
+                        <i class="el-icon-s-opportunity"></i>
+                        <span>{{ item.dictValue }}</span>
+                    </el-menu-item>
+
+                </el-menu>
+            </div>
+        </div>
+        <div class="boxswai" style="width: 30%; padding-left: 0px">
+            <div class="boxnei" style="display: flex; flex-direction: column">
+                <h3>引用元素表</h3>
+                <div style="overflow: auto; flex: 1;height:500px">
+                    <div class="flex">
+                        <el-input placeholder="请输入表单名称" clearable @clear="clearfiltertext"
+                            v-model="filterText">
+                        </el-input>
+                        <el-button  class="mg-l-10" @click="treeFilter">搜索</el-button>
+                    </div>
+                    <el-tree style="display: inline-block;min-width: 100%;" class="filter-tree" :data="treeData" v-loading="treeloading"
+                        :default-expanded-keys="defaultExpanded" @node-click="getNodeDetail" :props="defaultProps"
+                        :expand-on-click-node="false" highlight-current node-key="id" ref="tree" lazy :load="treeLoadNode"
+                        v-show="!allTreeShow">
+                    </el-tree>
+                    <el-tree style="width: 100%" ref="treeall" v-loading="treeloading" :data="allTreeData"
+                        :props="defaultProps" @node-click="getNodeDetail" node-key="id" :expand-on-click-node="false"
+                        :filter-node-method="filterNode" v-show="allTreeShow">
+                    </el-tree>
+                </div>
+            </div>
+        </div>
+        <div class="boxswai" style="width: 55%; padding-left: 0px; padding-right: 0px">
+            <div class="boxnei">
+                <div class="marleft10" style="height: 100%; display: flex; flex-direction: column">
+                    <div class="martop20" v-if="true" style="flex: 1">
+                        <div class="flex mg-b-10">
+                            <el-input
+                            v-model="formulaInput"
+                            placeholder="请输入元素名称"
+                          
+                            clearable
+                            @clear="searchFormulaName">
+                            </el-input>
+                            <el-button type="primary" class="mg-l-10" @click="searchFormulaName">搜索</el-button>
+                        </div>
+                       
+                            <el-table
+                                :data="editEleListFilter"
+                                border
+                                style="width: 100%"  
+                            >
+                                <el-table-column align="center" prop="eName" label="字段信息">
+                                </el-table-column>
+                                <el-table-column align="center" label="操作" width="200">
+                                <template slot-scope="scope">
+                                    <el-button
+                                    v-if="scope.row.isBussTime!==2"
+                                    type="primary"
+                                    size="small"
+                                    plain
+                                    @click="setFiledate(scope.row)"
+                                    >设置为文件日期
+                                    </el-button>
+                                    <el-button
+                                   v-else
+                                    type="danger"
+                                    size="small"
+                                    plain
+                                    @click="quitFiledate(scope.row)"
+                                    >取消
+                                    </el-button>
+                                </template>
+                                </el-table-column>
+                             </el-table>
+                
+                        
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+  
+<script>
+
+import { dictionary } from "@/api/manager/archivetree";
+import {tabTypeLazyTree,saveTabusstime,removeTabusstime} from "@/api/manager/wbsprivate";
+import {getTableElments} from "@/api/manager/wbstree";
+
+
+export default {
+
+
+    data() {
+        return {
+            majorDataTypeList: [],  //内业资料类型
+            activeIndex:'1',
+            projectid: '',
+            wbsid: '',
+            treeData: [],
+            allTreeData:[],
+            filterText: '',
+            defaultExpanded: '',
+            allTreeShow: false,
+            defaultProps: {
+                children: "children",
+                label: "title",
+                isLeaf: function (data) {
+                    return !data.hasChildren;
+                },
+            },
+            curData:{
+
+            },
+            majorDataType:{
+
+            },
+            formulaInput:'',//搜索元素字段
+            editEleListFilter:[],
+            editEleListAll:[]
+        };
+    },
+    created() {
+        this.projectid = this.$route.query.pid;
+        this.wbsid = this.$route.query.wbsid;
+        this.major_data_type()//内业资料类型
+    },
+    methods: {
+        async major_data_type() {//内业资料类型
+            const { data: res } = await dictionary({ code: 'major_data_type' })
+            console.log(res);
+            if (res.code == 200) {
+                this.majorDataTypeList = res.data
+            }
+        },
+        selectMajorDataType(item){
+            console.log(item,'item');
+            this.treeloading = true;
+            this.allTreeShow = false;
+            this.activeIndex=item
+            this.curData={}
+            this.treeData=[]
+            this.editEleListFilter=[]
+            this.editEleListAll=[]
+            let parentId=''
+            if (this.$refs.tree) {
+                this.$refs.tree.setCurrentKey(null);
+            }
+             if(this.curData.hasChildren){
+               parentId=this.curData.id
+             }else{
+                // parentId=this.curData.parentId
+                 parentId='12345678910'
+             }
+            tabTypeLazyTree({parentId:parentId,projectId:this.projectid,current:1,size:1000,titleName:this.filterText,majorDataType:this.activeIndex}).then((res) => {
+                  this.treeloading = false;
+                  this.treeData = res.data.data.records;
+             });
+        },
+        clearfiltertext() {
+            this.allTreeShow = false;
+        },
+        getNodeDetail(data,node) {
+            this.curData=data;
+            console.log(data,'data');
+            this.getTableElmentsData()
+            
+        },
+      
+        treeLoadNode(node, resolve) {
+            let parentId = 12345678910;
+            if (node.level != 0) {
+                parentId = node.data.id;
+            }
+            // 开启 “加载中” 动画
+            if (node.level == 0) this.loading = true
+                tabTypeLazyTree({ 
+                    parentId, projectId: this.projectid, pcurrent: 1, size: 1000,majorDataType:this.activeIndex
+                }).then(res => {
+                    // 请求接口,返回数据
+                    let data = res.data.data.records;
+                    this.loading = false
+                    resolve(data);
+                })
+            
+        },
+        filterNode(value, data) {
+            if (!value) return true;
+            return data.title.indexOf(value) !== -1;
+        },
+         //搜索树
+        treeFilter() {
+        console.log('搜索');
+        if (this.filterText) {
+            this.allTreeShow = true;
+            this.allTreeData=[]
+            if (!this.allTreeData.length) {
+            this.treeloading = true;
+        
+            let parentId=''
+                if(this.curData.hasChildren){
+                parentId=this.curData.id
+                }else{
+                    // parentId=this.curData.parentId
+                    parentId=''
+                }
+                console.log(parentId,'parentId');
+                    tabTypeLazyTree({parentId:parentId,projectId:this.projectid,pcurrent:1,size:1000,titleName:this.filterText,majorDataType:this.activeIndex}).then((res) => {
+                    this.treeloading = false;
+                    this.allTreeData = res.data.data.records;
+                    });
+                    this.$nextTick(() => {
+                        console.log("过滤");
+                        this.treeloading = false;
+                        this.$refs.treeall.filter(this.filterText);
+                    });
+            
+            } else {
+                this.treeloading = false;
+            this.$refs.treeall.filter(this.filterText);
+            }
+        } else {
+            this.$message.warning('请先输入文字')
+            this.allTreeShow = false;
+        }
+        },
+           //搜索 筛选
+        searchFormulaName() {
+            this.editEleListFilter = this.editEleListAll.filter((ele) => {
+                return ele.eName.indexOf(this.formulaInput) > -1;
+            });
+        },
+        //获取元素列表
+    
+        getTableElmentsData(){
+                getTableElments(this.curData.initTableId).then((res) => {
+                this.editEleListFilter = res.data.data;
+                this.editEleListAll = [].concat(this.editEleListFilter);
+            });
+           
+        },
+        //设置为文件日期
+        async setFiledate(row){
+            let colId=row.id
+            let colKey=row.tableElementKey
+            let tableId=this.curData.initTableId
+            const { data: res } = await saveTabusstime(colId,colKey,tableId)
+            console.log(res);
+            if (res.code == 200) {
+              this.$message.success(res.msg)
+              this.getTableElmentsData()
+            }
+            
+        },
+        //取消设置
+        async quitFiledate(row){
+            let ids=row.tableElementKey
+            const { data: res } = await removeTabusstime(ids)
+            console.log(res);
+            if (res.code == 200) {
+              this.$message.success(res.msg)
+              this.getTableElmentsData()
+            }
+           
+           
+        }
+
+
+
+
+
+    },
+
+    mounted() {
+        // this.heightss = this.$refs.rulesss.clientHeight
+    },
+};
+</script>
+  
+<style scoped lang="scss">
+//调整表单样式
+.excelHtml {
+    position: absolute;
+    z-index: 999999;
+    top: 50px;
+    left: 0px;
+    width: 100%;
+    height: 100%;
+}
+
+.marleft10 {
+    margin-left: 10px;
+}
+
+/deep/.el-tree-node__expand-icon {
+    font-size: 16px;
+}
+
+.colorblue {
+    color: rgb(0, 82, 217);
+}
+
+.treecontent /deep/.el-scrollbar {
+    height: 100%;
+}
+
+.el-scrollbar {
+    height: 100%;
+}
+
+.rightHeader {
+    display: flex;
+    justify-content: flex-start;
+    align-items: top;
+    font-size: 14px;
+    background-color: #fff;
+
+    .excelname {
+        box-sizing: border-box;
+        min-width: 200px;
+        height: 28px;
+        border: 1px solid rgb(220, 220, 220);
+        padding: 0 10px;
+        border-radius: 3px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+    }
+}
+
+.dialogModel {
+    .dialogBox {
+        .middle {
+            display: flex;
+
+            .left {
+                border: 1px solid rgb(220, 220, 220);
+                border-radius: 3px;
+                height: 500px;
+                width: 49%;
+
+                .select {
+                    box-sizing: border-box;
+                    display: flex;
+                    justify-content: center;
+                    padding: 5px 0;
+                    border-bottom: 1px solid #e0e0e0;
+                }
+
+                .leftscroll {
+                    height: 450px;
+                    overflow-y: scroll;
+                }
+            }
+
+            .right {
+                height: auto;
+                height: 60px;
+                max-height: 500px;
+                margin-left: 2%;
+                // height: 500px;
+                border-radius: 3px;
+
+                td {
+                    box-sizing: border-box;
+                    padding: 5px 10px;
+                    height: 30px;
+                    line-height: 30px;
+                }
+            }
+        }
+    }
+
+    .btbox {
+        margin-top: 20px;
+        display: flex;
+        justify-content: center;
+    }
+}
+
+.rightBox {
+    flex: 1;
+}
+
+.boxswai {
+    height: 100%;
+    box-sizing: border-box;
+    padding-bottom: 10px;
+
+}
+
+/deep/.avue-crud__left {
+    width: 65%;
+}
+
+/deep/.el-input-group__append {
+    background-color: #ecf5ff;
+    color: #409EFF;
+}
+
+/deep/.el-input-group__append:hover {
+    background-color: #409EFF;
+    color: white;
+}
+
+/deep/.el-input-group__prepend:hover {
+    background-color: #409EFF;
+    color: white;
+}
+
+/deep/.el-input-group__append:active {
+    background-color: #9dc5ee;
+    color: white;
+}
+
+/deep/.el-input-group__prepend:active {
+    background-color: #9dc5ee;
+    color: white;
+}
+</style>
+  

+ 21 - 7
src/views/manager/projectinfo/archivetreeRule.vue

@@ -295,7 +295,7 @@
               v-model="form.postType"
               v-model="form.postType"
               placeholder="请选择岗位"
               placeholder="请选择岗位"
               style="width:400px;"
               style="width:400px;"
-              disabled
+              
             >
             >
               <el-option
               <el-option
                 v-for="item in JobTypeList"
                 v-for="item in JobTypeList"
@@ -700,6 +700,7 @@ export default {
       filterText: '',//筛选条件
       filterText: '',//筛选条件
       rulefilterText:'',
       rulefilterText:'',
       treeNode: {},
       treeNode: {},
+      treeParent:{},
       nodeNames: '',
       nodeNames: '',
       token: '',
       token: '',
       props: {
       props: {
@@ -1248,7 +1249,7 @@ export default {
       }
       }
       this.treeTap = true
       this.treeTap = true
     },
     },
-    async edittree (data) {//编辑树
+    async edittree (data,node) {//编辑树
       if (this.JobTypeList.length == 0) {
       if (this.JobTypeList.length == 0) {
         this.roletree()
         this.roletree()
       }
       }
@@ -1262,6 +1263,7 @@ export default {
       this.form.id = data.id
       this.form.id = data.id
       this.form.parentId = ''
       this.form.parentId = ''
       this.treeNode = data
       this.treeNode = data
+      this.treeParent=node.parent.data
       this.treeTap = true
       this.treeTap = true
     },
     },
     deletetree (node) {//删除树
     deletetree (node) {//删除树
@@ -1307,7 +1309,7 @@ export default {
         this.form.isInterfaceNode = res.data.isInterfaceNode   //是否接口节点
         this.form.isInterfaceNode = res.data.isInterfaceNode   //是否接口节点
         this.form.interfaceType = res.data.interfaceType   //选择接口类型
         this.form.interfaceType = res.data.interfaceType   //选择接口类型
         this.form.associationType = res.data.associationType   //关联类型
         this.form.associationType = res.data.associationType   //关联类型
-        this.form.majorDataType = res.data.majorDataType.split(',')   //内业资料类型
+        // this.form.majorDataType = res.data.majorDataType.split(',')   //内业资料类型
         this.form.displayHierarchy = res.data.displayHierarchy   //显示层级
         this.form.displayHierarchy = res.data.displayHierarchy   //显示层级
 
 
         this.form.projectType = res.data.projectType   //工程类型
         this.form.projectType = res.data.projectType   //工程类型
@@ -1318,6 +1320,11 @@ export default {
         }else{
         }else{
           this.form.expDataType = [];
           this.form.expDataType = [];
         }
         }
+        if(res.data.majorDataType){
+          this.form.majorDataType = res.data.majorDataType.split(',')   //文件类型
+        }else{
+          this.form.majorDataType = [];
+        }
       }
       }
     },
     },
     async archiveTreetree4 () {//全加载左侧树
     async archiveTreetree4 () {//全加载左侧树
@@ -1396,7 +1403,11 @@ export default {
       }
       }
     },
     },
     saveTree () {//保存按钮
     saveTree () {//保存按钮
-      this.$refs.form.validate(val => {
+      console.log(this.form.postType,'this.form.postType');
+      if(this.treeParent.postType&&this.treeParent.postType!== this.form.postType){
+        this.$message.warning('岗位类型必须和父级节点岗位类型一致')
+      }else{
+        this.$refs.form.validate(val => {
         if (val) {
         if (val) {
           if (this.form.nodeType == 2) {
           if (this.form.nodeType == 2) {
             if (this.form.isStorageNode == 1) {
             if (this.form.isStorageNode == 1) {
@@ -1493,10 +1504,13 @@ export default {
           }
           }
         }
         }
       })
       })
-      if(this.menuKey='edit'){
-        //刷新页面
-       window.location.reload()
+        if(this.menuKey='edit'){
+          //刷新页面
+          window.location.reload()
+        }
       }
       }
+    
+   
        
        
     },
     },
     async baocun (da) {
     async baocun (da) {

+ 58 - 10
src/views/manager/projectinfo/detail.vue

@@ -822,15 +822,23 @@ export default {
         this.saveBtnBackLoad = true;
         this.saveBtnBackLoad = true;
         this.saveBtnNextDisabled = true
         this.saveBtnNextDisabled = true
         this.saveBtnDisabled = true
         this.saveBtnDisabled = true
+      
+
       }
       }
       try {
       try {
         if (this.activeType == '1') {
         if (this.activeType == '1') {
           let res = await this.saveProject();
           let res = await this.saveProject();
           this.projectForm.id = res.data.data.id;
           this.projectForm.id = res.data.data.id;
         } else if (this.activeType == '2') {
         } else if (this.activeType == '2') {
+  
           await this.saveWbsTree();
           await this.saveWbsTree();
         } else if (this.activeType == '3'){
         } else if (this.activeType == '3'){
           await this.saveLogWbsTree();
           await this.saveLogWbsTree();
+          if(type == 'p'){
+            console.log(this.wbsId,'wbsis');
+          }
+                
+
         }
         }
       } catch (error) {
       } catch (error) {
         this.btnLoad = false;
         this.btnLoad = false;
@@ -846,6 +854,7 @@ export default {
         if(this.activeType == '2'){
         if(this.activeType == '2'){
           console.log("saveNext getRightTree")
           console.log("saveNext getRightTree")
           this.getRightTree();
           this.getRightTree();
+          // this.templateType=1
         }
         }
         return;
         return;
       }
       }
@@ -918,13 +927,15 @@ export default {
         //私有库
         //私有库
         obj.referenceType = "private";
         obj.referenceType = "private";
         let ids = this.wbsId.toString().split(',');
         let ids = this.wbsId.toString().split(',');
-        obj.wbsId = this.finalWbsid;
+        // obj.wbsId = this.finalWbsid;
+        obj.wbsId = ids[0];
         obj.referencePrivateWbsProjectId = ids[1];
         obj.referencePrivateWbsProjectId = ids[1];
         obj.primaryKeyId = this.leftTreeData[0].primaryKeyId;
         obj.primaryKeyId = this.leftTreeData[0].primaryKeyId;
       } else {
       } else {
         //公有库
         //公有库
         obj.referenceType = "public";
         obj.referenceType = "public";
-        obj.wbsId = this.finalWbsid;
+         obj.wbsId = this.wbsId;
+        // obj.wbsId = this.finalWbsid;
       }
       }
 
 
       return submitWbsTreeInProject(obj);
       return submitWbsTreeInProject(obj);
@@ -1329,6 +1340,7 @@ export default {
       let refId = this.selectData.referenceWbsTemplateId;
       let refId = this.selectData.referenceWbsTemplateId;
 
 
       console.log(refId, '------------------- treeInit.refId ------------------------');
       console.log(refId, '------------------- treeInit.refId ------------------------');
+  
 
 
       if (this.projectForm.referenceWbsTemplateType === 'private' && refId != null && refId.toString().length > 0) {
       if (this.projectForm.referenceWbsTemplateType === 'private' && refId != null && refId.toString().length > 0) {
         // 私有库右边树形数据是通过 pkeyId 查询的
         // 私有库右边树形数据是通过 pkeyId 查询的
@@ -1346,7 +1358,7 @@ export default {
         //有引用id,回显
         //有引用id,回显
         //this.selected = true;
         //this.selected = true;
 
 
-        this.templateType = this.projectForm.wbsType;
+        // this.templateType = this.projectForm.wbsType;
         await this.getTreeList();
         await this.getTreeList();
         let priv = {};
         let priv = {};
 
 
@@ -1382,7 +1394,7 @@ export default {
           id:  priv.pkeyId 
           id:  priv.pkeyId 
         }
         }
         let projectTree = await findProjectTree(this.projectForm.id, refId) //查询的右边的数据
         let projectTree = await findProjectTree(this.projectForm.id, refId) //查询的右边的数据
-           if (projectTree.data.data.length>0) {
+           if (projectTree&&projectTree.data&&projectTree.data.data&&projectTree.data.data.length>0) {
             this.iswbsselected=true
             this.iswbsselected=true
           }else{
           }else{
              this.iswbsselected=false
              this.iswbsselected=false
@@ -1423,7 +1435,7 @@ export default {
         this.getTreeList();
         this.getTreeList();
         this.iswbsselected=false
         this.iswbsselected=false
       }
       }
-
+      console.log(this.wbsId,'this.wbsId33333');
       this.treeInitTrial()
       this.treeInitTrial()
       this.treeInitLar()
       this.treeInitLar()
     },
     },
@@ -1489,7 +1501,9 @@ export default {
     },
     },
     //初始化试验
     //初始化试验
     async treeInitTrial () {
     async treeInitTrial () {
+      console.log(this.wbsId,'wbsidshiyan');
       let refId = this.selectData.referenceWbsTemplateIdTrial;
       let refId = this.selectData.referenceWbsTemplateIdTrial;
+      console.log(refId,'wbsidshiyan');
       //引用被删会出现 wbsType -1
       //引用被删会出现 wbsType -1
       if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
       if (refId && refId > 0 && Number(this.projectForm.wbsType) > 0) {
         //有引用id,回显
         //有引用id,回显
@@ -1564,8 +1578,7 @@ export default {
           this.iswbsselected=false
           this.iswbsselected=false
       }else{
       }else{
               let WbsId=''
               let WbsId=''
-              if (this.projectForm.referenceWbsTemplateType === 'private'  && refId != null && refId.toString().length > 0
-              ||this.projectForm.referenceWbsTemplateTypeLar === 'private' && refId != null && refId.toString().length > 0) {
+              if (this.projectForm.referenceWbsTemplateType === 'private'  && refId != null && refId.toString().length > 0&&this.templateType===1) {
                 // 私有库右边树形数据是通过 pkeyId 查询的
                 // 私有库右边树形数据是通过 pkeyId 查询的
                 let ids = refId.toString().split(",");
                 let ids = refId.toString().split(",");
                 console.log(ids,'ids111111');
                 console.log(ids,'ids111111');
@@ -1578,10 +1591,39 @@ export default {
                 
                 
                 }
                 }
               }
               }
+              if (this.projectForm.referenceWbsTemplateTypeTrial === 'private'  && refId != null && refId.toString().length > 0&&this.templateType===2) {
+                // 私有库右边树形数据是通过 pkeyId 查询的
+                let ids = refId.toString().split(",");
+                console.log(ids,'试验');
+                this.finalIds=ids
+                if (ids.length > 1) {
+                  refId = ids[0]
+                  let list = this.treeList[1].options;
+                  refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
+                  console.log(refId,'refId');
+                
+                }
+              }
+              if (
+              this.projectForm.referenceWbsTemplateTypeLar === 'private' && refId != null && refId.toString().length > 0 &&this.templateType===5) {
+                // 私有库右边树形数据是通过 pkeyId 查询的
+                let ids = refId.toString().split(",");
+                console.log(ids,'征拆');
+                this.finalIds=ids
+                if (ids.length > 1) {
+                  refId = ids[0]
+                  let list = this.treeList[1].options;
+                  refId = list.filter(e => e.projectId == ids[1])[0].pkeyId;
+                  console.log(refId,'refId');
+                
+                }
+              }
               //引用被删会出现 wbsType -1
               //引用被删会出现 wbsType -1
               if (refId && refId > 0) {
               if (refId && refId > 0) {
                 let priv = {};
                 let priv = {};
-                if (this.projectForm.referenceWbsTemplateType == 'private'||this.projectForm.referenceWbsTemplateTypeLar === 'private' ) {
+                if (this.projectForm.referenceWbsTemplateType == 'private'&&this.templateType===1
+                ||this.projectForm.referenceWbsTemplateTypeLar === 'private' &&this.templateType===5
+                ||this.projectForm.referenceWbsTemplateTypeTrial === 'private'&&this.templateType===2) {
                   //私有
                   //私有
                   let list = this.treeList[1].options;
                   let list = this.treeList[1].options;
                   for (let i = 0; i < list.length; i++) {
                   for (let i = 0; i < list.length; i++) {
@@ -1605,8 +1647,14 @@ export default {
                 console.log(11111111111);
                 console.log(11111111111);
                 WbsId=this.nowref.id
                 WbsId=this.nowref.id
               }else{
               }else{
-                if (this.projectForm.referenceWbsTemplateType == 'private'&& refId != null && refId.toString().length > 0 ||this.projectForm.referenceWbsTemplateTypeLar === 'private'&& refId != null && refId.toString().length > 0) {
-                    WbsId = priv.pkeyId||this.selectData.referenceWbsTemplateIdTrial 
+                if (this.projectForm.referenceWbsTemplateType == 'private'&& refId != null && refId.toString().length > 0 &&this.templateType==1) {
+                    WbsId = priv.pkeyId
+                }
+               else if (this.projectForm.referenceWbsTemplateTypeTrial == 'private'&& refId != null && refId.toString().length > 0 &&this.templateType==2) {
+                    WbsId =priv.pkeyId
+                }
+               else if (this.projectForm.referenceWbsTemplateTypeLar === 'private'&& refId != null && refId.toString().length > 0&&this.templateType==5) {
+                    WbsId = priv.pkeyId
                 }
                 }
                 else {//公有
                 else {//公有
                   WbsId=this.templateType === 1 ?this.selectData.referenceWbsTemplateId: this.selectData.referenceWbsTemplateIdTrial 
                   WbsId=this.templateType === 1 ?this.selectData.referenceWbsTemplateId: this.selectData.referenceWbsTemplateIdTrial 

+ 15 - 0
src/views/manager/projectinfo/tree.vue

@@ -77,6 +77,13 @@
                     @click="independent"
                     @click="independent"
                     >独立表单库</el-button
                     >独立表单库</el-button
                   >
                   >
+                  <el-button
+                    style="margin-top:10px"
+                    size="medium"
+                    icon="el-icon-time"
+                    @click="archiveTimeClick"
+                    >归档文件时间设置</el-button
+                  >
                   <!-- <el-button
                   <!-- <el-button
                     :loading="syncElectricLoad"
                     :loading="syncElectricLoad"
                     style="margin-top:10px"
                     style="margin-top:10px"
@@ -3472,6 +3479,14 @@ export default {
         query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
         query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
 
 
 
 
+      });
+    },
+    archiveTimeClick(){
+      this.$router.push({
+        path: '/project/archiveTime',
+        query: { pid: this.projectid,wbsid:this.$route.query.wbsid }
+
+
       });
       });
     },
     },
     syncElectric(item){
     syncElectric(item){

+ 6 - 2
src/views/system/user.vue

@@ -1347,7 +1347,11 @@ export default {
     },
     },
     rowUpdate(row, index, done, loading) {//修改按钮
     rowUpdate(row, index, done, loading) {//修改按钮
       // row.roleId = row.roleId.join(",");
       // row.roleId = row.roleId.join(",");
-      row.postId = row.postId.join(",");
+      console.log(row,'row');
+      if(row.postId){
+        row.postId = row.postId.join(",");
+      }
+     
       let ks = {...row}
       let ks = {...row}
       delete ks.projectAndUserList
       delete ks.projectAndUserList
       delete ks.roleId
       delete ks.roleId
@@ -1538,7 +1542,7 @@ export default {
           if (this.form.hasOwnProperty("roleId")) {
           if (this.form.hasOwnProperty("roleId")) {
             this.form.roleId = this.form.roleId.split(",");
             this.form.roleId = this.form.roleId.split(",");
           }
           }
-          if (this.form.hasOwnProperty("postId")) {
+          if (this.form.hasOwnProperty("postId")&&this.form.postId) {
             this.form.postId = this.form.postId.split(",");
             this.form.postId = this.form.postId.split(",");
           }
           }
         });
         });