contractJszj.js 36 KB

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