managementDetaile.jsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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 ManagementDetaile = 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. lookState:true,
  62. orgCodeUrl:[],
  63. checkedKeys: [],
  64. lookflowList:[],
  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. id:thisData.id,
  177. orderList:thisData,
  178. orderAmount:thisData.orderAmount,
  179. firstPayment:thisData.firstPayment,
  180. signTotalAmount:thisData.signTotalAmount,
  181. signFirstPayment:thisData.signFirstPayment,
  182. approval:thisData.approval==0?thisData.approval.toString():thisData.approval,
  183. orderRemarks:thisData.orderRemarks,
  184. orgCodeUrl: thisData.orgCodeUrl ? splitUrl(thisData.orgCodeUrl, ',', globalConfig.avatarHost + '/upload') : [],
  185. //签单
  186. orderNo:thisData.orderNo,//订单编号
  187. buyerName:thisData.buyerName,
  188. });
  189. }.bind(this),
  190. }).always(function () {
  191. this.setState({
  192. loading: false
  193. });
  194. }.bind(this));
  195. }
  196. },
  197. handleOk(e) {
  198. this.setState({
  199. visible: false,
  200. });
  201. this.props.closeDesc(false, true);
  202. },
  203. handleCancel(e) {
  204. this.setState({
  205. visible: false,
  206. });
  207. this.props.closeDesc(false);
  208. },
  209. nextCancel() {
  210. this.setState({
  211. addnextVisible: false
  212. })
  213. },
  214. lookflow(){
  215. this.setState({
  216. loading: true,
  217. lookVisible:true,
  218. })
  219. this.state.lookSource=[];
  220. $.ajax({
  221. method: "get",
  222. dataType: "json",
  223. crossDomain: false,
  224. url: globalConfig.context +'/api/admin/order/getBillByOrderNo',
  225. data: {
  226. orderNo:this.props.datauser.orderNo,
  227. },
  228. success: function (data) {
  229. let theArr = [];
  230. if (!data.data) {
  231. if (data.error && data.error.length) {
  232. message.warning(data.error[0].message);
  233. };
  234. } else {
  235. for (let i = 0; i < data.data.length; i++) {
  236. let thisdata = data.data[i];
  237. theArr.push({
  238. key: i,
  239. billNo: thisdata.billNo,
  240. transactionAmount:thisdata.transactionAmount,
  241. createTime:thisdata.createTime,
  242. transactionAmount:thisdata.transactionAmount,
  243. payerName:thisdata.payerName,
  244. payeeName:thisdata.payeeName,
  245. transactionSubject:thisdata.transactionSubject,
  246. transactionChannel:thisdata.transactionChannel,
  247. financialPayNo:thisdata.financialPayNo,
  248. financialPayTime:thisdata.financialPayTime,
  249. orderNo:thisdata.orderNo,
  250. departmentName:thisdata.departmentName,
  251. salesmanName:thisdata.salesmanName,
  252. financeName:thisdata.financeName,
  253. confirmSign:thisdata.confirmSign,
  254. deleteSign:thisdata.deleteSign,
  255. confirmTime:thisdata.confirmTime
  256. });
  257. };
  258. };
  259. this.setState({
  260. lookflowList: theArr,
  261. });
  262. }.bind(this),
  263. }).always(function () {
  264. this.setState({
  265. loading: false
  266. });
  267. }.bind(this));
  268. },
  269. lookCancel(){
  270. this.setState({
  271. lookVisible:false
  272. })
  273. },
  274. tableRowClick(record, index) {
  275. this.setState({
  276. editFw:record,
  277. addnextVisible:true,
  278. });
  279. },
  280. componentWillMount() {
  281. },
  282. componentWillReceiveProps(nextProps) { //props改变时触发
  283. this.state.visible = nextProps.showDesc;
  284. if(nextProps.userDetaile && nextProps.showDesc ) {
  285. this.loaduser(nextProps.datauser);
  286. this.loadData(nextProps.datauser);
  287. }
  288. },
  289. render() {
  290. const FormItem = Form.Item
  291. const formItemLayout = {
  292. labelCol: { span: 8 },
  293. wrapperCol: { span: 14 },
  294. };
  295. const editFws=this.state.editFw || [];
  296. const orderDetaiel=this.state.orderList || [];
  297. return(
  298. <div>
  299. <Modal maskClosable={false} visible={this.state.visible}
  300. onOk={this.handleOk} onCancel={this.handleCancel}
  301. width='1000px'
  302. title='订单详情'
  303. footer=''
  304. className="admin-desc-content">
  305. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  306. <Spin spinning={this.state.loading}>
  307. <div className="clearfix">
  308. <div className="clearfix">
  309. <FormItem className="half-item"
  310. {...formItemLayout}
  311. label="订单编号" >
  312. <span>{orderDetaiel.orderNo}</span>
  313. </FormItem>
  314. <FormItem className="half-item"
  315. {...formItemLayout}
  316. label="下单时间" >
  317. <span>{orderDetaiel.createTime}</span>
  318. </FormItem>
  319. <FormItem className="half-item"
  320. {...formItemLayout}
  321. label="客户名称" >
  322. <span>{orderDetaiel.buyerName}</span>
  323. </FormItem>
  324. <FormItem className="half-item"
  325. {...formItemLayout}
  326. label="订单类型" >
  327. <span>{getOrderType(orderDetaiel.orderType)}</span>
  328. </FormItem>
  329. <FormItem className="half-item"
  330. {...formItemLayout}
  331. label="订单渠道" >
  332. <span>{getOrderChannel(orderDetaiel.orderChannel)}</span>
  333. </FormItem>
  334. <FormItem className="half-item"
  335. {...formItemLayout}
  336. label="订单状态" >
  337. <span>{getOrderState(orderDetaiel.orderStatus)}</span>
  338. </FormItem>
  339. <FormItem className="half-item"
  340. {...formItemLayout}
  341. label="已收款项" >
  342. <span>{orderDetaiel.actuallyTotalAmount+'万元'}</span>
  343. </FormItem>
  344. <FormItem className="half-item"
  345. {...formItemLayout}
  346. label="结算状态" >
  347. <span>{getPaymentState(orderDetaiel.liquidationStatus)}</span>
  348. </FormItem>
  349. <FormItem className="half-item"
  350. {...formItemLayout}
  351. label="市价订单金额" >
  352. <span>{orderDetaiel.orderAmount+'万元'}</span>
  353. </FormItem>
  354. <FormItem className="half-item"
  355. {...formItemLayout}
  356. label="市价首款金额" >
  357. <span>{orderDetaiel.firstPayment+'万元'}</span>
  358. </FormItem>
  359. <div className='clearfix'>
  360. <FormItem className="half-item"
  361. {...formItemLayout}
  362. label="实签订单金额" >
  363. <span>{orderDetaiel.signTotalAmount+'万元'}</span>
  364. </FormItem>
  365. <FormItem className="half-item"
  366. {...formItemLayout}
  367. label="实签首款金额" >
  368. <span>{orderDetaiel.signFirstPayment+'万元'}</span>
  369. </FormItem>
  370. <FormItem className="half-item"
  371. {...formItemLayout}
  372. label="特批立项" >
  373. <span>{getApprovedState(orderDetaiel.approval)}</span>
  374. </FormItem>
  375. <FormItem className="half-item"
  376. {...formItemLayout}
  377. label="合同编号" >
  378. <span>{orderDetaiel.contractNo}</span>
  379. </FormItem>
  380. <div className='clearfix'>
  381. <FormItem
  382. labelCol={{ span: 4 }}
  383. wrapperCol={{ span: 16 }}
  384. label="订单留言" >
  385. <span>{orderDetaiel.orderRemarks}</span>
  386. </FormItem>
  387. </div>
  388. </div>
  389. </div>
  390. <div className='clearfix'>
  391. <FormItem className="half-item"
  392. {...formItemLayout}
  393. label="订单负责人" >
  394. <span>{orderDetaiel.salesmanName}</span>
  395. </FormItem>
  396. <FormItem className="half-item"
  397. {...formItemLayout}
  398. label="业务品类" >
  399. <span>{orderDetaiel.projectType}</span>
  400. </FormItem>
  401. </div>
  402. <div className='clearfix'>
  403. <FormItem className="half-item"
  404. {...formItemLayout}
  405. label="意向时间" >
  406. <span>{orderDetaiel.createTime}</span>
  407. </FormItem>
  408. <FormItem className="half-item"
  409. {...formItemLayout}
  410. label="签单时间" >
  411. <span>{orderDetaiel.signTime}</span>
  412. </FormItem>
  413. <FormItem className="half-item"
  414. {...formItemLayout}
  415. label="财务负责人" >
  416. <span>{orderDetaiel.financeName}</span>
  417. <Button onClick={this.lookflow} style={{float:'right'}}>查看流水</Button>
  418. </FormItem>
  419. <FormItem className="half-item"
  420. {...formItemLayout}
  421. label="项目负责人" >
  422. <span>{orderDetaiel.technicianName}</span>
  423. </FormItem>
  424. <FormItem className="half-item"
  425. {...formItemLayout}
  426. label="立项时间" >
  427. <span>{orderDetaiel.setUpTime}</span>
  428. </FormItem>
  429. <FormItem className="half-item"
  430. {...formItemLayout}
  431. label="项目状态" >
  432. <span>{getProjectState(orderDetaiel.projectStage)}</span>
  433. </FormItem>
  434. </div>
  435. <div>
  436. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目业务</span>
  437. </div>
  438. <div className="patent-table">
  439. <Spin spinning={this.state.loading}>
  440. <Table size="middle" columns={this.state.columns}
  441. dataSource={this.state.dataSource}
  442. pagination={false}
  443. onRowClick={this.tableRowClick}
  444. />
  445. </Spin>
  446. </div>
  447. </div>
  448. </Spin>
  449. </Form >
  450. </Modal>
  451. <Modal maskClosable={false} visible={this.state.addnextVisible}
  452. onOk={this.nextCancel} onCancel={this.nextCancel}
  453. width='550px'
  454. title='查看明细服务'
  455. footer=''
  456. className="admin-desc-content">
  457. <Form layout="horizontal" id="demand-form">
  458. <Spin spinning={this.state.loading}>
  459. <div className="clearfix">
  460. <FormItem className="half-item"
  461. {...formItemLayout}
  462. label="服务名称" >
  463. <span>{editFws.commodityName}</span>
  464. </FormItem>
  465. <FormItem className="half-item"
  466. {...formItemLayout}
  467. label="市场价格" >
  468. <span>{editFws.commodityPrice}</span>
  469. </FormItem>
  470. <FormItem className="half-item"
  471. {...formItemLayout}
  472. label="实签价格" >
  473. <span>{editFws.discountPrice+'万元'}</span>
  474. </FormItem>
  475. <FormItem className="half-item"
  476. {...formItemLayout}
  477. label="服务数量" >
  478. <span>{editFws.commodityQuantity}</span>
  479. </FormItem>
  480. <FormItem className="half-item"
  481. {...formItemLayout}
  482. label="市场首付金额" >
  483. <span>{editFws.commodityFirstPayment+'万元'}</span>
  484. </FormItem>
  485. <FormItem className="half-item"
  486. {...formItemLayout}
  487. label="签单首付金额" >
  488. <span>{editFws.discountFirstPayment+'万元'}</span>
  489. </FormItem>
  490. <div className='clearfix'>
  491. <FormItem
  492. labelCol={{ span: 4 }}
  493. wrapperCol={{ span: 16 }}
  494. label="服务说明" >
  495. <span>{editFws.remarks}</span>
  496. </FormItem>
  497. </div>
  498. </div>
  499. </Spin>
  500. </Form >
  501. </Modal>
  502. <Modal maskClosable={false} visible={this.state.lookVisible}
  503. onOk={this.lookCancel} onCancel={this.lookCancel}
  504. width='1300px'
  505. title= '查看流水'
  506. footer=''
  507. className="admin-desc-content">
  508. <Form layout="horizontal" id="demand-form">
  509. <Spin spinning={this.state.loading}>
  510. <div className="clearfix">
  511. <Table size="middle" columns={this.state.flowList}
  512. dataSource={this.state.lookflowList}
  513. pagination={false}
  514. />
  515. </div>
  516. </Spin>
  517. </Form >
  518. </Modal>
  519. </div>
  520. )
  521. }
  522. }));
  523. export default ManagementDetaile;