contractJszj.js 45 KB

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