orderInfor.jsx 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. import React,{Component} from "react";
  2. import {Button, Col, DatePicker, Form, Input, message, Modal, Select, Spin, Table, Tag, Tooltip} from "antd";
  3. import {getApprovedState, getLiquidationStatus, getProcessStatus, getProjectName, splitUrl} from "../../../../tools";
  4. import moment from "moment";
  5. import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
  6. import PicturesWall from "../../../order/orderNew/changeComponent/picturesWall";
  7. import ImgList from "../../../../common/imgList";
  8. import $ from "jquery";
  9. const FormItem = Form.Item;
  10. const formItemLayout = {
  11. labelCol: { span: 8 },
  12. wrapperCol: { span: 14 },
  13. };
  14. class OrderInfor extends Component{
  15. constructor(props) {
  16. super(props);
  17. this.state={
  18. contactList:[],
  19. columns: [
  20. {
  21. title: "业务项目名称",
  22. dataIndex: "commodityName",
  23. key: "commodityName",
  24. render: (text, record) => {
  25. return (
  26. text + "-" + record.id
  27. )
  28. }
  29. },
  30. {
  31. title: "项目类别",
  32. dataIndex: "cname",
  33. key: "cname",
  34. },
  35. {
  36. title: "项目数量",
  37. dataIndex: "commodityQuantity",
  38. key: "commodityQuantity",
  39. render: (text, record) => {
  40. if (record.splitStatus == 1) {
  41. return (
  42. <span>
  43. {text}{" "}
  44. <Tag
  45. color="#108ee9"
  46. onClick={(e) => {
  47. e.stopPropagation();
  48. this.showRes(record);
  49. }}
  50. >
  51. 已拆
  52. </Tag>
  53. </span>
  54. );
  55. } else {
  56. return text;
  57. }
  58. },
  59. },
  60. {
  61. title: "金额(万元)",
  62. dataIndex: "commodityPrice",
  63. key: "commodityPrice",
  64. },
  65. {
  66. title: "负责人",
  67. dataIndex: "contacts",
  68. key: "contacts",
  69. },
  70. {
  71. title: "负责人电话",
  72. dataIndex: "contactsMobile",
  73. key: "contactsMobile",
  74. },
  75. {
  76. title: "项目状态",
  77. dataIndex: "projectStatus",
  78. key: "projectStatus",
  79. render: (text) => {
  80. return getProjectName(text);
  81. },
  82. },
  83. {
  84. title: "主要项目",
  85. dataIndex: "main",
  86. key: "main",
  87. render: (text) => {
  88. return text ? "是" : "否";
  89. },
  90. },
  91. {
  92. title: "项目说明",
  93. dataIndex: "taskComment",
  94. key: "taskComment",
  95. render: (text) => {
  96. return (
  97. <Tooltip title={text}>
  98. <div style={{
  99. maxWidth:'100px',
  100. overflow:'hidden',
  101. textOverflow: "ellipsis",
  102. whiteSpace:'nowrap',
  103. }}>{text}</div>
  104. </Tooltip>
  105. );
  106. },
  107. },
  108. ]
  109. }
  110. this.loaduser = this.loaduser.bind(this);
  111. this.jiedian = this.jiedian.bind(this);
  112. this.loadData = this.loadData.bind(this);
  113. }
  114. componentDidMount() {
  115. this.loaduser();
  116. this.jiedian();
  117. this.loadData();
  118. }
  119. //查看项目列表
  120. loadData(record) {
  121. this.setState({
  122. loading: true,
  123. });
  124. $.ajax({
  125. method: "get",
  126. dataType: "json",
  127. crossDomain: false,
  128. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  129. data: {
  130. orderNo: this.props.orderNo
  131. },
  132. success: function (data) {
  133. let theArr = [];
  134. if (!data.data) {
  135. if (data.error && data.error.length) {
  136. message.warning(data.error[0].message);
  137. }
  138. } else {
  139. for (let i = 0; i < data.data.length; i++) {
  140. let thisdata = data.data[i];
  141. thisdata.key = i;
  142. thisdata.sort = thisdata.cSort;
  143. thisdata.declarationBatch = thisdata.declarationBatch || undefined;//申报批次
  144. thisdata.ifCertificationFee = isNaN(parseInt(thisdata.ifCertificationFee)) ? undefined : thisdata.ifCertificationFee;//是否包含申报批次
  145. theArr.push(thisdata);
  146. }
  147. }
  148. this.setState({
  149. dataSource: theArr,
  150. });
  151. }.bind(this),
  152. }).always(
  153. function () {
  154. this.setState({
  155. loading: false,
  156. });
  157. }.bind(this)
  158. );
  159. }
  160. loaduser() {
  161. $.ajax({
  162. method: "get",
  163. dataType: "json",
  164. crossDomain: false,
  165. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  166. data: {
  167. orderNo: this.props.orderNo,
  168. },
  169. success: function (data) {
  170. let thisData = data.data;
  171. if (!thisData) {
  172. if (data.error && data.error.length) {
  173. message.warning(data.error[0].message);
  174. }
  175. thisData = {};
  176. }
  177. if (thisData.approval == 2) {
  178. thisData.approval = "特批通过";
  179. } else if (thisData.approval == 3) {
  180. thisData.approval = "特批驳回";
  181. }
  182. this.setState({
  183. id: thisData.id,
  184. kehuId: thisData.buyerId,
  185. orderNo: thisData.orderNo, //订单编号
  186. orderType: thisData.orderType, //订单类型
  187. firstAmount: thisData.firstAmount, //首付金额
  188. totalAmount: thisData.totalAmount, //总金额
  189. settlementAmount: thisData.settlementAmount, //结算金额
  190. liquidationStatus: thisData.liquidationStatus, //清算状态
  191. processStatus: thisData.processStatus, //流程状态
  192. orderRemarks: thisData.orderRemarks, //订单备注
  193. contractNo: thisData.contractNo, //合同编号
  194. contacts: thisData.contacts, //联系人
  195. contactMobile: thisData.contactMobile, //联系人电话
  196. legalPerson: thisData.legalPerson, //法人
  197. legalPersonTel: thisData.legalPersonTel, //法人电话
  198. orgCodeUrl: thisData.contractPictureUrl
  199. ? splitUrl(
  200. thisData.contractPictureUrl,
  201. ",",
  202. globalConfig.avatarHost + "/upload"
  203. )
  204. : [], //图片地址
  205. replenishUrl: thisData.agreementUrl
  206. ? splitUrl(
  207. thisData.agreementUrl,
  208. ",",
  209. globalConfig.avatarHost + "/upload"
  210. )
  211. : [], //图片地址
  212. signDate: thisData.signDate, //签单时间
  213. userName: thisData.userName, //客户名称
  214. salesmanName: thisData.salesmanName, //营销员名称
  215. salesmanMobile: thisData.salesmanMobile, //营销员电话
  216. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  217. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  218. financeName: thisData.financeName, //财务名称
  219. financeMobile: thisData.financeMobile, //财务电话
  220. nowFinanceMobile: thisData.nowFinanceMobile,
  221. nowFinance: thisData.nowFinance,
  222. approval:
  223. thisData.approval == 0
  224. ? thisData.approval.toString()
  225. : thisData.approval,
  226. organizationSearch: thisData.orderDep,
  227. depName: thisData.depName,
  228. status: thisData.status,
  229. outsource: thisData.outsource,
  230. deleteSign:thisData.deleteSign,
  231. orderUid:thisData.uid,
  232. });
  233. }.bind(this),
  234. }).always(
  235. function () {
  236. this.setState({
  237. loading: false,
  238. });
  239. }.bind(this)
  240. );
  241. }
  242. jiedian() {
  243. this.setState({
  244. loadData: true,
  245. });
  246. $.ajax({
  247. method: "get",
  248. dataType: "json",
  249. crossDomain: false,
  250. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  251. data: {
  252. orderNo: this.props.orderNo,
  253. },
  254. success: function (data) {
  255. let theArr = [];
  256. let thisData = [];
  257. if (data.error.length || data.data.list == "") {
  258. if (data.error && data.error.length) {
  259. message.warning(data.error[0].message);
  260. }
  261. } else {
  262. for (let i = 0; i < data.data.length; i++) {
  263. thisData = data.data[i];
  264. theArr.push({
  265. key: i,
  266. dunSubject: thisData.dunSubject
  267. ? thisData.dunSubject.toString()
  268. : "", //催款科目
  269. id: thisData.id, //节点Id
  270. money: thisData.money, //催款金额
  271. dunStatus: thisData.dunStatus, //催款状态
  272. orderNo: thisData.orderNo,
  273. });
  274. }
  275. this.setState({
  276. contactList: theArr,
  277. });
  278. }
  279. }.bind(this),
  280. }).always(
  281. function () {
  282. this.setState({
  283. loading: false,
  284. });
  285. }.bind(this)
  286. );
  287. }
  288. render() {
  289. const formItemList = [
  290. {
  291. label: "企业联系人",
  292. content: <span>{this.state.contacts}</span>,
  293. },
  294. {
  295. label: "客户名称",
  296. content: <span>
  297. {this.state.userName}
  298. <EnterpriseNameChange
  299. type='journal'
  300. style={{ marginLeft: 10 }}
  301. enterpriseId={this.state.orderUid}/>
  302. </span>,
  303. },
  304. {
  305. label: "联系人电话",
  306. content: <span>{this.state.contactMobile}</span>,
  307. },
  308. {
  309. label: "企业法人",
  310. content: <span>{this.state.legalPerson}</span>,
  311. },
  312. {
  313. label: "法人电话",
  314. content: <span>{this.state.legalPersonTel}</span>,
  315. },
  316. ];
  317. return (
  318. <Modal
  319. maskClosable={false}
  320. visible={this.props.visible}
  321. onOk={this.props.onCancel}
  322. onCancel={this.props.onCancel}
  323. width={800}
  324. title='订单详情'
  325. footer=""
  326. className="admin-desc-content"
  327. >
  328. <div className="clearfix">
  329. <div className="clearfix">
  330. <FormItem
  331. className="half-item"
  332. {...formItemLayout}
  333. label="合同编号"
  334. >
  335. {<span>{this.state.contractNo}</span>}
  336. </FormItem>
  337. <FormItem
  338. className="half-item"
  339. {...formItemLayout}
  340. label="订单编号"
  341. >
  342. <span>{this.state.orderNo}</span>
  343. </FormItem>
  344. <FormItem
  345. className="half-item"
  346. {...formItemLayout}
  347. label="流程状态"
  348. >
  349. <span>
  350. {getProcessStatus(this.state.processStatus)}
  351. </span>
  352. </FormItem>
  353. <FormItem
  354. className="half-item"
  355. {...formItemLayout}
  356. label="结算状态"
  357. >
  358. <span>
  359. {getLiquidationStatus(
  360. this.state.liquidationStatus
  361. )}
  362. </span>
  363. </FormItem>
  364. <div className="clearfix">
  365. <FormItem
  366. className="half-item"
  367. {...formItemLayout}
  368. label="特批立项"
  369. >
  370. <span>
  371. {getApprovedState(this.state.approval)}
  372. </span>
  373. </FormItem>
  374. <FormItem
  375. className="half-item"
  376. {...formItemLayout}
  377. label="合同签订时间"
  378. >
  379. <span>{this.state.signDate}</span>
  380. </FormItem>
  381. <FormItem
  382. className="half-item"
  383. {...formItemLayout}
  384. label="订单部门"
  385. >
  386. <span>{this.state.depName}</span>
  387. </FormItem>
  388. <FormItem
  389. className="half-item"
  390. {...formItemLayout}
  391. label="是否外包"
  392. >
  393. <span>
  394. {this.state.outsource == 0 ? "否" : "是"}
  395. </span>
  396. </FormItem>
  397. </div>
  398. </div>
  399. <h3
  400. style={{
  401. marginLeft: 10,
  402. fontWeight: 800,
  403. marginBottom: 10,
  404. }}
  405. >
  406. 收款项目
  407. </h3>
  408. {this.state.processStatus === 0 ? (
  409. <div className="clearfix">
  410. <FormItem
  411. className="half-item"
  412. {...formItemLayout}
  413. label="签单金额(万元)"
  414. >
  415. <Input
  416. placeholder="签单金额"
  417. ref="totalAmountRef"
  418. value={this.state.totalAmount}
  419. onChange={(e) => {
  420. this.setState({
  421. totalAmount: e.target.value,
  422. });
  423. }}
  424. style={{ width: "240px" }}
  425. />
  426. </FormItem>
  427. <FormItem
  428. className="half-item"
  429. {...formItemLayout}
  430. label="首付金额(万元)"
  431. >
  432. <Input
  433. placeholder="请输入实签首款金额"
  434. ref="firstAmountRef"
  435. value={this.state.firstAmount}
  436. onChange={(e) => {
  437. this.setState({
  438. firstAmount: e.target.value,
  439. });
  440. }}
  441. style={{ width: "240px" }}
  442. />
  443. </FormItem>
  444. <FormItem
  445. className="half-item"
  446. {...formItemLayout}
  447. label="已收款项"
  448. >
  449. <span>
  450. {this.state.settlementAmount + "万元"}
  451. </span>
  452. </FormItem>
  453. </div>
  454. ) : (
  455. <div className="clearfix">
  456. <FormItem
  457. className="half-item"
  458. {...formItemLayout}
  459. label="签单金额(万元)"
  460. >
  461. <span>{this.state.totalAmount}</span>
  462. </FormItem>
  463. <FormItem
  464. className="half-item"
  465. {...formItemLayout}
  466. label="首付金额(万元)"
  467. >
  468. <span>{this.state.firstAmount}</span>
  469. </FormItem>
  470. <FormItem
  471. className="half-item"
  472. {...formItemLayout}
  473. label="已收款项"
  474. >
  475. <span>
  476. {this.state.settlementAmount + "万元"}
  477. </span>
  478. </FormItem>
  479. </div>
  480. )}
  481. <h3
  482. style={{
  483. marginLeft: 10,
  484. fontWeight: 800,
  485. marginBottom: 10,
  486. }}
  487. >
  488. 联系信息
  489. </h3>
  490. <div className="clearfix">
  491. {formItemList.map((data, index) => {
  492. return (
  493. <FormItem
  494. className="half-item"
  495. {...formItemLayout}
  496. key={index}
  497. label={data.label}
  498. >
  499. {data.content}
  500. </FormItem>
  501. );
  502. })}
  503. </div>
  504. <div className="clearfix">
  505. <div>
  506. <FormItem
  507. labelCol={{ span: 4 }}
  508. wrapperCol={{ span: 18 }}
  509. label="合同扫描件"
  510. >
  511. <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  512. {this.state.orgCodeUrl && this.state.visible && this.state.activeKey === '1'? <ImgList domId={'addService3'} fileList={this.state.orgCodeUrl} ItemWidth={'96px'}/> : <div/>}
  513. </div>
  514. <Modal
  515. maskClosable={false}
  516. footer={null}
  517. width={"50%"}
  518. visible={this.state.previewVisible}
  519. onCancel={() => {
  520. this.setState({
  521. previewVisible: false,
  522. rotateDeg: 0,
  523. });
  524. }}
  525. >
  526. <img
  527. alt=""
  528. style={{
  529. width: "100%",
  530. transform: `rotate(${this.state.rotateDeg}deg)`,
  531. }}
  532. src={this.state.previewImage || ""}
  533. />
  534. <Button
  535. onClick={this.rotate}
  536. style={{
  537. position: "relative",
  538. left: "50%",
  539. transform: "translateX(-50%)",
  540. }}
  541. >
  542. 旋转
  543. </Button>
  544. <Button
  545. onClick={this.upImg}
  546. style={{
  547. position: "absolute",
  548. left: -81,
  549. top: "50%",
  550. transform: "translateY(-50%)",
  551. }}
  552. >
  553. 上一张
  554. </Button>
  555. <Button
  556. onClick={this.downImg}
  557. style={{
  558. position: "absolute",
  559. right: -81,
  560. top: "50%",
  561. transform: "translateY(-50%)",
  562. }}
  563. >
  564. 下一张
  565. </Button>
  566. </Modal>
  567. <Button
  568. style={{
  569. float: "right",
  570. marginRight: "140px",
  571. marginTop: "20px",
  572. }}
  573. onClick={this.getOrderLog}
  574. >
  575. 查看订单日志
  576. </Button>
  577. </FormItem>
  578. <FormItem
  579. labelCol={{ span: 4 }}
  580. wrapperCol={{ span: 18 }}
  581. label="补充协议"
  582. >
  583. {/*<Upload*/}
  584. {/* className="demandDetailShow-upload"*/}
  585. {/* listType="picture-card"*/}
  586. {/* fileList={this.state.replenishUrl}*/}
  587. {/* onPreview={(file) => {*/}
  588. {/* this.setState({*/}
  589. {/* previewImage: file.url || file.thumbUrl,*/}
  590. {/* previewVisibles: true,*/}
  591. {/* });*/}
  592. {/* }}*/}
  593. {/*/>*/}
  594. <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  595. {
  596. this.state.visible && this.state.activeKey === '1' && this.state.replenishUrl?
  597. <ImgList domId={'addService4'} fileList={this.state.replenishUrl} ItemWidth={'96px'}/> :
  598. <div/>
  599. }
  600. </div>
  601. <Modal
  602. maskClosable={false}
  603. footer={null}
  604. width={"50%"}
  605. visible={this.state.previewVisibles}
  606. onCancel={() => {
  607. this.setState({
  608. previewVisibles: false,
  609. rotateDeg: 0,
  610. });
  611. }}
  612. >
  613. <img
  614. alt=""
  615. style={{
  616. width: "100%",
  617. transform: `rotate(${this.state.rotateDeg}deg)`,
  618. }}
  619. src={this.state.previewImage || ""}
  620. />
  621. <Button
  622. onClick={this.rotates}
  623. style={{
  624. position: "relative",
  625. left: "50%",
  626. transform: "translateX(-50%)",
  627. }}
  628. >
  629. 旋转
  630. </Button>
  631. <Button
  632. onClick={this.upImgs}
  633. style={{
  634. position: "absolute",
  635. left: -81,
  636. top: "50%",
  637. transform: "translateY(-50%)",
  638. }}
  639. >
  640. 上一张
  641. </Button>
  642. <Button
  643. onClick={this.downImgs}
  644. style={{
  645. position: "absolute",
  646. right: -81,
  647. top: "50%",
  648. transform: "translateY(-50%)",
  649. }}
  650. >
  651. 下一张
  652. </Button>
  653. </Modal>
  654. </FormItem>
  655. </div>
  656. </div>
  657. <div className="clearfix">
  658. <FormItem
  659. labelCol={{ span: 4 }}
  660. wrapperCol={{ span: 16 }}
  661. label="订单留言"
  662. >
  663. <p
  664. style={{ width: 500, wordWrap: "break-word" }}
  665. >
  666. {this.state.orderRemarks}
  667. </p>
  668. </FormItem>
  669. </div>
  670. <div className="clearfix">
  671. <FormItem
  672. className="half-item"
  673. {...formItemLayout}
  674. label="订单负责人"
  675. >
  676. <span>{this.state.salesmanName}</span>
  677. </FormItem>
  678. <FormItem
  679. className="half-item"
  680. {...formItemLayout}
  681. label="订单负责人电话"
  682. >
  683. <span>{this.state.salesmanMobile}</span>
  684. </FormItem>
  685. </div>
  686. <div className="clearfix">
  687. <FormItem
  688. className="half-item"
  689. {...formItemLayout}
  690. label="当前财务负责人"
  691. >
  692. <span>{this.state.nowFinance}</span>
  693. </FormItem>
  694. <FormItem
  695. className="half-item"
  696. {...formItemLayout}
  697. label="当前财务负责人电话"
  698. >
  699. <span>{this.state.nowFinanceMobile}</span>
  700. </FormItem>
  701. </div>
  702. <div className="clearfix">
  703. <FormItem
  704. className="half-item"
  705. {...formItemLayout}
  706. style={{ opacity: ".5" }}
  707. label="原订单负责人"
  708. >
  709. <span>{this.state.oldSalesmanName}</span>
  710. </FormItem>
  711. <FormItem
  712. className="half-item"
  713. {...formItemLayout}
  714. style={{ opacity: ".5" }}
  715. label="原订单负责人电话"
  716. >
  717. <span>{this.state.oldSalesmanMobile}</span>
  718. </FormItem>
  719. </div>
  720. <div className="clearfix">
  721. <FormItem
  722. className="half-item"
  723. style={{ opacity: ".5" }}
  724. {...formItemLayout}
  725. label="实际财务操作人"
  726. >
  727. <span>{this.state.financeName}</span>
  728. </FormItem>
  729. <FormItem
  730. className="half-item"
  731. {...formItemLayout}
  732. style={{ opacity: ".5" }}
  733. label="实际财务操作人电话"
  734. >
  735. <span>{this.state.financeMobile}</span>
  736. </FormItem>
  737. </div>
  738. <div>
  739. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  740. 项目业务
  741. </span>
  742. </div>
  743. <div
  744. className="patent-table"
  745. style={{ marginBottom: 10 }}
  746. >
  747. <Spin spinning={this.state.loading}>
  748. <Table
  749. columns={this.state.columns}
  750. scroll={{ x: "max-content", y: 0 }}
  751. dataSource={this.state.dataSource}
  752. pagination={false}
  753. onRowClick={this.tableRowClick}
  754. bordered
  755. size="small"
  756. />
  757. </Spin>
  758. </div>
  759. </div>
  760. </Modal>
  761. )
  762. }
  763. }
  764. export default OrderInfor;