contractYxgly.js 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248
  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. sort: thisdata.cSort
  547. });
  548. }
  549. }
  550. this.setState({
  551. dataSourceX: theArr
  552. });
  553. }.bind(this)
  554. });
  555. },
  556. search(obj) {
  557. this.setState(
  558. {
  559. searchData: obj
  560. },
  561. () => {
  562. this.loadData(1);
  563. }
  564. );
  565. },
  566. rizhi(orderNo) {
  567. $.ajax({
  568. method: "get",
  569. dataType: "json",
  570. crossDomain: false,
  571. url: "/api/admin/newOrder/selectOrderLog",
  572. data: {
  573. orderNo: orderNo
  574. },
  575. success: function(data) {
  576. let theArr = [];
  577. let thisData = data.data;
  578. if (!thisData.length) {
  579. if (data.error && data.error.length) {
  580. message.warning(data.error[0].message);
  581. }
  582. thisData = {};
  583. } else {
  584. for (let i = 0; i < data.data.length; i++) {
  585. let thisdata = data.data[i];
  586. theArr.push({
  587. processName: thisdata.processName,
  588. adminName: thisdata.adminName,
  589. createDate: thisdata.createDate
  590. });
  591. }
  592. }
  593. this.setState({
  594. dataSourcerizhi: theArr
  595. });
  596. }.bind(this)
  597. });
  598. },
  599. getOrderLog(orderNo) {
  600. this.setState({
  601. rizhivisible: true
  602. });
  603. this.rizhi(orderNo);
  604. },
  605. closeOrderLog() {
  606. this.setState({
  607. rizhivisible: false
  608. });
  609. },
  610. //节点列表
  611. jiedian(orderNos) {
  612. $.ajax({
  613. method: "get",
  614. dataType: "json",
  615. crossDomain: false,
  616. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  617. data: {
  618. orderNo: orderNos
  619. },
  620. success: function(data) {
  621. let theArr = [];
  622. let thisData = [];
  623. if (data.error.length || data.data.list == "") {
  624. if (data.error && data.error.length) {
  625. message.warning(data.error[0].message);
  626. }
  627. } else {
  628. for (let i = 0; i < data.data.length; i++) {
  629. thisData = data.data[i];
  630. theArr.push({
  631. key: i,
  632. dunSubject: thisData.dunSubject
  633. ? thisData.dunSubject.toString()
  634. : "", //催款科目
  635. id: thisData.id, //节点Id
  636. money: thisData.money, //催款金额
  637. dunStatus: thisData.dunStatus //催款状态
  638. });
  639. }
  640. this.setState({
  641. contactList: theArr
  642. });
  643. }
  644. }.bind(this)
  645. });
  646. },
  647. //审核通过
  648. examOk() {
  649. $.ajax({
  650. method: "post",
  651. dataType: "json",
  652. crossDomain: false,
  653. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  654. data: {
  655. orderNo: this.state.orderNo,
  656. orderStatus: 2
  657. },
  658. success: function(data) {
  659. if (data.error.length || data.data.list == "") {
  660. if (data.error && data.error.length) {
  661. message.warning(data.error[0].message);
  662. }
  663. } else {
  664. message.success("该订单已通过审核~");
  665. this.setState({
  666. visible: false
  667. });
  668. this.reset();
  669. }
  670. }.bind(this)
  671. }).always(
  672. function() {
  673. this.setState({
  674. loading: false
  675. });
  676. }.bind(this)
  677. );
  678. },
  679. //通过发给外包
  680. outsourcing() {
  681. $.ajax({
  682. method: "post",
  683. dataType: "json",
  684. crossDomain: false,
  685. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  686. data: {
  687. orderNo: this.state.orderNo,
  688. orderStatus: 2,
  689. outsource: 1
  690. },
  691. success: function(data) {
  692. if (data.error.length || data.data.list == "") {
  693. if (data.error && data.error.length) {
  694. message.warning(data.error[0].message);
  695. }
  696. } else {
  697. message.success("该订单已通过审核~");
  698. this.setState({
  699. visible: false
  700. });
  701. this.reset();
  702. }
  703. }.bind(this)
  704. }).always(
  705. function() {
  706. this.setState({
  707. loading: false
  708. });
  709. }.bind(this)
  710. );
  711. },
  712. //审核不通过
  713. examOks() {
  714. this.setState({
  715. aloading: true
  716. });
  717. $.ajax({
  718. method: "post",
  719. dataType: "json",
  720. crossDomain: false,
  721. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  722. data: {
  723. orderNo: this.state.orderNo,
  724. orderStatus: 3,
  725. reason: this.state.reason
  726. },
  727. success: function(data) {
  728. if (data.error.length || data.data.list == "") {
  729. if (data.error && data.error.length) {
  730. message.warning(data.error[0].message);
  731. this.setState({
  732. aloading: true
  733. });
  734. }
  735. } else {
  736. message.success("该订单已被拒绝~");
  737. this.setState({
  738. visible: false,
  739. aloading: false,
  740. noVisible: false,
  741. reason: ""
  742. });
  743. this.reset();
  744. }
  745. }.bind(this)
  746. }).always(
  747. function() {
  748. this.setState({
  749. loading: false
  750. });
  751. }.bind(this)
  752. );
  753. },
  754. //点击拒绝
  755. examNo() {
  756. this.setState({
  757. noVisible: true
  758. });
  759. },
  760. // componentDidMount(){
  761. // window.setTimeout(() => {
  762. // console.log(this.state.dataProps);
  763. // },100)
  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.orderNo);
  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.state.searchData.completeSearch = 0;
  936. this.state.searchData = {
  937. completeSearch: 0
  938. };
  939. this.loadData(1);
  940. },
  941. outReset() {
  942. this.setState({
  943. companyName: "",
  944. amount: "",
  945. unitPrice: "",
  946. unitNumber: "",
  947. outsourceRemarks: "",
  948. attachmentUrl: [],
  949. pictureUrl: []
  950. });
  951. },
  952. getOrgCodeUrl(e) {
  953. this.setState({ pictureUrl: e });
  954. },
  955. //关闭详情
  956. visitCancel() {
  957. this.setState(
  958. {
  959. visible: false,
  960. activeKey: "1"
  961. },
  962. () => {
  963. this.setState({
  964. activeKey: "1"
  965. });
  966. }
  967. );
  968. this.loadData(this.state.page);
  969. },
  970. visitOk() {
  971. this.setState({
  972. visible: false
  973. });
  974. },
  975. render() {
  976. const formItemLayout = {
  977. labelCol: { span: 8 },
  978. wrapperCol: { span: 14 }
  979. };
  980. const FormItem = Form.Item;
  981. const { TabPane } = Tabs;
  982. return (
  983. <div className="user-content">
  984. <ShowModalDiv ShowModal={this.state.showModal} />
  985. <div className="content-title">
  986. <span>合同变更审核订单</span>
  987. </div>
  988. <div className="user-search">
  989. <SearchInput search={this.search} />
  990. <div className="patent-table">
  991. <Spin spinning={this.state.loading}>
  992. <Table
  993. size="small"
  994. bordered
  995. columns={this.state.columns}
  996. dataSource={this.state.dataSource}
  997. pagination={this.state.pagination}
  998. onRowClick={this.tableRowClick}
  999. />
  1000. </Spin>
  1001. </div>
  1002. <Modal
  1003. className="customeDetails"
  1004. footer=""
  1005. maskClosable={false}
  1006. width="900px"
  1007. visible={this.state.visible}
  1008. onOk={this.visitOk}
  1009. onCancel={this.visitCancel}
  1010. >
  1011. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  1012. <TabPane tab="订单详情" key="1">
  1013. <Form
  1014. layout="horizontal"
  1015. onSubmit={this.handleSubmit}
  1016. id="demand-form"
  1017. style={{ paddingBottom: "40px" }}
  1018. >
  1019. <Spin spinning={this.state.loading}>
  1020. <OrderDetail
  1021. orderData={this.state.orderData}
  1022. getOrderLog={this.getOrderLog}
  1023. dataSourceX={this.state.dataSourceX}
  1024. contactList={this.state.contactList}
  1025. orderNo={this.state.orderNo}
  1026. />
  1027. </Spin>
  1028. </Form>
  1029. </TabPane>
  1030. <TabPane tab="合同变更记录" key="2">
  1031. <ChangeDetail
  1032. data={this.state.contractData}
  1033. pictureUrl={this.state.voucherUrl}
  1034. processState={this.props.processState}
  1035. dataSource={this.state.dataProps}
  1036. proceedsData={this.state.proceedsData}
  1037. proceedsTotal={this.state.proTotal}
  1038. invoiceTotal={this.state.invTotal}
  1039. contactList={this.state.refundInvoice}
  1040. onCancel={this.visitCancel}
  1041. />
  1042. </TabPane>
  1043. {this.state.status === 4 ? (
  1044. <TabPane tab="原订单" key="3">
  1045. <Form
  1046. layout="horizontal"
  1047. onSubmit={this.handleSubmit}
  1048. id="demand-form"
  1049. style={{ paddingBottom: "40px" }}
  1050. >
  1051. <Spin spinning={this.state.loading}>
  1052. <OrderDetail
  1053. orderData={this.state.primaryOrderData}
  1054. getOrderLog={this.getOrderLog}
  1055. dataSourceX={this.state.dataSourceX}
  1056. contactList={this.state.contactList}
  1057. orderNo={this.state.primaryOrderNo}
  1058. />
  1059. </Spin>
  1060. </Form>
  1061. </TabPane>
  1062. ) : (
  1063. ""
  1064. )}
  1065. {this.state.status === 4 ? (
  1066. this.state.type === 4 || this.state.type === 5 ? (
  1067. <TabPane tab="附加订单" key="4">
  1068. <OrderDetail
  1069. orderData={this.state.additionalOrderData}
  1070. getOrderLog={this.getOrderLog}
  1071. dataSourceX={this.state.dataSourceX}
  1072. contactList={this.state.contactList}
  1073. orderNo={this.state.additionalOrder}
  1074. />
  1075. </TabPane>
  1076. ) : (
  1077. ""
  1078. )
  1079. ) : (
  1080. ""
  1081. )}
  1082. </Tabs>
  1083. </Modal>
  1084. <Modal
  1085. maskClosable={false}
  1086. visible={this.state.addnextVisible}
  1087. onOk={this.nextCancel}
  1088. onCancel={this.nextCancel}
  1089. confirmLoading={this.state.confirmLoading}
  1090. width="800px"
  1091. title={"项目任务详情"}
  1092. footer=""
  1093. className="admin-desc-content"
  1094. >
  1095. <Form layout="horizontal" id="demand-form">
  1096. <Spin spinning={this.state.loading}>
  1097. <div className="clearfix">
  1098. <FormItem
  1099. className="half-item"
  1100. {...formItemLayout}
  1101. label="项目名称"
  1102. >
  1103. <span>{this.state.commodityName}</span>
  1104. </FormItem>
  1105. <FormItem
  1106. className="half-item"
  1107. {...formItemLayout}
  1108. label="项目数量"
  1109. >
  1110. <span>{this.state.commodityQuantity}</span>
  1111. </FormItem>
  1112. <FormItem
  1113. className="half-item"
  1114. {...formItemLayout}
  1115. label="金额(万元)"
  1116. >
  1117. <span>{this.state.commodityPrice}</span>
  1118. </FormItem>
  1119. <FormItem
  1120. className="half-item"
  1121. {...formItemLayout}
  1122. label="主要项目"
  1123. >
  1124. <span>{getboutique(this.state.main)}</span>
  1125. </FormItem>
  1126. <div className="clearfix">
  1127. <FormItem
  1128. labelCol={{ span: 4 }}
  1129. wrapperCol={{ span: 16 }}
  1130. label="服务说明"
  1131. >
  1132. <span>{this.state.taskComment}</span>
  1133. </FormItem>
  1134. </div>
  1135. </div>
  1136. </Spin>
  1137. </Form>
  1138. </Modal>
  1139. <Modal
  1140. maskClosable={false}
  1141. visible={this.state.noVisible}
  1142. onOk={this.handleOk}
  1143. onCancel={this.noCancel}
  1144. width="400px"
  1145. title={"拒绝理由"}
  1146. footer=""
  1147. className="admin-desc-content"
  1148. confirmLoading={this.state.confirmLoading}
  1149. >
  1150. <Form layout="horizontal" id="demand-form">
  1151. <Spin spinning={this.state.loading}>
  1152. <div className="clearfix">
  1153. <FormItem
  1154. labelCol={{ span: 4 }}
  1155. wrapperCol={{ span: 16 }}
  1156. label="拒绝理由"
  1157. >
  1158. <Input
  1159. type="textarea"
  1160. placeholder="请输入拒绝理由"
  1161. rows={4}
  1162. value={this.state.reason}
  1163. onChange={e => {
  1164. this.setState({ reason: e.target.value });
  1165. }}
  1166. />
  1167. </FormItem>
  1168. </div>
  1169. <div className="clearfix">
  1170. <Button
  1171. className="cancel"
  1172. type="primary"
  1173. onClick={this.examOks}
  1174. style={{ marginLeft: "50px" }}
  1175. htmlType="submit"
  1176. loading={this.state.aloading}
  1177. >
  1178. 确定
  1179. </Button>
  1180. <Button
  1181. className="cancel"
  1182. type="ghost"
  1183. onClick={this.noCancel}
  1184. style={{ marginLeft: "50px" }}
  1185. >
  1186. 取消
  1187. </Button>
  1188. </div>
  1189. </Spin>
  1190. </Form>
  1191. </Modal>
  1192. {/* <Modal
  1193. visible={this.state.rizhivisible}
  1194. className="admin-desc-content"
  1195. width="800px"
  1196. maskClosable={false}
  1197. title="订单日志"
  1198. footer={null}
  1199. onCancel={this.closeOrderLog}
  1200. >
  1201. <div className="patent-table">
  1202. <Spin spinning={this.state.loading}>
  1203. <Table
  1204. bordered
  1205. columns={this.state.columnsrizhi}
  1206. dataSource={this.state.dataSourcerizhi}
  1207. pagination={false}
  1208. />
  1209. </Spin>
  1210. </div>
  1211. </Modal> */}
  1212. <OrderRiZi
  1213. dataSourcerizhi={this.state.dataSourcerizhi}
  1214. closeOrderLog={this.closeOrderLog}
  1215. visible={this.state.rizhivisible}
  1216. loading={this.state.loading}
  1217. />
  1218. </div>
  1219. </div>
  1220. );
  1221. }
  1222. })
  1223. );
  1224. export default contractChange;