contractJszj.js 43 KB

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