businessQuery.jsx 70 KB

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