contractJszj.js 36 KB

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