contractJsy.js 43 KB

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