businessProject.jsx 68 KB

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