contractJsy.js 44 KB

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