contractYxgly.js 33 KB

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