import React from 'react'; import ReactDom from 'react-dom'; import ajax from 'jquery/src/ajax/xhr.js'; import $ from 'jquery/src/ajax'; import '../content.less'; import { citySelect,provinceList,areaSelect,provinceSelect,addressList} from '../../../NewDicProvinceList'; import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,AutoComplete,Tabs,Checkbox,Tree,Cascader} from 'antd'; import {patternOrganization,conditionOrganization,intentionalService,messageType,designatedObjects,socialAttributeS,industry,socialAttribute,industryS,designatedObjectse,auditStatusL} from '../../../dataDic.js'; import {getPattern,getProvince,getCondition,getcustomerTyp,getSocialAttribute,getDesignated,getCertification,getAuditStatus, getContactType, getfllowSituation,getWhether,getLvl,getCurrentMember,getStatuslist,getMessageType} from '../../../tools.js'; import {ChooseList} from "../../order/orderNew/chooseList"; const TabPane = Tabs.TabPane; const TreeNodet = Tree.TreeNode; const CheckboxGroup = Checkbox.Group; const SystemMessage=Form.create()(React.createClass({ //列表的展示和搜索 loadData(pageNo,sendType) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/message/listSystemMessage', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, isDraft:sendType,//是否发送 subject:'01',//列表消息类型 }, success: function (data) { let theArr = []; if (!data.data || !data.data.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: i, id: thisdata.messageId,//每一条消息的ID createTime:thisdata.createTime,//创建时间 title:thisdata.title,//消息标题 body:thisdata.body,//消息内容 subject:thisdata.subject,//消息类型 consumerType:thisdata.consumerType,//发送目标类型 }); }; this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; }; this.setState({ dataSource: theArr, pagination: this.state.pagination }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, sanhuLoadData(pageNo, apiUrl) { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/customer/listAllPersonalCustomer', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, name: this.state.nameSearch, societyTag: this.state.societyTagSearch, }, success: function(data) { let theArr = []; if(data.error.length || data.data.list == "") { if(data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for(let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: thisdata.uid, id: thisdata.uid, type: thisdata.type, name: thisdata.name, status: thisdata.status, contacts: thisdata.contacts, contactMobile: thisdata.contactMobile, industry: thisdata.industry, createTime: thisdata.createTime, businessAudit: thisdata.businessAudit, auditStatus: thisdata.auditStatus, lvl: thisdata.lvl, isMember: thisdata.isMember, status: thisdata.status, societyTag: thisdata.societyTag, currentMemberStatus: thisdata.currentMemberStatus, international: thisdata.international, listed: thisdata.listed, highTechZone: thisdata.highTechZone, locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--' }); }; }; this.state.pagination1.current = data.data.pageNo ? data.data.pageNo : '0'; this.state.pagination1.total = data.data.totalCount ? data.data.totalCount : '0'; this.setState({ sanhuDataSource: theArr, pagination1: this.state.pagination1 }); }.bind(this), }).always(function() { this.setState({ loading: false }); }.bind(this)); }, sanhuLoadData21(pageNo, apiUrl) { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/customer/listAllOrganizationCustomer', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, name: this.state.nameSearch, societyTag: this.state.societyTagSearch, }, success: function(data) { let theArr = []; if(data.error.length || data.data.list == "") { if(data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for(let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: thisdata.uid, id: thisdata.uid, type: thisdata.type, name: thisdata.name, status: thisdata.status, contacts: thisdata.contacts, contactMobile: thisdata.contactMobile, industry: thisdata.industry, createTime: thisdata.createTime, businessAudit: thisdata.businessAudit, auditStatus: thisdata.auditStatus, lvl: thisdata.lvl, isMember: thisdata.isMember, status: thisdata.status, societyTag: thisdata.societyTag, currentMemberStatus: thisdata.currentMemberStatus, international: thisdata.international, listed: thisdata.listed, highTechZone: thisdata.highTechZone, locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city || '' + '-' + thisdata.area : '--' }); }; }; this.state.pagination21.current = data.data.pageNo ? data.data.pageNo : '0'; this.state.pagination21.total = data.data.totalCount ? data.data.totalCount : '0'; this.setState({ sanhuDataSource21: theArr, pagination21: this.state.pagination21 }); }.bind(this), }).always(function() { this.setState({ loading: false }); }.bind(this)); }, sanhuLoadData1(pageNo) { this.setState({ loading: true }); $.ajax({ type: 'get', cache: false, url: globalConfig.context + "/api/admin/supervise/adminList", dataType: "json", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, province: this.state.searchProvince, mobile: this.state.searchMobile, name: this.state.searchName, department:this.state.departmentt }, success: function (data) { let theArr = []; if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; this.state.onlyProvince = thisdata.province; theArr.push({ key: thisdata.id, id: thisdata.id, mobile: thisdata.mobile, name: thisdata.name, email: thisdata.email, createTime: thisdata.createTime, number: thisdata.number, province: thisdata.province, city:thisdata.city, position: thisdata.position, departmentName:thisdata.departmentName, departmentId:thisdata.departmentId, superior: thisdata.superior, superiorId: thisdata.superiorId, createTimeFormattedDate: thisdata.createTimeFormattedDate }); }; this.state.pagination2.current = data.data.pageNo; this.state.pagination2.total = data.data.totalCount; }; this.setState({ sanhuDataSource1: theArr, pagination2: this.state.pagination2 }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, //分公司列表和搜索 fengongsiLoadData(pageNo) { this.state.data = []; this.setState({ loading: true }); let nameText=this.state.departmentArr; let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].name:""; $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/organization/listOrganizationManagement', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, name: this.state.name, //组织名称 superId:superText,//上级组织 type:this.state.type,//组织类型 depNo:this.state.depNo,//组织编号 }, success: function (data) { let theArr = []; if (!data.data || !data.data.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: thisdata.id, id: thisdata.id,//每一条记录的ID depNo:thisdata.depNo,//组织编号 name:thisdata.name,//组织名称 type:thisdata.type,//组织类型 managerId:thisdata.managerId,//负责人 superId:thisdata.superId,//上级组织 status:thisdata.status,//组织状态 }); }; this.state.pagination3.current = data.data.pageNo; this.state.pagination3.total = data.data.totalCount; }; this.setState({ fengongsiDataSource: theArr, pagination3: this.state.pagination3 }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, jueseLoadData(pageNo) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + '/api/admin/roles', data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, roleName:this.state.roleNameSearch, }, success: function (data) { let theArr = []; if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: thisdata.id, id: thisdata.id, roleName: thisdata.roleName, creater:thisdata.creater, createTime:thisdata.createTimez, }); }; this.state.pagination4.current = data.data.pageNo; this.state.pagination4.total = data.data.totalCount; }; this.setState({ jueseDataSource: theArr, pagination4: this.state.pagination4 }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, getInitialState() { return { data: [], sanhu:[], objText:[], callnub:'0', sendType:'0', showAdd: false, showDesc: false, expandedKeys: [], autoExpandParent: true, selectedKeys: [], searchMore: true, selectedRowKeys: [], selectedRows: [], loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page,this.state.sendType); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, pagination1: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.sanhuLoadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, pagination21: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.sanhuLoadData21(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, pagination2: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.sanhuLoadData1(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, pagination3: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.fengongsiLoadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, pagination4: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.jueseLoadData(page); }.bind(this), showTotal: function (total) { return '共' + total + '条数据'; } }, columns: [ { title: '消息时间', dataIndex: 'createTime', key: 'createTime', width:'150px', }, { title: '消息标题', dataIndex: 'title', key: 'title', width:'300px', },{ title: '消息内容', dataIndex: 'body', key: 'body', },{ title: '消息类型', dataIndex: 'subject', key: 'subject', width:'100px', render: text => { return getMessageType(text) } },{ title: '发送目标', dataIndex: 'consumerType', key: 'consumerType', width:'100px', render: text => { return getDesignated(text) } } ], dataSource: [], sanhuColumns1: [ { title: '编号', dataIndex: 'number', key: 'number' }, { title: '登录账号', dataIndex: 'mobile', key: 'mobile' }, { title: '名字', dataIndex: 'name', key: 'name' }, { title: '职位', dataIndex: 'position', key: 'position' },{ title: '部门', dataIndex: 'departmentName', key: 'departmentName' }, { title: '上级管理员', dataIndex: 'superior', key: 'superior' }, { title: '邮箱', dataIndex: 'email', key: 'email' }, { title: '创建时间', dataIndex: 'createTimeFormattedDate', key: 'createTimeFormattedDate' } ], sanhuDataSource1: [], sanhuColumns: [{ title: '客户名称', dataIndex: 'name', key: 'name', },{ title: '地区', dataIndex: 'locationProvince', key: 'locationProvince', }, { title: '联系人', dataIndex: 'contacts', key: 'contacts', }, { title: '联系电话', dataIndex: 'contactMobile', key: 'contactMobile', }, { title: '行业', dataIndex: 'industry', key: 'industry', }, { title: '社会性质', dataIndex: 'societyTag', key: 'societyTag', render: text => { return getSocialAttribute(text) } }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', }, { title: '会员等级', dataIndex: 'lvl', key: 'lvl', render: text => { return getLvl(text) } }, { title: '会员状态', dataIndex: 'currentMemberStatus', key: 'currentMemberStatus', render: text => { return getCurrentMember(text) } }, { title: '账户状态', dataIndex: 'status', key: 'status', render: text => { return getStatuslist(text) } } ], sanhuDataSource: [], sanhuColumns21: [{ title: '客户名称', dataIndex: 'name', key: 'name', }, { title: '地区', dataIndex: 'locationProvince', key: 'locationProvince', }, { title: '联系人', dataIndex: 'contacts', key: 'contacts', }, { title: '联系电话', dataIndex: 'contactMobile', key: 'contactMobile', }, { title: '行业', dataIndex: 'industry', key: 'industry', }, { title: '社会性质', dataIndex: 'societyTag', key: 'societyTag', render: text => { return getSocialAttribute(text) } }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', }, { title: '会员状态', dataIndex: 'currentMemberStatus', key: 'currentMemberStatus', render: text => { return getCurrentMember(text) } }, { title: '账户状态', dataIndex: 'status', key: 'status', render: text => { return getStatuslist(text) } } ], sanhuDataSource21: [], fengongsiColumns: [ { title: '组织编号', dataIndex: 'depNo', key: 'depNo', }, { title: '组织名称', dataIndex: 'name', key: 'name', }, { title: '负责人', dataIndex: 'managerId', key: 'managerId', },{ title: '组织类型', dataIndex: 'type', key: 'type', render: text => { return getPattern(text) } }, { title: '上级组织', dataIndex: 'superId', key: 'superId', },{ title: '组织状态', dataIndex: 'status', key: 'status', render: text => { return getCondition(text) } } ], fengongsiDataSource: [], jueseColumns: [ { title: '角色名称', dataIndex: 'roleName', key: 'roleName', width:'300px' }, { title: '创建人', dataIndex: 'creater', key: 'creater', width:'300px' }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime', } ], jueseDataSource: [], }; }, componentWillMount() { this.loadData(1,0); }, //部门 departmentList() { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/organization/selectSuperId", data: { }, success: function(data) { let thedata = data.data; let theArr=[]; if(!thedata) { if(data.error && data.error.length) { message.warning(data.error[0].message); }; thedata = {}; }else{ thedata.map(function(item,index){ theArr.push({ key:index, name:item.name, id:item.id, depNo:item.depNo }) }) } this.setState({ departmentArr:theArr, }) }.bind(this), }).always(function() { this.setState({ loading: false }); }.bind(this)); }, //整行点击 bianji(record, index) { this.state.RowData = record; this.setState({ editvisible: true, selectedRowKeys:[], rowId:record.businessId, }) let deletedIds =''; for (let idx = 0; idx < this.state.selectedRows.length; idx++) { let rowItem = this.state.selectedRows[idx]; if (rowItem.id) { deletedIds=rowItem.id; }; }; $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context +"/api/admin/message/getSystemMessageDetail" , data: { messageId: deletedIds }, success: function (data) { let theArr = []; let thisdata = data.data; if (!data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } else { theArr.push({ editId: thisdata.messageId,//每一条消息的ID editTitle:thisdata.title,//消息标题 editBody:thisdata.body,//消息内容 editCreateTime:thisdata.createTime,//消息时间 editSubject:thisdata.subject,//消息类型 editConsumerType:thisdata.consumerType,//消息发送对象 }); }; this.setState({ editId: thisdata.messageId,//每一条消息的ID editTitle:thisdata.title,//消息标题 editBody:thisdata.body,//消息内容 editCreateTime:thisdata.createTime,//消息时间 editSubject:thisdata.subject,//消息类型 editConsumerType:thisdata.consumerType,//上级组织 editDataSource: theArr, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, //草稿删除 delectRow() { let deletedIds =''; for (let idx = 0; idx < this.state.selectedRows.length; idx++) { let rowItem = this.state.selectedRows[idx]; if (rowItem.id) { deletedIds=rowItem.id; }; }; this.setState({ selectedRowKeys: [], loading: deletedIds.length > 0 }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/message/deleteSystemMessage", data: { messageId: deletedIds } }).done(function (data) { if (!data.error.length) { message.success('删除成功!'); this.loadData(1,1); this.setState({ loading: false, }); } else { message.warning(data.error[0].message); }; }.bind(this)); }, //新增一个部门,保存 addhandleSubmit(e,isDraft){ e.preventDefault(); let duixiang=JSON.stringify(this.state.sanhu)||JSON.stringify(this.state.sanhu21)||JSON.stringify(this.state.shehui)||JSON.stringify(this.state.hangye)||JSON.stringify(this.state.fengongsi)||JSON.stringify(this.state.diqu)||JSON.stringify(this.state.yonghu)||JSON.stringify(this.state.juese); if(!this.state.addContent){ message.warning('请输入消息内容'); return false; } if(!this.state.addType){ message.warning('请选择消息类型'); return false; } if(!duixiang){ message.warning('请指定发送对象'); return false; } let diquText=this.state.diqu; let pro=[]; let city=[]; let dis=[]; if(this.state.diqu){ for(var i=0;i34&&diquText[i]<380){ city.push(diquText[i]) }else{ dis.push(diquText[i]) } } }else{ pro=undefined; city=undefined; dis=undefined; } this.props.form.validateFields((err, values) => { if (!err) { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url:globalConfig.context + '/api/admin/message/createSystemMessage', data:{ title:this.state.addTitle,//消息标题 body:this.state.addContent,//消息内容 subject:this.state.addType,//消息类型 targetType:this.state.addObject, //指定对象 createTime:this.state.addCreateTime, //创建时间 isDraft:isDraft,//是否存为草稿 personalUserIds:this.state.sanhu?this.state.sanhu.join(","):undefined,//散户 organizationUserIds:this.state.sanhu21?this.state.sanhu21.join(","):undefined,//散户 societyTags:this.state.shehui?this.state.shehui.join(","):undefined,//社会属性 provinceIds:pro?pro.join(","):undefined,//省 cityIds:city?city.join(","):undefined,//市 areaIds:dis?dis.join(","):undefined,//区 industryIds:this.state.hangye?this.state.hangye.join(","):undefined,//行业 companyIds:this.state.fengongsi?this.state.fengongsi.join(","):undefined,//分公司 adminIds:this.state.yonghu?this.state.yonghu.join(","):undefined,//用户 roles:this.state.juese?this.state.juese.join(","):undefined,//角色 } }).done(function (data) { this.setState({ loading: false }); if (!data.error.length) { message.success('保存成功!'); this.handleCancel(); this.loadData(1,this.state.callnub); } else { message.warning(data.error[0].message); } }.bind(this)); } }); }, add(e){ e.preventDefault(); this.addhandleSubmit(e,0); }, adds(e){ e.preventDefault(); this.addhandleSubmit(e,1); }, edit(e){ e.preventDefault(); this.editDraft(e,0); }, edits(e){ e.preventDefault(); this.editDraft(e,1); }, //编辑一个部门,保存或者存为草稿 editDraft(e,isDraft){ e.preventDefault(); if(!this.state.editTitle){ message.warning('请输入消息标题'); return false; } if(!this.state.editBody){ message.warning('请选择消息内容'); return false; } this.props.form.validateFields((err, values) => { if (!err) { this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url:globalConfig.context + '/api/admin/message/updateSystemMessage', data:{ messageId:this.state.editId,//消息ID body:this.state.editBody,//消息内容 title:this.state.editTitle,//消息标题 isDraft:isDraft,//是否存为草稿 } }).done(function (data) { this.setState({ loading: false }); if (!data.error.length) { message.success('保存成功!'); this.edithandleCancel(); } else { message.warning(data.error[0].message); } }.bind(this)); } }); }, //主管初始加载(自动补全) supervisor(e){ $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/organization/selectName", data:{ name:e }, success: function (data) { let thedata=data.data; if (!thedata) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; thedata = {}; }; this.setState({ customerArr:thedata, }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, //上级主管输入框失去焦点是判断客户是否存在 selectAuto(value,options){ this.setState({ managerIdOrganization:value }) }, //失去焦点时 blurChange(e){ this.setState({ theTypes:e }) }, //消息发送列表切换数据处理 callback(e) { this.setState({ callnub: e, }) if(e == 0) { this.setState({ bianjiMore: false, selectedRowKeys:[], sendType:0, }) this.loadData(1,0); } if(e == 1) { this.setState({ bianjiMore: true, selectedRowKeys:[], sendType:1, }) this.loadData(1,1); } }, //切换系统消息类型 changeNews(e){ if(e == 1) { this.setState({ newsChange: false, addObject:undefined, }) } if(e == 0) { this.setState({ newsChange: true , addObject:undefined, }) } }, //切换创建系统消息中的指定发送对象 selectObjects(e) { this.setState({ addObject:e }) if(e == 61) { this.sanhuReset(); this.setState({ visible1: true }) } if(e == 62) { this.sanhuReset21(); this.setState({ visible21: true }) } if(e == 1) { this.setState({ visible2: true }) } if(e == 2) { this.setState({ visible4: true }) } if(e == 0) { this.setState({ visible5: true }) } }, changeObjects(){ this.objectReset(); }, changeObjects1(e){ this.setState({ addObject:e }) if(e == 5) { this.sanhuReset1(); this.setState({ visible6: true }) } if(e == 4) { this.jueseReset(); this.setState({ visible7: true }) } if(e == 3) { this.fengongsiLoadData(); this.setState({ visible3: true }) } }, //值改变时请求客户名称 httpChange(e){ if(e.length>=2){ this.supervisor(e); } this.setState({ managerIdOrganization:e }) }, //修复账号 repairData(){ this.setState({ loading: true }); $.ajax({ method: "post", dataType: "json", crossDomain: false, url: globalConfig.context +"/api/admin/lockAdmin" , success: function (data) { if (!data.data) { if (data.error && data.error.length) { message.warning(data.error[0].message); }; } if(!data.error.length){ message.success('操作成功'); } }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, addClick() { this.state.addTitle= undefined;//消息标题 this.state.addContent= undefined;//消息内容 this.state.addType= undefined;//消息类型 this.state.addObject= undefined; //指定对象 this.state.RowData = {}; this.setState({ visible: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context +"/api/admin/message/toCreateSystemMessage" , data: { }, success: function (data) { let thisdata = data.data; this.setState({ addCreateTime: thisdata.createTime,//每一条消息的时间 }); }.bind(this), }).always(function () { this.setState({ loading: false }); }.bind(this)); }, editClick() { this.state.RowData = {}; this.setState({ editvisible: true }); }, handleCancel() { this.state.addTitle= undefined;//消息标题 this.state.addContent= undefined;//消息内容 this.state.addType= undefined;//消息类型 this.state.addObject= undefined; //指定对象 this.setState({ visible: false }) }, handleCancel1() { this.setState({ visible1: false }) }, handleCancel21() { this.setState({ visible21: false }) }, handleCancel2() { this.setState({ visible2: false }) }, handleCancel3() { this.setState({ visible3: false }) }, handleCancel4() { this.setState({ visible4: false }) }, handleCancel5() { this.setState({ visible5: false }) }, handleCancel6() { this.setState({ visible6: false }) }, handleCancel7() { this.setState({ visible7: false }) }, edithandleCancel() { this.setState({ editvisible: false }) }, //地区多选 onExpand(expandedKeys){ this.setState({ expandedKeys, autoExpandParent: false, }); }, onCheck(checkedKeys){ this.setState({ checkedKeys:checkedKeys }); }, onSelectDi(selectedKeys, info){ this.setState({ selectedKeys }); }, renderTreeNodes(data){ return provinceList.map((item) => { return( {item.cityList.map((item) => { return( {item.areaList.map((item) => { return( ); }) } ); }) } ); return ; }); }, search() { this.loadData(); }, //个人客户搜索 sanhusearch(){ this.sanhuLoadData(); }, //单位客户搜索 sanhusearch21(){ this.sanhuLoadData21(); }, //用户搜索 sanhusearch1(){ this.sanhuLoadData1(); }, //用户搜索 juesesearch(){ this.jueseLoadData(); }, //个人客户重置 sanhuReset() { this.state.nameSearch = ''; this.state.societyTagSearch = undefined; this.sanhuLoadData(); }, //单位客户重置 sanhuReset21() { this.state.nameSearch = ''; this.state.societyTagSearch = undefined; this.sanhuLoadData21(); }, //用户重置 sanhuReset1() { this.state.departmentt=undefined; this.state.searchMobile = undefined; this.state.searchName = undefined; this.state.searchProvince = undefined; this.sanhuLoadData1(); }, //角色重置 jueseReset() { this.state.roleNameSearch=''; this.jueseLoadData(); }, //把搜索的部分置零 reset() { this.state.addTitle= undefined;//消息标题 this.state.addContent= undefined;//消息内容 this.state.addType= undefined;//消息类型 this.state.addObject= undefined; //指定对象 this.loadData(1,0); }, searchSwitch() { this.setState({ searchMore: !this.state.searchMore }); }, //选择发送对象时的数据处理 //指定对象清零 objectReset(){ this.state.sanhu=undefined; this.state.sanhu21=undefined; this.state.yonghu=undefined; this.state.juese=undefined; this.state.shehui=undefined; this.state.diqu=undefined; this.state.fengongsi=undefined; this.state.hangye=undefined; }, rowReset(){ this.state.selectedRowKeys=[]; }, //散户 sanhuSubmit(e){ e.preventDefault(); this.objectReset(); this.setState({ sanhu:this.state.selectedRowKeys }); this.rowReset(); this.handleCancel1(); },//散户 sanhuSubmit21(e){ e.preventDefault(); this.objectReset(); this.setState({ sanhu21:this.state.selectedRowKeys }); this.rowReset(); this.handleCancel21(); }, //用户 yonghuSubmit(e){ e.preventDefault(); this.objectReset(); this.setState({ yonghu:this.state.selectedRowKeys }); this.rowReset(); this.handleCancel6(); }, //角色 jueseSubmit(e){ e.preventDefault(); this.objectReset(); this.setState({ juese:this.state.selectedRowKeys }); this.rowReset(); this.handleCancel7(); }, //社会属性 shehuiSubmit(e){ e.preventDefault(); this.setState({ shehui:this.state.shehui }); this.handleCancel2(); }, //分公司 fengongsiSubmit(e){ e.preventDefault(); this.objectReset(); this.setState({ fengongsi:this.state.selectedRowKeys }); this.rowReset(); this.handleCancel3(); }, //地区 diquSubmit(e){ e.preventDefault(); this.objectReset(); this.setState({ diqu:this.state.checkedKeys }); this.handleCancel4(); }, //行业 hangyeSubmit(e){ e.preventDefault(); this.setState({ hangye:this.state.hangye }); this.handleCancel5(); }, changeList(arr) { const newArr = []; this.state.columns.forEach(item => { arr.forEach(val => { if (val === item.title) { newArr.push(item); } }); }); this.setState({ changeList: newArr }); }, render() { let departmentArr = this.state.departmentArr || []; const FormItem = Form.Item const rowSelection = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows.slice(-1), selectedRowKeys: selectedRowKeys.slice(-1) }); }, onSelect: (recordt, selected, selectedRows) => { this.setState({ recordt:recordt.id }) }, }; const rowSelections = { selectedRowKeys: this.state.selectedRowKeys, onChange: (selectedRowKeys, selectedRows) => { this.setState({ selectedRows: selectedRows, selectedRowKeys: selectedRowKeys }); }, onSelect: (recordt, selected, selectedRows) => { this.setState({ recordt:recordt.id }) }, }; const formItemLayout = { labelCol: { span: 8 }, wrapperCol: { span: 14 }, }; const { getFieldDecorator } = this.props.form; const hasSelected = this.state.selectedRowKeys.length > 0; const { RangePicker } = DatePicker; const dataSources=this.state.customerArr || []; const options = dataSources.map((group,index) => ) return (
{this.setState({addTitle:e.target.value})}} required="required"/> *
{this.state.addCreateTime}
{ this.setState({ addContent: e.target.value }) }} style={{width:'95%'}}/> *
*
*
*
{this.setState({editTitle:e.target.value})}} required="required"/> *
{ this.setState({ editBody: e.target.value }) }} style={{width:'95%'}}/> *
{this.state.editCreateTime}
{getMessageType(this.state.editSubject)}
{getDesignated(this.state.editConsumerType)}
{ this.setState({ searchMobile: e.target.value }); }} /> { this.setState({ searchName: e.target.value }); }} />
{ this.setState({ roleNameSearch: e.target.value }); }} />
{ this.setState({ nameSearch: e.target.value }); }} />
{ this.setState({ nameSearch: e.target.value }); }} />
{this.setState({shehui:e})}} />
{this.renderTreeNodes(this.state.Interface)}
{this.setState({hangye:e})}} />
); } })); export default SystemMessage;