contractJsjl.js 46 KB

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