Browse Source

Merge remote-tracking branch 'origin/master'

master
wangpengfei 2 years ago
parent
commit
a7de8831c4
  1. 29
      supervise-crm-ui/src/api/projectStaff/index.js
  2. 332
      supervise-crm-ui/src/views/WechatPush/index.vue
  3. 607
      supervise-crm-ui/src/views/projectStaff/index.vue

29
supervise-crm-ui/src/api/projectStaff/index.js

@ -10,12 +10,21 @@ export default {
}); });
}, },
// 组织结构 // 组织结构
sysorganization: function() { sysorganization: function(sid) {
return request({ return request({
url: '/portal/v1/sysorganization/userList', url: '/portal/v1/sysorganization/userList/'+sid,
method: 'get', method: 'get',
}); });
}, },
// 组织结构
associationUserList: function(sid) {
return request({
url: '/portal/v1/sysorganization/associationUserList/'+sid,
method: 'get',
});
},
getUserByType: function(id) { getUserByType: function(id) {
return request({ return request({
url: '/crm/userproject/getUserByType/'+ id, url: '/crm/userproject/getUserByType/'+ id,
@ -27,7 +36,8 @@ export default {
url: '/crm/userproject/getUserProjectBySid/'+ sid, url: '/crm/userproject/getUserProjectBySid/'+ sid,
method: 'get' method: 'get'
}) })
}, },
// 人员关联项目
userprojectSave: function(data) { userprojectSave: function(data) {
return request({ return request({
url: '/crm/userproject/save', url: '/crm/userproject/save',
@ -35,6 +45,15 @@ export default {
data: data data: data
}); });
}, },
// 人员取消关联项目
usercancellation: function(data) {
return request({
url: '/crm/userproject/cancellation',
method: 'post',
data: data
});
},
// 消息模版 // 消息模版
templateMessage: function(sid) { templateMessage: function(sid) {
@ -53,5 +72,5 @@ export default {
data: data data: data
}); });
}, },
} }

332
supervise-crm-ui/src/views/WechatPush/index.vue

@ -3,18 +3,18 @@
<button-bar ref="btnbar" view-title="推送详情" :btndisabled="btndisabled" @btnhandle="btnHandle" /> <button-bar ref="btnbar" view-title="推送详情" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content"> <div class="main-content">
<div class="mid"> <el-row class="mid">
<div class="item"> <el-col :span="8" class="item">
<div class="listtop" style="width: 400px"> <div class="listtop" style="width: 450px">
<div class="tit">项目列表</div> <div class="tit">项目列表</div>
</div> </div>
<el-table :data="formobj" border ref="multipleTab" max-height="500px" style="width: 400px" <el-table :data="formobj" border ref="multipleTab" max-height="500px" style="width: 450px;font-size: 16px"
highlight-current-row @row-click="singleElection" :show-header="false" :row-style="{height:'50px'}"> highlight-current-row @row-click="singleElection" :show-header="false" :row-style="{height:'50px'}">
<el-table-column prop="entryName" label="项目名称" /> <el-table-column prop="entryName" label="项目名称" />
</el-table> </el-table>
</div> </el-col>
<div class="item" style="margin-left: 50px;"> <el-col :span="8" class="item" style="margin-left: 50px;">
<div class="listtop" style="width: 400px"> <div class="listtop" style="width: 100%">
<div class="tit">关联人员</div> <div class="tit">关联人员</div>
<div <div
style="display: flex;flex-direction: row; align-items: center; justify-content: space-between;padding-left: 20px;padding-right: 20px;"> style="display: flex;flex-direction: row; align-items: center; justify-content: space-between;padding-left: 20px;padding-right: 20px;">
@ -23,7 +23,47 @@
</div> </div>
</div> </div>
<el-table ref="multipleTable" :data="dataListOne" highlight-current-row border max-height="500px"
<div class="org-tree">
<el-tree :data="sysorganList" node-key="sid" :props="props" ref="tree" highlight-current check-strictly
:default-checked-keys="uploadData.users"
:default-expanded-keys="['2','fd6435f2-0005-11ec-a033-48452053aa33','3042d730-64e8-4e34-b08a-44adca4da3a5']"
@node-click="handleNodeClick">
<div class="custom-tree-node" slot-scope="{ node, data }"
style=" width: 100%;display: flex;flex-direction: row; align-items: center;flex-shrink: 1;">
<div :class="{ 'title': data.psid==='0' }">{{ node.label }}</div>
<div style="flex: 1;"></div>
<div style="margin-right: 35px;display: flex;flex-direction: row; align-items: center;">
<!-- <span v-if="node.childNodes.length!=0" :class="{ 'title': data.psid==='0' }">[ {{ node.childNodes.length}} ]</span> -->
<span v-if="data.psid==='0'" :class="{ 'title': data.psid==='0' }" style="margin-right: 20px;">微信名称
</span>
<div v-if="node.childNodes.length==0"
style="width: 100%;display: flex;flex-direction: row;align-items: center;">
<div></div>
<img v-if="data.isOpenId=='2'" src="../../../public/image/association.png" style="width: 35px;height: 25px;" />
<span style="margin-left: 30px;width:100px; overflow: hidden;text-align: center;
white-space: nowrap;
text-overflow: ellipsis;">正在完善 </span>
</div>
</div>
<!-- <span
v-if="node.childNodes.length===0"
class="history"
@click="jumpHistory(node.data)"
>查看历史录像
</span> -->
</div>
</el-tree>
</div>
<!-- <el-table ref="multipleTable" :data="dataListOne" highlight-current-row border max-height="500px"
style="width: 400px;height: 500px;" @row-click="singleElection2" tooltip-effect="dark" style="width: 400px;height: 500px;" @row-click="singleElection2" tooltip-effect="dark"
:row-style="{height:'50px'}"> :row-style="{height:'50px'}">
@ -40,34 +80,36 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="orgName" label="单位" align="center" /> <el-table-column prop="orgName" label="单位" align="center" />
</el-table> </el-table> -->
</div> </el-col>
<div class="item" style="margin-left: 50px;width:700px;"> <el-col :span="8" class="item" style="margin-left: 50px;width:700px;">
<div class="listtop"> <div class="listtop">
<div class="tit">微信推送</div> <div class="tit">微信推送</div>
<div> <div>
<span <span
style="color: #fff;background: #018AD2; font-size: 18px; margin-right: 20px; border-radius: 5px;padding: 4px 12px;" style="color: #fff;background: #018AD2; font-size: 16px; margin-right: 20px; border-radius: 5px;padding: 4px 12px;"
@click="saveData()">保存</span> @click="saveData()">保存</span>
</div> </div>
</div> </div>
<div v-for="(item, index) in sysorganList"> <div v-for="(item, index) in sysorganList2">
<div class="itemlay"> <div class="itemlay">
<div style="display: flex;flex-direction: row;align-items: center; background:#EDF1F7 ; height: 50px; <div
padding: 10px;"> style="display: flex;flex-direction: row;align-items: center; background:#EDF1F7 ; height: 50px;padding: 10px;">
<el-checkbox style="zoom: 150%;" :value="item.state === '2'" <el-checkbox style="zoom: 150%;" :value="item.state === '2'"
@change="titlecheckbox(item.id,$event)"></el-checkbox> @change="titlecheckbox(item.id,$event)"></el-checkbox>
<span style="margin-left: 10px;flex: 1; font-size: 18px;"> {{item.name}}</span> <span style="margin-left: 10px;flex: 1; font-size: 18px;"> {{item.name}}</span>
<span style="color: #fff; margin-right: 20px;background: #018AD2; border-radius: 5px;padding: 4px 12px;" <span
style="color: #fff; margin-right: 20px;background: #018AD2; border-radius: 5px;padding: 4px 12px; font-size: 16px; "
@click="showList(item.id)" v-show="!item.Show">展开</span> @click="showList(item.id)" v-show="!item.Show">展开</span>
<span style="color: #fff; margin-right: 20px;background: #018AD2; border-radius: 5px;padding: 4px 12px;" <span
style="color: #fff; margin-right: 20px;background: #018AD2; border-radius: 5px;padding: 4px 12px; font-size: 16px; "
@click="showList2(item.id)" v-show="item.Show">收起</span> @click="showList2(item.id)" v-show="item.Show">收起</span>
</div> </div>
@ -96,8 +138,8 @@
</div> </div>
</div> </el-col>
</div> </el-row>
</div> </div>
</div> </div>
</template> </template>
@ -152,11 +194,12 @@
// //
checkList: [], checkList: [],
uploadData: { uploadData: {
userProjectSid: '', userProjectSid: '',
templateSid:[] templateSid: []
}, },
ValSids: [], ValSids: [],
sysorganList: [], sysorganList: [],
sysorganList2: [],
} }
}, },
watch: { watch: {
@ -165,11 +208,6 @@
this.$refs['multipleTab'].setCurrentRow(this.formobj[0]) this.$refs['multipleTab'].setCurrentRow(this.formobj[0])
}) })
}, },
dataListOne: function() {
this.$nextTick(function() {
this.$refs['multipleTable'].setCurrentRow(this.dataListOne[0])
})
},
}, },
mounted() { mounted() {
@ -203,45 +241,34 @@
if (res.success) { if (res.success) {
this.formobj = res.data this.formobj = res.data
req.getUserProjectBySid(res.data[0].sid).then(res => { req.associationUserList(res.data[0].sid).then(res => {
this.dataListOne = res.data this.sysorganList = res.data
this.forList() // this.uploadData.userProjectSid = res.data[0].sid
this.uploadData.userProjectSid = res.data[0].sid
// this.estimate()
req.templateMessage(this.dataListOne[0].sid).then(res => { // req.templateMessage(this.dataListOne[0].sid).then(res => {
if (res.success) { // if (res.success) {
this.sysorganList = res.data // this.sysorganList2 = res.data
//this.Array // //this.Array
this.sysorganList.forEach(item => { // this.sysorganList2.forEach(item => {
this.$set(item, 'Show', true) // this.$set(item, 'Show', true)
}) // })
console.log("aaaaaaaaaa", this.sysorganList) // console.log("aaaaaaaaaa", this.sysorganList2)
} // }
}) // })
}) })
} }
}) })
},
clearList() {
this.ValSid = []
this.ValSids = []
this.dataListOne = []
this.uploadData = {
userProjectSid: '',
templateSid:[]
}
}, },
singleElection(row) { singleElection(row) {
this.clearList() console.log("aaaaaaaaaa", row)
this.uploadData.userProjectSid = row.sid this.uploadData.userProjectSid = row.sid
req.getUserProjectBySid(row.sid).then(res => { req.associationUserList(row.sid).then(res => {
this.dataListOne = res.data this.sysorganList = res.data
this.uploadData.userProjectSid = res.data[0].sid this.uploadData.userProjectSid = res.data[0].sid
req.templateMessage(this.dataListOne[0].sid).then(res => { req.templateMessage(this.dataListOne[0].sid).then(res => {
@ -258,8 +285,6 @@
} }
}) })
this.forList()
// this.estimate()
}) })
}, },
singleElection2(row) { singleElection2(row) {
@ -267,9 +292,9 @@
this.uploadData.userProjectSid = row.sid this.uploadData.userProjectSid = row.sid
req.templateMessage(row.sid).then(res => { req.templateMessage(row.sid).then(res => {
if (res.success) { if (res.success) {
this.sysorganList = res.data this.sysorganList2 = res.data
//this.Array //this.Array
this.sysorganList.forEach(item => { this.sysorganList2.forEach(item => {
this.$set(item, 'Show', true) this.$set(item, 'Show', true)
@ -280,7 +305,7 @@
}, },
showList(id) { showList(id) {
console.log("aaaaaaaaaa", id) console.log("aaaaaaaaaa", id)
const item = this.sysorganList.find((item => item.id == id)) const item = this.sysorganList2.find((item => item.id == id))
item.Show = !item.Show item.Show = !item.Show
@ -288,7 +313,7 @@
}, },
showList2(id) { showList2(id) {
console.log("aaaaaaaaaa", id) console.log("aaaaaaaaaa", id)
const item = this.sysorganList.find((item => item.id == id)) const item = this.sysorganList2.find((item => item.id == id))
item.Show = !item.Show item.Show = !item.Show
console.log("aaaaaaaaaa", item) console.log("aaaaaaaaaa", item)
}, },
@ -299,7 +324,7 @@
const item = this.sysorganList.find((item => item.id == id)) const item = this.sysorganList2.find((item => item.id == id))
item.state = info ? "2" : '1' item.state = info ? "2" : '1'
@ -320,9 +345,9 @@
console.log("aaaaaaaaaa", info) console.log("aaaaaaaaaa", info)
child.state = info ? "2" : "1" child.state = info ? "2" : "1"
console.log("aaaaaaaaaa", this.sysorganList[index].list) console.log("aaaaaaaaaa", this.sysorganList2[index].list)
var newList = this.sysorganList[index].list var newList = this.sysorganList2[index].list
var count = 0 var count = 0
for (var i = 0; i < newList.length; i++) { for (var i = 0; i < newList.length; i++) {
@ -335,16 +360,16 @@
} }
console.log("aaaaaaaaaa", count) console.log("aaaaaaaaaa", count)
console.log("aaaaaaaaaa", newList.length) console.log("aaaaaaaaaa", newList.length)
this.sysorganList[index].state = count == newList.length ? "2" : "1" this.sysorganList2[index].state = count == newList.length ? "2" : "1"
}, },
saveData() { saveData() {
var newList = [] var newList = []
for (var i = 0; i < this.sysorganList.length; i++) { for (var i = 0; i < this.sysorganList2.length; i++) {
var list = this.sysorganList[i].list var list = this.sysorganList2[i].list
for (var j = 0; j < list.length; j++) { for (var j = 0; j < list.length; j++) {
@ -363,133 +388,37 @@
console.log("uploadData", this.uploadData) console.log("uploadData", this.uploadData)
req.saveProjectTemplate(this.uploadData).then(res => { req.saveProjectTemplate(this.uploadData).then(res => {
if (res.success) { if (res.success) {
this.$message({
message: '保存成功',
type: 'success'
});
}
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
typeName: '',
}
}
this.loadList()
},
resetState() {
this.viewState = 1
},
//
getWaiting() {
if (this.ValSid[0]) {
for (var i = 0; i < this.dataListOne.length; i++) {
for (var j = 0; j < this.ValSid.length; j++) {
if (this.ValSid[j].userSid == this.dataListOne[i].userSid) {
this.dataListOne.splice(i, 1)
}
}
}
// this.forList()
// this.estimate()
} else {
this.$message({
message: '请选择待选的数据',
type: 'warning'
});
}
},
//
getRelevance() {
if (this.ValSids[0]) {
let arrLists = this.ValSids
let arr = []
for (var i = 0; i < arrLists.length; i++) {
let orgnames = this.$refs.tree.getNode(arrLists[i]).parent.data.name
let bb = {
name: arrLists[i].name,
orgName: orgnames,
userSid: arrLists[i].sid
}
arr.push(bb)
}
this.dataListOne = arr
} else {
this.$message({
message: '请选择要改变的关联在点击',
type: 'warning'
});
}
},
forList() {
// let vals = this.dataListOne
// let arrSids = []
// for (let i = 0; i < vals.length; i++) {
// arrSids.push(vals[i].userSid)
// }
// this.uploadData.users = arrSids
},
getPurchaseList() {
this.forList()
req.userprojectSave(this.uploadData).then(res => {
if (res.success) {
this.$message({ this.$message({
showClose: true, message: '保存成功',
type: 'success', type: 'success'
message: res.msg });
})
this.clearList()
this.loadList()
} }
}) })
}, },
getCancel() {
this.clearList()
this.loadList()
// this.$nextTick(()=>{
// this.$refs.multipleTab.setCurrentRow(this.baseDataList[0])
// })
},
handleNodeClick(val, num) { handleNodeClick(val, num) {
let checkdata = this.$refs.tree.getCheckedNodes()
let arr = [] console.log("aaaaaaaaaa", val)
for (let i = 0; i < checkdata.length; i++) {
arr.push(checkdata[i])
} console.log("aaaaaaaaaa", num)
this.removeByvalue(arr, undefined)
this.ValSids = arr var userProjectSid = val.userProjectSid
},
// if (userProjectSid) {
removeByvalue(arr, val) { this.uploadData.userProjectSid = userProjectSid
for (var i = 0; i < arr.length; i++) { req.templateMessage(userProjectSid).then(res => {
if (arr[i] == val) { if (res.success) {
arr.splice(i, 1) this.sysorganList2 = res.data
break //this.Array
} this.sysorganList2.forEach(item => {
this.$set(item, 'Show', true)
})
}
})
} }
},
estimate() {
let allParentId = []
this.sysorganList.forEach(ele => allParentId.push(ele.sid))
//id
let checkedKeyArray = this.uploadData.users
//id
let children = checkedKeyArray.filter(menuId => !allParentId.includes(menuId));
this.$refs.tree.setCheckedKeys(children)
}, },
doClose() { doClose() {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch('tagsView/delView', this.$route)
@ -507,6 +436,18 @@
display: none; display: none;
} }
//
::v-deep .el-tree-node__content {
height: 35px;
}
::v-deep .title {
font-size: 18px;
color: #000;
font-weight: 600;
font-family: sans-serif;
}
::v-deep .el-checkbox__label { ::v-deep .el-checkbox__label {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
@ -515,13 +456,18 @@
} }
.main-content { .main-content {
display: flex;
flex-direction: row;
.mid { .mid {
width: 100%; width: 100%;
height: 540px;
margin-top: 30px; margin-top: 30px;
display: flex;
flex-direction: row;
.item { .item {
float: left; display: flex;
flex-direction: column;
.listtop { .listtop {
display: flex; display: flex;
@ -532,6 +478,16 @@
} }
.org-tree {
width: 100%;
height: 450px;
box-sizing: border-box;
/*padding-right: 10px;*/
border: 1px solid #edf1f7;
overflow: scroll;
overflow-x: hidden;
}
.itemlay { .itemlay {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

607
supervise-crm-ui/src/views/projectStaff/index.vue

@ -1,67 +1,75 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<button-bar ref="btnbar" view-title="设置关联人员" :btndisabled="btndisabled" @btnhandle="btnHandle" /> <button-bar ref="btnbar" view-title="设置关联人员" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content"> <div class="main-content">
<div class="mid"> <el-row class="mid">
<div class="left"> <el-col :span="8" class="left">
<div class="listtop" style="width: 400px"> <div class="listtop" style="width: 400px">
<div class="tit" >项目列表</div> <div class="tit">项目列表</div>
</div> </div>
<el-table :data="formobj" border ref="multipleTab" max-height="540px" style="width: 400px" highlight-current-row <el-table :data="formobj" border ref="multipleTab" max-height="560px" style="width: 400px;font-size: 16px"
@row-click="singleElection"> highlight-current-row @row-click="singleElection" :row-style="{height:'50px'}" :show-header="false">
<el-table-column align="center" width="55" label="选择"> <el-table-column prop="entryName" label="项目名称" />
<template slot-scope="scope">
<!-- 可以手动的修改label的值从而控制选择哪一项 -->
<el-radio class="radio" v-model="uploadData.projectSid" :label="scope.row.sid" style="margin-left:10px"
>{{''}}</el-radio
>
</template>
</el-table-column>
<el-table-column prop="entryName" label="项目名称" />
</el-table> </el-table>
</div> </el-col>
<div class="rigth"> <el-col :span="16" class="rigth">
<div class="rihthGl"> <div class="rihthGl">
<div class="rigthJg"> <div class="rigthJg">
<div class="listtop" style="width: 100%"> <div class="listtop" style="width: 100%">
<span>项目关联人员</span> <span>关联人员</span>
<button class="Waiting" @click="getWaiting">设为待选</button> <button class="Waiting" @click="getWaiting">取消关联</button>
</div> </div>
<el-table ref="multipleTable" :data="dataListOne" border max-height="340px" style="width: 350px" <!-- <el-table ref="multipleTable" :data="dataListOne" border max-height="440px" style="width: 450px"
@selection-change="handlChange" tooltip-effect="dark" > @selection-change="handlChange" tooltip-effect="dark" :row-style="{height:'50px'}" >
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column prop="name" label="ID" align="center" /> <el-table-column prop="name" label="ID" align="center" />
<el-table-column prop="orgName" label="单位" align="center" /> <el-table-column prop="orgName" label="单位" align="center" />
</el-table> </el-table> -->
</div>
<div class="org-tree">
<el-tree :data="sysorganList" show-checkbox node-key="sid" :props="props" ref="tree" highlight-current
check-strictly :default-checked-keys="uploadData.users"
:default-expanded-keys="['2','fd6435f2-0005-11ec-a033-48452053aa33','3042d730-64e8-4e34-b08a-44adca4da3a5']"
@check="handleNodeClick1">
<div class="custom-tree-node" slot-scope="{ node, data }"
style=" width: 100%;display: flex;flex-direction: row; align-items: center;flex-shrink: 1;">
<div :class="{ 'title': data.psid==='0' }">{{ node.label }}</div>
</div>
</el-tree>
</div>
</div>
<div class="rigthYh"> <div class="rigthYh">
<div class="listtop" style="width: 100%"> <div class="listtop" style="width: 100%">
<span>待选人员</span> <span>未关联人员</span>
<button class="relevance" @click="getRelevance">设为关联</button> <button class="relevance" @click="getRelevance">关联</button>
</div> </div>
<div class="org-tree"> <div class="org-tree">
<el-tree <el-tree :data="sysorganList2" show-checkbox node-key="sid" :props="props" ref="tree2" highlight-current
:data="sysorganList" check-strictly :default-checked-keys="uploadData.users"
show-checkbox :default-expanded-keys="['2','fd6435f2-0005-11ec-a033-48452053aa33','3042d730-64e8-4e34-b08a-44adca4da3a5']"
node-key="sid" @check="handleNodeClick2">
:props="props" <div class="custom-tree-node" slot-scope="{ node, data }"
ref="tree" style=" width: 100%;display: flex;flex-direction: row; align-items: center;flex-shrink: 1;">
highlight-current <div :class="{ 'title': data.psid==='0' }">{{ node.label }}</div>
check-strictly
:default-checked-keys="uploadData.users"
:default-expanded-keys="['fd6435f2-0005-11ec-a033-48452053aa33','3042d730-64e8-4e34-b08a-44adca4da3a5']" @check="handleNodeClick"> </div>
</el-tree> </el-tree>
</div>
</div> </div>
</div>
</div> </div>
<div class="Btn"> <!-- <div class="Btn">
<el-button type="primary" @click="getPurchaseList">保存</el-button> <el-button type="primary" @click="getPurchaseList">保存</el-button>
<el-button type="primary" style="margin-left: 40px;" @click="getCancel">取消</el-button> <el-button type="primary" style="margin-left: 40px;" @click="getCancel">取消</el-button>
</div> </div> -->
</div> </el-col>
</div> </el-row>
</div> </div>
</div> </div>
</template> </template>
@ -85,21 +93,21 @@
isSearchShow: false, isSearchShow: false,
searchxianshitit: '显示查询条件', searchxianshitit: '显示查询条件',
tableLoading: false, tableLoading: false,
formobj:[], formobj: [],
dataListOne: [], dataListOne: [],
props: { props: {
label: 'name', sid: 'sid',
children: 'children' psid: "psid",
}, label: 'name',
btnList: [ children: 'children'
{ },
type: 'info', btnList: [{
size: 'small', type: 'info',
icon: 'cross', size: 'small',
btnKey: 'doClose', icon: 'cross',
btnLabel: '关闭' btnKey: 'doClose',
} btnLabel: '关闭'
], }],
queryParams: { queryParams: {
current: 1, current: 1,
size: 10, size: 10,
@ -112,18 +120,26 @@
templateSelection: "", templateSelection: "",
// //
checkList: [], checkList: [],
uploadData:{ uploadData: {
projectSid:'', projectSid: '',
users:[], users: [],
}, },
ValSid:[], ValSid: [],
ValSids:[], ValSids: [],
sysorganList:[], sysorganList: [],
sysorganList2: [],
} }
}, },
watch: {
formobj: function() {
this.$nextTick(function() {
this.$refs['multipleTab'].setCurrentRow(this.formobj[0])
})
},
},
mounted() { mounted() {
this.$refs['btnbar'].setButtonList(this.btnList) this.$refs['btnbar'].setButtonList(this.btnList)
}, },
created() { created() {
this.loadList() this.loadList()
}, },
@ -147,247 +163,264 @@
} }
}, },
loadList() { loadList() {
req.projectinformation().then(res=>{ req.projectinformation().then(res => {
if (res.success) { if (res.success) {
this.formobj = res.data this.formobj = res.data
this.uploadData.projectSid = res.data[0].sid this.uploadData.projectSid = res.data[0].sid
req.getUserProjectBySid(res.data[0].sid).then(res=>{ console.log("aaaaaaaaaa", this.uploadData.projectSid)
this.dataListOne=res.data req.associationUserList(this.uploadData.projectSid).then(res => {
this.forList() if (res.success) {
this.estimate() this.sysorganList = res.data
}) }
} })
}) req.sysorganization(this.uploadData.projectSid).then(res => {
req.sysorganization().then(res=>{ if (res.success) {
if (res.success) { this.sysorganList2 = res.data
this.sysorganList = res.data }
})
} }
}) })
},
clearList(){
this.ValSid=[]
this.ValSids=[]
this.dataListOne=[]
this.uploadData={
projectSid:'',
users:[],
}
}, },
singleElection(row) { singleElection(row) {
this.clearList() // this.clearList()
this.uploadData.projectSid = row.sid this.uploadData.projectSid = row.sid
req.getUserProjectBySid(row.sid).then(res=>{ req.associationUserList(this.uploadData.projectSid).then(res => {
this.dataListOne=res.data if (res.success) {
this.forList() this.sysorganList = res.data
this.estimate()
})
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
typeName: '',
}
}
this.loadList()
},
resetState() {
this.viewState = 1
},
//
getWaiting(){
if(this.ValSid[0]){
for(var i=0;i<this.dataListOne.length;i++){
for(var j=0;j<this.ValSid.length;j++){
if(this.ValSid[j].userSid==this.dataListOne[i].userSid){
this.dataListOne.splice(i,1)
}
} }
} })
this.forList() req.sysorganization(this.uploadData.projectSid).then(res => {
this.estimate() if (res.success) {
}else{ this.sysorganList2 = res.data
this.$message({
message: '请选择待选的数据',
type: 'warning'
});
}
},
//
getRelevance(){
if(this.ValSids[0]){
let arrLists=this.ValSids
let arr=[]
for(var i=0;i<arrLists.length;i++){
let orgnames=this.$refs.tree.getNode(arrLists[i]).parent.data.name
let bb={
name: arrLists[i].name,
orgName: orgnames,
userSid:arrLists[i].sid
}
arr.push(bb)
} }
this.dataListOne=arr })
}else{
this.$message({
message: '请选择要改变的关联在点击',
type: 'warning'
});
}
}, },
forList(){
let vals=this.dataListOne handleNodeClick1(val, num) {
let arrSids=[] console.log("aaaaaaaaaa", val)
for(let i=0;i<vals.length;i++){ console.log("aaaaaaaaaa", num)
arrSids.push(vals[i].userSid)
} this.uploadData.users = num.checkedKeys
this.uploadData.users=arrSids
}, },
getPurchaseList(){ //
this.forList() getWaiting() {
req.userprojectSave(this.uploadData).then(res=>{ console.log("aaaaaaaaaa", this.uploadData)
req.usercancellation(this.uploadData).then(res => {
if (res.success) { if (res.success) {
this.$message({ this.$message({
showClose: true, message: '取消关联成功',
type: 'success', type: 'success'
message: res.msg });
})
this.clearList() req.associationUserList(this.uploadData.projectSid).then(res => {
this.loadList() if (res.success) {
this.sysorganList = res.data
}
})
req.sysorganization(this.uploadData.projectSid).then(res => {
if (res.success) {
this.sysorganList2 = res.data
}
})
} }
}) })
this.$nextTick(() => {
this.$refs['tree'].setCheckedKeys([])
this.$refs['tree2'].setCheckedKeys([])
});
}, },
getCancel(){ handleNodeClick2(val, num) {
this.clearList() console.log("aaaaaaaaaa", val)
this.loadList() console.log("aaaaaaaaaa", num)
// this.$nextTick(()=>{
// this.$refs.multipleTab.setCurrentRow(this.baseDataList[0]) console.log("aaaaaaaaaa", val)
// }) console.log("aaaaaaaaaa", num)
},
handlChange(val){ this.uploadData.users = num.checkedKeys
this.ValSid=val
},
handleNodeClick(val,num){
let checkdata=this.$refs.tree.getCheckedNodes()
let arr=[]
for(let i=0;i<checkdata.length;i++){
arr.push(checkdata[i])
}
this.removeByvalue(arr,undefined)
this.ValSids=arr
}, },
// //
removeByvalue(arr,val){ getRelevance() {
for(var i=0;i<arr.length;i++){ console.log("aaaaaaaaaa", this.uploadData)
if(arr[i]==val){
arr.splice(i,1) req.userprojectSave(this.uploadData).then(res => {
break if (res.success) {
this.$message({
message: '关联成功',
type: 'success'
});
req.associationUserList(this.uploadData.projectSid).then(res => {
if (res.success) {
this.sysorganList = res.data
}
})
req.sysorganization(this.uploadData.projectSid).then(res => {
if (res.success) {
console.log("aaaaaaaaaa", res.data)
this.sysorganList2 = []
this.sysorganList2 = res.data
}
})
} }
} })
}, this.$nextTick(() => {
estimate(){
let allParentId = [] this.$refs['tree'].setCheckedKeys([])
this.sysorganList.forEach(ele => allParentId.push(ele.sid)) this.$refs['tree2'].setCheckedKeys([])
//id
let checkedKeyArray = this.uploadData.users });
//id
let children = checkedKeyArray.filter(menuId => ! allParentId.includes(menuId) );
this.$refs.tree.setCheckedKeys(children)
}, },
doClose() { doClose() {
this.$store.dispatch('tagsView/delView', this.$route) this.$store.dispatch('tagsView/delView', this.$route)
this.$router.go(-1) this.$router.go(-1)
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .el-tree .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner{display: inline-block;} ::v-deep .el-tree .el-tree-node .is-leaf+.el-checkbox .el-checkbox__inner {
::v-deep .el-tree .el-tree-node .el-checkbox .el-checkbox__inner{display: none;} display: inline-block;
.main-content{ }
.mid{
width: 100%; ::v-deep .el-tree .el-tree-node .el-checkbox .el-checkbox__inner {
height: 540px; display: none;
margin-top: 30px; }
.left{
float: left; //
::v-deep .el-tree-node__content {
height: 35px;
} }
.rigth{
float: right; ::v-deep .title {
width: 63%; font-size: 18px;
height: 540px; color: #000;
border: 1px solid #dfe6ec; font-weight: 600;
position: relative; font-family: sans-serif;
.rihthGl{ }
//
// ::v-deep .el-tree-node__expand-icon {
// position: absolute;
// right: 2%;
// }
.main-content {
.mid {
width: 100%; width: 100%;
height: 100%; height: 540px;
display: flex; margin-top: 30px;
justify-content: space-around;
.rigthJg{ .left {
margin-top: 50px; .listtop {
width: 350px; display: flex;
.listtop{ flex-direction: row;
.Waiting{ align-items: center;
width: 75px; padding-top: 25px;
height: 32px; padding-bottom: 25px;
border: 2px solid #018ad2; }
color: #018ad2;
font-size: 14px;
border-radius: 5px;
margin-right: 10px;
}
.Waiting:hover{
background-color: #fff;
}
}
}
.rigthYh{
margin-top: 50px;
width: 350px;
.org-tree{
width:100%;
max-height: 340px;
box-sizing: border-box;
/*padding-right: 10px;*/
border: 1px solid #edf1f7;
overflow: scroll;
overflow-x:hidden;
} }
.listtop{
.relevance{ .rigth {
width: 75px; margin-left: -50px;
height: 32px; height: 600px;
border: 2px solid #018ad2; border: 1px solid #dfe6ec;
color: #018ad2; position: relative;
font-size: 14px;
border-radius: 5px; .rihthGl {
margin-right: 10px; width: 100%;
} height: 100%;
.relevance:hover{ display: flex;
background-color: #fff; justify-content: space-around;
}
.rigthJg {
margin-top: 30px;
width: 450px;
.org-tree {
width: 100%;
height: 450px;
box-sizing: border-box;
/*padding-right: 10px;*/
border: 1px solid #edf1f7;
overflow: scroll;
overflow-x: hidden;
}
.listtop {
display: flex;
flex-direction: row;
align-items: center;
padding-top: 25px;
padding-bottom: 25px;
.Waiting {
padding: 5px 10px;
border: 2px solid #018ad2;
color: #018ad2;
font-size: 14px;
border-radius: 5px;
margin-right: 20px;
}
.Waiting:hover {
background-color: #fff;
}
}
}
.rigthYh {
margin-top: 30px;
width: 450px;
.org-tree {
width: 100%;
height: 450px;
box-sizing: border-box;
/*padding-right: 10px;*/
border: 1px solid #edf1f7;
overflow: scroll;
overflow-x: hidden;
}
.listtop {
display: flex;
flex-direction: row;
align-items: center;
padding-top: 25px;
padding-bottom: 25px;
.relevance {
padding: 5px 10px;
border: 2px solid #018ad2;
color: #018ad2;
font-size: 14px;
border-radius: 5px;
margin-right: 20px;
}
.relevance:hover {
background-color: #fff;
}
}
}
}
.Btn {
position: absolute;
left: 45%;
top: 92%;
}
} }
}
} }
.Btn{
position: absolute;
left: 40%;
top: 85%;
}
}
}
} }
</style> </style>

Loading…
Cancel
Save