businessProject.jsx 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689
  1. import React from 'react';
  2. import ReactDom from 'react-dom';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import '../content.less';
  7. import { citySelect,provinceList,areaSelect,provinceSelect} from '../../../NewDicProvinceListAll';
  8. import { Form,Radio, Icon, Button, Input,Tabs, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker,Cascader } from 'antd';
  9. import {categoryState,industry,conditionOrganization,gameState} from '../../../dataDic.js';
  10. import {getCategoryState,getGameState,splitUrl,getprovince} from '../../../tools.js';
  11. const TabPane = Tabs.TabPane;
  12. //图片组件
  13. const PicturesWall = React.createClass({
  14. getInitialState() {
  15. return {
  16. previewVisible: false,
  17. previewImage: '',
  18. fileList: [],
  19. }
  20. },
  21. handleCancel() {
  22. this.setState({ previewVisible: false })
  23. },
  24. handlePreview(file) {
  25. this.setState({
  26. previewImage: file.url || file.thumbUrl,
  27. previewVisible: true,
  28. });
  29. },
  30. handleChange(info) {
  31. let fileList = info.fileList;
  32. this.setState({ fileList });
  33. this.props.fileList(fileList);
  34. },
  35. componentWillReceiveProps(nextProps) {
  36. this.state.fileList = nextProps.pictureUrl;
  37. },
  38. render() {
  39. const { previewVisible, previewImage, fileList } = this.state;
  40. const uploadButton = (
  41. <div>
  42. <Icon type="plus" />
  43. <div className="ant-upload-text">点击上传</div>
  44. </div>
  45. );
  46. return (
  47. <div style={{display:"inline-block"}}>
  48. <Upload
  49. action={globalConfig.context + "/api/admin/ProjectSize/uploadPicture"}
  50. data={{ 'sign': this.props.pictureSign }}
  51. listType="picture-card"
  52. fileList={fileList}
  53. onPreview={this.handlePreview}
  54. onChange={this.handleChange} >
  55. {fileList.length >= 1 ? null : uploadButton}
  56. </Upload>
  57. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  58. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  59. </Modal>
  60. </div>
  61. );
  62. }
  63. });
  64. //主体
  65. const BusinessProject=Form.create()(React.createClass({
  66. //搜索功能和初始列表加载
  67. loadData(pageNo, apiUrl) {
  68. this.state.data = [];
  69. this.setState({
  70. loading: true,
  71. ispage:pageNo,
  72. });
  73. let nameText=this.state.SuperArr;
  74. let superText=(this.state.cid)?nameText[parseInt(this.state.cid)].id:"";
  75. let isCountry='';
  76. let pro='';
  77. let city='';
  78. let dis='';
  79. if(this.state.ressSearch==undefined){
  80. }else{
  81. switch(parseInt(this.state.ressSearch.length)){
  82. case 1:pro=this.state.ressSearch[0];break;
  83. case 2:pro=this.state.ressSearch[0];city=this.state.ressSearch[1];break;
  84. case 3:pro=this.state.ressSearch[0];city=this.state.ressSearch[1];dis=this.state.ressSearch[2];break;
  85. }
  86. }
  87. if(pro===0){
  88. isCountry=1;
  89. pro='';
  90. }
  91. $.ajax({
  92. method: "post",
  93. dataType: "json",
  94. crossDomain: false,
  95. url: globalConfig.context + '/api/admin/ProjectSize/listProject',
  96. data: {
  97. pageNo: pageNo || 1,
  98. pageSize: this.state.pagination.pageSize,
  99. bname:this.state.bname, //项目名称
  100. cid:superText, //品类名称
  101. country:isCountry, //是否全国
  102. province:pro, //省
  103. city:city, //市
  104. district:dis, //区
  105. activityFlag:this.state.activityFlag, //活动生效标识
  106. status:this.state.status, //项目状态
  107. },
  108. success: function (data) {
  109. let theArr = [];
  110. if (!data.data || !data.data.list) {
  111. if (data.error && data.error.length) {
  112. message.warning(data.error[0].message);
  113. };
  114. } else {
  115. for (let i = 0; i < data.data.list.length; i++) {
  116. let thisdata = data.data.list[i];
  117. let ProvinceCity=[];
  118. let isCountry='';
  119. if(thisdata.country==1){
  120. isCountry="全国";
  121. }else{
  122. if(thisdata.city==null||thisdata.city==''){
  123. isCountry+=getprovince(parseInt(thisdata.province));
  124. }else if(thisdata.district==null||thisdata.district==''){
  125. isCountry+=getprovince(parseInt(thisdata.province))+'-';
  126. isCountry+=getprovince(parseInt(thisdata.city));
  127. }else{
  128. isCountry+=getprovince(parseInt(thisdata.province))+'-';
  129. isCountry+=getprovince(parseInt(thisdata.city))+'-';
  130. isCountry+=getprovince(parseInt(thisdata.district));
  131. }
  132. }
  133. theArr.push({
  134. key: i,
  135. id:thisdata.id,//业务名称
  136. bname: thisdata.bname,//业务名称
  137. cname: thisdata.cname,//业务品类
  138. area:isCountry?isCountry:ProvinceCity,
  139. price: thisdata.price,//市场价
  140. offset:thisdata.offset,//最低折扣
  141. memberPrice:thisdata.memberPrice,//会员价
  142. activityPrice:thisdata.activityPrice,//活动价
  143. activityFlag:thisdata.activityFlag,//活动生效标识
  144. status: thisdata.status,//项目状态
  145. arrProvinceCity:ProvinceCity,
  146. });
  147. };
  148. this.state.pagination.current = data.data.pageNo;
  149. this.state.pagination.total = data.data.totalCount;
  150. };
  151. this.setState({
  152. dataSource: theArr,
  153. pagination: this.state.pagination
  154. });
  155. }.bind(this),
  156. }).always(function () {
  157. this.setState({
  158. loading: false
  159. });
  160. }.bind(this));
  161. },
  162. //项目规格列表
  163. formatLoadData(pageNo, apiUrl){
  164. this.state.data = [];
  165. this.setState({
  166. loading: true,
  167. });
  168. $.ajax({
  169. method: "get",
  170. dataType: "json",
  171. crossDomain: false,
  172. url: globalConfig.context + '/api/admin/ProjectSize/listProjectSize',
  173. data: {
  174. pageNo: pageNo || 1,
  175. pageSize: this.state.formatPagination.pageSize,
  176. pid:this.state.editId,
  177. },
  178. success: function (data) {
  179. let theArr = [];
  180. if (!data.data || !data.data.list) {
  181. if (data.error && data.error.length) {
  182. message.warning(data.error[0].message);
  183. };
  184. } else {
  185. for (let i = 0; i < data.data.list.length; i++) {
  186. let thisdata = data.data.list[i];
  187. theArr.push({
  188. key: i,
  189. formatId:thisdata.id,//规格ID
  190. formatPname: thisdata.pname,//规格名称
  191. formatBname: thisdata.bname,//项目品类
  192. formatPrice: thisdata.price,//市场价
  193. formatOffset: thisdata.offset,//最低折扣
  194. formatActivityPrice: thisdata.activityPrice,//活动价
  195. formatActivityFlag:thisdata.activityFlag,//活动生效标识
  196. formatMemberPrice:thisdata.memberPrice,//会员价
  197. formatStatus:thisdata.status,//会员价
  198. });
  199. };
  200. this.state.formatPagination.current = data.data.pageNo;
  201. this.state.formatPagination.total = data.data.totalCount;
  202. };
  203. this.setState({
  204. formatDataSource: theArr,
  205. formatPagination: this.state.formatPagination
  206. });
  207. }.bind(this),
  208. }).always(function () {
  209. this.setState({
  210. loading: false
  211. });
  212. }.bind(this));
  213. },
  214. getInitialState() {
  215. return {
  216. searchMore: true,
  217. selectedRowKeys: [],
  218. selectedRows: [],
  219. loading: false,
  220. orgCodeUrl: [],
  221. companyLogoUrl: [],
  222. pagination: {
  223. defaultCurrent: 1,
  224. defaultPageSize: 10,
  225. showQuickJumper: true,
  226. pageSize: 10,
  227. onChange: function (page) {
  228. this.loadData(page);
  229. }.bind(this),
  230. showTotal: function (total) {
  231. return '共' + total + '条数据';
  232. }
  233. },
  234. formatPagination: {
  235. defaultCurrent: 1,
  236. defaultPageSize: 10,
  237. showQuickJumper: true,
  238. pageSize: 10,
  239. onChange: function (page) {
  240. this.loadData(page);
  241. }.bind(this),
  242. showTotal: function (total) {
  243. return '共' + total + '条数据';
  244. }
  245. },
  246. ContactsLists: [{
  247. title: '业务项目名称',
  248. dataIndex: 'formatBname',
  249. key: 'formatBname',
  250. }, {
  251. title: '规格名称',
  252. dataIndex: 'formatPname',
  253. key: 'formatPname',
  254. }, {
  255. title: '市场价',
  256. dataIndex: 'formatPrice',
  257. key: 'formatPrice',
  258. }, {
  259. title: '最低折扣',
  260. dataIndex: 'formatOffset',
  261. key: 'formatOffset',
  262. }, {
  263. title: '会员价',
  264. dataIndex: 'formatMemberPrice',
  265. key: 'formatMemberPrice',
  266. }, {
  267. title: '活动价',
  268. dataIndex: 'formatActivityPrice',
  269. key: 'formatActivityPrice',
  270. }, {
  271. title: '活动生效标识',
  272. dataIndex: 'formatActivityFlag',
  273. key: 'formatActivityFlag',
  274. render: text => { return getGameState(text) }
  275. },{
  276. title: '状态',
  277. dataIndex: 'formatStatus',
  278. key: 'formatStatus',
  279. render: text => { return getCategoryState(text.toString()) }
  280. }
  281. ],
  282. formatDataSource: [],
  283. columns: [
  284. {
  285. title: '项目名称',
  286. dataIndex: 'bname',
  287. key: 'bname',
  288. }, {
  289. title: '业务品类',
  290. dataIndex: 'cname',
  291. key: 'cname',
  292. }, {
  293. title: '业务地区',
  294. dataIndex: 'area',
  295. key: 'area',
  296. // render: text => { return getprovince(text); }
  297. }, {
  298. title: '市场价',
  299. dataIndex: 'price',
  300. key: 'price',
  301. }, {
  302. title: '最低折扣',
  303. dataIndex: 'offset',
  304. key: 'offset',
  305. }, {
  306. title: '会员价',
  307. dataIndex: 'memberPrice',
  308. key: 'memberPrice',
  309. }, {
  310. title: '活动价',
  311. dataIndex: 'activityPrice',
  312. key: 'activityPrice',
  313. }, {
  314. title: '活动生效标识',
  315. dataIndex: 'activityFlag',
  316. key: 'activityFlag',
  317. render: text => { return getGameState(text) }
  318. },{
  319. title: '业务状态',
  320. dataIndex: 'status',
  321. key: 'status',
  322. render: text => { return getCategoryState(text) }
  323. }
  324. ],
  325. dataSource: [],
  326. };
  327. },
  328. componentWillMount() {
  329. this.selectSuperId();
  330. },
  331. //获取上级品类
  332. selectSuperId() {
  333. this.state.data = []
  334. $.ajax({
  335. method: "get",
  336. dataType: "json",
  337. crossDomain: false,
  338. url: globalConfig.context + "/api/admin/ProjectSize/getAllCname",
  339. data:{
  340. flag:0,
  341. },
  342. success: function (data) {
  343. let theArr = [];
  344. let thedata=data.data;
  345. if (!thedata) {
  346. if (data.error && data.error.length) {
  347. message.warning(data.error[0].message);
  348. };
  349. thedata = {};
  350. };
  351. var contactIds=[];
  352. for(var i=0;i<data.data.length;i++){
  353. let theData = data.data[i];
  354. theArr.push(
  355. <Select.Option value={i.toString()} key={theData.cname}>{theData.cname}</Select.Option>
  356. );
  357. };
  358. this.setState({
  359. SuperArr:thedata,
  360. contactsOption: theArr,
  361. orderStatusOptions:data.data,
  362. });
  363. console.log(theArr);
  364. }.bind(this),
  365. }).always(function () {
  366. this.loadData(this.state.ispage);
  367. this.setState({
  368. loading: false
  369. });
  370. }.bind(this));
  371. },
  372. //编辑部门,保存
  373. edithandleSubmit(e){
  374. e.preventDefault();
  375. let offsetText;
  376. if(this.state.editOffset){
  377. if(this.state.editOffset>10||this.state.editOffset<0){
  378. message.warning('最低折扣请输入0到10之间的数字');
  379. return false;
  380. }else{
  381. offsetText=this.state.editOffset;
  382. }
  383. }
  384. this.props.form.validateFields((err, values) => {
  385. let theorgCodeUrl = [];
  386. if(this.state.orgCodeUrl.length) {
  387. let picArr = [];
  388. this.state.orgCodeUrl.map(function(item) {
  389. if ( item.response && item.response.data && item.response.data.length ){
  390. picArr.push(item.response.data);
  391. }
  392. });
  393. theorgCodeUrl = picArr.join(",");
  394. };
  395. let thecompanyLogoUrl = [];
  396. if(this.state.companyLogoUrl.length) {
  397. let picArr = [];
  398. this.state.companyLogoUrl.map(function(item) {
  399. if ( item.response && item.response.data && item.response.data.length ){
  400. picArr.push(item.response.data);
  401. }
  402. });
  403. thecompanyLogoUrl = picArr.join(",");
  404. };
  405. if(!err) {
  406. this.setState({
  407. loading: true
  408. });
  409. let nameText=this.state.SuperArr
  410. let num = 0
  411. nameText.forEach((item,index) => {
  412. if(item.cname == this.state.editCname) {
  413. num = index
  414. }
  415. })
  416. // let superText=(this.state.editCname.length==1)?nameText[parseInt(this.state.editCname)].id:this.state.editCid;
  417. // let superText=nameText[parseInt(this.state.editCname)].id
  418. let superText=nameText[parseInt(num)].id
  419. let isCountry=0;
  420. let pro='';
  421. let city='';
  422. let dis='';
  423. if(this.state.ProvinceCity==undefined||this.state.ProvinceCity.length==0){
  424. message.warning('请选择项目有效范围');
  425. this.setState({
  426. loading: false
  427. });
  428. return false;
  429. }else{
  430. switch(parseInt(this.state.ProvinceCity.length)){
  431. case 1:pro=this.state.ProvinceCity[0];break;
  432. case 2:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];break;
  433. case 3:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];dis=this.state.ProvinceCity[2];break;
  434. }
  435. }
  436. if(pro==0){
  437. isCountry=1;
  438. pro='';
  439. }
  440. $.ajax({
  441. method: "post",
  442. dataType: "json",
  443. crossDomain: false,
  444. url:globalConfig.context + '/api/admin/ProjectSize/updateProject',
  445. data:{
  446. id:this.state.editId,//项目ID
  447. cid:superText,//项目业务品类
  448. bname:this.state.editName,//业务项目名称
  449. price:this.state.editPrice,//市场价
  450. firstPayment:this.state.firstPayment,//首付金额
  451. offset:offsetText,//最低折扣
  452. activityPrice:this.state.editActivityPrice,//活动价
  453. activityFlag:this.state.editActivityFlag,//活动生效标识
  454. memberPrice:this.state.editMemberPrice,//项目ID
  455. status:this.state.editStatus,//项目状态
  456. type: this.state.typeStatus,//项目分类
  457. country:isCountry,//是否全国
  458. province:pro?pro:'',//省
  459. city:city?city:'',//市
  460. district:dis?dis:'',//区
  461. minLogo:theorgCodeUrl,
  462. maxLogo:thecompanyLogoUrl,
  463. introduce:this.state.editIntroduce,//项目介绍
  464. projectUrl:this.state.editProjectUrl,//项目地址
  465. valueEffect:this.state.editValueEffect,//项目价值及作用
  466. clientSize:this.state.editClientSize,//项目基本条件
  467. boutique:this.state.editBoutique,
  468. }
  469. }).done(function (data) {
  470. this.setState({
  471. loading: false
  472. });
  473. if (!data.error.length) {
  474. message.success('保存成功!');
  475. this.edithandleCancel();
  476. this.selectSuperId();
  477. } else {
  478. message.warning(data.error[0].message);
  479. }
  480. }.bind(this));
  481. }
  482. })
  483. },
  484. //规格列表整行点击
  485. formatTableRowClick(record, index){
  486. this.editformatClick();
  487. this.state.RowData = record;
  488. this.setState({
  489. selectedRowKeys:[],
  490. formatId:record.formatId,//规格名称
  491. formatPname:record.formatPname,//规格名称
  492. formatPrice:record.formatPrice,//市场价
  493. formatOffset:record.formatOffset,//最低折扣
  494. formatActivityPrice:record.formatActivityPrice,//活动价
  495. formatActivityFlag:record.formatActivityFlag,//活动生效标识
  496. formatMemberPrice:record.formatMemberPrice,//会员价
  497. formatStatus:record.formatStatus.toString(),//项目状态
  498. });
  499. },
  500. //项目列表整行点击
  501. tableRowClick(record, index) {
  502. this.selectSuperId();
  503. this.state.RowData = record;
  504. this.setState({
  505. callnub:'1',
  506. editvisible: true,
  507. selectedRowKeys:[],
  508. rowId:record.businessId,
  509. });
  510. $.ajax({
  511. method: "get",
  512. dataType: "json",
  513. crossDomain: false,
  514. url: globalConfig.context +"/api/admin/ProjectSize/orgProject" ,
  515. data: {
  516. id: record.id
  517. },
  518. success: function (data) {
  519. let theArr = [];
  520. let ProvinceCity=[];
  521. let thisdata = data.data;
  522. if (!data) {
  523. if (data.error && data.error.length) {
  524. message.warning(data.error[0].message);
  525. };
  526. } else {
  527. if(thisdata.country==1){
  528. ProvinceCity.push(0);
  529. }else{
  530. ProvinceCity.push(parseInt(thisdata.province));
  531. ProvinceCity.push(parseInt(thisdata.city));
  532. ProvinceCity.push(parseInt(thisdata.district));
  533. }
  534. let str = ""
  535. if(thisdata.type == 0) {
  536. str = "通用"
  537. }else if(thisdata.type == 1) {
  538. str = "专利"
  539. }else if(thisdata.type == 2) {
  540. str = "软著"
  541. }
  542. theArr.push({
  543. editId: thisdata.id,//每一条记录的ID
  544. editName:thisdata.bname,//项目名称
  545. editCname: thisdata.cname,//项目分类
  546. editCid: thisdata.cid,//项目分类
  547. editCountry: thisdata.country,//是否全国
  548. editProvince: thisdata.province,//省
  549. editCity: thisdata.city,//市
  550. editDistrict: thisdata.district,//区
  551. editPrice: thisdata.price,//市场价
  552. firstPayment:thisdata.firstPayment,//首付金额
  553. editActivityPrice: thisdata.activityPrice,//活动价
  554. editOffset: thisdata.offset,//最低折扣
  555. editMemberPrice: thisdata.memberPrice,//会员价
  556. editActivityFlag:thisdata.activityFlag,//活动生效标识
  557. editStatus:thisdata.status,//品类状态
  558. typeStr: str,
  559. typeStatus: thisdata.type,
  560. editCreateId:thisdata.createName,//创建人
  561. editTime:thisdata.createTimeFormattedDate,//创建时间
  562. editIntroduce:thisdata.introduce,//服务内容
  563. editProjectUrl:thisdata.projectUrl,//项目地址
  564. editValueEffect:thisdata.valueEffect,//价值及作用
  565. editClientSize:thisdata.clientSize,//基本条件
  566. editBoutique:thisdata.boutique,//是否精品
  567. orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
  568. cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
  569. });
  570. };
  571. let str = ""
  572. if(thisdata.type == 0) {
  573. str = "通用"
  574. }else if(thisdata.type == 1) {
  575. str = "专利"
  576. }else if(thisdata.type == 2) {
  577. str = "软著"
  578. }
  579. this.setState({
  580. editId: thisdata.id, //每一条记录的ID
  581. editName: thisdata.bname, //项目名称
  582. editCname: thisdata.cname, //项目分类
  583. editCid: thisdata.cid, //项目分类
  584. editCountry: thisdata.country, //是否全国
  585. editProvince: thisdata.province, //省
  586. editCity: thisdata.city, //市
  587. editDistrict: thisdata.district, //区
  588. editPrice: thisdata.price, //市场价
  589. firstPayment: thisdata.firstPayment,
  590. editActivityPrice: thisdata.activityPrice, //活动价
  591. editOffset: thisdata.offset, //最低折扣
  592. editMemberPrice: thisdata.memberPrice, //会员价
  593. editActivityFlag: thisdata.activityFlag, //活动生效标识
  594. editStatus: thisdata.status, //品类状态
  595. typeStr: str,
  596. typeStatus: thisdata.type,
  597. editCreateId: thisdata.createName, //创建人
  598. editTime: thisdata.createTimeFormattedDate, //创建时间
  599. editIntroduce: thisdata.introduce, //服务内容
  600. editProjectUrl: thisdata.projectUrl, //项目地址
  601. editValueEffect: thisdata.valueEffect, //价值及作用
  602. editClientSize: thisdata.clientSize, //基本条件
  603. editBoutique: thisdata.boutique, //是否精品
  604. orgCodeUrl: thisdata.minLogo
  605. ? splitUrl(
  606. thisdata.minLogo,
  607. ",",
  608. globalConfig.avatarHost + "/upload"
  609. )
  610. : [],
  611. companyLogoUrl: thisdata.maxLogo
  612. ? splitUrl(
  613. thisdata.maxLogo,
  614. ",",
  615. globalConfig.avatarHost + "/upload"
  616. )
  617. : [],
  618. editDataSource: theArr,
  619. ProvinceCity: ProvinceCity
  620. });
  621. }.bind(this),
  622. }).always(function () {
  623. this.setState({
  624. loading: false
  625. });
  626. }.bind(this));
  627. },
  628. //左侧图片地址
  629. getOrgCodeUrl(e) {
  630. this.setState({ orgCodeUrl: e });
  631. },
  632. //右侧图片地址
  633. getCompanyLogoUrl(e) {
  634. this.setState({ companyLogoUrl: e });
  635. },
  636. //编辑一个规格,保存
  637. editformathandleSubmit(e){
  638. e.preventDefault();
  639. let offsetText;
  640. if(this.state.formatOffset){
  641. if(this.state.formatOffset>10||this.state.formatOffset<0){
  642. message.warning('最低折扣请输入0到10之间的数字');
  643. return false;
  644. }else{
  645. offsetText=this.state.formatOffset;
  646. }
  647. }
  648. this.props.form.validateFields((err, values) => {
  649. if (!err) {
  650. this.setState({
  651. loading: true
  652. });
  653. $.ajax({
  654. method: "post",
  655. dataType: "json",
  656. crossDomain: false,
  657. url:globalConfig.context + '/api/admin/ProjectSize/orgProjectSize',
  658. data:{
  659. id:this.state.formatId,//项目ID
  660. pname:this.state.formatPname,//规格名称
  661. price:this.state.formatPrice,//市场价
  662. offset:offsetText,//最低折扣
  663. activityPrice:this.state.formatActivityPrice,//活动价
  664. activityFlag:this.state.formatActivityFlag,//活动生效标识
  665. memberPrice:this.state.formatMemberPrice,//会员价
  666. status:this.state.formatStatus,//项目状态
  667. }
  668. }).done(function (data) {
  669. this.setState({
  670. loading: false
  671. });
  672. if (!data.error.length) {
  673. message.success('修改规格成功!');
  674. this.formatLoadData();
  675. this.editformathandleCancel();
  676. } else {
  677. message.warning(data.error[0].message);
  678. }
  679. }.bind(this));
  680. }
  681. });
  682. },
  683. //新增一个规格,保存
  684. formathandleSubmit(e){
  685. e.preventDefault();
  686. let offsetText;
  687. if(this.state.formatOffset){
  688. if(this.state.formatOffset>10||this.state.formatOffset<0){
  689. message.warning('最低折扣请输入0到10之间的数字');
  690. return false;
  691. }else{
  692. offsetText=this.state.formatOffset;
  693. }
  694. }
  695. this.props.form.validateFields((err, values) => {
  696. if (!err) {
  697. this.setState({
  698. loading: true
  699. });
  700. $.ajax({
  701. method: "post",
  702. dataType: "json",
  703. crossDomain: false,
  704. url:globalConfig.context + '/api/admin/ProjectSize/addProjectSize',
  705. data:{
  706. pid:this.state.editId,//项目ID
  707. pname:this.state.formatPname,//规格名称
  708. price:this.state.formatPrice,//市场价
  709. offset:offsetText,//最低折扣
  710. activityPrice:this.state.formatActivityPrice,//活动价
  711. activityFlag:this.state.formatActivityFlag,//活动生效标识
  712. memberPrice:this.state.formatMemberPrice,//会员价
  713. status:this.state.formatStatus,//项目状态
  714. }
  715. }).done(function (data) {
  716. this.setState({
  717. loading: false
  718. });
  719. if (!data.error.length) {
  720. message.success('新增规格成功!');
  721. this.formathandleCancel();
  722. this.formatLoadData();
  723. } else {
  724. message.warning(data.error[0].message);
  725. }
  726. }.bind(this));
  727. }
  728. });
  729. },
  730. //新增一个项目,保存
  731. addhandleSubmit(e){
  732. e.preventDefault();
  733. if(!this.state.categoryName){
  734. message.warning('请输入项目名称');
  735. return false;
  736. }
  737. if(!this.state.addCid){
  738. message.warning('请选择项目品类');
  739. return false;
  740. }
  741. let isCountry=0;
  742. let pro='';
  743. let city='';
  744. let dis='';
  745. if(this.state.ProvinceCity==undefined){
  746. message.warning('请选择项目有效范围');
  747. return false;
  748. }else{
  749. switch(parseInt(this.state.ProvinceCity.length)){
  750. case 1:pro=this.state.ProvinceCity[0];break;
  751. case 2:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];break;
  752. case 3:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];dis=this.state.ProvinceCity[2];break;
  753. }
  754. }
  755. if(pro==0){
  756. isCountry=1;
  757. pro='';
  758. }
  759. this.props.form.validateFields((err, values) => {
  760. if (!err) {
  761. this.setState({
  762. loading: true
  763. });
  764. //上级组织字典
  765. let nameText=this.state.SuperArr;
  766. let superText=nameText[parseInt(this.state.addCid)].id;
  767. $.ajax({
  768. method: "post",
  769. dataType: "json",
  770. crossDomain: false,
  771. url:globalConfig.context + '/api/admin/ProjectSize/addProject',
  772. data:{
  773. bname:this.state.categoryName,//项目名称
  774. cid:superText,//品类类ID
  775. boutique:this.state.boutique?this.state.boutique:'0',
  776. country:isCountry,//是否全国
  777. province:pro,//省
  778. city:city,//市
  779. district:dis,//区
  780. }
  781. }).done(function (data) {
  782. this.setState({
  783. loading: false
  784. });
  785. if (!data.error.length) {
  786. message.success('新增项目成功!');
  787. this.handleCancel();
  788. this.selectSuperId();
  789. } else {
  790. message.warning(data.error[0].message);
  791. }
  792. }.bind(this));
  793. }
  794. });
  795. },
  796. //项目整行删除
  797. delectRow() {
  798. let deletedIds = '';
  799. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  800. let rowItem = this.state.selectedRows[idx];
  801. if (rowItem.id) {
  802. deletedIds=rowItem.id;
  803. };
  804. };
  805. this.setState({
  806. selectedRowKeys: [],
  807. loading: deletedIds.length > 0
  808. });
  809. $.ajax({
  810. method: "get",
  811. dataType: "json",
  812. crossDomain: false,
  813. url: globalConfig.context + "/api/admin/ProjectSize/deleteProject",
  814. data: {
  815. id:deletedIds
  816. }
  817. }).done(function (data) {
  818. if (!data.error.length) {
  819. message.success('删除成功!');
  820. this.setState({
  821. loading: false,
  822. });
  823. } else {
  824. message.warning(data.error[0].message);
  825. };
  826. this.selectSuperId();
  827. }.bind(this));
  828. },
  829. //项目整行停用
  830. blockRow() {
  831. let deletedIds = '';
  832. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  833. let rowItem = this.state.selectedRows[idx];
  834. if (rowItem.id) {
  835. deletedIds=rowItem.id;
  836. };
  837. };
  838. this.setState({
  839. selectedRowKeys: [],
  840. loading: deletedIds.length > 0
  841. });
  842. $.ajax({
  843. method: "get",
  844. dataType: "json",
  845. crossDomain: false,
  846. url: globalConfig.context + "/api/admin/ProjectSize/stopProject",
  847. data: {
  848. id:deletedIds
  849. }
  850. }).done(function (data) {
  851. if (!data.error.length) {
  852. message.success('该项目已成功停用!');
  853. this.setState({
  854. loading: false,
  855. });
  856. } else {
  857. message.warning(data.error[0].message);
  858. };
  859. this.selectSuperId();
  860. }.bind(this));
  861. },
  862. //规格整行删除
  863. delectRowSize() {
  864. let deletedIds = '';
  865. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  866. let rowItem = this.state.selectedRows[idx];
  867. if (rowItem.formatId) {
  868. deletedIds=rowItem.formatId;
  869. };
  870. };
  871. this.setState({
  872. selectedRowKeys: [],
  873. loading: deletedIds.length > 0
  874. });
  875. $.ajax({
  876. method: "get",
  877. dataType: "json",
  878. crossDomain: false,
  879. url: globalConfig.context + "/api/admin/ProjectSize/deleteProjectSize",
  880. data: {
  881. id: deletedIds
  882. }
  883. }).done(function (data) {
  884. if (!data.error.length) {
  885. message.success('删除成功!');
  886. this.setState({
  887. loading: false,
  888. });
  889. } else {
  890. message.warning(data.error[0].message);
  891. };
  892. this.formatLoadData();
  893. }.bind(this));
  894. },
  895. //规格整行停用
  896. blockRowSize() {
  897. let deletedIds = '';
  898. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  899. let rowItem = this.state.selectedRows[idx];
  900. if (rowItem.formatId) {
  901. deletedIds=rowItem.formatId;
  902. };
  903. };
  904. this.setState({
  905. selectedRowKeys: [],
  906. loading: deletedIds.length > 0
  907. });
  908. $.ajax({
  909. method: "get",
  910. dataType: "json",
  911. crossDomain: false,
  912. url: globalConfig.context + "/api/admin/ProjectSize/stopProjectSize",
  913. data: {
  914. id: deletedIds
  915. }
  916. }).done(function (data) {
  917. if (!data.error.length) {
  918. message.success('该项目已成功停用!');
  919. this.setState({
  920. loading: false,
  921. });
  922. } else {
  923. message.warning(data.error[0].message);
  924. };
  925. this.formatLoadData();
  926. }.bind(this));
  927. },
  928. addClick() {
  929. this.state.RowData = {};
  930. this.setState({
  931. visible: true
  932. });
  933. this.addReset();
  934. },
  935. editClick(e) {
  936. this.state.RowData = {};
  937. this.setState({
  938. editvisible: true
  939. });
  940. },
  941. formatClick(e) {
  942. this.formatReset();
  943. this.state.RowData = {};
  944. this.setState({
  945. formatvisible: true
  946. });
  947. },
  948. editformatClick(e) {
  949. this.state.RowData = {};
  950. this.setState({
  951. editformatvisible: true
  952. });
  953. },
  954. handleCancel() {
  955. this.setState({ visible: false })
  956. },
  957. edithandleCancel(e) {
  958. this.setState({
  959. editvisible: false
  960. });
  961. },
  962. formathandleCancel(e) {
  963. this.setState({
  964. formatvisible: false
  965. });
  966. },
  967. editformathandleCancel(e) {
  968. this.setState({
  969. editformatvisible: false
  970. });
  971. },
  972. search() {
  973. this.loadData();
  974. },
  975. //搜索部分的清零
  976. reset() {
  977. this.state.bname = '';//项目名称清零
  978. this.state.cid = undefined;//品类名称清零
  979. this.state.ressSearch= undefined;//省市区清零
  980. this.state.activityFlag = undefined;//活动生效清零
  981. this.state.status = undefined;//项目状态清零
  982. this.loadData();
  983. },
  984. //新增部分的清零
  985. addReset(){
  986. this.state.categoryName='';//项目名称清零
  987. this.state.ProvinceCity=undefined;
  988. this.state.addCid=undefined;
  989. this.state.boutique='';
  990. },
  991. //规格新增清零
  992. formatReset() {
  993. this.state.formatPname = '';//规格名称清零
  994. this.state.formatPrice = '';//市场价清零
  995. this.state.formatOffset = '';//最低折扣清零
  996. this.state.formatActivityPrice = '';//活动价清零
  997. this.state.formatMemberPrice = '';//会员价清零
  998. this.state.formatActivityFlag = undefined;//活动生效标识清零
  999. this.state.formatStatus= undefined;//项目状态清零
  1000. this.formatLoadData();
  1001. },
  1002. //详情tab切换数据处理
  1003. callback(e) {
  1004. this.setState({
  1005. callnub: e,
  1006. })
  1007. if(e == 1) {
  1008. }
  1009. if(e == 2) {
  1010. this.formatLoadData();
  1011. }
  1012. },
  1013. //更多搜索的显示与否
  1014. searchSwitch() {
  1015. this.setState({
  1016. searchMore: !this.state.searchMore
  1017. });
  1018. },
  1019. render() {
  1020. const FormItem = Form.Item
  1021. const rowSelection = {
  1022. selectedRowKeys: this.state.selectedRowKeys,
  1023. onChange: (selectedRowKeys, selectedRows) => {
  1024. this.setState({
  1025. selectedRows: selectedRows.slice(-1),
  1026. selectedRowKeys: selectedRowKeys.slice(-1)
  1027. });
  1028. }
  1029. };
  1030. const formItemLayout = {
  1031. labelCol: { span: 8 },
  1032. wrapperCol: { span: 14 },
  1033. };
  1034. const { getFieldDecorator } = this.props.form;
  1035. const hasSelected = this.state.selectedRowKeys.length > 0;
  1036. const { RangePicker } = DatePicker;
  1037. return (
  1038. <div className="user-content" >
  1039. <div className="content-title">
  1040. <Tabs
  1041. defaultActiveKey="1"
  1042. onChange={this.callback}
  1043. className="test">
  1044. <TabPane tab="搜索" key="1">
  1045. <div className="user-search">
  1046. <Input placeholder="业务项目名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px',marginLeft:10}}
  1047. value={this.state.bname}
  1048. onChange={(e) => { this.setState({ bname: e.target.value }); }} />
  1049. <Select placeholder="业务品类"
  1050. style={{ width:'200px',marginRight:'10px' }}
  1051. value={this.state.cid}
  1052. onChange={(e) => { this.setState({ cid: e }) }} notFoundContent="未获取到上级品类列表">
  1053. {this.state.contactsOption}
  1054. </Select>
  1055. <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
  1056. <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
  1057. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  1058. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1059. disabled={!hasSelected}
  1060. >删除<Icon type="minus" />
  1061. </Button>
  1062. </Popconfirm>
  1063. <Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
  1064. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
  1065. disabled={!hasSelected}
  1066. >停用<Icon type="minus" />
  1067. </Button>
  1068. </Popconfirm>
  1069. <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1070. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'block'}}>
  1071. <span style={{marginRight:'10px',marginBottom:'10px',marginLeft:10}}>
  1072. <Cascader options={provinceSelect()} value={this.state.ressSearch} placeholder="选择省份"
  1073. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1074. </span>
  1075. <span style={{marginRight:'10px',marginBottom:'10px'}}>
  1076. <Cascader options={citySelect()} value={this.state.ressSearch} placeholder="选择城市"
  1077. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1078. </span>
  1079. <span style={{marginRight:'10px'}}>
  1080. <Cascader options={areaSelect()} value={this.state.ressSearch} placeholder="选择地区"
  1081. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1082. </span>
  1083. <Select placeholder="活动生效标识"
  1084. style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  1085. value={this.state.activityFlag}
  1086. onChange={(e) => { this.setState({ activityFlag: e }) }}>
  1087. <Select.Option value="0" >有效</Select.Option>
  1088. <Select.Option value="1" >无效</Select.Option>
  1089. </Select>
  1090. <Select placeholder="项目状态"
  1091. style={{width:'150px',marginRight:'10px'}}
  1092. value={this.state.status}
  1093. onChange={(e) => { this.setState({ status: e }) }}>
  1094. <Select.Option value="0" >正常</Select.Option>
  1095. <Select.Option value="1" >停用</Select.Option>
  1096. </Select>
  1097. </div>
  1098. </div>
  1099. </TabPane>
  1100. <TabPane tab="新增项目" key="2">
  1101. <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'left',marginRight:'50px',marginLeft:10,marginBottom:10}}>新增项目<Icon type="plus" /></Button>
  1102. </TabPane>
  1103. </Tabs>
  1104. <div className="patent-table">
  1105. <Spin spinning={this.state.loading}>
  1106. <Table columns={this.state.columns}
  1107. dataSource={this.state.dataSource}
  1108. rowSelection={rowSelection}
  1109. pagination={this.state.pagination}
  1110. onRowClick={this.tableRowClick}
  1111. current={this.state.aa}/>
  1112. </Spin>
  1113. </div>
  1114. <div className="patent-desc">
  1115. <Modal maskClosable={false} visible={this.state.visible}
  1116. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1117. width='400px'
  1118. title='新增业务项目'
  1119. footer=''
  1120. className="admin-desc-content">
  1121. <Form horizontal onSubmit={this.addhandleSubmit} id="demand-form">
  1122. <Spin spinning={this.state.loading}>
  1123. <div className="clearfix">
  1124. <FormItem
  1125. labelCol={{ span: 7 }}
  1126. wrapperCol={{ span: 12 }}
  1127. label="业务项目名称" >
  1128. <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
  1129. onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
  1130. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1131. </FormItem>
  1132. </div>
  1133. <div className="clearfix">
  1134. <FormItem
  1135. labelCol={{ span: 7 }}
  1136. wrapperCol={{ span: 12 }}
  1137. label="业务品类"
  1138. >
  1139. <Select placeholder="请选择业务品类" value={this.state.addCid} onChange={(e)=>{this.setState({addCid:e})}}
  1140. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1141. {this.state.contactsOption}
  1142. </Select>
  1143. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1144. </FormItem>
  1145. </div>
  1146. <div className="clearfix">
  1147. <FormItem
  1148. labelCol={{ span: 7 }}
  1149. wrapperCol={{ span: 12 }}
  1150. label="是否精品"
  1151. >
  1152. <Radio.Group value={this.state.boutique} onChange={(e) => {
  1153. this.setState({ boutique: e.target.value })
  1154. }}>
  1155. <Radio value={1}>精品</Radio>
  1156. <Radio value={0}>非精品</Radio>
  1157. </Radio.Group>
  1158. </FormItem>
  1159. </div>
  1160. <div className="clearfix">
  1161. <FormItem
  1162. labelCol={{ span: 7 }}
  1163. wrapperCol={{ span: 12 }}
  1164. label="省"
  1165. >
  1166. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1167. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1168. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1169. </FormItem>
  1170. </div>
  1171. <div className="clearfix">
  1172. <FormItem
  1173. labelCol={{ span: 7 }}
  1174. wrapperCol={{ span: 12 }}
  1175. label="省-市"
  1176. >
  1177. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1178. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1179. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1180. </FormItem>
  1181. </div>
  1182. <div className="clearfix">
  1183. <FormItem
  1184. labelCol={{ span: 7 }}
  1185. wrapperCol={{ span: 12 }}
  1186. label="省-市-区"
  1187. >
  1188. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1189. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1190. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1191. </FormItem>
  1192. </div>
  1193. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1194. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1195. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1196. </FormItem>
  1197. </Spin>
  1198. </Form >
  1199. </Modal>
  1200. </div>
  1201. <div className="patent-desc">
  1202. <Modal maskClosable={false} visible={this.state.formatvisible}
  1203. onOk={this.checkPatentProcess} onCancel={this.formathandleCancel}
  1204. width='400px'
  1205. title='新增项目规格'
  1206. footer=''
  1207. className="admin-desc-content">
  1208. <Form horizontal onSubmit={this.formathandleSubmit} id="demand-form">
  1209. <Spin spinning={this.state.loading}>
  1210. <div className="clearfix">
  1211. <FormItem
  1212. labelCol={{ span: 7 }}
  1213. wrapperCol={{ span: 12 }}
  1214. label="项目名称"
  1215. >
  1216. <span style={{width:'94%'}}>{this.state.editName}</span>
  1217. </FormItem>
  1218. <FormItem
  1219. labelCol={{ span: 7 }}
  1220. wrapperCol={{ span: 12 }}
  1221. label="规格名称" >
  1222. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1223. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1224. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1225. </FormItem>
  1226. <FormItem
  1227. labelCol={{ span: 7 }}
  1228. wrapperCol={{ span: 12 }}
  1229. label="市场价"
  1230. >
  1231. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1232. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1233. </FormItem>
  1234. <FormItem
  1235. labelCol={{ span: 7 }}
  1236. wrapperCol={{ span: 12 }}
  1237. label="活动价"
  1238. >
  1239. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1240. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1241. </FormItem>
  1242. <FormItem
  1243. labelCol={{ span: 7 }}
  1244. wrapperCol={{ span: 12 }}
  1245. label="最低折扣"
  1246. >
  1247. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1248. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1249. </FormItem>
  1250. <FormItem
  1251. labelCol={{ span: 7 }}
  1252. wrapperCol={{ span: 12 }}
  1253. label="会员价"
  1254. >
  1255. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1256. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1257. </FormItem>
  1258. <FormItem
  1259. labelCol={{ span: 7 }}
  1260. wrapperCol={{ span: 12 }}
  1261. label="活动生效"
  1262. >
  1263. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1264. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1265. {
  1266. gameState.map(function (item) {
  1267. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1268. })
  1269. }
  1270. </Select>
  1271. </FormItem>
  1272. <FormItem
  1273. labelCol={{ span: 7 }}
  1274. wrapperCol={{ span: 12 }}
  1275. label="项目状态"
  1276. >
  1277. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1278. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1279. {
  1280. conditionOrganization.map(function (item) {
  1281. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1282. })
  1283. }
  1284. </Select>
  1285. </FormItem>
  1286. </div>
  1287. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1288. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1289. <Button className="set-submit" type="ghost" onClick={this.formathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1290. </FormItem>
  1291. </Spin>
  1292. </Form >
  1293. </Modal>
  1294. </div>
  1295. <div className="patent-desc">
  1296. <Modal maskClosable={false} visible={this.state.editformatvisible}
  1297. onOk={this.checkPatentProcess} onCancel={this.editformathandleCancel}
  1298. width='400px'
  1299. title='编辑项目规格'
  1300. footer=''
  1301. className="admin-desc-content">
  1302. <Form horizontal onSubmit={this.editformathandleSubmit} id="demand-form">
  1303. <Spin spinning={this.state.loading}>
  1304. <div className="clearfix">
  1305. <FormItem
  1306. labelCol={{ span: 7 }}
  1307. wrapperCol={{ span: 12 }}
  1308. label="规格名称" >
  1309. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1310. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1311. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1312. </FormItem>
  1313. </div>
  1314. <div className="clearfix" >
  1315. <FormItem
  1316. labelCol={{ span: 7 }}
  1317. wrapperCol={{ span: 12 }}
  1318. label="创建人"
  1319. >
  1320. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1321. </FormItem>
  1322. <FormItem
  1323. labelCol={{ span: 7 }}
  1324. wrapperCol={{ span: 12 }}
  1325. label="市场价"
  1326. >
  1327. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1328. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1329. </FormItem>
  1330. <FormItem
  1331. labelCol={{ span: 7 }}
  1332. wrapperCol={{ span: 12 }}
  1333. label="活动价"
  1334. >
  1335. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1336. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1337. </FormItem>
  1338. <FormItem
  1339. labelCol={{ span: 7 }}
  1340. wrapperCol={{ span: 12 }}
  1341. label="最低折扣"
  1342. >
  1343. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1344. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1345. </FormItem>
  1346. <FormItem
  1347. labelCol={{ span: 7 }}
  1348. wrapperCol={{ span: 12 }}
  1349. label="会员价"
  1350. >
  1351. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1352. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1353. </FormItem>
  1354. <FormItem
  1355. labelCol={{ span: 7 }}
  1356. wrapperCol={{ span: 12 }}
  1357. label="活动生效"
  1358. >
  1359. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1360. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1361. {
  1362. gameState.map(function (item) {
  1363. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1364. })
  1365. }
  1366. </Select>
  1367. </FormItem>
  1368. <FormItem
  1369. labelCol={{ span: 7 }}
  1370. wrapperCol={{ span: 12 }}
  1371. label="项目状态"
  1372. >
  1373. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1374. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1375. {
  1376. conditionOrganization.map(function (item) {
  1377. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1378. })
  1379. }
  1380. </Select>
  1381. </FormItem>
  1382. </div>
  1383. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1384. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1385. <Button className="set-submit" type="ghost" onClick={this.editformathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1386. </FormItem>
  1387. </Spin>
  1388. </Form >
  1389. </Modal>
  1390. </div>
  1391. <div className="patent-desc">
  1392. <Modal
  1393. className="customeDetails"
  1394. title="业务项目"
  1395. width='1000px'
  1396. visible={this.state.editvisible}
  1397. onOk={this.edithandleCancel}
  1398. onCancel={this.edithandleCancel}
  1399. footer=''
  1400. >
  1401. <Tabs defaultActiveKey="1" onChange={this.callback} activeKey={this.state.callnub}>
  1402. <TabPane tab="业务项目基本资料" key="1">
  1403. <Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
  1404. <Spin spinning={this.state.loading}>
  1405. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1406. <FormItem className="half-item"
  1407. labelCol={{ span: 4 }}
  1408. wrapperCol={{ span: 12 }}
  1409. label="项目名称" >
  1410. <Input placeholder="项目名称" value={this.state.editName} style={{width:'94%'}}
  1411. onChange={(e)=>{this.setState({editName:e.target.value})}} required="required"/>
  1412. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1413. </FormItem>
  1414. <FormItem className="half-item"
  1415. labelCol={{ span: 4 }}
  1416. wrapperCol={{ span: 12 }}
  1417. label="业务品类"
  1418. >
  1419. <Select placeholder="请选择业务品类" value={this.state.editCname} onChange={(e)=>{this.setState({editCname:e})}}
  1420. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1421. {this.state.contactsOption}
  1422. </Select>
  1423. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1424. </FormItem>
  1425. </div>
  1426. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1427. <FormItem className="half-item"
  1428. labelCol={{ span: 4 }}
  1429. wrapperCol={{ span: 12 }}
  1430. label="省"
  1431. >
  1432. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1433. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1434. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1435. </FormItem>
  1436. <FormItem className="half-item"
  1437. labelCol={{ span: 4 }}
  1438. wrapperCol={{ span: 12 }}
  1439. label="省-市"
  1440. >
  1441. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1442. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1443. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1444. </FormItem>
  1445. <FormItem className="half-item"
  1446. labelCol={{ span: 4 }}
  1447. wrapperCol={{ span: 12 }}
  1448. label="省-市-区"
  1449. >
  1450. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1451. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1452. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1453. </FormItem>
  1454. <FormItem className="half-item"
  1455. labelCol={{ span: 4 }}
  1456. wrapperCol={{ span: 12 }}
  1457. label="是否精品"
  1458. >
  1459. <Radio.Group value={this.state.editBoutique} onChange={(e) => {
  1460. this.setState({ editBoutique: e.target.value })
  1461. }}>
  1462. <Radio value={1}>精品</Radio>
  1463. <Radio value={0}>非精品</Radio>
  1464. </Radio.Group>
  1465. </FormItem>
  1466. </div>
  1467. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1468. <FormItem className="half-item"
  1469. labelCol={{ span: 4 }}
  1470. wrapperCol={{ span: 12 }}
  1471. label="市场价"
  1472. >
  1473. <Input placeholder="市场价" value={this.state.editPrice} style={{width:'94%'}}
  1474. onChange={(e)=>{this.setState({editPrice:e.target.value})}} required="required"/>
  1475. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1476. </FormItem>
  1477. <FormItem className="half-item"
  1478. labelCol={{ span: 4 }}
  1479. wrapperCol={{ span: 12 }}
  1480. label="首付金额"
  1481. >
  1482. <Input placeholder="市场价" value={this.state.firstPayment} style={{width:'94%'}}
  1483. onChange={(e)=>{this.setState({firstPayment:e.target.value})}} required="required"/>
  1484. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1485. </FormItem>
  1486. <FormItem className="half-item"
  1487. labelCol={{ span: 4 }}
  1488. wrapperCol={{ span: 12 }}
  1489. label="活动价"
  1490. >
  1491. <Input placeholder="活动价" value={this.state.editActivityPrice} style={{width:'94%'}}
  1492. onChange={(e)=>{this.setState({editActivityPrice:e.target.value})}}/>
  1493. </FormItem>
  1494. <FormItem className="half-item"
  1495. labelCol={{ span: 4 }}
  1496. wrapperCol={{ span: 12 }}
  1497. label="最低折扣"
  1498. >
  1499. <Input placeholder="最低折扣" value={this.state.editOffset} style={{width:'94%'}}
  1500. onChange={(e)=>{this.setState({editOffset:e.target.value})}}/>
  1501. </FormItem>
  1502. <FormItem className="half-item"
  1503. labelCol={{ span: 4 }}
  1504. wrapperCol={{ span: 12 }}
  1505. label="会员价"
  1506. >
  1507. <Input placeholder="会员价" value={this.state.editMemberPrice} style={{width:'94%'}}
  1508. onChange={(e)=>{this.setState({editMemberPrice:e.target.value})}}/>
  1509. </FormItem>
  1510. <FormItem className="half-item"
  1511. labelCol={{ span: 4 }}
  1512. wrapperCol={{ span: 12 }}
  1513. label="活动生效"
  1514. >
  1515. <Select placeholder="活动生效" value={this.state.editActivityFlag} style={{width:'94%'}}
  1516. onChange={(e)=>{this.setState({editActivityFlag:e})}}>
  1517. {
  1518. gameState.map(function (item) {
  1519. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1520. })
  1521. }
  1522. </Select>
  1523. </FormItem>
  1524. <FormItem className="half-item"
  1525. labelCol={{ span: 4 }}
  1526. wrapperCol={{ span: 12 }}
  1527. label="项目状态"
  1528. >
  1529. <Select placeholder="项目状态" value={this.state.editStatus} style={{width:'94%'}}
  1530. onChange={(e)=>{this.setState({editStatus:e})}}>
  1531. {
  1532. conditionOrganization.map(function (item) {
  1533. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1534. })
  1535. }
  1536. </Select>
  1537. </FormItem>
  1538. <FormItem className="half-item"
  1539. labelCol={{ span: 4 }}
  1540. wrapperCol={{ span: 12 }}
  1541. label="项目分类"
  1542. >
  1543. <Select placeholder="项目分类" value={this.state.typeStr} style={{width:'94%'}}
  1544. onChange={(e)=>{
  1545. let str = ""
  1546. if(e == 0) {
  1547. str = "通用"
  1548. }else if(e == 1) {
  1549. str = "专利"
  1550. }else if(e == 2) {
  1551. str = "软著"
  1552. }
  1553. this.setState({
  1554. typeStatus: e,
  1555. typeStr: str
  1556. });}}>
  1557. <Select.Option key={0} >通用</Select.Option>
  1558. <Select.Option key={1} >专利</Select.Option>
  1559. <Select.Option key={2} >软著</Select.Option>
  1560. </Select>
  1561. </FormItem>
  1562. <FormItem className="half-item"
  1563. labelCol={{ span: 4 }}
  1564. wrapperCol={{ span: 12 }}
  1565. label="创建人"
  1566. >
  1567. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1568. </FormItem>
  1569. <FormItem className="half-item"
  1570. labelCol={{ span: 4 }}
  1571. wrapperCol={{ span: 12 }}
  1572. label="创建时间"
  1573. >
  1574. <span style={{width:'94%'}}>{this.state.editTime}</span>
  1575. </FormItem>
  1576. </div>
  1577. <div className="clearfix">
  1578. <FormItem
  1579. labelCol={{ span: 4 }}
  1580. wrapperCol={{ span: 12 }}
  1581. label="项目地址" >
  1582. <Input type="textarea" rows={1} placeholder="业务项目服务内容" value={this.state.editProjectUrl}
  1583. onChange={(e) => { this.setState({ editProjectUrl: e.target.value }) }}/>
  1584. </FormItem>
  1585. </div>
  1586. <div className="clearfix">
  1587. <FormItem
  1588. labelCol={{ span: 4 }}
  1589. wrapperCol={{ span: 12 }}
  1590. label="业务项目服务内容" >
  1591. <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.editIntroduce}
  1592. onChange={(e) => { this.setState({ editIntroduce: e.target.value }) }}/>
  1593. </FormItem>
  1594. </div>
  1595. <div className="clearfix">
  1596. <FormItem
  1597. labelCol={{ span: 4 }}
  1598. wrapperCol={{ span: 12 }}
  1599. label="业务项目价值及作用" >
  1600. <Input type="textarea" rows={4} placeholder="业务项目价值及作用" value={this.state.editValueEffect}
  1601. onChange={(e) => { this.setState({ editValueEffect: e.target.value }) }}/>
  1602. </FormItem>
  1603. </div>
  1604. <div className="clearfix">
  1605. <FormItem
  1606. labelCol={{ span: 4 }}
  1607. wrapperCol={{ span: 12 }}
  1608. label="业务项目客户基本条件" >
  1609. <Input type="textarea" rows={4} placeholder="业务项目客户基本条件" value={this.state.editClientSize}
  1610. onChange={(e) => { this.setState({ editClientSize: e.target.value }) }}/>
  1611. </FormItem>
  1612. </div>
  1613. <div className="clearfix pictures">
  1614. <FormItem className="half-item"
  1615. labelCol={{ span: 8 }}
  1616. wrapperCol={{ span: 10 }}
  1617. label="业务项目图标" >
  1618. <PicturesWall
  1619. pictureSign="business_project_min_picture"
  1620. fileList={this.getOrgCodeUrl}
  1621. pictureUrl={this.state.orgCodeUrl} />
  1622. <p>图片建议:图片要清晰。(35*35)</p>
  1623. </FormItem>
  1624. <FormItem className="half-item"
  1625. labelCol={{ span: 4 }}
  1626. wrapperCol={{ span: 12 }}
  1627. label="业务项目图标" >
  1628. <PicturesWall
  1629. pictureSign="business_project_max_picture"
  1630. fileList={this.getCompanyLogoUrl}
  1631. pictureUrl={this.state.companyLogoUrl} />
  1632. <p>图片建议:图片要清晰。(200*200)</p>
  1633. </FormItem>
  1634. </div>
  1635. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'110px'}}>保存</Button>
  1636. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px',marginBottom:'20px'}}>取消</Button>
  1637. </Spin>
  1638. </Form>
  1639. </TabPane>
  1640. <TabPane tab="业务项目规格" key="2">
  1641. <div className="clearfix" >
  1642. <Popconfirm title="是否删除?" onConfirm={this.delectRowSize} okText="是" cancelText="否">
  1643. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1644. disabled={!hasSelected}
  1645. >删除<Icon type="minus" />
  1646. </Button>
  1647. </Popconfirm>
  1648. <Popconfirm title="是否停用?" onConfirm={this.blockRowSize} okText="是" cancelText="否" >
  1649. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
  1650. disabled={!hasSelected}
  1651. >停用<Icon type="minus" />
  1652. </Button>
  1653. </Popconfirm>
  1654. <Button className="ContactsList" type="primary" onClick={this.formatClick} style={{float:'right',marginBottom:'10px'}}>新增</Button>
  1655. </div>
  1656. <div className="clearfix">
  1657. <Spin spinning={this.state.loading}>
  1658. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  1659. <Table
  1660. pagination={this.state.formatPagination}
  1661. columns={this.state.ContactsLists}
  1662. dataSource={this.state.formatDataSource}
  1663. rowSelection={rowSelection}
  1664. onRowClick={this.formatTableRowClick}
  1665. />
  1666. </Form>
  1667. </Spin>
  1668. </div>
  1669. </TabPane>
  1670. </Tabs>
  1671. </Modal>
  1672. </div>
  1673. </div>
  1674. </div>
  1675. );
  1676. }
  1677. }));
  1678. export default BusinessProject;