businessProject.jsx 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536
  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. <span style={{marginRight:'20px'}}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  988. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {display: 'block'}}>
  989. <span style={{marginRight:'10px',marginBottom:'10px'}}>
  990. <Cascader options={provinceSelect()} value={this.state.ressSearch} placeholder="选择省份"
  991. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  992. </span>
  993. <span style={{marginRight:'10px',marginBottom:'10px'}}>
  994. <Cascader options={citySelect()} value={this.state.ressSearch} placeholder="选择城市"
  995. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  996. </span>
  997. <span style={{marginRight:'10px'}}>
  998. <Cascader options={areaSelect()} value={this.state.ressSearch} placeholder="选择地区"
  999. onChange={(e,pre) => { this.setState({ ressSearch: e }) }} />
  1000. </span>
  1001. <Select placeholder="活动生效标识"
  1002. style={{width:'150px',marginRight:'10px',marginBottom:'10px'}}
  1003. value={this.state.activityFlag}
  1004. onChange={(e) => { this.setState({ activityFlag: e }) }}>
  1005. <Select.Option value="0" >有效</Select.Option>
  1006. <Select.Option value="1" >无效</Select.Option>
  1007. </Select>
  1008. <Select placeholder="项目状态"
  1009. style={{width:'150px',marginRight:'10px'}}
  1010. value={this.state.status}
  1011. onChange={(e) => { this.setState({ status: e }) }}>
  1012. <Select.Option value="0" >正常</Select.Option>
  1013. <Select.Option value="1" >停用</Select.Option>
  1014. </Select>
  1015. </div>
  1016. </div>
  1017. <div className="patent-table">
  1018. <Spin spinning={this.state.loading}>
  1019. <Table columns={this.state.columns}
  1020. dataSource={this.state.dataSource}
  1021. rowSelection={rowSelection}
  1022. pagination={this.state.pagination}
  1023. onRowClick={this.tableRowClick}
  1024. current={this.state.aa}/>
  1025. </Spin>
  1026. </div>
  1027. <div className="patent-desc">
  1028. <Modal maskClosable={false} visible={this.state.visible}
  1029. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1030. width='400px'
  1031. title='新增业务项目'
  1032. footer=''
  1033. className="admin-desc-content">
  1034. <Form horizontal onSubmit={this.addhandleSubmit} id="demand-form">
  1035. <Spin spinning={this.state.loading}>
  1036. <div className="clearfix">
  1037. <FormItem
  1038. labelCol={{ span: 7 }}
  1039. wrapperCol={{ span: 12 }}
  1040. label="业务项目名称" >
  1041. <Input placeholder="业务项目名称" value={this.state.categoryName} style={{width:'94%'}}
  1042. onChange={(e)=>{this.setState({categoryName:e.target.value})}} required="required"/>
  1043. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1044. </FormItem>
  1045. </div>
  1046. <div className="clearfix">
  1047. <FormItem
  1048. labelCol={{ span: 7 }}
  1049. wrapperCol={{ span: 12 }}
  1050. label="业务品类"
  1051. >
  1052. <Select placeholder="请选择业务品类" value={this.state.addCid} onChange={(e)=>{this.setState({addCid:e})}}
  1053. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1054. {this.state.contactsOption}
  1055. </Select>
  1056. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1057. </FormItem>
  1058. </div>
  1059. <div className="clearfix">
  1060. <FormItem
  1061. labelCol={{ span: 7 }}
  1062. wrapperCol={{ span: 12 }}
  1063. label="省"
  1064. >
  1065. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1066. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1067. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1068. </FormItem>
  1069. </div>
  1070. <div className="clearfix">
  1071. <FormItem
  1072. labelCol={{ span: 7 }}
  1073. wrapperCol={{ span: 12 }}
  1074. label="省-市"
  1075. >
  1076. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1077. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1078. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1079. </FormItem>
  1080. </div>
  1081. <div className="clearfix">
  1082. <FormItem
  1083. labelCol={{ span: 7 }}
  1084. wrapperCol={{ span: 12 }}
  1085. label="省-市-区"
  1086. >
  1087. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1088. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1089. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1090. </FormItem>
  1091. </div>
  1092. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1093. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1094. <Button className="set-submit" type="ghost" onClick={this.handleCancel} style={{marginLeft:'50px'}}>取消</Button>
  1095. </FormItem>
  1096. </Spin>
  1097. </Form >
  1098. </Modal>
  1099. </div>
  1100. <div className="patent-desc">
  1101. <Modal maskClosable={false} visible={this.state.formatvisible}
  1102. onOk={this.checkPatentProcess} onCancel={this.formathandleCancel}
  1103. width='400px'
  1104. title='新增项目规格'
  1105. footer=''
  1106. className="admin-desc-content">
  1107. <Form horizontal onSubmit={this.formathandleSubmit} id="demand-form">
  1108. <Spin spinning={this.state.loading}>
  1109. <div className="clearfix">
  1110. <FormItem
  1111. labelCol={{ span: 7 }}
  1112. wrapperCol={{ span: 12 }}
  1113. label="规格名称" >
  1114. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1115. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1116. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1117. </FormItem>
  1118. </div>
  1119. <div className="clearfix" >
  1120. <FormItem
  1121. labelCol={{ span: 7 }}
  1122. wrapperCol={{ span: 12 }}
  1123. label="创建人"
  1124. >
  1125. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1126. </FormItem>
  1127. <FormItem
  1128. labelCol={{ span: 7 }}
  1129. wrapperCol={{ span: 12 }}
  1130. label="市场价"
  1131. >
  1132. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1133. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1134. </FormItem>
  1135. <FormItem
  1136. labelCol={{ span: 7 }}
  1137. wrapperCol={{ span: 12 }}
  1138. label="活动价"
  1139. >
  1140. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1141. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1142. </FormItem>
  1143. <FormItem
  1144. labelCol={{ span: 7 }}
  1145. wrapperCol={{ span: 12 }}
  1146. label="最低折扣"
  1147. >
  1148. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1149. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1150. </FormItem>
  1151. <FormItem
  1152. labelCol={{ span: 7 }}
  1153. wrapperCol={{ span: 12 }}
  1154. label="会员价"
  1155. >
  1156. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1157. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1158. </FormItem>
  1159. <FormItem
  1160. labelCol={{ span: 7 }}
  1161. wrapperCol={{ span: 12 }}
  1162. label="活动生效"
  1163. >
  1164. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1165. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1166. {
  1167. gameState.map(function (item) {
  1168. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1169. })
  1170. }
  1171. </Select>
  1172. </FormItem>
  1173. <FormItem
  1174. labelCol={{ span: 7 }}
  1175. wrapperCol={{ span: 12 }}
  1176. label="项目状态"
  1177. >
  1178. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1179. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1180. {
  1181. conditionOrganization.map(function (item) {
  1182. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1183. })
  1184. }
  1185. </Select>
  1186. </FormItem>
  1187. </div>
  1188. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1189. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1190. <Button className="set-submit" type="ghost" onClick={this.formathandleCancel} style={{marginLeft:'50px'}}>取消</Button>
  1191. </FormItem>
  1192. </Spin>
  1193. </Form >
  1194. </Modal>
  1195. </div>
  1196. <div className="patent-desc">
  1197. <Modal maskClosable={false} visible={this.state.editformatvisible}
  1198. onOk={this.checkPatentProcess} onCancel={this.editformathandleCancel}
  1199. width='400px'
  1200. title='编辑项目规格'
  1201. footer=''
  1202. className="admin-desc-content">
  1203. <Form horizontal onSubmit={this.editformathandleSubmit} id="demand-form">
  1204. <Spin spinning={this.state.loading}>
  1205. <div className="clearfix">
  1206. <FormItem
  1207. labelCol={{ span: 7 }}
  1208. wrapperCol={{ span: 12 }}
  1209. label="规格名称" >
  1210. <Input placeholder="规格名称" value={this.state.formatPname} style={{width:'94%'}}
  1211. onChange={(e)=>{this.setState({formatPname:e.target.value})}} required="required"/>
  1212. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1213. </FormItem>
  1214. </div>
  1215. <div className="clearfix" >
  1216. <FormItem
  1217. labelCol={{ span: 7 }}
  1218. wrapperCol={{ span: 12 }}
  1219. label="创建人"
  1220. >
  1221. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1222. </FormItem>
  1223. <FormItem
  1224. labelCol={{ span: 7 }}
  1225. wrapperCol={{ span: 12 }}
  1226. label="市场价"
  1227. >
  1228. <Input placeholder="市场价" value={this.state.formatPrice} style={{width:'94%'}}
  1229. onChange={(e)=>{this.setState({formatPrice:e.target.value})}}/>
  1230. </FormItem>
  1231. <FormItem
  1232. labelCol={{ span: 7 }}
  1233. wrapperCol={{ span: 12 }}
  1234. label="活动价"
  1235. >
  1236. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%'}}
  1237. onChange={(e)=>{this.setState({formatActivityPrice:e.target.value})}}/>
  1238. </FormItem>
  1239. <FormItem
  1240. labelCol={{ span: 7 }}
  1241. wrapperCol={{ span: 12 }}
  1242. label="最低折扣"
  1243. >
  1244. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%'}}
  1245. onChange={(e)=>{this.setState({formatOffset:e.target.value})}}/>
  1246. </FormItem>
  1247. <FormItem
  1248. labelCol={{ span: 7 }}
  1249. wrapperCol={{ span: 12 }}
  1250. label="会员价"
  1251. >
  1252. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%'}}
  1253. onChange={(e)=>{this.setState({formatMemberPrice:e.target.value})}}/>
  1254. </FormItem>
  1255. <FormItem
  1256. labelCol={{ span: 7 }}
  1257. wrapperCol={{ span: 12 }}
  1258. label="活动生效"
  1259. >
  1260. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%'}}
  1261. onChange={(e)=>{this.setState({formatActivityFlag:e})}}>
  1262. {
  1263. gameState.map(function (item) {
  1264. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1265. })
  1266. }
  1267. </Select>
  1268. </FormItem>
  1269. <FormItem
  1270. labelCol={{ span: 7 }}
  1271. wrapperCol={{ span: 12 }}
  1272. label="项目状态"
  1273. >
  1274. <Select placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%'}}
  1275. onChange={(e)=>{this.setState({formatStatus:e})}}>
  1276. {
  1277. conditionOrganization.map(function (item) {
  1278. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1279. })
  1280. }
  1281. </Select>
  1282. </FormItem>
  1283. </div>
  1284. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1285. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1286. <Button className="set-submit" type="ghost" onClick={this.editformathandleCancel} style={{marginLeft:'50px'}}>取消</Button>
  1287. </FormItem>
  1288. </Spin>
  1289. </Form >
  1290. </Modal>
  1291. </div>
  1292. <div className="patent-desc">
  1293. <Modal
  1294. className="customeDetails"
  1295. title="业务项目"
  1296. width='1000px'
  1297. visible={this.state.editvisible}
  1298. onOk={this.edithandleCancel}
  1299. onCancel={this.edithandleCancel}
  1300. footer=''
  1301. >
  1302. <Tabs defaultActiveKey="1" onChange={this.callback}>
  1303. <TabPane tab="业务项目基本资料" key="1">
  1304. <Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
  1305. <Spin spinning={this.state.loading}>
  1306. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1307. <FormItem className="half-item"
  1308. labelCol={{ span: 4 }}
  1309. wrapperCol={{ span: 12 }}
  1310. label="项目名称" >
  1311. <Input placeholder="项目名称" value={this.state.editName} style={{width:'94%'}}
  1312. onChange={(e)=>{this.setState({editName:e.target.value})}} required="required"/>
  1313. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1314. </FormItem>
  1315. <FormItem className="half-item"
  1316. labelCol={{ span: 4 }}
  1317. wrapperCol={{ span: 12 }}
  1318. label="业务品类"
  1319. >
  1320. <Select placeholder="请选择业务品类" value={this.state.editCname} onChange={(e)=>{this.setState({editCname:e})}}
  1321. notFoundContent="未获取到业务品类列表" style={{width:'94%'}} required="required">
  1322. {this.state.contactsOption}
  1323. </Select>
  1324. <span className="mandatory" style={{color:'red',marginLeft:'5px'}}>*</span>
  1325. </FormItem>
  1326. </div>
  1327. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1328. <FormItem className="half-item"
  1329. labelCol={{ span: 4 }}
  1330. wrapperCol={{ span: 12 }}
  1331. label="省"
  1332. >
  1333. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{width:'94%'}}
  1334. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1335. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1336. </FormItem>
  1337. <FormItem className="half-item"
  1338. labelCol={{ span: 4 }}
  1339. wrapperCol={{ span: 12 }}
  1340. label="省-市"
  1341. >
  1342. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{width:'94%'}}
  1343. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1344. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1345. </FormItem>
  1346. <FormItem className="half-item"
  1347. labelCol={{ span: 4 }}
  1348. wrapperCol={{ span: 12 }}
  1349. label="省-市-区"
  1350. >
  1351. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{width:'94%'}}
  1352. onChange={(e,pre) => { this.setState({ ProvinceCity: e }) }} />
  1353. <span style={{color:'red',marginLeft:'5px'}}>*</span>
  1354. </FormItem>
  1355. </div>
  1356. <div className="clearfix" style={{paddingLeft:'60px'}}>
  1357. <FormItem className="half-item"
  1358. labelCol={{ span: 4 }}
  1359. wrapperCol={{ span: 12 }}
  1360. label="市场价"
  1361. >
  1362. <Input placeholder="市场价" value={this.state.editPrice} style={{width:'94%'}}
  1363. onChange={(e)=>{this.setState({editPrice:e.target.value})}}/>
  1364. </FormItem>
  1365. <FormItem className="half-item"
  1366. labelCol={{ span: 4 }}
  1367. wrapperCol={{ span: 12 }}
  1368. label="活动价"
  1369. >
  1370. <Input placeholder="活动价" value={this.state.editActivityPrice} style={{width:'94%'}}
  1371. onChange={(e)=>{this.setState({editActivityPrice:e.target.value})}}/>
  1372. </FormItem>
  1373. <FormItem className="half-item"
  1374. labelCol={{ span: 4 }}
  1375. wrapperCol={{ span: 12 }}
  1376. label="最低折扣"
  1377. >
  1378. <Input placeholder="最低折扣" value={this.state.editOffset} style={{width:'94%'}}
  1379. onChange={(e)=>{this.setState({editOffset:e.target.value})}}/>
  1380. </FormItem>
  1381. <FormItem className="half-item"
  1382. labelCol={{ span: 4 }}
  1383. wrapperCol={{ span: 12 }}
  1384. label="会员价"
  1385. >
  1386. <Input placeholder="会员价" value={this.state.editMemberPrice} style={{width:'94%'}}
  1387. onChange={(e)=>{this.setState({editMemberPrice:e.target.value})}}/>
  1388. </FormItem>
  1389. <FormItem className="half-item"
  1390. labelCol={{ span: 4 }}
  1391. wrapperCol={{ span: 12 }}
  1392. label="活动生效"
  1393. >
  1394. <Select placeholder="活动生效" value={this.state.editActivityFlag} style={{width:'94%'}}
  1395. onChange={(e)=>{this.setState({editActivityFlag:e})}}>
  1396. {
  1397. gameState.map(function (item) {
  1398. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1399. })
  1400. }
  1401. </Select>
  1402. </FormItem>
  1403. <FormItem className="half-item"
  1404. labelCol={{ span: 4 }}
  1405. wrapperCol={{ span: 12 }}
  1406. label="项目状态"
  1407. >
  1408. <Select placeholder="项目状态" value={this.state.editStatus} style={{width:'94%'}}
  1409. onChange={(e)=>{this.setState({editStatus:e})}}>
  1410. {
  1411. conditionOrganization.map(function (item) {
  1412. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1413. })
  1414. }
  1415. </Select>
  1416. </FormItem>
  1417. <FormItem className="half-item"
  1418. labelCol={{ span: 4 }}
  1419. wrapperCol={{ span: 12 }}
  1420. label="创建人"
  1421. >
  1422. <span style={{width:'94%'}}>{this.state.editCreateId}</span>
  1423. </FormItem>
  1424. <FormItem className="half-item"
  1425. labelCol={{ span: 4 }}
  1426. wrapperCol={{ span: 12 }}
  1427. label="创建时间"
  1428. >
  1429. <span style={{width:'94%'}}>{this.state.editTime}</span>
  1430. </FormItem>
  1431. </div>
  1432. <div className="clearfix">
  1433. <FormItem
  1434. labelCol={{ span: 4 }}
  1435. wrapperCol={{ span: 12 }}
  1436. label="业务项目服务内容" >
  1437. <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.editIntroduce}
  1438. onChange={(e) => { this.setState({ editIntroduce: e.target.value }) }}/>
  1439. </FormItem>
  1440. </div>
  1441. <div className="clearfix">
  1442. <FormItem
  1443. labelCol={{ span: 4 }}
  1444. wrapperCol={{ span: 12 }}
  1445. label="业务项目价值及作用" >
  1446. <Input type="textarea" rows={4} placeholder="业务项目价值及作用" value={this.state.editValueEffect}
  1447. onChange={(e) => { this.setState({ editValueEffect: e.target.value }) }}/>
  1448. </FormItem>
  1449. </div>
  1450. <div className="clearfix">
  1451. <FormItem
  1452. labelCol={{ span: 4 }}
  1453. wrapperCol={{ span: 12 }}
  1454. label="业务项目客户基本条件" >
  1455. <Input type="textarea" rows={4} placeholder="业务项目客户基本条件" value={this.state.editClientSize}
  1456. onChange={(e) => { this.setState({ editClientSize: e.target.value }) }}/>
  1457. </FormItem>
  1458. </div>
  1459. <div className="clearfix pictures">
  1460. <FormItem className="half-item"
  1461. labelCol={{ span: 8 }}
  1462. wrapperCol={{ span: 10 }}
  1463. label="业务项目图标" >
  1464. <PicturesWall
  1465. pictureSign="business_project_min_picture"
  1466. fileList={this.getOrgCodeUrl}
  1467. pictureUrl={this.state.orgCodeUrl} />
  1468. <p>图片建议:图片要清晰。(35*35)</p>
  1469. </FormItem>
  1470. <FormItem className="half-item"
  1471. labelCol={{ span: 4 }}
  1472. wrapperCol={{ span: 12 }}
  1473. label="业务项目图标" >
  1474. <PicturesWall
  1475. pictureSign="business_project_max_picture"
  1476. fileList={this.getCompanyLogoUrl}
  1477. pictureUrl={this.state.companyLogoUrl} />
  1478. <p>图片建议:图片要清晰。(200*200)</p>
  1479. </FormItem>
  1480. </div>
  1481. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'190px',marginBottom:'20px',marginTop:'20px'}}>保存</Button>
  1482. <Button className="set-submit" type="ghost" onClick={this.edithandleCancel} style={{marginLeft:'100px',marginBottom:'20px'}}>取消</Button>
  1483. </Spin>
  1484. </Form>
  1485. </TabPane>
  1486. <TabPane tab="业务项目规格" key="2">
  1487. <div className="clearfix" >
  1488. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  1489. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1490. disabled={!hasSelected}
  1491. >删除<Icon type="minus" />
  1492. </Button>
  1493. </Popconfirm>
  1494. <Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
  1495. <Button style={{ background: "#ea0862", border: "none", color: "#fff",marginRight:'10px' ,marginLeft:'10px'}}
  1496. disabled={!hasSelected}
  1497. >停用<Icon type="minus" />
  1498. </Button>
  1499. </Popconfirm>
  1500. <Button className="ContactsList" type="primary" onClick={this.formatClick} style={{float:'right',marginBottom:'10px'}}>新增</Button>
  1501. </div>
  1502. <div className="clearfix">
  1503. <Spin spinning={this.state.loading}>
  1504. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  1505. <Table
  1506. pagination={this.state.pagination}
  1507. columns={this.state.ContactsLists}
  1508. dataSource={this.state.formatDataSource}
  1509. rowSelection={rowSelection}
  1510. onRowClick={this.formatTableRowClick}
  1511. />
  1512. </Form>
  1513. </Spin>
  1514. </div>
  1515. </TabPane>
  1516. </Tabs>
  1517. </Modal>
  1518. </div>
  1519. </div>
  1520. </div>
  1521. );
  1522. }
  1523. }));
  1524. export default BusinessProject;