contractJsjl.js 35 KB

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