contractJszj.js 36 KB

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