contractCwzy.js 37 KB

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