businessProject.jsx 74 KB

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