approveOrderDetaile.jsx 17 KB

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