contractJszj.js 43 KB

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