sunyadv hace 5 años
padre
commit
1234dc35cc
Se han modificado 2 ficheros con 13 adiciones y 10 borrados
  1. 2 0
      ys_vue/src/port.js
  2. 11 10
      ys_vue/src/views/project/project.vue

+ 2 - 0
ys_vue/src/port.js

@@ -13,7 +13,9 @@ export default {
 
         projectList: '/project/list', //项目列表
         addProject: '/project/add', //添加或修改项目
+
         getUserList: '/project/getUserList', //获取人员列表
+        getUserById: '/project/getUserListByCompanyIds', // 根据公司id获取人员
     },
     // 基础管理
     base: {

+ 11 - 10
ys_vue/src/views/project/project.vue

@@ -9,7 +9,7 @@
 				<el-form-item>
 					<el-button type="primary" v-on:click="getProject">查询</el-button>
 				</el-form-item>
-				<el-form-item style="float:right;" v-if="">
+				<el-form-item style="float:right;" v-if="user.parentId == 1">
 					<el-button type="primary" @click="handleAdd">新增</el-button>
 				</el-form-item>
 			</el-form>
@@ -150,8 +150,8 @@
 		methods: {
             // 获取基础数据
             getMsg(){
-                this.http.post(this.port.project.getUserList, {
-                    companyId: this.user.companyId
+                this.http.post(this.port.project.getUserById, {
+                    companyIds: this.user.companyId
                 } , res => {
                     if (res.code == "ok") {
                         this.charger = res.data;
@@ -234,13 +234,13 @@
 
             //选择公司切换人员
             companyChange: function(){
-                var param = {} 
+                var param = {} ,
                     str = this.user.companyId;
                 for(var i in this.addForm.customerCompany){
                     str += "," + this.addForm.customerCompany[i].id;
                 }
-                param.companyId = str;
-                this.http.post(this.port.project.getUserList, param , res => {
+                param.companyIds = str;
+                this.http.post(this.port.project.getUserById, param , res => {
                     if (res.code == "ok") {
                         this.charger = res.data;
                     } else {
@@ -291,6 +291,7 @@
                         var cId = "",
                             cName = "";
                         for(var i in this.addForm.customerCompany){
+                            console.log(this.addForm.customerCompany[i])
                             cId += this.addForm.customerCompany[i].id + ",";
                             cName += this.addForm.customerCompany[i].companyName + ",";
                         }
@@ -299,10 +300,10 @@
                         this.addLoading = true;
                         this.http.post(this.port.project.addProject, {
                             projectName: this.addForm.projectName,
-                            customerCompany: cId,
-                            customerCompanyName: cName,
-                            managerName: this.addForm.charger.id,
-                            managerId: this.addForm.charger.username,
+                            customerCompanyIds: cId,
+                            customerCompanyNames: cName,
+                            managerName: this.addForm.managerId.username,
+                            managerId: this.addForm.managerId.id,
                             // userIds: userIds,
                             flag: 0
                         } , res => {