businessProject.jsx 69 KB

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