contractYxy.js 45 KB

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