addService.jsx 71 KB

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