businessQuery.jsx 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646
  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. lvlType: thisdata.lvlType,//国家级
  533. editProvince: thisdata.province,//省
  534. editCity: thisdata.city,//市
  535. editDistrict: thisdata.district,//区
  536. editPrice: thisdata.price,//市场价
  537. editActivityPrice: thisdata.activityPrice,//活动价
  538. editOffset: thisdata.offset,//最低折扣
  539. editMemberPrice: thisdata.memberPrice,//会员价
  540. editActivityFlag: thisdata.activityFlag,//活动生效标识
  541. editStatus: thisdata.status,//品类状态
  542. editCreateId: thisdata.createName,//创建人
  543. editTime: thisdata.createTimeFormattedDate,//创建时间
  544. editIntroduce: thisdata.introduce,//服务内容
  545. editProjectUrl: thisdata.projectUrl,//项目地址
  546. editValueEffect: thisdata.valueEffect,//价值及作用
  547. editClientSize: thisdata.clientSize,//基本条件
  548. editBoutique: thisdata.boutique,//是否精品
  549. orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
  550. cditCompanyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
  551. });
  552. };
  553. this.setState({
  554. editId: thisdata.id,//每一条记录的ID
  555. editName: thisdata.bname,//项目名称
  556. editCname: thisdata.cname,//项目分类
  557. editCid: thisdata.cid,//项目分类
  558. editCountry: thisdata.country,//是否全国
  559. lvlType: thisdata.lvlType,//国家级
  560. editProvince: thisdata.province,//省
  561. editCity: thisdata.city,//市
  562. editDistrict: thisdata.district,//区
  563. editPrice: thisdata.price,//市场价
  564. editActivityPrice: thisdata.activityPrice,//活动价
  565. editOffset: thisdata.offset,//最低折扣
  566. editMemberPrice: thisdata.memberPrice,//会员价
  567. editActivityFlag: thisdata.activityFlag,//活动生效标识
  568. editStatus: thisdata.status,//品类状态
  569. editCreateId: thisdata.createName,//创建人
  570. editTime: thisdata.createTimeFormattedDate,//创建时间
  571. editIntroduce: thisdata.introduce,//服务内容
  572. editProjectUrl: thisdata.projectUrl,//项目地址
  573. editValueEffect: thisdata.valueEffect,//价值及作用
  574. editClientSize: thisdata.clientSize,//基本条件
  575. editBoutique: thisdata.boutique,//是否精品
  576. orgCodeUrl: thisdata.minLogo ? splitUrl(thisdata.minLogo, ',', globalConfig.avatarHost + '/upload') : [],
  577. companyLogoUrl: thisdata.maxLogo ? splitUrl(thisdata.maxLogo, ',', globalConfig.avatarHost + '/upload') : [],
  578. editDataSource: theArr,
  579. ProvinceCity: ProvinceCity,
  580. });
  581. }.bind(this),
  582. }).always(function () {
  583. this.setState({
  584. loading: false
  585. });
  586. }.bind(this));
  587. },
  588. //左侧图片地址
  589. getOrgCodeUrl(e) {
  590. this.setState({ orgCodeUrl: e });
  591. },
  592. //右侧图片地址
  593. getCompanyLogoUrl(e) {
  594. this.setState({ companyLogoUrl: e });
  595. },
  596. //编辑一个规格,保存
  597. editformathandleSubmit(e) {
  598. e.preventDefault();
  599. let offsetText;
  600. if (this.state.formatOffset) {
  601. if (this.state.formatOffset > 10 || this.state.formatOffset < 0) {
  602. message.warning('最低折扣请输入0到10之间的数字');
  603. return false;
  604. } else {
  605. offsetText = this.state.formatOffset;
  606. }
  607. }
  608. this.props.form.validateFields((err, values) => {
  609. if (!err) {
  610. this.setState({
  611. loading: true
  612. });
  613. $.ajax({
  614. method: "post",
  615. dataType: "json",
  616. crossDomain: false,
  617. url: globalConfig.context + '/api/admin/ProjectSize/orgProjectSize',
  618. data: {
  619. id: this.state.formatId,//项目ID
  620. pname: this.state.formatPname,//规格名称
  621. price: this.state.formatPrice,//市场价
  622. offset: offsetText,//最低折扣
  623. activityPrice: this.state.formatActivityPrice,//活动价
  624. activityFlag: this.state.formatActivityFlag,//活动生效标识
  625. memberPrice: this.state.formatMemberPrice,//会员价
  626. status: this.state.formatStatus,//项目状态
  627. }
  628. }).done(function (data) {
  629. this.setState({
  630. loading: false
  631. });
  632. if (!data.error.length) {
  633. message.success('修改规格成功!');
  634. this.formatLoadData();
  635. this.editformathandleCancel();
  636. } else {
  637. message.warning(data.error[0].message);
  638. }
  639. }.bind(this));
  640. }
  641. });
  642. },
  643. //新增一个规格,保存
  644. formathandleSubmit(e) {
  645. e.preventDefault();
  646. let offsetText;
  647. if (this.state.formatOffset) {
  648. if (this.state.formatOffset > 10 || this.state.formatOffset < 0) {
  649. message.warning('最低折扣请输入0到10之间的数字');
  650. return false;
  651. } else {
  652. offsetText = this.state.formatOffset;
  653. }
  654. }
  655. this.props.form.validateFields((err, values) => {
  656. if (!err) {
  657. this.setState({
  658. loading: true
  659. });
  660. $.ajax({
  661. method: "post",
  662. dataType: "json",
  663. crossDomain: false,
  664. url: globalConfig.context + '/api/admin/ProjectSize/addProjectSize',
  665. data: {
  666. pid: this.state.editId,//项目ID
  667. pname: this.state.formatPname,//规格名称
  668. price: this.state.formatPrice,//市场价
  669. offset: offsetText,//最低折扣
  670. activityPrice: this.state.formatActivityPrice,//活动价
  671. activityFlag: this.state.formatActivityFlag,//活动生效标识
  672. memberPrice: this.state.formatMemberPrice,//会员价
  673. status: this.state.formatStatus,//项目状态
  674. }
  675. }).done(function (data) {
  676. this.setState({
  677. loading: false
  678. });
  679. if (!data.error.length) {
  680. message.success('新增规格成功!');
  681. this.formathandleCancel();
  682. this.formatLoadData();
  683. } else {
  684. message.warning(data.error[0].message);
  685. }
  686. }.bind(this));
  687. }
  688. });
  689. },
  690. //新增一个项目,保存
  691. addhandleSubmit(e) {
  692. e.preventDefault();
  693. if (!this.state.categoryName) {
  694. message.warning('请输入项目名称');
  695. return false;
  696. }
  697. if (!this.state.addCid) {
  698. message.warning('请选择项目品类');
  699. return false;
  700. }
  701. let isCountry = 0;
  702. let pro = '';
  703. let city = '';
  704. let dis = '';
  705. if (this.state.ProvinceCity == undefined) {
  706. message.warning('请选择项目有效范围');
  707. return false;
  708. } else {
  709. switch (parseInt(this.state.ProvinceCity.length)) {
  710. case 1: pro = this.state.ProvinceCity[0]; break;
  711. case 2: pro = this.state.ProvinceCity[0]; city = this.state.ProvinceCity[1]; break;
  712. case 3: pro = this.state.ProvinceCity[0]; city = this.state.ProvinceCity[1]; dis = this.state.ProvinceCity[2]; break;
  713. }
  714. }
  715. if (pro == 0) {
  716. isCountry = 1;
  717. pro = '';
  718. }
  719. this.props.form.validateFields((err, values) => {
  720. if (!err) {
  721. this.setState({
  722. loading: true
  723. });
  724. //上级组织字典
  725. let nameText = this.state.SuperArr;
  726. let superText = nameText[parseInt(this.state.addCid)].id;
  727. $.ajax({
  728. method: "post",
  729. dataType: "json",
  730. crossDomain: false,
  731. url: globalConfig.context + '/api/admin/ProjectSize/addProject',
  732. data: {
  733. bname: this.state.categoryName,//项目名称
  734. cid: superText,//品类类ID
  735. boutique: this.state.boutique ? this.state.boutique : '0',
  736. country: isCountry,//是否全国
  737. province: pro,//省
  738. city: city,//市
  739. district: dis,//区
  740. }
  741. }).done(function (data) {
  742. this.setState({
  743. loading: false
  744. });
  745. if (!data.error.length) {
  746. message.success('新增项目成功!');
  747. this.handleCancel();
  748. this.selectSuperId();
  749. } else {
  750. message.warning(data.error[0].message);
  751. }
  752. }.bind(this));
  753. }
  754. });
  755. },
  756. //项目整行删除
  757. delectRow() {
  758. let deletedIds = '';
  759. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  760. let rowItem = this.state.selectedRows[idx];
  761. if (rowItem.id) {
  762. deletedIds = rowItem.id;
  763. };
  764. };
  765. this.setState({
  766. selectedRowKeys: [],
  767. loading: deletedIds.length > 0
  768. });
  769. $.ajax({
  770. method: "get",
  771. dataType: "json",
  772. crossDomain: false,
  773. url: globalConfig.context + "/api/admin/ProjectSize/deleteProject",
  774. data: {
  775. id: deletedIds
  776. }
  777. }).done(function (data) {
  778. if (!data.error.length) {
  779. message.success('删除成功!');
  780. this.setState({
  781. loading: false,
  782. });
  783. } else {
  784. message.warning(data.error[0].message);
  785. };
  786. this.selectSuperId();
  787. }.bind(this));
  788. },
  789. //项目整行停用
  790. blockRow() {
  791. let deletedIds = '';
  792. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  793. let rowItem = this.state.selectedRows[idx];
  794. if (rowItem.id) {
  795. deletedIds = rowItem.id;
  796. };
  797. };
  798. this.setState({
  799. selectedRowKeys: [],
  800. loading: deletedIds.length > 0
  801. });
  802. $.ajax({
  803. method: "get",
  804. dataType: "json",
  805. crossDomain: false,
  806. url: globalConfig.context + "/api/admin/ProjectSize/stopProject",
  807. data: {
  808. id: deletedIds
  809. }
  810. }).done(function (data) {
  811. if (!data.error.length) {
  812. message.success('该项目已成功停用!');
  813. this.setState({
  814. loading: false,
  815. });
  816. } else {
  817. message.warning(data.error[0].message);
  818. };
  819. this.selectSuperId();
  820. }.bind(this));
  821. },
  822. //规格整行删除
  823. delectRowSize() {
  824. let deletedIds = '';
  825. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  826. let rowItem = this.state.selectedRows[idx];
  827. if (rowItem.formatId) {
  828. deletedIds = rowItem.formatId;
  829. };
  830. };
  831. this.setState({
  832. selectedRowKeys: [],
  833. loading: deletedIds.length > 0
  834. });
  835. $.ajax({
  836. method: "get",
  837. dataType: "json",
  838. crossDomain: false,
  839. url: globalConfig.context + "/api/admin/ProjectSize/deleteProjectSize",
  840. data: {
  841. id: deletedIds
  842. }
  843. }).done(function (data) {
  844. if (!data.error.length) {
  845. message.success('删除成功!');
  846. this.setState({
  847. loading: false,
  848. });
  849. } else {
  850. message.warning(data.error[0].message);
  851. };
  852. this.formatLoadData();
  853. }.bind(this));
  854. },
  855. //规格整行停用
  856. blockRowSize() {
  857. let deletedIds = '';
  858. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  859. let rowItem = this.state.selectedRows[idx];
  860. if (rowItem.formatId) {
  861. deletedIds = rowItem.formatId;
  862. };
  863. };
  864. this.setState({
  865. selectedRowKeys: [],
  866. loading: deletedIds.length > 0
  867. });
  868. $.ajax({
  869. method: "get",
  870. dataType: "json",
  871. crossDomain: false,
  872. url: globalConfig.context + "/api/admin/ProjectSize/stopProjectSize",
  873. data: {
  874. id: deletedIds
  875. }
  876. }).done(function (data) {
  877. if (!data.error.length) {
  878. message.success('该项目已成功停用!');
  879. this.setState({
  880. loading: false,
  881. });
  882. } else {
  883. message.warning(data.error[0].message);
  884. };
  885. this.formatLoadData();
  886. }.bind(this));
  887. },
  888. addClick() {
  889. this.state.RowData = {};
  890. this.setState({
  891. visible: true
  892. });
  893. this.addReset();
  894. },
  895. editClick(e) {
  896. this.state.RowData = {};
  897. this.setState({
  898. editvisible: true
  899. });
  900. },
  901. formatClick(e) {
  902. this.formatReset();
  903. this.state.RowData = {};
  904. this.setState({
  905. formatvisible: true
  906. });
  907. },
  908. editformatClick(e) {
  909. this.state.RowData = {};
  910. this.setState({
  911. editformatvisible: true
  912. });
  913. },
  914. handleCancel() {
  915. this.setState({ visible: false })
  916. },
  917. edithandleCancel(e) {
  918. this.setState({
  919. editvisible: false
  920. });
  921. },
  922. formathandleCancel(e) {
  923. this.setState({
  924. formatvisible: false
  925. });
  926. },
  927. editformathandleCancel(e) {
  928. this.setState({
  929. editformatvisible: false
  930. });
  931. },
  932. search() {
  933. this.loadData();
  934. },
  935. //搜索部分的清零
  936. reset() {
  937. this.state.bname = '';//项目名称清零
  938. this.state.cid = undefined;//品类名称清零
  939. this.state.ressSearch = undefined;//省市区清零
  940. this.state.activityFlag = undefined;//活动生效清零
  941. this.state.status = undefined;//项目状态清零
  942. this.loadData();
  943. },
  944. //新增部分的清零
  945. addReset() {
  946. this.state.categoryName = '';//项目名称清零
  947. this.state.ProvinceCity = undefined;
  948. this.state.addCid = undefined;
  949. this.state.boutique = '';
  950. },
  951. //规格新增清零
  952. formatReset() {
  953. this.state.formatPname = '';//规格名称清零
  954. this.state.formatPrice = '';//市场价清零
  955. this.state.formatOffset = '';//最低折扣清零
  956. this.state.formatActivityPrice = '';//活动价清零
  957. this.state.formatMemberPrice = '';//会员价清零
  958. this.state.formatActivityFlag = undefined;//活动生效标识清零
  959. this.state.formatStatus = undefined;//项目状态清零
  960. this.formatLoadData();
  961. },
  962. //详情tab切换数据处理
  963. callback(e) {
  964. this.setState({
  965. callnub: e,
  966. })
  967. if (e == 1) {
  968. }
  969. if (e == 2) {
  970. this.formatLoadData();
  971. }
  972. },
  973. //更多搜索的显示与否
  974. searchSwitch() {
  975. this.setState({
  976. searchMore: !this.state.searchMore
  977. });
  978. },
  979. changeList(arr) {
  980. const newArr = [];
  981. this.state.columns.forEach(item => {
  982. arr.forEach(val => {
  983. if (val === item.title) {
  984. newArr.push(item);
  985. }
  986. });
  987. });
  988. this.setState({
  989. changeList: newArr
  990. });
  991. },
  992. render() {
  993. const FormItem = Form.Item
  994. const rowSelection = {
  995. selectedRowKeys: this.state.selectedRowKeys,
  996. onChange: (selectedRowKeys, selectedRows) => {
  997. this.setState({
  998. selectedRows: selectedRows.slice(-1),
  999. selectedRowKeys: selectedRowKeys.slice(-1)
  1000. });
  1001. }
  1002. };
  1003. const formItemLayout = {
  1004. labelCol: { span: 8 },
  1005. wrapperCol: { span: 14 },
  1006. };
  1007. const { getFieldDecorator } = this.props.form;
  1008. const hasSelected = this.state.selectedRowKeys.length > 0;
  1009. const { RangePicker } = DatePicker;
  1010. return (
  1011. <div className="user-content" >
  1012. <div className="content-title">
  1013. <Tabs
  1014. defaultActiveKey="1"
  1015. onChange={this.callback}
  1016. className="test">
  1017. <TabPane tab="搜索" key="1">
  1018. <div className="user-search">
  1019. <Input placeholder="业务项目名称" style={{ width: '150px', marginRight: '10px', marginBottom: '10px', marginLeft: 10 }}
  1020. value={this.state.bname}
  1021. onChange={(e) => { this.setState({ bname: e.target.value }); }} />
  1022. <Select placeholder="业务品类"
  1023. style={{ width: '200px', marginRight: '10px' }}
  1024. value={this.state.cid}
  1025. onChange={(e) => { this.setState({ cid: e }) }} notFoundContent="未获取到上级品类列表">
  1026. {this.state.contactsOption}
  1027. </Select>
  1028. <Button type="primary" onClick={this.search} style={{ marginRight: '10px' }}>搜索</Button>
  1029. <Button onClick={this.reset} style={{ marginRight: '10px' }}>重置</Button>
  1030. <Popconfirm title="是否停用?" onConfirm={this.blockRow} okText="是" cancelText="否">
  1031. <Button style={{ background: "#ea0862", border: "none", color: "#fff", marginRight: '10px', marginLeft: '10px', display: 'none' }}
  1032. disabled={!hasSelected}
  1033. >停用<Icon type="minus" />
  1034. </Button>
  1035. </Popconfirm>
  1036. <span style={{ marginRight: '20px' }}>更多搜索 <Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1037. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : { display: 'block' }}>
  1038. <span style={{ marginRight: '10px', marginBottom: '10px' }}>
  1039. <Cascader options={provinceSelect()} style={{ marginLeft: 10 }} value={this.state.ressSearch} placeholder="选择省份"
  1040. onChange={(e, pre) => { this.setState({ ressSearch: e }) }} />
  1041. </span>
  1042. <span style={{ marginRight: '10px', marginBottom: '10px' }}>
  1043. <Cascader options={citySelect()} value={this.state.ressSearch} placeholder="选择城市"
  1044. onChange={(e, pre) => { this.setState({ ressSearch: e }) }} />
  1045. </span>
  1046. <span style={{ marginRight: '10px' }}>
  1047. <Cascader options={areaSelect()} value={this.state.ressSearch} placeholder="选择地区"
  1048. onChange={(e, pre) => { this.setState({ ressSearch: e }) }} />
  1049. </span>
  1050. <Select placeholder="活动生效标识"
  1051. style={{ width: '150px', marginRight: '10px', marginBottom: '10px' }}
  1052. value={this.state.activityFlag}
  1053. onChange={(e) => { this.setState({ activityFlag: e }) }}>
  1054. <Select.Option value="0" >有效</Select.Option>
  1055. <Select.Option value="1" >无效</Select.Option>
  1056. </Select>
  1057. <Select placeholder="项目状态"
  1058. style={{ width: '150px', marginRight: '10px' }}
  1059. value={this.state.status}
  1060. onChange={(e) => { this.setState({ status: e }) }}>
  1061. <Select.Option value="0" >正常</Select.Option>
  1062. <Select.Option value="1" >停用</Select.Option>
  1063. </Select>
  1064. </div>
  1065. </div>
  1066. </TabPane>
  1067. <TabPane tab="更改表格显示数据" key="3">
  1068. <div style={{ marginLeft: 10 }}>
  1069. <ChooseList
  1070. columns={this.state.columns}
  1071. changeFn={this.changeList}
  1072. changeList={this.state.changeList}
  1073. top={55}
  1074. margin={11}
  1075. />
  1076. </div>
  1077. </TabPane>
  1078. </Tabs>
  1079. <div className="patent-table">
  1080. <Spin spinning={this.state.listLoading}>
  1081. <Table columns={
  1082. this.state.changeList
  1083. ? this.state.changeList
  1084. : this.state.columns
  1085. }
  1086. dataSource={this.state.dataSource}
  1087. rowSelection={rowSelection}
  1088. pagination={this.state.pagination}
  1089. onRowClick={this.tableRowClick}
  1090. current={this.state.aa} />
  1091. </Spin>
  1092. </div>
  1093. <div className="patent-desc">
  1094. <Modal maskClosable={false} visible={this.state.visible}
  1095. onOk={this.checkPatentProcess} onCancel={this.handleCancel}
  1096. width='400px'
  1097. title='新增业务项目'
  1098. footer=''
  1099. className="admin-desc-content">
  1100. <Form horizontal onSubmit={this.addhandleSubmit} id="demand-form">
  1101. <Spin spinning={this.state.loading}>
  1102. <div className="clearfix">
  1103. <FormItem
  1104. labelCol={{ span: 7 }}
  1105. wrapperCol={{ span: 12 }}
  1106. label="业务项目名称" >
  1107. <Input placeholder="业务项目名称" value={this.state.categoryName} style={{ width: '94%' }}
  1108. onChange={(e) => { this.setState({ categoryName: e.target.value }) }} required="required" />
  1109. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1110. </FormItem>
  1111. </div>
  1112. <div className="clearfix">
  1113. <FormItem
  1114. labelCol={{ span: 7 }}
  1115. wrapperCol={{ span: 12 }}
  1116. label="业务品类"
  1117. >
  1118. <Select placeholder="请选择业务品类" value={this.state.addCid} onChange={(e) => { this.setState({ addCid: e }) }}
  1119. notFoundContent="未获取到业务品类列表" style={{ width: '94%' }} required="required">
  1120. {this.state.contactsOption}
  1121. </Select>
  1122. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1123. </FormItem>
  1124. </div>
  1125. <div className="clearfix">
  1126. <FormItem
  1127. labelCol={{ span: 7 }}
  1128. wrapperCol={{ span: 12 }}
  1129. label="是否精品"
  1130. >
  1131. <Radio.Group value={this.state.boutique} onChange={(e) => {
  1132. this.setState({ boutique: e.target.value })
  1133. }}>
  1134. <Radio value={1}>精品</Radio>
  1135. <Radio value={0}>非精品</Radio>
  1136. </Radio.Group>
  1137. </FormItem>
  1138. </div>
  1139. <div className="clearfix">
  1140. <FormItem
  1141. labelCol={{ span: 7 }}
  1142. wrapperCol={{ span: 12 }}
  1143. label="省"
  1144. >
  1145. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{ width: '94%' }}
  1146. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1147. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1148. </FormItem>
  1149. </div>
  1150. <div className="clearfix">
  1151. <FormItem
  1152. labelCol={{ span: 7 }}
  1153. wrapperCol={{ span: 12 }}
  1154. label="省-市"
  1155. >
  1156. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{ width: '94%' }}
  1157. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1158. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1159. </FormItem>
  1160. </div>
  1161. <div className="clearfix">
  1162. <FormItem
  1163. labelCol={{ span: 7 }}
  1164. wrapperCol={{ span: 12 }}
  1165. label="省-市-区"
  1166. >
  1167. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{ width: '94%' }}
  1168. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1169. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1170. </FormItem>
  1171. </div>
  1172. </Spin>
  1173. </Form >
  1174. </Modal>
  1175. </div>
  1176. <div className="patent-desc">
  1177. <Modal maskClosable={false} visible={this.state.formatvisible}
  1178. onOk={this.checkPatentProcess} onCancel={this.formathandleCancel}
  1179. width='400px'
  1180. title='新增项目规格'
  1181. footer=''
  1182. className="admin-desc-content">
  1183. <Form horizontal onSubmit={this.formathandleSubmit} id="demand-form">
  1184. <Spin spinning={this.state.loading}>
  1185. <div className="clearfix">
  1186. <FormItem
  1187. labelCol={{ span: 7 }}
  1188. wrapperCol={{ span: 12 }}
  1189. label="项目名称"
  1190. >
  1191. <span style={{ width: '94%' }}>{this.state.editName}</span>
  1192. </FormItem>
  1193. <FormItem
  1194. labelCol={{ span: 7 }}
  1195. wrapperCol={{ span: 12 }}
  1196. label="规格名称" >
  1197. <Input placeholder="规格名称" value={this.state.formatPname} style={{ width: '94%' }}
  1198. onChange={(e) => { this.setState({ formatPname: e.target.value }) }} required="required" />
  1199. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1200. </FormItem>
  1201. <FormItem
  1202. labelCol={{ span: 7 }}
  1203. wrapperCol={{ span: 12 }}
  1204. label="市场价"
  1205. >
  1206. <Input placeholder="市场价" value={this.state.formatPrice} style={{ width: '94%' }}
  1207. onChange={(e) => { this.setState({ formatPrice: e.target.value }) }} />
  1208. </FormItem>
  1209. <FormItem
  1210. labelCol={{ span: 7 }}
  1211. wrapperCol={{ span: 12 }}
  1212. label="活动价"
  1213. >
  1214. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{ width: '94%' }}
  1215. onChange={(e) => { this.setState({ formatActivityPrice: e.target.value }) }} />
  1216. </FormItem>
  1217. <FormItem
  1218. labelCol={{ span: 7 }}
  1219. wrapperCol={{ span: 12 }}
  1220. label="最低折扣"
  1221. >
  1222. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{ width: '94%' }}
  1223. onChange={(e) => { this.setState({ formatOffset: e.target.value }) }} />
  1224. </FormItem>
  1225. <FormItem
  1226. labelCol={{ span: 7 }}
  1227. wrapperCol={{ span: 12 }}
  1228. label="会员价"
  1229. >
  1230. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{ width: '94%' }}
  1231. onChange={(e) => { this.setState({ formatMemberPrice: e.target.value }) }} />
  1232. </FormItem>
  1233. <FormItem
  1234. labelCol={{ span: 7 }}
  1235. wrapperCol={{ span: 12 }}
  1236. label="活动生效"
  1237. >
  1238. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{ width: '94%' }}
  1239. onChange={(e) => { this.setState({ formatActivityFlag: e }) }}>
  1240. {
  1241. gameState.map(function (item) {
  1242. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1243. })
  1244. }
  1245. </Select>
  1246. </FormItem>
  1247. <FormItem
  1248. labelCol={{ span: 7 }}
  1249. wrapperCol={{ span: 12 }}
  1250. label="项目状态"
  1251. >
  1252. <Select placeholder="项目状态" value={this.state.formatStatus} style={{ width: '94%' }}
  1253. onChange={(e) => { this.setState({ formatStatus: e }) }}>
  1254. {
  1255. conditionOrganization.map(function (item) {
  1256. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1257. })
  1258. }
  1259. </Select>
  1260. </FormItem>
  1261. </div>
  1262. </Spin>
  1263. </Form >
  1264. </Modal>
  1265. </div>
  1266. <div className="patent-desc">
  1267. <Modal maskClosable={false} visible={this.state.editformatvisible}
  1268. onOk={this.checkPatentProcess} onCancel={this.editformathandleCancel}
  1269. width='400px'
  1270. title='编辑项目规格'
  1271. footer=''
  1272. className="admin-desc-content">
  1273. <Form horizontal onSubmit={this.editformathandleSubmit} id="demand-form">
  1274. <Spin spinning={this.state.loading}>
  1275. <div className="clearfix">
  1276. <FormItem
  1277. labelCol={{ span: 7 }}
  1278. wrapperCol={{ span: 12 }}
  1279. label="规格名称" >
  1280. <Input placeholder="规格名称" value={this.state.formatPname} style={{ width: '94%' }}
  1281. onChange={(e) => { this.setState({ formatPname: e.target.value }) }} required="required" />
  1282. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1283. </FormItem>
  1284. </div>
  1285. <div className="clearfix" >
  1286. <FormItem
  1287. labelCol={{ span: 7 }}
  1288. wrapperCol={{ span: 12 }}
  1289. label="创建人"
  1290. >
  1291. <span style={{ width: '94%' }}>{this.state.editCreateId}</span>
  1292. </FormItem>
  1293. <FormItem
  1294. labelCol={{ span: 7 }}
  1295. wrapperCol={{ span: 12 }}
  1296. label="市场价"
  1297. >
  1298. <Input placeholder="市场价" value={this.state.formatPrice} style={{ width: '94%' }}
  1299. onChange={(e) => { this.setState({ formatPrice: e.target.value }) }} />
  1300. </FormItem>
  1301. <FormItem
  1302. labelCol={{ span: 7 }}
  1303. wrapperCol={{ span: 12 }}
  1304. label="活动价"
  1305. >
  1306. <Input placeholder="活动价" value={this.state.formatActivityPrice} style={{ width: '94%' }}
  1307. onChange={(e) => { this.setState({ formatActivityPrice: e.target.value }) }} />
  1308. </FormItem>
  1309. <FormItem
  1310. labelCol={{ span: 7 }}
  1311. wrapperCol={{ span: 12 }}
  1312. label="最低折扣"
  1313. >
  1314. <Input placeholder="最低折扣" value={this.state.formatOffset} style={{ width: '94%' }}
  1315. onChange={(e) => { this.setState({ formatOffset: e.target.value }) }} />
  1316. </FormItem>
  1317. <FormItem
  1318. labelCol={{ span: 7 }}
  1319. wrapperCol={{ span: 12 }}
  1320. label="会员价"
  1321. >
  1322. <Input placeholder="会员价" value={this.state.formatMemberPrice} style={{ width: '94%' }}
  1323. onChange={(e) => { this.setState({ formatMemberPrice: e.target.value }) }} />
  1324. </FormItem>
  1325. <FormItem
  1326. labelCol={{ span: 7 }}
  1327. wrapperCol={{ span: 12 }}
  1328. label="活动生效"
  1329. >
  1330. <Select placeholder="活动生效" value={this.state.formatActivityFlag} style={{ width: '94%' }}
  1331. onChange={(e) => { this.setState({ formatActivityFlag: e }) }}>
  1332. {
  1333. gameState.map(function (item) {
  1334. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1335. })
  1336. }
  1337. </Select>
  1338. </FormItem>
  1339. <FormItem
  1340. labelCol={{ span: 7 }}
  1341. wrapperCol={{ span: 12 }}
  1342. label="项目状态"
  1343. >
  1344. <Select placeholder="项目状态" value={this.state.formatStatus} style={{ width: '94%' }}
  1345. onChange={(e) => { this.setState({ formatStatus: e }) }}>
  1346. {
  1347. conditionOrganization.map(function (item) {
  1348. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1349. })
  1350. }
  1351. </Select>
  1352. </FormItem>
  1353. </div>
  1354. <FormItem wrapperCol={{ span: 12, offset: 7 }}>
  1355. </FormItem>
  1356. </Spin>
  1357. </Form >
  1358. </Modal>
  1359. </div>
  1360. <div className="patent-desc">
  1361. <Modal
  1362. className="customeDetails"
  1363. title="业务项目"
  1364. width='1200px'
  1365. visible={this.state.editvisible}
  1366. onOk={this.edithandleCancel}
  1367. onCancel={this.edithandleCancel}
  1368. footer=''
  1369. >
  1370. <Tabs defaultActiveKey="1" onChange={this.callback} activeKey={this.state.callnub}>
  1371. <TabPane tab="业务项目基本资料" key="1">
  1372. <Form horizontal onSubmit={this.edithandleSubmit} id="demand-form">
  1373. <Spin spinning={this.state.loading}>
  1374. <div className="clearfix" style={{ paddingLeft: '60px' }}>
  1375. <FormItem className="half-item"
  1376. labelCol={{ span: 4 }}
  1377. wrapperCol={{ span: 12 }}
  1378. label="项目名称" >
  1379. <Input placeholder="项目名称" value={this.state.editName} style={{ width: '94%' }}
  1380. onChange={(e) => { this.setState({ editName: e.target.value }) }} required="required" />
  1381. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1382. </FormItem>
  1383. <FormItem className="half-item"
  1384. labelCol={{ span: 4 }}
  1385. wrapperCol={{ span: 12 }}
  1386. label="业务品类"
  1387. >
  1388. <Select placeholder="请选择业务品类" value={this.state.editCname} onChange={(e) => { this.setState({ editCname: e }) }}
  1389. notFoundContent="未获取到业务品类列表" style={{ width: '94%' }} required="required">
  1390. {this.state.contactsOption}
  1391. </Select>
  1392. <span className="mandatory" style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1393. </FormItem>
  1394. </div>
  1395. <div className="clearfix" style={{ paddingLeft: '60px' }}>
  1396. <FormItem
  1397. className="half-item"
  1398. labelCol={{ span: 4 }}
  1399. wrapperCol={{ span: 12 }}
  1400. label="国家级"
  1401. >
  1402. <Select
  1403. placeholder="请选择"
  1404. value={this.state.lvlType}
  1405. onChange={(e) => {
  1406. this.setState({ lvlType: e });
  1407. }}
  1408. notFoundContent="请选择国家级"
  1409. style={{ width: "94%" }}
  1410. required="required"
  1411. >
  1412. <Select.Option value={0}>否</Select.Option>
  1413. <Select.Option value={1}>国家级</Select.Option>
  1414. <Select.Option value={2}>省级</Select.Option>
  1415. <Select.Option value={3}>市级</Select.Option>
  1416. </Select>
  1417. <span
  1418. className="mandatory"
  1419. style={{ color: "red", marginLeft: "5px" }}
  1420. >
  1421. *
  1422. </span>
  1423. </FormItem>
  1424. <FormItem className="half-item"
  1425. labelCol={{ span: 4 }}
  1426. wrapperCol={{ span: 12 }}
  1427. label="省"
  1428. >
  1429. <Cascader options={provinceSelect()} value={this.state.ProvinceCity} placeholder="选择省" style={{ width: '94%' }}
  1430. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1431. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1432. </FormItem>
  1433. <FormItem className="half-item"
  1434. labelCol={{ span: 4 }}
  1435. wrapperCol={{ span: 12 }}
  1436. label="省-市"
  1437. >
  1438. <Cascader options={citySelect()} value={this.state.ProvinceCity} placeholder="选择市" style={{ width: '94%' }}
  1439. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1440. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1441. </FormItem>
  1442. <FormItem className="half-item"
  1443. labelCol={{ span: 4 }}
  1444. wrapperCol={{ span: 12 }}
  1445. label="省-市-区"
  1446. >
  1447. <Cascader options={areaSelect()} value={this.state.ProvinceCity} placeholder="选择区" style={{ width: '94%' }}
  1448. onChange={(e, pre) => { this.setState({ ProvinceCity: e }) }} />
  1449. <span style={{ color: 'red', marginLeft: '5px' }}>*</span>
  1450. </FormItem>
  1451. <FormItem className="half-item"
  1452. labelCol={{ span: 4 }}
  1453. wrapperCol={{ span: 12 }}
  1454. label="是否精品"
  1455. >
  1456. <Radio.Group value={this.state.editBoutique} onChange={(e) => {
  1457. this.setState({ editBoutique: e.target.value })
  1458. }}>
  1459. <Radio value={1}>精品</Radio>
  1460. <Radio value={0}>非精品</Radio>
  1461. </Radio.Group>
  1462. </FormItem>
  1463. </div>
  1464. <div className="clearfix" style={{ paddingLeft: '60px' }}>
  1465. <FormItem className="half-item"
  1466. labelCol={{ span: 4 }}
  1467. wrapperCol={{ span: 12 }}
  1468. label="市场价"
  1469. >
  1470. <Input placeholder="市场价" value={this.state.editPrice} style={{ width: '94%' }}
  1471. onChange={(e) => { this.setState({ editPrice: e.target.value }) }} />
  1472. </FormItem>
  1473. <FormItem className="half-item"
  1474. labelCol={{ span: 4 }}
  1475. wrapperCol={{ span: 12 }}
  1476. label="活动价"
  1477. >
  1478. <Input placeholder="活动价" value={this.state.editActivityPrice} style={{ width: '94%' }}
  1479. onChange={(e) => { this.setState({ editActivityPrice: e.target.value }) }} />
  1480. </FormItem>
  1481. <FormItem className="half-item"
  1482. labelCol={{ span: 4 }}
  1483. wrapperCol={{ span: 12 }}
  1484. label="最低折扣"
  1485. >
  1486. <Input placeholder="最低折扣" value={this.state.editOffset} style={{ width: '94%' }}
  1487. onChange={(e) => { this.setState({ editOffset: e.target.value }) }} />
  1488. </FormItem>
  1489. <FormItem className="half-item"
  1490. labelCol={{ span: 4 }}
  1491. wrapperCol={{ span: 12 }}
  1492. label="会员价"
  1493. >
  1494. <Input placeholder="会员价" value={this.state.editMemberPrice} style={{ width: '94%' }}
  1495. onChange={(e) => { this.setState({ editMemberPrice: e.target.value }) }} />
  1496. </FormItem>
  1497. <FormItem className="half-item"
  1498. labelCol={{ span: 4 }}
  1499. wrapperCol={{ span: 12 }}
  1500. label="活动生效"
  1501. >
  1502. <Select placeholder="活动生效" value={this.state.editActivityFlag} style={{ width: '94%' }}
  1503. onChange={(e) => { this.setState({ editActivityFlag: e }) }}>
  1504. {
  1505. gameState.map(function (item) {
  1506. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1507. })
  1508. }
  1509. </Select>
  1510. </FormItem>
  1511. <FormItem className="half-item"
  1512. labelCol={{ span: 4 }}
  1513. wrapperCol={{ span: 12 }}
  1514. label="项目状态"
  1515. >
  1516. <Select placeholder="项目状态" value={this.state.editStatus} style={{ width: '94%' }}
  1517. onChange={(e) => { this.setState({ editStatus: e }) }}>
  1518. {
  1519. conditionOrganization.map(function (item) {
  1520. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1521. })
  1522. }
  1523. </Select>
  1524. </FormItem>
  1525. <FormItem className="half-item"
  1526. labelCol={{ span: 4 }}
  1527. wrapperCol={{ span: 12 }}
  1528. label="创建人"
  1529. >
  1530. <span style={{ width: '94%' }}>{this.state.editCreateId}</span>
  1531. </FormItem>
  1532. <FormItem className="half-item"
  1533. labelCol={{ span: 4 }}
  1534. wrapperCol={{ span: 12 }}
  1535. label="创建时间"
  1536. >
  1537. <span style={{ width: '94%' }}>{this.state.editTime}</span>
  1538. </FormItem>
  1539. </div>
  1540. <div className="clearfix">
  1541. <FormItem
  1542. labelCol={{ span: 4 }}
  1543. wrapperCol={{ span: 12 }}
  1544. label="项目地址" >
  1545. <Input type="textarea" rows={1} placeholder="业务项目服务内容" value={this.state.editProjectUrl}
  1546. onChange={(e) => { this.setState({ editProjectUrl: e.target.value }) }} />
  1547. </FormItem>
  1548. </div>
  1549. <div className="clearfix">
  1550. <FormItem
  1551. labelCol={{ span: 4 }}
  1552. wrapperCol={{ span: 12 }}
  1553. label="业务项目服务内容" >
  1554. <Input type="textarea" rows={4} placeholder="业务项目服务内容" value={this.state.editIntroduce}
  1555. onChange={(e) => { this.setState({ editIntroduce: e.target.value }) }} />
  1556. </FormItem>
  1557. </div>
  1558. <div className="clearfix">
  1559. <FormItem
  1560. labelCol={{ span: 4 }}
  1561. wrapperCol={{ span: 12 }}
  1562. label="业务项目价值及作用" >
  1563. <Input type="textarea" rows={4} placeholder="业务项目价值及作用" value={this.state.editValueEffect}
  1564. onChange={(e) => { this.setState({ editValueEffect: e.target.value }) }} />
  1565. </FormItem>
  1566. </div>
  1567. <div className="clearfix">
  1568. <FormItem
  1569. labelCol={{ span: 4 }}
  1570. wrapperCol={{ span: 12 }}
  1571. label="业务项目客户基本条件" >
  1572. <Input type="textarea" rows={4} placeholder="业务项目客户基本条件" value={this.state.editClientSize}
  1573. onChange={(e) => { this.setState({ editClientSize: e.target.value }) }} />
  1574. </FormItem>
  1575. </div>
  1576. <div className="clearfix pictures" style={{ "marginBottom": "60px" }}>
  1577. <FormItem className="half-item"
  1578. labelCol={{ span: 8 }}
  1579. wrapperCol={{ span: 10 }}
  1580. label="业务项目图标" >
  1581. <PicturesWall
  1582. domId={'businessQuery1'}
  1583. pictureSign="business_project_min_picture"
  1584. fileList={this.getOrgCodeUrl}
  1585. pictureUrl={this.state.orgCodeUrl} />
  1586. <p>图片建议:图片要清晰。(35*35)</p>
  1587. </FormItem>
  1588. <FormItem className="half-item"
  1589. labelCol={{ span: 4 }}
  1590. wrapperCol={{ span: 12 }}
  1591. label="业务项目图标" >
  1592. <PicturesWall
  1593. domId={'businessQuery2'}
  1594. pictureSign="business_project_max_picture"
  1595. fileList={this.getCompanyLogoUrl}
  1596. pictureUrl={this.state.companyLogoUrl} />
  1597. <p>图片建议:图片要清晰。(200*200)</p>
  1598. </FormItem>
  1599. </div>
  1600. </Spin>
  1601. </Form>
  1602. </TabPane>
  1603. <TabPane tab="业务项目规格" key="2">
  1604. <div className="clearfix" >
  1605. <Popconfirm title="是否停用?" onConfirm={this.blockRowSize} okText="是" cancelText="否" >
  1606. <Button style={{ background: "#ea0862", border: "none", color: "#fff", marginRight: '10px', marginLeft: '10px', display: 'none' }}
  1607. disabled={!hasSelected}
  1608. >停用<Icon type="minus" />
  1609. </Button>
  1610. </Popconfirm>
  1611. </div>
  1612. <div className="clearfix">
  1613. <Spin spinning={this.state.loading}>
  1614. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  1615. <Table
  1616. pagination={this.state.formatPagination}
  1617. columns={this.state.ContactsLists}
  1618. dataSource={this.state.formatDataSource}
  1619. rowSelection={rowSelection}
  1620. onRowClick={this.formatTableRowClick}
  1621. />
  1622. </Form>
  1623. </Spin>
  1624. </div>
  1625. </TabPane>
  1626. </Tabs>
  1627. </Modal>
  1628. </div>
  1629. </div>
  1630. </div>
  1631. );
  1632. }
  1633. }));
  1634. export default BusinessProject;