addService.jsx 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete,DatePicker,Radio,Col} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import moment from 'moment';
  7. import Picture from '@/manageCenter/publicComponent/picture';
  8. import {orderTypes,customerType,jiedian,tepi,boutique} from '../../../dataDic.js';
  9. import {splitUrl,getTransactionProject,getChangeState,getTransactionChannel,beforeUploadFile,getProcessStatus,getLiquidationStatus,getboutique,getApprovedState,getjiedian} from '../../../tools.js';
  10. const Option = AutoComplete.Option;
  11. //图片组件
  12. const PicturesWall = React.createClass({
  13. getInitialState() {
  14. return {
  15. previewVisible: false,
  16. previewImage: '',
  17. fileList: [],
  18. }
  19. },
  20. getDefaultProps(){
  21. return{
  22. changeClick:this.modifyChange
  23. }
  24. },
  25. handleCancel() {
  26. this.setState({ previewVisible: false })
  27. },
  28. handlePreview(file) {
  29. this.setState({
  30. previewImage: file.url || file.thumbUrl,
  31. previewVisible: true,
  32. });
  33. },
  34. handleChange(info) {
  35. let fileList = info.fileList;
  36. this.setState({ fileList });
  37. this.props.fileList(fileList);
  38. },
  39. componentWillReceiveProps(nextProps) {
  40. this.state.fileList = nextProps.pictureUrl;
  41. },
  42. render() {
  43. const { previewVisible, previewImage, fileList } = this.state;
  44. const uploadButton = (
  45. <div>
  46. <Icon type="plus" />
  47. <div className="ant-upload-text">点击上传</div>
  48. </div>
  49. );
  50. return (
  51. <div style={{display:"inline-block"}}>
  52. <Upload
  53. beforeUpload={beforeUploadFile}
  54. action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
  55. data={{ 'sign': '' }}
  56. listType="picture-card"
  57. fileList={fileList}
  58. onPreview={this.handlePreview}
  59. onChange={this.handleChange} >
  60. {fileList.length >= 18 ? null : uploadButton}
  61. </Upload>
  62. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  63. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  64. </Modal>
  65. </div>
  66. );
  67. }
  68. });
  69. const NewService = Form.create()(React.createClass({
  70. //查看项目列表
  71. loadData(record) {
  72. this.state.data = [];
  73. this.setState({
  74. loading: true
  75. });
  76. $.ajax({
  77. method: "get",
  78. dataType: "json",
  79. crossDomain: false,
  80. url: globalConfig.context + '/api/admin/newOrder/getOrderTask',
  81. data: {
  82. orderNo:record?record.orderNo:this.props.datauser.orderNo
  83. },
  84. success: function (data) {
  85. let theArr = [];
  86. if (!data.data) {
  87. if (data.error && data.error.length) {
  88. message.warning(data.error[0].message);
  89. };
  90. } else {
  91. for (let i = 0; i < data.data.length; i++) {
  92. let thisdata = data.data[i];
  93. theArr.push({
  94. key: i,
  95. id:thisdata.id,
  96. orderNo:thisdata.orderNo,//订单编号
  97. commodityId:thisdata.commodityId,//项目ID
  98. commodityName:thisdata.commodityName,//项目名称
  99. cname:thisdata.cname,//项目类别
  100. commodityPrice:thisdata.commodityPrice,//项目价格
  101. commodityQuantity:thisdata.commodityQuantity,//项目数量
  102. main:thisdata.main,//是否为主要任务
  103. taskComment:thisdata.taskComment,//任务说明
  104. contacts:thisdata.contacts,//联系人
  105. contactsMobile:thisdata.contactsMobile,//联系人电话
  106. });
  107. };
  108. }
  109. this.setState({
  110. dataSource: theArr,
  111. pagination: false,
  112. });
  113. }.bind(this),
  114. }).always(function () {
  115. this.setState({
  116. loading: false
  117. });
  118. }.bind(this));
  119. },
  120. //收款节点
  121. loadDatas(record) {
  122. this.state.data = [];
  123. this.setState({
  124. loading: true
  125. });
  126. $.ajax({
  127. method: "get",
  128. dataType: "json",
  129. crossDomain: false,
  130. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  131. data: {
  132. orderNo:record?record.orderNo:this.props.datauser.orderNo
  133. },
  134. success: function (data) {
  135. let theArr = [];
  136. if (!data.data) {
  137. if (data.error && data.error.length) {
  138. message.warning(data.error[0].message);
  139. };
  140. } else {
  141. for (let i = 0; i < data.data.length; i++) {
  142. let thisdata = data.data[i];
  143. theArr.push({
  144. key: i,
  145. id:thisdata.id,
  146. });
  147. };
  148. }
  149. this.setState({
  150. dataSource: theArr,
  151. pagination: false,
  152. });
  153. }.bind(this),
  154. }).always(function () {
  155. this.setState({
  156. loading: false
  157. });
  158. }.bind(this));
  159. },
  160. getInitialState() {
  161. return {
  162. loading: false,
  163. visible: false,
  164. orgCodeUrl:[],
  165. customerArr:[],
  166. bussStats:false,
  167. checkedKeys: [],
  168. lookflowList:[],
  169. contractUrl:[],
  170. applicationUrl:[],
  171. active:{
  172. applySign:false
  173. },
  174. lookState:false,
  175. signBillVisible:false,
  176. commod:'',
  177. columns: [
  178. {
  179. title: '业务项目名称',
  180. dataIndex: 'commodityName',
  181. key: 'commodityName'
  182. }, {
  183. title: '项目类别',
  184. dataIndex: 'cname',
  185. key: 'cname',
  186. },{
  187. title: '项目数量',
  188. dataIndex: 'commodityQuantity',
  189. key: 'commodityQuantity'
  190. }, {
  191. title: '金额(万元)',
  192. dataIndex: 'commodityPrice',
  193. key: 'commodityPrice'
  194. }, {
  195. title: '负责人',
  196. dataIndex: 'contacts',
  197. key: 'contacts'
  198. }, {
  199. title: '负责人电话',
  200. dataIndex: 'contactsMobile',
  201. key: 'contactsMobile'
  202. }, {
  203. title: '主要项目',
  204. dataIndex: 'main',
  205. key: 'main',
  206. render:(text)=>{
  207. return (text?'是':'否')
  208. }
  209. }, {
  210. title: '项目说明',
  211. dataIndex: 'taskComment',
  212. key: 'taskComment',
  213. render:(text)=>{
  214. return (text&&text.length>8?text.substr(0,8)+'…':text)
  215. }
  216. }, {
  217. title: '操作',
  218. dataIndex: 'ABC',
  219. key: 'ABC',
  220. render: (text, record, index) => {
  221. return <div>
  222. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.delectRow(record)}} okText="是" cancelText="否">
  223. <Button onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  224. </Popconfirm>:""}
  225. </div>
  226. }
  227. }
  228. ],
  229. contactList:[],
  230. loading:false,
  231. ContactsLists: [{
  232. title: '催款科目',
  233. dataIndex: 'dunSubject',
  234. key: 'dunSubject',
  235. render: (text, record, index) => {
  236. return <div>
  237. {this.state.processStatus==0?<Select placeholder="请选择催款科目" value={record.dunSubject} style={{width:'150px'}}
  238. onChange={(e) => { record.dunSubject = e; this.setState({ contactList: this.state.contactList }); }}>
  239. {
  240. jiedian.map(function (item) {
  241. return <Select.Option key={item.value} >{item.key}</Select.Option>
  242. })
  243. }
  244. </Select>:getjiedian(text)}
  245. </div>
  246. }
  247. },{
  248. title: '金额(万)',
  249. dataIndex: 'money',
  250. key: 'money',
  251. render: (text, record, index) => {
  252. return <div>
  253. {this.state.processStatus==0?<Input value={record.money} placeholder="请输入金额(必填项)" key={record.id} required="required"
  254. onChange={(e) => { record.money = e.target.value; this.setState({ contactList: this.state.contactList }); }} style={{width:'120px'}}/>:<span>{text}</span>}
  255. </div>
  256. }
  257. }, {
  258. title: '催款状态',
  259. dataIndex: 'dunStatus',
  260. key: 'dunStatus',
  261. render: (text, record, index) => {
  262. return text?'已完成':'催款中'
  263. }
  264. },
  265. {
  266. title: '操作',
  267. dataIndex: 'dels',
  268. key: 'dels',
  269. render: (text, record, index) => {
  270. return <div>
  271. {this.state.processStatus==0?<Popconfirm title="是否删除?" onConfirm={(e)=>{this.confirmDelet(record.key)}} okText="删除" cancelText="不删除">
  272. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}}>删除</Button>
  273. </Popconfirm>
  274. :''}
  275. {record.id?'': <Button type="primary" onClick={this.contactSave}>保存</Button>}
  276. </div>
  277. }
  278. }
  279. ],
  280. };
  281. },
  282. //新建订单、编辑订单保存
  283. handleSubmit(e) {
  284. e.preventDefault();
  285. let theorgCodeUrl = [];
  286. if (this.state.orgCodeUrl.length) {
  287. let picArr = [];
  288. this.state.orgCodeUrl.map(function (item) {
  289. if ( item.response && item.response.data && item.response.data.length ){
  290. picArr.push(item.response.data);
  291. }
  292. });
  293. theorgCodeUrl = picArr.join(",");
  294. };
  295. if(this.props.userDetaile){
  296. if(!this.state.totalAmount){
  297. message.warning('签单金额不能为空');
  298. this.refs.signFirstPayment.focus()
  299. return false;
  300. };
  301. if(!this.state.firstAmount){
  302. message.warning('首付金额不能为空');
  303. this.refs.signFirstPayment.focus()
  304. return false;
  305. };
  306. if(!theorgCodeUrl){
  307. message.warning('企业负责人不能为空');
  308. this.refs.signFirstPayment.focus()
  309. return false;
  310. };
  311. if(!this.state.signDate){
  312. message.warning('签单日期不能为空');
  313. this.refs.signFirstPayment.focus()
  314. return false;
  315. };
  316. }else{
  317. if(this.state.orderType==undefined){
  318. message.warning('请选择订单类型');
  319. return false;
  320. };
  321. if(!this.state.autoId){
  322. message.warning('客户名称不匹配');
  323. return false;
  324. };
  325. }
  326. this.setState({
  327. loading: true
  328. });
  329. let api=this.props.userDetaile?'/api/admin/newOrder/updateServiceOrderNew':'/api/admin/newOrder/createOrder';
  330. $.ajax({
  331. method: "POST",
  332. dataType: "json",
  333. crossDomain: false,
  334. url: globalConfig.context + api,
  335. data: !this.props.userDetaile?{
  336. uid:this.state.autoId,
  337. orderType:this.state.orderType,
  338. contractType:this.state.contractType
  339. }:{
  340. orderNo: this.state.orderNo,//订单编号
  341. totalAmount: this.state.totalAmount,//总金额
  342. firstAmount: this.state.firstAmount,//首付
  343. isSubmit: this.state.isSubmit,//保存草稿还是提交
  344. signDate: this.state.signDate,//签单日期
  345. contacts: this.state.contacts,//企业负责人
  346. contactMobile: this.state.contactMobile,//负责人联系方式
  347. legalPerson: this.state.legalPerson,//企业法人
  348. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  349. approval: this.state.approval,//特批状态
  350. contractNo: this.state.contractNo,//合同编号
  351. orderRemarks: this.state.orderRemarks,//订单备注
  352. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  353. }
  354. }).done(function(data) {
  355. this.setState({
  356. loading: false
  357. });
  358. if(!data.error.length) {
  359. message.success('保存成功!');
  360. this.handleOk();
  361. if(this.state.autoId){
  362. this.loadData()
  363. };
  364. } else {
  365. message.warning(data.error[0].message);
  366. }
  367. }.bind(this));
  368. },
  369. //订单详情修改
  370. xiangqingClick(e) {
  371. e.preventDefault();
  372. this.setState({
  373. loading: true
  374. });
  375. $.ajax({
  376. url: globalConfig.context + '/api/admin/newOrder/updateServiceOrderNew',
  377. method: 'post',
  378. data: {
  379. orderNo: this.state.orderNo,//订单编号
  380. totalAmount: this.state.totalAmount,//总金额
  381. firstAmount: this.state.firstAmount,//首付
  382. isSubmit: this.state.isSubmit,//保存草稿还是提交
  383. signDate: this.state.selTime,//签单日期
  384. contacts: this.state.contacts,//企业负责人
  385. contactMobile: this.state.contactMobile,//负责人联系方式
  386. legalPerson: this.state.legalPerson,//企业法人
  387. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  388. approval: this.state.approval,//特批状态
  389. contractNo: this.state.contractNo,//合同编号
  390. orderRemarks: this.state.orderRemarks,//订单备注
  391. }
  392. }).done(function(data) {
  393. this.setState({
  394. loading: false
  395. });
  396. if(!data.error.length) {
  397. message.success('保存成功!');
  398. this.loaduser();
  399. } else {
  400. message.warning(data.error[0].message);
  401. }
  402. }.bind(this));
  403. },
  404. //查看基本详情基本信息
  405. loaduser(record){
  406. this.state.orderList=[]
  407. $.ajax({
  408. method: "get",
  409. dataType: "json",
  410. crossDomain: false,
  411. url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
  412. data: {
  413. orderNo:record?record.orderNo:this.props.datauser.orderNo
  414. },
  415. success: function (data) {
  416. let thisData = data.data;
  417. if (!thisData) {
  418. if (data.error && data.error.length) {
  419. message.warning(data.error[0].message);
  420. };
  421. thisData = {};
  422. };
  423. this.setState({
  424. id:thisData.id,
  425. kehuId:thisData.buyerId,
  426. orderNo:thisData.orderNo,//订单编号
  427. orderType:thisData.orderType,//订单类型
  428. firstAmount:thisData.firstAmount,//首付金额
  429. totalAmount:thisData.totalAmount,//总金额
  430. settlementAmount:thisData.settlementAmount,//结算金额
  431. liquidationStatus:thisData.liquidationStatus,//清算状态
  432. processStatus:thisData.processStatus,//流程状态
  433. approval:thisData.approval.toString(),//特批状态
  434. orderRemarks:thisData.orderRemarks,//订单备注
  435. contractNo:thisData.contractNo,//合同编号
  436. contacts:thisData.contacts,//联系人
  437. contactMobile:thisData.contactMobile,//联系人电话
  438. legalPerson:thisData.legalPerson,//法人
  439. legalPersonTel:thisData.legalPersonTel,//法人电话
  440. contractNo:thisData.contractNo,//合同编号
  441. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  442. signDate:thisData.signDate,//签单时间
  443. userName:thisData.userName,//客户名称
  444. salesmanName:thisData.salesmanName,//营销员名称
  445. salesmanMobile:thisData.salesmanMobile,//营销员电话
  446. financeName:thisData.financeName,//财务名称
  447. financeMobile:thisData.financeMobile,//财务电话
  448. contractNo:thisData.contractNo,//合同编号
  449. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  450. });
  451. }.bind(this),
  452. }).always(function () {
  453. this.setState({
  454. loading: false
  455. });
  456. }.bind(this));
  457. },
  458. //查看催款节点
  459. loaduserss(record){
  460. this.state.orderList=[]
  461. this.setState({
  462. orderNoss:record?record.orderNo:this.props.datauser.orderNo,
  463. })
  464. $.ajax({
  465. method: "get",
  466. dataType: "json",
  467. crossDomain: false,
  468. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  469. data: {
  470. orderNo:record?record.orderNo:this.props.datauser.orderNo
  471. },
  472. success: function (data) {
  473. let theArr=[];
  474. let thisData=[];
  475. if (!thisData) {
  476. if (data.error && data.error.length) {
  477. message.warning(data.error[0].message);
  478. };
  479. thisData = {};
  480. }else{
  481. for(let i = 0; i < data.data.length; i++) {
  482. thisData= data.data[i];
  483. theArr.push({
  484. key:i,
  485. dunSubject:thisData.dunSubject?thisData.dunSubject.toString():"",//催款科目
  486. id:thisData.id,//节点Id
  487. money:thisData.money,//催款金额
  488. dunStatus:thisData.dunStatus,//催款状态
  489. orderNo:record?record.orderNo:this.props.datauser.orderNo,
  490. })
  491. }
  492. this.setState({
  493. contactList:theArr
  494. })
  495. };
  496. }.bind(this),
  497. }).always(function () {
  498. this.setState({
  499. loading: false
  500. });
  501. }.bind(this));
  502. },
  503. //催款节点保存
  504. contactSave(e) {
  505. if(this.state.contactList){
  506. console.log(1);
  507. let cuiData=this.state.contactList;
  508. for(var a=0;a<cuiData.length;a++){
  509. console.log(cuiData[a]);
  510. if(cuiData[a].money==''){
  511. message.warning('催款金额不能为空');
  512. this.refs.signFirstPayment.focus()
  513. return false;
  514. }else if(!cuiData[a].dunSubject){
  515. message.warning('催款科目不能为空');
  516. this.refs.signFirstPayment.focus()
  517. return false;
  518. }
  519. }
  520. };
  521. this.setState({
  522. loading: true
  523. });
  524. $.ajax({
  525. url: globalConfig.context + '/api/admin/newOrder/createOrderDun',
  526. method: 'post',
  527. data: {
  528. orderNo: this.state.orderNoss,
  529. orderDun: JSON.stringify(this.state.contactList)
  530. }
  531. }).done(function(data) {
  532. this.setState({
  533. loading: false
  534. });
  535. if(!data.error.length) {
  536. message.success('保存成功!');
  537. this.loaduserss();
  538. } else {
  539. message.warning(data.error[0].message);
  540. }
  541. }.bind(this));
  542. },
  543. //点击新增催款节点
  544. addcontact(record) {
  545. this.state.contactList.push({
  546. key:this.state.contactList.length,
  547. money: '',
  548. dunSubject:undefined,
  549. orderNo: this.state.orderNoss,
  550. dunTarget:this.state.kehuId,
  551. });
  552. this.setState({
  553. contactList: this.state.contactList
  554. })
  555. },
  556. //删除收款节点
  557. confirmDelet(index) {
  558. this.state.contactList.splice(index,1);
  559. this.setState({
  560. contactList: this.state.contactList
  561. })
  562. this.contactSave();
  563. },
  564. handleOk(e) {
  565. this.setState({
  566. visible: false,
  567. });
  568. this.props.closeDesc(false, true);
  569. },
  570. handleCancel(e) {
  571. this.setState({
  572. visible: false,
  573. });
  574. this.props.closeDesc(false);
  575. },
  576. //点击签单
  577. handleCancels(e) {
  578. this.setState({
  579. isSubmit:1
  580. })
  581. },
  582. //点击签单
  583. handleCancelq(e) {
  584. this.setState({
  585. isSubmit:0
  586. })
  587. },
  588. //删除
  589. delectRow(record) {
  590. this.setState({
  591. loading: true
  592. });
  593. $.ajax({
  594. method: "post",
  595. dataType: "json",
  596. crossDomain: false,
  597. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  598. data: {
  599. id:record.id
  600. }
  601. }).done(function (data) {
  602. if (!data.error.length) {
  603. message.success('删除成功!');
  604. this.setState({
  605. loading: false,
  606. });
  607. //this.loaduser()
  608. this.loadData();
  609. } else {
  610. message.warning(data.error[0].message);
  611. };
  612. }.bind(this));
  613. },
  614. nextCancel() {
  615. this.setState({
  616. addnextVisible: false
  617. })
  618. },
  619. getOrgCodeUrl(e) {
  620. this.setState({ orgCodeUrl: e });
  621. },
  622. componentWillMount() {
  623. },
  624. //加载(自动补全)
  625. supervisor(e,state){ //客户名称与服务名称自动补全
  626. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  627. $.ajax({
  628. method: "get",
  629. dataType: "json",
  630. crossDomain: false,
  631. url: globalConfig.context + api,
  632. data:state?{
  633. name:e,
  634. type:this.state.customType
  635. }:{
  636. businessName:e
  637. },
  638. success: function (data) {
  639. let thedata=data.data;
  640. if (!thedata) {
  641. if (data.error && data.error.length) {
  642. message.warning(data.error[0].message);
  643. };
  644. thedata = {};
  645. };
  646. this.setState({
  647. states:state,
  648. customerArr:thedata,
  649. });
  650. }.bind(this),
  651. }).always(function () {
  652. this.setState({
  653. loading: false
  654. });
  655. }.bind(this));
  656. },
  657. //上级主管输入框失去焦点是判断客户是否存在
  658. selectAuto(value){
  659. let kid=[];
  660. let fwList=this.state.customerArr;
  661. fwList.map(function(item){
  662. if(value==item.bname){
  663. kid=item
  664. }
  665. })
  666. this.setState({
  667. commodityName:value,
  668. gid:kid.id,
  669. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  670. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  671. })
  672. },
  673. //客户
  674. selectAutoCUT(value){
  675. let autoIds;
  676. let fwList=this.state.customerArr;
  677. fwList.map(function(item){
  678. if(value==item.name){
  679. autoIds=item.id
  680. }
  681. })
  682. this.setState({
  683. customerName:value,
  684. autoId:autoIds
  685. })
  686. },
  687. //服务值改变时请求客户名称
  688. httpChange(e){
  689. this.state.gid='';
  690. if(e.length>=1){
  691. this.supervisor(e,false);
  692. }
  693. this.setState({
  694. commodityName:e
  695. })
  696. },
  697. //客户名称自动补全
  698. customerChange(e){
  699. this.state.autoId='';
  700. if(e.length>=2){
  701. this.supervisor(e,true);
  702. }
  703. this.setState({
  704. customerName:e
  705. })
  706. },
  707. //点击添加项目明细
  708. addDetailed(){
  709. this.setState({
  710. gid:'',
  711. customerArr:[],
  712. commodityName:'',
  713. commodityQuantity:'',
  714. commodityId:'',
  715. taskComment:'',
  716. main:undefined,
  717. commodityPrice:'',
  718. addState:1,
  719. addnextVisible: true
  720. })
  721. },
  722. //新建项目明细保存
  723. nextSubmit(e) {
  724. e.preventDefault();
  725. if(this.state.gid==undefined||!this.state.gid){
  726. message.warning('服务名称不匹配!');
  727. return false;
  728. };
  729. if(!this.state.commodityPrice){
  730. message.warning('请输入金额!');
  731. this.refs.commodityPrice.focus();
  732. return false;
  733. };
  734. if(!this.state.commodityQuantity){
  735. message.warning('请输入商品数量!');
  736. this.refs.commodityQuantity.focus();
  737. return false;
  738. };
  739. if(!this.state.main){
  740. message.warning('请选择是否为主要项目!');
  741. this.refs.commodityQuantity.focus();
  742. return false;
  743. };
  744. this.setState({
  745. loading: true
  746. });
  747. let api=this.state.addState?'/api/admin/newOrder/addOrderTask':'/api/bianji';
  748. $.ajax({
  749. method: "POST",
  750. dataType: "json",
  751. crossDomain: false,
  752. url: globalConfig.context +api ,
  753. data: {
  754. commodityId:this.state.gid,//商品ID
  755. orderNo:this.props.datauser.orderNo,//订单编号
  756. commodityName:this.state.commodityName,//商品名称
  757. commodityQuantity:this.state.commodityQuantity,//商品数量
  758. commodityPrice:this.state.commodityPrice,//签单总价
  759. taskComment:this.state.taskComment,//服务说明
  760. main:this.state.main,//是否为主要项目
  761. }
  762. }).done(function(data) {
  763. this.setState({
  764. loading: false
  765. });
  766. if(!data.error.length) {
  767. message.success('保存成功!');
  768. this.nextCancel()
  769. //this.loaduser(this.props.datauser);
  770. this.loadData();
  771. } else {
  772. message.warning(data.error[0].message);
  773. }
  774. }.bind(this));
  775. },
  776. //点击打卡项目详情
  777. tableRowClick(record, index) {
  778. console.log(record);
  779. this.setState({
  780. jid:record.id,//项目ID
  781. kid:record.commodityId,//商品ID
  782. commodityName:record.commodityName,//金额
  783. commodityPrice:record.commodityPrice,//金额
  784. commodityQuantity:record.commodityQuantity,//数量
  785. taskComment:record.taskComment,//备注
  786. main:record.main.toString(),//是否为主要
  787. addnextVisible:true,
  788. addState:0,
  789. });
  790. },
  791. //修改项目详情
  792. tabRowSave(e){
  793. e.preventDefault();
  794. if(!this.state.commodityPrice){
  795. message.warning('金额不能为空!');
  796. return false;
  797. };
  798. if(!this.state.commodityQuantity){
  799. message.warning('数量不能为空!');
  800. return false;
  801. };
  802. if(!this.state.main){
  803. message.warning('请选择是否为主要项目!');
  804. this.refs.commodityQuantity.focus();
  805. return false;
  806. };
  807. $.ajax({
  808. method: "POST",
  809. dataType: "json",
  810. crossDomain: false,
  811. url: globalConfig.context +'/api/admin/newOrder/updateOrderTask' ,
  812. data: {
  813. id:this.state.jid,//项目ID
  814. commodityId:this.state.kid,//商品ID
  815. orderNo:this.props.datauser.orderNo,//订单编号
  816. main:this.state.main,//是否为主要
  817. commodityPrice:this.state.commodityPrice,//金额
  818. commodityQuantity:this.state.commodityQuantity,//数量
  819. taskComment:this.state.taskComment//备注
  820. }
  821. }).done(function(data) {
  822. this.setState({
  823. loading: false
  824. });
  825. if(!data.error.length) {
  826. message.success('保存成功!');
  827. this.nextCancel()
  828. //this.loaduser(this.props.datauser);
  829. this.loadData();
  830. } else {
  831. message.warning(data.error[0].message);
  832. }
  833. }.bind(this));
  834. },
  835. //签单时间选择
  836. selTime(e,index){
  837. this.setState({
  838. entryTime:e,
  839. signDate:e,
  840. selTime:index
  841. })
  842. },
  843. //退单操作
  844. //点击退单
  845. tuikuan(){
  846. this.setState({
  847. lookVisible:true,
  848. contractUrl:[],
  849. applicationUrl:[],
  850. reason:''
  851. })
  852. },
  853. //关闭退单
  854. noCancel(){
  855. this.setState({
  856. lookVisible:false
  857. })
  858. },
  859. //点击确认退单
  860. tuidanOk(){
  861. let contractUrls = [];
  862. let applicationUrls = [];
  863. if (this.state.contractUrl.length) {
  864. let picArr = [];
  865. this.state.contractUrl.map(function (item) {
  866. if ( item.response && item.response.data && item.response.data.length ){
  867. picArr.push(item.response.data);
  868. }
  869. });
  870. contractUrls = picArr.join(",");
  871. };
  872. if (this.state.applicationUrl.length) {
  873. let picArr = [];
  874. this.state.applicationUrl.map(function (item) {
  875. if ( item.response && item.response.data && item.response.data.length ){
  876. picArr.push(item.response.data);
  877. }
  878. });
  879. applicationUrls = picArr.join(",");
  880. };
  881. $.ajax({
  882. method: "POST",
  883. dataType: "json",
  884. crossDomain: false,
  885. url: globalConfig.context +'/api/admin/newOrder/addOrderRefund' ,
  886. data: {
  887. orderNo:this.state.orderNo,//订单编号
  888. contractUrl:contractUrls.length?contractUrls:'',//终止合同
  889. applicationUrl:applicationUrls.length?applicationUrls:'',//退单申请表
  890. reason:this.state.reason,//退单原因
  891. }
  892. }).done(function(data) {
  893. this.setState({
  894. loading: false
  895. });
  896. if(!data.error.length) {
  897. message.success('退单成功!');
  898. this.noCancel();
  899. this.handleCancel();
  900. } else {
  901. message.warning(data.error[0].message);
  902. }
  903. }.bind(this));
  904. },
  905. //开单选择订单类型骚操作
  906. orderTypeFn(e){
  907. if(e==0){
  908. this.setState({
  909. bussStats:true,
  910. orderType:e
  911. })
  912. this.category();
  913. }else{
  914. this.setState({
  915. contractType:undefined,
  916. bussStats:false,
  917. orderType:e
  918. })
  919. }
  920. },
  921. //品类数据获取
  922. category(){
  923. $.ajax({
  924. method: "get",
  925. dataType: "json",
  926. crossDomain: false,
  927. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  928. data: {
  929. },
  930. success: function(data) {
  931. let thedata = data.data;
  932. let theArr=[];
  933. if(!thedata) {
  934. if(data.error && data.error.length) {
  935. message.warning(data.error[0].message);
  936. };
  937. thedata = {};
  938. }else{
  939. thedata.map(function(item,index){
  940. theArr.push({
  941. key:index,
  942. name:item.cname,
  943. id:item.id,
  944. })
  945. })
  946. }
  947. this.setState({
  948. contractType:undefined,
  949. categoryArr:theArr,
  950. })
  951. }.bind(this),
  952. });
  953. },
  954. componentWillReceiveProps(nextProps) { //props改变时触发
  955. this.state.visible = nextProps.showDesc;
  956. this.state.signBillVisible=nextProps.signBillVisible;
  957. if(this.state.signBillVisible){
  958. this.loaduser(nextProps.uid)
  959. };
  960. if(nextProps.userDetaile && nextProps.showDesc) {
  961. this.loaduser(nextProps.datauser);
  962. this.loaduserss(nextProps.datauser);
  963. this.loadData(nextProps.datauser);
  964. }else{
  965. this.setState({
  966. orderType:undefined,
  967. customerName:'',
  968. autoId:'',
  969. customerArr:[],
  970. contractType:undefined,
  971. bussStats:false,
  972. customType:undefined
  973. })
  974. }
  975. },
  976. render() {
  977. const FormItem = Form.Item
  978. const formItemLayout = {
  979. labelCol: { span: 8 },
  980. wrapperCol: { span: 14 },
  981. };
  982. const changeHtml=this.state.changeHtml ||[];
  983. const categoryList=this.state.categoryArr ||[];
  984. const orderDetaiel=this.state.orderList || [];
  985. const dataSources=this.state.customerArr || [];
  986. const options = this.state.states?dataSources.map((group,index) =>
  987. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  988. ):dataSources.map((group,index) =>
  989. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  990. )
  991. return(
  992. <div>
  993. <Modal maskClosable={false} visible={this.state.visible}
  994. onOk={this.handleOk} onCancel={this.handleCancel}
  995. width={!this.props.userDetaile?'600px':'900px'}
  996. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  997. footer=''
  998. className="admin-desc-content">
  999. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1000. <Spin spinning={this.state.loading}>
  1001. <div className="clearfix">
  1002. {!this.props.userDetaile?
  1003. <div className="clearfix">
  1004. <div className="clearfix">
  1005. <FormItem
  1006. {...formItemLayout}
  1007. label="订单类型" >
  1008. <Select placeholder="请选择订单类型"
  1009. style={{ width:'200px'}}
  1010. value={this.state.orderType}
  1011. onChange={(e)=>{this.setState({orderType:e})}}>
  1012. {
  1013. orderTypes.map(function (item) {
  1014. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1015. })
  1016. }
  1017. </Select>
  1018. <span className="mandatory">*</span>
  1019. </FormItem>
  1020. </div>
  1021. <FormItem
  1022. {...formItemLayout}
  1023. label="客户所属类型" >
  1024. <Select placeholder="请选择客户所属类型"
  1025. style={{ width:'200px'}}
  1026. value={this.state.customType}
  1027. onChange={(e)=>{this.setState({customType:e})}}>
  1028. {
  1029. customerType.map(function (item) {
  1030. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1031. })
  1032. }
  1033. </Select>
  1034. </FormItem>
  1035. <div className="clearfix">
  1036. <FormItem
  1037. {...formItemLayout}
  1038. label="客户名称" >
  1039. <AutoComplete
  1040. className="certain-category-search"
  1041. dropdownClassName="certain-category-search-dropdown"
  1042. dropdownMatchSelectWidth={false}
  1043. dropdownStyle={{ width: 200 }}
  1044. size="large"
  1045. style={{ width: '200px' }}
  1046. dataSource={options}
  1047. placeholder="输入名称"
  1048. value={this.state.customerName}
  1049. onChange={this.customerChange}
  1050. filterOption={true}
  1051. onSelect={this.selectAutoCUT}
  1052. >
  1053. <Input/>
  1054. </AutoComplete>
  1055. <span className="mandatory">*</span>
  1056. </FormItem>
  1057. </div>
  1058. <div className='addSave' style={{marginTop:'15px'}}>
  1059. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1060. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1061. </div>
  1062. </div>
  1063. :<div className="clearfix">
  1064. <FormItem className="half-item"
  1065. {...formItemLayout}
  1066. label="订单编号" >
  1067. <span>{this.state.orderNo}</span>
  1068. </FormItem>
  1069. <FormItem className="half-item"
  1070. {...formItemLayout}
  1071. label="合同编号" >
  1072. {this.state.processStatus==0?<Input placeholder="请输入合同编号" value={this.state.contractNo}
  1073. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />:<span>{this.state.contractNo}</span>}
  1074. </FormItem>
  1075. <FormItem className="half-item"
  1076. {...formItemLayout}
  1077. label="客户名称" >
  1078. <span>{this.state.userName}</span>
  1079. </FormItem>
  1080. <FormItem className="half-item"
  1081. {...formItemLayout}
  1082. label="流程状态" >
  1083. <span>{getProcessStatus(this.state.processStatus)}</span>
  1084. </FormItem>
  1085. <FormItem className="half-item"
  1086. {...formItemLayout}
  1087. label="结算状态" >
  1088. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1089. </FormItem>
  1090. <FormItem className="half-item"
  1091. {...formItemLayout}
  1092. label="已收款项" >
  1093. <span>{this.state.settlementAmount+'万元'}</span>
  1094. {this.state.settlementAmount?<Button type='primary' onClick={this.tuikuan} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>退单</Button>:''}
  1095. </FormItem>
  1096. {this.state.processStatus==0?
  1097. <div className='clearfix'>
  1098. <FormItem className="half-item"
  1099. {...formItemLayout}
  1100. label="企业联系人" >
  1101. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1102. </FormItem>
  1103. <FormItem className="half-item"
  1104. {...formItemLayout}
  1105. label="联系人电话" >
  1106. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1107. </FormItem>
  1108. <FormItem className="half-item"
  1109. {...formItemLayout}
  1110. label="企业法人" >
  1111. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1112. </FormItem>
  1113. <FormItem className="half-item"
  1114. {...formItemLayout}
  1115. label="法人电话" >
  1116. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1117. </FormItem>
  1118. <FormItem className="half-item"
  1119. {...formItemLayout}
  1120. label="签单金额(万元)" >
  1121. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1122. <span className="mandatory">*</span>
  1123. </FormItem>
  1124. <FormItem className="half-item"
  1125. {...formItemLayout}
  1126. label="首付金额(万元)" >
  1127. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1128. <span className="mandatory">*</span>
  1129. </FormItem>
  1130. <FormItem className="half-item"
  1131. {...formItemLayout}
  1132. label="特批立项" >
  1133. <Select placeholder="请选择客户所属类型"
  1134. style={{ width:'240px'}}
  1135. value={this.state.approval}
  1136. onChange={(e)=>{this.setState({approval:e})}}>
  1137. {
  1138. tepi.map(function (item) {
  1139. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1140. })
  1141. }
  1142. </Select>
  1143. </FormItem>
  1144. <FormItem className="half-item" {...formItemLayout} label="合同签订时间">
  1145. <DatePicker
  1146. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1147. showTime
  1148. format="YYYY-MM-DD"
  1149. onOk={(e)=>{}}
  1150. value={this.state.signDate ? moment(this.state.signDate) : null}
  1151. onChange={(data, dataString) => { this.setState({ signDate: dataString }); }} />
  1152. <span className="mandatory">*</span>
  1153. </FormItem>
  1154. </div>
  1155. :
  1156. <div className='clearfix'>
  1157. <FormItem className="half-item"
  1158. {...formItemLayout}
  1159. label="企业联系人" >
  1160. <span>{this.state.contacts}</span>
  1161. </FormItem>
  1162. <FormItem className="half-item"
  1163. {...formItemLayout}
  1164. label="联系人电话" >
  1165. <span>{this.state.contactMobile}</span>
  1166. </FormItem>
  1167. <FormItem className="half-item"
  1168. {...formItemLayout}
  1169. label="企业法人" >
  1170. <span>{this.state.legalPerson}</span>
  1171. </FormItem>
  1172. <FormItem className="half-item"
  1173. {...formItemLayout}
  1174. label="法人电话" >
  1175. <span>{this.state.legalPersonTel}</span>
  1176. </FormItem>
  1177. <FormItem className="half-item"
  1178. {...formItemLayout}
  1179. label="签单金额(万元)" >
  1180. <span>{this.state.totalAmount}</span>
  1181. </FormItem>
  1182. <FormItem className="half-item"
  1183. {...formItemLayout}
  1184. label="首付金额(万元)" >
  1185. <span>{this.state.firstAmount}</span>
  1186. </FormItem>
  1187. <FormItem className="half-item"
  1188. {...formItemLayout}
  1189. label="特批立项" >
  1190. <span>{getApprovedState(this.state.approval)}</span>
  1191. </FormItem>
  1192. <FormItem className="half-item"
  1193. {...formItemLayout}
  1194. label="合同签订时间" >
  1195. <span>{this.state.signDate}</span>
  1196. </FormItem>
  1197. </div>}
  1198. <div className='clearfix'>
  1199. {this.state.processStatus==0?
  1200. <FormItem
  1201. labelCol={{ span: 4 }}
  1202. wrapperCol={{ span: 18 }}
  1203. label={
  1204. <span>
  1205. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1206. </span>
  1207. }
  1208. >
  1209. <PicturesWall
  1210. fileList={this.getOrgCodeUrl}
  1211. pictureUrl={this.state.orgCodeUrl} />
  1212. <p>图片建议:要清晰。</p>
  1213. </FormItem>:
  1214. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 18 }} label="合同扫描件">
  1215. <Upload className="demandDetailShow-upload"
  1216. listType="picture-card"
  1217. fileList={this.state.orgCodeUrl}
  1218. onPreview={(file) => {
  1219. this.setState({
  1220. previewImage: file.url || file.thumbUrl,
  1221. previewVisible: true,
  1222. });
  1223. }} >
  1224. </Upload>
  1225. <Modal maskClosable={false} footer={null}
  1226. visible={this.state.previewVisible}
  1227. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1228. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1229. </Modal>
  1230. </FormItem>}
  1231. </div>
  1232. <div className='clearfix'>
  1233. {this.state.processStatus==0?
  1234. <FormItem
  1235. labelCol={{ span: 4 }}
  1236. wrapperCol={{ span: 16 }}
  1237. label="订单留言" >
  1238. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1239. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1240. </FormItem>:
  1241. <FormItem
  1242. labelCol={{ span: 4 }}
  1243. wrapperCol={{ span: 16 }}
  1244. label="订单留言" >
  1245. <span>{this.state.orderRemarks}</span>
  1246. </FormItem>}
  1247. </div>
  1248. <div className='clearfix'>
  1249. <FormItem className="half-item"
  1250. {...formItemLayout}
  1251. label="订单负责人" >
  1252. <span>{this.state.salesmanName}</span>
  1253. </FormItem>
  1254. <FormItem className="half-item"
  1255. {...formItemLayout}
  1256. label="订单负责人电话" >
  1257. <span>{this.state.salesmanMobile}</span>
  1258. </FormItem>
  1259. </div>
  1260. <div className='clearfix'>
  1261. <FormItem className="half-item"
  1262. {...formItemLayout}
  1263. label="财务负责人" >
  1264. <span>{this.state.financeName}</span>
  1265. </FormItem>
  1266. <FormItem className="half-item"
  1267. {...formItemLayout}
  1268. label="财务负责人电话" >
  1269. <span>{this.state.financeMobile}</span>
  1270. </FormItem>
  1271. </div>
  1272. <div>
  1273. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1274. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1275. </div>
  1276. <div className="clearfix">
  1277. <Spin spinning={this.state.loading}>
  1278. <Form layout="horizontal" id="demand-form" >
  1279. <Table
  1280. pagination={false}
  1281. columns={this.state.ContactsLists}
  1282. dataSource={this.state.contactList}
  1283. />
  1284. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1285. </Col>
  1286. </Form>
  1287. </Spin>
  1288. </div>
  1289. <div>
  1290. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1291. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1292. </div>
  1293. <div className="patent-table">
  1294. <Spin spinning={this.state.loading}>
  1295. <Table columns={this.state.columns}
  1296. dataSource={this.state.dataSource}
  1297. pagination={this.state.pagination}
  1298. onRowClick={this.tableRowClick}
  1299. />
  1300. </Spin>
  1301. </div>
  1302. {this.state.processStatus==0?
  1303. <div className='addSave' style={{marginTop:'15px'}}>
  1304. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1305. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1306. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1307. </div>:""}
  1308. </div>}
  1309. </div>
  1310. </Spin>
  1311. </Form >
  1312. </Modal>
  1313. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1314. onOk={this.nextCancel} onCancel={this.nextCancel}
  1315. width='800px'
  1316. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1317. footer=''
  1318. className="admin-desc-content">
  1319. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1320. <Spin spinning={this.state.loading}>
  1321. {this.state.addState?<div className="clearfix">
  1322. <FormItem className="half-item"
  1323. {...formItemLayout}
  1324. label="服务名称" >
  1325. <AutoComplete
  1326. className="certain-category-search"
  1327. dropdownClassName="certain-category-search-dropdown"
  1328. dropdownMatchSelectWidth={false}
  1329. dropdownStyle={{ width: 200 }}
  1330. style={{ width: '200px' }}
  1331. dataSource={options}
  1332. placeholder="输入服务名称"
  1333. value={this.state.commodityName}
  1334. onChange={this.httpChange}
  1335. filterOption={true}
  1336. onSelect={this.selectAuto}
  1337. >
  1338. <Input/>
  1339. </AutoComplete>
  1340. <span className="mandatory">*</span>
  1341. </FormItem>
  1342. <FormItem className="half-item"
  1343. {...formItemLayout}
  1344. label="服务数量" >
  1345. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1346. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1347. <span className="mandatory">*</span>
  1348. </FormItem>
  1349. <FormItem className="half-item"
  1350. {...formItemLayout}
  1351. label="实签价格(万元)" >
  1352. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1353. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1354. <span className="mandatory">*</span>
  1355. </FormItem>
  1356. <FormItem className="half-item"
  1357. {...formItemLayout}
  1358. label="主要业务" >
  1359. <Select placeholder="选择是否为主要业务"
  1360. style={{ width:'200px'}}
  1361. value={this.state.main}
  1362. onChange={(e)=>{this.setState({main:e})}}>
  1363. {
  1364. boutique.map(function (item) {
  1365. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1366. })
  1367. }
  1368. </Select>
  1369. <span className="mandatory">*</span>
  1370. </FormItem>
  1371. <div className='clearfix'>
  1372. <FormItem
  1373. labelCol={{ span: 4 }}
  1374. wrapperCol={{ span: 16 }}
  1375. label="服务说明" >
  1376. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1377. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1378. </FormItem>
  1379. </div>
  1380. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1381. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1382. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1383. </FormItem>
  1384. </div>:
  1385. <div className="clearfix">
  1386. {this.state.processStatus==0?
  1387. <div className='clearfix'>
  1388. <FormItem className="half-item"
  1389. {...formItemLayout}
  1390. label="项目名称" >
  1391. <span>{this.state.commodityName}</span>
  1392. </FormItem>
  1393. <FormItem className="half-item"
  1394. {...formItemLayout}
  1395. label="项目数量" >
  1396. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1397. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1398. <span className="mandatory">*</span>
  1399. </FormItem>
  1400. <FormItem className="half-item"
  1401. {...formItemLayout}
  1402. label="金额(万元)" >
  1403. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1404. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1405. <span className="mandatory">*</span>
  1406. </FormItem>
  1407. <FormItem className="half-item"
  1408. {...formItemLayout}
  1409. label="主要项目" >
  1410. <Select placeholder="选择是否为主要业务"
  1411. style={{ width:'200px'}}
  1412. value={this.state.main}
  1413. onChange={(e)=>{this.setState({main:e})}}>
  1414. {
  1415. boutique.map(function (item) {
  1416. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1417. })
  1418. }
  1419. </Select>
  1420. <span className="mandatory">*</span>
  1421. </FormItem>
  1422. <div className='clearfix'>
  1423. <FormItem
  1424. labelCol={{ span: 4 }}
  1425. wrapperCol={{ span: 16 }}
  1426. label="服务说明" >
  1427. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1428. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1429. </FormItem>
  1430. </div>
  1431. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1432. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1433. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1434. </FormItem>
  1435. </div>:<div className='clearfix'>
  1436. <FormItem className="half-item"
  1437. {...formItemLayout}
  1438. label="项目名称" >
  1439. <span>{this.state.commodityName}</span>
  1440. </FormItem>
  1441. <FormItem className="half-item"
  1442. {...formItemLayout}
  1443. label="项目数量" >
  1444. <span>{this.state.commodityQuantity}</span>
  1445. </FormItem>
  1446. <FormItem className="half-item"
  1447. {...formItemLayout}
  1448. label="金额(万元)" >
  1449. <span>{this.state.commodityPrice}</span>
  1450. </FormItem>
  1451. <FormItem className="half-item"
  1452. {...formItemLayout}
  1453. label="主要项目" >
  1454. <span>{getboutique(this.state.main)}</span>
  1455. </FormItem>
  1456. <div className='clearfix'>
  1457. <FormItem
  1458. labelCol={{ span: 4 }}
  1459. wrapperCol={{ span: 16 }}
  1460. label="服务说明" >
  1461. <span>{this.state.taskComment}</span>
  1462. </FormItem>
  1463. </div>
  1464. </div>
  1465. }
  1466. </div>
  1467. }
  1468. </Spin>
  1469. </Form >
  1470. </Modal>
  1471. <Modal maskClosable={false} visible={this.state.lookVisible}
  1472. onOk={this.noCancel} onCancel={this.noCancel}
  1473. width='800px'
  1474. title={'退单申请'}
  1475. footer=''
  1476. className="admin-desc-content">
  1477. <Form layout="horizontal" id="demand-form">
  1478. <Spin spinning={this.state.loading}>
  1479. <div className='clearfix'>
  1480. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="终止合同">
  1481. <Picture
  1482. fileList={(e)=>{this.setState({contractUrl:e})}}
  1483. pictureUrl={this.state.contractUrl}
  1484. visible={this.props.visible}
  1485. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1486. />
  1487. </FormItem>
  1488. </div>
  1489. <div className='clearfix'>
  1490. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="退单申请表">
  1491. <Picture
  1492. fileList={(e)=>{this.setState({applicationUrl:e})}}
  1493. pictureUrl={this.state.applicationUrl}
  1494. visible={this.props.visible}
  1495. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1496. />
  1497. </FormItem>
  1498. </div>
  1499. <div className='clearfix'>
  1500. <FormItem
  1501. labelCol={{ span: 4 }}
  1502. wrapperCol={{ span: 16 }}
  1503. label="退单理由" >
  1504. <Input type="textarea" placeholder="请输入退单理由" rows={4} value={this.state.reason}
  1505. onChange={(e)=>{this.setState({reason:e.target.value})}}/>
  1506. </FormItem>
  1507. </div>
  1508. <div className='clearfix'>
  1509. <Button className="cancel" type="primary" onClick={this.tuidanOk} style={{marginLeft:"50px"}} htmlType="submit">确定退单</Button>
  1510. <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
  1511. </div>
  1512. </Spin>
  1513. </Form >
  1514. </Modal>
  1515. </div>
  1516. )
  1517. }
  1518. }));
  1519. export default Form.create()(NewService);