contractJsy.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443
  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. 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.examineName,
  82. thisdata.processState,
  83. thisdata.status
  84. )
  85. });
  86. }
  87. this.state.pagination.total = data.data.totalCount;
  88. this.state.pagination.current = data.data.pageNo;
  89. }
  90. if (data.data && data.data.list && !data.data.list.length) {
  91. this.state.pagination.total = 0;
  92. }
  93. this.setState({
  94. dataSource: theArr,
  95. pageNo: pageNo,
  96. pagination: this.state.pagination
  97. });
  98. }.bind(this)
  99. }).always(
  100. function () {
  101. this.setState({
  102. loading: false
  103. });
  104. }.bind(this)
  105. );
  106. },
  107. getInitialState() {
  108. return {
  109. page: 1,
  110. searchData: {
  111. releaseDate: []
  112. },
  113. primaryOrderData: {}, //原订单数据
  114. orderData: {}, //现订单数据
  115. pictureUrl: [],
  116. voucherUrl: [],
  117. attachment: [],
  118. declarationBatch: 1,
  119. dataInfor: {},
  120. attachmentUrl: [],
  121. contractData: {},
  122. additionalOrderData: {},
  123. paginations: false,
  124. activeKey: "a",
  125. confirmLoading: false,
  126. aloading: false,
  127. pagination: {
  128. defaultCurrent: 1,
  129. defaultPageSize: 10,
  130. showQuickJumper: true,
  131. pageSize: 10,
  132. onChange: function (page) {
  133. this.loadData(page);
  134. this.setState({
  135. page
  136. });
  137. }.bind(this),
  138. showTotal: function (total) {
  139. return "共" + total + "条数据";
  140. }
  141. },
  142. columns: [
  143. {
  144. title: "合同编号",
  145. dataIndex: "contractNo",
  146. key: "contractNo"
  147. },
  148. {
  149. title: "订单编号",
  150. dataIndex: "orderNo",
  151. key: "orderNo"
  152. },
  153. {
  154. title: "客户名称",
  155. dataIndex: "nickname",
  156. key: "nickname",
  157. width: 150,
  158. render: (text) => {
  159. return (
  160. <Tooltip title={text}>
  161. <div
  162. // style={{
  163. // maxWidth: '150px',
  164. // overflow: 'hidden',
  165. // textOverflow: "ellipsis",
  166. // whiteSpace: 'nowrap',
  167. // }}
  168. >{text}</div>
  169. </Tooltip>
  170. )
  171. },
  172. },
  173. {
  174. title: "订单部门",
  175. dataIndex: "depName",
  176. key: "depName"
  177. },
  178. {
  179. title: "订单类型",
  180. dataIndex: "orderType",
  181. key: "orderType",
  182. render: text => {
  183. return text ? "科技项目" : "认证项目";
  184. }
  185. },
  186. {
  187. title: "下单时间",
  188. dataIndex: "establishTimes",
  189. key: "establishTimes"
  190. },
  191. {
  192. title: "订单状态",
  193. dataIndex: "orderStatus",
  194. key: "orderStatus",
  195. render: text => {
  196. return getNewOrderStatus(text);
  197. }
  198. },
  199. {
  200. title: "合同额(万元)",
  201. dataIndex: "totalAmount",
  202. key: "totalAmount"
  203. },
  204. {
  205. title: "已付额(万元)",
  206. dataIndex: "settlementAmount",
  207. key: "settlementAmount"
  208. },
  209. {
  210. title: "欠款(万元)",
  211. dataIndex: "arrears",
  212. key: "arrears"
  213. },
  214. {
  215. title: "订单负责人",
  216. dataIndex: "salesmanName",
  217. key: "salesmanName"
  218. },
  219. {
  220. title: "变更类型",
  221. dataIndex: "type",
  222. key: "type",
  223. render: text => {
  224. return getType(text);
  225. }
  226. },
  227. {
  228. title: "审核状态",
  229. dataIndex: "processStateText",
  230. key: "processStateText"
  231. },
  232. {
  233. title: "提交时间",
  234. dataIndex: "createTimes",
  235. key: "createTimes"
  236. }
  237. ],
  238. dataSource: [],
  239. // 传递给子组件的
  240. dataProps: [],
  241. columnsX: [
  242. {
  243. title: "业务项目名称",
  244. dataIndex: "commodityName",
  245. key: "commodityName",
  246. render: (text, record) => {
  247. return (
  248. <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
  249. )
  250. }
  251. },
  252. {
  253. title: "项目类别",
  254. dataIndex: "cname",
  255. key: "cname"
  256. },
  257. {
  258. title: "项目数量",
  259. dataIndex: "commodityQuantity",
  260. key: "commodityQuantity"
  261. },
  262. {
  263. title: "金额(万元)",
  264. dataIndex: "commodityPrice",
  265. key: "commodityPrice"
  266. },
  267. {
  268. title: "负责人",
  269. dataIndex: "contacts",
  270. key: "contacts"
  271. },
  272. {
  273. title: "负责人电话",
  274. dataIndex: "contactsMobile",
  275. key: "contactsMobile"
  276. },
  277. {
  278. title: "项目状态",
  279. dataIndex: "projectStatus",
  280. key: "projectStatus",
  281. render: text => {
  282. return getProjectName(text);
  283. }
  284. },
  285. {
  286. title: "主要项目",
  287. dataIndex: "main",
  288. key: "main",
  289. render: text => {
  290. return text ? "是" : "否";
  291. }
  292. },
  293. {
  294. title: "总年限",
  295. dataIndex: "yearSum",
  296. key: "yearSum",
  297. render: (text, record) => {
  298. return (
  299. <div>{["", "一年", "二年", "三年", "四年", "五年"][text]}</div>
  300. );
  301. }
  302. },
  303. {
  304. title: "年限",
  305. dataIndex: "serviceLife",
  306. key: "serviceLife",
  307. render: (text, record) => {
  308. return (
  309. <div>{!!text && JSON.parse(text).toString()}</div>
  310. );
  311. }
  312. },
  313. {
  314. title: "本次派单",
  315. dataIndex: "serviceYear",
  316. key: "serviceYear",
  317. render: (text, record) => {
  318. return (
  319. <div>{!text ? "" : text}</div>
  320. );
  321. }
  322. },
  323. {
  324. title: "项目说明",
  325. dataIndex: "taskComment",
  326. key: "taskComment",
  327. render: text => {
  328. return (
  329. <Tooltip title={text}>
  330. <div
  331. style={{
  332. width: 100,
  333. overflow: "hidden",
  334. whiteSpace: "nowrap",
  335. textOverflow: "ellipsis",
  336. }}
  337. >{text}</div>
  338. </Tooltip>
  339. )
  340. }
  341. }
  342. ],
  343. columnsrizhi: [
  344. {
  345. title: "流程",
  346. dataIndex: "processName",
  347. key: "processName"
  348. },
  349. {
  350. title: "操作人",
  351. dataIndex: "adminName",
  352. key: "adminName"
  353. },
  354. {
  355. title: "时间",
  356. dataIndex: "createDate",
  357. key: "createDate"
  358. }
  359. ],
  360. dataSourceX: [],
  361. ContactsLists: [
  362. {
  363. title: "催款科目",
  364. dataIndex: "dunSubject",
  365. key: "dunSubject",
  366. render: text => {
  367. return getjiedian(text);
  368. }
  369. },
  370. {
  371. title: "金额(万元)",
  372. dataIndex: "money",
  373. key: "money"
  374. },
  375. {
  376. title: "催款状态",
  377. dataIndex: "dunStatus",
  378. key: "dunStatus",
  379. render: text => {
  380. return getCuikuan(text);
  381. }
  382. }
  383. ]
  384. };
  385. },
  386. //页面加载函数
  387. componentWillMount() {
  388. this.loadData();
  389. },
  390. //整行点击
  391. tableRowClick(record) {
  392. this.setState(
  393. {
  394. visible: true,
  395. type: record.type,
  396. status: record.status,
  397. buttonStatus: true,
  398. orderStatus: record.orderStatus,
  399. processStateText: record.processStateText,
  400. id: record.id,
  401. orderNo: record.orderNo
  402. },
  403. () => {
  404. this.xiangqing(record.orderNo);
  405. this.xiangmu(record.orderNo);
  406. this.jiedian(record.orderNo);
  407. this.jiedianNew(record.orderNo);
  408. this.createTabs();
  409. }
  410. );
  411. },
  412. createTabs() {
  413. $.ajax({
  414. url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
  415. method: "get",
  416. data: {
  417. orderNo: this.state.orderNo
  418. },
  419. success: data => {
  420. if (data.error && data.error.length) {
  421. message.warning(data.error[0].message);
  422. } else {
  423. this.setState({
  424. tabList: data.data
  425. });
  426. }
  427. }
  428. });
  429. },
  430. //点击打卡项目详情
  431. tableRowClickX(record) {
  432. this.setState({
  433. jid: record.id, //项目ID
  434. kid: record.commodityId, //商品ID
  435. commodityName: record.commodityName, //金额
  436. commodityPrice: record.commodityPrice, //金额
  437. commodityQuantity: record.commodityQuantity, //数量
  438. taskComment: record.taskComment, //备注
  439. main: record.main.toString(), //是否为主要
  440. addnextVisible: true,
  441. dataInfor: record,
  442. addState: 0
  443. });
  444. },
  445. //项目详情关闭
  446. nextCancel() {
  447. this.setState({
  448. addnextVisible: false
  449. });
  450. },
  451. // 合同变更详情
  452. ChangeDetail(key) {
  453. let url = window.location.href.substring(7);
  454. $.ajax({
  455. method: "get",
  456. dataType: "json",
  457. crossDomain: false,
  458. url:
  459. globalConfig.context +
  460. "/api/admin/orderChange/orderChangeDetailsById",
  461. data: {
  462. id: key
  463. },
  464. success: function (data) {
  465. if (data.data) {
  466. let thisdata = data.data;
  467. Object.assign(thisdata, {
  468. processStateText: this.state.processStateText,
  469. userName: this.state.userName,
  470. contractNo: this.state.contractNo
  471. });
  472. this.setState({
  473. contractData: thisdata,
  474. voucherUrl: thisdata.voucherUrl
  475. ? splitUrl(
  476. thisdata.voucherUrl,
  477. ",",
  478. globalConfig.avatarHost + "/upload",
  479. url
  480. )
  481. : [],
  482. attachment: thisdata.attachmentUrl
  483. ? splitUrl(
  484. thisdata.attachmentUrl,
  485. ",",
  486. globalConfig.avatarHost + "/upload",
  487. url
  488. )
  489. : [],
  490. contractPictureUrl: thisdata.contractPictureUrl
  491. ? splitUrl(
  492. thisdata.contractPictureUrl,
  493. ",",
  494. globalConfig.avatarHost + "/upload",
  495. url
  496. )
  497. : []
  498. });
  499. }
  500. }.bind(this)
  501. });
  502. },
  503. //订单详情
  504. xiangqing(orderNos) {
  505. $.ajax({
  506. method: "get",
  507. dataType: "json",
  508. crossDomain: false,
  509. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  510. data: {
  511. orderNo: orderNos
  512. },
  513. success: function (data) {
  514. if (data.error.length || data.data.list == "") {
  515. if (data.error && data.error.length) {
  516. message.warning(data.error[0].message);
  517. }
  518. } else {
  519. let thisdata = data.data;
  520. this.setState({
  521. orderUid: thisdata.uid,
  522. userName: thisdata.userName,
  523. primaryOrderNo: thisdata.primaryOrder,
  524. additionalOrder: thisdata.additionalOrder,
  525. contractNo: thisdata.contractNo,
  526. // arrears: thisdata.arrears,
  527. orderData: thisdata,
  528. isAddition: thisdata.additionalOrder ? true : false,
  529. deleteSign: thisdata.deleteSign,
  530. });
  531. }
  532. }.bind(this)
  533. });
  534. },
  535. // 原订单数据
  536. primaryOrder(primaryOrder) {
  537. $.ajax({
  538. method: "get",
  539. dataType: "json",
  540. crossDomain: false,
  541. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  542. data: {
  543. orderNo: primaryOrder
  544. },
  545. success: function (data) {
  546. if (data.error.length || data.data.list == "") {
  547. if (data.error && data.error.length) {
  548. message.warning(data.error[0].message);
  549. }
  550. } else {
  551. let thisdata = data.data;
  552. this.setState({
  553. primaryOrderData: thisdata
  554. });
  555. }
  556. }.bind(this)
  557. });
  558. },
  559. // 附加订单数据
  560. additionalOrder(additionalOrder) {
  561. $.ajax({
  562. method: "get",
  563. dataType: "json",
  564. crossDomain: false,
  565. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  566. data: {
  567. orderNo: additionalOrder
  568. },
  569. success: function (data) {
  570. if (data.error.length || data.data.list == "") {
  571. if (data.error && data.error.length) {
  572. message.warning(data.error[0].message);
  573. }
  574. } else {
  575. let thisdata = data.data;
  576. this.setState({
  577. additionalOrderData: thisdata
  578. });
  579. }
  580. }.bind(this)
  581. });
  582. },
  583. //项目列表
  584. xiangmu(orderNos) {
  585. $.ajax({
  586. method: "get",
  587. dataType: "json",
  588. crossDomain: false,
  589. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  590. data: {
  591. orderNo: orderNos
  592. },
  593. success: function (data) {
  594. let theArr = [];
  595. if (data.error.length || data.data.list == "") {
  596. if (data.error && data.error.length) {
  597. message.warning(data.error[0].message);
  598. }
  599. } else {
  600. for (let i = 0; i < data.data.length; i++) {
  601. let thisdata = data.data[i];
  602. thisdata.key = i;
  603. thisdata.sort = thisdata.cSort;
  604. theArr.push(thisdata);
  605. }
  606. }
  607. this.setState({
  608. dataSourceX: theArr
  609. });
  610. }.bind(this)
  611. });
  612. },
  613. search(obj) {
  614. this.setState({
  615. searchData: obj
  616. }, () => {
  617. this.loadData(1);
  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} onClose={() => { this.setState({ showModal: false }) }} />
  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. <SearchInput search={this.search} />
  1136. </div>
  1137. </TabPane>
  1138. <TabPane tab="更改表格显示数据" key="2">
  1139. <div style={{ marginLeft: 10 }}>
  1140. <ChooseList
  1141. columns={this.state.columns}
  1142. changeFn={this.changeList}
  1143. changeList={this.state.changeList}
  1144. top={55}
  1145. margin={11}
  1146. />
  1147. </div>
  1148. </TabPane>
  1149. </Tabs>
  1150. <div className="patent-table">
  1151. <Spin spinning={this.state.loading}>
  1152. <Table
  1153. size="small"
  1154. bordered
  1155. columns={
  1156. this.state.changeList
  1157. ? this.state.changeList
  1158. : this.state.columns
  1159. }
  1160. dataSource={this.state.dataSource}
  1161. pagination={this.state.pagination}
  1162. onRowClick={this.tableRowClick}
  1163. />
  1164. </Spin>
  1165. </div>
  1166. {
  1167. this.state.visible &&
  1168. <Modal
  1169. className="customeDetails"
  1170. footer=""
  1171. maskClosable={false}
  1172. width="1200px"
  1173. visible={this.state.visible}
  1174. onOk={this.visitOk}
  1175. onCancel={this.visitCancel}
  1176. >
  1177. <Tabs
  1178. activeKey={this.state.activeKey}
  1179. onChange={this.callback}
  1180. type="card"
  1181. tabBarExtraContent={
  1182. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  1183. <OrderItemStatus deleteSign={this.state.deleteSign} />
  1184. </div>
  1185. }
  1186. >
  1187. <TabPane tab="订单详情" key="a">
  1188. <Form
  1189. layout="horizontal"
  1190. onSubmit={this.handleSubmit}
  1191. id="demand-form"
  1192. style={{ paddingBottom: "40px" }}
  1193. >
  1194. <Spin spinning={this.state.loading}>
  1195. {
  1196. this.state.activeKey == "a" &&
  1197. <OrderDetail
  1198. domId='orderDetail2'
  1199. orderUid={this.state.orderUid}
  1200. processState={this.props.processState}
  1201. orderData={this.state.orderData}
  1202. getOrderLog={this.getOrderLog}
  1203. dataSourceX={this.state.dataSourceX}
  1204. contactList={this.state.contactList}
  1205. orderNo={this.state.orderNo}
  1206. totalCui={this.state.totalCui}
  1207. contactListNew={this.state.contactListNew}
  1208. />
  1209. }
  1210. </Spin>
  1211. </Form>
  1212. </TabPane>
  1213. {tabList.map((item, index) => {
  1214. return (
  1215. <TabPane tab={"合同变更记录" + (tabList.length - index)} key={item.id}>
  1216. {
  1217. this.state.activeKey == item.id &&
  1218. <ChangeDetail
  1219. id={item.id}
  1220. domId={'hetongbiangenjilu' + (index + 1)}
  1221. orderUid={this.state.orderUid}
  1222. data={this.state.contractData}
  1223. pictureUrl={this.state.voucherUrl}
  1224. contractPictureUrl={this.state.contractPictureUrl}
  1225. attachment={this.state.attachment}
  1226. processState={this.props.processState}
  1227. loadData={this.callback}
  1228. reset={this.state.visible}
  1229. dataSource={this.state.dataProps}
  1230. onCancel={this.visitCancel}
  1231. />
  1232. }
  1233. </TabPane>
  1234. );
  1235. })}
  1236. {tabList.map((item, index) => {
  1237. if (item.usedOrder) {
  1238. return (
  1239. <TabPane
  1240. tab={"原订单" + (tabList.length - index)}
  1241. key={item.usedOrder}
  1242. >
  1243. {
  1244. this.state.activeKey == item.usedOrder &&
  1245. <Form
  1246. layout="horizontal"
  1247. onSubmit={this.handleSubmit}
  1248. id="demand-form"
  1249. style={{ paddingBottom: "40px" }}
  1250. >
  1251. <Spin spinning={this.state.loading}>
  1252. <OrderDetail
  1253. domId={'yuandingdan' + (index + 1)}
  1254. orderUid={this.state.orderUid}
  1255. processState={this.props.processState}
  1256. orderData={this.state.primaryOrderData}
  1257. getOrderLog={this.getOrderLog}
  1258. dataSourceX={this.state.dataSourceX}
  1259. contactList={this.state.contactList}
  1260. orderNo={this.state.primaryOrderNo}
  1261. totalCui={this.state.totalCui}
  1262. contactListNew={this.state.contactListNew}
  1263. />
  1264. </Spin>
  1265. </Form>
  1266. }
  1267. </TabPane>
  1268. );
  1269. } else {
  1270. return "";
  1271. }
  1272. })}
  1273. {/* {this.state.status === 4 ? (
  1274. <TabPane tab="原订单" key="3">
  1275. <Form
  1276. layout="horizontal"
  1277. onSubmit={this.handleSubmit}
  1278. id="demand-form"
  1279. style={{ paddingBottom: "40px" }}
  1280. >
  1281. <Spin spinning={this.state.loading}>
  1282. <OrderDetail
  1283. processState={this.props.processState}
  1284. orderData={this.state.primaryOrderData}
  1285. getOrderLog={this.getOrderLog}
  1286. dataSourceX={this.state.dataSourceX}
  1287. contactList={this.state.contactList}
  1288. orderNo={this.state.primaryOrderNo}
  1289. totalCui={this.state.totalCui}
  1290. contactListNew={this.state.contactListNew}
  1291. />
  1292. </Spin>
  1293. </Form>
  1294. </TabPane>
  1295. ) : (
  1296. ""
  1297. )} */}
  1298. {this.state.status === 4 && this.state.isAddition ? (
  1299. this.state.type === 4 || this.state.type === 5 ? (
  1300. <TabPane tab="附加订单" key="c">
  1301. <OrderDetail
  1302. domId='fujiadingdan'
  1303. orderUid={this.state.orderUid}
  1304. processState={this.props.processState}
  1305. orderData={this.state.additionalOrderData}
  1306. getOrderLog={this.getOrderLog}
  1307. dataSourceX={this.state.dataSourceX}
  1308. contactList={this.state.contactList}
  1309. orderNo={this.state.additionalOrder}
  1310. totalCui={this.state.totalCui}
  1311. contactListNew={this.state.contactListNew}
  1312. />
  1313. </TabPane>
  1314. ) : (
  1315. ""
  1316. )
  1317. ) : (
  1318. ""
  1319. )}
  1320. </Tabs>
  1321. </Modal>
  1322. }
  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. {
  1409. // 项目业务详情
  1410. this.state.addnextVisible &&
  1411. <NewEditProject
  1412. readOnly={true}
  1413. visible={this.state.addnextVisible}
  1414. dataInfor={this.state.dataInfor}
  1415. onCancel={this.nextCancel}
  1416. />
  1417. }
  1418. </div>
  1419. );
  1420. }
  1421. })
  1422. );
  1423. export default contractChange;