businessQuery.jsx 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626
  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. loading: 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. loading: 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.loading}>
  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 size='default' placeholder="规格名称" value={this.state.formatPname} style={{width:'94%',marginBottom:'5px'}}
  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%',marginBottom:'5px'}}>{this.state.editCreateId}</span>
  1290. </FormItem>
  1291. <FormItem
  1292. labelCol={{ span: 7 }}
  1293. wrapperCol={{ span: 12 }}
  1294. label="市场价"
  1295. >
  1296. <Input size='default' placeholder="市场价" value={this.state.formatPrice} style={{width:'94%',marginBottom:'5px'}}
  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 size='default' placeholder="活动价" value={this.state.formatActivityPrice} style={{width:'94%',marginBottom:'5px'}}
  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 size='default' placeholder="最低折扣" value={this.state.formatOffset} style={{width:'94%',marginBottom:'5px'}}
  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 size='default' placeholder="会员价" value={this.state.formatMemberPrice} style={{width:'94%',marginBottom:'5px'}}
  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 size='default' placeholder="活动生效" value={this.state.formatActivityFlag} style={{width:'94%',marginBottom:'5px'}}
  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 size='default' placeholder="项目状态" value={this.state.formatStatus} style={{width:'94%',marginBottom:'5px'}}
  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 style={{marginBottom:'5px'}} 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 style={{marginBottom:'5px'}} 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 style={{marginBottom:'5px'}} 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 style={{marginBottom:'5px'}} 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
  1577. style={{
  1578. background: "#ea0862",
  1579. border: "none",
  1580. color: "#fff",
  1581. marginRight:'10px' ,
  1582. marginLeft:'10px',
  1583. display:'none'
  1584. }}
  1585. disabled={!hasSelected}
  1586. >
  1587. 停用
  1588. <Icon type="minus" />
  1589. </Button>
  1590. </Popconfirm>
  1591. </div>
  1592. <div className="clearfix">
  1593. <Spin spinning={this.state.loading}>
  1594. <Form horizontal id="demand-form" onSubmit={this.contactSave} >
  1595. <Table
  1596. pagination={this.state.formatPagination}
  1597. columns={this.state.ContactsLists}
  1598. dataSource={this.state.formatDataSource}
  1599. // rowSelection={rowSelection}
  1600. onRowClick={this.formatTableRowClick}
  1601. />
  1602. </Form>
  1603. </Spin>
  1604. </div>
  1605. </TabPane>
  1606. </Tabs>
  1607. </Modal>
  1608. </div>
  1609. </div>
  1610. </div>
  1611. );
  1612. }
  1613. }));
  1614. export default BusinessProject;