managementDetaile.jsx 16 KB

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