Commit 6edce319 by zhangleyuan

feat:处理人员的三级联动

parent 2217762e
......@@ -5,6 +5,7 @@ import StoreService from "@/domains/store-domain/storeService";
import User from '@/common/js/user';
import WWOpenDataCom from '@/components/WWOpenDataCom';
import $ from 'jquery';
import _ from 'underscore';
import './SearchUser.less'
const { Search } = Input;
function SearchUser(props) {
......@@ -21,9 +22,17 @@ function SearchUser(props) {
}
function selectuser(e,item){
if(e.target.checked){
let _record = []
let _record = props.selectUserList
_record.push(item)
props.onSelect(_record,'user')
}else{
let _record = props.selectUserList
_record.map((_item,index)=>{
if(item.userId === item.userId){
_record.splice(index,1)
}
})
props.onSelect(_record,'user')
}
}
function selectDep(e,item){
......@@ -69,7 +78,7 @@ function SearchUser(props) {
<div>
{props.data.departmentUserVOList.map((item,index)=>{
return <div>
<Checkbox onChange={(e)=>{selectuser(e,item)}} >
<Checkbox onChange={(e)=>{selectuser(e,item)}} checked={_.pluck(props.selectUserList, 'userId').indexOf(item.userId)=== -1?false:true}>
<div className="drop-down__item__con__item">
<div className="drop-down__item__con__item__left">
<span className="icon iconfont title-icon">&#xe603;</span>
......
......@@ -256,7 +256,7 @@ class NewChooseMembersModal extends React.Component {
confirmSearchSelect=(record,type)=>{
const { selectUserList } = this.state;
if(type==='user'){
this.setState({selectUserList:[...selectUserList,...record]});
this.setState({selectUserList:[...record]});
}else{
let _list = [];
if(record.departmentUserVOList){
......@@ -267,20 +267,6 @@ class NewChooseMembersModal extends React.Component {
console.log('selectUserList',this.state.selectUserList);
});
}
// }else{
// const params = {
// depType:this.props.treeDepType,
// enterpriseId: User.getEnterpriseId(),
// source: 0,
// storeId: User.getStoreId(),
// userId: User.getUserId(),
// departmentId:record.id
// }
// StoreService.getStoreCustomerAndDepNamePage(params).then((res) => {
// const { records = []} = res.result;
// this.setState({selectUserList:[...selectUserList,...records]});
// });
// }
}
render() {
......@@ -321,7 +307,7 @@ class NewChooseMembersModal extends React.Component {
enterButton={<span className="icon iconfont">&#xe832;</span>}
/> */}
{/* {this.Complete()} */}
<SearchUser onChange={(value)=>{this.getCompleteOptionData(value)}} data={searchUserResultList} onSelect={(record,type)=>{this.confirmSearchSelect(record,type)}}/>
<SearchUser onChange={(value)=>{this.getCompleteOptionData(value)}} data={searchUserResultList} onSelect={(record,type)=>{this.confirmSearchSelect(record,type)}} selectUserList={selectUserList}/>
<div className='container-left-body-table'>
<MemberTree departmentId={id} treeDepType={treeDepType} nowTreeDepType={addDepType} onSelect={(record)=>{this.treeSelect(record)}} selectUserList={selectUserList} type={type}/>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment