contractYxgly.js 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  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/changeDetailYxgly.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(orderNo) {
  335. let url = window.location.href.substring(7);
  336. $.ajax({
  337. method: "get",
  338. dataType: "json",
  339. crossDomain: false,
  340. url: globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  341. data: {
  342. orderNo: orderNo
  343. },
  344. success: function(data) {
  345. if (data.data) {
  346. let thisdata = data.data;
  347. Object.assign(thisdata, {
  348. processStateText: this.state.processStateText,
  349. userName: this.state.userName,
  350. contractNo: this.state.contractNo
  351. });
  352. this.setState({
  353. contractData: thisdata,
  354. voucherUrl: thisdata.voucherUrl
  355. ? splitUrl(
  356. thisdata.voucherUrl,
  357. ",",
  358. globalConfig.avatarHost + "/upload",
  359. url
  360. )
  361. : []
  362. });
  363. }
  364. }.bind(this)
  365. });
  366. },
  367. //订单详情
  368. xiangqing(orderNos) {
  369. $.ajax({
  370. method: "get",
  371. dataType: "json",
  372. crossDomain: false,
  373. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  374. data: {
  375. orderNo: orderNos
  376. },
  377. success: function(data) {
  378. if (data.error.length || data.data.list == "") {
  379. if (data.error && data.error.length) {
  380. message.warning(data.error[0].message);
  381. }
  382. } else {
  383. let thisdata = data.data;
  384. this.setState({
  385. userName: thisdata.userName,
  386. primaryOrderNo: thisdata.primaryOrder,
  387. additionalOrder: thisdata.additionalOrder,
  388. contractNo: thisdata.contractNo,
  389. // arrears: thisdata.arrears,
  390. orderData: thisdata
  391. });
  392. }
  393. }.bind(this)
  394. });
  395. },
  396. // 原订单数据
  397. primaryOrder(primaryOrder) {
  398. $.ajax({
  399. method: "get",
  400. dataType: "json",
  401. crossDomain: false,
  402. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  403. data: {
  404. orderNo: primaryOrder
  405. },
  406. success: function(data) {
  407. if (data.error.length || data.data.list == "") {
  408. if (data.error && data.error.length) {
  409. message.warning(data.error[0].message);
  410. }
  411. } else {
  412. let thisdata = data.data;
  413. this.setState({
  414. primaryOrderData: thisdata
  415. });
  416. }
  417. }.bind(this)
  418. });
  419. },
  420. // 附加订单数据
  421. additionalOrder(additionalOrder) {
  422. $.ajax({
  423. method: "get",
  424. dataType: "json",
  425. crossDomain: false,
  426. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  427. data: {
  428. orderNo: additionalOrder
  429. },
  430. success: function(data) {
  431. if (data.error.length || data.data.list == "") {
  432. if (data.error && data.error.length) {
  433. message.warning(data.error[0].message);
  434. }
  435. } else {
  436. let thisdata = data.data;
  437. this.setState({
  438. additionalOrderData: thisdata
  439. });
  440. }
  441. }.bind(this)
  442. });
  443. },
  444. //项目列表
  445. xiangmu(orderNos) {
  446. $.ajax({
  447. method: "get",
  448. dataType: "json",
  449. crossDomain: false,
  450. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  451. data: {
  452. orderNo: orderNos
  453. },
  454. success: function(data) {
  455. let theArr = [];
  456. if (data.error.length || data.data.list == "") {
  457. if (data.error && data.error.length) {
  458. message.warning(data.error[0].message);
  459. }
  460. } else {
  461. for (let i = 0; i < data.data.length; i++) {
  462. let thisdata = data.data[i];
  463. theArr.push({
  464. key: i,
  465. id: thisdata.id,
  466. orderNo: thisdata.orderNo, //订单编号
  467. commodityId: thisdata.commodityId, //项目ID
  468. commodityName: thisdata.commodityName, //项目名称
  469. cname: thisdata.cname, //项目类别
  470. commodityPrice: thisdata.commodityPrice, //项目价格
  471. commodityQuantity: thisdata.commodityQuantity, //项目数量
  472. main: thisdata.main, //是否为主要任务
  473. taskComment: thisdata.taskComment, //任务说明
  474. contacts: thisdata.contacts, //联系人
  475. contactsMobile: thisdata.contactsMobile, //联系人电话
  476. projectStatus: thisdata.projectStatus //项目状态
  477. });
  478. }
  479. }
  480. this.setState({
  481. dataSourceX: theArr
  482. });
  483. }.bind(this)
  484. });
  485. },
  486. search(obj) {
  487. this.setState(
  488. {
  489. searchData: obj
  490. },
  491. () => {
  492. this.loadData(1);
  493. }
  494. );
  495. },
  496. rizhi(orderNo) {
  497. $.ajax({
  498. method: "get",
  499. dataType: "json",
  500. crossDomain: false,
  501. url: "/api/admin/newOrder/selectOrderLog",
  502. data: {
  503. orderNo: orderNo
  504. },
  505. success: function(data) {
  506. let theArr = [];
  507. let thisData = data.data;
  508. if (!thisData.length) {
  509. if (data.error && data.error.length) {
  510. message.warning(data.error[0].message);
  511. }
  512. thisData = {};
  513. } else {
  514. for (let i = 0; i < data.data.length; i++) {
  515. let thisdata = data.data[i];
  516. theArr.push({
  517. processName: thisdata.processName,
  518. adminName: thisdata.adminName,
  519. createDate: thisdata.createDate
  520. });
  521. }
  522. }
  523. this.setState({
  524. dataSourcerizhi: theArr
  525. });
  526. }.bind(this)
  527. });
  528. },
  529. getOrderLog(orderNo) {
  530. this.setState({
  531. rizhivisible: true
  532. });
  533. this.rizhi(orderNo);
  534. },
  535. closeOrderLog() {
  536. this.setState({
  537. rizhivisible: false
  538. });
  539. },
  540. //节点列表
  541. jiedian(orderNos) {
  542. $.ajax({
  543. method: "get",
  544. dataType: "json",
  545. crossDomain: false,
  546. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  547. data: {
  548. orderNo: orderNos
  549. },
  550. success: function(data) {
  551. let theArr = [];
  552. let thisData = [];
  553. if (data.error.length || data.data.list == "") {
  554. if (data.error && data.error.length) {
  555. message.warning(data.error[0].message);
  556. }
  557. } else {
  558. for (let i = 0; i < data.data.length; i++) {
  559. thisData = data.data[i];
  560. theArr.push({
  561. key: i,
  562. dunSubject: thisData.dunSubject
  563. ? thisData.dunSubject.toString()
  564. : "", //催款科目
  565. id: thisData.id, //节点Id
  566. money: thisData.money, //催款金额
  567. dunStatus: thisData.dunStatus //催款状态
  568. });
  569. }
  570. this.setState({
  571. contactList: theArr
  572. });
  573. }
  574. }.bind(this)
  575. });
  576. },
  577. //审核通过
  578. examOk() {
  579. $.ajax({
  580. method: "post",
  581. dataType: "json",
  582. crossDomain: false,
  583. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  584. data: {
  585. orderNo: this.state.orderNo,
  586. orderStatus: 2
  587. },
  588. success: function(data) {
  589. if (data.error.length || data.data.list == "") {
  590. if (data.error && data.error.length) {
  591. message.warning(data.error[0].message);
  592. }
  593. } else {
  594. message.success("该订单已通过审核~");
  595. this.setState({
  596. visible: false
  597. });
  598. this.reset();
  599. }
  600. }.bind(this)
  601. }).always(
  602. function() {
  603. this.setState({
  604. loading: false
  605. });
  606. }.bind(this)
  607. );
  608. },
  609. //通过发给外包
  610. outsourcing() {
  611. $.ajax({
  612. method: "post",
  613. dataType: "json",
  614. crossDomain: false,
  615. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  616. data: {
  617. orderNo: this.state.orderNo,
  618. orderStatus: 2,
  619. outsource: 1
  620. },
  621. success: function(data) {
  622. if (data.error.length || data.data.list == "") {
  623. if (data.error && data.error.length) {
  624. message.warning(data.error[0].message);
  625. }
  626. } else {
  627. message.success("该订单已通过审核~");
  628. this.setState({
  629. visible: false
  630. });
  631. this.reset();
  632. }
  633. }.bind(this)
  634. }).always(
  635. function() {
  636. this.setState({
  637. loading: false
  638. });
  639. }.bind(this)
  640. );
  641. },
  642. //审核不通过
  643. examOks() {
  644. this.setState({
  645. aloading: true
  646. });
  647. $.ajax({
  648. method: "post",
  649. dataType: "json",
  650. crossDomain: false,
  651. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  652. data: {
  653. orderNo: this.state.orderNo,
  654. orderStatus: 3,
  655. reason: this.state.reason
  656. },
  657. success: function(data) {
  658. if (data.error.length || data.data.list == "") {
  659. if (data.error && data.error.length) {
  660. message.warning(data.error[0].message);
  661. this.setState({
  662. aloading: true
  663. });
  664. }
  665. } else {
  666. message.success("该订单已被拒绝~");
  667. this.setState({
  668. visible: false,
  669. aloading: false,
  670. noVisible: false,
  671. reason: ""
  672. });
  673. this.reset();
  674. }
  675. }.bind(this)
  676. }).always(
  677. function() {
  678. this.setState({
  679. loading: false
  680. });
  681. }.bind(this)
  682. );
  683. },
  684. //点击拒绝
  685. examNo() {
  686. this.setState({
  687. noVisible: true
  688. });
  689. },
  690. callback(key) {
  691. this.setState({
  692. activeKey: key
  693. });
  694. if (key === "1") {
  695. this.xiangmu(this.state.orderNo);
  696. this.jiedian(this.state.orderNo);
  697. }
  698. if (key === "2") {
  699. this.ChangeDetail(this.state.orderNo);
  700. }
  701. if (key === "3") {
  702. this.primaryOrder(this.state.primaryOrderNo);
  703. this.xiangmu(this.state.primaryOrderNo);
  704. this.jiedian(this.state.primaryOrderNo);
  705. }
  706. if (key === "4") {
  707. this.additionalOrder(this.state.additionalOrder);
  708. this.xiangmu(this.state.additionalOrder);
  709. this.jiedian(this.state.additionalOrder);
  710. this.setState({
  711. buttonStatusA: false
  712. });
  713. } else {
  714. this.setState({
  715. buttonStatusA: true
  716. });
  717. }
  718. },
  719. closeDesc(e, s) {
  720. this.state.activeKey = "1";
  721. this.state.userDetaile = false;
  722. this.state.signBillVisible = false;
  723. this.state.visible = e;
  724. if (s) {
  725. this.loadData(this.state.pageNo);
  726. }
  727. },
  728. // 获取原订单编号
  729. getPrimaryOrder(value) {
  730. this.setState({
  731. primaryOrder: value
  732. });
  733. },
  734. getAdditionalOrder(value) {
  735. this.setState({
  736. additionalOrder: value
  737. });
  738. },
  739. getUrl(url) {
  740. let theorgCodeUrl = [];
  741. if (url.length) {
  742. let picArr = [];
  743. url.map(function(item) {
  744. if (
  745. item.response &&
  746. item.response.data &&
  747. item.response.data.length
  748. ) {
  749. picArr.push(item.response.data);
  750. }
  751. });
  752. theorgCodeUrl = picArr.join(",");
  753. }
  754. return theorgCodeUrl;
  755. },
  756. sureOut() {
  757. if (!this.state.companyName) {
  758. message.warning("公司名称不能为空");
  759. return;
  760. }
  761. if (!this.state.unitPrice) {
  762. message.warning("单价不能为空");
  763. return;
  764. }
  765. if (!this.state.unitNumber) {
  766. message.warning("数量不能为空");
  767. return;
  768. }
  769. if (!this.state.amount) {
  770. message.warning("总金额不能为空");
  771. return;
  772. }
  773. if (!this.state.outsourceRemarks) {
  774. message.warning("备注不能为空");
  775. return;
  776. }
  777. if (this.state.pictureUrl.length === 0) {
  778. message.warning("合同扫描件不能为空");
  779. return;
  780. }
  781. $.ajax({
  782. method: "POST",
  783. dataType: "json",
  784. crossDomain: false,
  785. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  786. data: {
  787. id: this.state.id,
  788. orderNo: this.state.orderNo,
  789. companyName: this.state.companyName,
  790. amount: this.state.amount,
  791. outsourceRemarks: this.state.outsourceRemarks,
  792. unitNumber: this.state.unitNumber,
  793. unitPrice: this.state.unitPrice,
  794. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  795. ? this.getUrl(this.state.attachmentUrl)
  796. : "",
  797. orderStatus: 2,
  798. pictureUrl: this.getUrl(this.state.pictureUrl).length
  799. ? this.getUrl(this.state.pictureUrl)
  800. : ""
  801. }
  802. }).done(
  803. function(data) {
  804. this.setState({
  805. loading: false
  806. });
  807. if (!data.error.length) {
  808. message.success("发起成功!");
  809. this.outReset();
  810. this.visitCancel();
  811. } else {
  812. message.warning(data.error[0].message);
  813. }
  814. }.bind(this)
  815. );
  816. },
  817. //关闭输入理由框
  818. noCancel() {
  819. this.setState({
  820. noVisible: false,
  821. aloading: false,
  822. reason: ""
  823. });
  824. },
  825. //重置
  826. reset() {
  827. this.setState({
  828. signBillVisible: false
  829. });
  830. this.state.orderNo = "";
  831. this.state.customerName = "";
  832. this.state.releaseDate[0] = undefined;
  833. this.state.releaseDate[1] = undefined;
  834. this.state.approval = undefined;
  835. this.loadData(1);
  836. },
  837. outReset() {
  838. this.setState({
  839. companyName: "",
  840. amount: "",
  841. unitPrice: "",
  842. unitNumber: "",
  843. outsourceRemarks: "",
  844. attachmentUrl: [],
  845. pictureUrl: []
  846. });
  847. },
  848. getOrgCodeUrl(e) {
  849. this.setState({ pictureUrl: e });
  850. },
  851. //关闭详情
  852. visitCancel() {
  853. this.setState(
  854. {
  855. visible: false,
  856. activeKey: "1"
  857. },
  858. () => {
  859. this.setState({
  860. activeKey: "1"
  861. });
  862. }
  863. );
  864. this.loadData(this.state.page);
  865. },
  866. visitOk() {
  867. this.setState({
  868. visible: false
  869. });
  870. },
  871. render() {
  872. const formItemLayout = {
  873. labelCol: { span: 8 },
  874. wrapperCol: { span: 14 }
  875. };
  876. const FormItem = Form.Item;
  877. const { TabPane } = Tabs;
  878. return (
  879. <div className="user-content">
  880. <div className="content-title">
  881. <span>合同变更审核订单</span>
  882. </div>
  883. <div className="user-search">
  884. <SearchInput search={this.search} />
  885. <div className="patent-table">
  886. <Spin spinning={this.state.loading}>
  887. <Table
  888. columns={this.state.columns}
  889. dataSource={this.state.dataSource}
  890. pagination={this.state.pagination}
  891. onRowClick={this.tableRowClick}
  892. />
  893. </Spin>
  894. </div>
  895. <Modal
  896. className="customeDetails"
  897. footer=""
  898. maskClosable={false}
  899. width="900px"
  900. visible={this.state.visible}
  901. onOk={this.visitOk}
  902. onCancel={this.visitCancel}
  903. >
  904. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  905. <TabPane tab="订单详情" key="1">
  906. <Form
  907. layout="horizontal"
  908. onSubmit={this.handleSubmit}
  909. id="demand-form"
  910. style={{ paddingBottom: "40px" }}
  911. >
  912. <Spin spinning={this.state.loading}>
  913. <OrderDetail
  914. orderData={this.state.orderData}
  915. getOrderLog={this.getOrderLog}
  916. dataSourceX={this.state.dataSourceX}
  917. contactList={this.state.contactList}
  918. orderNo={this.state.orderNo}
  919. />
  920. </Spin>
  921. </Form>
  922. </TabPane>
  923. <TabPane tab="合同变更记录" key="2">
  924. <ChangeDetail
  925. data={this.state.contractData}
  926. pictureUrl={this.state.voucherUrl}
  927. processState={this.props.processState}
  928. loadData={this.callback}
  929. reset={this.state.visible}
  930. />
  931. </TabPane>
  932. {this.state.status === 4 ? (
  933. <TabPane tab="原订单" key="3">
  934. <Form
  935. layout="horizontal"
  936. onSubmit={this.handleSubmit}
  937. id="demand-form"
  938. style={{ paddingBottom: "40px" }}
  939. >
  940. <Spin spinning={this.state.loading}>
  941. <OrderDetail
  942. orderData={this.state.primaryOrderData}
  943. getOrderLog={this.getOrderLog}
  944. dataSourceX={this.state.dataSourceX}
  945. contactList={this.state.contactList}
  946. orderNo={this.state.primaryOrderNo}
  947. />
  948. </Spin>
  949. </Form>
  950. </TabPane>
  951. ) : (
  952. ""
  953. )}
  954. {this.state.status === 4 ? (
  955. this.state.type === 4 || this.state.type === 5 ? (
  956. <TabPane tab="附加订单" key="4">
  957. <OrderDetail
  958. orderData={this.state.additionalOrderData}
  959. getOrderLog={this.getOrderLog}
  960. dataSourceX={this.state.dataSourceX}
  961. contactList={this.state.contactList}
  962. orderNo={this.state.additionalOrder}
  963. />
  964. </TabPane>
  965. ) : (
  966. ""
  967. )
  968. ) : (
  969. ""
  970. )}
  971. </Tabs>
  972. </Modal>
  973. <Modal
  974. maskClosable={false}
  975. visible={this.state.addnextVisible}
  976. onOk={this.nextCancel}
  977. onCancel={this.nextCancel}
  978. confirmLoading={this.state.confirmLoading}
  979. width="800px"
  980. title={"项目任务详情"}
  981. footer=""
  982. className="admin-desc-content"
  983. >
  984. <Form layout="horizontal" id="demand-form">
  985. <Spin spinning={this.state.loading}>
  986. <div className="clearfix">
  987. <FormItem
  988. className="half-item"
  989. {...formItemLayout}
  990. label="项目名称"
  991. >
  992. <span>{this.state.commodityName}</span>
  993. </FormItem>
  994. <FormItem
  995. className="half-item"
  996. {...formItemLayout}
  997. label="项目数量"
  998. >
  999. <span>{this.state.commodityQuantity}</span>
  1000. </FormItem>
  1001. <FormItem
  1002. className="half-item"
  1003. {...formItemLayout}
  1004. label="金额(万元)"
  1005. >
  1006. <span>{this.state.commodityPrice}</span>
  1007. </FormItem>
  1008. <FormItem
  1009. className="half-item"
  1010. {...formItemLayout}
  1011. label="主要项目"
  1012. >
  1013. <span>{getboutique(this.state.main)}</span>
  1014. </FormItem>
  1015. <div className="clearfix">
  1016. <FormItem
  1017. labelCol={{ span: 4 }}
  1018. wrapperCol={{ span: 16 }}
  1019. label="服务说明"
  1020. >
  1021. <span>{this.state.taskComment}</span>
  1022. </FormItem>
  1023. </div>
  1024. </div>
  1025. </Spin>
  1026. </Form>
  1027. </Modal>
  1028. <Modal
  1029. maskClosable={false}
  1030. visible={this.state.noVisible}
  1031. onOk={this.handleOk}
  1032. onCancel={this.noCancel}
  1033. width="400px"
  1034. title={"拒绝理由"}
  1035. footer=""
  1036. className="admin-desc-content"
  1037. confirmLoading={this.state.confirmLoading}
  1038. >
  1039. <Form layout="horizontal" id="demand-form">
  1040. <Spin spinning={this.state.loading}>
  1041. <div className="clearfix">
  1042. <FormItem
  1043. labelCol={{ span: 4 }}
  1044. wrapperCol={{ span: 16 }}
  1045. label="拒绝理由"
  1046. >
  1047. <Input
  1048. type="textarea"
  1049. placeholder="请输入拒绝理由"
  1050. rows={4}
  1051. value={this.state.reason}
  1052. onChange={e => {
  1053. this.setState({ reason: e.target.value });
  1054. }}
  1055. />
  1056. </FormItem>
  1057. </div>
  1058. <div className="clearfix">
  1059. <Button
  1060. className="cancel"
  1061. type="primary"
  1062. onClick={this.examOks}
  1063. style={{ marginLeft: "50px" }}
  1064. htmlType="submit"
  1065. loading={this.state.aloading}
  1066. >
  1067. 确定
  1068. </Button>
  1069. <Button
  1070. className="cancel"
  1071. type="ghost"
  1072. onClick={this.noCancel}
  1073. style={{ marginLeft: "50px" }}
  1074. >
  1075. 取消
  1076. </Button>
  1077. </div>
  1078. </Spin>
  1079. </Form>
  1080. </Modal>
  1081. <Modal
  1082. visible={this.state.rizhivisible}
  1083. className="admin-desc-content"
  1084. width="800px"
  1085. maskClosable={false}
  1086. title="订单日志"
  1087. footer={null}
  1088. onCancel={this.closeOrderLog}
  1089. >
  1090. <div className="patent-table">
  1091. <Spin spinning={this.state.loading}>
  1092. <Table
  1093. columns={this.state.columnsrizhi}
  1094. dataSource={this.state.dataSourcerizhi}
  1095. pagination={false}
  1096. />
  1097. </Spin>
  1098. </div>
  1099. </Modal>
  1100. </div>
  1101. </div>
  1102. );
  1103. }
  1104. })
  1105. );
  1106. export default contractChange;