contractCwzj.js 33 KB

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