Browse Source

2023-10-11

master
guoxing 2 years ago
parent
commit
53c5990bc9
  1. 23
      supervise-crm-ui/src/api/projectStaff/index.js
  2. 318
      supervise-crm-ui/src/views/WechatPush/index.vue
  3. 459
      supervise-crm-ui/src/views/projectStaff/index.vue

23
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,
@ -28,6 +37,7 @@ export default {
method: 'get' method: 'get'
}) })
}, },
// 人员关联项目
userprojectSave: function(data) { userprojectSave: function(data) {
return request({ return request({
url: '/crm/userproject/save', url: '/crm/userproject/save',
@ -36,6 +46,15 @@ export default {
}); });
}, },
// 人员取消关联项目
usercancellation: function(data) {
return request({
url: '/crm/userproject/cancellation',
method: 'post',
data: data
});
},
// 消息模版 // 消息模版
templateMessage: function(sid) { templateMessage: function(sid) {
return request({ return request({

318
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>
@ -153,10 +195,11 @@
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.forList()
this.uploadData.userProjectSid = res.data[0].sid
// this.estimate()
req.templateMessage(this.dataListOne[0].sid).then(res => {
if (res.success) {
this.sysorganList = res.data this.sysorganList = res.data
//this.Array // this.uploadData.userProjectSid = res.data[0].sid
this.sysorganList.forEach(item => {
this.$set(item, 'Show', true) // req.templateMessage(this.dataListOne[0].sid).then(res => {
// if (res.success) {
// this.sysorganList2 = res.data
// //this.Array
// this.sysorganList2.forEach(item => {
}) // 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++) {
@ -370,126 +395,30 @@
} }
}) })
}, },
// handleNodeClick(val, num) {
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size console.log("aaaaaaaaaa", val)
var pageindex = index + 1 + pagestart
return pageindex
}, console.log("aaaaaaaaaa", num)
dosearch() {
this.queryParams.current = 1 var userProjectSid = val.userProjectSid
this.loadList()
}, if (userProjectSid) {
resetQuery() { this.uploadData.userProjectSid = userProjectSid
this.queryParams = { req.templateMessage(userProjectSid).then(res => {
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) { if (res.success) {
this.$message({ this.sysorganList2 = res.data
showClose: true, //this.Array
type: 'success', this.sysorganList2.forEach(item => {
message: res.msg
this.$set(item, 'Show', true)
}) })
this.clearList()
this.loadList()
} }
}) })
},
getCancel() {
this.clearList()
this.loadList()
// this.$nextTick(()=>{
// this.$refs.multipleTab.setCurrentRow(this.baseDataList[0])
// })
},
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) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == val) {
arr.splice(i, 1)
break
}
}
},
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;

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

@ -3,65 +3,73 @@
<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="选择">
<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-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 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>
<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: {
sid: 'sid',
psid: "psid",
label: 'name', label: 'name',
children: 'children' children: 'children'
}, },
btnList: [ btnList: [{
{
type: 'info', type: 'info',
size: 'small', size: 'small',
icon: 'cross', icon: 'cross',
btnKey: 'doClose', btnKey: 'doClose',
btnLabel: '关闭' btnLabel: '关闭'
} }],
],
queryParams: { queryParams: {
current: 1, current: 1,
size: 10, size: 10,
@ -112,15 +120,23 @@
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)
}, },
@ -147,164 +163,121 @@
} }
}, },
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().then(res=>{ req.sysorganization(this.uploadData.projectSid).then(res => {
if (res.success) { if (res.success) {
this.sysorganList = res.data this.sysorganList2 = 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: '',
} }
})
req.sysorganization(this.uploadData.projectSid).then(res => {
if (res.success) {
this.sysorganList2 = res.data
} }
this.loadList() })
}, },
resetState() {
this.viewState = 1 handleNodeClick1(val, num) {
console.log("aaaaaaaaaa", val)
console.log("aaaaaaaaaa", num)
this.uploadData.users = num.checkedKeys
}, },
// //
getWaiting(){ getWaiting() {
if(this.ValSid[0]){ console.log("aaaaaaaaaa", this.uploadData)
for(var i=0;i<this.dataListOne.length;i++){
for(var j=0;j<this.ValSid.length;j++){ req.usercancellation(this.uploadData).then(res => {
if(this.ValSid[j].userSid==this.dataListOne[i].userSid){ if (res.success) {
this.dataListOne.splice(i,1) 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) {
this.sysorganList2 = res.data
} }
})
} }
this.forList() })
this.estimate() this.$nextTick(() => {
}else{
this.$message({ this.$refs['tree'].setCheckedKeys([])
message: '请选择待选的数据', this.$refs['tree2'].setCheckedKeys([])
type: 'warning'
}); });
}
},
handleNodeClick2(val, num) {
console.log("aaaaaaaaaa", val)
console.log("aaaaaaaaaa", num)
console.log("aaaaaaaaaa", val)
console.log("aaaaaaaaaa", num)
this.uploadData.users = num.checkedKeys
}, },
// //
getRelevance(){ getRelevance() {
if(this.ValSids[0]){ console.log("aaaaaaaaaa", this.uploadData)
let arrLists=this.ValSids
let arr=[] req.userprojectSave(this.uploadData).then(res => {
for(var i=0;i<arrLists.length;i++){ if (res.success) {
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({ this.$message({
message: '请选择要改变的关联在点击', message: '关联成功',
type: 'warning' type: 'success'
}); });
}
},
forList(){ req.associationUserList(this.uploadData.projectSid).then(res => {
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) { if (res.success) {
this.$message({ this.sysorganList = res.data
showClose: true,
type: 'success',
message: res.msg
})
this.clearList()
this.loadList()
} }
}) })
}, req.sysorganization(this.uploadData.projectSid).then(res => {
getCancel(){ if (res.success) {
this.clearList() console.log("aaaaaaaaaa", res.data)
this.loadList() this.sysorganList2 = []
// this.$nextTick(()=>{ this.sysorganList2 = res.data
// this.$refs.multipleTab.setCurrentRow(this.baseDataList[0])
// })
},
handlChange(val){
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){
for(var i=0;i<arr.length;i++){
if(arr[i]==val){
arr.splice(i,1)
break
} }
})
} }
}, })
estimate(){ this.$nextTick(() => {
let allParentId = []
this.sysorganList.forEach(ele => allParentId.push(ele.sid)) this.$refs['tree'].setCheckedKeys([])
//id this.$refs['tree2'].setCheckedKeys([])
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)
@ -314,80 +287,140 @@
} }
</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{
::v-deep .el-tree .el-tree-node .el-checkbox .el-checkbox__inner {
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-tree-node__expand-icon {
// position: absolute;
// right: 2%;
// }
.main-content {
.mid {
width: 100%; width: 100%;
height: 540px; height: 540px;
margin-top: 30px; margin-top: 30px;
.left{
float: left; .left {
.listtop {
display: flex;
flex-direction: row;
align-items: center;
padding-top: 25px;
padding-bottom: 25px;
} }
.rigth{ }
float: right;
width: 63%; .rigth {
height: 540px; margin-left: -50px;
height: 600px;
border: 1px solid #dfe6ec; border: 1px solid #dfe6ec;
position: relative; position: relative;
.rihthGl{
.rihthGl {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
.rigthJg{
margin-top: 50px; .rigthJg {
width: 350px; margin-top: 30px;
.listtop{ width: 450px;
.Waiting{
width: 75px; .org-tree {
height: 32px; 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; border: 2px solid #018ad2;
color: #018ad2; color: #018ad2;
font-size: 14px; font-size: 14px;
border-radius: 5px; border-radius: 5px;
margin-right: 10px; margin-right: 20px;
} }
.Waiting:hover{
.Waiting:hover {
background-color: #fff; background-color: #fff;
} }
} }
} }
.rigthYh{
margin-top: 50px; .rigthYh {
width: 350px; margin-top: 30px;
.org-tree{ width: 450px;
width:100%;
max-height: 340px; .org-tree {
width: 100%;
height: 450px;
box-sizing: border-box; box-sizing: border-box;
/*padding-right: 10px;*/ /*padding-right: 10px;*/
border: 1px solid #edf1f7; border: 1px solid #edf1f7;
overflow: scroll; overflow: scroll;
overflow-x:hidden; overflow-x: hidden;
} }
.listtop{
.relevance{ .listtop {
width: 75px; display: flex;
height: 32px; flex-direction: row;
align-items: center;
padding-top: 25px;
padding-bottom: 25px;
.relevance {
padding: 5px 10px;
border: 2px solid #018ad2; border: 2px solid #018ad2;
color: #018ad2; color: #018ad2;
font-size: 14px; font-size: 14px;
border-radius: 5px; border-radius: 5px;
margin-right: 10px; margin-right: 20px;
} }
.relevance:hover{
.relevance:hover {
background-color: #fff; background-color: #fff;
} }
} }
} }
} }
.Btn{
.Btn {
position: absolute; position: absolute;
left: 40%; left: 45%;
top: 85%; top: 92%;
} }
} }
} }
} }
</style> </style>
Loading…
Cancel
Save