businessProject.jsx 73 KB

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