contractJsy.js 37 KB

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