contractJsy.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455
  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. <Modal
  1190. className="customeDetails"
  1191. footer=""
  1192. maskClosable={false}
  1193. width="1200px"
  1194. visible={this.state.visible}
  1195. onOk={this.visitOk}
  1196. onCancel={this.visitCancel}
  1197. >
  1198. <Tabs
  1199. activeKey={this.state.activeKey}
  1200. onChange={this.callback}
  1201. type="card"
  1202. tabBarExtraContent={
  1203. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  1204. <OrderItemStatus deleteSign={this.state.deleteSign} />
  1205. </div>
  1206. }
  1207. >
  1208. <TabPane tab="订单详情" key="a">
  1209. <Form
  1210. layout="horizontal"
  1211. onSubmit={this.handleSubmit}
  1212. id="demand-form"
  1213. style={{ paddingBottom: "40px" }}
  1214. >
  1215. <Spin spinning={this.state.loading}>
  1216. <OrderDetail
  1217. domId='orderDetail2'
  1218. orderUid={this.state.orderUid}
  1219. processState={this.props.processState}
  1220. orderData={this.state.orderData}
  1221. getOrderLog={this.getOrderLog}
  1222. dataSourceX={this.state.dataSourceX}
  1223. contactList={this.state.contactList}
  1224. orderNo={this.state.orderNo}
  1225. totalCui={this.state.totalCui}
  1226. contactListNew={this.state.contactListNew}
  1227. />
  1228. </Spin>
  1229. </Form>
  1230. </TabPane>
  1231. {tabList.map((item, index) => {
  1232. return (
  1233. <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
  1234. <ChangeDetail
  1235. id={item.id}
  1236. domId={'hetongbiangenjilu' + (index + 1)}
  1237. orderUid={this.state.orderUid}
  1238. data={this.state.contractData}
  1239. pictureUrl={this.state.voucherUrl}
  1240. contractPictureUrl={this.state.contractPictureUrl}
  1241. attachment={this.state.attachment}
  1242. processState={this.props.processState}
  1243. loadData={this.callback}
  1244. reset={this.state.visible}
  1245. dataSource={this.state.dataProps}
  1246. onCancel={this.visitCancel}
  1247. />
  1248. </TabPane>
  1249. );
  1250. })}
  1251. {tabList.map((item, index) => {
  1252. if (item.usedOrder) {
  1253. return (
  1254. <TabPane
  1255. tab={"原订单" + (index + 1)}
  1256. key={item.usedOrder}
  1257. >
  1258. <Form
  1259. layout="horizontal"
  1260. onSubmit={this.handleSubmit}
  1261. id="demand-form"
  1262. style={{ paddingBottom: "40px" }}
  1263. >
  1264. <Spin spinning={this.state.loading}>
  1265. <OrderDetail
  1266. domId={'yuandingdan' + (index + 1)}
  1267. orderUid={this.state.orderUid}
  1268. processState={this.props.processState}
  1269. orderData={this.state.primaryOrderData}
  1270. getOrderLog={this.getOrderLog}
  1271. dataSourceX={this.state.dataSourceX}
  1272. contactList={this.state.contactList}
  1273. orderNo={this.state.primaryOrderNo}
  1274. totalCui={this.state.totalCui}
  1275. contactListNew={this.state.contactListNew}
  1276. />
  1277. </Spin>
  1278. </Form>
  1279. </TabPane>
  1280. );
  1281. } else {
  1282. return "";
  1283. }
  1284. })}
  1285. {/* {this.state.status === 4 ? (
  1286. <TabPane tab="原订单" key="3">
  1287. <Form
  1288. layout="horizontal"
  1289. onSubmit={this.handleSubmit}
  1290. id="demand-form"
  1291. style={{ paddingBottom: "40px" }}
  1292. >
  1293. <Spin spinning={this.state.loading}>
  1294. <OrderDetail
  1295. processState={this.props.processState}
  1296. orderData={this.state.primaryOrderData}
  1297. getOrderLog={this.getOrderLog}
  1298. dataSourceX={this.state.dataSourceX}
  1299. contactList={this.state.contactList}
  1300. orderNo={this.state.primaryOrderNo}
  1301. totalCui={this.state.totalCui}
  1302. contactListNew={this.state.contactListNew}
  1303. />
  1304. </Spin>
  1305. </Form>
  1306. </TabPane>
  1307. ) : (
  1308. ""
  1309. )} */}
  1310. {this.state.status === 4 && this.state.isAddition ? (
  1311. this.state.type === 4 || this.state.type === 5 ? (
  1312. <TabPane tab="附加订单" key="c">
  1313. <OrderDetail
  1314. domId='fujiadingdan'
  1315. orderUid={this.state.orderUid}
  1316. processState={this.props.processState}
  1317. orderData={this.state.additionalOrderData}
  1318. getOrderLog={this.getOrderLog}
  1319. dataSourceX={this.state.dataSourceX}
  1320. contactList={this.state.contactList}
  1321. orderNo={this.state.additionalOrder}
  1322. totalCui={this.state.totalCui}
  1323. contactListNew={this.state.contactListNew}
  1324. />
  1325. </TabPane>
  1326. ) : (
  1327. ""
  1328. )
  1329. ) : (
  1330. ""
  1331. )}
  1332. </Tabs>
  1333. </Modal>
  1334. <Modal
  1335. maskClosable={false}
  1336. visible={this.state.noVisible}
  1337. onOk={this.handleOk}
  1338. onCancel={this.noCancel}
  1339. width="400px"
  1340. title={"拒绝理由"}
  1341. footer=""
  1342. className="admin-desc-content"
  1343. confirmLoading={this.state.confirmLoading}
  1344. >
  1345. <Form layout="horizontal" id="demand-form">
  1346. <Spin spinning={this.state.loading}>
  1347. <div className="clearfix">
  1348. <FormItem
  1349. labelCol={{ span: 4 }}
  1350. wrapperCol={{ span: 16 }}
  1351. label="拒绝理由"
  1352. >
  1353. <Input
  1354. type="textarea"
  1355. placeholder="请输入拒绝理由"
  1356. rows={4}
  1357. value={this.state.reason}
  1358. onChange={e => {
  1359. this.setState({ reason: e.target.value });
  1360. }}
  1361. />
  1362. </FormItem>
  1363. </div>
  1364. <div className="clearfix">
  1365. <Button
  1366. className="cancel"
  1367. type="primary"
  1368. onClick={this.examOks}
  1369. style={{ marginLeft: "50px" }}
  1370. htmlType="submit"
  1371. loading={this.state.aloading}
  1372. >
  1373. 确定
  1374. </Button>
  1375. <Button
  1376. className="cancel"
  1377. type="ghost"
  1378. onClick={this.noCancel}
  1379. style={{ marginLeft: "50px" }}
  1380. >
  1381. 取消
  1382. </Button>
  1383. </div>
  1384. </Spin>
  1385. </Form>
  1386. </Modal>
  1387. {/* <Modal
  1388. visible={this.state.rizhivisible}
  1389. className="admin-desc-content"
  1390. width="800px"
  1391. maskClosable={false}
  1392. title="订单日志"
  1393. footer={null}
  1394. onCancel={this.closeOrderLog}
  1395. >
  1396. <div className="patent-table">
  1397. <Spin spinning={this.state.loading}>
  1398. <Table
  1399. bordered
  1400. columns={this.state.columnsrizhi}
  1401. dataSource={this.state.dataSourcerizhi}
  1402. pagination={false}
  1403. />
  1404. </Spin>
  1405. </div>
  1406. </Modal> */}
  1407. <OrderRiZi
  1408. dataSourcerizhi={this.state.dataSourcerizhi}
  1409. closeOrderLog={this.closeOrderLog}
  1410. visible={this.state.rizhivisible}
  1411. loading={this.state.loading}
  1412. />
  1413. </div>
  1414. {/* {this.state.addnextVisible && <ProjectDetailsReadOnly
  1415. infor={this.state.dataInfor}
  1416. visible={this.state.addnextVisible}
  1417. onCancel={this.nextCancel}
  1418. />} */}
  1419. {
  1420. // 项目业务详情
  1421. this.state.addnextVisible &&
  1422. <NewEditProject
  1423. readOnly={true}
  1424. visible={this.state.addnextVisible}
  1425. dataInfor={this.state.dataInfor}
  1426. onCancel={this.nextCancel}
  1427. />
  1428. }
  1429. </div>
  1430. );
  1431. }
  1432. })
  1433. );
  1434. export default contractChange;