contractJsy.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443
  1. import React from "react";
  2. import { Button, Input, Spin, Table, message, Form, Modal, Tabs, Tag, Tooltip } from "antd";
  3. import $ from "jquery/src/ajax";
  4. import {
  5. getNewOrderStatus,
  6. getProcessStatusNew,
  7. splitUrl,
  8. getjiedian,
  9. getboutique,
  10. getCuikuan,
  11. getProjectStatus,
  12. ShowModal,
  13. getType
  14. } from "@/tools.js";
  15. import "./customer.less";
  16. import { ChangeDetail } from "./changeComponent/changeDetailJsy.js";
  17. import { SearchInput } from "./changeComponent/searchInput.js";
  18. import OrderDetail from "./changeComponent/orderDetail";
  19. import ShowModalDiv from "@/showModal.jsx";
  20. import OrderRiZi from "@/orderRiZi.jsx";
  21. import { ChooseList } from "./chooseList";
  22. import { getProjectName } from "../../../tools";
  23. import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
  24. import OrderItemStatus from '../../../../component/common/orderItemStatus';
  25. import Cascaders from "../../../common/cascaders";
  26. const contractChange = Form.create()(
  27. React.createClass({
  28. loadData(pageNo) {
  29. this.setState({
  30. loading: true
  31. });
  32. $.ajax({
  33. method: "get",
  34. dataType: "json",
  35. crossDomain: false,
  36. url: globalConfig.context + "/api/admin/orderChange/orderChangeList",
  37. data: {
  38. pageNo: pageNo || this.state.page || 1,
  39. pageSize: this.state.pagination.pageSize,
  40. userName: this.state.searchData.userNameSearch,
  41. orderNo: this.state.searchData.orderNoSearch,
  42. contractNo: this.state.searchData.contractNoSearch,
  43. processState: this.props.processState,
  44. timeType: this.state.searchData.timeTypeSearch,
  45. startTime: this.state.searchData.releaseDate[0],
  46. endTime: this.state.searchData.releaseDate[1],
  47. salesmanName: this.state.searchData.salesmanNameSearch,
  48. complete: this.state.searchData.completeSearch || 1,
  49. deps: this.state.searchData.deps,
  50. type: this.state.searchData.changeSearch
  51. },
  52. success: function (data) {
  53. ShowModal(this);
  54. let theArr = [];
  55. if (data.error.length || data.data.list == "") {
  56. if (data.error && data.error.length) {
  57. message.warning(data.error[0].message);
  58. }
  59. } else {
  60. for (let i = 0; i < data.data.list.length; i++) {
  61. let thisdata = data.data.list[i];
  62. theArr.push({
  63. key: i,
  64. orderNo: thisdata.orderNo,
  65. createTimes: thisdata.createTimes,
  66. nickname: thisdata.nickname,
  67. orderType: thisdata.orderType,
  68. establishTimes: thisdata.establishTimes,
  69. orderStatus: thisdata.orderStatus,
  70. totalAmount: thisdata.totalAmount,
  71. settlementAmount: thisdata.settlementAmount,
  72. arrears: thisdata.arrears,
  73. salesmanName: thisdata.salesmanName,
  74. depName: thisdata.depName,
  75. processState: thisdata.processState,
  76. type: thisdata.type,
  77. status: thisdata.status,
  78. id: thisdata.id,
  79. contractNo: thisdata.contractNo,
  80. processStateText: getProcessStatusNew(
  81. thisdata.processState,
  82. thisdata.status
  83. )
  84. });
  85. }
  86. this.state.pagination.total = data.data.totalCount;
  87. this.state.pagination.current = data.data.pageNo;
  88. }
  89. if (data.data && data.data.list && !data.data.list.length) {
  90. this.state.pagination.total = 0;
  91. }
  92. this.setState({
  93. dataSource: theArr,
  94. pageNo: pageNo,
  95. pagination: this.state.pagination
  96. });
  97. }.bind(this)
  98. }).always(
  99. function () {
  100. this.setState({
  101. loading: false
  102. });
  103. }.bind(this)
  104. );
  105. },
  106. getInitialState() {
  107. return {
  108. page: 1,
  109. searchData: {
  110. releaseDate: []
  111. },
  112. primaryOrderData: {}, //原订单数据
  113. orderData: {}, //现订单数据
  114. pictureUrl: [],
  115. voucherUrl: [],
  116. attachment: [],
  117. declarationBatch: 1,
  118. dataInfor: {},
  119. attachmentUrl: [],
  120. contractData: {},
  121. additionalOrderData: {},
  122. paginations: false,
  123. activeKey: "a",
  124. confirmLoading: false,
  125. aloading: false,
  126. pagination: {
  127. defaultCurrent: 1,
  128. defaultPageSize: 10,
  129. showQuickJumper: true,
  130. pageSize: 10,
  131. onChange: function (page) {
  132. this.loadData(page);
  133. this.setState({
  134. page
  135. });
  136. }.bind(this),
  137. showTotal: function (total) {
  138. return "共" + total + "条数据";
  139. }
  140. },
  141. columns: [
  142. {
  143. title: "合同编号",
  144. dataIndex: "contractNo",
  145. key: "contractNo"
  146. },
  147. {
  148. title: "订单编号",
  149. dataIndex: "orderNo",
  150. key: "orderNo"
  151. },
  152. {
  153. title: "客户名称",
  154. dataIndex: "nickname",
  155. key: "nickname",
  156. width: 150,
  157. render: (text) => {
  158. return (
  159. <Tooltip title={text}>
  160. <div style={{
  161. maxWidth: '150px',
  162. overflow: 'hidden',
  163. textOverflow: "ellipsis",
  164. whiteSpace: 'nowrap',
  165. }}>{text}</div>
  166. </Tooltip>
  167. )
  168. },
  169. },
  170. {
  171. title: "订单部门",
  172. dataIndex: "depName",
  173. key: "depName"
  174. },
  175. {
  176. title: "订单类型",
  177. dataIndex: "orderType",
  178. key: "orderType",
  179. render: text => {
  180. return text ? "科技项目" : "认证项目";
  181. }
  182. },
  183. {
  184. title: "下单时间",
  185. dataIndex: "establishTimes",
  186. key: "establishTimes"
  187. },
  188. {
  189. title: "订单状态",
  190. dataIndex: "orderStatus",
  191. key: "orderStatus",
  192. render: text => {
  193. return getNewOrderStatus(text);
  194. }
  195. },
  196. {
  197. title: "合同额(万元)",
  198. dataIndex: "totalAmount",
  199. key: "totalAmount"
  200. },
  201. {
  202. title: "已付额(万元)",
  203. dataIndex: "settlementAmount",
  204. key: "settlementAmount"
  205. },
  206. {
  207. title: "欠款(万元)",
  208. dataIndex: "arrears",
  209. key: "arrears"
  210. },
  211. {
  212. title: "订单负责人",
  213. dataIndex: "salesmanName",
  214. key: "salesmanName"
  215. },
  216. {
  217. title: "变更类型",
  218. dataIndex: "type",
  219. key: "type",
  220. render: text => {
  221. return getType(text);
  222. }
  223. },
  224. {
  225. title: "审核状态",
  226. dataIndex: "processStateText",
  227. key: "processStateText"
  228. },
  229. {
  230. title: "提交时间",
  231. dataIndex: "createTimes",
  232. key: "createTimes"
  233. }
  234. ],
  235. dataSource: [],
  236. // 传递给子组件的
  237. dataProps: [],
  238. columnsX: [
  239. {
  240. title: "业务项目名称",
  241. dataIndex: "commodityName",
  242. key: "commodityName",
  243. render: (text, record) => {
  244. return (
  245. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  246. )
  247. }
  248. },
  249. {
  250. title: "项目类别",
  251. dataIndex: "cname",
  252. key: "cname"
  253. },
  254. {
  255. title: "项目数量",
  256. dataIndex: "commodityQuantity",
  257. key: "commodityQuantity"
  258. },
  259. {
  260. title: "金额(万元)",
  261. dataIndex: "commodityPrice",
  262. key: "commodityPrice"
  263. },
  264. {
  265. title: "负责人",
  266. dataIndex: "contacts",
  267. key: "contacts"
  268. },
  269. {
  270. title: "负责人电话",
  271. dataIndex: "contactsMobile",
  272. key: "contactsMobile"
  273. },
  274. {
  275. title: "项目状态",
  276. dataIndex: "projectStatus",
  277. key: "projectStatus",
  278. render: text => {
  279. return getProjectName(text);
  280. }
  281. },
  282. {
  283. title: "主要项目",
  284. dataIndex: "main",
  285. key: "main",
  286. render: text => {
  287. return text ? "是" : "否";
  288. }
  289. },
  290. {
  291. title: "总年限",
  292. dataIndex: "yearSum",
  293. key: "yearSum",
  294. render: (text, record) => {
  295. return (
  296. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  297. );
  298. }
  299. },
  300. {
  301. title: "年限",
  302. dataIndex: "serviceLife",
  303. key: "serviceLife",
  304. render: (text, record) => {
  305. return (
  306. <div>{!!text && JSON.parse(text).toString()}</div>
  307. );
  308. }
  309. },
  310. {
  311. title: "本次派单",
  312. dataIndex: "serviceYear",
  313. key: "serviceYear",
  314. render: (text, record) => {
  315. return (
  316. <div>{!text ? "" : text}</div>
  317. );
  318. }
  319. },
  320. {
  321. title: "项目说明",
  322. dataIndex: "taskComment",
  323. key: "taskComment",
  324. render: text => {
  325. return (
  326. <Tooltip title={text}>
  327. <div
  328. style={{
  329. width: 100,
  330. overflow: "hidden",
  331. whiteSpace: "nowrap",
  332. textOverflow: "ellipsis",
  333. }}
  334. >{text}</div>
  335. </Tooltip>
  336. )
  337. }
  338. }
  339. ],
  340. columnsrizhi: [
  341. {
  342. title: "流程",
  343. dataIndex: "processName",
  344. key: "processName"
  345. },
  346. {
  347. title: "操作人",
  348. dataIndex: "adminName",
  349. key: "adminName"
  350. },
  351. {
  352. title: "时间",
  353. dataIndex: "createDate",
  354. key: "createDate"
  355. }
  356. ],
  357. dataSourceX: [],
  358. ContactsLists: [
  359. {
  360. title: "催款科目",
  361. dataIndex: "dunSubject",
  362. key: "dunSubject",
  363. render: text => {
  364. return getjiedian(text);
  365. }
  366. },
  367. {
  368. title: "金额(万元)",
  369. dataIndex: "money",
  370. key: "money"
  371. },
  372. {
  373. title: "催款状态",
  374. dataIndex: "dunStatus",
  375. key: "dunStatus",
  376. render: text => {
  377. return getCuikuan(text);
  378. }
  379. }
  380. ]
  381. };
  382. },
  383. //页面加载函数
  384. componentWillMount() {
  385. this.loadData();
  386. },
  387. //整行点击
  388. tableRowClick(record) {
  389. this.setState(
  390. {
  391. visible: true,
  392. type: record.type,
  393. status: record.status,
  394. buttonStatus: true,
  395. orderStatus: record.orderStatus,
  396. processStateText: record.processStateText,
  397. id: record.id,
  398. orderNo: record.orderNo
  399. },
  400. () => {
  401. this.xiangqing(record.orderNo);
  402. this.xiangmu(record.orderNo);
  403. this.jiedian(record.orderNo);
  404. this.jiedianNew(record.orderNo);
  405. this.createTabs();
  406. }
  407. );
  408. },
  409. createTabs() {
  410. $.ajax({
  411. url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
  412. method: "get",
  413. data: {
  414. orderNo: this.state.orderNo
  415. },
  416. success: data => {
  417. if (data.error && data.error.length) {
  418. message.warning(data.error[0].message);
  419. } else {
  420. this.setState({
  421. tabList: data.data
  422. });
  423. }
  424. }
  425. });
  426. },
  427. //点击打卡项目详情
  428. tableRowClickX(record) {
  429. this.setState({
  430. jid: record.id, //项目ID
  431. kid: record.commodityId, //商品ID
  432. commodityName: record.commodityName, //金额
  433. commodityPrice: record.commodityPrice, //金额
  434. commodityQuantity: record.commodityQuantity, //数量
  435. taskComment: record.taskComment, //备注
  436. main: record.main.toString(), //是否为主要
  437. addnextVisible: true,
  438. dataInfor: record,
  439. addState: 0
  440. });
  441. },
  442. //项目详情关闭
  443. nextCancel() {
  444. this.setState({
  445. addnextVisible: false
  446. });
  447. },
  448. // 合同变更详情
  449. ChangeDetail(key) {
  450. let url = window.location.href.substring(7);
  451. $.ajax({
  452. method: "get",
  453. dataType: "json",
  454. crossDomain: false,
  455. url:
  456. globalConfig.context +
  457. "/api/admin/orderChange/orderChangeDetailsById",
  458. data: {
  459. id: key
  460. },
  461. success: function (data) {
  462. if (data.data) {
  463. let thisdata = data.data;
  464. Object.assign(thisdata, {
  465. processStateText: this.state.processStateText,
  466. userName: this.state.userName,
  467. contractNo: this.state.contractNo
  468. });
  469. this.setState({
  470. contractData: thisdata,
  471. voucherUrl: thisdata.voucherUrl
  472. ? splitUrl(
  473. thisdata.voucherUrl,
  474. ",",
  475. globalConfig.avatarHost + "/upload",
  476. url
  477. )
  478. : [],
  479. attachment: thisdata.attachmentUrl
  480. ? splitUrl(
  481. thisdata.attachmentUrl,
  482. ",",
  483. globalConfig.avatarHost + "/upload",
  484. url
  485. )
  486. : [],
  487. contractPictureUrl: thisdata.contractPictureUrl
  488. ? splitUrl(
  489. thisdata.contractPictureUrl,
  490. ",",
  491. globalConfig.avatarHost + "/upload",
  492. url
  493. )
  494. : []
  495. });
  496. }
  497. }.bind(this)
  498. });
  499. },
  500. //订单详情
  501. xiangqing(orderNos) {
  502. $.ajax({
  503. method: "get",
  504. dataType: "json",
  505. crossDomain: false,
  506. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  507. data: {
  508. orderNo: orderNos
  509. },
  510. success: function (data) {
  511. if (data.error.length || data.data.list == "") {
  512. if (data.error && data.error.length) {
  513. message.warning(data.error[0].message);
  514. }
  515. } else {
  516. let thisdata = data.data;
  517. this.setState({
  518. orderUid: thisdata.uid,
  519. userName: thisdata.userName,
  520. primaryOrderNo: thisdata.primaryOrder,
  521. additionalOrder: thisdata.additionalOrder,
  522. contractNo: thisdata.contractNo,
  523. // arrears: thisdata.arrears,
  524. orderData: thisdata,
  525. isAddition: thisdata.additionalOrder ? true : false,
  526. deleteSign: thisdata.deleteSign,
  527. });
  528. }
  529. }.bind(this)
  530. });
  531. },
  532. // 原订单数据
  533. primaryOrder(primaryOrder) {
  534. $.ajax({
  535. method: "get",
  536. dataType: "json",
  537. crossDomain: false,
  538. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  539. data: {
  540. orderNo: primaryOrder
  541. },
  542. success: function (data) {
  543. if (data.error.length || data.data.list == "") {
  544. if (data.error && data.error.length) {
  545. message.warning(data.error[0].message);
  546. }
  547. } else {
  548. let thisdata = data.data;
  549. this.setState({
  550. primaryOrderData: thisdata
  551. });
  552. }
  553. }.bind(this)
  554. });
  555. },
  556. // 附加订单数据
  557. additionalOrder(additionalOrder) {
  558. $.ajax({
  559. method: "get",
  560. dataType: "json",
  561. crossDomain: false,
  562. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  563. data: {
  564. orderNo: additionalOrder
  565. },
  566. success: function (data) {
  567. if (data.error.length || data.data.list == "") {
  568. if (data.error && data.error.length) {
  569. message.warning(data.error[0].message);
  570. }
  571. } else {
  572. let thisdata = data.data;
  573. this.setState({
  574. additionalOrderData: thisdata
  575. });
  576. }
  577. }.bind(this)
  578. });
  579. },
  580. //项目列表
  581. xiangmu(orderNos) {
  582. $.ajax({
  583. method: "get",
  584. dataType: "json",
  585. crossDomain: false,
  586. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  587. data: {
  588. orderNo: orderNos
  589. },
  590. success: function (data) {
  591. let theArr = [];
  592. if (data.error.length || data.data.list == "") {
  593. if (data.error && data.error.length) {
  594. message.warning(data.error[0].message);
  595. }
  596. } else {
  597. for (let i = 0; i < data.data.length; i++) {
  598. let thisdata = data.data[i];
  599. thisdata.key = i;
  600. thisdata.sort = thisdata.cSort;
  601. theArr.push(thisdata);
  602. }
  603. }
  604. this.setState({
  605. dataSourceX: theArr
  606. });
  607. }.bind(this)
  608. });
  609. },
  610. search(obj) {
  611. if (obj.reset) {
  612. this.state.searchData.deps = [];
  613. this.Cascaders.empty();
  614. this.loadData(1);
  615. } else {
  616. this.setState(
  617. {
  618. searchData: Object.assign(this.state.searchData, obj)
  619. },
  620. () => {
  621. this.loadData(1);
  622. }
  623. );
  624. }
  625. },
  626. rizhi(orderNo) {
  627. $.ajax({
  628. method: "get",
  629. dataType: "json",
  630. crossDomain: false,
  631. url: "/api/admin/newOrder/selectOrderLog",
  632. data: {
  633. orderNo: orderNo
  634. },
  635. success: function (data) {
  636. let theArr = [];
  637. let thisData = data.data;
  638. if (!thisData.length) {
  639. if (data.error && data.error.length) {
  640. message.warning(data.error[0].message);
  641. }
  642. thisData = {};
  643. } else {
  644. for (let i = 0; i < data.data.length; i++) {
  645. let thisdata = data.data[i];
  646. theArr.push({
  647. processName: thisdata.processName,
  648. adminName: thisdata.adminName,
  649. createDate: thisdata.createDate,
  650. remarks: thisdata.remarks
  651. });
  652. }
  653. }
  654. this.setState({
  655. dataSourcerizhi: theArr
  656. });
  657. }.bind(this)
  658. });
  659. },
  660. getOrderLog(orderNo) {
  661. this.setState({
  662. rizhivisible: true
  663. });
  664. this.rizhi(orderNo);
  665. },
  666. closeOrderLog() {
  667. this.setState({
  668. rizhivisible: false
  669. });
  670. },
  671. //节点列表
  672. jiedian(orderNos) {
  673. $.ajax({
  674. method: "get",
  675. dataType: "json",
  676. crossDomain: false,
  677. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  678. data: {
  679. orderNo: orderNos
  680. },
  681. success: function (data) {
  682. let theArr = [];
  683. let thisData = [];
  684. if (data.error.length || data.data.list == "") {
  685. if (data.error && data.error.length) {
  686. message.warning(data.error[0].message);
  687. }
  688. } else {
  689. for (let i = 0; i < data.data.length; i++) {
  690. thisData = data.data[i];
  691. theArr.push({
  692. key: i,
  693. dunSubject: thisData.dunSubject
  694. ? thisData.dunSubject.toString()
  695. : "", //催款科目
  696. id: thisData.id, //节点Id
  697. money: thisData.money, //催款金额
  698. dunStatus: thisData.dunStatus //催款状态
  699. });
  700. }
  701. this.setState({
  702. contactList: theArr
  703. });
  704. }
  705. }.bind(this)
  706. });
  707. },
  708. jiedianNew(orderNos) {
  709. $.ajax({
  710. method: "get",
  711. dataType: "json",
  712. crossDomain: false,
  713. url:
  714. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  715. data: {
  716. orderNo: orderNos
  717. },
  718. success: function (data) {
  719. if (data.error && data.error.length) {
  720. message.warning(data.error[0].message);
  721. } else {
  722. let theArr = [];
  723. let thisData = [];
  724. let arr = data.data || [];
  725. let totalCui = 0;
  726. for (let i = 0; i < arr.length; i++) {
  727. thisData = arr[i];
  728. totalCui += +thisData.money;
  729. theArr.push({
  730. key: i,
  731. dunSubject: thisData.dunSubject
  732. ? thisData.dunSubject.toString()
  733. : "", //催款科目
  734. id: thisData.id, //节点Id
  735. money: thisData.money, //催款金额
  736. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  737. commodityName: thisData.commodityName,
  738. projectType: thisData.projectType,
  739. dunTypeName: thisData.dunTypeName,
  740. status: thisData.status,
  741. waitDay: thisData.waitDay,
  742. effectiveCount: thisData.effectiveCount,
  743. startDate: thisData.startDate,
  744. dunType: thisData.dunType,
  745. appropriationRatio: thisData.appropriationRatio,
  746. customizeName: thisData.customizeName,
  747. customizeTimes: thisData.customizeTimes,
  748. tid: thisData.tid,
  749. });
  750. }
  751. if (!totalCui) {
  752. totalCui = 0;
  753. }
  754. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  755. this.setState({
  756. contactListNew: theArr,
  757. totalCui
  758. });
  759. }
  760. }.bind(this)
  761. }).always(
  762. function () {
  763. this.setState({
  764. loading: false
  765. });
  766. }.bind(this)
  767. );
  768. },
  769. //审核通过
  770. examOk() {
  771. $.ajax({
  772. method: "post",
  773. dataType: "json",
  774. crossDomain: false,
  775. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  776. data: {
  777. orderNo: this.state.orderNo,
  778. orderStatus: 2
  779. },
  780. success: function (data) {
  781. if (data.error.length || data.data.list == "") {
  782. if (data.error && data.error.length) {
  783. message.warning(data.error[0].message);
  784. }
  785. } else {
  786. message.success("该订单已通过审核~");
  787. this.setState({
  788. visible: false
  789. });
  790. this.reset();
  791. }
  792. }.bind(this)
  793. }).always(
  794. function () {
  795. this.setState({
  796. loading: false
  797. });
  798. }.bind(this)
  799. );
  800. },
  801. //通过发给外包
  802. outsourcing() {
  803. $.ajax({
  804. method: "post",
  805. dataType: "json",
  806. crossDomain: false,
  807. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  808. data: {
  809. orderNo: this.state.orderNo,
  810. orderStatus: 2,
  811. outsource: 1
  812. },
  813. success: function (data) {
  814. if (data.error.length || data.data.list == "") {
  815. if (data.error && data.error.length) {
  816. message.warning(data.error[0].message);
  817. }
  818. } else {
  819. message.success("该订单已通过审核~");
  820. this.setState({
  821. visible: false
  822. });
  823. this.reset();
  824. }
  825. }.bind(this)
  826. }).always(
  827. function () {
  828. this.setState({
  829. loading: false
  830. });
  831. }.bind(this)
  832. );
  833. },
  834. //审核不通过
  835. examOks() {
  836. this.setState({
  837. aloading: true
  838. });
  839. $.ajax({
  840. method: "post",
  841. dataType: "json",
  842. crossDomain: false,
  843. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  844. data: {
  845. orderNo: this.state.orderNo,
  846. orderStatus: 3,
  847. reason: this.state.reason
  848. },
  849. success: function (data) {
  850. if (data.error.length || data.data.list == "") {
  851. if (data.error && data.error.length) {
  852. message.warning(data.error[0].message);
  853. this.setState({
  854. aloading: true
  855. });
  856. }
  857. } else {
  858. message.success("该订单已被拒绝~");
  859. this.setState({
  860. visible: false,
  861. aloading: false,
  862. noVisible: false,
  863. reason: ""
  864. });
  865. this.reset();
  866. }
  867. }.bind(this)
  868. }).always(
  869. function () {
  870. this.setState({
  871. loading: false
  872. });
  873. }.bind(this)
  874. );
  875. },
  876. //点击拒绝
  877. examNo() {
  878. this.setState({
  879. noVisible: true
  880. });
  881. },
  882. loadDataChange(key) {
  883. $.ajax({
  884. method: "get",
  885. dataType: "json",
  886. async: false,
  887. crossDomain: false,
  888. url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  889. data: {
  890. changeId: key
  891. },
  892. success: function (data) {
  893. if (data.error.length || data.data.list == "") {
  894. if (data.error && data.error.length) {
  895. message.warning(data.error[0].message);
  896. }
  897. } else {
  898. // console.log("拿到历史", data.data);
  899. this.setState({
  900. dataProps: data.data
  901. });
  902. }
  903. }.bind(this)
  904. });
  905. },
  906. callback(key) {
  907. this.setState(
  908. {
  909. activeKey: key
  910. },
  911. () => {
  912. if (key != "a" && key != "c" && key.length < 10) {
  913. this.ChangeDetail(key);
  914. this.loadDataChange(key);
  915. } else if (key != "a" && key != "c" && key.length > 10) {
  916. this.primaryOrder(key);
  917. this.xiangmu(key);
  918. this.jiedian(key);
  919. this.jiedianNew(key);
  920. this.loadDataChange(key);
  921. }
  922. }
  923. );
  924. if (key === "a") {
  925. this.xiangmu(this.state.orderNo);
  926. this.jiedian(this.state.orderNo);
  927. this.jiedianNew(this.state.orderNo);
  928. }
  929. // if (key === "2") {
  930. // this.ChangeDetail(this.state.orderNo);
  931. // this.loadDataChange();
  932. // }
  933. // if (key === "3") {
  934. // this.primaryOrder(this.state.primaryOrderNo);
  935. // this.xiangmu(this.state.primaryOrderNo);
  936. // this.jiedian(this.state.primaryOrderNo);
  937. // this.jiedianNew(this.state.primaryOrderNo);
  938. // }
  939. if (key === "c") {
  940. this.additionalOrder(this.state.additionalOrder);
  941. this.xiangmu(this.state.additionalOrder);
  942. this.jiedian(this.state.additionalOrder);
  943. this.jiedianNew(this.state.additionalOrder);
  944. this.setState({
  945. buttonStatusA: false
  946. });
  947. } else {
  948. this.setState({
  949. buttonStatusA: true
  950. });
  951. }
  952. },
  953. closeDesc(e, s) {
  954. this.state.activeKey = "a";
  955. this.state.userDetaile = false;
  956. this.state.signBillVisible = false;
  957. this.state.visible = e;
  958. if (s) {
  959. this.loadData(this.state.pageNo);
  960. }
  961. },
  962. // 获取原订单编号
  963. getPrimaryOrder(value) {
  964. this.setState({
  965. primaryOrder: value
  966. });
  967. },
  968. getAdditionalOrder(value) {
  969. this.setState({
  970. additionalOrder: value
  971. });
  972. },
  973. getUrl(url) {
  974. let theorgCodeUrl = [];
  975. if (url.length) {
  976. let picArr = [];
  977. url.map(function (item) {
  978. if (
  979. item.response &&
  980. item.response.data &&
  981. item.response.data.length
  982. ) {
  983. picArr.push(item.response.data);
  984. }
  985. });
  986. theorgCodeUrl = picArr.join(",");
  987. }
  988. return theorgCodeUrl;
  989. },
  990. sureOut() {
  991. if (!this.state.companyName) {
  992. message.warning("公司名称不能为空");
  993. return;
  994. }
  995. if (!this.state.unitPrice) {
  996. message.warning("单价不能为空");
  997. return;
  998. }
  999. if (!this.state.unitNumber) {
  1000. message.warning("数量不能为空");
  1001. return;
  1002. }
  1003. if (!this.state.amount) {
  1004. message.warning("总金额不能为空");
  1005. return;
  1006. }
  1007. if (!this.state.outsourceRemarks) {
  1008. message.warning("备注不能为空");
  1009. return;
  1010. }
  1011. if (this.state.pictureUrl.length === 0) {
  1012. message.warning("合同扫描件不能为空");
  1013. return;
  1014. }
  1015. $.ajax({
  1016. method: "POST",
  1017. dataType: "json",
  1018. crossDomain: false,
  1019. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  1020. data: {
  1021. id: this.state.id,
  1022. orderNo: this.state.orderNo,
  1023. companyName: this.state.companyName,
  1024. amount: this.state.amount,
  1025. outsourceRemarks: this.state.outsourceRemarks,
  1026. unitNumber: this.state.unitNumber,
  1027. unitPrice: this.state.unitPrice,
  1028. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  1029. ? this.getUrl(this.state.attachmentUrl)
  1030. : "",
  1031. orderStatus: 2,
  1032. pictureUrl: this.getUrl(this.state.pictureUrl).length
  1033. ? this.getUrl(this.state.pictureUrl)
  1034. : ""
  1035. }
  1036. }).done(
  1037. function (data) {
  1038. this.setState({
  1039. loading: false
  1040. });
  1041. if (!data.error.length) {
  1042. message.success("发起成功!");
  1043. this.outReset();
  1044. this.visitCancel();
  1045. } else {
  1046. message.warning(data.error[0].message);
  1047. }
  1048. }.bind(this)
  1049. );
  1050. },
  1051. //关闭输入理由框
  1052. noCancel() {
  1053. this.setState({
  1054. noVisible: false,
  1055. aloading: false,
  1056. reason: ""
  1057. });
  1058. },
  1059. //重置
  1060. reset() {
  1061. this.setState({
  1062. signBillVisible: false
  1063. });
  1064. this.state.orderNo = "";
  1065. this.state.customerName = "";
  1066. this.state.releaseDate[0] = undefined;
  1067. this.state.releaseDate[1] = undefined;
  1068. this.state.approval = undefined;
  1069. this.loadData(1);
  1070. },
  1071. outReset() {
  1072. this.setState({
  1073. companyName: "",
  1074. amount: "",
  1075. unitPrice: "",
  1076. unitNumber: "",
  1077. outsourceRemarks: "",
  1078. attachmentUrl: [],
  1079. pictureUrl: []
  1080. });
  1081. },
  1082. getOrgCodeUrl(e) {
  1083. this.setState({ pictureUrl: e });
  1084. },
  1085. //关闭详情
  1086. visitCancel() {
  1087. this.setState(
  1088. {
  1089. visible: false,
  1090. activeKey: "a"
  1091. },
  1092. () => {
  1093. this.setState({
  1094. activeKey: "a"
  1095. });
  1096. }
  1097. );
  1098. this.loadData(this.state.pageNo);
  1099. },
  1100. visitOk() {
  1101. this.setState({
  1102. visible: false
  1103. });
  1104. },
  1105. changeList(arr) {
  1106. const newArr = [];
  1107. this.state.columns.forEach(item => {
  1108. arr.forEach(val => {
  1109. if (val === item.title) {
  1110. newArr.push(item);
  1111. }
  1112. });
  1113. });
  1114. this.setState({
  1115. changeList: newArr
  1116. });
  1117. },
  1118. render() {
  1119. const tabList = this.state.tabList || [];
  1120. const formItemLayout = {
  1121. labelCol: { span: 8 },
  1122. wrapperCol: { span: 14 }
  1123. };
  1124. const FormItem = Form.Item;
  1125. const { TabPane } = Tabs;
  1126. return (
  1127. <div className="user-content">
  1128. <ShowModalDiv ShowModal={this.state.showModal} />
  1129. <div className="content-title" style={{ marginBottom: 10 }}>
  1130. <span style={{ fontWeight: 900, fontSize: 16 }}>
  1131. 合同变更审核订单
  1132. </span>
  1133. </div>
  1134. <div className="user-search">
  1135. <Tabs
  1136. defaultActiveKey="1"
  1137. onChange={this.callback}
  1138. className="test">
  1139. <TabPane tab="搜索" key="1">
  1140. <div style={{ marginLeft: 10 }}>
  1141. <Cascaders
  1142. ref={node => this.Cascaders = node}
  1143. placeholder="订单部门"
  1144. id="id"
  1145. name="name"
  1146. children="list"
  1147. height={28}
  1148. onSel={(e) => {
  1149. const { searchData } = this.state
  1150. searchData["deps"] = JSON.stringify(e);
  1151. this.setState({
  1152. searchData: searchData
  1153. })
  1154. }}
  1155. />
  1156. <SearchInput search={this.search} />
  1157. </div>
  1158. </TabPane>
  1159. <TabPane tab="更改表格显示数据" key="2">
  1160. <div style={{ marginLeft: 10 }}>
  1161. <ChooseList
  1162. columns={this.state.columns}
  1163. changeFn={this.changeList}
  1164. changeList={this.state.changeList}
  1165. top={55}
  1166. margin={11}
  1167. />
  1168. </div>
  1169. </TabPane>
  1170. </Tabs>
  1171. <div className="patent-table">
  1172. <Spin spinning={this.state.loading}>
  1173. <Table
  1174. size="small"
  1175. bordered
  1176. columns={
  1177. this.state.changeList
  1178. ? this.state.changeList
  1179. : this.state.columns
  1180. }
  1181. dataSource={this.state.dataSource}
  1182. pagination={this.state.pagination}
  1183. onRowClick={this.tableRowClick}
  1184. />
  1185. </Spin>
  1186. </div>
  1187. <Modal
  1188. className="customeDetails"
  1189. footer=""
  1190. maskClosable={false}
  1191. width="1200px"
  1192. visible={this.state.visible}
  1193. onOk={this.visitOk}
  1194. onCancel={this.visitCancel}
  1195. >
  1196. <Tabs
  1197. activeKey={this.state.activeKey}
  1198. onChange={this.callback}
  1199. type="card"
  1200. tabBarExtraContent={
  1201. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  1202. <OrderItemStatus deleteSign={this.state.deleteSign} />
  1203. </div>
  1204. }
  1205. >
  1206. <TabPane tab="订单详情" key="a">
  1207. <Form
  1208. layout="horizontal"
  1209. onSubmit={this.handleSubmit}
  1210. id="demand-form"
  1211. style={{ paddingBottom: "40px" }}
  1212. >
  1213. <Spin spinning={this.state.loading}>
  1214. <OrderDetail
  1215. domId='orderDetail2'
  1216. orderUid={this.state.orderUid}
  1217. processState={this.props.processState}
  1218. orderData={this.state.orderData}
  1219. getOrderLog={this.getOrderLog}
  1220. dataSourceX={this.state.dataSourceX}
  1221. contactList={this.state.contactList}
  1222. orderNo={this.state.orderNo}
  1223. totalCui={this.state.totalCui}
  1224. contactListNew={this.state.contactListNew}
  1225. />
  1226. </Spin>
  1227. </Form>
  1228. </TabPane>
  1229. {tabList.map((item, index) => {
  1230. return (
  1231. <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
  1232. <ChangeDetail
  1233. id={item.id}
  1234. domId={'hetongbiangenjilu' + (index + 1)}
  1235. orderUid={this.state.orderUid}
  1236. data={this.state.contractData}
  1237. pictureUrl={this.state.voucherUrl}
  1238. contractPictureUrl={this.state.contractPictureUrl}
  1239. attachment={this.state.attachment}
  1240. processState={this.props.processState}
  1241. loadData={this.callback}
  1242. reset={this.state.visible}
  1243. dataSource={this.state.dataProps}
  1244. onCancel={this.visitCancel}
  1245. />
  1246. </TabPane>
  1247. );
  1248. })}
  1249. {tabList.map((item, index) => {
  1250. if (item.usedOrder) {
  1251. return (
  1252. <TabPane
  1253. tab={"原订单" + (index + 1)}
  1254. key={item.usedOrder}
  1255. >
  1256. <Form
  1257. layout="horizontal"
  1258. onSubmit={this.handleSubmit}
  1259. id="demand-form"
  1260. style={{ paddingBottom: "40px" }}
  1261. >
  1262. <Spin spinning={this.state.loading}>
  1263. <OrderDetail
  1264. domId={'yuandingdan' + (index + 1)}
  1265. orderUid={this.state.orderUid}
  1266. processState={this.props.processState}
  1267. orderData={this.state.primaryOrderData}
  1268. getOrderLog={this.getOrderLog}
  1269. dataSourceX={this.state.dataSourceX}
  1270. contactList={this.state.contactList}
  1271. orderNo={this.state.primaryOrderNo}
  1272. totalCui={this.state.totalCui}
  1273. contactListNew={this.state.contactListNew}
  1274. />
  1275. </Spin>
  1276. </Form>
  1277. </TabPane>
  1278. );
  1279. } else {
  1280. return "";
  1281. }
  1282. })}
  1283. {/* {this.state.status === 4 ? (
  1284. <TabPane tab="原订单" key="3">
  1285. <Form
  1286. layout="horizontal"
  1287. onSubmit={this.handleSubmit}
  1288. id="demand-form"
  1289. style={{ paddingBottom: "40px" }}
  1290. >
  1291. <Spin spinning={this.state.loading}>
  1292. <OrderDetail
  1293. processState={this.props.processState}
  1294. orderData={this.state.primaryOrderData}
  1295. getOrderLog={this.getOrderLog}
  1296. dataSourceX={this.state.dataSourceX}
  1297. contactList={this.state.contactList}
  1298. orderNo={this.state.primaryOrderNo}
  1299. totalCui={this.state.totalCui}
  1300. contactListNew={this.state.contactListNew}
  1301. />
  1302. </Spin>
  1303. </Form>
  1304. </TabPane>
  1305. ) : (
  1306. ""
  1307. )} */}
  1308. {this.state.status === 4 && this.state.isAddition ? (
  1309. this.state.type === 4 || this.state.type === 5 ? (
  1310. <TabPane tab="附加订单" key="c">
  1311. <OrderDetail
  1312. domId='fujiadingdan'
  1313. orderUid={this.state.orderUid}
  1314. processState={this.props.processState}
  1315. orderData={this.state.additionalOrderData}
  1316. getOrderLog={this.getOrderLog}
  1317. dataSourceX={this.state.dataSourceX}
  1318. contactList={this.state.contactList}
  1319. orderNo={this.state.additionalOrder}
  1320. totalCui={this.state.totalCui}
  1321. contactListNew={this.state.contactListNew}
  1322. />
  1323. </TabPane>
  1324. ) : (
  1325. ""
  1326. )
  1327. ) : (
  1328. ""
  1329. )}
  1330. </Tabs>
  1331. </Modal>
  1332. <Modal
  1333. maskClosable={false}
  1334. visible={this.state.noVisible}
  1335. onOk={this.handleOk}
  1336. onCancel={this.noCancel}
  1337. width="400px"
  1338. title={"拒绝理由"}
  1339. footer=""
  1340. className="admin-desc-content"
  1341. confirmLoading={this.state.confirmLoading}
  1342. >
  1343. <Form layout="horizontal" id="demand-form">
  1344. <Spin spinning={this.state.loading}>
  1345. <div className="clearfix">
  1346. <FormItem
  1347. labelCol={{ span: 4 }}
  1348. wrapperCol={{ span: 16 }}
  1349. label="拒绝理由"
  1350. >
  1351. <Input
  1352. type="textarea"
  1353. placeholder="请输入拒绝理由"
  1354. rows={4}
  1355. value={this.state.reason}
  1356. onChange={e => {
  1357. this.setState({ reason: e.target.value });
  1358. }}
  1359. />
  1360. </FormItem>
  1361. </div>
  1362. <div className="clearfix">
  1363. <Button
  1364. className="cancel"
  1365. type="primary"
  1366. onClick={this.examOks}
  1367. style={{ marginLeft: "50px" }}
  1368. htmlType="submit"
  1369. loading={this.state.aloading}
  1370. >
  1371. 确定
  1372. </Button>
  1373. <Button
  1374. className="cancel"
  1375. type="ghost"
  1376. onClick={this.noCancel}
  1377. style={{ marginLeft: "50px" }}
  1378. >
  1379. 取消
  1380. </Button>
  1381. </div>
  1382. </Spin>
  1383. </Form>
  1384. </Modal>
  1385. {/* <Modal
  1386. visible={this.state.rizhivisible}
  1387. className="admin-desc-content"
  1388. width="800px"
  1389. maskClosable={false}
  1390. title="订单日志"
  1391. footer={null}
  1392. onCancel={this.closeOrderLog}
  1393. >
  1394. <div className="patent-table">
  1395. <Spin spinning={this.state.loading}>
  1396. <Table
  1397. bordered
  1398. columns={this.state.columnsrizhi}
  1399. dataSource={this.state.dataSourcerizhi}
  1400. pagination={false}
  1401. />
  1402. </Spin>
  1403. </div>
  1404. </Modal> */}
  1405. <OrderRiZi
  1406. dataSourcerizhi={this.state.dataSourcerizhi}
  1407. closeOrderLog={this.closeOrderLog}
  1408. visible={this.state.rizhivisible}
  1409. loading={this.state.loading}
  1410. />
  1411. </div>
  1412. {this.state.addnextVisible && <ProjectDetailsReadOnly
  1413. infor={this.state.dataInfor}
  1414. visible={this.state.addnextVisible}
  1415. onCancel={this.nextCancel}
  1416. />}
  1417. </div>
  1418. );
  1419. }
  1420. })
  1421. );
  1422. export default contractChange;