12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106 |
- 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 {
- Form,
- Radio,
- Icon,
- Button,
- Input,
- Select,
- Spin,
- Table,
- Switch,
- message,
- DatePicker,
- Modal,
- Upload,
- Popconfirm,
- AutoComplete,
- Tabs
- } from 'antd';
- import {patternOrganization,conditionOrganization,client,stick} from '../../dataDic.js';
- import {getPattern,getAchievementCategory,getboutique,getClient,getStick} from '../../tools.js';
- import {ChooseList} from "../order/orderNew/chooseList";
- const TabPane = Tabs.TabPane;
- const Organization=Form.create()(React.createClass({
- loadData(pageNo) {
- this.state.data = [];
- this.setState({
- loading: true,
- ispage:pageNo,
- });
- let nameText=this.state.SuperArr;
- let superText=(this.state.superId)?nameText[parseInt(this.state.superId)].id:undefined;
- let nameTexts=this.state.SuperArrs;
- let superTexts=(this.state.publishPage)?nameTexts[parseInt(this.state.publishPage)].id:undefined;
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/demand/listPublish',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- name: this.state.name, //需求名称
- employerName: this.state.employerName, //需求雇主名称
- publishPlatform:superText,//发布子平台
- publishClient:this.state.publishClient,//发布客户端
- publishPage:superTexts,//发布页面
- ifTop:this.state.ifTop,//是否置顶
- },
- 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.id,//发布需求ID
- achievementId:thisdata.demandId,//成果ID
- publishPlatform:thisdata.publishPlatform,//发布子平台ID
- platformName:thisdata.platformName,//发布子平台ID
- publishClient:thisdata.publishClient.toString(),//发布客户端
- publishPage:thisdata.publishPage,//发布页面
- publishPageName:thisdata.publishPageName,//发布页面
- ifTop:thisdata.ifTop.toString(),//是否置顶
- topNumber:thisdata.topNumber,//置顶编号
- showNumber:thisdata.showNumber,//显示编号
- publisher:thisdata.publisher,//发布人ID
- publishTime:thisdata.publishTime,//发布时间
- serialNumber:thisdata.serialNumber,//成果编号
- name:thisdata.name,//成果名称
- userName:thisdata.userName,//成果所有人
- publisherName:thisdata.publisherName,//发布人名称
- publishTimeFormattedDate:thisdata.publishTimeFormattedDate,//发布时间
- });
- };
- 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));
- },
- loadDatas(pageNo, apiUrl) {
- this.state.data = [];
- if(this.state.serialNumber&&isNaN(this.state.serialNumber)){
- message.warning('请输入正确的编号格式');
- return false;
- }
- this.setState({
- loading: true,
- ispage:pageNo,
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/demand/orgList',
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- serialNumber: this.state.serialNumber, //编号
- name: this.state.name,
- auditStatus:3,//名称
- keyword: this.state.keyword, // 关键词
- category: this.state.category, //类型(0--专利, 2--软著, 3--项目, 4--版权, 5--工业设计, 6--配方, 7--非标)
- releaseDateStartDate: this.state.releaseDate[0],
- releaseDateEndDate: this.state.releaseDate[1],
- releaseStatus: this.state.releaseStatus ? Number(this.state.releaseStatus) : undefined, //是否发布(0--未发布,1--已发布)
- boutique:this.state.boutique,
- hot:this.state.hot,
- createDateStartDate: this.state.releaseDateS[0],
- createDateEndDate: this.state.releaseDateS[1],
- ownerType:this.state.ownerType,
- },
- 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,
- serialNumber: thisdata.serialNumber,
- dataCategory: thisdata.dataCategory,
- name: thisdata.name,
- keyword: thisdata.keyword,
- theName: thisdata.username || thisdata.ownerName,
- category: thisdata.category,
- ownerName: thisdata.username ? thisdata.username : thisdata.ownerName,
- ownerType: thisdata.ownerType,
- ownerMobile: thisdata.ownerMobile,
- status: thisdata.status,
- releaseDate: thisdata.releaseDate,
- releaseDateFormattedDate: thisdata.releaseDateFormattedDate,
- auditStatus: thisdata.auditStatus,
- boutique: thisdata.boutique,
- hot: thisdata.hot,
- releaseStatus: thisdata.releaseStatus,
- techBrokerId:thisdata.techBrokerId,
- createTimeFormattedDate: thisdata.createTimeFormattedDate,
- remark:thisdata.remark,
- ispage:pageNo,
- });
- };
- this.state.paginations.current = data.data.pageNo;
- this.state.paginations.total = data.data.totalCount;
- };
- this.setState({
- dataSourcesli: theArr,
- paginations: this.state.paginations
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false,
- visible: true
- });
- }.bind(this));
- },
- getInitialState() {
- return {
- searchMore: true,
- selectedRowKeys: [],
- selectedRowKeysli:[],
- selectedRows: [],
- releaseDate: [],
- releaseDateS: [],
- loading: false,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- paginations: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadDatas(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- columns: [
- {
- title: '需求编号',
- dataIndex: 'serialNumber',
- key: 'serialNumber',
- }, {
- title: '需求名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '客户名称',
- dataIndex: 'userName',
- key: 'userName',
- }, {
- title: '发布子平台',
- dataIndex: 'platformName',
- key: 'platformName',
- },{
- title: '发布客户端',
- dataIndex: 'publishClient',
- key: 'publishClient',
- render: text => { return getClient(text) }
- }, {
- title: '发布页面',
- dataIndex: 'publishPageName',
- key: 'publishPageName',
- },{
- title: '是否置顶',
- dataIndex: 'ifTop',
- key: 'ifTop',
- render: text => { return getStick(text) }
- }, {
- title: '展示序号',
- dataIndex: 'showNumber',
- key: 'showNumber',
- }, {
- title: '置顶序号',
- dataIndex: 'topNumber',
- key: 'topNumber',
- }, {
- title: '发布人',
- dataIndex: 'publisherName',
- key: 'publisherName',
- }, {
- title: '发布时间',
- dataIndex: 'publishTimeFormattedDate',
- key: 'publishTimeFormattedDate',
- }, {
- title: '操作',
- dataIndex: 'ee',
- key: 'ee',
- render: (text, record, index) => {
- return <div>
- <Popconfirm title={'请确认撤销发布成果【'+record.name+'】'} onConfirm={(e)=>{this.examine(record)}} okText="确认" cancelText="取消">
- <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">撤销发布</Button>
- </Popconfirm>
- </div>
- }
- }
- ],
- dataSource: [],
- searchTime: [,],
- column: [
- {
- title: '编号',
- dataIndex: 'serialNumber',
- key: 'serialNumber',
- }, {
- title: '名称',
- dataIndex: 'name',
- key: 'name',
- }, {
- title: '关键字',
- dataIndex: 'keyword',
- key: 'keyword',
- }, {
- title: '类型',
- dataIndex: 'category',
- key: 'category',
- render: text => { return getAchievementCategory(text); }
- }, {
- title: '录入人',
- dataIndex: 'techBrokerId',
- key: 'techBrokerId',
- },
- {
- title: '是否精品',
- dataIndex: 'boutique',
- key: 'boutique',
- render: text => { return getboutique(text) }
- },
- {
- title: '发布时间',
- dataIndex: 'releaseDateFormattedDate',
- key: 'releaseDateFormattedDate',
- },{
- title: '录入时间',
- dataIndex: 'createTimeFormattedDate',
- key: 'createTimeFormattedDate',
- }
- ],
- dataSourcesli: [],
- searchTime: [,]
- };
- },
- componentWillMount() {
- this.selectSuperIds();
- },
- examine(record) {
- this.setState({
- selectedRowKeys: [],
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/demand/deletePublish',
- data: {
- id:record.id,
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('操作成功');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData(this.state.ispage);
- }.bind(this));
- },
- //获取发布子平台
- selectSuperId() {
- this.state.data = []
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/achievement/getBranchInformation",
- data:{
- },
- success: function (data) {
- let theArr = [];
- let thedata=data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- var contactIds=[];
- for(var i=0;i<data.data.length;i++){
- let theData = data.data[i];
- theArr.push(
- <Select.Option value={i.toString()} key={theData.platformName}>{theData.platformName}</Select.Option>
- );
- };
- this.setState({
- SuperArr:thedata,
- contactsOption: theArr,
- orderStatusOptions:data.data,
- });
- }.bind(this),
- }).always(function () {
- this.loadData();
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //获取发布页面
- selectSuperIds() {
- this.state.data = []
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/demand/getPublishPage",
- data:{
- },
- success: function (data) {
- let theArr = [];
- let thedata=data.data;
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thedata = {};
- };
- var contactIds=[];
- for(var i=0;i<data.data.length;i++){
- let theData = data.data[i];
- theArr.push(
- <Select.Option value={i.toString()} key={theData.name}>{theData.name}</Select.Option>
- );
- };
- this.setState({
- SuperArrs:thedata,
- contactsOptions: theArr,
- orderStatusOptions:data.data,
- });
- }.bind(this),
- }).always(function () {
- this.selectSuperId();
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //编辑部门,保存
- edithandleSubmit(e){
- e.preventDefault();
- if(!this.state.editifTop){
- message.warning('请确认是否置顶');
- return false;
- }
- let topNumbers=(this.state.edittopNumber==9999999)?undefined:this.state.edittopNumber;
- topNumbers=topNumbers?topNumbers:undefined;
- if(this.state.editifTop==0){
- if(!topNumbers){
- message.warning('请输入置顶序号');
- return false;
- }
- let b=this.state.edittopNumber.toString().split('');
- for(var i=0;i<b.length;i++){
- if(parseInt(b[i]).toString()=='NaN'){
- message.warning('置顶序号请输入数字');
- return false;
- };
- }
- }else{
- if(topNumbers){
- message.warning('请清空置顶序号');
- return false;
- }
- if(!this.state.editshowNumber){
- message.warning('请输入展示序号');
- return false;
- }
- let b=this.state.editshowNumber.toString().split('');
- for(var i=0;i<b.length;i++){
- if(parseInt(b[i]).toString()=='NaN'){
- message.warning('展示序号请输入数字');
- return false;
- };
- }
- }
- //上级组织字典
- let nameText=this.state.SuperArr;
- let nameTexts=this.state.SuperArrs;
- let superText=(parseInt(this.state.editpublishPlatform).toString()=='NaN')?undefined:nameText[parseInt(this.state.editpublishPlatform)].id;
- let superTexts=(parseInt(this.state.editpublishPage).toString()=='NaN')?undefined:nameTexts[parseInt(this.state.editpublishPage)].id;
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/demand/updatePublish',
- data:{
- id:this.state.editid,//成果发布ID
- demandId:this.state.editachievementId, //成果ID
- publishPlatform:superText,//发布平台
- publishClient:this.state.editpublishClient,//发布客户端
- publishPage:superTexts,//发布页面
- ifTop:this.state.editifTop,//是否置顶
- topNumber:topNumbers,//置顶序号
- showNumber:this.state.editshowNumber,//展示序号
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.edithandleCancel();
- this.selectSuperId();
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this));
- },
- //整行点击
- tableRowClick(record, index) {
- this.selectSuperIds();
- this.state.RowData = record;
- this.setState({
- editvisible: true,
- selectedRowKeys:[],
- editid:record.id,
- editachievementId:record.achievementId,
- editpublishPlatform:record.platformName,
- editpublishClient:record.publishClient,
- editpublishPage:record.publishPageName,
- editifTop:record.ifTop,
- edittopNumber:record.topNumber,
- editshowNumber:record.showNumber,
- editserialNumber:record.serialNumber,
- editname:record.name,
- edituserName:record.userName,
- })
- },
- //新增一个部门,保存
- addhandleSubmit(e){
- e.preventDefault();
- if(!this.state.publishPlatform){
- message.warning('请选择发布子平台');
- return false;
- }
- if(!this.state.publishClient){
- message.warning('请选择发布客户端');
- return false;
- }
- if(!this.state.publishPage){
- message.warning('请选择发布页面');
- return false;
- }
- if(!this.state.ifTop){
- message.warning('请确认是否置顶');
- return false;
- }
- if(this.state.ifTop==0){
- if(!this.state.topNumber){
- message.warning('请输入置顶序号');
- return false;
- }
- let b=this.state.topNumber.split('');
- for(var i=0;i<b.length;i++){
- if(parseInt(b[i]).toString()=='NaN'){
- message.warning('置顶序号请输入数字');
- return false;
- };
- }
- }else{
- if(this.state.topNumber){
- message.warning('请清空置顶序号');
- return false;
- }
- if(!this.state.showNumber){
- message.warning('请输入展示序号');
- return false;
- }
- let b=this.state.showNumber.split('');
- for(var i=0;i<b.length;i++){
- if(parseInt(b[i]).toString()=='NaN'){
- message.warning('展示序号请输入数字');
- return false;
- };
- }
- }
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- //上级组织字典
- let nameText=this.state.SuperArr;
- let superText=nameText[parseInt(this.state.publishPlatform)].id;
- let nameTexts=this.state.SuperArrs;
- let superTexts=nameTexts[parseInt(this.state.publishPage)].id;
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/demand/addDemandPublish',
- data:{
- demandId:this.state.selectedRowKeysli?this.state.selectedRowKeysli.join(","):undefined,//成果ID
- publishPlatform:superText,//发布平台
- publishClient:this.state.publishClient,//发布客户端
- publishPage:superTexts, //发布页面
- ifTop:this.state.ifTop,//是否置顶
- topNumber:this.state.topNumber,//置顶序号
- showNumber:this.state.showNumber,//展示序号
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.handleCancel();
- this.reset();
- } 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){
- // let theType='';
- // let contactLists=this.state.customerArr||[];
- // if (e) {
- // contactLists.map(function (item) {
- // if (item.name == e.toString()) {
- // theType = item.id;
- // }
- // });
- // }
- this.setState({
- theTypes:e
- })
- },
- //值改变时请求客户名称
- httpChange(e){
- if(e.length>=2){
- this.supervisor(e);
- }
- this.setState({
- managerIdOrganization:e
- })
- },
- addClick() {
- this.state.name = undefined;//成果名称清零
- this.state.publishPlatform = undefined;//发布子平台清零
- this.state.publishClient = undefined;//发布客户端清零
- this.state.publishPage = undefined;//发布页面清零
- this.state.ifTop = undefined;//是否置顶清零
- this.state.topNumber = undefined;//置顶序号清零
- this.state.showNumber = undefined;//展示序号清零
- this.state.selectedRowKeysli=undefined;//选定的成果ID清零
- this.state.RowData = {};
- this.selectSuperId();
- this.loadDatas();
- },
- editClick() {
- this.state.RowData = {};
- this.setState({
- editvisible: true
- });
- },
- handleCancel() {
- this.setState({ visible: false })
- },
- edithandleCancel() {
- this.setState({ editvisible: false })
- },
- search() {
- this.loadData();
- },
- searchs() {
- this.loadDatas();
- },
- //把搜索的部分置零
- reset() {
- this.state.name = undefined;//成果名称清零
- this.state.superId = undefined;//发布子平台清零
- this.state.employerName= undefined;//需求雇主清零
- this.state.publishClient = undefined;//发布客户端清零
- this.state.publishPage = undefined;//发布页面清零
- this.state.ifTop = undefined;//是否置顶清零
- this.selectSuperId();
- },
- resets() {
- this.state.serialNumber = undefined;
- this.state.name = undefined;
- this.state.keyword = undefined;
- this.state.infoSources = undefined;
- this.state.demandType = undefined;
- this.state.searchName = undefined;
- this.state.searchType = 0;
- this.state.boutique = '';
- this.state.hot='' ;
- this.state.status = undefined;
- this.state.releaseStatus = undefined;
- this.state.auditStatus = undefined;
- this.state.dataCategory = undefined;
- this.state.validityPeriodDate = [];
- this.state.releaseDate = [];
- this.state.releaseDateS = [];
- this.loadDatas();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- changeList(arr) {
- const newArr = [];
- this.state.columns.forEach(item => {
- arr.forEach(val => {
- if (val === item.title) {
- newArr.push(item);
- }
- });
- });
- this.setState({
- changeList: newArr
- });
- },
- render() {
- 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 = {
- selectedRowKeysli: this.state.selectedRowKeysli,
- onChange: (selectedRowKeysli, selectedRows) => {
- this.setState({
- selectedRows: selectedRows,
- selectedRowKeysli: selectedRowKeysli
- });
- },
- 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) =>
- <Option key={index} value={group.name}>{group.name}</Option>
- )
- return (
- <div className="user-content" >
- <div className="content-title">
- <Tabs defaultActiveKey="1" className="test">
- <TabPane tab="搜索" key="1">
- <div className="user-search">
- <Input placeholder="需求名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
- value={this.state.name}
- onChange={(e) => { this.setState({ name: e.target.value }); }} />
- <Input placeholder="需求雇主名称"
- value={this.state.employerName}
- onChange={(e) => { this.setState({ employerName: e.target.value }); }} />
- <Select placeholder="发布子平台"
- style={{ width:'200px',marginRight:'10px' }}
- value={this.state.superId}
- onChange={(e) => { this.setState({ superId: e }) }} notFoundContent="未获取到上级组织列表">
- {this.state.contactsOption}
- </Select>
- <Select placeholder="发布客户端"
- style={{width:'150px',marginRight:'20px'}}
- value={this.state.publishClient}
- onChange={(e) => { this.setState({ publishClient: e }) }}>
- <Select.Option value="0" >网站</Select.Option>
- <Select.Option value="1" >APP</Select.Option>
- </Select>
- <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
- <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
- <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- <div style={this.state.searchMore ? { display: 'none' } : {display: 'inline-block'}}>
- <Select placeholder="发布页面"
- style={{ width:'200px',marginRight:'10px' }}
- value={this.state.publishPage}
- onChange={(e) => { this.setState({ publishPage: e }) }} notFoundContent="未获取到发布页面">
- {this.state.contactsOptions}
- </Select>
- <Select placeholder="是否置顶"
- style={{width:'150px',marginRight:'50px'}}
- value={this.state.ifTop}
- onChange={(e) => { this.setState({ ifTop: e }) }}>
- <Select.Option value="0" >置顶</Select.Option>
- <Select.Option value="1" >不置顶</Select.Option>
- </Select>
- </div>
- <Button type="primary" className="addButton" onClick={this.addClick} style={{marginBottom:'10px'}}>发布需求<Icon type="plus" /></Button>
- </div>
- </TabPane>
- <TabPane tab="更改表格显示数据" key="2">
- <div style={{ marginLeft: 10 }}>
- <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- margin={11}
- />
- </div>
- </TabPane>
- </Tabs>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={
- this.state.changeList
- ? this.state.changeList
- : this.state.columns
- }
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- style={{
- cursor: 'pointer',
- }}
- onRowClick={this.tableRowClick} />
- </Spin>
- </div>
- <div className="patent-desc">
- <Modal maskClosable={false} visible={this.state.visible}
- onOk={this.checkPatentProcess} onCancel={this.handleCancel}
- width='1200px'
- title='发布需求'
- footer=''
- className="admin-desc-content">
- <Form horizontal onSubmit={this.addhandleSubmit} id="add-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="发布子平台"
- >
- <Select placeholder="请选择子平台" value={this.state.publishPlatform} onChange={(e)=>{this.setState({publishPlatform:e})}}
- notFoundContent="未获取到子平台">
- {this.state.contactsOption}
- </Select>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="发布客户端"
- >
- <Select placeholder="选择客户端" value={this.state.publishClient}
- onChange={(e)=>{this.setState({publishClient:e})}}>
- {
- client.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="发布页面位置"
- >
- <Select placeholder="请选择页面位置" value={this.state.publishPage} onChange={(e)=>{this.setState({publishPage:e})}}
- notFoundContent="未获取到页面位置">
- {this.state.contactsOptions}
- </Select>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="是否置顶"
- >
- <Select placeholder="选择是否置顶" value={this.state.ifTop}
- onChange={(e)=>{this.setState({ifTop:e})}}>
- {
- stick.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12 }}
- label="置顶序号" >
- <Input placeholder="请输入置顶序号" value={this.state.topNumber}
- onChange={(e)=>{this.setState({topNumber:e.target.value})}}/>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 7 }}
- wrapperCol={{ span: 12}}
- label="展示序号" >
- <Input placeholder="请输入展示序号" value={this.state.showNumber}
- onChange={(e)=>{this.setState({showNumber:e.target.value})}}/>
- </FormItem>
- </div>
- <div className="user-search">
- <Input placeholder="需求编号" style={{"width":"150px","display":"inlineBlock","marginRight":"10px",'marginBottom':"5px"}}
- value={this.state.serialNumber}
- onChange={(e) => { this.setState({ serialNumber: e.target.value }); }} />
- <Input placeholder="需求名称" style={{"width":"150px","display":"inlineBlock","marginRight":"10px",'marginBottom':"5px"}}
- value={this.state.name}
- onChange={(e) => { this.setState({ name: e.target.value }); }} />
- <Input placeholder="关键字" style={{"width":"150px","display":"inlineBlock","marginRight":"10px",'marginBottom':"5px"}}
- value={this.state.keyword}
- onChange={(e) => { this.setState({ keyword: e.target.value }); }} />
- <span style={{"marginRight":"5px"}}>是否精品 :</span>
- <Radio.Group value={this.state.boutique} onChange={(e) => {
- this.setState({ boutique: e.target.value })
- }}>
- <Radio value={1}>精品</Radio>
- <Radio value={0}>非精品</Radio>
- </Radio.Group>
- <span style={{ marginLeft: '5px' }}>发布时间 : </span>
- <RangePicker style={{"marginRight":"150px"}}
- value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
- this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
- onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
- <span style={{ marginLeft: '10px' }}>录入时间 : </span>
- <RangePicker style={{"display":"inlineBlock",'marginRight':'10px'}}
- value={[this.state.releaseDateS[0] ? moment(this.state.releaseDateS[0]) : null,
- this.state.releaseDateS[1] ? moment(this.state.releaseDateS[1]) : null]}
- onChange={(data, dataString) => { this.setState({ releaseDateS: dataString }); }} />
- <Button type="primary" onClick={this.searchs} style={{"display":"inlineBlock",'marginRight':'10px'}}>搜索</Button>
- <Button onClick={this.resets} style={{"display":"inlineBlock",'marginRight':'10px'}}>重置</Button>
- </div>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.column}
- dataSource={this.state.dataSourcesli}
- rowSelection={rowSelections}
- pagination={this.state.paginations}
- />
- </Spin>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 7 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'100px'}}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- <div className="patent-desc">
- <Modal maskClosable={false} visible={this.state.editvisible}
- onOk={this.checkPatentProcess} onCancel={this.edithandleCancel}
- width='900px'
- title='编辑发布'
- footer=''
- className="admin-desc-content">
- <Form horizontal onSubmit={this.edithandleSubmit} id="edit-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="发布子平台"
- >
- <Select placeholder="请选择子平台" value={this.state.editpublishPlatform} onChange={(e)=>{this.setState({editpublishPlatform:e})}}
- notFoundContent="未获取到子平台">
- {this.state.contactsOption}
- </Select>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="发布客户端"
- >
- <Select placeholder="选择客户端" value={this.state.editpublishClient}
- onChange={(e)=>{this.setState({editpublishClient:e})}}>
- {
- client.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="发布页面位置"
- >
- <Select placeholder="请选择页面位置" value={this.state.editpublishPage} onChange={(e)=>{this.setState({editpublishPage:e})}}
- notFoundContent="未获取到页面位置">
- {this.state.contactsOptions}
- </Select>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="是否置顶"
- >
- <Select placeholder="选择是否置顶" value={this.state.editifTop}
- onChange={(e)=>{this.setState({editifTop:e})}}>
- {
- stick.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="置顶序号" >
- <Input placeholder="请输入置顶序号" value={this.state.edittopNumber}
- onChange={(e)=>{this.setState({edittopNumber:e.target.value})}}/>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12}}
- label="展示序号" >
- <Input placeholder="请输入展示序号" value={this.state.editshowNumber}
- onChange={(e)=>{this.setState({editshowNumber:e.target.value})}}/>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="需求编号"
- >
- <span>{this.state.editserialNumber}</span>
- </FormItem>
- <FormItem className="half-item"
- labelCol={{ span: 6 }}
- wrapperCol={{ span: 12 }}
- label="客户名称"
- >
- <span>{this.state.edituserName}</span>
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 3 }}
- wrapperCol={{ span: 18 }}
- label="需求名称"
- >
- <span>{this.state.editname}</span>
- </FormItem>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 7 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px'}}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- </div>
- </div>
- );
- }
- }));
- export default Organization;
|