orderInfor.jsx 34 KB

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