contractJszj.js 35 KB

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