Browse Source

plm BMM

master
ruanqi 1 year ago
parent
commit
bdc410c274
  1. 70
      src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue

70
src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue

@ -89,7 +89,7 @@
<el-input type="textarea" resize="none" :autosize="{minRows: 2, maxRows: 2}" v-model="dataForm.remark" ></el-input>
</el-form-item>
<el-form-item prop="userRoleName" :rules="projectRole.userRoleName">
<span slot="label" style="" @click="userRollModal('none')"><a herf="#">项目权限</a></span>
<span slot="label" style="" @click="userRollModal()"><a herf="#">项目权限</a></span>
<el-input v-model="dataForm.userRoleName" ></el-input>
</el-form-item>
</el-form>
@ -145,7 +145,7 @@
<el-input v-model="userRoleForm.userDisplay" placeholder=" "></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchUserRoll('none')">查询</el-button>
<el-button type="primary" @click="searchUserRoll()">查询</el-button>
</el-form-item>
</el-form>
<el-table
@ -513,7 +513,7 @@
searchProjectTeamStr(inData2).then(({data}) => {
this.dataForm.projectOwnerList=data.rows
})
this.searchUserRoll();
this.searchUserRollAll();
}
})
}else {
@ -545,7 +545,7 @@
finalCustomerId:'',
finalCustomerName:'',
}
this.searchUserRoll();
this.searchUserRollAll();
}
if (requestCustomer){
@ -553,20 +553,26 @@
}
this.visible = true
},
searchUserRoll(val){
let arr = []
if (val === 'none'){//
arr =JSON.parse(JSON.stringify(this.userRoleList));
}
searchUserRoll(){
let inData3={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
username:this.userRoleForm.username,
userDisplay:this.userRoleForm.userDisplay,
}
searchUserRoll(inData3).then(({data}) => {
this.userRoleList=data.rows;
// this.userRollModal();
})
},
searchUserRollAll(){
let inData3={
site:this.dataForm.site,
projectId:this.dataForm.projectId,
}
searchUserRoll(inData3).then(({data}) => {
this.dataForm.userRoleList=data.rows;
this.userRollModal(undefined,arr);
// this.userRollModal();
})
},
managerChooseModal(){
@ -615,27 +621,21 @@
this.dataForm.projectOwnerList=JSON.parse(JSON.stringify(this.projectOwnerList));
this.ownerFlag=false
},
userRollModal(val,arr){
this.userRoleList=JSON.parse(JSON.stringify(this.dataForm.userRoleList));
userRollModal(){
// console.log(this.dataForm.userRoleList)
// console.log(this.userRoleList)
// this.userRoleList=JSON.parse(JSON.stringify(this.dataForm.userRoleList));
this.searchUserRoll()
for (let i = 0; i <this.userRoleList.length ; i++) {
if(this.userRoleList[i].username===this.$store.state.user.name){
this.userRoleList[i].checkAll=true;
this.changeAll(this.userRoleList[i])
}
}
//
// if (arr && arr.length > 0){
// for (let i = 0; i < this.userRoleList.length; i++) {
// let row = arr[i]
// if (arr[i].username !== this.$store.state.user.name){
// row = arr.find(item => item.username === arr[i].username)
// }
// this.$set(this.userRoleList, i, row)
// }
// }
if (val === 'none'){
this.userRoleFlag=true
}
},
saveUserList(){
for (let i = 0; i <this.userRoleList.length ; i++) {
@ -650,15 +650,29 @@
this.userRoleList[i].deleteFlag='Y'
}
}
let name= [];
let name= '';
console.log("this.dataForm.userRoleList")
console.log(this.dataForm.userRoleList)
console.log("this.userRoleList")
console.log(this.userRoleList)
for (let i = 0; i < this.userRoleList.length; i++) {
this.dataForm.userRoleList=this.dataForm.userRoleList.filter(item => item.username != this.userRoleList[i].username)
if(this.userRoleList[i].searchCheck||this.userRoleList[i].updateCheck||this.userRoleList[i].downCheck||this.userRoleList[i].deleteCheck){
name[i]=this.userRoleList[i].userDisplay
this.dataForm.userRoleList.push(this.userRoleList[i])
}
console.log("this.dataForm.userRoleList")
console.log(this.dataForm.userRoleList)
}
this.dataForm.userRoleName=name.join(';')
this.dataForm.userRoleList=JSON.parse(JSON.stringify(this.userRoleList));
for (let i = 0; i < this.dataForm.userRoleList.length; i++) {
if(this.dataForm.userRoleList[i].searchCheck||this.dataForm.userRoleList[i].updateCheck
||this.dataForm.userRoleList[i].downCheck||this.dataForm.userRoleList[i].deleteCheck){
name+=this.dataForm.userRoleList[i].userDisplay+';'
}
}
this.dataForm.userRoleName=name
// this.dataForm.userRoleList=JSON.parse(JSON.stringify(this.userRoleList));
this.userRoleFlag=false
},
changeAll(row){
if(row.checkAll){

Loading…
Cancel
Save