contractJsy.js 35 KB

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