addService.jsx 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481
  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.contacts){
  297. message.warning('企业负责人不能为空');
  298. this.refs.signFirstPayment.focus()
  299. return false;
  300. };
  301. if(!this.state.contactMobile){
  302. message.warning('企业负责人电话不能为空');
  303. this.refs.signFirstPayment.focus()
  304. return false;
  305. };
  306. if(!this.state.totalAmount){
  307. message.warning('签单金额不能为空');
  308. this.refs.signFirstPayment.focus()
  309. return false;
  310. };
  311. if(!this.state.firstAmount){
  312. message.warning('首付金额不能为空');
  313. this.refs.signFirstPayment.focus()
  314. return false;
  315. };
  316. if(!theorgCodeUrl){
  317. message.warning('企业负责人不能为空');
  318. this.refs.signFirstPayment.focus()
  319. return false;
  320. };
  321. if(!this.state.signDate){
  322. message.warning('签单日期不能为空');
  323. this.refs.signFirstPayment.focus()
  324. return false;
  325. };
  326. }else{
  327. if(this.state.orderType==undefined){
  328. message.warning('请选择订单类型');
  329. return false;
  330. };
  331. if(!this.state.autoId){
  332. message.warning('客户名称不匹配');
  333. return false;
  334. };
  335. }
  336. this.setState({
  337. loading: true
  338. });
  339. let api=this.props.userDetaile?'/api/admin/newOrder/updateServiceOrderNew':'/api/admin/newOrder/createOrder';
  340. $.ajax({
  341. method: "POST",
  342. dataType: "json",
  343. crossDomain: false,
  344. url: globalConfig.context + api,
  345. data: !this.props.userDetaile?{
  346. uid:this.state.autoId,
  347. orderType:this.state.orderType,
  348. contractType:this.state.contractType
  349. }:{
  350. orderNo: this.state.orderNo,//订单编号
  351. totalAmount: this.state.totalAmount,//总金额
  352. firstAmount: this.state.firstAmount,//首付
  353. isSubmit: this.state.isSubmit,//保存草稿还是提交
  354. signDate: this.state.signDate,//签单日期
  355. contacts: this.state.contacts,//企业负责人
  356. contactMobile: this.state.contactMobile,//负责人联系方式
  357. legalPerson: this.state.legalPerson,//企业法人
  358. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  359. approval: this.state.approval,//特批状态
  360. contractNo: this.state.contractNo,//合同编号
  361. orderRemarks: this.state.orderRemarks,//订单备注
  362. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  363. }
  364. }).done(function(data) {
  365. this.setState({
  366. loading: false
  367. });
  368. if(!data.error.length) {
  369. message.success('保存成功!');
  370. this.handleOk();
  371. if(this.state.autoId){
  372. this.loadData()
  373. };
  374. } else {
  375. message.warning(data.error[0].message);
  376. }
  377. }.bind(this));
  378. },
  379. //订单详情修改
  380. xiangqingClick(e) {
  381. e.preventDefault();
  382. this.setState({
  383. loading: true
  384. });
  385. $.ajax({
  386. url: globalConfig.context + '/api/admin/newOrder/updateServiceOrderNew',
  387. method: 'post',
  388. data: {
  389. orderNo: this.state.orderNo,//订单编号
  390. totalAmount: this.state.totalAmount,//总金额
  391. firstAmount: this.state.firstAmount,//首付
  392. isSubmit: this.state.isSubmit,//保存草稿还是提交
  393. signDate: this.state.selTime,//签单日期
  394. contacts: this.state.contacts,//企业负责人
  395. contactMobile: this.state.contactMobile,//负责人联系方式
  396. legalPerson: this.state.legalPerson,//企业法人
  397. legalPersonTel: this.state.legalPersonTel,//企业法人联系电话
  398. approval: this.state.approval,//特批状态
  399. contractNo: this.state.contractNo,//合同编号
  400. orderRemarks: this.state.orderRemarks,//订单备注
  401. }
  402. }).done(function(data) {
  403. this.setState({
  404. loading: false
  405. });
  406. if(!data.error.length) {
  407. message.success('保存成功!');
  408. this.loaduser();
  409. } else {
  410. message.warning(data.error[0].message);
  411. }
  412. }.bind(this));
  413. },
  414. //查看基本详情基本信息
  415. loaduser(record){
  416. this.state.orderList=[]
  417. $.ajax({
  418. method: "get",
  419. dataType: "json",
  420. crossDomain: false,
  421. url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
  422. data: {
  423. orderNo:record?record.orderNo:this.props.datauser.orderNo
  424. },
  425. success: function (data) {
  426. let thisData = data.data;
  427. if (!thisData) {
  428. if (data.error && data.error.length) {
  429. message.warning(data.error[0].message);
  430. };
  431. thisData = {};
  432. };
  433. this.setState({
  434. id:thisData.id,
  435. kehuId:thisData.buyerId,
  436. orderNo:thisData.orderNo,//订单编号
  437. orderType:thisData.orderType,//订单类型
  438. firstAmount:thisData.firstAmount,//首付金额
  439. totalAmount:thisData.totalAmount,//总金额
  440. settlementAmount:thisData.settlementAmount,//结算金额
  441. liquidationStatus:thisData.liquidationStatus,//清算状态
  442. processStatus:thisData.processStatus,//流程状态
  443. approval:thisData.approval.toString(),//特批状态
  444. orderRemarks:thisData.orderRemarks,//订单备注
  445. contractNo:thisData.contractNo,//合同编号
  446. contacts:thisData.contacts,//联系人
  447. contactMobile:thisData.contactMobile,//联系人电话
  448. legalPerson:thisData.legalPerson,//法人
  449. legalPersonTel:thisData.legalPersonTel,//法人电话
  450. contractNo:thisData.contractNo,//合同编号
  451. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  452. signDate:thisData.signDate,//签单时间
  453. userName:thisData.userName,//客户名称
  454. salesmanName:thisData.salesmanName,//营销员名称
  455. financeName:thisData.financeName,//财务名称
  456. contractNo:thisData.contractNo,//合同编号
  457. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  458. });
  459. }.bind(this),
  460. }).always(function () {
  461. this.setState({
  462. loading: false
  463. });
  464. }.bind(this));
  465. },
  466. //查看催款节点
  467. loaduserss(record){
  468. this.state.orderList=[]
  469. this.setState({
  470. orderNoss:record?record.orderNo:this.props.datauser.orderNo,
  471. })
  472. $.ajax({
  473. method: "get",
  474. dataType: "json",
  475. crossDomain: false,
  476. url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
  477. data: {
  478. orderNo:record?record.orderNo:this.props.datauser.orderNo
  479. },
  480. success: function (data) {
  481. let theArr=[];
  482. let thisData=[];
  483. if (!thisData) {
  484. if (data.error && data.error.length) {
  485. message.warning(data.error[0].message);
  486. };
  487. thisData = {};
  488. }else{
  489. for(let i = 0; i < data.data.length; i++) {
  490. thisData= data.data[i];
  491. theArr.push({
  492. key:i,
  493. dunSubject:thisData.dunSubject?thisData.dunSubject.toString():"",//催款科目
  494. id:thisData.id,//节点Id
  495. money:thisData.money,//催款金额
  496. dunStatus:thisData.dunStatus,//催款状态
  497. orderNo:record?record.orderNo:this.props.datauser.orderNo,
  498. })
  499. }
  500. this.setState({
  501. contactList:theArr
  502. })
  503. };
  504. }.bind(this),
  505. }).always(function () {
  506. this.setState({
  507. loading: false
  508. });
  509. }.bind(this));
  510. },
  511. //催款节点保存
  512. contactSave(e) {
  513. this.setState({
  514. loading: true
  515. });
  516. $.ajax({
  517. url: globalConfig.context + '/api/admin/newOrder/createOrderDun',
  518. method: 'post',
  519. data: {
  520. orderNo: this.state.orderNoss,
  521. orderDun: JSON.stringify(this.state.contactList)
  522. }
  523. }).done(function(data) {
  524. this.setState({
  525. loading: false
  526. });
  527. if(!data.error.length) {
  528. message.success('保存成功!');
  529. this.loaduserss();
  530. } else {
  531. message.warning(data.error[0].message);
  532. }
  533. }.bind(this));
  534. },
  535. //点击新增催款节点
  536. addcontact(record) {
  537. this.state.contactList.push({
  538. key:this.state.contactList.length,
  539. money: '',
  540. dunSubject:undefined,
  541. orderNo: this.state.orderNoss,
  542. dunTarget:this.state.kehuId,
  543. });
  544. this.setState({
  545. contactList: this.state.contactList
  546. })
  547. console.log(this.state.contactList);
  548. },
  549. //删除收款节点
  550. confirmDelet(index) {
  551. this.state.contactList.splice(index,1);
  552. this.setState({
  553. contactList: this.state.contactList
  554. })
  555. this.contactSave();
  556. },
  557. handleOk(e) {
  558. this.setState({
  559. visible: false,
  560. });
  561. this.props.closeDesc(false, true);
  562. },
  563. handleCancel(e) {
  564. this.setState({
  565. visible: false,
  566. });
  567. this.props.closeDesc(false);
  568. },
  569. //点击签单
  570. handleCancels(e) {
  571. this.setState({
  572. isSubmit:1
  573. })
  574. },
  575. //点击签单
  576. handleCancelq(e) {
  577. this.setState({
  578. isSubmit:0
  579. })
  580. },
  581. //删除
  582. delectRow(record) {
  583. this.setState({
  584. loading: true
  585. });
  586. $.ajax({
  587. method: "post",
  588. dataType: "json",
  589. crossDomain: false,
  590. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  591. data: {
  592. id:record.id
  593. }
  594. }).done(function (data) {
  595. if (!data.error.length) {
  596. message.success('删除成功!');
  597. this.setState({
  598. loading: false,
  599. });
  600. //this.loaduser()
  601. this.loadData();
  602. } else {
  603. message.warning(data.error[0].message);
  604. };
  605. }.bind(this));
  606. },
  607. nextCancel() {
  608. this.setState({
  609. addnextVisible: false
  610. })
  611. },
  612. getOrgCodeUrl(e) {
  613. this.setState({ orgCodeUrl: e });
  614. },
  615. componentWillMount() {
  616. },
  617. //加载(自动补全)
  618. supervisor(e,state){ //客户名称与服务名称自动补全
  619. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  620. $.ajax({
  621. method: "get",
  622. dataType: "json",
  623. crossDomain: false,
  624. url: globalConfig.context + api,
  625. data:state?{
  626. name:e,
  627. type:this.state.customType
  628. }:{
  629. businessName:e
  630. },
  631. success: function (data) {
  632. let thedata=data.data;
  633. if (!thedata) {
  634. if (data.error && data.error.length) {
  635. message.warning(data.error[0].message);
  636. };
  637. thedata = {};
  638. };
  639. this.setState({
  640. states:state,
  641. customerArr:thedata,
  642. });
  643. }.bind(this),
  644. }).always(function () {
  645. this.setState({
  646. loading: false
  647. });
  648. }.bind(this));
  649. },
  650. //上级主管输入框失去焦点是判断客户是否存在
  651. selectAuto(value){
  652. let kid=[];
  653. let fwList=this.state.customerArr;
  654. fwList.map(function(item){
  655. if(value==item.bname){
  656. kid=item
  657. }
  658. })
  659. this.setState({
  660. commodityName:value,
  661. gid:kid.id,
  662. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  663. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  664. })
  665. },
  666. //客户
  667. selectAutoCUT(value){
  668. let autoIds;
  669. let fwList=this.state.customerArr;
  670. fwList.map(function(item){
  671. if(value==item.name){
  672. autoIds=item.id
  673. }
  674. })
  675. this.setState({
  676. customerName:value,
  677. autoId:autoIds
  678. })
  679. },
  680. //服务值改变时请求客户名称
  681. httpChange(e){
  682. this.state.gid='';
  683. if(e.length>=1){
  684. this.supervisor(e,false);
  685. }
  686. this.setState({
  687. commodityName:e
  688. })
  689. },
  690. //客户名称自动补全
  691. customerChange(e){
  692. this.state.autoId='';
  693. if(e.length>=2){
  694. this.supervisor(e,true);
  695. }
  696. this.setState({
  697. customerName:e
  698. })
  699. },
  700. //点击添加项目明细
  701. addDetailed(){
  702. this.setState({
  703. gid:'',
  704. customerArr:[],
  705. commodityName:'',
  706. commodityQuantity:'',
  707. commodityId:'',
  708. taskComment:'',
  709. main:undefined,
  710. commodityPrice:'',
  711. addState:1,
  712. addnextVisible: true
  713. })
  714. },
  715. //新建项目明细保存
  716. nextSubmit(e) {
  717. e.preventDefault();
  718. if(this.state.gid==undefined||!this.state.gid){
  719. message.warning('服务名称不匹配!');
  720. return false;
  721. };
  722. if(!this.state.commodityPrice){
  723. message.warning('请输入金额!');
  724. this.refs.commodityPrice.focus();
  725. return false;
  726. };
  727. if(!this.state.commodityQuantity){
  728. message.warning('请输入商品数量!');
  729. this.refs.commodityQuantity.focus();
  730. return false;
  731. };
  732. if(!this.state.main){
  733. message.warning('请选择是否为主要项目!');
  734. this.refs.commodityQuantity.focus();
  735. return false;
  736. };
  737. this.setState({
  738. loading: true
  739. });
  740. let api=this.state.addState?'/api/admin/newOrder/addOrderTask':'/api/bianji';
  741. $.ajax({
  742. method: "POST",
  743. dataType: "json",
  744. crossDomain: false,
  745. url: globalConfig.context +api ,
  746. data: {
  747. commodityId:this.state.gid,//商品ID
  748. orderNo:this.props.datauser.orderNo,//订单编号
  749. commodityName:this.state.commodityName,//商品名称
  750. commodityQuantity:this.state.commodityQuantity,//商品数量
  751. commodityPrice:this.state.commodityPrice,//签单总价
  752. taskComment:this.state.taskComment,//服务说明
  753. main:this.state.main,//是否为主要项目
  754. }
  755. }).done(function(data) {
  756. this.setState({
  757. loading: false
  758. });
  759. if(!data.error.length) {
  760. message.success('保存成功!');
  761. this.nextCancel()
  762. //this.loaduser(this.props.datauser);
  763. this.loadData();
  764. } else {
  765. message.warning(data.error[0].message);
  766. }
  767. }.bind(this));
  768. },
  769. //点击打卡项目详情
  770. tableRowClick(record, index) {
  771. console.log(record);
  772. this.setState({
  773. jid:record.id,//项目ID
  774. kid:record.commodityId,//商品ID
  775. commodityName:record.commodityName,//金额
  776. commodityPrice:record.commodityPrice,//金额
  777. commodityQuantity:record.commodityQuantity,//数量
  778. taskComment:record.taskComment,//备注
  779. main:record.main.toString(),//是否为主要
  780. addnextVisible:true,
  781. addState:0,
  782. });
  783. },
  784. //修改项目详情
  785. tabRowSave(e){
  786. e.preventDefault();
  787. if(!this.state.commodityPrice){
  788. message.warning('金额不能为空!');
  789. return false;
  790. };
  791. if(!this.state.commodityQuantity){
  792. message.warning('数量不能为空!');
  793. return false;
  794. };
  795. if(!this.state.main){
  796. message.warning('请选择是否为主要项目!');
  797. this.refs.commodityQuantity.focus();
  798. return false;
  799. };
  800. $.ajax({
  801. method: "POST",
  802. dataType: "json",
  803. crossDomain: false,
  804. url: globalConfig.context +'/api/admin/newOrder/updateOrderTask' ,
  805. data: {
  806. id:this.state.jid,//项目ID
  807. commodityId:this.state.kid,//商品ID
  808. orderNo:this.props.datauser.orderNo,//订单编号
  809. main:this.state.main,//是否为主要
  810. commodityPrice:this.state.commodityPrice,//金额
  811. commodityQuantity:this.state.commodityQuantity,//数量
  812. taskComment:this.state.taskComment//备注
  813. }
  814. }).done(function(data) {
  815. this.setState({
  816. loading: false
  817. });
  818. if(!data.error.length) {
  819. message.success('保存成功!');
  820. this.nextCancel()
  821. this.loaduser(this.props.datauser);
  822. this.loadData();
  823. } else {
  824. message.warning(data.error[0].message);
  825. }
  826. }.bind(this));
  827. },
  828. //签单时间选择
  829. selTime(e,index){
  830. this.setState({
  831. entryTime:e,
  832. signDate:e,
  833. selTime:index
  834. })
  835. },
  836. //退单操作
  837. //点击退单
  838. tuikuan(){
  839. this.setState({
  840. lookVisible:true
  841. })
  842. },
  843. //关闭退单
  844. noCancel(){
  845. this.setState({
  846. lookVisible:false
  847. })
  848. },
  849. //点击确认退单
  850. tuidanOk(){
  851. let contractUrls = [];
  852. let applicationUrls = [];
  853. if (this.state.contractUrl.length) {
  854. let picArr = [];
  855. this.state.contractUrl.map(function (item) {
  856. if ( item.response && item.response.data && item.response.data.length ){
  857. picArr.push(item.response.data);
  858. }
  859. });
  860. contractUrls = picArr.join(",");
  861. };
  862. if (this.state.applicationUrl.length) {
  863. let picArr = [];
  864. this.state.applicationUrl.map(function (item) {
  865. if ( item.response && item.response.data && item.response.data.length ){
  866. picArr.push(item.response.data);
  867. }
  868. });
  869. applicationUrls = picArr.join(",");
  870. };
  871. $.ajax({
  872. method: "POST",
  873. dataType: "json",
  874. crossDomain: false,
  875. url: globalConfig.context +'/api/admin/newOrder/addOrderRefund' ,
  876. data: {
  877. orderNo:this.state.orderNo,//订单编号
  878. contractUrl:contractUrls.length?contractUrls:'',//终止合同
  879. applicationUrl:applicationUrls.length?applicationUrls:'',//退单申请表
  880. reason:this.state.reason,//退单原因
  881. }
  882. }).done(function(data) {
  883. this.setState({
  884. loading: false
  885. });
  886. if(!data.error.length) {
  887. message.success('退单成功!');
  888. this.noCancel();
  889. this.handleCancel();
  890. } else {
  891. message.warning(data.error[0].message);
  892. }
  893. }.bind(this));
  894. },
  895. //开单选择订单类型骚操作
  896. orderTypeFn(e){
  897. if(e==0){
  898. this.setState({
  899. bussStats:true,
  900. orderType:e
  901. })
  902. this.category();
  903. }else{
  904. this.setState({
  905. contractType:undefined,
  906. bussStats:false,
  907. orderType:e
  908. })
  909. }
  910. },
  911. //品类数据获取
  912. category(){
  913. $.ajax({
  914. method: "get",
  915. dataType: "json",
  916. crossDomain: false,
  917. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  918. data: {
  919. },
  920. success: function(data) {
  921. let thedata = data.data;
  922. let theArr=[];
  923. if(!thedata) {
  924. if(data.error && data.error.length) {
  925. message.warning(data.error[0].message);
  926. };
  927. thedata = {};
  928. }else{
  929. thedata.map(function(item,index){
  930. theArr.push({
  931. key:index,
  932. name:item.cname,
  933. id:item.id,
  934. })
  935. })
  936. }
  937. this.setState({
  938. contractType:undefined,
  939. categoryArr:theArr,
  940. })
  941. }.bind(this),
  942. });
  943. },
  944. componentWillReceiveProps(nextProps) { //props改变时触发
  945. this.state.visible = nextProps.showDesc;
  946. this.state.signBillVisible=nextProps.signBillVisible;
  947. if(this.state.signBillVisible){
  948. this.loaduser(nextProps.uid)
  949. };
  950. if(nextProps.userDetaile && nextProps.showDesc) {
  951. this.loaduser(nextProps.datauser);
  952. this.loaduserss(nextProps.datauser);
  953. this.loadData(nextProps.datauser);
  954. }else{
  955. this.setState({
  956. orderType:undefined,
  957. customerName:'',
  958. autoId:'',
  959. customerArr:[],
  960. contractType:undefined,
  961. bussStats:false,
  962. customType:undefined
  963. })
  964. }
  965. },
  966. render() {
  967. const FormItem = Form.Item
  968. const formItemLayout = {
  969. labelCol: { span: 8 },
  970. wrapperCol: { span: 14 },
  971. };
  972. const changeHtml=this.state.changeHtml ||[];
  973. const categoryList=this.state.categoryArr ||[];
  974. const orderDetaiel=this.state.orderList || [];
  975. const dataSources=this.state.customerArr || [];
  976. const options = this.state.states?dataSources.map((group,index) =>
  977. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  978. ):dataSources.map((group,index) =>
  979. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  980. )
  981. return(
  982. <div>
  983. <Modal maskClosable={false} visible={this.state.visible}
  984. onOk={this.handleOk} onCancel={this.handleCancel}
  985. width={!this.props.userDetaile?'600px':'900px'}
  986. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  987. footer=''
  988. className="admin-desc-content">
  989. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  990. <Spin spinning={this.state.loading}>
  991. <div className="clearfix">
  992. {!this.props.userDetaile?
  993. <div className="clearfix">
  994. <div className="clearfix">
  995. <FormItem
  996. {...formItemLayout}
  997. label="订单类型" >
  998. <Select placeholder="请选择订单类型"
  999. style={{ width:'200px'}}
  1000. value={this.state.orderType}
  1001. onChange={(e)=>{this.setState({orderType:e})}}>
  1002. {
  1003. orderTypes.map(function (item) {
  1004. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1005. })
  1006. }
  1007. </Select>
  1008. <span className="mandatory">*</span>
  1009. </FormItem>
  1010. </div>
  1011. <FormItem
  1012. {...formItemLayout}
  1013. label="客户所属类型" >
  1014. <Select placeholder="请选择客户所属类型"
  1015. style={{ width:'200px'}}
  1016. value={this.state.customType}
  1017. onChange={(e)=>{this.setState({customType:e})}}>
  1018. {
  1019. customerType.map(function (item) {
  1020. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1021. })
  1022. }
  1023. </Select>
  1024. </FormItem>
  1025. <div className="clearfix">
  1026. <FormItem
  1027. {...formItemLayout}
  1028. label="客户名称" >
  1029. <AutoComplete
  1030. className="certain-category-search"
  1031. dropdownClassName="certain-category-search-dropdown"
  1032. dropdownMatchSelectWidth={false}
  1033. dropdownStyle={{ width: 200 }}
  1034. size="large"
  1035. style={{ width: '200px' }}
  1036. dataSource={options}
  1037. placeholder="输入名称"
  1038. value={this.state.customerName}
  1039. onChange={this.customerChange}
  1040. filterOption={true}
  1041. onSelect={this.selectAutoCUT}
  1042. >
  1043. <Input/>
  1044. </AutoComplete>
  1045. <span className="mandatory">*</span>
  1046. </FormItem>
  1047. </div>
  1048. <div className='addSave' style={{marginTop:'15px'}}>
  1049. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1050. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1051. </div>
  1052. </div>
  1053. :<div className="clearfix">
  1054. <FormItem className="half-item"
  1055. {...formItemLayout}
  1056. label="订单编号" >
  1057. <span>{this.state.orderNo}</span>
  1058. </FormItem>
  1059. <FormItem className="half-item"
  1060. {...formItemLayout}
  1061. label="合同编号" >
  1062. {this.state.processStatus==0?<Input placeholder="请输入合同编号" value={this.state.contractNo}
  1063. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />:<span>{this.state.contractNo}</span>}
  1064. </FormItem>
  1065. <FormItem className="half-item"
  1066. {...formItemLayout}
  1067. label="客户名称" >
  1068. <span>{this.state.userName}</span>
  1069. </FormItem>
  1070. <FormItem className="half-item"
  1071. {...formItemLayout}
  1072. label="流程状态" >
  1073. <span>{getProcessStatus(this.state.processStatus)}</span>
  1074. </FormItem>
  1075. <FormItem className="half-item"
  1076. {...formItemLayout}
  1077. label="结算状态" >
  1078. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1079. </FormItem>
  1080. <FormItem className="half-item"
  1081. {...formItemLayout}
  1082. label="已收款项" >
  1083. <span>{this.state.settlementAmount+'万元'}</span>
  1084. {this.state.settlementAmount?<Button type='primary' onClick={this.tuikuan} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>退单</Button>:''}
  1085. </FormItem>
  1086. {this.state.processStatus==0?
  1087. <div className='clearfix'>
  1088. <FormItem className="half-item"
  1089. {...formItemLayout}
  1090. label="企业联系人" >
  1091. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1092. <span className="mandatory">*</span>
  1093. </FormItem>
  1094. <FormItem className="half-item"
  1095. {...formItemLayout}
  1096. label="联系人电话" >
  1097. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1098. <span className="mandatory">*</span>
  1099. </FormItem>
  1100. <FormItem className="half-item"
  1101. {...formItemLayout}
  1102. label="企业法人" >
  1103. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1104. </FormItem>
  1105. <FormItem className="half-item"
  1106. {...formItemLayout}
  1107. label="法人电话" >
  1108. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1109. </FormItem>
  1110. <FormItem className="half-item"
  1111. {...formItemLayout}
  1112. label="签单金额(万元)" >
  1113. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1114. <span className="mandatory">*</span>
  1115. </FormItem>
  1116. <FormItem className="half-item"
  1117. {...formItemLayout}
  1118. label="首付金额(万元)" >
  1119. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1120. <span className="mandatory">*</span>
  1121. </FormItem>
  1122. <FormItem className="half-item"
  1123. {...formItemLayout}
  1124. label="特批立项" >
  1125. <Select placeholder="请选择客户所属类型"
  1126. style={{ width:'240px'}}
  1127. value={this.state.approval}
  1128. onChange={(e)=>{this.setState({approval:e})}}>
  1129. {
  1130. tepi.map(function (item) {
  1131. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1132. })
  1133. }
  1134. </Select>
  1135. </FormItem>
  1136. <FormItem className="half-item" {...formItemLayout} label="合同签订时间">
  1137. <DatePicker
  1138. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1139. showTime
  1140. format="YYYY-MM-DD"
  1141. onOk={(e)=>{}}
  1142. value={this.state.signDate ? moment(this.state.signDate) : null}
  1143. onChange={(data, dataString) => { this.setState({ signDate: dataString }); }} />
  1144. <span className="mandatory">*</span>
  1145. </FormItem>
  1146. </div>
  1147. :
  1148. <div className='clearfix'>
  1149. <FormItem className="half-item"
  1150. {...formItemLayout}
  1151. label="企业联系人" >
  1152. <span>{this.state.contacts}</span>
  1153. </FormItem>
  1154. <FormItem className="half-item"
  1155. {...formItemLayout}
  1156. label="联系人电话" >
  1157. <span>{this.state.contactMobile}</span>
  1158. </FormItem>
  1159. <FormItem className="half-item"
  1160. {...formItemLayout}
  1161. label="企业法人" >
  1162. <span>{this.state.legalPerson}</span>
  1163. </FormItem>
  1164. <FormItem className="half-item"
  1165. {...formItemLayout}
  1166. label="法人电话" >
  1167. <span>{this.state.legalPersonTel}</span>
  1168. </FormItem>
  1169. <FormItem className="half-item"
  1170. {...formItemLayout}
  1171. label="签单金额(万元)" >
  1172. <span>{this.state.totalAmount}</span>
  1173. </FormItem>
  1174. <FormItem className="half-item"
  1175. {...formItemLayout}
  1176. label="首付金额(万元)" >
  1177. <span>{this.state.firstAmount}</span>
  1178. </FormItem>
  1179. <FormItem className="half-item"
  1180. {...formItemLayout}
  1181. label="特批立项" >
  1182. <span>{getApprovedState(this.state.approval)}</span>
  1183. </FormItem>
  1184. <FormItem className="half-item"
  1185. {...formItemLayout}
  1186. label="合同签订时间" >
  1187. <span>{this.state.signDate}</span>
  1188. </FormItem>
  1189. </div>}
  1190. <div className='clearfix'>
  1191. <FormItem
  1192. labelCol={{ span: 4 }}
  1193. wrapperCol={{ span: 18 }}
  1194. label={
  1195. <span>
  1196. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1197. </span>
  1198. }
  1199. >
  1200. <PicturesWall
  1201. fileList={this.getOrgCodeUrl}
  1202. pictureUrl={this.state.orgCodeUrl} />
  1203. <p>图片建议:要清晰。</p>
  1204. </FormItem>
  1205. </div>
  1206. <div className='clearfix'>
  1207. {this.state.processStatus==0?
  1208. <FormItem
  1209. labelCol={{ span: 4 }}
  1210. wrapperCol={{ span: 16 }}
  1211. label="订单留言" >
  1212. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1213. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1214. </FormItem>:
  1215. <FormItem
  1216. labelCol={{ span: 4 }}
  1217. wrapperCol={{ span: 16 }}
  1218. label="订单留言" >
  1219. <span>{this.state.orderRemarks}</span>
  1220. </FormItem>}
  1221. </div>
  1222. <div className='clearfix'>
  1223. <FormItem className="half-item"
  1224. {...formItemLayout}
  1225. label="订单负责人" >
  1226. <span>{this.state.salesmanName}</span>
  1227. </FormItem>
  1228. <FormItem className="half-item"
  1229. {...formItemLayout}
  1230. label="订单负责人电话" >
  1231. <span>{orderDetaiel.projectType}</span>
  1232. </FormItem>
  1233. </div>
  1234. <div className='clearfix'>
  1235. <FormItem className="half-item"
  1236. {...formItemLayout}
  1237. label="财务负责人" >
  1238. <span>{this.state.financeName}</span>
  1239. </FormItem>
  1240. <FormItem className="half-item"
  1241. {...formItemLayout}
  1242. label="财务负责人电话" >
  1243. <span>{orderDetaiel.projectType}</span>
  1244. </FormItem>
  1245. </div>
  1246. <div>
  1247. <span style={{marginLeft:'50px',fontSize:'20px'}}>催款节点</span>
  1248. {this.state.processStatus==0?<Button type='primary' onClick={this.addcontact} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加催款节点</Button>:""}
  1249. </div>
  1250. <div className="clearfix">
  1251. <Spin spinning={this.state.loading}>
  1252. <Form layout="horizontal" id="demand-form" >
  1253. <Table
  1254. pagination={false}
  1255. columns={this.state.ContactsLists}
  1256. dataSource={this.state.contactList}
  1257. />
  1258. <Col span={24} offset={9} style={{marginTop:'15px'}}>
  1259. </Col>
  1260. </Form>
  1261. </Spin>
  1262. </div>
  1263. <div>
  1264. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1265. {this.state.processStatus==0?<Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加项目明细</Button>:""}
  1266. </div>
  1267. <div className="patent-table">
  1268. <Spin spinning={this.state.loading}>
  1269. <Table columns={this.state.columns}
  1270. dataSource={this.state.dataSource}
  1271. pagination={this.state.pagination}
  1272. onRowClick={this.tableRowClick}
  1273. />
  1274. </Spin>
  1275. </div>
  1276. {this.state.processStatus==0?
  1277. <div className='addSave' style={{marginTop:'15px'}}>
  1278. <Button className="cancel" type="primary" onClick={this.handleCancels} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1279. <Button className="cancel" type="primary" onClick={this.handleCancelq} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1280. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1281. </div>:""}
  1282. </div>}
  1283. </div>
  1284. </Spin>
  1285. </Form >
  1286. </Modal>
  1287. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1288. onOk={this.nextCancel} onCancel={this.nextCancel}
  1289. width='800px'
  1290. title={this.state.addState?'添加项目任务':'项目任务详情'}
  1291. footer=''
  1292. className="admin-desc-content">
  1293. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1294. <Spin spinning={this.state.loading}>
  1295. {this.state.addState?<div className="clearfix">
  1296. <FormItem className="half-item"
  1297. {...formItemLayout}
  1298. label="服务名称" >
  1299. <AutoComplete
  1300. className="certain-category-search"
  1301. dropdownClassName="certain-category-search-dropdown"
  1302. dropdownMatchSelectWidth={false}
  1303. dropdownStyle={{ width: 200 }}
  1304. style={{ width: '200px' }}
  1305. dataSource={options}
  1306. placeholder="输入服务名称"
  1307. value={this.state.commodityName}
  1308. onChange={this.httpChange}
  1309. filterOption={true}
  1310. onSelect={this.selectAuto}
  1311. >
  1312. <Input/>
  1313. </AutoComplete>
  1314. <span className="mandatory">*</span>
  1315. </FormItem>
  1316. <FormItem className="half-item"
  1317. {...formItemLayout}
  1318. label="服务数量" >
  1319. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1320. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1321. <span className="mandatory">*</span>
  1322. </FormItem>
  1323. <FormItem className="half-item"
  1324. {...formItemLayout}
  1325. label="实签价格(万元)" >
  1326. <Input placeholder="请输入实签价格" value={this.state.commodityPrice} style={{width:'200px'}}
  1327. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} ref="commodityPrice"/>
  1328. <span className="mandatory">*</span>
  1329. </FormItem>
  1330. <FormItem className="half-item"
  1331. {...formItemLayout}
  1332. label="主要业务" >
  1333. <Select placeholder="选择是否为主要业务"
  1334. style={{ width:'200px'}}
  1335. value={this.state.main}
  1336. onChange={(e)=>{this.setState({main:e})}}>
  1337. {
  1338. boutique.map(function (item) {
  1339. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1340. })
  1341. }
  1342. </Select>
  1343. <span className="mandatory">*</span>
  1344. </FormItem>
  1345. <div className='clearfix'>
  1346. <FormItem
  1347. labelCol={{ span: 4 }}
  1348. wrapperCol={{ span: 16 }}
  1349. label="服务说明" >
  1350. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1351. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1352. </FormItem>
  1353. </div>
  1354. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1355. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1356. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1357. </FormItem>
  1358. </div>:
  1359. <div className='clearfix'>
  1360. <FormItem className="half-item"
  1361. {...formItemLayout}
  1362. label="项目名称" >
  1363. <span>{this.state.commodityName}</span>
  1364. </FormItem>
  1365. <FormItem className="half-item"
  1366. {...formItemLayout}
  1367. label="项目数量" >
  1368. <Input placeholder="请输入数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1369. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} />
  1370. <span className="mandatory">*</span>
  1371. </FormItem>
  1372. <FormItem className="half-item"
  1373. {...formItemLayout}
  1374. label="金额(万元)" >
  1375. <Input placeholder="请输入签单金额" value={this.state.commodityPrice} style={{width:'200px'}}
  1376. onChange={(e)=>{this.setState({commodityPrice:e.target.value})}} />
  1377. <span className="mandatory">*</span>
  1378. </FormItem>
  1379. <FormItem className="half-item"
  1380. {...formItemLayout}
  1381. label="主要项目" >
  1382. <Select placeholder="选择是否为主要业务"
  1383. style={{ width:'200px'}}
  1384. value={this.state.main}
  1385. onChange={(e)=>{this.setState({main:e})}}>
  1386. {
  1387. boutique.map(function (item) {
  1388. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1389. })
  1390. }
  1391. </Select>
  1392. <span className="mandatory">*</span>
  1393. </FormItem>
  1394. <div className='clearfix'>
  1395. <FormItem
  1396. labelCol={{ span: 4 }}
  1397. wrapperCol={{ span: 16 }}
  1398. label="服务说明" >
  1399. <Input type='textarea' placeholder="请输入服务说明" value={this.state.taskComment}
  1400. onChange={(e)=>{this.setState({taskComment:e.target.value})}} />
  1401. </FormItem>
  1402. </div>
  1403. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1404. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1405. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1406. </FormItem>
  1407. </div>}
  1408. </Spin>
  1409. </Form >
  1410. </Modal>
  1411. <Modal maskClosable={false} visible={this.state.lookVisible}
  1412. onOk={this.noCancel} onCancel={this.noCancel}
  1413. width='800px'
  1414. title={'项目任务详情'}
  1415. footer=''
  1416. className="admin-desc-content">
  1417. <Form layout="horizontal" id="demand-form">
  1418. <Spin spinning={this.state.loading}>
  1419. <div className='clearfix'>
  1420. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="终止合同">
  1421. <Picture
  1422. fileList={(e)=>{this.setState({contractUrl:e})}}
  1423. pictureUrl={this.state.contractUrl}
  1424. visible={this.props.visible}
  1425. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1426. />
  1427. </FormItem>
  1428. </div>
  1429. <div className='clearfix'>
  1430. <FormItem labelCol={{ span: 4 }} wrapperCol={{ span: 16 }} label="退单申请表">
  1431. <Picture
  1432. fileList={(e)=>{this.setState({applicationUrl:e})}}
  1433. pictureUrl={this.state.applicationUrl}
  1434. visible={this.props.visible}
  1435. data={{'sign':'order_refund_file',url:'/api/admin/newOrder/uploadRefundOrderFile',number:8}}
  1436. />
  1437. </FormItem>
  1438. </div>
  1439. <div className='clearfix'>
  1440. <FormItem
  1441. labelCol={{ span: 4 }}
  1442. wrapperCol={{ span: 16 }}
  1443. label="退单理由" >
  1444. <Input type="textarea" placeholder="请输入退单理由" rows={4} value={this.state.reason}
  1445. onChange={(e)=>{this.setState({reason:e.target.value})}}/>
  1446. </FormItem>
  1447. </div>
  1448. <div className='clearfix'>
  1449. <Button className="cancel" type="primary" onClick={this.tuidanOk} style={{marginLeft:"50px"}} htmlType="submit">确定退单</Button>
  1450. <Button className="cancel" type="ghost" onClick={this.noCancel} style={{marginLeft:"50px"}}>取消</Button>
  1451. </div>
  1452. </Spin>
  1453. </Form >
  1454. </Modal>
  1455. </div>
  1456. )
  1457. }
  1458. }));
  1459. export default Form.create()(NewService);