businessProject.jsx 69 KB

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