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