sunyadv пре 5 година
родитељ
комит
2a7f023e39

+ 4 - 0
ys_vue/index.html

@@ -79,6 +79,10 @@
                 width: 675px!important;
             }
 
+            .activeNames .el-collapse-item__wrap {
+                border-bottom: none; 
+            }
+
             /* 滚动条样式修改 */
             /*滚动条凹槽的颜色,还可以设置边框属性 */
             ::-webkit-scrollbar-track-piece {

+ 41 - 0
ys_vue/package-lock.json

@@ -2074,6 +2074,16 @@
       "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==",
       "dev": true
     },
+    "clipboard": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
+      "integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
+      "requires": {
+        "good-listener": "^1.2.2",
+        "select": "^1.1.2",
+        "tiny-emitter": "^2.0.0"
+      }
+    },
     "cliui": {
       "version": "3.2.0",
       "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
@@ -2841,6 +2851,11 @@
       "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
       "dev": true
     },
+    "delegate": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
+      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
+    },
     "delegates": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
@@ -4288,6 +4303,14 @@
         "minimatch": "~3.0.2"
       }
     },
+    "good-listener": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
+      "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
+      "requires": {
+        "delegate": "^3.1.2"
+      }
+    },
     "graceful-fs": {
       "version": "4.2.0",
       "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz",
@@ -7842,6 +7865,11 @@
         }
       }
     },
+    "select": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
+      "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
+    },
     "semver": {
       "version": "5.7.0",
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
@@ -8445,6 +8473,11 @@
         "setimmediate": "^1.0.4"
       }
     },
+    "tiny-emitter": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
+      "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
+    },
     "to-arraybuffer": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz",
@@ -8910,6 +8943,14 @@
       "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz",
       "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ=="
     },
+    "vue-clipboard2": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/vue-clipboard2/-/vue-clipboard2-0.3.0.tgz",
+      "integrity": "sha512-6/Y9NJErWb4LNBLMgsJSdKb7KpF6/jqXagvKlYut6VQzQsNj6515FpwH0r5hhmeJMqaPzf1kxAw8L8Qvw/QBJQ==",
+      "requires": {
+        "clipboard": "^2.0.0"
+      }
+    },
     "vue-hot-reload-api": {
       "version": "2.3.3",
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.3.tgz",

+ 1 - 0
ys_vue/package.json

@@ -16,6 +16,7 @@
     "font-awesome": "^4.7.0",
     "nprogress": "^0.2.0",
     "vue": "^2.6.10",
+    "vue-clipboard2": "^0.3.0",
     "vue-router": "^2.3.0",
     "vuex": "^2.0.0-rc.6"
   },

+ 49 - 42
ys_vue/src/main.js

@@ -16,6 +16,9 @@ Vue.prototype.http = http
 import port from './port'
 Vue.prototype.port = port
 
+import VueClipboard from 'vue-clipboard2'
+Vue.use(VueClipboard)
+
 import 'font-awesome/css/font-awesome.min.css'
 import './assets/iconfont/iconfont.css'
 
@@ -29,58 +32,62 @@ const router = new VueRouter({
 
 
 router.beforeEach((to, from, next) => {
-    if (to.path == '/login') {
-        sessionStorage.removeItem('user');
-    }
-
-    let user = JSON.parse(sessionStorage.getItem('user'));
-    if (!user && to.path != '/login') {
-        next({ path: '/login' })
-    } else {
-        if(user){
-            for(var i in routes){
-                if(routes[i].name == "基础管理" && user.parentId != 0){
-                    routes[i].hidden = true
-                } else if(routes[i].name == "基础管理"){
-                    routes[i].hidden = false
-                }
-                
-                if(routes[i].name == "项目管理" && user.parentId > 1){
-                    var children = routes[i].children;
-                    for(var j in children){
-
-                        if(children[j].name == "人员管理"){
-                            if(user.isManager == 0){
-                                children[j].hidden = true
-                            } else {
-                                children[j].hidden = false
+    if(to.name != '邀请') {
+        if (to.path == '/login') {
+            sessionStorage.removeItem('user');
+        }
+    
+        let user = JSON.parse(sessionStorage.getItem('user'));
+        if (!user && to.path != '/login') {
+            next({ path: '/login' })
+        } else {
+            if(user){
+                for(var i in routes){
+                    if(routes[i].name == "基础管理" && user.parentId != 0){
+                        routes[i].hidden = true
+                    } else if(routes[i].name == "基础管理"){
+                        routes[i].hidden = false
+                    }
+                    
+                    if(routes[i].name == "项目管理" && user.parentId > 1){
+                        var children = routes[i].children;
+                        for(var j in children){
+    
+                            if(children[j].name == "人员管理"){
+                                if(user.isManager == 0){
+                                    children[j].hidden = true
+                                } else {
+                                    children[j].hidden = false
+                                }
+                            }
+    
+                            if(children[j].name == "权限管理"){
+                                if(user.isManager == 0){
+                                    children[j].hidden = true
+                                } else {
+                                    children[j].hidden = false
+                                }
                             }
                         }
-
-                        if(children[j].name == "权限管理"){
-                            if(user.isManager == 0){
-                                children[j].hidden = true
-                            } else {
+                    } else if(routes[i].name == "项目管理") {
+                        var children = routes[i].children;
+                        for(var j in children){
+                            if(children[j].name != "项目详情"){
                                 children[j].hidden = false
                             }
-                        }
-                    }
-                } else if(routes[i].name == "项目管理") {
-                    var children = routes[i].children;
-                    for(var j in children){
-                        if(children[j].name != "项目详情"){
-                            children[j].hidden = false
-                        }
-                        
-                        if(children[j].name == "权限管理"){
-                            if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
-                                children[j].hidden = true
+                            
+                            if(children[j].name == "权限管理"){
+                                if((user.parentId == 0 || user.parentId == 1) && user.isManager == 0){
+                                    children[j].hidden = true
+                                }
                             }
                         }
                     }
                 }
             }
+            next()
         }
+    } else {
         next()
     }
 })

+ 2 - 0
ys_vue/src/port.js

@@ -33,6 +33,8 @@ export default {
         getUserList: '/user/getUserList', //获取用户列表
         getUserById: '/user/getUserListByCompanyIds', // 给项目分配参与人的时候根据公司id获取公司下的人员
 
+        inviteUser: '/invitationrecord/inviteUser', //添加邀请记录并产生链接
+
         powerList: '/power/list', // 权限列表
         powerUpdate: '/power/update', //修改权限
     },

+ 1 - 1
ys_vue/src/routes.js

@@ -96,7 +96,7 @@ let routes = [
     },
     //邀请
     {
-        path: '/invite/:id',
+        path: '/invite/:inviteeId/:projectId/:operatorId',
         component: invite,
         name: '邀请',
         hidden: true

+ 2 - 2
ys_vue/src/views/Login.vue

@@ -94,12 +94,12 @@
         margin: 180px auto;
         // width: 350px;
         width: 315px;
-        height: 345px;
+        height: 365px;
         // padding: 35px 35px 15px 35px;
         padding: 25px 35px 25px 35px;
         background: #fff;
         border: 1px solid #eaeaea;
-        box-shadow: 0 0 25px #cac6c6;
+        box-shadow: 0 0 5px #cac6c6;
         border-top: 10px solid #409EFF;
         .title {
             font-size: 20px;

+ 141 - 103
ys_vue/src/views/invite.vue

@@ -1,113 +1,151 @@
 <template>
-  <div class="main">
-    <div class="title">云模管理平台</div>
-    <p class="hello">王二小您好!</p>
-    <p class="invite">
-      陈晨 邀您参与
-      <span class="impoortant">南京火石闪信网络公司</span>的
-      <span class="impoortant">face水杯</span>项目
-    </p>
-    <div class="info">
-      <p class="info1">您的账户信息</p>
-      <p class="info2">
-        手机号
-        <span>16651112436</span>
-      </p>
-      <p class="info3">
-        初始密码
-        <span>000000</span>
-      </p>
+    <div class="main">
+        <div class="title">云模管理平台</div>
+        <p class="hello">{{detail.invitee}}您好!</p>
+        <p class="invite">
+            {{detail.operator}} 邀您参与
+            <span class="impoortant">{{detail.companyName}}</span>的
+            <span class="impoortant">{{detail.projectName}}</span>项目
+        </p>
+        <div class="info">
+            <p class="info1">您的账户信息</p>
+            <p class="info2">
+                手机号
+                <span>{{detail.account}}</span>
+            </p>
+            <p class="info3">
+                初始密码
+                <span>000000</span>
+            </p>
+        </div>
+        <button @click="join">立即加入</button>
     </div>
-    <button @click="join">立即加入</button>
-  </div>
 </template>
 
 <script>
-import util from "../common/js/util";
-export default {
-  data() {
-    return {
-      id: ""
+    import util from "../common/js/util";
+    export default {
+        data() {
+            return {
+                inviteeId: "",
+                projectId: "",
+                operatorId: "",
+                detail: ""
+            };
+        },
+        methods: {
+            join() {
+                this.$router.push("/login");
+            }
+        },
+        created() {},
+        mounted() {
+            //获取传入的值
+            this.inviteeId = this.$route.params.inviteeId;
+            this.projectId = this.$route.params.projectId;
+            this.operatorId = this.$route.params.operatorId;
+
+            this.http.post(this.port.project.inviteUser, {
+                inviteeId: this.inviteeId,
+                projectId: this.projectId,
+                operatorId: this.operatorId
+            } , res => {
+                if (res.code == "ok") {
+                    this.detail = res.data;
+                } else {
+                    this.$message({
+                        message: res.msg,
+                        type: 'error'
+                    });
+                }
+            }, error => {
+                this.$message({
+                    message: error,
+                    type: 'error'
+                });
+            })
+        }
     };
-  },
-  methods: {
-    join() {
-      this.$router.push("/login");
-    }
-  },
-  created() {},
-  mounted() {
-    //获取传入的值
-    this.id = this.$route.params.id;
-    console.log(this.id);
-  }
-};
 </script>
 
 <style scoped>
-* {
-  margin: 0;
-  padding: 0;
-}
-.main {
-  margin: 80px auto;
-  width: 300px;
-  color: #555;
-}
-.title {
-  text-align: center;
-  font-size: 20px;
-  color: #999;
-  line-height: 50px;
-  border-bottom: #ddd 1px solid;
-  margin-bottom: 5px;
-  padding: 0 10px;
-}
-.impoortant {
-  color: #1e72ff;
-}
-.hello {
-  line-height: 40px;
-  padding: 0 10px;
-}
-.invite {
-  line-height: 22px;
-  padding: 0 10px;
-}
-.info {
-  background-color: #eee;
-  margin: 20px 0;
-  padding: 10px;
-  border-radius: 3px;
-}
-.info1 {
-  padding-left: 10px;
-  border-left: #1e72ff 1px solid;
-  line-height: 18px;
-}
-.info2 {
-  line-height: 20px;
-  padding: 10px 0;
-}
-.info3 {
-  line-height: 20px;
-}
-.info2 span {
-  position: relative;
-  left: 40px;
-  color: #999;
-}
-.info3 span {
-  position: relative;
-  left: 25px;
-  color: #999;
-}
-button {
-  background-color: #1e72ff;
-  border: 0;
-  color: white;
-  border-radius: 5px;
-  width: 100%;
-  height: 40px;
-}
+    * {
+        margin: 0;
+        padding: 0;
+    }
+
+    .main {
+        margin: 80px auto;
+        width: 360px;
+        color: #555;
+    }
+
+    .title {
+        text-align: center;
+        font-size: 20px;
+        color: #999;
+        line-height: 50px;
+        border-bottom: #ddd 1px solid;
+        margin-bottom: 5px;
+        padding: 0 10px;
+    }
+
+    .impoortant {
+        color: #1e72ff;
+    }
+
+    .hello {
+        line-height: 40px;
+        padding: 0 10px;
+    }
+
+    .invite {
+        line-height: 22px;
+        padding: 0 10px;
+    }
+
+    .info {
+        background-color: #eee;
+        margin: 20px 0;
+        padding: 10px;
+        border-radius: 3px;
+    }
+
+    .info1 {
+        padding-left: 10px;
+        border-left: #1e72ff 1px solid;
+        line-height: 18px;
+    }
+
+
+    .info2 {
+        line-height: 20px;
+        padding: 10px 0;
+    }
+
+    .info3 {
+        line-height: 20px;
+    }
+
+    .info2 span {
+        position: relative;
+        left: 40px;
+        color: #999;
+    }
+
+    .info3 span {
+        position: relative;
+        left: 25px;
+        color: #999;
+    }
+
+    button {
+        background-color: #1e72ff;
+        border: 0;
+        color: white;
+        border-radius: 5px;
+        width: 100%;
+        height: 40px;
+        cursor: pointer;
+    }
 </style>

+ 5 - 2
ys_vue/src/views/project/project.vue

@@ -293,10 +293,13 @@
                             mId = "";
 
                         for(var i in this.addForm.mold){
-                            cId += this.addForm.mold[i].produceCompanyId + ",";
-                            cName += this.addForm.mold[i].produceCompany + ",";
+                            if(cId.indexOf(this.addForm.mold[i].produceCompanyId) == -1){
+                                cId += this.addForm.mold[i].produceCompanyId + ",";
+                                cName += this.addForm.mold[i].produceCompany + ",";
+                            }
                             mId += this.addForm.mold[i].id + ","
                         }
+
                         cId = cId.substring(0,cId.length-1);
                         cName = cName.substring(0,cName.length-1);
                         mId = mId.substring(0,mId.length-1);

+ 20 - 6
ys_vue/src/views/project/projectDetail.vue

@@ -51,7 +51,7 @@
                     </span>
                 </el-col> -->
                 <el-col :span="24" class="detail">
-                    普通员:
+                    普通员:
                     <span class="info" v-for="(item, index) in proDetail.participateUsers">
                         {{item.username}}
                         <span v-if="index != proDetail.participateUsers.length-1">、</span>
@@ -67,7 +67,7 @@
             </el-col>
              
             <el-col :span="24">
-                <el-collapse v-model="activeNames">
+                <el-collapse class="activeNames" v-model="activeNames">
                     <el-collapse-item name="1">
                         <template slot="title">
                             <el-col :span="24" class="title">项目模具</el-col>
@@ -91,7 +91,7 @@
                             <el-col :span="24" class="title">项目文档
                                 <!-- update == 1 -->
                                 <el-upload v-if="user.id == proDetail.managerId" action="customize" :http-request="uploadFile" :show-file-list="false" multiple :limit="5" style="float:right;margin-right:20px;">
-                                    <el-button size="small" type="primary" :loading="upLoading">点击上传</el-button>
+                                    <el-button size="mini" type="primary" :loading="upLoading">点击上传</el-button>
                                 </el-upload>
                             </el-col>
                         </template>
@@ -616,14 +616,22 @@
                         var list = res.data , assets = [] , produce = [];
                         for(var i in list) {
                             if(list[i].companyId == this.proDetail.ownerCompany){
-                                assets.push(list[i])
+                                if(list[i].id != this.user.id){
+                                    if(list[i].id != this.proDetail.managerId){
+                                        assets.push(list[i])
+                                    }
+                                }
                             } else {
                                 produce.push(list[i])
                             }
                         }
+
+                        this.allUser = res.data;
                         this.charger = res.data;
                         this.assets = assets;
                         this.produce = produce;
+                        this.general = res.data;
+                        this.setMember();
                     } else {
                         this.$message({
                             message: res.msg,
@@ -737,8 +745,10 @@
                             modelIds = "",
                             userIds = "";
                         for(var i in this.editForm.customerCompany){
-                            cId += this.editForm.customerCompany[i].id + ",";
-                            cName += this.editForm.customerCompany[i].companyName + ",";
+                            if(cId.indexOf(this.editForm.customerCompany[i].id) == -1){
+                                cId += this.editForm.customerCompany[i].id + ",";
+                                cName += this.editForm.customerCompany[i].companyName + ",";
+                            }
                         }
                         cId = cId.substring(0,cId.length-1);
                         cName = cName.substring(0,cName.length-1);
@@ -1021,4 +1031,8 @@
     .detail {
         margin-bottom: 20px;
     }
+
+    .el-collapse {
+        border: none;
+    }
 </style>

+ 67 - 29
ys_vue/src/views/project/staff.vue

@@ -34,10 +34,10 @@
 		<!--列表-->
 		<el-table :data="list" highlight-current-row :height="tableHeight" v-loading="listLoading" style="width: 100%;">
 			<el-table-column type="index" width="60"></el-table-column>
-			<el-table-column prop="username" label="姓名" width="100" sortable></el-table-column>
-			<el-table-column prop="account" label="手机号(登录账号)" width="180" sortable></el-table-column>
+			<el-table-column prop="username" label="姓名" width="120" align="center" sortable></el-table-column>
+			<el-table-column prop="account" label="手机号(登录账号)" align="center" width="180" sortable></el-table-column>
 			<!-- <el-table-column prop="mobile" label="联系方式" width="150" sortable></el-table-column> -->
-			<el-table-column prop="teamName" label="类型" width="100" sortable></el-table-column>
+			<el-table-column prop="teamName" label="类型" width="120" align="center" sortable></el-table-column>
             <el-table-column prop="projects" label="参与项目" sortable>
                 <template slot-scope="scope">
                     <span class="info" v-for="(item, index) in scope.row.projects">
@@ -47,11 +47,12 @@
                 </template>
 			</el-table-column>
 			<el-table-column prop="companyName" label="所属公司" sortable></el-table-column>
-            <el-table-column prop="roleName" label="角色" sortable></el-table-column>
-			<el-table-column label="操作" width="150">
-				<template slot-scope="scope" v-if="user.id == scope.row.parentId">
-					<el-button size="small" @click="handleEdit(scope.$index, scope.row)" v-if="scope.row.roleName != -1">编辑</el-button>
-					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)" v-if="scope.row.roleName != -1">删除</el-button>
+            <el-table-column prop="roleName" label="角色" width="180" sortable></el-table-column>
+			<el-table-column label="操作" align="left" width="230">
+				<template slot-scope="scope" v-if="user.id == scope.row.parentId || user.isManager == 1 || user.parentId == 1">
+					<el-button size="small" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+					<el-button type="danger" size="small" @click="handleDel(scope.$index, scope.row)">删除</el-button>
+                    <el-button type="primary" size="small" @click="invite(scope.$index, scope.row)" v-if="user.id != 1 && scope.row.projects.length == 1">邀请</el-button>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -123,6 +124,13 @@
 				<el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>
 			</div>
 		</el-dialog>
+
+        <!--邀请界面-->
+		<el-dialog title="邀请" v-if="inviteVisible" :visible.sync="inviteVisible" :close-on-click-modal="false" customClass='customWidth'>
+			<el-input placeholder="请复制邀请链接" v-model="inviteLink" class="input-with-select">
+                <el-button slot="append" v-clipboard:copy="inviteLink" v-clipboard:success="copyLink" v-clipboard:error="onError" type="primary" icon="el-icon-share">复制链接</el-button>
+            </el-input>
+		</el-dialog>
 	</section>
 </template>
 
@@ -204,31 +212,16 @@
                     companyId: '',
                     roleName: '',
                     flag: 1
-				}
+                },
+                
+                //邀请
+                inviteVisible: false,
+                inviteLink: ''
 			}
 		},
 		methods: {
             // 获取基础数据
             getMsg(){
-                // this.http.post(this.port.base.companys, {
-                //     parentId: this.user.parentId,
-                //     id: this.user.id
-                // }, res => {
-                //     if (res.code == "ok") {
-                //         this.company = res.data;
-                //     } else {
-                //         this.$message({
-                //             message: res.msg,
-                //             type: 'error'
-                //         });
-                //     }
-                // }, error => {
-                //     this.$message({
-                //         message: error,
-                //         type: 'error'
-                //     });
-                // })
-
                 this.http.post(this.port.project.projectByUser, {}, 
                 res => {
                     if (res.code == "ok") {
@@ -434,6 +427,47 @@
                         type: 'error'
                     });
                 })
+            },
+
+            //邀请
+            invite(index, row) {
+                this.http.post(this.port.project.inviteUser, {
+                    inviteeId: row.id,
+                    projectId: row.projects[0].id,
+                    operatorId: this.user.id
+                } , res => {
+                    if (res.code == "ok") {
+                        this.inviteVisible = true;
+                        this.inviteLink = res.data.addressUrl;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
+
+            //复制链接
+            copyLink() {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制成功!",
+                    type: 'success'
+                });
+            },
+
+            onError(e) {
+                //this.inviteVisible = false;
+                this.$message({
+                    message: "复制失败!",
+                    type: 'error'
+                });
             }
         },
         created() {
@@ -452,5 +486,9 @@
 </script>
 
 <style scoped>
-    
+    .el-input-group__append button.el-button {
+        background-color: #409EFF;
+        border-color: #409EFF;
+        color: #fff;
+    }
 </style>