contractJsjl.js 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  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 OrderItemStatus from "../../../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 || 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. declarationBatch: 1,
  113. dataInfor: {},
  114. primaryOrderData: {}, //原订单数据
  115. orderData: {}, //现订单数据
  116. pictureUrl: [],
  117. voucherUrl: [],
  118. attachment: [],
  119. attachmentUrl: [],
  120. proceedsData: {},
  121. proTotal: 0,
  122. invTotal: 0,
  123. contractData: {},
  124. // 回收退票数据
  125. refundInvoice: [],
  126. RefundInvoice: [],
  127. additionalOrderData: {},
  128. paginations: false,
  129. activeKey: "a",
  130. confirmLoading: false,
  131. aloading: false,
  132. pagination: {
  133. defaultCurrent: 1,
  134. defaultPageSize: 10,
  135. showQuickJumper: true,
  136. pageSize: 10,
  137. onChange: function (page) {
  138. this.loadData(page);
  139. }.bind(this),
  140. showTotal: function (total) {
  141. return "共" + total + "条数据";
  142. }
  143. },
  144. columns: [
  145. {
  146. title: "合同编号",
  147. dataIndex: "contractNo",
  148. key: "contractNo"
  149. },
  150. {
  151. title: "订单编号",
  152. dataIndex: "orderNo",
  153. key: "orderNo"
  154. },
  155. {
  156. title: "客户名称",
  157. dataIndex: "nickname",
  158. key: "nickname",
  159. width: 150,
  160. render: (text) => {
  161. return (
  162. <Tooltip title={text}>
  163. <div style={{
  164. maxWidth: '150px',
  165. overflow: 'hidden',
  166. textOverflow: "ellipsis",
  167. whiteSpace: 'nowrap',
  168. }}>{text}</div>
  169. </Tooltip>
  170. )
  171. },
  172. },
  173. {
  174. title: "订单部门",
  175. dataIndex: "depName",
  176. key: "depName"
  177. },
  178. {
  179. title: "订单类型",
  180. dataIndex: "orderType",
  181. key: "orderType",
  182. render: text => {
  183. return text ? "科技项目" : "认证项目";
  184. }
  185. },
  186. {
  187. title: "下单时间",
  188. dataIndex: "establishTimes",
  189. key: "establishTimes"
  190. },
  191. {
  192. title: "订单状态",
  193. dataIndex: "orderStatus",
  194. key: "orderStatus",
  195. render: text => {
  196. return getNewOrderStatus(text);
  197. }
  198. },
  199. {
  200. title: "合同额(万元)",
  201. dataIndex: "totalAmount",
  202. key: "totalAmount"
  203. },
  204. {
  205. title: "已付额(万元)",
  206. dataIndex: "settlementAmount",
  207. key: "settlementAmount"
  208. },
  209. {
  210. title: "欠款(万元)",
  211. dataIndex: "arrears",
  212. key: "arrears"
  213. },
  214. {
  215. title: "订单负责人",
  216. dataIndex: "salesmanName",
  217. key: "salesmanName"
  218. },
  219. {
  220. title: "变更类型",
  221. dataIndex: "type",
  222. key: "type",
  223. render: text => {
  224. return getType(text);
  225. }
  226. },
  227. {
  228. title: "审核状态",
  229. dataIndex: "processStateText",
  230. key: "processStateText"
  231. },
  232. {
  233. title: "提交时间",
  234. dataIndex: "createTimes",
  235. key: "createTimes"
  236. }
  237. ],
  238. dataSource: [],
  239. // 传递给子组件的
  240. dataProps: [],
  241. columnsX: [
  242. {
  243. title: "业务项目名称",
  244. dataIndex: "commodityName",
  245. key: "commodityName",
  246. render: (text, record) => {
  247. return (
  248. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  249. )
  250. }
  251. },
  252. {
  253. title: "项目类别",
  254. dataIndex: "cname",
  255. key: "cname"
  256. },
  257. {
  258. title: "项目数量",
  259. dataIndex: "commodityQuantity",
  260. key: "commodityQuantity"
  261. },
  262. {
  263. title: "金额(万元)",
  264. dataIndex: "commodityPrice",
  265. key: "commodityPrice"
  266. },
  267. {
  268. title: "负责人",
  269. dataIndex: "contacts",
  270. key: "contacts"
  271. },
  272. {
  273. title: "负责人电话",
  274. dataIndex: "contactsMobile",
  275. key: "contactsMobile"
  276. },
  277. {
  278. title: "项目状态",
  279. dataIndex: "projectStatus",
  280. key: "projectStatus",
  281. render: text => {
  282. return getProjectName(text);
  283. }
  284. },
  285. {
  286. title: "主要项目",
  287. dataIndex: "main",
  288. key: "main",
  289. render: text => {
  290. return text ? "是" : "否";
  291. }
  292. },
  293. {
  294. title: "总年限",
  295. dataIndex: "yearSum",
  296. key: "yearSum",
  297. render: (text, record) => {
  298. return (
  299. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  300. );
  301. }
  302. },
  303. {
  304. title: "年限",
  305. dataIndex: "serviceLife",
  306. key: "serviceLife",
  307. render: (text, record) => {
  308. return (
  309. !!text && JSON.parse(text).map(item =>
  310. <div>{item}</div>
  311. )
  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. // console.log("row",this.state.activeKey);
  414. },
  415. //点击打卡项目详情
  416. tableRowClickX(record) {
  417. this.setState({
  418. jid: record.id, //项目ID
  419. kid: record.commodityId, //商品ID
  420. commodityName: record.commodityName, //金额
  421. commodityPrice: record.commodityPrice, //金额
  422. commodityQuantity: record.commodityQuantity, //数量
  423. taskComment: record.taskComment, //备注
  424. main: record.main.toString(), //是否为主要
  425. addnextVisible: true,
  426. dataInfor: record,
  427. addState: 0
  428. });
  429. },
  430. //项目详情关闭
  431. nextCancel() {
  432. this.setState({
  433. addnextVisible: false
  434. });
  435. },
  436. // 合同变更详情
  437. ChangeDetail(id) {
  438. let url = window.location.href.substring(7);
  439. $.ajax({
  440. method: "get",
  441. dataType: "json",
  442. crossDomain: false,
  443. url:
  444. globalConfig.context +
  445. "/api/admin/orderChange/orderChangeDetailsById",
  446. data: {
  447. id: id
  448. },
  449. success: function (data) {
  450. if (data.data) {
  451. let thisdata = data.data;
  452. Object.assign(thisdata, {
  453. processStateText: this.state.processStateText,
  454. userName: this.state.userName,
  455. contractNo: this.state.contractNo
  456. });
  457. this.setState({
  458. contractData: thisdata,
  459. voucherUrl: thisdata.voucherUrl
  460. ? splitUrl(
  461. thisdata.voucherUrl,
  462. ",",
  463. globalConfig.avatarHost + "/upload",
  464. url
  465. )
  466. : [],
  467. attachment: thisdata.attachmentUrl
  468. ? splitUrl(
  469. thisdata.attachmentUrl,
  470. ",",
  471. globalConfig.avatarHost + "/upload",
  472. url
  473. )
  474. : []
  475. });
  476. }
  477. }.bind(this)
  478. });
  479. $.ajax({
  480. method: "get",
  481. dataType: "json",
  482. crossDomain: false,
  483. url:
  484. globalConfig.context +
  485. "/api/admin/orderChange/listOrderInvoiceAndBill",
  486. data: {
  487. orderNo: this.state.orderNo
  488. },
  489. success: function (data) {
  490. if (!data.data) return;
  491. let proTotal = 0;
  492. let invTotal = 0;
  493. data.data.bill.forEach(item => {
  494. proTotal += item.transactionAmount;
  495. });
  496. data.data.invoice.forEach(item => {
  497. invTotal += item.amount;
  498. });
  499. this.setState({
  500. proceedsData: data.data,
  501. proTotal: (Math.round(proTotal * 1000000) / 1000000).toFixed(6),
  502. invTotal: (Math.round(invTotal * 1000000) / 1000000).toFixed(6),
  503. });
  504. }.bind(this)
  505. });
  506. $.ajax({
  507. method: "get",
  508. dataType: "json",
  509. crossDomain: false,
  510. url:
  511. globalConfig.context +
  512. "/api/admin/orderChange/listOrderRefundInvoice",
  513. data: {
  514. orderNo: this.state.orderNo
  515. },
  516. success: data => {
  517. if (!data) return;
  518. data.data.forEach(item => {
  519. item.load = true;
  520. });
  521. this.setState({
  522. refundInvoice: data.data
  523. });
  524. }
  525. });
  526. },
  527. //订单详情
  528. xiangqing(orderNos) {
  529. $.ajax({
  530. method: "get",
  531. dataType: "json",
  532. crossDomain: false,
  533. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  534. data: {
  535. orderNo: orderNos
  536. },
  537. success: function (data) {
  538. if (data.error.length || data.data.list == "") {
  539. if (data.error && data.error.length) {
  540. message.warning(data.error[0].message);
  541. }
  542. } else {
  543. let thisdata = data.data;
  544. this.setState({
  545. userName: thisdata.userName,
  546. primaryOrderNo: thisdata.primaryOrder,
  547. additionalOrder: thisdata.additionalOrder,
  548. contractNo: thisdata.contractNo,
  549. // arrears: thisdata.arrears,
  550. orderData: thisdata,
  551. isAddition: thisdata.additionalOrder ? true : false,
  552. deleteSign: thisdata.deleteSign,
  553. });
  554. }
  555. }.bind(this)
  556. });
  557. },
  558. // 原订单数据
  559. primaryOrder(primaryOrder) {
  560. $.ajax({
  561. method: "get",
  562. dataType: "json",
  563. crossDomain: false,
  564. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  565. data: {
  566. orderNo: primaryOrder
  567. },
  568. success: function (data) {
  569. if (data.error.length || data.data.list == "") {
  570. if (data.error && data.error.length) {
  571. message.warning(data.error[0].message);
  572. }
  573. } else {
  574. let thisdata = data.data;
  575. this.setState({
  576. primaryOrderData: thisdata
  577. });
  578. }
  579. }.bind(this)
  580. });
  581. },
  582. // 附加订单数据
  583. additionalOrder(additionalOrder) {
  584. $.ajax({
  585. method: "get",
  586. dataType: "json",
  587. crossDomain: false,
  588. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  589. data: {
  590. orderNo: additionalOrder
  591. },
  592. success: function (data) {
  593. if (data.error.length || data.data.list == "") {
  594. if (data.error && data.error.length) {
  595. message.warning(data.error[0].message);
  596. }
  597. } else {
  598. let thisdata = data.data;
  599. this.setState({
  600. additionalOrderData: thisdata
  601. });
  602. }
  603. }.bind(this)
  604. });
  605. },
  606. //项目列表
  607. xiangmu(orderNos) {
  608. $.ajax({
  609. method: "get",
  610. dataType: "json",
  611. crossDomain: false,
  612. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  613. data: {
  614. orderNo: orderNos
  615. },
  616. success: function (data) {
  617. let theArr = [];
  618. if (data.error.length || data.data.list == "") {
  619. if (data.error && data.error.length) {
  620. message.warning(data.error[0].message);
  621. }
  622. } else {
  623. for (let i = 0; i < data.data.length; i++) {
  624. let thisdata = data.data[i];
  625. thisdata.key = i;
  626. thisdata.sort = thisdata.cSort;
  627. theArr.push(thisdata);
  628. }
  629. }
  630. this.setState({
  631. dataSourceX: theArr
  632. });
  633. }.bind(this)
  634. });
  635. },
  636. search(obj) {
  637. if (obj.reset) {
  638. this.state.searchData.deps = [];
  639. this.Cascaders.empty();
  640. this.loadData(1);
  641. } else {
  642. this.setState(
  643. {
  644. searchData: Object.assign(this.state.searchData, obj)
  645. },
  646. () => {
  647. this.loadData(1);
  648. }
  649. );
  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} />
  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. <Cascaders
  1188. ref={node => this.Cascaders = node}
  1189. placeholder="订单部门"
  1190. id="id"
  1191. name="name"
  1192. children="list"
  1193. height={28}
  1194. onSel={(e) => {
  1195. const { searchData } = this.state
  1196. searchData["deps"] = JSON.stringify(e);
  1197. this.setState({
  1198. searchData: searchData
  1199. })
  1200. }}
  1201. />
  1202. <SearchInput search={this.search} />
  1203. </div>
  1204. </TabPane>
  1205. <TabPane tab="更改表格显示数据" key="2">
  1206. <div style={{ marginLeft: 10 }}>
  1207. <ChooseList
  1208. columns={this.state.columns}
  1209. changeFn={this.changeList}
  1210. changeList={this.state.changeList}
  1211. top={55}
  1212. margin={11}
  1213. />
  1214. </div>
  1215. </TabPane>
  1216. </Tabs>
  1217. <div className="patent-table">
  1218. <Spin spinning={this.state.loading}>
  1219. <Table
  1220. size="small"
  1221. bordered
  1222. columns={
  1223. this.state.changeList
  1224. ? this.state.changeList
  1225. : this.state.columns
  1226. }
  1227. dataSource={this.state.dataSource}
  1228. pagination={this.state.pagination}
  1229. onRowClick={this.tableRowClick}
  1230. />
  1231. </Spin>
  1232. </div>
  1233. <Modal
  1234. className="customeDetails"
  1235. footer=""
  1236. maskClosable={false}
  1237. width="900px"
  1238. visible={this.state.visible}
  1239. onOk={this.visitOk}
  1240. onCancel={this.visitCancel}
  1241. >
  1242. <Tabs
  1243. activeKey={this.state.activeKey}
  1244. onChange={this.callback}
  1245. type="card"
  1246. tabBarExtraContent={
  1247. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  1248. <OrderItemStatus deleteSign={this.state.deleteSign} />
  1249. </div>
  1250. }
  1251. >
  1252. <TabPane tab="订单详情" key="a">
  1253. <Form
  1254. layout="horizontal"
  1255. onSubmit={this.handleSubmit}
  1256. id="demand-form"
  1257. style={{ paddingBottom: "40px" }}
  1258. >
  1259. <Spin spinning={this.state.loading}>
  1260. <OrderDetail
  1261. domId='dindanxiangqing'
  1262. orderData={this.state.orderData}
  1263. getOrderLog={this.getOrderLog}
  1264. dataSourceX={this.state.dataSourceX}
  1265. contactList={this.state.contactList}
  1266. orderNo={this.state.orderNo}
  1267. totalCui={this.state.totalCui}
  1268. contactListNew={this.state.contactListNew}
  1269. />
  1270. </Spin>
  1271. </Form>
  1272. </TabPane>
  1273. {/* <TabPane tab="合同变更记录" key="2">
  1274. <ChangeDetail
  1275. data={this.state.contractData}
  1276. pictureUrl={this.state.voucherUrl}
  1277. processState={this.props.processState}
  1278. // loadData={this.callback}
  1279. reset={this.state.visible}
  1280. dataSource={this.state.dataProps}
  1281. proceedsData={this.state.proceedsData}
  1282. proceedsTotal={this.state.proTotal}
  1283. invoiceTotal={this.state.invTotal}
  1284. contactList={this.state.refundInvoice}
  1285. onCancel={this.visitCancel}
  1286. />
  1287. </TabPane> */}
  1288. {tabList.map((item, index, arr) => {
  1289. return (
  1290. <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
  1291. <ChangeDetail
  1292. id={item.id}
  1293. domId={'hetongbiangenjilu' + (index + 1)}
  1294. money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
  1295. data={this.state.contractData}
  1296. pictureUrl={this.state.voucherUrl}
  1297. attachment={this.state.attachment}
  1298. processState={this.props.processState}
  1299. // loadData={this.callback}
  1300. reset={this.state.visible}
  1301. dataSource={this.state.dataProps}
  1302. proceedsData={this.state.proceedsData}
  1303. proceedsTotal={this.state.proTotal}
  1304. invoiceTotal={this.state.invTotal}
  1305. contactList={this.state.refundInvoice}
  1306. onCancel={this.visitCancel}
  1307. />
  1308. </TabPane>
  1309. );
  1310. })}
  1311. {/* {this.state.status === 4 ? (
  1312. <TabPane tab="原订单" key="3">
  1313. <Form
  1314. layout="horizontal"
  1315. onSubmit={this.handleSubmit}
  1316. id="demand-form"
  1317. style={{ paddingBottom: "40px" }}
  1318. >
  1319. <Spin spinning={this.state.loading}>
  1320. <OrderDetail
  1321. orderData={this.state.primaryOrderData}
  1322. getOrderLog={this.getOrderLog}
  1323. dataSourceX={this.state.dataSourceX}
  1324. contactList={this.state.contactList}
  1325. orderNo={this.state.primaryOrderNo}
  1326. totalCui={this.state.totalCui}
  1327. contactListNew={this.state.contactListNew}
  1328. />
  1329. </Spin>
  1330. </Form>
  1331. </TabPane>
  1332. ) : (
  1333. ""
  1334. )} */}
  1335. {tabList.map((item, index) => {
  1336. if (item.usedOrder) {
  1337. return (
  1338. <TabPane
  1339. tab={"原订单" + (index + 1)}
  1340. key={item.usedOrder}
  1341. >
  1342. <Form
  1343. layout="horizontal"
  1344. onSubmit={this.handleSubmit}
  1345. id="demand-form"
  1346. style={{ paddingBottom: "40px" }}
  1347. >
  1348. <Spin spinning={this.state.loading}>
  1349. <OrderDetail
  1350. domId={'yuandingdan' + (index + 1)}
  1351. orderData={this.state.primaryOrderData}
  1352. getOrderLog={this.getOrderLog}
  1353. dataSourceX={this.state.dataSourceX}
  1354. contactList={this.state.contactList}
  1355. orderNo={this.state.primaryOrderNo}
  1356. totalCui={this.state.totalCui}
  1357. contactListNew={this.state.contactListNew}
  1358. />
  1359. </Spin>
  1360. </Form>
  1361. </TabPane>
  1362. );
  1363. } else {
  1364. return "";
  1365. }
  1366. })}
  1367. {this.state.status === 4 && this.state.isAddition ? (
  1368. this.state.type === 4 || this.state.type === 5 ? (
  1369. <TabPane tab="附加订单" key="c">
  1370. <OrderDetail
  1371. orderData={this.state.additionalOrderData}
  1372. getOrderLog={this.getOrderLog}
  1373. dataSourceX={this.state.dataSourceX}
  1374. contactList={this.state.contactList}
  1375. orderNo={this.state.additionalOrder}
  1376. totalCui={this.state.totalCui}
  1377. contactListNew={this.state.contactListNew}
  1378. />
  1379. </TabPane>
  1380. ) : (
  1381. ""
  1382. )
  1383. ) : (
  1384. ""
  1385. )}
  1386. </Tabs>
  1387. </Modal>
  1388. <Modal
  1389. maskClosable={false}
  1390. visible={this.state.noVisible}
  1391. onOk={this.handleOk}
  1392. onCancel={this.noCancel}
  1393. width="400px"
  1394. title={"拒绝理由"}
  1395. footer=""
  1396. className="admin-desc-content"
  1397. confirmLoading={this.state.confirmLoading}
  1398. >
  1399. <Form layout="horizontal" id="demand-form">
  1400. <Spin spinning={this.state.loading}>
  1401. <div className="clearfix">
  1402. <FormItem
  1403. labelCol={{ span: 4 }}
  1404. wrapperCol={{ span: 16 }}
  1405. label="拒绝理由"
  1406. >
  1407. <Input
  1408. type="textarea"
  1409. placeholder="请输入拒绝理由"
  1410. rows={4}
  1411. value={this.state.reason}
  1412. onChange={e => {
  1413. this.setState({ reason: e.target.value });
  1414. }}
  1415. />
  1416. </FormItem>
  1417. </div>
  1418. <div className="clearfix">
  1419. <Button
  1420. className="cancel"
  1421. type="primary"
  1422. onClick={this.examOks}
  1423. style={{ marginLeft: "50px" }}
  1424. htmlType="submit"
  1425. loading={this.state.aloading}
  1426. >
  1427. 确定
  1428. </Button>
  1429. <Button
  1430. className="cancel"
  1431. type="ghost"
  1432. onClick={this.noCancel}
  1433. style={{ marginLeft: "50px" }}
  1434. >
  1435. 取消
  1436. </Button>
  1437. </div>
  1438. </Spin>
  1439. </Form>
  1440. </Modal>
  1441. {/* <Modal
  1442. visible={this.state.rizhivisible}
  1443. className="admin-desc-content"
  1444. width="800px"
  1445. maskClosable={false}
  1446. title="订单日志"
  1447. footer={null}
  1448. onCancel={this.closeOrderLog}
  1449. >
  1450. <div className="patent-table">
  1451. <Spin spinning={this.state.loading}>
  1452. <Table
  1453. bordered
  1454. columns={this.state.columnsrizhi}
  1455. dataSource={this.state.dataSourcerizhi}
  1456. pagination={false}
  1457. />
  1458. </Spin>
  1459. </div>
  1460. </Modal> */}
  1461. <OrderRiZi
  1462. dataSourcerizhi={this.state.dataSourcerizhi}
  1463. closeOrderLog={this.closeOrderLog}
  1464. visible={this.state.rizhivisible}
  1465. loading={this.state.loading}
  1466. />
  1467. </div>
  1468. {this.state.addnextVisible && <ProjectDetailsReadOnly
  1469. infor={this.state.dataInfor}
  1470. visible={this.state.addnextVisible}
  1471. onCancel={this.nextCancel}
  1472. />}
  1473. </div>
  1474. );
  1475. }
  1476. })
  1477. );
  1478. export default contractChange;