businessProject.jsx 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558
  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. }.bind(this),
  364. }).always(function () {
  365. this.loadData(this.state.ispage);
  366. this.setState({
  367. loading: false
  368. });
  369. }.bind(this));
  370. },
  371. //编辑部门,保存
  372. edithandleSubmit(e){
  373. e.preventDefault();
  374. let offsetText;
  375. if(this.state.editOffset){
  376. if(this.state.editOffset>10||this.state.editOffset<0){
  377. message.warning('最低折扣请输入0到10之间的数字');
  378. return false;
  379. }else{
  380. offsetText=this.state.editOffset;
  381. }
  382. }
  383. this.props.form.validateFields((err, values) => {
  384. let theorgCodeUrl = [];
  385. if(this.state.orgCodeUrl.length) {
  386. let picArr = [];
  387. this.state.orgCodeUrl.map(function(item) {
  388. if ( item.response && item.response.data && item.response.data.length ){
  389. picArr.push(item.response.data);
  390. }
  391. });
  392. theorgCodeUrl = picArr.join(",");
  393. };
  394. let thecompanyLogoUrl = [];
  395. if(this.state.companyLogoUrl.length) {
  396. let picArr = [];
  397. this.state.companyLogoUrl.map(function(item) {
  398. if ( item.response && item.response.data && item.response.data.length ){
  399. picArr.push(item.response.data);
  400. }
  401. });
  402. thecompanyLogoUrl = picArr.join(",");
  403. };
  404. if(!err) {
  405. this.setState({
  406. loading: true
  407. });
  408. let nameText=this.state.SuperArr
  409. let superText=(this.state.editCname.length==1)?nameText[parseInt(this.state.editCname)].id:this.state.editCid;
  410. let isCountry=0;
  411. let pro='';
  412. let city='';
  413. let dis='';
  414. console.log(this.state.ProvinceCity);
  415. if(this.state.ProvinceCity==undefined||this.state.ProvinceCity.length==0){
  416. message.warning('请选择项目有效范围');
  417. return false;
  418. }else{
  419. switch(parseInt(this.state.ProvinceCity.length)){
  420. case 1:pro=this.state.ProvinceCity[0];break;
  421. case 2:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];break;
  422. case 3:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];dis=this.state.ProvinceCity[2];break;
  423. }
  424. }
  425. if(pro==0){
  426. isCountry=1;
  427. pro='';
  428. }
  429. $.ajax({
  430. method: "post",
  431. dataType: "json",
  432. crossDomain: false,
  433. url:globalConfig.context + '/api/admin/ProjectSize/updateProject',
  434. data:{
  435. id:this.state.editId,//项目ID
  436. cid:superText,//项目业务品类
  437. bname:this.state.editName,//业务项目名称
  438. price:this.state.editPrice,//市场价
  439. offset:offsetText,//最低折扣
  440. activityPrice:this.state.editActivityPrice,//活动价
  441. activityFlag:this.state.editActivityFlag,//活动生效标识
  442. memberPrice:this.state.editMemberPrice,//项目ID
  443. status:this.state.editStatus,//项目状态
  444. country:isCountry,//是否全国
  445. province:pro,//省
  446. city:city,//市
  447. district:dis,//区
  448. minLogo:theorgCodeUrl,
  449. maxLogo:thecompanyLogoUrl,
  450. introduce:this.state.editIntroduce,//项目介绍
  451. valueEffect:this.state.editValueEffect,//项目价值及作用
  452. clientSize:this.state.editClientSize,//项目基本条件
  453. }
  454. }).done(function (data) {
  455. this.setState({
  456. loading: false
  457. });
  458. if (!data.error.length) {
  459. message.success('保存成功!');
  460. this.edithandleCancel();
  461. this.selectSuperId();
  462. } else {
  463. message.warning(data.error[0].message);
  464. }
  465. }.bind(this));
  466. }
  467. })
  468. },
  469. //规格列表整行点击
  470. formatTableRowClick(record, index){
  471. this.editformatClick();
  472. this.state.RowData = record;
  473. this.setState({
  474. selectedRowKeys:[],
  475. formatId:record.formatId,//规格名称
  476. formatPname:record.formatPname,//规格名称
  477. formatPrice:record.formatPrice,//市场价
  478. formatOffset:record.formatOffset,//最低折扣
  479. formatActivityPrice:record.formatActivityPrice,//活动价
  480. formatActivityFlag:record.formatActivityFlag,//活动生效标识
  481. formatMemberPrice:record.formatMemberPrice,//会员价
  482. formatStatus:record.formatStatus.toString(),//项目状态
  483. });
  484. },
  485. //项目列表整行点击
  486. tableRowClick(record, index) {
  487. this.selectSuperId();
  488. this.state.RowData = record;
  489. this.setState({
  490. callnub:'1',
  491. editvisible: true,
  492. selectedRowKeys:[],
  493. rowId:record.businessId,
  494. });
  495. $.ajax({
  496. method: "get",
  497. dataType: "json",
  498. crossDomain: false,
  499. url: globalConfig.context +"/api/admin/ProjectSize/orgProject" ,
  500. data: {
  501. id: record.id
  502. },
  503. success: function (data) {
  504. let theArr = [];
  505. let ProvinceCity=[];
  506. let thisdata = data.data;
  507. if (!data) {
  508. if (data.error && data.error.length) {
  509. message.warning(data.error[0].message);
  510. };
  511. } else {
  512. if(thisdata.country==1){
  513. ProvinceCity.push(0);
  514. }else{
  515. ProvinceCity.push(parseInt(thisdata.province));
  516. ProvinceCity.push(parseInt(thisdata.city));
  517. ProvinceCity.push(parseInt(thisdata.district));
  518. }
  519. theArr.push({
  520. editId: thisdata.id,//每一条记录的ID
  521. editName:thisdata.bname,//项目名称
  522. editCname: thisdata.cname,//项目分类
  523. editCid: thisdata.cid,//项目分类
  524. editCountry: thisdata.country,//是否全国
  525. editProvince: thisdata.province,//省
  526. editCity: thisdata.city,//市
  527. editDistrict: thisdata.district,//区
  528. editPrice: thisdata.price,//市场价
  529. editActivityPrice: thisdata.activityPrice,//活动价
  530. editOffset: thisdata.offset,//最低折扣
  531. editMemberPrice: thisdata.memberPrice,//会员价
  532. editActivityFlag:thisdata.activityFlag,//活动生效标识
  533. editStatus:thisdata.status,//品类状态
  534. editCreateId:thisdata.createName,//创建人
  535. editTime:thisdata.createTimeFormattedDate,//创建时间
  536. editIntroduce:thisdata.introduce,//服务内容
  537. editValueEffect:thisdata.valueEffect,//价值及作用
  538. editClientSize:thisdata.clientSize,//基本条件
  539. orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
  540. cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
  541. });
  542. };
  543. this.setState({
  544. editId: thisdata.id,//每一条记录的ID
  545. editName:thisdata.bname,//项目名称
  546. editCname: thisdata.cname,//项目分类
  547. editCid: thisdata.cid,//项目分类
  548. editCountry: thisdata.country,//是否全国
  549. editProvince: thisdata.province,//省
  550. editCity: thisdata.city,//市
  551. editDistrict: thisdata.district,//区
  552. editPrice: thisdata.price,//市场价
  553. editActivityPrice: thisdata.activityPrice,//活动价
  554. editOffset: thisdata.offset,//最低折扣
  555. editMemberPrice: thisdata.memberPrice,//会员价
  556. editActivityFlag:thisdata.activityFlag,//活动生效标识
  557. editStatus:thisdata.status,//品类状态
  558. editCreateId:thisdata.createName,//创建人
  559. editTime:thisdata.createTimeFormattedDate,//创建时间
  560. editIntroduce:thisdata.introduce,//服务内容
  561. editValueEffect:thisdata.valueEffect,//价值及作用
  562. editClientSize:thisdata.clientSize,//基本条件
  563. orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
  564. companyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
  565. editDataSource: theArr,
  566. ProvinceCity:ProvinceCity,
  567. });
  568. }.bind(this),
  569. }).always(function () {
  570. this.setState({
  571. loading: false
  572. });
  573. }.bind(this));
  574. },
  575. //左侧图片地址
  576. getOrgCodeUrl(e) {
  577. this.setState({ orgCodeUrl: e });
  578. },
  579. //右侧图片地址
  580. getCompanyLogoUrl(e) {
  581. this.setState({ companyLogoUrl: e });
  582. },
  583. //编辑一个规格,保存
  584. editformathandleSubmit(e){
  585. e.preventDefault();
  586. let offsetText;
  587. if(this.state.formatOffset){
  588. if(this.state.formatOffset>10||this.state.formatOffset<0){
  589. message.warning('最低折扣请输入0到10之间的数字');
  590. return false;
  591. }else{
  592. offsetText=this.state.formatOffset;
  593. }
  594. }
  595. this.props.form.validateFields((err, values) => {
  596. if (!err) {
  597. this.setState({
  598. loading: true
  599. });
  600. $.ajax({
  601. method: "post",
  602. dataType: "json",
  603. crossDomain: false,
  604. url:globalConfig.context + '/api/admin/ProjectSize/orgProjectSize',
  605. data:{
  606. id:this.state.formatId,//项目ID
  607. pname:this.state.formatPname,//规格名称
  608. price:this.state.formatPrice,//市场价
  609. offset:offsetText,//最低折扣
  610. activityPrice:this.state.formatActivityPrice,//活动价
  611. activityFlag:this.state.formatActivityFlag,//活动生效标识
  612. memberPrice:this.state.formatMemberPrice,//会员价
  613. status:this.state.formatStatus,//项目状态
  614. }
  615. }).done(function (data) {
  616. this.setState({
  617. loading: false
  618. });
  619. if (!data.error.length) {
  620. message.success('修改规格成功!');
  621. this.formatLoadData();
  622. this.editformathandleCancel();
  623. } else {
  624. message.warning(data.error[0].message);
  625. }
  626. }.bind(this));
  627. }
  628. });
  629. },
  630. //新增一个规格,保存
  631. formathandleSubmit(e){
  632. e.preventDefault();
  633. let offsetText;
  634. if(this.state.formatOffset){
  635. if(this.state.formatOffset>10||this.state.formatOffset<0){
  636. message.warning('最低折扣请输入0到10之间的数字');
  637. return false;
  638. }else{
  639. offsetText=this.state.formatOffset;
  640. }
  641. }
  642. this.props.form.validateFields((err, values) => {
  643. if (!err) {
  644. this.setState({
  645. loading: true
  646. });
  647. $.ajax({
  648. method: "post",
  649. dataType: "json",
  650. crossDomain: false,
  651. url:globalConfig.context + '/api/admin/ProjectSize/addProjectSize',
  652. data:{
  653. pid:this.state.editId,//项目ID
  654. pname:this.state.formatPname,//规格名称
  655. price:this.state.formatPrice,//市场价
  656. offset:offsetText,//最低折扣
  657. activityPrice:this.state.formatActivityPrice,//活动价
  658. activityFlag:this.state.formatActivityFlag,//活动生效标识
  659. memberPrice:this.state.formatMemberPrice,//会员价
  660. status:this.state.formatStatus,//项目状态
  661. }
  662. }).done(function (data) {
  663. this.setState({
  664. loading: false
  665. });
  666. if (!data.error.length) {
  667. message.success('新增规格成功!');
  668. this.formathandleCancel();
  669. this.formatLoadData();
  670. } else {
  671. message.warning(data.error[0].message);
  672. }
  673. }.bind(this));
  674. }
  675. });
  676. },
  677. //新增一个项目,保存
  678. addhandleSubmit(e){
  679. e.preventDefault();
  680. if(!this.state.categoryName){
  681. message.warning('请输入项目名称');
  682. return false;
  683. }
  684. if(!this.state.addCid){
  685. message.warning('请选择项目品类');
  686. return false;
  687. }
  688. let isCountry=0;
  689. let pro='';
  690. let city='';
  691. let dis='';
  692. if(this.state.ProvinceCity==undefined){
  693. message.warning('请选择项目有效范围');
  694. return false;
  695. }else{
  696. switch(parseInt(this.state.ProvinceCity.length)){
  697. case 1:pro=this.state.ProvinceCity[0];break;
  698. case 2:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];break;
  699. case 3:pro=this.state.ProvinceCity[0];city=this.state.ProvinceCity[1];dis=this.state.ProvinceCity[2];break;
  700. }
  701. }
  702. if(pro==0){
  703. isCountry=1;
  704. pro='';
  705. }
  706. this.props.form.validateFields((err, values) => {
  707. if (!err) {
  708. this.setState({
  709. loading: true
  710. });
  711. //上级组织字典
  712. let nameText=this.state.SuperArr;
  713. let superText=nameText[parseInt(this.state.addCid)].id;
  714. $.ajax({
  715. method: "post",
  716. dataType: "json",
  717. crossDomain: false,
  718. url:globalConfig.context + '/api/admin/ProjectSize/addProject',
  719. data:{
  720. bname:this.state.categoryName,//项目名称
  721. cid:superText,//品类类ID
  722. country:isCountry,//是否全国
  723. province:pro,//省
  724. city:city,//市
  725. district:dis,//区
  726. }
  727. }).done(function (data) {
  728. this.setState({
  729. loading: false
  730. });
  731. if (!data.error.length) {
  732. message.success('新增项目成功!');
  733. this.handleCancel();
  734. this.selectSuperId();
  735. } else {
  736. message.warning(data.error[0].message);
  737. }
  738. }.bind(this));
  739. }
  740. });
  741. },
  742. //项目整行删除
  743. delectRow() {
  744. let deletedIds = '';
  745. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  746. let rowItem = this.state.selectedRows[idx];
  747. if (rowItem.id) {
  748. deletedIds=rowItem.id;
  749. };
  750. };
  751. this.setState({
  752. selectedRowKeys: [],
  753. loading: deletedIds.length > 0
  754. });
  755. $.ajax({
  756. method: "get",
  757. dataType: "json",
  758. crossDomain: false,
  759. url: globalConfig.context + "/api/admin/ProjectSize/deleteProject",
  760. data: {
  761. id:deletedIds
  762. }
  763. }).done(function (data) {
  764. if (!data.error.length) {
  765. message.success('删除成功!');
  766. this.setState({
  767. loading: false,
  768. });
  769. } else {
  770. message.warning(data.error[0].message);
  771. };
  772. this.selectSuperId();
  773. }.bind(this));
  774. },
  775. //项目整行停用
  776. blockRow() {
  777. let deletedIds = '';
  778. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  779. let rowItem = this.state.selectedRows[idx];
  780. if (rowItem.id) {
  781. deletedIds=rowItem.id;
  782. };
  783. };
  784. this.setState({
  785. selectedRowKeys: [],
  786. loading: deletedIds.length > 0
  787. });
  788. $.ajax({
  789. method: "get",
  790. dataType: "json",
  791. crossDomain: false,
  792. url: globalConfig.context + "/api/admin/ProjectSize/stopProject",
  793. data: {
  794. id:deletedIds
  795. }
  796. }).done(function (data) {
  797. if (!data.error.length) {
  798. message.success('该项目已成功停用!');
  799. this.setState({
  800. loading: false,
  801. });
  802. } else {
  803. message.warning(data.error[0].message);
  804. };
  805. this.selectSuperId();
  806. }.bind(this));
  807. },
  808. //规格整行删除
  809. delectRowSize() {
  810. let deletedIds = '';
  811. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  812. let rowItem = this.state.selectedRows[idx];
  813. if (rowItem.formatId) {
  814. deletedIds=rowItem.formatId;
  815. };
  816. };
  817. this.setState({
  818. selectedRowKeys: [],
  819. loading: deletedIds.length > 0
  820. });
  821. $.ajax({
  822. method: "get",
  823. dataType: "json",
  824. crossDomain: false,
  825. url: globalConfig.context + "/api/admin/ProjectSize/deleteProjectSize",
  826. data: {
  827. id: deletedIds
  828. }
  829. }).done(function (data) {
  830. if (!data.error.length) {
  831. message.success('删除成功!');
  832. this.setState({
  833. loading: false,
  834. });
  835. } else {
  836. message.warning(data.error[0].message);
  837. };
  838. this.formatLoadData();
  839. }.bind(this));
  840. },
  841. //规格整行停用
  842. blockRowSize() {
  843. let deletedIds = '';
  844. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  845. let rowItem = this.state.selectedRows[idx];
  846. if (rowItem.formatId) {
  847. deletedIds=rowItem.formatId;
  848. };
  849. };
  850. this.setState({
  851. selectedRowKeys: [],
  852. loading: deletedIds.length > 0
  853. });
  854. $.ajax({
  855. method: "get",
  856. dataType: "json",
  857. crossDomain: false,
  858. url: globalConfig.context + "/api/admin/ProjectSize/stopProjectSize",
  859. data: {
  860. id: deletedIds
  861. }
  862. }).done(function (data) {
  863. if (!data.error.length) {
  864. message.success('该项目已成功停用!');
  865. this.setState({
  866. loading: false,
  867. });
  868. } else {
  869. message.warning(data.error[0].message);
  870. };
  871. this.formatLoadData();
  872. }.bind(this));
  873. },
  874. addClick() {
  875. this.state.RowData = {};
  876. this.setState({
  877. visible: true
  878. });
  879. this.addReset();
  880. },
  881. editClick(e) {
  882. this.state.RowData = {};
  883. this.setState({
  884. editvisible: true
  885. });
  886. },
  887. formatClick(e) {
  888. this.formatReset();
  889. this.state.RowData = {};
  890. this.setState({
  891. formatvisible: true
  892. });
  893. },
  894. editformatClick(e) {
  895. this.state.RowData = {};
  896. this.setState({
  897. editformatvisible: true
  898. });
  899. },
  900. handleCancel() {
  901. this.setState({ visible: false })
  902. },
  903. edithandleCancel(e) {
  904. this.setState({
  905. editvisible: false
  906. });
  907. },
  908. formathandleCancel(e) {
  909. this.setState({
  910. formatvisible: false
  911. });
  912. },
  913. editformathandleCancel(e) {
  914. this.setState({
  915. editformatvisible: false
  916. });
  917. },
  918. search() {
  919. this.loadData();
  920. },
  921. //搜索部分的清零
  922. reset() {
  923. this.state.bname = '';//项目名称清零
  924. this.state.cid = undefined;//品类名称清零
  925. this.state.ressSearch= undefined;//省市区清零
  926. this.state.activityFlag = undefined;//活动生效清零
  927. this.state.status = undefined;//项目状态清零
  928. this.loadData();
  929. },
  930. //新增部分的清零
  931. addReset(){
  932. this.state.categoryName='';//项目名称清零
  933. this.state.ProvinceCity=undefined;
  934. this.state.addCid=undefined;
  935. },
  936. //规格新增清零
  937. formatReset() {
  938. this.state.formatPname = '';//规格名称清零
  939. this.state.formatPrice = '';//市场价清零
  940. this.state.formatOffset = '';//最低折扣清零
  941. this.state.formatActivityPrice = '';//活动价清零
  942. this.state.formatMemberPrice = '';//会员价清零
  943. this.state.formatActivityFlag = undefined;//活动生效标识清零
  944. this.state.formatStatus= undefined;//项目状态清零
  945. this.formatLoadData();
  946. },
  947. //详情tab切换数据处理
  948. callback(e) {
  949. this.setState({
  950. callnub: e,
  951. })
  952. if(e == 1) {
  953. }
  954. if(e == 2) {
  955. this.formatLoadData();
  956. }
  957. },
  958. //更多搜索的显示与否
  959. searchSwitch() {
  960. this.setState({
  961. searchMore: !this.state.searchMore
  962. });
  963. },
  964. render() {
  965. const FormItem = Form.Item
  966. const rowSelection = {
  967. selectedRowKeys: this.state.selectedRowKeys,
  968. onChange: (selectedRowKeys, selectedRows) => {
  969. this.setState({
  970. selectedRows: selectedRows.slice(-1),
  971. selectedRowKeys: selectedRowKeys.slice(-1)
  972. });
  973. }
  974. };
  975. const formItemLayout = {
  976. labelCol: { span: 8 },
  977. wrapperCol: { span: 14 },
  978. };
  979. const { getFieldDecorator } = this.props.form;
  980. const hasSelected = this.state.selectedRowKeys.length > 0;
  981. const { RangePicker } = DatePicker;
  982. return (
  983. <div className="user-content" >
  984. <div className="content-title">
  985. <div className="user-search">
  986. <Button type="primary" className="addButton" onClick={this.addClick} style={{float:'right',marginRight:'50px'}}>新增项目<Icon type="plus" /></Button>
  987. <Input placeholder="业务项目名称" style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  988. value={this.state.bname}
  989. onChange={(e) => { this.setState({ bname: e.target.value }); }} />
  990. <Select placeholder="业务品类"
  991. style={{ width:'200px',marginRight:'10px' }}
  992. value={this.state.cid}
  993. onChange={(e) => { this.setState({ cid: e }) }} notFoundContent="未获取到上级品类列表">
  994. {this.state.contactsOption}
  995. </Select>
  996. <Button type="primary" onClick={this.search} style={{marginRight:'10px'}}>搜索</Button>
  997. <Button onClick={this.reset} style={{marginRight:'10px'}}>重置</Button>
  998. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  999. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1000. disabled={!hasSelected}
  1001. >删除<Icon type="minus" />
  1002. </Button>
  1003. </Popconfirm>
  1004. <Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
  1005. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
  1006. disabled={!hasSelected}
  1007. >停用<Icon type="minus" />
  1008. </Button>
  1009. </Popconfirm>
  1010. <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1011. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'block'}}>
  1012. <span style={{marginRight:'10px',marginBottom:'10px'}}>
  1013. <Cascader options={provinceSelect()} value={this.state.ressSearch} placeholder="选择省份"
  1014. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1015. </span>
  1016. <span style={{marginRight:'10px',marginBottom:'10px'}}>
  1017. <Cascader options={citySelect()} value={this.state.ressSearch} placeholder="选择城市"
  1018. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1019. </span>
  1020. <span style={{marginRight:'10px'}}>
  1021. <Cascader options={areaSelect()} value={this.state.ressSearch} placeholder="选择地区"
  1022. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1023. </span>
  1024. <Select placeholder="活动生效标识"
  1025. style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  1026. value={this.state.activityFlag}
  1027. onChange={(e) => { this.setState({ activityFlag: e }) }}>
  1028. <Select.Option value="0" >有效</Select.Option>
  1029. <Select.Option value="1" >无效</Select.Option>
  1030. </Select>
  1031. <Select placeholder="项目状态"
  1032. style={{width:'150px',marginRight:'10px'}}
  1033. value={this.state.status}
  1034. onChange={(e) => { this.setState({ status: e }) }}>
  1035. <Select.Option value="0" >正常</Select.Option>
  1036. <Select.Option value="1" >停用</Select.Option>
  1037. </Select>
  1038. </div>
  1039. </div>
  1040. <div className="patent-table">
  1041. <Spin spinning={this.state.loading}>
  1042. <Table columns={this.state.columns}
  1043. dataSource={this.state.dataSource}
  1044. rowSelection={rowSelection}
  1045. pagination={this.state.pagination}
  1046. onRowClick={this.tableRowClick}
  1047. current={this.state.aa}/>
  1048. </Spin>
  1049. </div>
  1050. <div className="patent-desc">
  1051. <Modal maskClosable={false} visible={this.state.visible}
  1052. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1053. width='400px'
  1054. title='新增业务项目'
  1055. footer=''
  1056. className="admin-desc-content">
  1057. <Form horizontal onSubmit={this.addhandleSubmit} id="demand-form">
  1058. <Spin spinning={this.state.loading}>
  1059. <div className="clearfix">
  1060. <FormItem
  1061. labelCol={{ span: 7 }}
  1062. wrapperCol={{ span: 12 }}
  1063. label="业务项目名称" >
  1064. <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
  1065. onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
  1066. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1067. </FormItem>
  1068. </div>
  1069. <div className="clearfix">
  1070. <FormItem
  1071. labelCol={{ span: 7 }}
  1072. wrapperCol={{ span: 12 }}
  1073. label="业务品类"
  1074. >
  1075. <Select placeholder="请选择业务品类" value={this.state.addCid} onChange={(e)=>{this.setState({addCid:e})}}
  1076. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1077. {this.state.contactsOption}
  1078. </Select>
  1079. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1080. </FormItem>
  1081. </div>
  1082. <div className="clearfix">
  1083. <FormItem
  1084. labelCol={{ span: 7 }}
  1085. wrapperCol={{ span: 12 }}
  1086. label="省"
  1087. >
  1088. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1089. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1090. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1091. </FormItem>
  1092. </div>
  1093. <div className="clearfix">
  1094. <FormItem
  1095. labelCol={{ span: 7 }}
  1096. wrapperCol={{ span: 12 }}
  1097. label="省-市"
  1098. >
  1099. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1100. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1101. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1102. </FormItem>
  1103. </div>
  1104. <div className="clearfix">
  1105. <FormItem
  1106. labelCol={{ span: 7 }}
  1107. wrapperCol={{ span: 12 }}
  1108. label="省-市-区"
  1109. >
  1110. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1111. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1112. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1113. </FormItem>
  1114. </div>
  1115. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1116. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1117. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1118. </FormItem>
  1119. </Spin>
  1120. </Form >
  1121. </Modal>
  1122. </div>
  1123. <div className="patent-desc">
  1124. <Modal maskClosable={false} visible={this.state.formatvisible}
  1125. onOk={this.checkPatentProcess} onCancel={this.formathandleCancel}
  1126. width='400px'
  1127. title='新增项目规格'
  1128. footer=''
  1129. className="admin-desc-content">
  1130. <Form horizontal onSubmit={this.formathandleSubmit} id="demand-form">
  1131. <Spin spinning={this.state.loading}>
  1132. <div className="clearfix">
  1133. <FormItem
  1134. labelCol={{ span: 7 }}
  1135. wrapperCol={{ span: 12 }}
  1136. label="项目名称"
  1137. >
  1138. <span style={{width:'94%'}}>{this.state.editName}</span>
  1139. </FormItem>
  1140. <FormItem
  1141. labelCol={{ span: 7 }}
  1142. wrapperCol={{ span: 12 }}
  1143. label="规格名称" >
  1144. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1145. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1146. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1147. </FormItem>
  1148. <FormItem
  1149. labelCol={{ span: 7 }}
  1150. wrapperCol={{ span: 12 }}
  1151. label="市场价"
  1152. >
  1153. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1154. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1155. </FormItem>
  1156. <FormItem
  1157. labelCol={{ span: 7 }}
  1158. wrapperCol={{ span: 12 }}
  1159. label="活动价"
  1160. >
  1161. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1162. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1163. </FormItem>
  1164. <FormItem
  1165. labelCol={{ span: 7 }}
  1166. wrapperCol={{ span: 12 }}
  1167. label="最低折扣"
  1168. >
  1169. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1170. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1171. </FormItem>
  1172. <FormItem
  1173. labelCol={{ span: 7 }}
  1174. wrapperCol={{ span: 12 }}
  1175. label="会员价"
  1176. >
  1177. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1178. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1179. </FormItem>
  1180. <FormItem
  1181. labelCol={{ span: 7 }}
  1182. wrapperCol={{ span: 12 }}
  1183. label="活动生效"
  1184. >
  1185. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1186. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1187. {
  1188. gameState.map(function (item) {
  1189. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1190. })
  1191. }
  1192. </Select>
  1193. </FormItem>
  1194. <FormItem
  1195. labelCol={{ span: 7 }}
  1196. wrapperCol={{ span: 12 }}
  1197. label="项目状态"
  1198. >
  1199. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1200. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1201. {
  1202. conditionOrganization.map(function (item) {
  1203. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1204. })
  1205. }
  1206. </Select>
  1207. </FormItem>
  1208. </div>
  1209. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1210. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1211. <Button className="set-submit" type="ghost" onClick={this.formathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1212. </FormItem>
  1213. </Spin>
  1214. </Form >
  1215. </Modal>
  1216. </div>
  1217. <div className="patent-desc">
  1218. <Modal maskClosable={false} visible={this.state.editformatvisible}
  1219. onOk={this.checkPatentProcess} onCancel={this.editformathandleCancel}
  1220. width='400px'
  1221. title='编辑项目规格'
  1222. footer=''
  1223. className="admin-desc-content">
  1224. <Form horizontal onSubmit={this.editformathandleSubmit} id="demand-form">
  1225. <Spin spinning={this.state.loading}>
  1226. <div className="clearfix">
  1227. <FormItem
  1228. labelCol={{ span: 7 }}
  1229. wrapperCol={{ span: 12 }}
  1230. label="规格名称" >
  1231. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1232. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1233. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1234. </FormItem>
  1235. </div>
  1236. <div className="clearfix" >
  1237. <FormItem
  1238. labelCol={{ span: 7 }}
  1239. wrapperCol={{ span: 12 }}
  1240. label="创建人"
  1241. >
  1242. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1243. </FormItem>
  1244. <FormItem
  1245. labelCol={{ span: 7 }}
  1246. wrapperCol={{ span: 12 }}
  1247. label="市场价"
  1248. >
  1249. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1250. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1251. </FormItem>
  1252. <FormItem
  1253. labelCol={{ span: 7 }}
  1254. wrapperCol={{ span: 12 }}
  1255. label="活动价"
  1256. >
  1257. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1258. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1259. </FormItem>
  1260. <FormItem
  1261. labelCol={{ span: 7 }}
  1262. wrapperCol={{ span: 12 }}
  1263. label="最低折扣"
  1264. >
  1265. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1266. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1267. </FormItem>
  1268. <FormItem
  1269. labelCol={{ span: 7 }}
  1270. wrapperCol={{ span: 12 }}
  1271. label="会员价"
  1272. >
  1273. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1274. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1275. </FormItem>
  1276. <FormItem
  1277. labelCol={{ span: 7 }}
  1278. wrapperCol={{ span: 12 }}
  1279. label="活动生效"
  1280. >
  1281. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1282. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1283. {
  1284. gameState.map(function (item) {
  1285. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1286. })
  1287. }
  1288. </Select>
  1289. </FormItem>
  1290. <FormItem
  1291. labelCol={{ span: 7 }}
  1292. wrapperCol={{ span: 12 }}
  1293. label="项目状态"
  1294. >
  1295. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1296. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1297. {
  1298. conditionOrganization.map(function (item) {
  1299. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1300. })
  1301. }
  1302. </Select>
  1303. </FormItem>
  1304. </div>
  1305. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1306. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1307. <Button className="set-submit" type="ghost" onClick={this.editformathandleCancel} style={{marginLeft:'15px'}}>取消</Button>
  1308. </FormItem>
  1309. </Spin>
  1310. </Form >
  1311. </Modal>
  1312. </div>
  1313. <div className="patent-desc">
  1314. <Modal
  1315. className="customeDetails"
  1316. title="业务项目"
  1317. width='1000px'
  1318. visible={this.state.editvisible}
  1319. onOk={this.edithandleCancel}
  1320. onCancel={this.edithandleCancel}
  1321. footer=''
  1322. >
  1323. <Tabs defaultActiveKey="1" onChange={this.callback} activeKey={this.state.callnub}>
  1324. <TabPane tab="业务项目基本资料" key="1">
  1325. <Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
  1326. <Spin spinning={this.state.loading}>
  1327. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1328. <FormItem className="half-item"
  1329. labelCol={{ span: 4 }}
  1330. wrapperCol={{ span: 12 }}
  1331. label="项目名称" >
  1332. <Input placeholder="项目名称" value={this.state.editName} style={{width:'94%'}}
  1333. onChange={(e)=>{this.setState({editName:e.target.value})}} required="required"/>
  1334. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1335. </FormItem>
  1336. <FormItem className="half-item"
  1337. labelCol={{ span: 4 }}
  1338. wrapperCol={{ span: 12 }}
  1339. label="业务品类"
  1340. >
  1341. <Select placeholder="请选择业务品类" value={this.state.editCname} onChange={(e)=>{this.setState({editCname:e})}}
  1342. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1343. {this.state.contactsOption}
  1344. </Select>
  1345. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1346. </FormItem>
  1347. </div>
  1348. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1349. <FormItem className="half-item"
  1350. labelCol={{ span: 4 }}
  1351. wrapperCol={{ span: 12 }}
  1352. label="省"
  1353. >
  1354. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1355. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1356. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1357. </FormItem>
  1358. <FormItem className="half-item"
  1359. labelCol={{ span: 4 }}
  1360. wrapperCol={{ span: 12 }}
  1361. label="省-市"
  1362. >
  1363. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1364. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1365. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1366. </FormItem>
  1367. <FormItem className="half-item"
  1368. labelCol={{ span: 4 }}
  1369. wrapperCol={{ span: 12 }}
  1370. label="省-市-区"
  1371. >
  1372. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1373. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1374. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1375. </FormItem>
  1376. </div>
  1377. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1378. <FormItem className="half-item"
  1379. labelCol={{ span: 4 }}
  1380. wrapperCol={{ span: 12 }}
  1381. label="市场价"
  1382. >
  1383. <Input placeholder="市场价" value={this.state.editPrice} style={{width:'94%'}}
  1384. onChange={(e)=>{this.setState({editPrice:e.target.value})}}/>
  1385. </FormItem>
  1386. <FormItem className="half-item"
  1387. labelCol={{ span: 4 }}
  1388. wrapperCol={{ span: 12 }}
  1389. label="活动价"
  1390. >
  1391. <Input placeholder="活动价" value={this.state.editActivityPrice} style={{width:'94%'}}
  1392. onChange={(e)=>{this.setState({editActivityPrice:e.target.value})}}/>
  1393. </FormItem>
  1394. <FormItem className="half-item"
  1395. labelCol={{ span: 4 }}
  1396. wrapperCol={{ span: 12 }}
  1397. label="最低折扣"
  1398. >
  1399. <Input placeholder="最低折扣" value={this.state.editOffset} style={{width:'94%'}}
  1400. onChange={(e)=>{this.setState({editOffset:e.target.value})}}/>
  1401. </FormItem>
  1402. <FormItem className="half-item"
  1403. labelCol={{ span: 4 }}
  1404. wrapperCol={{ span: 12 }}
  1405. label="会员价"
  1406. >
  1407. <Input placeholder="会员价" value={this.state.editMemberPrice} style={{width:'94%'}}
  1408. onChange={(e)=>{this.setState({editMemberPrice:e.target.value})}}/>
  1409. </FormItem>
  1410. <FormItem className="half-item"
  1411. labelCol={{ span: 4 }}
  1412. wrapperCol={{ span: 12 }}
  1413. label="活动生效"
  1414. >
  1415. <Select placeholder="活动生效" value={this.state.editActivityFlag} style={{width:'94%'}}
  1416. onChange={(e)=>{this.setState({editActivityFlag:e})}}>
  1417. {
  1418. gameState.map(function (item) {
  1419. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1420. })
  1421. }
  1422. </Select>
  1423. </FormItem>
  1424. <FormItem className="half-item"
  1425. labelCol={{ span: 4 }}
  1426. wrapperCol={{ span: 12 }}
  1427. label="项目状态"
  1428. >
  1429. <Select placeholder="项目状态" value={this.state.editStatus} style={{width:'94%'}}
  1430. onChange={(e)=>{this.setState({editStatus:e})}}>
  1431. {
  1432. conditionOrganization.map(function (item) {
  1433. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1434. })
  1435. }
  1436. </Select>
  1437. </FormItem>
  1438. <FormItem className="half-item"
  1439. labelCol={{ span: 4 }}
  1440. wrapperCol={{ span: 12 }}
  1441. label="创建人"
  1442. >
  1443. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1444. </FormItem>
  1445. <FormItem className="half-item"
  1446. labelCol={{ span: 4 }}
  1447. wrapperCol={{ span: 12 }}
  1448. label="创建时间"
  1449. >
  1450. <span style={{width:'94%'}}>{this.state.editTime}</span>
  1451. </FormItem>
  1452. </div>
  1453. <div className="clearfix">
  1454. <FormItem
  1455. labelCol={{ span: 4 }}
  1456. wrapperCol={{ span: 12 }}
  1457. label="业务项目服务内容" >
  1458. <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.editIntroduce}
  1459. onChange={(e) => { this.setState({ editIntroduce: e.target.value }) }}/>
  1460. </FormItem>
  1461. </div>
  1462. <div className="clearfix">
  1463. <FormItem
  1464. labelCol={{ span: 4 }}
  1465. wrapperCol={{ span: 12 }}
  1466. label="业务项目价值及作用" >
  1467. <Input type="textarea" rows={4} placeholder="业务项目价值及作用" value={this.state.editValueEffect}
  1468. onChange={(e) => { this.setState({ editValueEffect: e.target.value }) }}/>
  1469. </FormItem>
  1470. </div>
  1471. <div className="clearfix">
  1472. <FormItem
  1473. labelCol={{ span: 4 }}
  1474. wrapperCol={{ span: 12 }}
  1475. label="业务项目客户基本条件" >
  1476. <Input type="textarea" rows={4} placeholder="业务项目客户基本条件" value={this.state.editClientSize}
  1477. onChange={(e) => { this.setState({ editClientSize: e.target.value }) }}/>
  1478. </FormItem>
  1479. </div>
  1480. <div className="clearfix pictures">
  1481. <FormItem className="half-item"
  1482. labelCol={{ span: 8 }}
  1483. wrapperCol={{ span: 10 }}
  1484. label="业务项目图标" >
  1485. <PicturesWall
  1486. pictureSign="business_project_min_picture"
  1487. fileList={this.getOrgCodeUrl}
  1488. pictureUrl={this.state.orgCodeUrl} />
  1489. <p>图片建议:图片要清晰。(35*35)</p>
  1490. </FormItem>
  1491. <FormItem className="half-item"
  1492. labelCol={{ span: 4 }}
  1493. wrapperCol={{ span: 12 }}
  1494. label="业务项目图标" >
  1495. <PicturesWall
  1496. pictureSign="business_project_max_picture"
  1497. fileList={this.getCompanyLogoUrl}
  1498. pictureUrl={this.state.companyLogoUrl} />
  1499. <p>图片建议:图片要清晰。(200*200)</p>
  1500. </FormItem>
  1501. </div>
  1502. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'110px'}}>保存</Button>
  1503. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px',marginBottom:'20px'}}>取消</Button>
  1504. </Spin>
  1505. </Form>
  1506. </TabPane>
  1507. <TabPane tab="业务项目规格" key="2">
  1508. <div className="clearfix" >
  1509. <Popconfirm title="是否删除?" onConfirm={this.delectRowSize} okText="是" cancelText="否">
  1510. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1511. disabled={!hasSelected}
  1512. >删除<Icon type="minus" />
  1513. </Button>
  1514. </Popconfirm>
  1515. <Popconfirm title="是否停用?" onConfirm={this.blockRowSize} okText="是" cancelText="否" >
  1516. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px',display:'none'}}
  1517. disabled={!hasSelected}
  1518. >停用<Icon type="minus" />
  1519. </Button>
  1520. </Popconfirm>
  1521. <Button className="ContactsList" type="primary" onClick={this.formatClick} style={{float:'right',marginBottom:'10px'}}>新增</Button>
  1522. </div>
  1523. <div className="clearfix">
  1524. <Spin spinning={this.state.loading}>
  1525. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  1526. <Table
  1527. pagination={this.state.formatPagination}
  1528. columns={this.state.ContactsLists}
  1529. dataSource={this.state.formatDataSource}
  1530. rowSelection={rowSelection}
  1531. onRowClick={this.formatTableRowClick}
  1532. />
  1533. </Form>
  1534. </Spin>
  1535. </div>
  1536. </TabPane>
  1537. </Tabs>
  1538. </Modal>
  1539. </div>
  1540. </div>
  1541. </div>
  1542. );
  1543. }
  1544. }));
  1545. export default BusinessProject;