managementDetaile.jsx 17 KB

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