contractYxgly.js 36 KB

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