addService.jsx 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete,DatePicker,Radio} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import {orderTypes,customerType} from '../../../dataDic.js';
  7. import {splitUrl,getOrderType,getOrderStage,getProjectState,getOrderState,getTransactionProject,getChangeState,getPaymentState,getOrderChannel,getApprovedState,getLock,getPaymentMethod,getTransactionChannel,beforeUploadFile,getProcessStatus,getLiquidationStatus} from '../../../tools.js';
  8. const Option = AutoComplete.Option;
  9. //图片组件
  10. const PicturesWall = React.createClass({
  11. getInitialState() {
  12. return {
  13. previewVisible: false,
  14. previewImage: '',
  15. fileList: [],
  16. }
  17. },
  18. getDefaultProps(){
  19. return{
  20. changeClick:this.modifyChange
  21. }
  22. },
  23. handleCancel() {
  24. this.setState({ previewVisible: false })
  25. },
  26. handlePreview(file) {
  27. this.setState({
  28. previewImage: file.url || file.thumbUrl,
  29. previewVisible: true,
  30. });
  31. },
  32. handleChange(info) {
  33. let fileList = info.fileList;
  34. this.setState({ fileList });
  35. this.props.fileList(fileList);
  36. },
  37. componentWillReceiveProps(nextProps) {
  38. this.state.fileList = nextProps.pictureUrl;
  39. },
  40. render() {
  41. const { previewVisible, previewImage, fileList } = this.state;
  42. const uploadButton = (
  43. <div>
  44. <Icon type="plus" />
  45. <div className="ant-upload-text">点击上传</div>
  46. </div>
  47. );
  48. return (
  49. <div style={{display:"inline-block"}}>
  50. <Upload
  51. beforeUpload={beforeUploadFile}
  52. action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
  53. data={{ 'sign': '' }}
  54. listType="picture-card"
  55. fileList={fileList}
  56. onPreview={this.handlePreview}
  57. onChange={this.handleChange} >
  58. {fileList.length >= 18 ? null : uploadButton}
  59. </Upload>
  60. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  61. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  62. </Modal>
  63. </div>
  64. );
  65. }
  66. });
  67. const NewService = Form.create()(React.createClass({
  68. loadData(record) {
  69. this.state.data = [];
  70. this.setState({
  71. loading: true
  72. });
  73. $.ajax({
  74. method: "get",
  75. dataType: "json",
  76. crossDomain: false,
  77. url: globalConfig.context + '/api/admin/order/getOrderCommodity',
  78. data: {
  79. orderNo:record?record.orderNo:this.props.datauser.orderNo
  80. },
  81. success: function (data) {
  82. let theArr = [];
  83. if (!data.data) {
  84. if (data.error && data.error.length) {
  85. message.warning(data.error[0].message);
  86. };
  87. } else {
  88. for (let i = 0; i < data.data.length; i++) {
  89. let thisdata = data.data[i];
  90. theArr.push({
  91. key: i,
  92. id:thisdata.id,
  93. orderNo:thisdata.orderNo,
  94. commodityName:thisdata.commodityName,
  95. commodityType:thisdata.commodityType,
  96. commodityMode:thisdata.commodityMode,
  97. commodityQuantity:thisdata.commodityQuantity,
  98. commodityPrice:thisdata.commodityPrice,
  99. discountPrice:thisdata.discountPrice,
  100. commodityFirstPayment:thisdata.commodityFirstPayment,
  101. createTimes:thisdata.createTimes,
  102. discountFirstPayment:thisdata.discountFirstPayment,
  103. remarks:thisdata.remarks,
  104. commodityId:thisdata.commodityId,
  105. });
  106. };
  107. }
  108. this.setState({
  109. dataSource: theArr,
  110. pagination: false,
  111. });
  112. }.bind(this),
  113. }).always(function () {
  114. this.setState({
  115. loading: false
  116. });
  117. }.bind(this));
  118. },
  119. //收款节点
  120. loadDatas(record) {
  121. this.state.data = [];
  122. this.setState({
  123. loading: true
  124. });
  125. $.ajax({
  126. method: "get",
  127. dataType: "json",
  128. crossDomain: false,
  129. url: globalConfig.context + '/open/api/admin/newOrder/selectOrderDun',
  130. data: {
  131. orderNo:record?record.orderNo:this.props.datauser.orderNo
  132. },
  133. success: function (data) {
  134. let theArr = [];
  135. if (!data.data) {
  136. if (data.error && data.error.length) {
  137. message.warning(data.error[0].message);
  138. };
  139. } else {
  140. for (let i = 0; i < data.data.length; i++) {
  141. let thisdata = data.data[i];
  142. theArr.push({
  143. key: i,
  144. id:thisdata.id,
  145. });
  146. };
  147. }
  148. this.setState({
  149. dataSource: theArr,
  150. pagination: false,
  151. });
  152. }.bind(this),
  153. }).always(function () {
  154. this.setState({
  155. loading: false
  156. });
  157. }.bind(this));
  158. },
  159. getInitialState() {
  160. return {
  161. loading: false,
  162. visible: false,
  163. orgCodeUrl:[],
  164. customerArr:[],
  165. bussStats:false,
  166. checkedKeys: [],
  167. lookflowList:[],
  168. active:{
  169. applySign:false
  170. },
  171. editFw:[],
  172. lookState:false,
  173. signBillVisible:false,
  174. commod:'',
  175. columns: [
  176. {
  177. title: '业务项目名称',
  178. dataIndex: 'commodityName',
  179. key: 'commodityName'
  180. }, {
  181. title: '项目类别',
  182. dataIndex: 'commodityType',
  183. key: 'commodityType',
  184. render:(text)=>{
  185. return (getOrderType(text))
  186. }
  187. },{
  188. title: '项目数量',
  189. dataIndex: 'commodityQuantity',
  190. key: 'commodityQuantity'
  191. }, {
  192. title: '服务市价(万元)',
  193. dataIndex: 'commodityPrice',
  194. key: 'commodityPrice'
  195. }, {
  196. title: '实签价格(万元)',
  197. dataIndex: 'discountPrice',
  198. key: 'discountPrice'
  199. }, {
  200. title: '下单时间',
  201. dataIndex: 'createTimes',
  202. key: 'createTimes'
  203. }, {
  204. title: '项目说明',
  205. dataIndex: 'remarks',
  206. key: 'remarks',
  207. render:(text)=>{
  208. return (text&&text.length>8?text.substr(0,8)+'…':text)
  209. }
  210. }, {
  211. title: '操作',
  212. dataIndex: 'ABC',
  213. key: 'ABC',
  214. render: (text, record, index) => {
  215. return
  216. // <div style={{display:this.props.datauser.active.applySign||this.state.changeStatus==1?'block':'none'}}>
  217. <Popconfirm title="是否删除?" onConfirm={(e)=>{this.delectRow(record)}} okText="是" cancelText="否">
  218. <Button onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  219. </Popconfirm>
  220. // </div>
  221. }
  222. },
  223. ],
  224. flowList:[
  225. {
  226. title: '平台流水号',
  227. dataIndex: 'billNo',
  228. key: 'billNo',
  229. }, {
  230. title: '平台流水时间',
  231. dataIndex: 'createTime',
  232. key: 'createTime'
  233. }, {
  234. title: '流水金额(万元)',
  235. dataIndex: 'transactionAmount',
  236. key: 'transactionAmount'
  237. },{
  238. title: '付款人名称',
  239. dataIndex: 'payerName',
  240. key: 'payerName'
  241. }, {
  242. title: '收款人名称',
  243. dataIndex: 'payeeName',
  244. key: 'payeeName'
  245. },
  246. {
  247. title: '流水科目',
  248. dataIndex: 'transactionSubject',
  249. key: 'transactionSubject',
  250. render:(text)=>{return getTransactionProject(text) }
  251. }, {
  252. title: '流水渠道',
  253. dataIndex: 'transactionChannel',
  254. key: 'transactionChannel',
  255. render:(text)=>{return getTransactionChannel(text) }
  256. },{
  257. title: '财务流水号',
  258. dataIndex: 'financialPayNo',
  259. key: 'financialPayNo',
  260. }, {
  261. title: '财务流水时间',
  262. dataIndex: 'financialPayTime',
  263. key: 'financialPayTime',
  264. }, {
  265. title: '流水确认',
  266. dataIndex: 'confirmSign',
  267. key: 'confirmSign',
  268. render:(text)=>{return text?'已确认':'待确认' }
  269. },{
  270. title: '确认时间',
  271. dataIndex: 'confirmTime',
  272. key: 'confirmTime',
  273. }
  274. ]
  275. };
  276. },
  277. //新建订单、编辑订单保存
  278. handleSubmit(e) {
  279. e.preventDefault();
  280. let theorgCodeUrl = [];
  281. if (this.state.orgCodeUrl.length) {
  282. let picArr = [];
  283. this.state.orgCodeUrl.map(function (item) {
  284. if ( item.response && item.response.data && item.response.data.length ){
  285. picArr.push(item.response.data);
  286. }
  287. });
  288. theorgCodeUrl = picArr.join(",");
  289. };
  290. if(this.props.userDetaile){
  291. if(!this.state.signTotalAmount){
  292. message.warning('请输入实签订单金额!');
  293. this.refs.signFirstPayment.focus()
  294. return false;
  295. };
  296. if(!this.state.signFirstPayment){
  297. message.warning('实签首款金额不能为空');
  298. this.refs.signFirstPayment.focus()
  299. return false;
  300. };
  301. }else{
  302. if(this.state.orderType==undefined){
  303. message.warning('请选择订单类型');
  304. return false;
  305. };
  306. if(!this.state.autoId){
  307. message.warning('客户名称不匹配');
  308. return false;
  309. };
  310. }
  311. this.props.form.validateFields((err, values) => {
  312. if(!err) {
  313. this.setState({
  314. loading: true
  315. });
  316. let api=this.props.userDetaile?'/api/admin/order/updateServiceOrder':'/open/api/admin/newOrder/createOrder';
  317. $.ajax({
  318. method: "POST",
  319. dataType: "json",
  320. crossDomain: false,
  321. url: globalConfig.context + api,
  322. data: !this.props.userDetaile?{
  323. uid:this.state.autoId,
  324. orderType:this.state.orderType,
  325. contractType:this.state.contractType
  326. }:{
  327. orderNo:this.props.datauser.orderNo,
  328. signTotalAmount:this.state.signTotalAmount,
  329. signFirstPayment:this.state.signFirstPayment,
  330. orderRemarks:this.state.orderRemarks,
  331. contractNo:this.state.contractNo,
  332. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  333. }
  334. }).done(function(data) {
  335. this.setState({
  336. loading: false
  337. });
  338. if(!data.error.length) {
  339. message.success('保存成功!');
  340. this.handleOk()
  341. } else {
  342. message.warning(data.error[0].message);
  343. }
  344. }.bind(this));
  345. }
  346. });
  347. },
  348. //查看基本详情基本信息
  349. loaduser(record){
  350. this.state.orderList=[]
  351. $.ajax({
  352. method: "get",
  353. dataType: "json",
  354. crossDomain: false,
  355. url: globalConfig.context + '/open/api/admin/newOrder/getOrderNewDetail',
  356. data: {
  357. orderNo:record?record.orderNo:this.props.datauser.orderNo
  358. },
  359. success: function (data) {
  360. let thisData = data.data;
  361. if (!thisData) {
  362. if (data.error && data.error.length) {
  363. message.warning(data.error[0].message);
  364. };
  365. thisData = {};
  366. };
  367. this.setState({
  368. id:thisData.id,
  369. orderNo:thisData.orderNo,//订单编号
  370. orderType:thisData.orderType,//订单类型
  371. firstAmount:thisData.firstAmount,//总金额
  372. totalAmount:thisData.totalAmount,//首付金额
  373. settlementAmount:thisData.settlementAmount,//结算金额
  374. liquidationStatus:thisData.liquidationStatus,//清算状态
  375. processStatus:thisData.processStatus,//流程状态
  376. approval:thisData.approval,//特批状态
  377. orderRemarks:thisData.orderRemarks,//订单备注
  378. contractNo:thisData.contractNo,//合同编号
  379. contacts:thisData.contacts,//联系人
  380. contactMobile:thisData.contactMobile,//联系人电话
  381. legalPerson:thisData.legalPerson,//法人
  382. legalPersonTel:thisData.legalPersonTel,//法人电话
  383. contractNo:thisData.contractNo,//合同编号
  384. orgCodeUrl: thisData.contractPictureUrl ? splitUrl(thisData.contractPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],//图片地址
  385. signDate:thisData.signDate,//签单时间
  386. userName:thisData.userName,//客户名称
  387. salesmanName:thisData.salesmanName,//营销员名称
  388. financeName:thisData.financeName,//财务名称
  389. contractNo:thisData.contractNo,//合同编号
  390. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  391. });
  392. }.bind(this),
  393. }).always(function () {
  394. this.setState({
  395. loading: false
  396. });
  397. }.bind(this));
  398. },
  399. handleOk(e) {
  400. this.setState({
  401. visible: false,
  402. });
  403. this.props.closeDesc(false, true);
  404. },
  405. handleCancel(e) {
  406. this.setState({
  407. visible: false,
  408. });
  409. this.props.closeDesc(false);
  410. },
  411. //删除
  412. delectRow(record) {
  413. this.setState({
  414. loading: true
  415. });
  416. $.ajax({
  417. method: "get",
  418. dataType: "json",
  419. crossDomain: false,
  420. url: globalConfig.context + "/api/admin/order/deleteOrderCommodity",
  421. data: {
  422. detailId:record.id
  423. }
  424. }).done(function (data) {
  425. if (!data.error.length) {
  426. message.success('删除成功!');
  427. this.setState({
  428. loading: false,
  429. });
  430. this.loaduser()
  431. this.loadData();
  432. } else {
  433. message.warning(data.error[0].message);
  434. };
  435. }.bind(this));
  436. },
  437. //添加明细
  438. addDetailed(){
  439. this.setState({
  440. gid:'',
  441. customerArr:[],
  442. commodityName:'',
  443. commodityId:'',
  444. commodityMode:'',
  445. commodityQuantity:'',
  446. commodityPrice:'',
  447. discountPrice:'',
  448. commodityFirstPayment:'',
  449. discountFirstPayment:'',
  450. remarks:'',
  451. addState:1,
  452. addnextVisible: true
  453. })
  454. },
  455. nextCancel() {
  456. this.setState({
  457. addnextVisible: false
  458. })
  459. },
  460. tableRowClick(record, index) {
  461. this.setState({
  462. active:this.props.datauser.active,
  463. editFw:record,
  464. jid:record.id,
  465. discountFirstPayment:record.discountFirstPayment,
  466. discountPrice:record.discountPrice,
  467. addnextVisible:true,
  468. addState:0,
  469. });
  470. },
  471. getOrgCodeUrl(e) {
  472. this.setState({ orgCodeUrl: e });
  473. },
  474. componentWillMount() {
  475. },
  476. //查看订单详情里面的各种骚操作
  477. //受理订单
  478. admissibleOrderOK(){
  479. let idArr=this.props.datauser;
  480. this.props.admissibleOrder(idArr,true)
  481. },
  482. //拒绝受理
  483. admissibleOrderCancel(){
  484. let idArr=this.props.datauser;
  485. this.props.admissibleOrder(idArr,false)
  486. },
  487. //取消订单
  488. cancelOrder(){
  489. let idArr=this.props.datauser;
  490. this.props.operation(idArr,3)
  491. },
  492. //作废订单
  493. scrapOrder(){
  494. let idArr=this.props.datauser;
  495. this.props.operation(idArr,2)
  496. },
  497. //锁定订单
  498. lockOrder(){
  499. let idArr=this.props.datauser;
  500. this.props.operation(idArr,0)
  501. },
  502. //解锁订单
  503. unlockOrder(){
  504. let idArr=this.props.datauser;
  505. this.props.operation(idArr,1)
  506. },
  507. //签单
  508. signBitt(){
  509. this.setState({
  510. contractNo:this.state.contractNo,
  511. signVisible:true,
  512. entryTime:undefined,
  513. selTime:undefined
  514. })
  515. },
  516. signBittOk(){
  517. this.setState({
  518. signVisible:false
  519. })
  520. },
  521. signBillOk(){
  522. this.setState({
  523. signBillVisible:false
  524. })
  525. },
  526. signBillCancel(e) {
  527. this.setState({
  528. signVisible:false,
  529. signBillVisible: false,
  530. });
  531. this.props.closeDesc(false, true);
  532. },
  533. //加载(自动补全)
  534. supervisor(e,state){ //客户名称与服务名称自动补全
  535. let api=state?'/api/admin/customer/getCustomerByName':'/api/admin/order/getBusinessProjectByName';
  536. $.ajax({
  537. method: "get",
  538. dataType: "json",
  539. crossDomain: false,
  540. url: globalConfig.context + api,
  541. data:state?{
  542. name:e,
  543. type:this.state.customType
  544. }:{
  545. businessName:e
  546. },
  547. success: function (data) {
  548. let thedata=data.data;
  549. if (!thedata) {
  550. if (data.error && data.error.length) {
  551. message.warning(data.error[0].message);
  552. };
  553. thedata = {};
  554. };
  555. this.setState({
  556. states:state,
  557. customerArr:thedata,
  558. });
  559. }.bind(this),
  560. }).always(function () {
  561. this.setState({
  562. loading: false
  563. });
  564. }.bind(this));
  565. },
  566. //上级主管输入框失去焦点是判断客户是否存在
  567. selectAuto(value){
  568. let kid=[];
  569. let fwList=this.state.customerArr;
  570. fwList.map(function(item){
  571. if(value==item.bname){
  572. kid=item
  573. }
  574. })
  575. this.setState({
  576. commodityName:value,
  577. gid:kid.id,
  578. commodityPrice:kid.price==0?kid.price.toString():kid.price,
  579. commodityFirstPayment:kid.firstPayment==0?kid.firstPayment.toString():kid.firstPayment
  580. })
  581. },
  582. //客户
  583. selectAutoCUT(value){
  584. let autoIds;
  585. let fwList=this.state.customerArr;
  586. fwList.map(function(item){
  587. if(value==item.name){
  588. autoIds=item.id
  589. }
  590. })
  591. this.setState({
  592. customerName:value,
  593. autoId:autoIds
  594. })
  595. },
  596. //服务值改变时请求客户名称
  597. httpChange(e){
  598. this.state.gid='';
  599. if(e.length>=1){
  600. this.supervisor(e,false);
  601. }
  602. this.setState({
  603. commodityName:e
  604. })
  605. },
  606. //客户名称自动补全
  607. customerChange(e){
  608. this.state.autoId='';
  609. if(e.length>=2){
  610. this.supervisor(e,true);
  611. }
  612. this.setState({
  613. customerName:e
  614. })
  615. },
  616. //新建明细保存
  617. nextSubmit(e) {
  618. e.preventDefault();
  619. if(this.state.gid==undefined||!this.state.gid){
  620. message.warning('服务名称不匹配!');
  621. return false;
  622. };
  623. if(!this.state.commodityPrice){
  624. message.warning('请输入市场价格!');
  625. this.refs.commodityPrice.focus();
  626. return false;
  627. };
  628. if(!this.state.discountPrice){
  629. message.warning('请输入实签价格!');
  630. this.refs.discountPrice.focus();
  631. return false;
  632. };
  633. if(!this.state.commodityQuantity){
  634. message.warning('请输入商品数量!');
  635. this.refs.commodityQuantity.focus();
  636. return false;
  637. };
  638. if(!this.state.commodityFirstPayment){
  639. message.warning('请输入市场首付金额!');
  640. this.refs.commodityFirstPayment.focus();
  641. return false;
  642. };
  643. if(!this.state.discountFirstPayment){
  644. message.warning('请输入签单首付金额!');
  645. this.refs.discountFirstPayment.focus();
  646. return false;
  647. };
  648. this.setState({
  649. loading: true
  650. });
  651. let api=this.state.addState?'/api/admin/order/addOrderCommodity':'/api/bianji';
  652. $.ajax({
  653. method: "POST",
  654. dataType: "json",
  655. crossDomain: false,
  656. url: globalConfig.context +api ,
  657. data: {
  658. commodityId:this.state.gid,
  659. orderNo:this.props.datauser.orderNo,
  660. commodityName:this.state.commodityName,//商品名称
  661. commodityMode:this.state.commodityMode,//商品规格
  662. commodityQuantity:this.state.commodityQuantity,//商品数量
  663. commodityType:0,//商品类型
  664. commodityPrice:this.state.commodityPrice,//市场总价
  665. discountPrice:this.state.discountPrice,//签单总价
  666. commodityFirstPayment:this.state.commodityFirstPayment,//市场首付金额
  667. discountFirstPayment:this.state.discountFirstPayment,//签单首付金额
  668. remarks:this.state.remarks,//服务说明
  669. }
  670. }).done(function(data) {
  671. this.setState({
  672. loading: false
  673. });
  674. if(!data.error.length) {
  675. message.success('保存成功!');
  676. this.nextCancel()
  677. this.loaduser(this.props.datauser);
  678. this.loadData();
  679. } else {
  680. message.warning(data.error[0].message);
  681. }
  682. }.bind(this));
  683. },
  684. tabRowSave(e){
  685. e.preventDefault();
  686. if(!this.state.discountPrice){
  687. message.warning('实签价格不能为空!');
  688. return false;
  689. };
  690. if(!this.state.discountFirstPayment){
  691. message.warning('签单首付金额不能为空!');
  692. return false;
  693. };
  694. $.ajax({
  695. method: "POST",
  696. dataType: "json",
  697. crossDomain: false,
  698. url: globalConfig.context +'/api/admin/order/updateOrderCommodity' ,
  699. data: {
  700. detailId:this.state.jid,
  701. orderNo:this.props.datauser.orderNo,
  702. discountPrice:this.state.discountPrice,//签单总价
  703. discountFirstPayment:this.state.discountFirstPayment,//签单首付金额
  704. commodityQuantity:this.state.editFw.commodityQuantity,
  705. remarks:this.state.editFw.remarks
  706. }
  707. }).done(function(data) {
  708. this.setState({
  709. loading: false
  710. });
  711. if(!data.error.length) {
  712. message.success('保存成功!');
  713. this.nextCancel()
  714. this.loaduser(this.props.datauser);
  715. this.loadData();
  716. } else {
  717. message.warning(data.error[0].message);
  718. }
  719. }.bind(this));
  720. },
  721. //签单保存
  722. signOk(e){
  723. e.preventDefault();
  724. this.temporarySave(false)
  725. },
  726. //暂存信息
  727. temporary(){
  728. this.temporarySave(true)
  729. },
  730. //签单时间选择
  731. selTime(e,index){
  732. this.setState({
  733. entryTime:e,
  734. selTime:index
  735. })
  736. },
  737. signSub(e){
  738. e.preventDefault();
  739. if(!this.state.selTime){
  740. message.warning("请选择签单时间!");
  741. return false;
  742. };
  743. let theorgCodeUrl = [];
  744. if (this.state.orgCodeUrl.length) {
  745. let picArr = [];
  746. this.state.orgCodeUrl.map(function (item) {
  747. if ( item.response && item.response.data && item.response.data.length ){
  748. picArr.push(item.response.data);
  749. }
  750. });
  751. theorgCodeUrl = picArr.join(",");
  752. };
  753. this.setState({
  754. loading: true
  755. });
  756. let dataList=this.state.dataSource,
  757. idsList=[];
  758. dataList.map((item,index) => {
  759. console.log(item);
  760. console.log(this.state.commodityId);
  761. idsList.push({
  762. businessId:'',
  763. businessProjectId:item.commodityId,
  764. customerStatus:"1",
  765. followSituation:"5",
  766. remarks:"签单-自动触发"
  767. })
  768. })
  769. $.ajax({
  770. method: "POST",
  771. dataType: "json",
  772. crossDomain: false,
  773. url: globalConfig.context +'/api/admin/order/signServiceOrder' ,
  774. data: {
  775. userBusinessList: JSON.stringify(idsList),
  776. uid:this.state.buyerId,
  777. orderNo:this.props.datauser.orderNo,
  778. signTotalAmount:this.state.signTotalAmount,
  779. signFirstPayment:this.state.signFirstPayment,
  780. approval:this.state.approval,
  781. orderRemarks:this.state.orderRemarks,
  782. contractNo:this.state.contractNo,
  783. signTime:this.state.selTime,
  784. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  785. }
  786. }).done(function(data) {
  787. this.setState({
  788. loading: false
  789. });
  790. if(!data.error.length) {
  791. message.success('操作成功!');
  792. this.signBillCancel()
  793. } else {
  794. message.warning(data.error[0].message);
  795. }
  796. }.bind(this));
  797. },
  798. //签单保存与暂存函数
  799. temporarySave(e){
  800. if(!this.state.signTotalAmount){
  801. message.warning('实签款项不能为空!')
  802. return false;
  803. };
  804. if(!this.state.signTotalAmount){
  805. message.warning('实签首款不能为空!')
  806. return false;
  807. };
  808. if(this.state.approval==undefined){
  809. message.warning('实签首款不能为空!')
  810. return false;
  811. };
  812. if(!this.state.contractNo){
  813. message.warning("请输入合同编号!");
  814. return false;
  815. }
  816. this.setState({
  817. loading: true
  818. });
  819. let theorgCodeUrl = [];
  820. if (this.state.orgCodeUrl.length) {
  821. let picArr = [];
  822. this.state.orgCodeUrl.map(function (item) {
  823. if ( item.response && item.response.data && item.response.data.length ){
  824. picArr.push(item.response.data);
  825. }
  826. });
  827. theorgCodeUrl = picArr.join(",");
  828. };
  829. let api=e?'/api/admin/order/updateServiceOrder':'/api/admin/order/signServiceOrder';
  830. $.ajax({
  831. method: "POST",
  832. dataType: "json",
  833. crossDomain: false,
  834. url: globalConfig.context +api ,
  835. data: {
  836. orderNo:this.props.uid?this.props.uid.orderNo:this.props.datauser.orderNo,
  837. signTotalAmount:this.state.signTotalAmount,
  838. signFirstPayment:this.state.signFirstPayment,
  839. approval:this.state.approval,
  840. orderRemarks:this.state.orderRemarks,
  841. contractNo:this.state.contractNo,
  842. contractPictureUrl:theorgCodeUrl.length?theorgCodeUrl:'',
  843. }
  844. }).done(function(data) {
  845. this.setState({
  846. loading: false
  847. });
  848. if(!data.error.length) {
  849. message.success('操作成功!');
  850. this.signBillCancel()
  851. } else {
  852. message.warning(data.error[0].message);
  853. }
  854. }.bind(this));
  855. },
  856. lookflow(){
  857. this.setState({
  858. loading: true,
  859. lookVisible:true,
  860. })
  861. this.state.lookSource=[];
  862. $.ajax({
  863. method: "get",
  864. dataType: "json",
  865. crossDomain: false,
  866. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  867. data: {
  868. orderNo:this.props.datauser.orderNo,
  869. },
  870. success: function (data) {
  871. let theArr = [];
  872. if (!data.data) {
  873. if (data.error && data.error.length) {
  874. message.warning(data.error[0].message);
  875. };
  876. } else {
  877. for (let i = 0; i < data.data.length; i++) {
  878. let thisdata = data.data[i];
  879. theArr.push({
  880. key: i,
  881. billNo: thisdata.billNo,
  882. transactionAmount:thisdata.transactionAmount,
  883. createTime:thisdata.createTime,
  884. transactionAmount:thisdata.transactionAmount,
  885. payerName:thisdata.payerName,
  886. payeeName:thisdata.payeeName,
  887. transactionSubject:thisdata.transactionSubject,
  888. transactionChannel:thisdata.transactionChannel,
  889. financialPayNo:thisdata.financialPayNo,
  890. financialPayTime:thisdata.financialPayTime,
  891. orderNo:thisdata.orderNo,
  892. departmentName:thisdata.departmentName,
  893. salesmanName:thisdata.salesmanName,
  894. financeName:thisdata.financeName,
  895. confirmSign:thisdata.confirmSign,
  896. deleteSign:thisdata.deleteSign,
  897. confirmTime:thisdata.confirmTime
  898. });
  899. };
  900. };
  901. this.setState({
  902. lookflowList: theArr,
  903. });
  904. }.bind(this),
  905. }).always(function () {
  906. this.setState({
  907. loading: false
  908. });
  909. }.bind(this));
  910. },
  911. lookCancel(){
  912. this.setState({
  913. lookVisible:false
  914. })
  915. },
  916. /* -----变更操作开始----- */
  917. //新建变更
  918. addChange(){
  919. this.setState({
  920. addChangeState:true,
  921. stateAdd:1,
  922. changeRemarks:''
  923. })
  924. },
  925. //产看变更记录
  926. lookChange(){
  927. this.setState({
  928. addChangeState:true,
  929. stateAdd:0
  930. })
  931. this.lookChangeData()
  932. },
  933. //查看变更列表修改变更
  934. modifyChangeCancel(){
  935. this.setState({
  936. modifyChangeState:false
  937. })
  938. },
  939. //获取变更记录
  940. lookChangeData(){
  941. this.setState({
  942. loading:true
  943. });
  944. $.ajax({
  945. method: "get",
  946. dataType: "json",
  947. crossDomain: false,
  948. url: globalConfig.context +'/api/admin/order/viewOrderChange',
  949. data: {
  950. orderNo:this.props.datauser.orderNo,
  951. },
  952. success: function (data) {
  953. let theArr = [];
  954. if (!data.data) {
  955. if (data.error && data.error.length) {
  956. message.warning(data.error[0].message);
  957. };
  958. } else {
  959. for (let i = 0; i < data.data.length; i++) {
  960. theArr = data.data;
  961. };
  962. };
  963. this.setState({
  964. changeHtml: theArr,
  965. });
  966. }.bind(this),
  967. }).always(function () {
  968. this.setState({
  969. loading: false
  970. });
  971. }.bind(this));
  972. },
  973. //添加变更状态
  974. addChangeCancel(){
  975. this.setState({
  976. addChangeState:false
  977. })
  978. },
  979. //新建变更
  980. subChangeState(e){
  981. e.preventDefault();
  982. this.setState({
  983. loading: true
  984. });
  985. $.ajax({
  986. method: "POST",
  987. dataType: "json",
  988. crossDomain: false,
  989. url: globalConfig.context +'/api/admin/order/addOrderChange' ,
  990. data: {
  991. orderNo:this.props.datauser.orderNo,
  992. changeComment:this.state.changeRemarks
  993. }
  994. }).done(function(data) {
  995. this.setState({
  996. loading: false
  997. });
  998. if(!data.error.length) {
  999. message.success('保存成功!');
  1000. this.addChangeCancel();
  1001. this.loaduser();
  1002. } else {
  1003. message.warning(data.error[0].message);
  1004. }
  1005. }.bind(this));
  1006. },
  1007. //查看修改变更
  1008. modifyChange(item){
  1009. this.setState({
  1010. modifyChangeState:true,
  1011. changePromoter:item.creater,
  1012. changeTime:item.createTime,
  1013. changeState:item.changeStatus,
  1014. changeRemarks:item.changeComment,
  1015. idt:item.changeId,
  1016. orderNot:item.orderNo
  1017. })
  1018. },
  1019. //删除变更
  1020. modifyDelete(item){
  1021. this.setState({
  1022. loading: true
  1023. });
  1024. $.ajax({
  1025. method: "get",
  1026. dataType: "json",
  1027. crossDomain: false,
  1028. url: globalConfig.context +'/api/admin/order/deleteOrderChange' ,
  1029. data: {
  1030. changeId:item.changeId,
  1031. }
  1032. }).done(function(data) {
  1033. this.setState({
  1034. loading: false
  1035. });
  1036. if(!data.error.length) {
  1037. message.success('删除成功!');
  1038. this.lookChangeData();
  1039. this.loaduser()
  1040. } else {
  1041. message.warning(data.error[0].message);
  1042. }
  1043. }.bind(this));
  1044. },
  1045. //修改变更保存
  1046. changeModify(e){
  1047. e.preventDefault();
  1048. this.setState({
  1049. loading: true
  1050. });
  1051. $.ajax({
  1052. method: "POST",
  1053. dataType: "json",
  1054. crossDomain: false,
  1055. url: globalConfig.context +'/api/admin/order/updateOrderChange' ,
  1056. data: {
  1057. changeId:this.state.idt,
  1058. changeStatus:this.state.changeState,
  1059. changeComment:this.state.changeRemarks
  1060. }
  1061. }).done(function(data) {
  1062. this.setState({
  1063. loading: false
  1064. });
  1065. if(!data.error.length) {
  1066. message.success('保存成功!');
  1067. this.modifyChangeCancel();
  1068. this.lookChangeData();
  1069. this.loaduser()
  1070. } else {
  1071. message.warning(data.error[0].message);
  1072. }
  1073. }.bind(this));
  1074. },
  1075. /*-----变更操作结束----*/
  1076. //查看流失。项目列表
  1077. lookSee(state) {
  1078. this.state.lookSource=[];
  1079. this.setState({
  1080. loading: true
  1081. });
  1082. let api=state?'/api/xiangmu':'/api/liushui'
  1083. $.ajax({
  1084. method: "get",
  1085. dataType: "json",
  1086. crossDomain: false,
  1087. url: globalConfig.context + api,
  1088. data: {
  1089. orderNo:this.props.datauser.orderNo
  1090. },
  1091. success: function (data) {
  1092. let theArr = [];
  1093. if (!data.data) {
  1094. if (data.error && data.error.length) {
  1095. message.warning(data.error[0].message);
  1096. };
  1097. } else {
  1098. for (let i = 0; i < data.data.length; i++) {
  1099. let thisdata = data.data[i];
  1100. theArr.push({
  1101. key: i,
  1102. id:thisdata.id,
  1103. orderNo:thisdata.orderNo,
  1104. commodityName:thisdata.commodityName,
  1105. commodityType:thisdata.commodityType,
  1106. commodityMode:thisdata.commodityMode,
  1107. commodityQuantity:thisdata.commodityQuantity,
  1108. commodityPrice:thisdata.commodityPrice,
  1109. discountPrice:thisdata.discountPrice,
  1110. commodityFirstPayment:thisdata.commodityFirstPayment,
  1111. createTimes:thisdata.createTimes,
  1112. discountFirstPayment:thisdata.discountFirstPayment,
  1113. remarks:thisdata.remarks,
  1114. });
  1115. };
  1116. }
  1117. this.setState({
  1118. lookSource: theArr,
  1119. });
  1120. }.bind(this),
  1121. }).always(function () {
  1122. this.setState({
  1123. loading: false
  1124. });
  1125. }.bind(this));
  1126. },
  1127. //开单选择订单类型骚操作
  1128. orderTypeFn(e){
  1129. if(e==0){
  1130. this.setState({
  1131. bussStats:true,
  1132. orderType:e
  1133. })
  1134. this.category();
  1135. }else{
  1136. this.setState({
  1137. contractType:undefined,
  1138. bussStats:false,
  1139. orderType:e
  1140. })
  1141. }
  1142. },
  1143. //品类数据获取
  1144. category(){
  1145. $.ajax({
  1146. method: "get",
  1147. dataType: "json",
  1148. crossDomain: false,
  1149. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  1150. data: {
  1151. },
  1152. success: function(data) {
  1153. let thedata = data.data;
  1154. let theArr=[];
  1155. if(!thedata) {
  1156. if(data.error && data.error.length) {
  1157. message.warning(data.error[0].message);
  1158. };
  1159. thedata = {};
  1160. }else{
  1161. thedata.map(function(item,index){
  1162. theArr.push({
  1163. key:index,
  1164. name:item.cname,
  1165. id:item.id,
  1166. })
  1167. })
  1168. }
  1169. this.setState({
  1170. contractType:undefined,
  1171. categoryArr:theArr,
  1172. })
  1173. }.bind(this),
  1174. });
  1175. },
  1176. componentWillReceiveProps(nextProps) { //props改变时触发
  1177. this.state.visible = nextProps.showDesc;
  1178. this.state.signBillVisible=nextProps.signBillVisible;
  1179. if(this.state.signBillVisible){
  1180. this.loaduser(nextProps.uid)
  1181. };
  1182. if(nextProps.userDetaile && nextProps.showDesc) {
  1183. this.loaduser(nextProps.datauser);
  1184. this.loadData(nextProps.datauser);
  1185. }else{
  1186. this.setState({
  1187. orderType:undefined,
  1188. customerName:'',
  1189. autoId:'',
  1190. customerArr:[],
  1191. contractType:undefined,
  1192. bussStats:false,
  1193. customType:undefined
  1194. })
  1195. }
  1196. },
  1197. render() {
  1198. const FormItem = Form.Item
  1199. const formItemLayout = {
  1200. labelCol: { span: 8 },
  1201. wrapperCol: { span: 14 },
  1202. };
  1203. const changeHtml=this.state.changeHtml ||[];
  1204. const editFws=this.state.editFw;
  1205. const categoryList=this.state.categoryArr ||[];
  1206. const orderDetaiel=this.state.orderList || [];
  1207. const dataSources=this.state.customerArr || [];
  1208. const options = this.state.states?dataSources.map((group,index) =>
  1209. <Select.Option key={group.id} value={group.name}>{group.name}</Select.Option>
  1210. ):dataSources.map((group,index) =>
  1211. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  1212. )
  1213. return(
  1214. <div>
  1215. <Modal maskClosable={false} visible={this.state.visible}
  1216. onOk={this.handleOk} onCancel={this.handleCancel}
  1217. width={!this.props.userDetaile?'600px':'900px'}
  1218. title={!this.props.userDetaile?'创建订单':'编辑订单'}
  1219. footer=''
  1220. className="admin-desc-content">
  1221. <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form" style={{paddingBottom:'40px'}} >
  1222. <Spin spinning={this.state.loading}>
  1223. <div className="clearfix">
  1224. {!this.props.userDetaile?
  1225. <div className="clearfix">
  1226. <div className="clearfix">
  1227. <FormItem
  1228. {...formItemLayout}
  1229. label="订单类型" >
  1230. <Select placeholder="请选择订单类型"
  1231. style={{ width:'200px'}}
  1232. value={this.state.orderType}
  1233. onChange={(e)=>{this.setState({orderType:e})}}>
  1234. {
  1235. orderTypes.map(function (item) {
  1236. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1237. })
  1238. }
  1239. </Select>
  1240. <span className="mandatory">*</span>
  1241. </FormItem>
  1242. </div>
  1243. <FormItem
  1244. {...formItemLayout}
  1245. label="客户所属类型" >
  1246. <Select placeholder="请选择客户所属类型"
  1247. style={{ width:'200px'}}
  1248. value={this.state.customType}
  1249. onChange={(e)=>{this.setState({customType:e})}}>
  1250. {
  1251. customerType.map(function (item) {
  1252. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1253. })
  1254. }
  1255. </Select>
  1256. </FormItem>
  1257. <div className="clearfix">
  1258. <FormItem
  1259. {...formItemLayout}
  1260. label="客户名称" >
  1261. <AutoComplete
  1262. className="certain-category-search"
  1263. dropdownClassName="certain-category-search-dropdown"
  1264. dropdownMatchSelectWidth={false}
  1265. dropdownStyle={{ width: 200 }}
  1266. size="large"
  1267. style={{ width: '200px' }}
  1268. dataSource={options}
  1269. placeholder="输入名称"
  1270. value={this.state.customerName}
  1271. onChange={this.customerChange}
  1272. filterOption={true}
  1273. onSelect={this.selectAutoCUT}
  1274. >
  1275. <Input/>
  1276. </AutoComplete>
  1277. <span className="mandatory">*</span>
  1278. </FormItem>
  1279. </div>
  1280. <div className='addSave' style={{marginTop:'15px'}}>
  1281. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"150px"}} htmlType="submit">开单</Button>
  1282. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1283. </div>
  1284. </div>
  1285. :<div className="clearfix">
  1286. <FormItem className="half-item"
  1287. {...formItemLayout}
  1288. label="订单编号" >
  1289. <span>{this.state.orderNo}</span>
  1290. </FormItem>
  1291. <FormItem className="half-item"
  1292. {...formItemLayout}
  1293. label="合同签订时间" >
  1294. <DatePicker
  1295. style={{marginTop:"2px",width: '240px',height:"32px" }}
  1296. showTime
  1297. format="YYYY-MM-DD"
  1298. placeholder="合同签订时间"
  1299. value={this.state.signDate}
  1300. onChange={(e,time)=>{this.selTime(e,time)}}
  1301. />
  1302. <span className="mandatory">*</span>
  1303. </FormItem>
  1304. <FormItem className="half-item"
  1305. {...formItemLayout}
  1306. label="客户名称" >
  1307. <span>{this.state.userName}</span>
  1308. </FormItem>
  1309. <FormItem className="half-item"
  1310. {...formItemLayout}
  1311. label="流程状态" >
  1312. <span>{getProcessStatus(this.state.processStatus)}</span>
  1313. </FormItem>
  1314. <FormItem className="half-item"
  1315. {...formItemLayout}
  1316. label="结算状态" >
  1317. <span>{getLiquidationStatus(this.state.liquidationStatus)}</span>
  1318. </FormItem>
  1319. <FormItem className="half-item"
  1320. {...formItemLayout}
  1321. label="已收款项" >
  1322. <span>{this.state.settlementAmount+'万元'}</span>
  1323. </FormItem>
  1324. <FormItem className="half-item"
  1325. {...formItemLayout}
  1326. label="企业联系人" >
  1327. <Input placeholder="请输入联系人" ref='signTotalAmount' value={this.state.contacts} onChange={(e)=>{this.setState({contacts:e.target.value})}} style={{width:'240px'}} />
  1328. <span className="mandatory">*</span>
  1329. </FormItem>
  1330. <FormItem className="half-item"
  1331. {...formItemLayout}
  1332. label="联系人电话" >
  1333. <Input placeholder="请输入联系人电话" ref='signTotalAmount' value={this.state.contactMobile} onChange={(e)=>{this.setState({contactMobile:e.target.value})}} style={{width:'240px'}} />
  1334. <span className="mandatory">*</span>
  1335. </FormItem>
  1336. <FormItem className="half-item"
  1337. {...formItemLayout}
  1338. label="企业法人" >
  1339. <Input placeholder="请输入法人" ref='signTotalAmount' value={this.state.legalPerson} onChange={(e)=>{this.setState({legalPerson:e.target.value})}} style={{width:'240px'}} />
  1340. </FormItem>
  1341. <FormItem className="half-item"
  1342. {...formItemLayout}
  1343. label="法人电话" >
  1344. <Input placeholder="请输入法人电话" ref='signTotalAmount' value={this.state.legalPersonTel} onChange={(e)=>{this.setState({legalPersonTel:e.target.value})}} style={{width:'240px'}} />
  1345. </FormItem>
  1346. <div className='clearfix'>
  1347. <FormItem className="half-item"
  1348. {...formItemLayout}
  1349. label="签单金额(万元)" >
  1350. <Input placeholder="签单金额" ref='signTotalAmount' value={this.state.firstAmount} onChange={(e)=>{this.setState({firstAmount:e.target.value})}} style={{width:'240px'}} />
  1351. <span className="mandatory">*</span>
  1352. </FormItem>
  1353. <FormItem className="half-item"
  1354. {...formItemLayout}
  1355. label="首付金额(万元)" >
  1356. <Input placeholder="请输入实签首款金额" ref='signFirstPayment' value={this.state.totalAmount} onChange={(e)=>{this.setState({totalAmount:e.target.value})}} style={{width:'240px'}} />
  1357. <span className="mandatory">*</span>
  1358. </FormItem>
  1359. <FormItem className="half-item"
  1360. {...formItemLayout}
  1361. label="特批立项" >
  1362. <span>{getApprovedState(this.state.approval)}</span>
  1363. </FormItem>
  1364. <FormItem className="half-item"
  1365. {...formItemLayout}
  1366. label="合同编号" >
  1367. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1368. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />
  1369. </FormItem>
  1370. <div className='clearfix'>
  1371. <FormItem
  1372. labelCol={{ span: 4 }}
  1373. wrapperCol={{ span: 18 }}
  1374. label={
  1375. <span>
  1376. <strong style={{ color: '#f00' }}>*</strong>合同扫描件
  1377. </span>
  1378. }
  1379. >
  1380. <PicturesWall
  1381. fileList={this.getOrgCodeUrl}
  1382. pictureUrl={this.state.orgCodeUrl} />
  1383. <p>图片建议:要清晰。</p>
  1384. </FormItem>
  1385. </div>
  1386. <div className='clearfix'>
  1387. <FormItem
  1388. labelCol={{ span: 4 }}
  1389. wrapperCol={{ span: 16 }}
  1390. label="订单留言" >
  1391. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.orderRemarks}
  1392. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1393. </FormItem>
  1394. </div>
  1395. </div>
  1396. <div className='clearfix'>
  1397. <FormItem className="half-item"
  1398. {...formItemLayout}
  1399. label="订单负责人" >
  1400. <span>{this.state.salesmanName}</span>
  1401. </FormItem>
  1402. <FormItem className="half-item"
  1403. {...formItemLayout}
  1404. label="订单负责人电话" >
  1405. <span>{orderDetaiel.projectType}</span>
  1406. </FormItem>
  1407. </div>
  1408. <div className='clearfix'>
  1409. <FormItem className="half-item"
  1410. {...formItemLayout}
  1411. label="财务负责人" >
  1412. <span>{this.state.financeName}</span>
  1413. </FormItem>
  1414. <FormItem className="half-item"
  1415. {...formItemLayout}
  1416. label="财务负责人电话" >
  1417. <span>{orderDetaiel.projectType}</span>
  1418. </FormItem>
  1419. </div>
  1420. <div>
  1421. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  1422. <Button type='primary' onClick={this.addDetailed} style={{float:'right',marginRight:'50px',marginBottom:'15px'}}>添加明细</Button>
  1423. </div>
  1424. <div className="patent-table">
  1425. <Spin spinning={this.state.loading}>
  1426. <Table columns={this.state.columns}
  1427. dataSource={this.state.dataSource}
  1428. pagination={this.state.pagination}
  1429. onRowClick={this.tableRowClick}
  1430. />
  1431. </Spin>
  1432. </div>
  1433. <div className='addSave' style={{marginTop:'15px'}}>
  1434. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"200px"}} htmlType="submit">签单</Button>
  1435. <Button className="cancel" type="primary" onClick={this.handleCancel} style={{marginLeft:"50px"}} htmlType="submit">保存</Button>
  1436. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{marginLeft:"50px"}}>取消</Button>
  1437. </div>
  1438. </div>}
  1439. </div>
  1440. </Spin>
  1441. </Form >
  1442. </Modal>
  1443. <Modal maskClosable={false} visible={this.state.addnextVisible}
  1444. onOk={this.nextCancel} onCancel={this.nextCancel}
  1445. width='800px'
  1446. title={this.state.addState?'添加服务':'服务详情'}
  1447. footer=''
  1448. className="admin-desc-content">
  1449. <Form layout="horizontal" onSubmit={this.nextSubmit} id="demand-form">
  1450. <Spin spinning={this.state.loading}>
  1451. {this.state.addState?<div className="clearfix">
  1452. <FormItem className="half-item"
  1453. {...formItemLayout}
  1454. label="服务名称" >
  1455. <AutoComplete
  1456. className="certain-category-search"
  1457. dropdownClassName="certain-category-search-dropdown"
  1458. dropdownMatchSelectWidth={false}
  1459. dropdownStyle={{ width: 200 }}
  1460. style={{ width: '200px' }}
  1461. dataSource={options}
  1462. placeholder="输入服务名称"
  1463. value={this.state.commodityName}
  1464. onChange={this.httpChange}
  1465. filterOption={true}
  1466. onSelect={this.selectAuto}
  1467. >
  1468. <Input/>
  1469. </AutoComplete>
  1470. <span className="mandatory">*</span>
  1471. </FormItem>
  1472. <FormItem className="half-item"
  1473. {...formItemLayout}
  1474. label="市场价格(万元)" >
  1475. <span>{this.state.commodityPrice}</span>
  1476. </FormItem>
  1477. <FormItem className="half-item"
  1478. {...formItemLayout}
  1479. label="实签价格(万元)" >
  1480. <Input placeholder="请输入实签价格" value={this.state.discountPrice} style={{width:'200px'}}
  1481. onChange={(e)=>{this.setState({discountPrice:e.target.value})}} ref="discountPrice"/>
  1482. <span className="mandatory">*</span>
  1483. </FormItem>
  1484. <FormItem className="half-item"
  1485. {...formItemLayout}
  1486. label="服务数量" >
  1487. <Input placeholder="请输入服务数量" value={this.state.commodityQuantity} style={{width:'200px'}}
  1488. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}} ref="commodityQuantity"/>
  1489. <span className="mandatory">*</span>
  1490. </FormItem>
  1491. <FormItem className="half-item"
  1492. {...formItemLayout}
  1493. label="市场首付金额(万元)" >
  1494. <span>{this.state.commodityFirstPayment}</span>
  1495. </FormItem>
  1496. <FormItem className="half-item"
  1497. {...formItemLayout}
  1498. label="签单首付金额(万元)" >
  1499. <Input placeholder="请输入签单首付金额" value={this.state.discountFirstPayment} style={{width:'200px'}}
  1500. onChange={(e)=>{this.setState({discountFirstPayment:e.target.value})}} ref='discountFirstPayment'/>
  1501. <span className="mandatory">*</span>
  1502. </FormItem>
  1503. <div className='clearfix'>
  1504. <FormItem
  1505. labelCol={{ span: 4 }}
  1506. wrapperCol={{ span: 16 }}
  1507. label="服务说明" >
  1508. <Input type='textarea' placeholder="请输入服务说明" value={this.state.remarks}
  1509. onChange={(e)=>{this.setState({remarks:e.target.value})}} />
  1510. </FormItem>
  1511. </div>
  1512. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1513. <Button className="submitSave" type="primary" htmlType="submit">保存</Button>
  1514. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1515. </FormItem>
  1516. </div>:
  1517. <div className='clearfix'>
  1518. <FormItem className="half-item"
  1519. {...formItemLayout}
  1520. label="服务名称" >
  1521. <span>{editFws.commodityName}</span>
  1522. </FormItem>
  1523. <FormItem className="half-item"
  1524. {...formItemLayout}
  1525. label="市场价格" >
  1526. <span>{editFws.commodityPrice+'万元'}</span>
  1527. </FormItem>
  1528. <FormItem className="half-item"
  1529. {...formItemLayout}
  1530. label="市场首付金额" >
  1531. <span>{editFws.commodityFirstPayment+'万元'}</span>
  1532. </FormItem>
  1533. <FormItem className="half-item"
  1534. {...formItemLayout}
  1535. label="实签价格(万元)" >
  1536. <Input placeholder="请输入签单首付金额" value={this.state.discountPrice} style={{width:'200px'}}
  1537. onChange={(e)=>{this.setState({discountPrice:e.target.value})}} />
  1538. <span className="mandatory">*</span>
  1539. </FormItem>
  1540. <FormItem className="half-item"
  1541. {...formItemLayout}
  1542. label="服务数量" >
  1543. <span>{editFws.commodityQuantity}</span>
  1544. </FormItem>
  1545. <FormItem className="half-item"
  1546. {...formItemLayout}
  1547. label="签单首付金额(万元)" >
  1548. <Input placeholder="请输入签单首付金额" value={this.state.discountFirstPayment} style={{width:'200px'}}
  1549. onChange={(e)=>{this.setState({discountFirstPayment:e.target.value})}} />
  1550. <span className="mandatory">*</span>
  1551. </FormItem>
  1552. <div className='clearfix'>
  1553. <FormItem
  1554. labelCol={{ span: 4 }}
  1555. wrapperCol={{ span: 16 }}
  1556. label="服务说明" >
  1557. <span>{editFws.remarks}</span>
  1558. </FormItem>
  1559. </div>
  1560. {this.state.active.applySign&&<FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1561. <Button className="submitSave" type="primary" onClick={this.tabRowSave}>保存</Button>
  1562. <Button className="submitSave" type="ghost" onClick={this.nextCancel}>取消</Button>
  1563. </FormItem>}
  1564. </div>}
  1565. </Spin>
  1566. </Form >
  1567. </Modal>
  1568. <Modal maskClosable={false} visible={this.state.signBillVisible}
  1569. onOk={this.signBillOk} onCancel={this.signBillOk}
  1570. width='800px'
  1571. title='签单信息'
  1572. footer=''
  1573. className="admin-desc-content">
  1574. <Form layout="horizontal" onSubmit={this.signOk} id="demand-form">
  1575. <Spin spinning={this.state.loading}>
  1576. <div className="clearfix">
  1577. <FormItem className="half-item"
  1578. {...formItemLayout}
  1579. label="订单编号" >
  1580. <span>{this.state.orderNo}</span>
  1581. </FormItem>
  1582. <FormItem className="half-item"
  1583. {...formItemLayout}
  1584. label="客户名称" >
  1585. <span>{this.state.buyerName}</span>
  1586. </FormItem>
  1587. <FormItem className="half-item"
  1588. {...formItemLayout}
  1589. label="实签款项(万元)" >
  1590. <Input placeholder="请输入实签款项" value={this.state.signTotalAmount} style={{width:'200px'}}
  1591. onChange={(e)=>{this.setState({signTotalAmount:e.target.value})}} />
  1592. <span className="mandatory">*</span>
  1593. </FormItem>
  1594. <FormItem className="half-item"
  1595. {...formItemLayout}
  1596. label="实签首款(万元)" >
  1597. <Input placeholder="请输入实签首款" value={this.state.signFirstPayment} style={{width:'200px'}}
  1598. onChange={(e)=>{this.setState({signFirstPayment:e.target.value})}} />
  1599. <span className="mandatory">*</span>
  1600. </FormItem>
  1601. <FormItem className="half-item"
  1602. {...formItemLayout}
  1603. label="特批立项" >
  1604. <Select placeholder="选择特批立项类型"
  1605. style={{ width:'200px'}}
  1606. value={this.state.approval}
  1607. onChange={(e) => { this.setState({ approval: e }) }}>
  1608. <Select.Option value='0'>不申请特批</Select.Option>
  1609. <Select.Option value='1'>申请特批</Select.Option>
  1610. </Select>
  1611. <span className="mandatory">*</span>
  1612. </FormItem>
  1613. <FormItem className="half-item"
  1614. {...formItemLayout}
  1615. label="合同编号" >
  1616. <Input placeholder="请输入合同编号" value={this.state.contractNo}
  1617. onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'200px'}} />
  1618. <span className="mandatory">*</span>
  1619. </FormItem>
  1620. <div className='clearfix'>
  1621. <FormItem
  1622. labelCol={{ span: 4 }}
  1623. wrapperCol={{ span: 16 }}
  1624. label="签单备注" >
  1625. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.orderRemarks}
  1626. onChange={(e)=>{this.setState({orderRemarks:e.target.value})}}/>
  1627. </FormItem>
  1628. </div>
  1629. <div className='clearfix'>
  1630. <FormItem
  1631. labelCol={{ span: 4 }}
  1632. wrapperCol={{ span: 18 }}
  1633. label="合同扫描件" >
  1634. <PicturesWall
  1635. listType="picture-card"
  1636. fileList={this.getOrgCodeUrl}
  1637. pictureUrl={this.state.orgCodeUrl} />
  1638. <p>图片建议:要清晰。</p>
  1639. </FormItem>
  1640. </div>
  1641. </div>
  1642. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1643. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1644. <Button className="submitSave" type="ghost" onClick={this.signBillOk}>返回</Button>
  1645. </FormItem>
  1646. </Spin>
  1647. </Form >
  1648. </Modal>
  1649. <Modal maskClosable={false} visible={this.state.signVisible}
  1650. onOk={this.signBittOk} onCancel={this.signBittOk}
  1651. width='600px'
  1652. title='签单信息'
  1653. footer=''
  1654. className="admin-desc-content">
  1655. <Form layout="horizontal" onSubmit={this.signSub} id="demand-form">
  1656. <Spin spinning={this.state.loading}>
  1657. <div className="clearfix">
  1658. <FormItem
  1659. {...formItemLayout}
  1660. label="特批立项" >
  1661. <Select placeholder="选择特批立项类型"
  1662. style={{ width:'200px'}}
  1663. value={this.state.approval}
  1664. onChange={(e) => { this.setState({ approval: e }) }}>
  1665. <Select.Option value='0'>不申请特批</Select.Option>
  1666. <Select.Option value='1'>申请特批</Select.Option>
  1667. </Select>
  1668. <span className="mandatory">*</span>
  1669. </FormItem>
  1670. </div>
  1671. <div className="clearfix">
  1672. <FormItem
  1673. {...formItemLayout}
  1674. label="签单时间" >
  1675. <DatePicker
  1676. style={{marginTop:"2px"}}
  1677. showTime
  1678. format="YYYY-MM-DD"
  1679. placeholder="选择签单时间"
  1680. value={this.state.entryTime}
  1681. onChange={(e,time)=>{this.selTime(e,time)}}
  1682. />
  1683. <span className="mandatory">*</span>
  1684. </FormItem>
  1685. </div>
  1686. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1687. <Button className="submitSave" type="primary" htmlType="submit">确定签单</Button>
  1688. <Button className="submitSave" type="ghost" onClick={this.signBittOk}>返回</Button>
  1689. </FormItem>
  1690. </Spin>
  1691. </Form >
  1692. </Modal>
  1693. <Modal maskClosable={false} visible={this.state.lookVisible}
  1694. onOk={this.lookCancel} onCancel={this.lookCancel}
  1695. width='1300px'
  1696. title= '查看流水'
  1697. footer=''
  1698. className="admin-desc-content">
  1699. <Form layout="horizontal" id="demand-form">
  1700. <Spin spinning={this.state.loading}>
  1701. <div className="clearfix">
  1702. <Table columns={this.state.flowList}
  1703. dataSource={this.state.lookflowList}
  1704. pagination={false}
  1705. />
  1706. </div>
  1707. </Spin>
  1708. </Form >
  1709. </Modal>
  1710. <Modal maskClosable={false} visible={this.state.addChangeState}
  1711. onOk={this.addChangeCancel} onCancel={this.addChangeCancel}
  1712. width='800px'
  1713. title= {this.state.stateAdd?'添加变更':'查看变更记录'}
  1714. footer=''
  1715. className="admin-desc-content">
  1716. <Form layout="horizontal" id="demand-form">
  1717. <Spin spinning={this.state.loading}>
  1718. <div className="clearfix">
  1719. {this.state.stateAdd?<div className="clearfix">
  1720. <FormItem
  1721. labelCol={{ span: 4 }}
  1722. wrapperCol={{ span: 16 }}
  1723. label="变更说明" >
  1724. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1725. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  1726. </FormItem>
  1727. <div className="clearfix">
  1728. <Button type="primary" onClick={this.subChangeState} style={{margin:"10px 50px 10px 128px"}}>保存</Button>
  1729. <Button onClick={this.addChangeCancel}>取消</Button>
  1730. </div>
  1731. </div>:
  1732. <div>
  1733. {
  1734. changeHtml.length?changeHtml.map(function(item,index){
  1735. return (<div className="changeBorder" key={index}>
  1736. <FormItem className="half-item"
  1737. {...formItemLayout}
  1738. label="变更发起人" >
  1739. <span>{item.creater}</span>
  1740. </FormItem>
  1741. <FormItem className="half-item"
  1742. {...formItemLayout}
  1743. label="变更申请时间" >
  1744. <span>{item.createTime}</span>
  1745. </FormItem>
  1746. <div className='clearfix'>
  1747. <FormItem className="half-item"
  1748. {...formItemLayout}
  1749. label="变更状态" >
  1750. <span>{getChangeState(item.changeStatus)}</span>
  1751. </FormItem>
  1752. <FormItem className="half-item"
  1753. {...formItemLayout}
  1754. label="变更操作" >
  1755. <Button onClick={(e)=>{this.modifyChange(item)}}>修改</Button>
  1756. {/*<Button type="danger" onClick={(e)=>{this.modifyDelete(item)}}>删除</Button>*/}
  1757. </FormItem>
  1758. </div>
  1759. <div className='clearfix changeRemark'>
  1760. <FormItem
  1761. labelCol={{ span: 4 }}
  1762. wrapperCol={{ span: 16 }}
  1763. label="变更说明" >
  1764. <p>{item.changeComment}</p>
  1765. </FormItem>
  1766. </div>
  1767. </div>)
  1768. },this):<p style={{textAlign:"center"}}>暂无变更记录</p>}
  1769. </div>
  1770. }
  1771. </div>
  1772. </Spin>
  1773. </Form >
  1774. </Modal>
  1775. <Modal maskClosable={false} visible={this.state.modifyChangeState}
  1776. onOk={this.modifyChangeCancel} onCancel={this.modifyChangeCancel}
  1777. width='600px'
  1778. title= "修改变更 "
  1779. footer=''
  1780. className="admin-desc-content">
  1781. <Form layout="horizontal" id="demand-form">
  1782. <Spin spinning={this.state.loading}>
  1783. <div className="clearfix">
  1784. <div className="clearfix">
  1785. <FormItem className="half-item"
  1786. {...formItemLayout}
  1787. label="变更发起人" >
  1788. <span>{this.state.changePromoter}</span>
  1789. </FormItem>
  1790. <FormItem className="half-item"
  1791. {...formItemLayout}
  1792. label="变更申请时间" >
  1793. <span>{this.state.changeTime}</span>
  1794. </FormItem>
  1795. <div className='clearfix'>
  1796. <FormItem
  1797. labelCol={{ span: 4 }}
  1798. wrapperCol={{ span: 16 }}
  1799. label="变更状态" >
  1800. <Radio.Group onChange={(e)=>{this.setState({changeState:e.target.value})}} value={this.state.changeState}>
  1801. <Radio value={1}>变更中</Radio>
  1802. <Radio value={2}>变更完成</Radio>
  1803. </Radio.Group>
  1804. </FormItem>
  1805. </div>
  1806. <div className='clearfix'>
  1807. <FormItem
  1808. labelCol={{ span: 4 }}
  1809. wrapperCol={{ span: 16 }}
  1810. label="变更说明" >
  1811. <Input type="textarea" placeholder="请输入变更说明" rows={4} value={this.state.changeRemarks}
  1812. onChange={(e)=>{this.setState({changeRemarks:e.target.value})}}/>
  1813. </FormItem>
  1814. </div>
  1815. <div className="clearfix">
  1816. <Button type="primary" onClick={this.changeModify} style={{margin:"10px 95px"}}>保存</Button>
  1817. <Button onClick={this.modifyChangeCancel}>取消</Button>
  1818. </div>
  1819. </div>
  1820. </div>
  1821. </Spin>
  1822. </Form >
  1823. </Modal>
  1824. </div>
  1825. )
  1826. }
  1827. }));
  1828. export default NewService;