contractJsy.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191
  1. import React from "react";
  2. import { Button, Input, Spin, Table, message, Form, Modal, Tabs } 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. const contractChange = Form.create()(
  22. React.createClass({
  23. loadData(pageNo) {
  24. this.setState({
  25. loading: true
  26. });
  27. $.ajax({
  28. method: "get",
  29. dataType: "json",
  30. crossDomain: false,
  31. url: globalConfig.context + "/api/admin/orderChange/orderChangeList",
  32. data: {
  33. pageNo: pageNo || this.state.page || 1,
  34. pageSize: this.state.pagination.pageSize,
  35. userName: this.state.searchData.userNameSearch,
  36. processState: this.props.processState,
  37. timeType: this.state.searchData.timeTypeSearch,
  38. startTime: this.state.searchData.releaseDate[0],
  39. endTime: this.state.searchData.releaseDate[1],
  40. salesmanName: this.state.searchData.salesmanNameSearch,
  41. complete: this.state.searchData.completeSearch || 1,
  42. depId: this.state.searchData.depIdSearch
  43. },
  44. success: function(data) {
  45. ShowModal(this);
  46. let theArr = [];
  47. if (data.error.length || data.data.list == "") {
  48. if (data.error && data.error.length) {
  49. message.warning(data.error[0].message);
  50. }
  51. } else {
  52. for (let i = 0; i < data.data.list.length; i++) {
  53. let thisdata = data.data.list[i];
  54. theArr.push({
  55. key: i,
  56. orderNo: thisdata.orderNo,
  57. createTimes: thisdata.createTimes,
  58. nickname: thisdata.nickname,
  59. orderType: thisdata.orderType,
  60. establishTimes: thisdata.establishTimes,
  61. orderStatus: thisdata.orderStatus,
  62. totalAmount: thisdata.totalAmount,
  63. settlementAmount: thisdata.settlementAmount,
  64. arrears: thisdata.arrears,
  65. salesmanName: thisdata.salesmanName,
  66. depName: thisdata.depName,
  67. processState: thisdata.processState,
  68. type: thisdata.type,
  69. status: thisdata.status,
  70. id: thisdata.id,
  71. contractNo: thisdata.contractNo,
  72. processStateText: getProcessStatusNew(
  73. thisdata.processState,
  74. thisdata.status
  75. )
  76. });
  77. }
  78. this.state.pagination.total = data.data.totalCount;
  79. this.state.pagination.current = data.data.pageNo;
  80. }
  81. if (data.data && data.data.list && !data.data.list.length) {
  82. this.state.pagination.total = 0;
  83. }
  84. this.setState({
  85. dataSource: theArr,
  86. pageNo: pageNo,
  87. pagination: this.state.pagination
  88. });
  89. }.bind(this)
  90. }).always(
  91. function() {
  92. this.setState({
  93. loading: false
  94. });
  95. }.bind(this)
  96. );
  97. },
  98. getInitialState() {
  99. return {
  100. page: 1,
  101. searchData: {
  102. releaseDate: []
  103. },
  104. primaryOrderData: {}, //原订单数据
  105. orderData: {}, //现订单数据
  106. pictureUrl: [],
  107. voucherUrl: [],
  108. attachmentUrl: [],
  109. contractData: {},
  110. additionalOrderData: {},
  111. paginations: false,
  112. activeKey: "1",
  113. confirmLoading: false,
  114. aloading: false,
  115. pagination: {
  116. defaultCurrent: 1,
  117. defaultPageSize: 10,
  118. showQuickJumper: true,
  119. pageSize: 10,
  120. onChange: function(page) {
  121. this.loadData(page);
  122. this.setState({
  123. page
  124. });
  125. }.bind(this),
  126. showTotal: function(total) {
  127. return "共" + total + "条数据";
  128. }
  129. },
  130. columns: [
  131. {
  132. title: "合同编号",
  133. dataIndex: "contractNo",
  134. key: "contractNo"
  135. },
  136. {
  137. title: "订单编号",
  138. dataIndex: "orderNo",
  139. key: "orderNo"
  140. },
  141. {
  142. title: "客户名称",
  143. dataIndex: "nickname",
  144. key: "nickname"
  145. },
  146. {
  147. title: "订单部门",
  148. dataIndex: "depName",
  149. key: "depName"
  150. },
  151. {
  152. title: "订单类型",
  153. dataIndex: "orderType",
  154. key: "orderType",
  155. render: text => {
  156. return text ? "科技项目" : "认证项目";
  157. }
  158. },
  159. {
  160. title: "下单时间",
  161. dataIndex: "establishTimes",
  162. key: "establishTimes"
  163. },
  164. {
  165. title: "订单状态",
  166. dataIndex: "orderStatus",
  167. key: "orderStatus",
  168. render: text => {
  169. return getNewOrderStatus(text);
  170. }
  171. },
  172. {
  173. title: "合同额(万元)",
  174. dataIndex: "totalAmount",
  175. key: "totalAmount"
  176. },
  177. {
  178. title: "已付额(万元)",
  179. dataIndex: "settlementAmount",
  180. key: "settlementAmount"
  181. },
  182. {
  183. title: "欠款(万元)",
  184. dataIndex: "arrears",
  185. key: "arrears"
  186. },
  187. {
  188. title: "订单负责人",
  189. dataIndex: "salesmanName",
  190. key: "salesmanName"
  191. },
  192. {
  193. title: "变更类型",
  194. dataIndex: "type",
  195. key: "type",
  196. render: text => {
  197. return getType(text);
  198. }
  199. },
  200. {
  201. title: "审核状态",
  202. dataIndex: "processStateText",
  203. key: "processStateText"
  204. },
  205. {
  206. title: "提交时间",
  207. dataIndex: "createTimes",
  208. key: "createTimes"
  209. }
  210. ],
  211. dataSource: [],
  212. // 传递给子组件的
  213. dataProps: [],
  214. columnsX: [
  215. {
  216. title: "业务项目名称",
  217. dataIndex: "commodityName",
  218. key: "commodityName"
  219. },
  220. {
  221. title: "项目类别",
  222. dataIndex: "cname",
  223. key: "cname"
  224. },
  225. {
  226. title: "项目数量",
  227. dataIndex: "commodityQuantity",
  228. key: "commodityQuantity"
  229. },
  230. {
  231. title: "金额(万元)",
  232. dataIndex: "commodityPrice",
  233. key: "commodityPrice"
  234. },
  235. {
  236. title: "负责人",
  237. dataIndex: "contacts",
  238. key: "contacts"
  239. },
  240. {
  241. title: "负责人电话",
  242. dataIndex: "contactsMobile",
  243. key: "contactsMobile"
  244. },
  245. {
  246. title: "项目状态",
  247. dataIndex: "projectStatus",
  248. key: "projectStatus",
  249. render: text => {
  250. return getProjectStatus(text);
  251. }
  252. },
  253. {
  254. title: "主要项目",
  255. dataIndex: "main",
  256. key: "main",
  257. render: text => {
  258. return text ? "是" : "否";
  259. }
  260. },
  261. {
  262. title: "项目说明",
  263. dataIndex: "taskComment",
  264. key: "taskComment",
  265. render: text => {
  266. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  267. }
  268. }
  269. ],
  270. columnsrizhi: [
  271. {
  272. title: "流程",
  273. dataIndex: "processName",
  274. key: "processName"
  275. },
  276. {
  277. title: "操作人",
  278. dataIndex: "adminName",
  279. key: "adminName"
  280. },
  281. {
  282. title: "时间",
  283. dataIndex: "createDate",
  284. key: "createDate"
  285. }
  286. ],
  287. dataSourceX: [],
  288. ContactsLists: [
  289. {
  290. title: "催款科目",
  291. dataIndex: "dunSubject",
  292. key: "dunSubject",
  293. render: text => {
  294. return getjiedian(text);
  295. }
  296. },
  297. {
  298. title: "金额(万)",
  299. dataIndex: "money",
  300. key: "money"
  301. },
  302. {
  303. title: "催款状态",
  304. dataIndex: "dunStatus",
  305. key: "dunStatus",
  306. render: text => {
  307. return getCuikuan(text);
  308. }
  309. }
  310. ]
  311. };
  312. },
  313. //页面加载函数
  314. componentWillMount() {
  315. this.loadData();
  316. },
  317. //整行点击
  318. tableRowClick(record) {
  319. this.setState(
  320. {
  321. visible: true,
  322. type: record.type,
  323. status: record.status,
  324. buttonStatus: true,
  325. orderStatus: record.orderStatus,
  326. processStateText: record.processStateText,
  327. id: record.id,
  328. orderNo: record.orderNo
  329. },
  330. () => {
  331. this.xiangqing(record.orderNo);
  332. this.xiangmu(record.orderNo);
  333. this.jiedian(record.orderNo);
  334. }
  335. );
  336. },
  337. //点击打卡项目详情
  338. tableRowClickX(record) {
  339. this.setState({
  340. jid: record.id, //项目ID
  341. kid: record.commodityId, //商品ID
  342. commodityName: record.commodityName, //金额
  343. commodityPrice: record.commodityPrice, //金额
  344. commodityQuantity: record.commodityQuantity, //数量
  345. taskComment: record.taskComment, //备注
  346. main: record.main.toString(), //是否为主要
  347. addnextVisible: true,
  348. addState: 0
  349. });
  350. },
  351. //项目详情关闭
  352. nextCancel() {
  353. this.setState({
  354. addnextVisible: false
  355. });
  356. },
  357. // 合同变更详情
  358. ChangeDetail(orderNo) {
  359. let url = window.location.href.substring(7);
  360. $.ajax({
  361. method: "get",
  362. dataType: "json",
  363. crossDomain: false,
  364. url:
  365. globalConfig.context +
  366. "/api/admin/orderChange/orderChangeDetailsById",
  367. data: {
  368. id: this.state.id
  369. },
  370. success: function(data) {
  371. if (data.data) {
  372. let thisdata = data.data;
  373. Object.assign(thisdata, {
  374. processStateText: this.state.processStateText,
  375. userName: this.state.userName,
  376. contractNo: this.state.contractNo
  377. });
  378. this.setState({
  379. contractData: thisdata,
  380. voucherUrl: thisdata.voucherUrl
  381. ? splitUrl(
  382. thisdata.voucherUrl,
  383. ",",
  384. globalConfig.avatarHost + "/upload",
  385. url
  386. )
  387. : []
  388. });
  389. }
  390. }.bind(this)
  391. });
  392. },
  393. //订单详情
  394. xiangqing(orderNos) {
  395. $.ajax({
  396. method: "get",
  397. dataType: "json",
  398. crossDomain: false,
  399. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  400. data: {
  401. orderNo: orderNos
  402. },
  403. success: function(data) {
  404. if (data.error.length || data.data.list == "") {
  405. if (data.error && data.error.length) {
  406. message.warning(data.error[0].message);
  407. }
  408. } else {
  409. let thisdata = data.data;
  410. this.setState({
  411. userName: thisdata.userName,
  412. primaryOrderNo: thisdata.primaryOrder,
  413. additionalOrder: thisdata.additionalOrder,
  414. contractNo: thisdata.contractNo,
  415. // arrears: thisdata.arrears,
  416. orderData: thisdata
  417. });
  418. }
  419. }.bind(this)
  420. });
  421. },
  422. // 原订单数据
  423. primaryOrder(primaryOrder) {
  424. $.ajax({
  425. method: "get",
  426. dataType: "json",
  427. crossDomain: false,
  428. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  429. data: {
  430. orderNo: primaryOrder
  431. },
  432. success: function(data) {
  433. if (data.error.length || data.data.list == "") {
  434. if (data.error && data.error.length) {
  435. message.warning(data.error[0].message);
  436. }
  437. } else {
  438. let thisdata = data.data;
  439. this.setState({
  440. primaryOrderData: thisdata
  441. });
  442. }
  443. }.bind(this)
  444. });
  445. },
  446. // 附加订单数据
  447. additionalOrder(additionalOrder) {
  448. $.ajax({
  449. method: "get",
  450. dataType: "json",
  451. crossDomain: false,
  452. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  453. data: {
  454. orderNo: additionalOrder
  455. },
  456. success: function(data) {
  457. if (data.error.length || data.data.list == "") {
  458. if (data.error && data.error.length) {
  459. message.warning(data.error[0].message);
  460. }
  461. } else {
  462. let thisdata = data.data;
  463. this.setState({
  464. additionalOrderData: thisdata
  465. });
  466. }
  467. }.bind(this)
  468. });
  469. },
  470. //项目列表
  471. xiangmu(orderNos) {
  472. $.ajax({
  473. method: "get",
  474. dataType: "json",
  475. crossDomain: false,
  476. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  477. data: {
  478. orderNo: orderNos
  479. },
  480. success: function(data) {
  481. let theArr = [];
  482. if (data.error.length || data.data.list == "") {
  483. if (data.error && data.error.length) {
  484. message.warning(data.error[0].message);
  485. }
  486. } else {
  487. for (let i = 0; i < data.data.length; i++) {
  488. let thisdata = data.data[i];
  489. theArr.push({
  490. key: i,
  491. id: thisdata.id,
  492. orderNo: thisdata.orderNo, //订单编号
  493. commodityId: thisdata.commodityId, //项目ID
  494. commodityName: thisdata.commodityName, //项目名称
  495. cname: thisdata.cname, //项目类别
  496. commodityPrice: thisdata.commodityPrice, //项目价格
  497. commodityQuantity: thisdata.commodityQuantity, //项目数量
  498. main: thisdata.main, //是否为主要任务
  499. taskComment: thisdata.taskComment, //任务说明
  500. contacts: thisdata.contacts, //联系人
  501. contactsMobile: thisdata.contactsMobile, //联系人电话
  502. projectStatus: thisdata.projectStatus //项目状态
  503. });
  504. }
  505. }
  506. this.setState({
  507. dataSourceX: theArr
  508. });
  509. }.bind(this)
  510. });
  511. },
  512. search(obj) {
  513. this.setState(
  514. {
  515. searchData: obj
  516. },
  517. () => {
  518. this.loadData(1);
  519. }
  520. );
  521. },
  522. rizhi(orderNo) {
  523. $.ajax({
  524. method: "get",
  525. dataType: "json",
  526. crossDomain: false,
  527. url: "/api/admin/newOrder/selectOrderLog",
  528. data: {
  529. orderNo: orderNo
  530. },
  531. success: function(data) {
  532. let theArr = [];
  533. let thisData = data.data;
  534. if (!thisData.length) {
  535. if (data.error && data.error.length) {
  536. message.warning(data.error[0].message);
  537. }
  538. thisData = {};
  539. } else {
  540. for (let i = 0; i < data.data.length; i++) {
  541. let thisdata = data.data[i];
  542. theArr.push({
  543. processName: thisdata.processName,
  544. adminName: thisdata.adminName,
  545. createDate: thisdata.createDate
  546. });
  547. }
  548. }
  549. this.setState({
  550. dataSourcerizhi: theArr
  551. });
  552. }.bind(this)
  553. });
  554. },
  555. getOrderLog(orderNo) {
  556. this.setState({
  557. rizhivisible: true
  558. });
  559. this.rizhi(orderNo);
  560. },
  561. closeOrderLog() {
  562. this.setState({
  563. rizhivisible: false
  564. });
  565. },
  566. //节点列表
  567. jiedian(orderNos) {
  568. $.ajax({
  569. method: "get",
  570. dataType: "json",
  571. crossDomain: false,
  572. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  573. data: {
  574. orderNo: orderNos
  575. },
  576. success: function(data) {
  577. let theArr = [];
  578. let thisData = [];
  579. if (data.error.length || data.data.list == "") {
  580. if (data.error && data.error.length) {
  581. message.warning(data.error[0].message);
  582. }
  583. } else {
  584. for (let i = 0; i < data.data.length; i++) {
  585. thisData = data.data[i];
  586. theArr.push({
  587. key: i,
  588. dunSubject: thisData.dunSubject
  589. ? thisData.dunSubject.toString()
  590. : "", //催款科目
  591. id: thisData.id, //节点Id
  592. money: thisData.money, //催款金额
  593. dunStatus: thisData.dunStatus //催款状态
  594. });
  595. }
  596. this.setState({
  597. contactList: theArr
  598. });
  599. }
  600. }.bind(this)
  601. });
  602. },
  603. //审核通过
  604. examOk() {
  605. $.ajax({
  606. method: "post",
  607. dataType: "json",
  608. crossDomain: false,
  609. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  610. data: {
  611. orderNo: this.state.orderNo,
  612. orderStatus: 2
  613. },
  614. success: function(data) {
  615. if (data.error.length || data.data.list == "") {
  616. if (data.error && data.error.length) {
  617. message.warning(data.error[0].message);
  618. }
  619. } else {
  620. message.success("该订单已通过审核~");
  621. this.setState({
  622. visible: false
  623. });
  624. this.reset();
  625. }
  626. }.bind(this)
  627. }).always(
  628. function() {
  629. this.setState({
  630. loading: false
  631. });
  632. }.bind(this)
  633. );
  634. },
  635. //通过发给外包
  636. outsourcing() {
  637. $.ajax({
  638. method: "post",
  639. dataType: "json",
  640. crossDomain: false,
  641. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  642. data: {
  643. orderNo: this.state.orderNo,
  644. orderStatus: 2,
  645. outsource: 1
  646. },
  647. success: function(data) {
  648. if (data.error.length || data.data.list == "") {
  649. if (data.error && data.error.length) {
  650. message.warning(data.error[0].message);
  651. }
  652. } else {
  653. message.success("该订单已通过审核~");
  654. this.setState({
  655. visible: false
  656. });
  657. this.reset();
  658. }
  659. }.bind(this)
  660. }).always(
  661. function() {
  662. this.setState({
  663. loading: false
  664. });
  665. }.bind(this)
  666. );
  667. },
  668. //审核不通过
  669. examOks() {
  670. this.setState({
  671. aloading: true
  672. });
  673. $.ajax({
  674. method: "post",
  675. dataType: "json",
  676. crossDomain: false,
  677. url: globalConfig.context + "/api/admin/newOrder/auditOrderNew",
  678. data: {
  679. orderNo: this.state.orderNo,
  680. orderStatus: 3,
  681. reason: this.state.reason
  682. },
  683. success: function(data) {
  684. if (data.error.length || data.data.list == "") {
  685. if (data.error && data.error.length) {
  686. message.warning(data.error[0].message);
  687. this.setState({
  688. aloading: true
  689. });
  690. }
  691. } else {
  692. message.success("该订单已被拒绝~");
  693. this.setState({
  694. visible: false,
  695. aloading: false,
  696. noVisible: false,
  697. reason: ""
  698. });
  699. this.reset();
  700. }
  701. }.bind(this)
  702. }).always(
  703. function() {
  704. this.setState({
  705. loading: false
  706. });
  707. }.bind(this)
  708. );
  709. },
  710. //点击拒绝
  711. examNo() {
  712. this.setState({
  713. noVisible: true
  714. });
  715. },
  716. loadDataChange() {
  717. $.ajax({
  718. method: "get",
  719. dataType: "json",
  720. async: false,
  721. crossDomain: false,
  722. url: globalConfig.context + "/api/admin/orderChange/orderChangeLogList",
  723. data: {
  724. changeId: this.state.id
  725. },
  726. success: function(data) {
  727. if (data.error.length || data.data.list == "") {
  728. if (data.error && data.error.length) {
  729. message.warning(data.error[0].message);
  730. }
  731. } else {
  732. // console.log("拿到历史", data.data);
  733. this.setState({
  734. dataProps: data.data
  735. });
  736. }
  737. }.bind(this)
  738. });
  739. },
  740. callback(key) {
  741. this.setState({
  742. activeKey: key
  743. });
  744. if (key === "1") {
  745. this.xiangmu(this.state.orderNo);
  746. this.jiedian(this.state.orderNo);
  747. }
  748. if (key === "2") {
  749. this.ChangeDetail(this.state.orderNo);
  750. this.loadDataChange();
  751. }
  752. if (key === "3") {
  753. this.primaryOrder(this.state.primaryOrderNo);
  754. this.xiangmu(this.state.primaryOrderNo);
  755. this.jiedian(this.state.primaryOrderNo);
  756. }
  757. if (key === "4") {
  758. this.additionalOrder(this.state.additionalOrder);
  759. this.xiangmu(this.state.additionalOrder);
  760. this.jiedian(this.state.additionalOrder);
  761. this.setState({
  762. buttonStatusA: false
  763. });
  764. } else {
  765. this.setState({
  766. buttonStatusA: true
  767. });
  768. }
  769. },
  770. closeDesc(e, s) {
  771. this.state.activeKey = "1";
  772. this.state.userDetaile = false;
  773. this.state.signBillVisible = false;
  774. this.state.visible = e;
  775. if (s) {
  776. this.loadData(this.state.pageNo);
  777. }
  778. },
  779. // 获取原订单编号
  780. getPrimaryOrder(value) {
  781. this.setState({
  782. primaryOrder: value
  783. });
  784. },
  785. getAdditionalOrder(value) {
  786. this.setState({
  787. additionalOrder: value
  788. });
  789. },
  790. getUrl(url) {
  791. let theorgCodeUrl = [];
  792. if (url.length) {
  793. let picArr = [];
  794. url.map(function(item) {
  795. if (
  796. item.response &&
  797. item.response.data &&
  798. item.response.data.length
  799. ) {
  800. picArr.push(item.response.data);
  801. }
  802. });
  803. theorgCodeUrl = picArr.join(",");
  804. }
  805. return theorgCodeUrl;
  806. },
  807. sureOut() {
  808. if (!this.state.companyName) {
  809. message.warning("公司名称不能为空");
  810. return;
  811. }
  812. if (!this.state.unitPrice) {
  813. message.warning("单价不能为空");
  814. return;
  815. }
  816. if (!this.state.unitNumber) {
  817. message.warning("数量不能为空");
  818. return;
  819. }
  820. if (!this.state.amount) {
  821. message.warning("总金额不能为空");
  822. return;
  823. }
  824. if (!this.state.outsourceRemarks) {
  825. message.warning("备注不能为空");
  826. return;
  827. }
  828. if (this.state.pictureUrl.length === 0) {
  829. message.warning("合同扫描件不能为空");
  830. return;
  831. }
  832. $.ajax({
  833. method: "POST",
  834. dataType: "json",
  835. crossDomain: false,
  836. url: globalConfig.context + "/api/admin/outsourceOrg/auditOutsource",
  837. data: {
  838. id: this.state.id,
  839. orderNo: this.state.orderNo,
  840. companyName: this.state.companyName,
  841. amount: this.state.amount,
  842. outsourceRemarks: this.state.outsourceRemarks,
  843. unitNumber: this.state.unitNumber,
  844. unitPrice: this.state.unitPrice,
  845. attachmentUrl: this.getUrl(this.state.attachmentUrl).length
  846. ? this.getUrl(this.state.attachmentUrl)
  847. : "",
  848. orderStatus: 2,
  849. pictureUrl: this.getUrl(this.state.pictureUrl).length
  850. ? this.getUrl(this.state.pictureUrl)
  851. : ""
  852. }
  853. }).done(
  854. function(data) {
  855. this.setState({
  856. loading: false
  857. });
  858. if (!data.error.length) {
  859. message.success("发起成功!");
  860. this.outReset();
  861. this.visitCancel();
  862. } else {
  863. message.warning(data.error[0].message);
  864. }
  865. }.bind(this)
  866. );
  867. },
  868. //关闭输入理由框
  869. noCancel() {
  870. this.setState({
  871. noVisible: false,
  872. aloading: false,
  873. reason: ""
  874. });
  875. },
  876. //重置
  877. reset() {
  878. this.setState({
  879. signBillVisible: false
  880. });
  881. this.state.orderNo = "";
  882. this.state.customerName = "";
  883. this.state.releaseDate[0] = undefined;
  884. this.state.releaseDate[1] = undefined;
  885. this.state.approval = undefined;
  886. this.loadData(1);
  887. },
  888. outReset() {
  889. this.setState({
  890. companyName: "",
  891. amount: "",
  892. unitPrice: "",
  893. unitNumber: "",
  894. outsourceRemarks: "",
  895. attachmentUrl: [],
  896. pictureUrl: []
  897. });
  898. },
  899. getOrgCodeUrl(e) {
  900. this.setState({ pictureUrl: e });
  901. },
  902. //关闭详情
  903. visitCancel() {
  904. this.setState(
  905. {
  906. visible: false,
  907. activeKey: "1"
  908. },
  909. () => {
  910. this.setState({
  911. activeKey: "1"
  912. });
  913. }
  914. );
  915. this.loadData(this.state.pageNo);
  916. },
  917. visitOk() {
  918. this.setState({
  919. visible: false
  920. });
  921. },
  922. render() {
  923. const formItemLayout = {
  924. labelCol: { span: 8 },
  925. wrapperCol: { span: 14 }
  926. };
  927. const FormItem = Form.Item;
  928. const { TabPane } = Tabs;
  929. return (
  930. <div className="user-content">
  931. <ShowModalDiv ShowModal={this.state.showModal} />
  932. <div className="content-title">
  933. <span>合同变更审核订单</span>
  934. </div>
  935. <div className="user-search">
  936. <SearchInput search={this.search} />
  937. <div className="patent-table">
  938. <Spin spinning={this.state.loading}>
  939. <Table
  940. size="small"
  941. bordered
  942. columns={this.state.columns}
  943. dataSource={this.state.dataSource}
  944. pagination={this.state.pagination}
  945. onRowClick={this.tableRowClick}
  946. />
  947. </Spin>
  948. </div>
  949. <Modal
  950. className="customeDetails"
  951. footer=""
  952. maskClosable={false}
  953. width="900px"
  954. visible={this.state.visible}
  955. onOk={this.visitOk}
  956. onCancel={this.visitCancel}
  957. >
  958. <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
  959. <TabPane tab="订单详情" key="1">
  960. <Form
  961. layout="horizontal"
  962. onSubmit={this.handleSubmit}
  963. id="demand-form"
  964. style={{ paddingBottom: "40px" }}
  965. >
  966. <Spin spinning={this.state.loading}>
  967. <OrderDetail
  968. processState={this.props.processState}
  969. orderData={this.state.orderData}
  970. getOrderLog={this.getOrderLog}
  971. dataSourceX={this.state.dataSourceX}
  972. contactList={this.state.contactList}
  973. orderNo={this.state.orderNo}
  974. />
  975. </Spin>
  976. </Form>
  977. </TabPane>
  978. <TabPane tab="合同变更记录" key="2">
  979. <ChangeDetail
  980. data={this.state.contractData}
  981. pictureUrl={this.state.voucherUrl}
  982. processState={this.props.processState}
  983. loadData={this.callback}
  984. reset={this.state.visible}
  985. dataSource={this.state.dataProps}
  986. onCancel={this.visitCancel}
  987. />
  988. </TabPane>
  989. {this.state.status === 4 ? (
  990. <TabPane tab="原订单" key="3">
  991. <Form
  992. layout="horizontal"
  993. onSubmit={this.handleSubmit}
  994. id="demand-form"
  995. style={{ paddingBottom: "40px" }}
  996. >
  997. <Spin spinning={this.state.loading}>
  998. <OrderDetail
  999. processState={this.props.processState}
  1000. orderData={this.state.primaryOrderData}
  1001. getOrderLog={this.getOrderLog}
  1002. dataSourceX={this.state.dataSourceX}
  1003. contactList={this.state.contactList}
  1004. orderNo={this.state.primaryOrderNo}
  1005. />
  1006. </Spin>
  1007. </Form>
  1008. </TabPane>
  1009. ) : (
  1010. ""
  1011. )}
  1012. {this.state.status === 4 ? (
  1013. this.state.type === 4 || this.state.type === 5 ? (
  1014. <TabPane tab="附加订单" key="4">
  1015. <OrderDetail
  1016. processState={this.props.processState}
  1017. orderData={this.state.additionalOrderData}
  1018. getOrderLog={this.getOrderLog}
  1019. dataSourceX={this.state.dataSourceX}
  1020. contactList={this.state.contactList}
  1021. orderNo={this.state.additionalOrder}
  1022. />
  1023. </TabPane>
  1024. ) : (
  1025. ""
  1026. )
  1027. ) : (
  1028. ""
  1029. )}
  1030. </Tabs>
  1031. </Modal>
  1032. <Modal
  1033. maskClosable={false}
  1034. visible={this.state.addnextVisible}
  1035. onOk={this.nextCancel}
  1036. onCancel={this.nextCancel}
  1037. confirmLoading={this.state.confirmLoading}
  1038. width="800px"
  1039. title={"项目任务详情"}
  1040. footer=""
  1041. className="admin-desc-content"
  1042. >
  1043. <Form layout="horizontal" id="demand-form">
  1044. <Spin spinning={this.state.loading}>
  1045. <div className="clearfix">
  1046. <FormItem
  1047. className="half-item"
  1048. {...formItemLayout}
  1049. label="项目名称"
  1050. >
  1051. <span>{this.state.commodityName}</span>
  1052. </FormItem>
  1053. <FormItem
  1054. className="half-item"
  1055. {...formItemLayout}
  1056. label="项目数量"
  1057. >
  1058. <span>{this.state.commodityQuantity}</span>
  1059. </FormItem>
  1060. <FormItem
  1061. className="half-item"
  1062. {...formItemLayout}
  1063. label="金额(万元)"
  1064. >
  1065. <span>{this.state.commodityPrice}</span>
  1066. </FormItem>
  1067. <FormItem
  1068. className="half-item"
  1069. {...formItemLayout}
  1070. label="主要项目"
  1071. >
  1072. <span>{getboutique(this.state.main)}</span>
  1073. </FormItem>
  1074. <div className="clearfix">
  1075. <FormItem
  1076. labelCol={{ span: 4 }}
  1077. wrapperCol={{ span: 16 }}
  1078. label="服务说明"
  1079. >
  1080. <span>{this.state.taskComment}</span>
  1081. </FormItem>
  1082. </div>
  1083. </div>
  1084. </Spin>
  1085. </Form>
  1086. </Modal>
  1087. <Modal
  1088. maskClosable={false}
  1089. visible={this.state.noVisible}
  1090. onOk={this.handleOk}
  1091. onCancel={this.noCancel}
  1092. width="400px"
  1093. title={"拒绝理由"}
  1094. footer=""
  1095. className="admin-desc-content"
  1096. confirmLoading={this.state.confirmLoading}
  1097. >
  1098. <Form layout="horizontal" id="demand-form">
  1099. <Spin spinning={this.state.loading}>
  1100. <div className="clearfix">
  1101. <FormItem
  1102. labelCol={{ span: 4 }}
  1103. wrapperCol={{ span: 16 }}
  1104. label="拒绝理由"
  1105. >
  1106. <Input
  1107. type="textarea"
  1108. placeholder="请输入拒绝理由"
  1109. rows={4}
  1110. value={this.state.reason}
  1111. onChange={e => {
  1112. this.setState({ reason: e.target.value });
  1113. }}
  1114. />
  1115. </FormItem>
  1116. </div>
  1117. <div className="clearfix">
  1118. <Button
  1119. className="cancel"
  1120. type="primary"
  1121. onClick={this.examOks}
  1122. style={{ marginLeft: "50px" }}
  1123. htmlType="submit"
  1124. loading={this.state.aloading}
  1125. >
  1126. 确定
  1127. </Button>
  1128. <Button
  1129. className="cancel"
  1130. type="ghost"
  1131. onClick={this.noCancel}
  1132. style={{ marginLeft: "50px" }}
  1133. >
  1134. 取消
  1135. </Button>
  1136. </div>
  1137. </Spin>
  1138. </Form>
  1139. </Modal>
  1140. {/* <Modal
  1141. visible={this.state.rizhivisible}
  1142. className="admin-desc-content"
  1143. width="800px"
  1144. maskClosable={false}
  1145. title="订单日志"
  1146. footer={null}
  1147. onCancel={this.closeOrderLog}
  1148. >
  1149. <div className="patent-table">
  1150. <Spin spinning={this.state.loading}>
  1151. <Table
  1152. bordered
  1153. columns={this.state.columnsrizhi}
  1154. dataSource={this.state.dataSourcerizhi}
  1155. pagination={false}
  1156. />
  1157. </Spin>
  1158. </div>
  1159. </Modal> */}
  1160. <OrderRiZi
  1161. dataSourcerizhi={this.state.dataSourcerizhi}
  1162. closeOrderLog={this.closeOrderLog}
  1163. visible={this.state.rizhivisible}
  1164. loading={this.state.loading}
  1165. />
  1166. </div>
  1167. </div>
  1168. );
  1169. }
  1170. })
  1171. );
  1172. export default contractChange;