Преглед на файлове

项目列表合同段完成

zhangh преди 2 години
родител
ревизия
45814b9dab

+ 9 - 0
src/api/manager/contractinfo.js

@@ -16,6 +16,15 @@ export const findContractByProjectId = (pid) => {
         }
     })
 }
+
+export const getContractInfo2 = (params) => {
+    return request({
+        url: '/api/blade-manager/contractInfo/detail2',
+        method: 'get',
+        params
+    })
+}
+
 export const getContractInfo = (id) => {
     return request({
         url: '/api/blade-manager/contractInfo/detail',

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

@@ -21,6 +21,18 @@ export const getProjectList = (current, size, params) => {
     })
 }
 
+
+//获取合同段信息
+export const getProjectDeatil2 = (id) => {
+    return request({
+        url: '/api/blade-manager/contractInfo/detail2',
+        method: 'get',
+        params: {
+            id
+        }
+    })
+}
+
 export const getProjectDeatil = (id) => {
     return request({
         url: '/api/blade-manager/projectInfo/detail',
@@ -80,4 +92,14 @@ export const removeProject = (ids) => {
             ids
         }
     })
+}
+
+
+//施工方合同段权限配置枚举接口
+export const treeAllConstruction = (params) => {
+    return request({
+        url: '/api/blade-manager/contractInfo/treeAllConstruction',
+        method: 'get',
+        params
+    })
 }

+ 103 - 14
src/views/manager/contractinfo/detail.vue

@@ -5,6 +5,7 @@
         v-model="activeType"
         :before-leave="beforeLeave"
       >
+        <!-- 合同段信息 -->
         <el-tab-pane
           label="合同段信息"
           name="1"
@@ -222,9 +223,25 @@
               </el-row>
               <el-divider></el-divider>
               <el-row :gutter="20">
+                <el-col
+                  :span="12"
+                  v-show="contractForm.contractType!=1"
+                >
+                  <div class="head-font">施工方合同段权限配置</div>
+                  <el-checkbox-group
+                    v-model="idList"
+                    class="martop15"
+                  >
+                    <el-checkbox
+                      :label="item.contractId"
+                      :key="key"
+                      v-for="(item,key) in checkList"
+                    >{{item.deptName}}</el-checkbox>
+                  </el-checkbox-group>
+                </el-col>
                 <el-col :span="12">
                   <div class="head-font">组卷归档默认信息</div>
-                  <el-row>
+                  <el-row class="martop15">
                     <el-col :span="12">
                       <el-form-item
                         label="立卷人"
@@ -296,7 +313,10 @@
                     </el-col>
                   </el-row>
                 </el-col>
-                <el-col :span="12">
+                <el-col
+                  :span="12"
+                  v-if="contractForm.contractType==1"
+                >
                   <div class="head-font">附加信息</div>
                   <el-form-item
                     label="项目地址"
@@ -330,6 +350,7 @@
           </div>
         </el-tab-pane>
         <el-tab-pane
+          v-if="$route.query.contractType==1||$route.query.contractType===undefined"
           label="分配WBS"
           name="2"
         >
@@ -517,9 +538,9 @@
 </template>
 
 <script>
-import { getProjectDeatil, findProjectTree } from "@/api/manager/projectinfo";
+import { getProjectDeatil, findProjectTree, treeAllConstruction } from "@/api/manager/projectinfo";
 import {
-  submitContractInfo, getContractInfo, delFileFromUrl, searchRole, findAllUserByCondition, findUserByName,
+  submitContractInfo, getContractInfo, getContractInfo2, delFileFromUrl, searchRole, findAllUserByCondition, findUserByName,
   saveUserInfoByProjectTow, removeUsersByIds, resetPasswordByUserId,
   submitWbsTreeInContract, getContractInfoTree
 } from "@/api/manager/contractinfo";
@@ -567,6 +588,8 @@ export default {
       callback();
     };
     return {
+      idList: [],
+      checkList: [],
       postIdss: '',
       //#region
       pageindx: 1,
@@ -592,6 +615,7 @@ export default {
       isBackShow: false,
 
       contractForm: {
+        contractType: 1,
         contractAmount: 0
       },
       contractRules: {
@@ -696,6 +720,12 @@ export default {
       } else {
         this.contractUserList = [];
       }
+    },
+    'contractForm.contractType' (newValue) {
+      if (newValue != 1) {
+        this.treeAllConstruction()
+
+      }
     }
   },
   created () {
@@ -743,16 +773,20 @@ export default {
       if (!this.cid) {
         this.contractForm.pid = this.pid;
       } else {
-        await this.getContractInfo();
+        if (this.$route.query.contractType == 1) {
+          await this.getContractInfo();//获取合同段基本信息
+        } else if (this.$route.query.contractType == 2 || this.$route.query.contractType == 3) {
+          await this.getContractInfo2()
+        }
       }
-      await this.getProjectDeatil();
+      await this.getProjectDeatil();//获取项目详情
       if (this.$route.query.type) {
+        console.log(this.$route.query.type);
         this.activeType = this.$route.query.type;
       }
-
-      this.getContractTypeList();
-      this.getStoragePeriodList();
-      this.getSecurityLevelList();
+      this.getContractTypeList();//获取合同类型
+      this.getStoragePeriodList();//获取业务字典
+      this.getSecurityLevelList();//获取安全等级
       this.setHeaders();
     },
     beforeLeave (activeName, oldActiveName) {
@@ -801,7 +835,6 @@ export default {
         }
       })
     },
-
     getProjectDeatil () {
       return new Promise((resolve) => {
         getProjectDeatil(this.pid).then((res) => {
@@ -834,7 +867,36 @@ export default {
         })
       })
     },
+    getContractInfo2 () {
+      return new Promise((resolve) => {
+        getContractInfo2({ id: this.cid, contractType: this.contractType }).then((res) => {
+          this.contractForm = res.data.data.contractInfo
+          if (res.data.data.wbsTreeContractList.length > 0) {
+            this.idList = []
+            res.data.data.wbsTreeContractList.forEach(val => {
+              if (val.contractIdRelation) {
+                this.idList.push(val.contractIdRelation)
+              }
+            })
+          }
 
+          if (this.contractForm.startFileUrl) {
+            this.isBackShow = true;
+          }
+          if (this.contractForm.projectPlace) {
+            this.flageData = ['', '', this.contractForm.projectPlace]
+          }
+          if (Number(this.contractForm.contractAmount) < 0) {
+            this.contractForm.contractAmount = 0;
+          }
+          this.$nextTick(() => {
+            this.typeChang['1'] = false;
+          })
+        }).finally(() => {
+          resolve();
+        })
+      })
+    },
     async saveQuit () {
       this.btnLoad = true;
       try {
@@ -880,7 +942,6 @@ export default {
       } else if (type == 'p') {
         num--;
       }
-
       this.activeType = num.toString();
       this.btnLoad = false;
     },
@@ -892,7 +953,26 @@ export default {
             if (this.flageData.length == 3) {
               this.contractForm.projectPlace = this.flageData[2];
             }
-            resolve(submitContractInfo(this.contractForm))
+            let das = this.contractForm
+            if (this.contractForm.contractType != 1) {
+              if (this.idList.length > 0) {
+                delete das.startStation
+                delete das.endStation
+                delete das.projectPlace
+                das.idList = []
+                this.idList.forEach(val => {
+                  das.idList.push({ contractId: val })
+                })
+                resolve(submitContractInfo(das))
+              } else {
+                this.$message({
+                  type: "error",
+                  message: "请先选择施工方合同段权限配置"
+                })
+              }
+            } else {
+              resolve(submitContractInfo(das))
+            }
           } else {
             reject('验证失败')
           }
@@ -1093,13 +1173,13 @@ export default {
       })
     },
     getRightTree () {
+      console.log(this.wbsId, this.projectInfo.id, this.contractForm.id);
       getContractInfoTree(this.wbsId, this.projectInfo.id, this.contractForm.id).then((res) => {
         if (Array.isArray(res.data.data)) {
           this.$refs.treetotree.setRightTree(res.data.data);
         }
       })
     },
-
     saveWbsTree () {
       let obj = {};
       let ids = this.$refs.treetotree.getTreeAllId('rightTree');
@@ -1148,6 +1228,15 @@ export default {
     },
     //#endregion
 
+    //#region 合同段信息
+    async treeAllConstruction () {
+      const { data: res } = await treeAllConstruction({ projectId: this.$route.query.pid })
+      console.log(res);
+      if (res.code == 200) {
+        this.checkList = res.data
+      }
+    },
+    //#endregion
   }
 };
 </script>

+ 7 - 4
src/views/manager/projectinfo/list.vue

@@ -111,12 +111,13 @@
               <el-link
                 type="primary"
                 class="mg-l-10"
-                @click="contractDetail(item,'2')"
+                v-if="item.contractType==1"
+                @click="contractDetail(item,'2',item.contractType)"
               >分配WBS</el-link>
               <el-link
                 type="primary"
                 class="mg-l-10"
-                @click="contractDetail(item,'3')"
+                @click="contractDetail(item,'3',item.contractType)"
               >分配项目人员</el-link>
               <el-link
                 type="primary"
@@ -223,6 +224,7 @@ export default {
         query: {
           pid: item.pid,
           cid: item.id,
+          contractType: item.contractType
         }
       });
     },
@@ -234,15 +236,16 @@ export default {
         }
       });
     },
-    contractDetail (item, type) {
+    contractDetail (item, type, contractType) {
       this.$router.push({
         path: '/contract/detail',
         query: {
           pid: item.pid,
           cid: item.id,
           type,
+          contractType
         }
-      });
+      })
     },
     editTree () {
       this.$router.push({

+ 68 - 1
src/views/manager/wbsinfo/edit.vue

@@ -88,6 +88,11 @@
                           v-if="node.level == 2"
                           icon="el-icon-sort"
                         >调整排序</el-dropdown-item>
+                        <el-dropdown-item
+                          @click.native="ImportElement(data)"
+                          v-if="node.level != 1"
+                          icon="el-icon-folder-opened"
+                        >导入元素</el-dropdown-item>
                       </el-dropdown-menu>
                     </el-dropdown>
                   </span>
@@ -164,6 +169,11 @@
                           v-if="node.level == 2"
                           icon="el-icon-upload"
                         >调整排序</el-dropdown-item>
+                        <el-dropdown-item
+                          @click.native="ImportElement(data)"
+                          v-if="node.level != 1"
+                          icon="el-icon-folder-opened"
+                        >导入元素</el-dropdown-item>
                       </el-dropdown-menu>
                     </el-dropdown>
                   </span>
@@ -310,6 +320,48 @@
       </el-col>
     </el-row>
 
+    <!-- 导入元素 -->
+    <el-dialog
+      title="导入元素"
+      :visible.sync="ImportElementTag"
+      width="30%"
+      :modal-append-to-body="false"
+      :before-close="ImportElementHandleClose"
+    >
+      <div>
+        <el-link
+          type="primary"
+          @click="handleDownload"
+        >下载导入模版</el-link>
+      </div>
+      <el-upload
+        class="upload-demo martop10"
+        action="#"
+        accept="xlsx,xls"
+        multiple
+        :file-list="ImportElementFile"
+      >
+        <el-button
+          size="small"
+          type="primary"
+        >点击上传</el-button>
+        <div
+          slot="tip"
+          class="el-upload__tip"
+        >只能上传xlsx/xls文件</div>
+      </el-upload>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="ImportElementHandleClose()">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="pushImportElement"
+        >确 定</el-button>
+      </span>
+    </el-dialog>
+
     <!-- wbs树排序弹框 -->
     <el-dialog
       title="调整排序"
@@ -1267,6 +1319,8 @@ import { mapGetters } from "vuex";
 export default {
   data () {
     return {
+      ImportElementFile: [],//导入元素file文件 
+      ImportElementTag: false,
       jiedianId: '',
       excelSortTag: false,
       excelSortTag2: false,
@@ -1364,7 +1418,7 @@ export default {
     //console.log(this.userInfo)
   },
   methods: {
-    //#region 
+    //#region 排序
     paixuMD (data) {
       this.sortTag = true
       this.sortTag2 = true
@@ -2188,6 +2242,19 @@ export default {
     },
     //#endregion
 
+    //#region 导入元素
+    ImportElement () {//导入元素按钮
+      this.ImportElementTag = true
+
+    },
+    pushImportElement () {//确定按钮
+
+    },
+    ImportElementHandleClose () {//关闭弹框事件
+      this.ImportElementTag = false
+      this.ImportElementFile = []
+    },
+    //#endregion
   },
   components: {
     ManualSorting,

+ 2 - 1
vue.config.js

@@ -29,7 +29,8 @@ module.exports = {
                 // target: 'http://localhost',
                 // target: 'http://192.168.4.6',
                 // target: 'http://47.110.251.215:8090',
-                target: 'http://192.168.4.12',
+                // target: 'http://192.168.4.12',
+                target: 'http://192.168.4.44',
                 //远程演示服务地址,可用于直接启动项目
                 //target: 'https://saber.bladex.vip/api',
                 ws: true,