contractYxgly.js 35 KB

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