contractYxy.js 34 KB

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