mySettlementDetaile.jsx 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../../userMangagement.less';
  6. import {getApprovedState,getPaymentState,getOrderState,getProjectState,getOrderChannel,getOrderType,getTransactionProject,getTransactionChannel} from '../../../../tools.js';
  7. const MySettlementDetaile = Form.create()(React.createClass({
  8. loadData(record) {
  9. this.state.data = [];
  10. this.setState({
  11. loading: true
  12. });
  13. $.ajax({
  14. method: "get",
  15. dataType: "json",
  16. crossDomain: false,
  17. url: globalConfig.context + '/api/admin/order/getOrderCommodity',
  18. data: {
  19. orderNo:record?record.orderNo:this.props.datauser.orderNo
  20. },
  21. success: function (data) {
  22. let theArr = [];
  23. if (!data.data) {
  24. if (data.error && data.error.length) {
  25. message.warning(data.error[0].message);
  26. };
  27. } else {
  28. for (let i = 0; i < data.data.length; i++) {
  29. let thisdata = data.data[i];
  30. theArr.push({
  31. key: i,
  32. id:thisdata.id,
  33. orderNo:thisdata.orderNo,
  34. commodityName:thisdata.commodityName,
  35. commodityType:thisdata.commodityType,
  36. commodityMode:thisdata.commodityMode,
  37. commodityQuantity:thisdata.commodityQuantity,
  38. commodityPrice:thisdata.commodityPrice,
  39. discountPrice:thisdata.discountPrice,
  40. commodityFirstPayment:thisdata.commodityFirstPayment,
  41. createTimes:thisdata.createTimes,
  42. discountFirstPayment:thisdata.discountFirstPayment,
  43. remarks:thisdata.remarks,
  44. });
  45. };
  46. }
  47. this.setState({
  48. dataSource: theArr,
  49. });
  50. }.bind(this),
  51. }).always(function () {
  52. this.setState({
  53. loading: false
  54. });
  55. }.bind(this));
  56. },
  57. getInitialState() {
  58. return {
  59. loading: false,
  60. visible: false,
  61. contractState:false,
  62. orgCodeUrl:[],
  63. lookflowList:[],
  64. checkedKeys: [],
  65. columns: [
  66. {
  67. title: '业务项目名称',
  68. dataIndex: 'commodityName',
  69. key: 'commodityName'
  70. }, {
  71. title: '项目类别',
  72. dataIndex: 'commodityType',
  73. key: 'commodityType',
  74. render:(text)=>{
  75. return (getOrderType(text))
  76. }
  77. },{
  78. title: '项目数量',
  79. dataIndex: 'commodityQuantity',
  80. key: 'commodityQuantity'
  81. }, {
  82. title: '服务市价(万元)',
  83. dataIndex: 'commodityPrice',
  84. key: 'commodityPrice'
  85. }, {
  86. title: '实签价格(万元)',
  87. dataIndex: 'discountPrice',
  88. key: 'discountPrice'
  89. }, {
  90. title: '下单时间',
  91. dataIndex: 'createTimes',
  92. key: 'createTimes'
  93. }, {
  94. title: '项目说明',
  95. dataIndex: 'remarks',
  96. key: 'remarks',
  97. render:(text)=>{
  98. return (text&&text.length>8?text.substr(0,8)+'…':text)
  99. }
  100. }
  101. ],
  102. flowList:[
  103. {
  104. title: '平台流水号',
  105. dataIndex: 'billNo',
  106. key: 'billNo',
  107. }, {
  108. title: '平台流水时间',
  109. dataIndex: 'createTime',
  110. key: 'createTime'
  111. }, {
  112. title: '流水金额(万元)',
  113. dataIndex: 'transactionAmount',
  114. key: 'transactionAmount'
  115. },{
  116. title: '付款人名称',
  117. dataIndex: 'payerName',
  118. key: 'payerName'
  119. }, {
  120. title: '收款人名称',
  121. dataIndex: 'payeeName',
  122. key: 'payeeName'
  123. },
  124. {
  125. title: '流水科目',
  126. dataIndex: 'transactionSubject',
  127. key: 'transactionSubject',
  128. render:(text)=>{return getTransactionProject(text) }
  129. }, {
  130. title: '流水渠道',
  131. dataIndex: 'transactionChannel',
  132. key: 'transactionChannel',
  133. render:(text)=>{return getTransactionChannel(text) }
  134. },{
  135. title: '财务流水号',
  136. dataIndex: 'financialPayNo',
  137. key: 'financialPayNo',
  138. }, {
  139. title: '财务流水时间',
  140. dataIndex: 'financialPayTime',
  141. key: 'financialPayTime',
  142. }, {
  143. title: '流水确认',
  144. dataIndex: 'confirmSign',
  145. key: 'confirmSign',
  146. render:(text)=>{return text?'已确认':'待确认' }
  147. },{
  148. title: '确认时间',
  149. dataIndex: 'confirmTime',
  150. key: 'confirmTime',
  151. }
  152. ]
  153. };
  154. },
  155. //查看基本详情基本信息
  156. loaduser(record){
  157. if(record){
  158. this.state.orderList=[]
  159. $.ajax({
  160. method: "get",
  161. dataType: "json",
  162. crossDomain: false,
  163. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  164. data: {
  165. orderNo: record.orderNo
  166. },
  167. success: function (data) {
  168. let thisData = data.data;
  169. if (!thisData) {
  170. if (data.error && data.error.length) {
  171. message.warning(data.error[0].message);
  172. };
  173. thisData = {};
  174. };
  175. this.setState({
  176. orderType:thisData.orderType,
  177. id:thisData.id,
  178. contractNo:thisData.contractNo,
  179. orderList:thisData,
  180. orderAmount:thisData.orderAmount,
  181. firstPayment:thisData.firstPayment,
  182. signTotalAmount:thisData.signTotalAmount,
  183. signFirstPayment:thisData.signFirstPayment,
  184. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  185. orderRemarks:thisData.orderRemarks,
  186. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  187. //签单
  188. orderNo:thisData.orderNo,//订单编号
  189. buyerName:thisData.buyerName,
  190. });
  191. }.bind(this),
  192. }).always(function () {
  193. this.setState({
  194. loading: false
  195. });
  196. }.bind(this));
  197. }
  198. },
  199. handleOk(e) {
  200. this.setState({
  201. visible: false,
  202. });
  203. this.props.closeDesc(false, true);
  204. },
  205. handleCancel(e) {
  206. this.setState({
  207. visible: false,
  208. });
  209. this.props.closeDesc(false);
  210. },
  211. componentWillMount() {
  212. },
  213. nextCancel() {
  214. this.setState({
  215. addnextVisible: false
  216. })
  217. },
  218. lookflow(){
  219. this.setState({
  220. loading: true,
  221. lookVisible:true,
  222. })
  223. this.state.lookSource=[];
  224. $.ajax({
  225. method: "get",
  226. dataType: "json",
  227. crossDomain: false,
  228. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  229. data: {
  230. orderNo:this.props.datauser.orderNo,
  231. },
  232. success: function (data) {
  233. let theArr = [];
  234. if (!data.data) {
  235. if (data.error && data.error.length) {
  236. message.warning(data.error[0].message);
  237. };
  238. } else {
  239. for (let i = 0; i < data.data.length; i++) {
  240. let thisdata = data.data[i];
  241. theArr.push({
  242. key: i,
  243. billNo: thisdata.billNo,
  244. transactionAmount:thisdata.transactionAmount,
  245. createTime:thisdata.createTime,
  246. transactionAmount:thisdata.transactionAmount,
  247. payerName:thisdata.payerName,
  248. payeeName:thisdata.payeeName,
  249. transactionSubject:thisdata.transactionSubject,
  250. transactionChannel:thisdata.transactionChannel,
  251. financialPayNo:thisdata.financialPayNo,
  252. financialPayTime:thisdata.financialPayTime,
  253. orderNo:thisdata.orderNo,
  254. departmentName:thisdata.departmentName,
  255. salesmanName:thisdata.salesmanName,
  256. financeName:thisdata.financeName,
  257. confirmSign:thisdata.confirmSign,
  258. deleteSign:thisdata.deleteSign,
  259. confirmTime:thisdata.confirmTime
  260. });
  261. };
  262. };
  263. this.setState({
  264. lookflowList: theArr,
  265. });
  266. }.bind(this),
  267. }).always(function () {
  268. this.setState({
  269. loading: false
  270. });
  271. }.bind(this));
  272. },
  273. //保存合同编号
  274. subContract(e) {
  275. e.preventDefault();
  276. this.setState({
  277. loading: true
  278. });
  279. let api='/api/admin/order/updateServiceOrder';
  280. $.ajax({
  281. method: "POST",
  282. dataType: "json",
  283. crossDomain: false,
  284. url: globalConfig.context + api,
  285. data:{
  286. orderNo:this.state.orderNo,
  287. contractNo:this.state.contractNo,
  288. signTotalAmount:this.state.signTotalAmount,
  289. signFirstPayment:this.state.signFirstPayment,
  290. }
  291. }).done(function(data) {
  292. this.setState({
  293. loading: false
  294. });
  295. if(!data.error.length) {
  296. message.success('保存成功!');
  297. this.handleOk()
  298. } else {
  299. message.warning(data.error[0].message);
  300. }
  301. }.bind(this));
  302. },
  303. lookCancel(){
  304. this.setState({
  305. lookVisible:false
  306. })
  307. },
  308. tableRowClick(record, index) {
  309. this.setState({
  310. editFw:record,
  311. addnextVisible:true,
  312. });
  313. },
  314. componentWillReceiveProps(nextProps) { //props改变时触发
  315. this.state.visible = nextProps.showDesc;
  316. if(nextProps.userDetaile && nextProps.showDesc ) {
  317. this.loaduser(nextProps.datauser);
  318. this.loadData(nextProps.datauser);
  319. }
  320. },
  321. render() {
  322. const FormItem = Form.Item
  323. const formItemLayout = {
  324. labelCol: { span: 8 },
  325. wrapperCol: { span: 14 },
  326. };
  327. const editFws=this.state.editFw || [];
  328. const orderDetaiel=this.state.orderList || [];
  329. return(
  330. <div>
  331. <Modal maskClosable={false} visible={this.state.visible}
  332. onOk={this.handleOk} onCancel={this.handleCancel}
  333. width='1000px'
  334. title='查看订单详情'
  335. footer=''
  336. className="admin-desc-content">
  337. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  338. <Spin spinning={this.state.loading}>
  339. <div className="clearfix">
  340. <div className="clearfix">
  341. <FormItem className="half-item"
  342. {...formItemLayout}
  343. label="订单编号" >
  344. <span>{orderDetaiel.orderNo}</span>
  345. </FormItem>
  346. <FormItem className="half-item"
  347. {...formItemLayout}
  348. label="下单时间" >
  349. <span>{orderDetaiel.createTime}</span>
  350. </FormItem>
  351. <FormItem className="half-item"
  352. {...formItemLayout}
  353. label="客户名称" >
  354. <span>{orderDetaiel.buyerName}</span>
  355. </FormItem>
  356. <FormItem className="half-item"
  357. {...formItemLayout}
  358. label="订单类型" >
  359. <span>{getOrderType(orderDetaiel.orderType)}</span>
  360. </FormItem>
  361. <FormItem className="half-item"
  362. {...formItemLayout}
  363. label="订单渠道" >
  364. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  365. </FormItem>
  366. <FormItem className="half-item"
  367. {...formItemLayout}
  368. label="订单状态" >
  369. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  370. </FormItem>
  371. <FormItem className="half-item"
  372. {...formItemLayout}
  373. label="已收款项" >
  374. <span>{orderDetaiel.actuallyTotalAmount+"万元"}</span>
  375. </FormItem>
  376. <FormItem className="half-item"
  377. {...formItemLayout}
  378. label="结算状态" >
  379. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  380. </FormItem>
  381. <FormItem className="half-item"
  382. {...formItemLayout}
  383. label="市价订单金额" >
  384. <span>{orderDetaiel.orderAmount+"万元"}</span>
  385. </FormItem>
  386. <FormItem className="half-item"
  387. {...formItemLayout}
  388. label="市价首款金额" >
  389. <span>{orderDetaiel.firstPayment+"万元"}</span>
  390. </FormItem>
  391. <div className='clearfix'>
  392. <FormItem className="half-item"
  393. {...formItemLayout}
  394. label="实签订单金额" >
  395. <span>{orderDetaiel.signTotalAmount+"万元"}</span>
  396. </FormItem>
  397. <FormItem className="half-item"
  398. {...formItemLayout}
  399. label="实签首款金额" >
  400. <span>{orderDetaiel.signFirstPayment+"万元"}</span>
  401. </FormItem>
  402. <FormItem className="half-item"
  403. {...formItemLayout}
  404. label="特批立项" >
  405. <span>{getApprovedState(orderDetaiel.approval)}</span>
  406. </FormItem>
  407. <FormItem className="half-item"
  408. {...formItemLayout}
  409. label="合同编号" >
  410. <Input placeholder="实签订单金额" value={this.state.contractNo} onChange={(e)=>{this.setState({contractNo:e.target.value})}} style={{width:'240px'}} />
  411. </FormItem>
  412. <div className='clearfix'>
  413. <FormItem
  414. labelCol={{ span: 4 }}
  415. wrapperCol={{ span: 16 }}
  416. label="订单留言" >
  417. <span>{orderDetaiel.orderRemarks}</span>
  418. </FormItem>
  419. </div>
  420. </div>
  421. </div>
  422. <div className='clearfix'>
  423. <FormItem className="half-item"
  424. {...formItemLayout}
  425. label="订单负责人" >
  426. <span>{orderDetaiel.salesmanName}</span>
  427. </FormItem>
  428. <FormItem className="half-item"
  429. {...formItemLayout}
  430. label="业务品类" >
  431. <span>{orderDetaiel.projectType}</span>
  432. </FormItem>
  433. </div>
  434. <div className='clearfix'>
  435. <FormItem className="half-item"
  436. {...formItemLayout}
  437. label="意向时间" >
  438. <span>{orderDetaiel.createTime}</span>
  439. </FormItem>
  440. <FormItem className="half-item"
  441. {...formItemLayout}
  442. label="签单时间" >
  443. <span>{orderDetaiel.signTime}</span>
  444. </FormItem>
  445. <FormItem className="half-item"
  446. {...formItemLayout}
  447. label="财务负责人" >
  448. <span>{orderDetaiel.financeName}</span>
  449. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  450. </FormItem>
  451. <FormItem className="half-item"
  452. {...formItemLayout}
  453. label="首付时间" >
  454. <span>{orderDetaiel.createTimez}</span>
  455. </FormItem>
  456. <FormItem className="half-item"
  457. {...formItemLayout}
  458. label="项目负责人" >
  459. <span>{orderDetaiel.technicianName}</span>
  460. </FormItem>
  461. <FormItem className="half-item"
  462. {...formItemLayout}
  463. label="立项时间" >
  464. <span>{orderDetaiel.setUpTime}</span>
  465. </FormItem>
  466. <FormItem className="half-item"
  467. {...formItemLayout}
  468. label="项目状态" >
  469. <span>{getProjectState(orderDetaiel.projectStage)}</span>
  470. </FormItem>
  471. </div>
  472. <div>
  473. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  474. </div>
  475. <div className="patent-table">
  476. <Spin spinning={this.state.loading}>
  477. <Table columns={this.state.columns}
  478. dataSource={this.state.dataSource}
  479. pagination={false}
  480. onRowClick={this.tableRowClick}
  481. />
  482. </Spin>
  483. </div>
  484. <div style={{marginTop:'10px'}}>
  485. <Button type="primary" onClick={this.subContract} style={{float:'left',marginLeft:'200px'}}>保存</Button>
  486. <Button className="cancel" type="ghost" onClick={this.handleCancel} style={{float:'right',marginRight:'200px'}}>返回</Button>
  487. </div>
  488. </div>
  489. </Spin>
  490. </Form >
  491. </Modal>
  492. <Modal maskClosable={false} visible={this.state.addnextVisible}
  493. onOk={this.nextCancel} onCancel={this.nextCancel}
  494. width='550px'
  495. title='查看明细服务'
  496. footer=''
  497. className="admin-desc-content">
  498. <Form layout="horizontal" id="demand-form">
  499. <Spin spinning={this.state.loading}>
  500. <div className="clearfix">
  501. <FormItem className="half-item"
  502. {...formItemLayout}
  503. label="服务名称" >
  504. <span>{editFws.commodityName}</span>
  505. </FormItem>
  506. <FormItem className="half-item"
  507. {...formItemLayout}
  508. label="市场价格" >
  509. <span>{editFws.commodityPrice+"万元"}</span>
  510. </FormItem>
  511. <FormItem className="half-item"
  512. {...formItemLayout}
  513. label="实签价格" >
  514. <span>{editFws.discountPrice+"万元"}</span>
  515. </FormItem>
  516. <FormItem className="half-item"
  517. {...formItemLayout}
  518. label="服务数量" >
  519. <span>{editFws.commodityQuantity}</span>
  520. </FormItem>
  521. <FormItem className="half-item"
  522. {...formItemLayout}
  523. label="市场首付金额" >
  524. <span>{editFws.commodityFirstPayment+"万元"}</span>
  525. </FormItem>
  526. <FormItem className="half-item"
  527. {...formItemLayout}
  528. label="签单首付金额" >
  529. <span>{editFws.discountFirstPayment+"万元"}</span>
  530. </FormItem>
  531. <div className='clearfix'>
  532. <FormItem
  533. labelCol={{ span: 4 }}
  534. wrapperCol={{ span: 16 }}
  535. label="服务说明" >
  536. <span>{editFws.remarks}</span>
  537. </FormItem>
  538. </div>
  539. </div>
  540. </Spin>
  541. </Form >
  542. </Modal>
  543. <Modal maskClosable={false} visible={this.state.lookVisible}
  544. onOk={this.lookCancel} onCancel={this.lookCancel}
  545. width='1300px'
  546. title= '查看流水'
  547. footer=''
  548. className="admin-desc-content">
  549. <Form layout="horizontal" id="demand-form">
  550. <Spin spinning={this.state.loading}>
  551. <div className="clearfix">
  552. <Table columns={this.state.flowList}
  553. dataSource={this.state.lookflowList}
  554. pagination={false}
  555. />
  556. </div>
  557. </Spin>
  558. </Form >
  559. </Modal>
  560. </div>
  561. )
  562. }
  563. }));
  564. export default MySettlementDetaile;