contractYxy.js 45 KB

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