contractYxy.js 37 KB

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