contractYxy.js 47 KB

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