contractJsy.js 43 KB

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