|
@@ -78,7 +78,7 @@
|
|
|
<el-table-column type="index" width="40"></el-table-column>
|
|
|
<el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="200" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
- <span class="model" @click="toMold(scope.row.id)">{{scope.row.modelNo}}</span>
|
|
|
+ <span class="model" @click="toMold(scope.row.id)">{{scope.row.belongProjectGrade}}-{{scope.row.modelNo}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="modelName" :label="$t('mold.modelName')" width="500" sortable></el-table-column>
|
|
@@ -663,7 +663,9 @@
|
|
|
this.http.post(this.port.project.getUserById, param , res => {
|
|
|
if (res.code == "ok") {
|
|
|
var list = res.data , assets = [] , produce = [];
|
|
|
+ var allUserId = [];
|
|
|
for(var i in list) {
|
|
|
+ allUserId.push(list[i].id);
|
|
|
if(list[i].companyId == this.proDetail.ownerCompany){
|
|
|
if(list[i].id != this.user.id){
|
|
|
if(list[i].id != this.proDetail.managerId){
|
|
@@ -674,14 +676,67 @@
|
|
|
produce.push(list[i])
|
|
|
}
|
|
|
}
|
|
|
- this.editForm.managerId = "";
|
|
|
- this.editForm.customerApproverId = "";
|
|
|
- this.editForm.users = [];
|
|
|
+
|
|
|
+ var manager = allUserId.indexOf(this.editForm.managerId.id),
|
|
|
+ customerApprover = allUserId.indexOf(this.editForm.customerApproverId),
|
|
|
+ array = res.data , newAssets = [] , newProduce = [],newCharger = [];
|
|
|
+
|
|
|
this.allUser = res.data;
|
|
|
- this.charger = res.data;
|
|
|
- this.assets = assets;
|
|
|
- this.produce = produce;
|
|
|
- this.general = res.data;
|
|
|
+
|
|
|
+ if(manager == -1) {
|
|
|
+ this.editForm.managerId = "";
|
|
|
+ this.charger = res.data;
|
|
|
+ } else {
|
|
|
+ for(var i in list) {
|
|
|
+ newCharger.push(list[i]);
|
|
|
+ }
|
|
|
+ this.charger = newCharger;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(customerApprover == -1) {
|
|
|
+ this.editForm.customerApproverId = "";
|
|
|
+ } else {
|
|
|
+ for(var i in list) {
|
|
|
+ if(str.indexOf(list[i].id) == -1) {
|
|
|
+ if(list[i].subordinateType == 0){
|
|
|
+ newAssets.push(list[i])
|
|
|
+ } else {
|
|
|
+ newProduce.push(list[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.assets = newAssets;
|
|
|
+ this.produce = newAssets;
|
|
|
+ }
|
|
|
+
|
|
|
+ var oldUsers = [] , backUsers = this.proDetail.participateUsers;
|
|
|
+ for(var i in backUsers) {
|
|
|
+ oldUsers.push(backUsers[i]);
|
|
|
+ }
|
|
|
+ for(var i in oldUsers) {
|
|
|
+ var num = allUserId.indexOf(oldUsers[i].id);
|
|
|
+ if(num == -1) {
|
|
|
+ oldUsers.splice(num - 1, 1);
|
|
|
+ } else {
|
|
|
+ for(var j in list){
|
|
|
+ if(oldUsers[i].id == list[j].id) {
|
|
|
+ if(list[j].id == this.editForm.customerApproverId || list[j].id == this.editForm.managerId.id || list[j].id == this.editForm.ownerApproverId){
|
|
|
+ array.splice(j,1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var editUser = [];
|
|
|
+ for(var i in oldUsers) {
|
|
|
+ for(var j in this.editForm.users) {
|
|
|
+ if(this.editForm.users[j] == oldUsers[i].id) {
|
|
|
+ editUser.push(oldUsers[i].id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.editForm.users = editUser;
|
|
|
+ this.general = array;
|
|
|
this.setMember();
|
|
|
} else {
|
|
|
this.$message({
|
|
@@ -741,19 +796,61 @@
|
|
|
users.push(this.proDetail.participateUsers[i].id)
|
|
|
}
|
|
|
|
|
|
- this.editForm = {
|
|
|
- id: this.proDetail.id,
|
|
|
- projectName: this.proDetail.projectName,
|
|
|
- customerCompany: compArr,
|
|
|
- managerId: manager,
|
|
|
- ownerApproverId: ownerApproverId,
|
|
|
- customerApproverId: customerApproverId,
|
|
|
- modelIds: moldArr,
|
|
|
- users: users
|
|
|
+ var param = {} ,
|
|
|
+ str = this.proDetail.ownerCompany + ',';
|
|
|
+ for(var i in this.proDetail.models){
|
|
|
+ if(str.indexOf(this.proDetail.models[i].produceCompanyId) == -1) {
|
|
|
+ str += this.proDetail.models[i].produceCompanyId + ",";
|
|
|
+ }
|
|
|
}
|
|
|
- this.setMember();
|
|
|
-
|
|
|
- this.editFormVisible = true;
|
|
|
+ str = str.substring(0,str.length-1);
|
|
|
+ param.companyIds = str;
|
|
|
+ param.id = this.user.id;
|
|
|
+ param.projectId = this.detailId;
|
|
|
+ this.http.post(this.port.project.getUserById, param , res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var list = res.data , assets = [] , produce = [];
|
|
|
+ for(var i in list) {
|
|
|
+ if(list[i].companyId == this.proDetail.ownerCompany){
|
|
|
+ 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.editForm = {
|
|
|
+ id: this.proDetail.id,
|
|
|
+ projectName: this.proDetail.projectName,
|
|
|
+ customerCompany: compArr,
|
|
|
+ managerId: manager,
|
|
|
+ ownerApproverId: ownerApproverId,
|
|
|
+ customerApproverId: customerApproverId,
|
|
|
+ modelIds: moldArr,
|
|
|
+ users: users
|
|
|
+ }
|
|
|
+ this.setMember();
|
|
|
+ this.editFormVisible = true;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ //this.setMember();
|
|
|
},
|
|
|
|
|
|
setMember() {
|