contractJsy.js 44 KB

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