contractYxgly.js 35 KB

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