outOutsourcingList.jsx 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import "./public.less";
  5. import {
  6. Button,
  7. Form,
  8. Input,
  9. Select,
  10. Spin,
  11. Table,
  12. message,
  13. DatePicker,
  14. Modal,
  15. Upload,
  16. Tabs,
  17. Tag
  18. } from "antd";
  19. import Assign from "@/manageCenter/publicComponent/assign";
  20. import ResolutionDetail from "@/resolutionDetail";
  21. import {
  22. getjiedian,
  23. getProcessStatus,
  24. getApproval,
  25. getNewOrderType,
  26. getLiquidationStatus,
  27. getProjectStatus,
  28. splitUrl,
  29. getprovince
  30. } from "@/tools";
  31. const FormItem = Form.Item;
  32. const outsourcingPaiDan = React.createClass({
  33. loadData(pageNo) {
  34. this.state.data = [];
  35. this.setState({
  36. loading: true,
  37. });
  38. $.ajax({
  39. method: "get",
  40. dataType: "json",
  41. crossDomain: false,
  42. url: globalConfig.context + "/api/admin/financial/allUnassignedOrder",
  43. data: {
  44. pageNo: pageNo || 1,
  45. pageSize: this.state.pagination.pageSize,
  46. buyerName: this.state.nameSearch, //客户名称
  47. orderNo: this.state.orderNoSearch,
  48. startTime: this.state.releaseDate[0],
  49. endTime: this.state.releaseDate[1],
  50. processStatus: this.state.processStatus,
  51. outsource: 1,
  52. },
  53. success: function (data) {
  54. let theArr = [];
  55. if (!data.data || !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. approval: thisdata.approval,
  66. orderType: thisdata.orderType,
  67. processStatus: thisdata.processStatus,
  68. signTotalAmount: thisdata.signTotalAmount,
  69. buyerName: thisdata.buyerName,
  70. sellerName: thisdata.sellerName,
  71. createTime: thisdata.createTime
  72. ? new Date(thisdata.createTime).toLocaleString()
  73. : "",
  74. signTime: thisdata.signTime,
  75. contractNo: thisdata.contractNo,
  76. financeId: thisdata.financeId,
  77. departmentName: thisdata.departmentName,
  78. outsourceName: thisdata.outsourceName,
  79. });
  80. }
  81. }
  82. if (data.data && data.data.list && !data.data.list.length) {
  83. this.state.pagination.current = 0;
  84. this.state.pagination.total = 0;
  85. }
  86. this.setState({
  87. totalPage: data.data.totalPage,
  88. dataSource: theArr,
  89. pagination: this.state.pagination,
  90. });
  91. }.bind(this),
  92. }).always(
  93. function () {
  94. this.setState({
  95. loading: false,
  96. });
  97. }.bind(this)
  98. );
  99. },
  100. getInitialState() {
  101. return {
  102. rotateDeg: 0,
  103. searchMore: true,
  104. assignVisible: false,
  105. releaseDate: [],
  106. totalPage: 0,
  107. boHuivisible: false,
  108. selectedRowKeys: [],
  109. selectedRows: [],
  110. modKey: "1",
  111. width: "800px",
  112. loading: false,
  113. pagination: {
  114. defaultCurrent: 1,
  115. defaultPageSize: 10,
  116. showQuickJumper: true,
  117. pageSize: 10,
  118. onChange: function (page) {
  119. this.loadData(page);
  120. }.bind(this),
  121. showTotal: function (total) {
  122. return "共" + total + "条数据";
  123. },
  124. },
  125. columns: [
  126. {
  127. title: "订单编号",
  128. dataIndex: "orderNo",
  129. key: "orderNo",
  130. },
  131. {
  132. title: "合同编号",
  133. dataIndex: "contractNo",
  134. key: "contractNo",
  135. },
  136. {
  137. title: "下单时间",
  138. dataIndex: "createTime",
  139. key: "createTime",
  140. },
  141. {
  142. title: "签单时间",
  143. dataIndex: "signTime",
  144. key: "signTime",
  145. },
  146. {
  147. title: "签单客户",
  148. dataIndex: "buyerName",
  149. key: "buyerName",
  150. render: (text) => {
  151. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  152. },
  153. },
  154. {
  155. title: "外包公司",
  156. dataIndex: "outsourceName",
  157. key: "outsourceName",
  158. render: (text) => {
  159. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  160. },
  161. },
  162. {
  163. title: "流程状态",
  164. dataIndex: "processStatus",
  165. key: "processStatus",
  166. render: (text) => {
  167. return getProcessStatus(text);
  168. },
  169. },
  170. {
  171. title: "订单部门",
  172. dataIndex: "departmentName",
  173. key: "departmentName",
  174. render: (text) => {
  175. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  176. },
  177. },
  178. {
  179. title: "订单总金额(万)",
  180. dataIndex: "signTotalAmount",
  181. key: "signTotalAmount",
  182. },
  183. {
  184. title: "是否特批",
  185. dataIndex: "approval",
  186. key: "approval",
  187. render: (text) => {
  188. return getApproval(text);
  189. },
  190. },
  191. {
  192. title: "订单负责人",
  193. dataIndex: "sellerName",
  194. key: "sellerName",
  195. },
  196. {
  197. title: "操作",
  198. dataIndex: "caozuo",
  199. key: "caouzo",
  200. render: (text, recard) => {
  201. return <div>{this.judgeFenpai(recard)}</div>;
  202. },
  203. },
  204. ],
  205. columnsX: [
  206. {
  207. title: "业务项目名称",
  208. dataIndex: "commodityName",
  209. key: "commodityName",
  210. render: (text) => {
  211. return text && text.length > 6 ? (
  212. <span title={text}>{text.substr(0, 8)}...</span>
  213. ) : (
  214. text
  215. );
  216. },
  217. },
  218. {
  219. title: "项目类别",
  220. dataIndex: "cname",
  221. key: "cname",
  222. },
  223. {
  224. title: "项目数量",
  225. dataIndex: "commodityQuantity",
  226. key: "commodityQuantity",
  227. render: (text, record) => {
  228. if (record.splitStatus == 1) {
  229. return (
  230. <span>
  231. {text}{" "}
  232. <Tag
  233. color="#108ee9"
  234. onClick={(e) => {
  235. e.stopPropagation();
  236. this.showRes(record);
  237. }}
  238. >
  239. 已拆
  240. </Tag>
  241. </span>
  242. );
  243. } else {
  244. return text;
  245. }
  246. },
  247. },
  248. {
  249. title: "服务市价(万元)",
  250. dataIndex: "commodityPrice",
  251. key: "commodityPrice",
  252. },
  253. {
  254. title: "项目状态",
  255. dataIndex: "projectStatus",
  256. key: "projectStatus",
  257. render: (text) => {
  258. return getProjectStatus(text);
  259. },
  260. },
  261. {
  262. title: "证书编号",
  263. dataIndex: "certificateNumber",
  264. key: "certificateNumber",
  265. },
  266. {
  267. title: "是否主要项目",
  268. dataIndex: "main",
  269. key: "main",
  270. render: (text) => {
  271. return text ? "是" : "否";
  272. },
  273. },
  274. {
  275. title: "项目说明",
  276. dataIndex: "taskComment",
  277. key: "taskComment",
  278. render: (text) => {
  279. return text && text.length > 8 ? (
  280. <span title={text}>{text.substr(0, 8)}...</span>
  281. ) : (
  282. text
  283. );
  284. },
  285. },
  286. ],
  287. columnsY: [
  288. {
  289. title: "流程",
  290. dataIndex: "processName",
  291. key: "processName",
  292. },
  293. {
  294. title: "操作人",
  295. dataIndex: "adminName",
  296. key: "adminName",
  297. },
  298. {
  299. title: "时间",
  300. dataIndex: "createDate",
  301. key: "createDate",
  302. },
  303. ],
  304. columnsW: [
  305. {
  306. title: "外包名称",
  307. dataIndex: "name",
  308. key: "name",
  309. },
  310. {
  311. title: "联系人",
  312. dataIndex: "contacts",
  313. key: "contacts",
  314. },
  315. {
  316. title: "联系人电话",
  317. dataIndex: "contactsMobile",
  318. key: "contactsMobile",
  319. },
  320. {
  321. title: "地址",
  322. dataIndex: "ProvinceCity",
  323. key: "ProvinceCity",
  324. render: (test) => {
  325. return test[0] === null
  326. ? ""
  327. : getprovince(test[0]) +
  328. "/" +
  329. getprovince(test[1]) +
  330. "/" +
  331. getprovince(test[2]);
  332. },
  333. },
  334. {
  335. title: "地址详情",
  336. dataIndex: "address",
  337. key: "address",
  338. render: (text) => {
  339. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  340. },
  341. },
  342. {
  343. title: "创建时间",
  344. dataIndex: "createTimes",
  345. key: "createTimes",
  346. },
  347. {
  348. title: "任务名称",
  349. dataIndex: "tname",
  350. key: "tname",
  351. },
  352. {
  353. title: "合同编号",
  354. dataIndex: "contractNo",
  355. key: "contractNo",
  356. },
  357. {
  358. title: "项目状态",
  359. dataIndex: "projectStatus",
  360. key: "projectStatus",
  361. render: (text) => {
  362. return getProjectStatus(text);
  363. },
  364. },
  365. ],
  366. dataSource: [],
  367. searchTime: [,],
  368. };
  369. },
  370. /* 判断是否有分派按钮 */
  371. judgeFenpai(recard) {
  372. if (recard.approval === 2) {
  373. if (recard.financeId === null || "") {
  374. return (
  375. <Button
  376. type="primary"
  377. onClick={(e) => {
  378. e.stopPropagation(), this.evaluate(recard);
  379. }}
  380. >
  381. 分派
  382. </Button>
  383. );
  384. } else {
  385. return undefined;
  386. }
  387. } else if (recard.processStatus <= 2) {
  388. return (
  389. <Button
  390. type="primary"
  391. onClick={(e) => {
  392. e.stopPropagation(), this.evaluate(recard);
  393. }}
  394. >
  395. 分派
  396. </Button>
  397. );
  398. } else {
  399. return undefined;
  400. }
  401. },
  402. jdDate(orderNo) {
  403. $.ajax({
  404. method: "get",
  405. dataType: "json",
  406. crossDomain: false,
  407. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  408. data: {
  409. orderNo: orderNo,
  410. },
  411. success: function (data) {
  412. let thisData = data.data;
  413. if (!thisData.length) {
  414. if (data.error && data.error.length) {
  415. message.warning(data.error[0].message);
  416. }
  417. thisData = {};
  418. } else {
  419. this.setState({
  420. jsDate: thisData,
  421. });
  422. }
  423. }.bind(this),
  424. }).always(
  425. function () {
  426. this.setState({
  427. loading: false,
  428. });
  429. }.bind(this)
  430. );
  431. },
  432. /* 分派 */
  433. evaluate(recard) {
  434. this.state.assignData = recard;
  435. this.setState({
  436. assignVisible: true,
  437. });
  438. },
  439. /* 驳回 */
  440. reject(recard) {
  441. this.setState({
  442. bohuiData: recard,
  443. boHuiVisible: true,
  444. content: "",
  445. });
  446. },
  447. boHuiOk() {
  448. this.setState({
  449. boHuiVisible: false,
  450. });
  451. if (
  452. this.state.pagination.current == this.state.totalPage &&
  453. this.state.pagination.total % 10 == 1
  454. ) {
  455. this.loadData(this.state.page - 1);
  456. } else {
  457. this.loadData(this.state.page);
  458. }
  459. },
  460. boHuiCancel() {
  461. this.setState({
  462. boHuiVisible: false,
  463. });
  464. },
  465. componentWillMount() {
  466. this.loadData();
  467. },
  468. tableRowClick(record) {
  469. this.state.RowData = record;
  470. this.setState({
  471. showDesc: true,
  472. visible: true,
  473. orderNo: record.orderNo,
  474. modKey: "1",
  475. });
  476. this.jdDate(record.orderNo);
  477. this.loadXmu(record);
  478. this.loadModal(record);
  479. },
  480. //详情
  481. callBack(key) {
  482. if (key === "2") {
  483. this.setState({
  484. modKey: key,
  485. width: "1200px",
  486. });
  487. this.loadWaiBao();
  488. }
  489. if (key === "1") {
  490. this.setState({
  491. modKey: key,
  492. width: "800px",
  493. });
  494. }
  495. },
  496. // 拆分详细
  497. showRes(record) {
  498. this.setState({
  499. resVisible: true,
  500. resRecord: record,
  501. });
  502. },
  503. resCancel() {
  504. this.setState({
  505. resVisible: false,
  506. });
  507. },
  508. //外包详情
  509. loadWaiBao() {
  510. $.ajax({
  511. method: "get",
  512. dataType: "json",
  513. rossDomain: false,
  514. url:
  515. globalConfig.context +
  516. "/api/admin/outsourceOrg/selectOrderOutsourceOrg",
  517. data: {
  518. orderNo: this.state.orderNo,
  519. },
  520. success: function (data) {
  521. let theArr = [];
  522. if (data.error.length || data.data.list == "") {
  523. if (data.error && data.error.length) {
  524. message.warning(data.error[0].message);
  525. }
  526. } else {
  527. for (let i = 0; i < data.data.length; i++) {
  528. let thisdata = data.data[i];
  529. let ProvinceCityArr = [];
  530. let ProvinceS = thisdata.province; //省
  531. let citys = thisdata.city; //市
  532. let Areas = thisdata.area; //区
  533. ProvinceCityArr.push(ProvinceS, citys, Areas);
  534. theArr.push({
  535. key: i,
  536. id: thisdata.id,
  537. name: thisdata.name,
  538. contacts: thisdata.contacts, //订单编号
  539. contactsMobile: thisdata.contactsMobile,
  540. ProvinceCity: ProvinceCityArr[0] === null ? [] : ProvinceCityArr,
  541. province: thisdata.province,
  542. city: thisdata.city,
  543. area: thisdata.area,
  544. address: thisdata.address,
  545. remarks: thisdata.remarks,
  546. tid: thisdata.tid,
  547. createTimes: thisdata.createTimes,
  548. tname: thisdata.tname,
  549. contractNo: thisdata.contractNo,
  550. projectStatus: thisdata.projectStatus,
  551. });
  552. }
  553. }
  554. this.setState(
  555. {
  556. dataSourceW: theArr,
  557. },
  558. () => {}
  559. );
  560. }.bind(this),
  561. }).always(
  562. function () {
  563. this.setState({
  564. loading: false,
  565. });
  566. }.bind(this)
  567. );
  568. },
  569. loadXmu(record) {
  570. this.state.data = [];
  571. this.setState({
  572. loading: true,
  573. });
  574. $.ajax({
  575. method: "get",
  576. dataType: "json",
  577. crossDomain: false,
  578. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  579. data: {
  580. orderNo: record.orderNo,
  581. },
  582. success: function (data) {
  583. let theArr = [];
  584. if (!data.data) {
  585. if (data.error && data.error.length) {
  586. message.warning(data.error[0].message);
  587. }
  588. } else {
  589. for (let i = 0; i < data.data.length; i++) {
  590. let thisdata = data.data[i];
  591. theArr.push({
  592. key: i,
  593. id: thisdata.id,
  594. orderNo: thisdata.orderNo,
  595. commodityName: thisdata.commodityName,
  596. commodityPrice: thisdata.commodityPrice,
  597. commodityQuantity: thisdata.commodityQuantity,
  598. taskStatus: thisdata.taskStatus,
  599. taskComment: thisdata.taskComment,
  600. main: thisdata.main,
  601. contacts: thisdata.contacts,
  602. contactsMobile: thisdata.contactsMobile,
  603. cname: thisdata.cname,
  604. certificateNumber: thisdata.certificateNumber,
  605. projectStatus: thisdata.projectStatus,
  606. splitStatus: thisdata.splitStatus,
  607. sort: thisdata.cSort,
  608. });
  609. }
  610. }
  611. this.setState({
  612. dataSourceX: theArr,
  613. pagination: false,
  614. });
  615. }.bind(this),
  616. }).always(
  617. function () {
  618. this.setState({
  619. loading: false,
  620. });
  621. }.bind(this)
  622. );
  623. },
  624. loadModal(record) {
  625. this.state.orderList = [];
  626. $.ajax({
  627. method: "get",
  628. dataType: "json",
  629. crossDomain: false,
  630. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  631. data: {
  632. orderNo: record.orderNo,
  633. },
  634. success: function (data) {
  635. let thisData = data.data;
  636. if (!thisData) {
  637. if (data.error && data.error.length) {
  638. message.warning(data.error[0].message);
  639. }
  640. thisData = {};
  641. }
  642. this.setState({
  643. id: thisData.id,
  644. orderList: thisData,
  645. approval:
  646. thisData.approval == 0
  647. ? thisData.approval.toString()
  648. : thisData.approval,
  649. orderRemarks: thisData.orderRemarks,
  650. orgCodeUrl: thisData.contractPictureUrl
  651. ? splitUrl(
  652. thisData.contractPictureUrl,
  653. ",",
  654. globalConfig.avatarHost + "/upload"
  655. )
  656. : [],
  657. replenishUrl: thisData.agreementUrl
  658. ? splitUrl(
  659. thisData.agreementUrl,
  660. ",",
  661. globalConfig.avatarHost + "/upload"
  662. )
  663. : [],
  664. orderNo: thisData.orderNo, //订单编号
  665. buyerId: thisData.buyerId,
  666. depName: thisData.depName,
  667. });
  668. }.bind(this),
  669. }).always(
  670. function () {
  671. this.setState({
  672. loading: false,
  673. });
  674. }.bind(this)
  675. );
  676. },
  677. rizhi() {
  678. this.setState({
  679. loading: true,
  680. });
  681. $.ajax({
  682. method: "get",
  683. dataType: "json",
  684. crossDomain: false,
  685. url: "/api/admin/newOrder/selectOrderLog",
  686. data: {
  687. orderNo: this.state.orderNo,
  688. },
  689. success: function (data) {
  690. let theArr = [];
  691. let thisData = data.data;
  692. if (!thisData.length) {
  693. if (data.error && data.error.length) {
  694. message.warning(data.error[0].message);
  695. }
  696. thisData = {};
  697. } else {
  698. for (let i = 0; i < data.data.length; i++) {
  699. let thisdata = data.data[i];
  700. theArr.push({
  701. processName: thisdata.processName,
  702. adminName: thisdata.adminName,
  703. createDate: thisdata.createDate,
  704. remarks: thisdata.remarks,
  705. });
  706. }
  707. }
  708. this.setState({
  709. dataSourceY: theArr,
  710. });
  711. }.bind(this),
  712. }).always(
  713. function () {
  714. this.setState({
  715. loading: false,
  716. });
  717. }.bind(this)
  718. );
  719. },
  720. closeOrderLog() {
  721. this.setState({
  722. avisible: false,
  723. });
  724. },
  725. getOrderLog() {
  726. this.setState({
  727. avisible: true,
  728. });
  729. this.rizhi();
  730. },
  731. closeModal() {
  732. this.setState({
  733. visible: false,
  734. modKey: "1",
  735. width: "800px",
  736. });
  737. },
  738. closeDesc(e, s) {
  739. this.state.showDesc = e;
  740. if (s) {
  741. this.loadData(this.state.page);
  742. }
  743. },
  744. closeAssign(e, s) {
  745. this.state.assignVisible = e;
  746. if (s) {
  747. if (
  748. this.state.pagination.current == this.state.totalPage &&
  749. this.state.pagination.total % 10 == 1
  750. ) {
  751. this.loadData(this.state.page - 1);
  752. } else {
  753. this.loadData(this.state.page);
  754. }
  755. }
  756. },
  757. search() {
  758. this.loadData();
  759. },
  760. downImg() {
  761. let num = 0;
  762. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  763. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  764. num = i;
  765. }
  766. }
  767. if (num == this.state.orgCodeUrl.length - 1) {
  768. return message.warning("已经是最后一张了哦");
  769. }
  770. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  771. this.setState({
  772. previewImage: this.state.previewImage,
  773. rotateDeg: 0,
  774. });
  775. },
  776. upImg() {
  777. let num = 0;
  778. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  779. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  780. num = i;
  781. }
  782. }
  783. if (num == 0) {
  784. return message.warning("已经是第一张了哦");
  785. }
  786. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  787. this.setState({
  788. previewImage: this.state.previewImage,
  789. rotateDeg: 0,
  790. });
  791. },
  792. rotate() {
  793. let rotateDeg = this.state.rotateDeg + 90;
  794. this.setState({
  795. rotateDeg,
  796. });
  797. },
  798. downImgs() {
  799. let num = 0;
  800. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  801. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  802. num = i;
  803. }
  804. }
  805. if (num == this.state.replenishUrl.length - 1) {
  806. return message.warning("已经是最后一张了哦");
  807. }
  808. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  809. this.setState({
  810. previewImage: this.state.previewImage,
  811. rotateDeg: 0,
  812. });
  813. },
  814. upImgs() {
  815. let num = 0;
  816. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  817. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  818. num = i;
  819. }
  820. }
  821. if (num == 0) {
  822. return message.warning("已经是第一张了哦");
  823. }
  824. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  825. this.setState({
  826. previewImage: this.state.previewImage,
  827. rotateDeg: 0,
  828. });
  829. },
  830. rotates() {
  831. let rotateDeg = this.state.rotateDeg + 90;
  832. this.setState({
  833. rotateDeg,
  834. });
  835. },
  836. reset() {
  837. this.state.nameSearch = "";
  838. this.state.releaseDate = [];
  839. this.state.orderNoSearch = "";
  840. this.state.processStatus = [];
  841. this.loadData();
  842. },
  843. searchSwitch() {
  844. this.setState({
  845. searchMore: !this.state.searchMore,
  846. });
  847. },
  848. render() {
  849. const { RangePicker } = DatePicker;
  850. const { TabPane } = Tabs;
  851. const theData = this.state.orderList || {};
  852. const formItemLayout = {
  853. labelCol: { span: 10 },
  854. wrapperCol: { span: 12 },
  855. };
  856. const jsDate = this.state.jsDate || [];
  857. return (
  858. <div className="user-content">
  859. {this.state.resVisible ? (
  860. <ResolutionDetail
  861. cancel={this.resCancel}
  862. detail={this.state.resRecord}
  863. visible={this.state.resVisible}
  864. id={this.state.resRecord.orderNo}
  865. />
  866. ) : (
  867. ""
  868. )}
  869. <div className="content-title">
  870. <span>外省外包列表</span>
  871. </div>
  872. <div className="user-search">
  873. <Input
  874. placeholder="客户名称"
  875. value={this.state.nameSearch}
  876. onChange={(e) => {
  877. this.setState({ nameSearch: e.target.value });
  878. }}
  879. />
  880. <Input
  881. placeholder="订单编号"
  882. value={this.state.orderNoSearch}
  883. onChange={(e) => {
  884. this.setState({ orderNoSearch: e.target.value });
  885. }}
  886. />
  887. <Select
  888. placeholder="流程状态"
  889. onChange={(e) => {
  890. this.setState({ processStatus: e });
  891. }}
  892. style={{ width: 160, marginRight: 5 }}
  893. value={this.state.processStatus}
  894. >
  895. <Option value="2">未分配</Option>
  896. <Option value="3">已分配</Option>
  897. </Select>
  898. <span style={{ marginRight: 10 }}>下单时间 :</span>
  899. <RangePicker
  900. value={[
  901. this.state.releaseDate[0]
  902. ? moment(this.state.releaseDate[0])
  903. : null,
  904. this.state.releaseDate[1]
  905. ? moment(this.state.releaseDate[1])
  906. : null,
  907. ]}
  908. onChange={(data, dataString) => {
  909. this.setState({ releaseDate: dataString });
  910. }}
  911. />
  912. <Button
  913. type="primary"
  914. onClick={this.search}
  915. style={{ marginLeft: 10 }}
  916. >
  917. 搜索
  918. </Button>
  919. <Button onClick={this.reset}>重置</Button>
  920. </div>
  921. <div className="patent-table">
  922. <Spin spinning={this.state.loading}>
  923. <Table
  924. columns={this.state.columns}
  925. dataSource={this.state.dataSource}
  926. scroll={{ x: 1500, y: 0 }}
  927. size="small"
  928. bordered
  929. rowSelection={false}
  930. pagination={this.state.pagination}
  931. onRowClick={this.tableRowClick.bind(this)}
  932. />
  933. </Spin>
  934. </div>
  935. <div className="patent-desc">
  936. <Modal
  937. maskClosable={false}
  938. visible={this.state.visible}
  939. onCancel={this.closeModal}
  940. width={this.state.width}
  941. footer=""
  942. className="admin-desc-content"
  943. >
  944. <Tabs
  945. onChange={this.callBack}
  946. type="card"
  947. activeKey={this.state.modKey}
  948. >
  949. <TabPane tab="项目概况" key="1">
  950. <Form layout="horizontal" id="demand-form">
  951. <Spin spinning={this.state.loading}>
  952. <div className="clearfix">
  953. <FormItem
  954. className="half-item"
  955. {...formItemLayout}
  956. label="订单编号"
  957. >
  958. <span>{this.state.orderNo}</span>
  959. </FormItem>
  960. <FormItem
  961. className="half-item"
  962. {...formItemLayout}
  963. label="签单时间"
  964. >
  965. <span>{theData.signDate}</span>
  966. </FormItem>
  967. <FormItem
  968. className="half-item"
  969. {...formItemLayout}
  970. label="客户名称"
  971. >
  972. <span>{theData.userName}</span>
  973. </FormItem>
  974. <FormItem
  975. className="half-item"
  976. {...formItemLayout}
  977. label="流转状态"
  978. >
  979. <span>{getProcessStatus(theData.processStatus)}</span>
  980. </FormItem>
  981. <FormItem
  982. className="half-item"
  983. {...formItemLayout}
  984. label="订单类型"
  985. >
  986. <span>{getNewOrderType(theData.orderType)}</span>
  987. </FormItem>
  988. <FormItem
  989. className="half-item"
  990. {...formItemLayout}
  991. label="结算状态"
  992. >
  993. <span>
  994. {getLiquidationStatus(theData.liquidationStatus)}
  995. </span>
  996. </FormItem>
  997. <FormItem
  998. className="half-item"
  999. {...formItemLayout}
  1000. label="签单总金额(万元)"
  1001. >
  1002. <span>{theData.totalAmount}</span>
  1003. </FormItem>
  1004. <FormItem
  1005. className="half-item"
  1006. {...formItemLayout}
  1007. label="首付款(万元)"
  1008. >
  1009. <span>{theData.firstAmount}</span>
  1010. </FormItem>
  1011. <FormItem
  1012. className="half-item"
  1013. {...formItemLayout}
  1014. label="已收款(万元)"
  1015. >
  1016. <span>{theData.settlementAmount}</span>
  1017. </FormItem>
  1018. <FormItem
  1019. className="half-item"
  1020. {...formItemLayout}
  1021. label="是否特批"
  1022. >
  1023. <span>{getApproval(theData.approval)}</span>
  1024. </FormItem>
  1025. {/*this.props.data.orderStatus=='6'&&<FormItem className="half-item" {...formItemLayout} label="已退(万元)">
  1026. <span>{this.props.data.refundAmount}</span>
  1027. </FormItem>*/}
  1028. </div>
  1029. <div className="clearfix">
  1030. <FormItem
  1031. labelCol={{ span: 5 }}
  1032. wrapperCol={{ span: 18 }}
  1033. label="合同扫描件"
  1034. >
  1035. <Upload
  1036. className="demandDetailShow-upload"
  1037. listType="picture-card"
  1038. fileList={this.state.orgCodeUrl}
  1039. onPreview={(file) => {
  1040. this.setState({
  1041. previewImage: file.url || file.thumbUrl,
  1042. previewVisible: true,
  1043. });
  1044. }}
  1045. ></Upload>
  1046. <Modal
  1047. maskClosable={false}
  1048. footer={null}
  1049. width={"50%"}
  1050. visible={this.state.previewVisible}
  1051. onCancel={() => {
  1052. this.setState({
  1053. previewVisible: false,
  1054. rotateDeg: 0,
  1055. });
  1056. }}
  1057. >
  1058. <img
  1059. alt=""
  1060. style={{
  1061. width: "100%",
  1062. transform: `rotate(${this.state.rotateDeg}deg)`,
  1063. }}
  1064. src={this.state.previewImage || ""}
  1065. />
  1066. <Button
  1067. onClick={this.rotate}
  1068. style={{
  1069. position: "relative",
  1070. left: "50%",
  1071. transform: "translateX(-50%)",
  1072. }}
  1073. >
  1074. 旋转
  1075. </Button>
  1076. <Button
  1077. onClick={this.upImg}
  1078. style={{
  1079. position: "absolute",
  1080. left: -81,
  1081. top: "50%",
  1082. transform: "translateY(-50%)",
  1083. }}
  1084. >
  1085. 上一张
  1086. </Button>
  1087. <Button
  1088. onClick={this.downImg}
  1089. style={{
  1090. position: "absolute",
  1091. right: -81,
  1092. top: "50%",
  1093. transform: "translateY(-50%)",
  1094. }}
  1095. >
  1096. 下一张
  1097. </Button>
  1098. </Modal>
  1099. <Button
  1100. style={{
  1101. float: "right",
  1102. marginRight: "140px",
  1103. marginTop: "20px",
  1104. }}
  1105. onClick={this.getOrderLog}
  1106. >
  1107. 查看订单日志
  1108. </Button>
  1109. </FormItem>
  1110. <FormItem
  1111. labelCol={{ span: 5 }}
  1112. wrapperCol={{ span: 18 }}
  1113. label="补充协议"
  1114. >
  1115. <Upload
  1116. className="demandDetailShow-upload"
  1117. listType="picture-card"
  1118. fileList={this.state.replenishUrl}
  1119. onPreview={(file) => {
  1120. this.setState({
  1121. previewImage: file.url || file.thumbUrl,
  1122. previewVisibles: true,
  1123. });
  1124. }}
  1125. ></Upload>
  1126. <Modal
  1127. maskClosable={false}
  1128. footer={null}
  1129. width={"50%"}
  1130. visible={this.state.previewVisibles}
  1131. onCancel={() => {
  1132. this.setState({
  1133. previewVisibles: false,
  1134. rotateDeg: 0,
  1135. });
  1136. }}
  1137. >
  1138. <img
  1139. alt=""
  1140. style={{
  1141. width: "100%",
  1142. transform: `rotate(${this.state.rotateDeg}deg)`,
  1143. }}
  1144. src={this.state.previewImage || ""}
  1145. />
  1146. <Button
  1147. onClick={this.rotates}
  1148. style={{
  1149. position: "relative",
  1150. left: "50%",
  1151. transform: "translateX(-50%)",
  1152. }}
  1153. >
  1154. 旋转
  1155. </Button>
  1156. <Button
  1157. onClick={this.upImgs}
  1158. style={{
  1159. position: "absolute",
  1160. left: -81,
  1161. top: "50%",
  1162. transform: "translateY(-50%)",
  1163. }}
  1164. >
  1165. 上一张
  1166. </Button>
  1167. <Button
  1168. onClick={this.downImgs}
  1169. style={{
  1170. position: "absolute",
  1171. right: -81,
  1172. top: "50%",
  1173. transform: "translateY(-50%)",
  1174. }}
  1175. >
  1176. 下一张
  1177. </Button>
  1178. </Modal>
  1179. </FormItem>
  1180. </div>
  1181. <div className="clearfix">
  1182. <FormItem
  1183. className="half-item"
  1184. {...formItemLayout}
  1185. label="合同编号"
  1186. >
  1187. <span>{theData.contractNo}</span>
  1188. </FormItem>
  1189. <FormItem
  1190. className="half-item"
  1191. {...formItemLayout}
  1192. label="订单部门"
  1193. >
  1194. <span>{theData.depName}</span>
  1195. </FormItem>
  1196. </div>
  1197. <div className="clearfix">
  1198. <FormItem
  1199. labelCol={{ span: 5 }}
  1200. wrapperCol={{ span: 18 }}
  1201. label="订单留言"
  1202. >
  1203. <p style={{ width: 500, wordWrap: "break-word" }}>
  1204. {this.state.orderRemarks}
  1205. </p>
  1206. </FormItem>
  1207. </div>
  1208. <div className="clearfix">
  1209. <FormItem
  1210. labelCol={{ span: 5 }}
  1211. wrapperCol={{ span: 18 }}
  1212. label="收款节点"
  1213. >
  1214. {jsDate.map((item) => {
  1215. return (
  1216. <p>
  1217. {getjiedian(item.dunSubject)} -- {item.money} 万元
  1218. </p>
  1219. );
  1220. })}
  1221. </FormItem>
  1222. </div>
  1223. <div className="clearfix">
  1224. <FormItem
  1225. className="half-item"
  1226. {...formItemLayout}
  1227. label="订单负责人"
  1228. >
  1229. <span>{theData.salesmanName}</span>
  1230. </FormItem>
  1231. <FormItem
  1232. className="half-item"
  1233. {...formItemLayout}
  1234. label="订单负责人电话"
  1235. >
  1236. <span>{theData.salesmanMobile}</span>
  1237. </FormItem>
  1238. <FormItem
  1239. className="half-item"
  1240. {...formItemLayout}
  1241. label="财务负责人"
  1242. >
  1243. <span>{theData.financeName}</span>
  1244. </FormItem>
  1245. <FormItem
  1246. className="half-item"
  1247. {...formItemLayout}
  1248. label="财务负责人电话"
  1249. >
  1250. <span>{theData.financeMobile}</span>
  1251. </FormItem>
  1252. </div>
  1253. <Modal
  1254. visible={this.state.avisible}
  1255. className="admin-desc-content"
  1256. width="800px"
  1257. maskClosable={false}
  1258. title="订单日志"
  1259. footer={null}
  1260. onCancel={this.closeOrderLog}
  1261. >
  1262. <div className="patent-table">
  1263. <Spin spinning={this.state.loading}>
  1264. <Table
  1265. columns={this.state.columnsY}
  1266. dataSource={this.state.dataSourceY}
  1267. pagination={false}
  1268. />
  1269. </Spin>
  1270. </div>
  1271. </Modal>
  1272. <div className="clearfix">
  1273. <p style={{ fontSize: 18, marginLeft: 20 }}>项目业务</p>
  1274. <div className="patent-table">
  1275. <Spin spinning={this.state.loading}>
  1276. <Table
  1277. columns={this.state.columnsX}
  1278. dataSource={this.state.dataSourceX}
  1279. size="small"
  1280. bordered
  1281. pagination={this.state.pagination}
  1282. onRowClick={this.tableRowClick}
  1283. />
  1284. </Spin>
  1285. </div>
  1286. </div>
  1287. </Spin>
  1288. </Form>
  1289. </TabPane>
  1290. <TabPane tab="外包详情" key="2">
  1291. <div className="clearfix">
  1292. <p style={{ color: "red" }}>
  1293. 提示:查看备注请点击表格左侧加号按钮~
  1294. </p>
  1295. <div className="patent-table">
  1296. <Spin spinning={this.state.loading}>
  1297. <Table
  1298. columns={this.state.columnsW}
  1299. dataSource={this.state.dataSourceW}
  1300. pagination={this.state.pagination}
  1301. expandedRowRender={(record) => (
  1302. <p style={{ margin: 0 }}>{record.remarks}</p>
  1303. )}
  1304. scroll={{ x: 300, y: 0 }}
  1305. />
  1306. </Spin>
  1307. </div>
  1308. </div>
  1309. </TabPane>
  1310. </Tabs>
  1311. </Modal>
  1312. </div>
  1313. <Assign
  1314. title="订单"
  1315. selApi="/api/admin/financial/distributionFinance"
  1316. data={this.state.assignData}
  1317. fenpaiData={4}
  1318. showDesc={this.state.assignVisible}
  1319. closeDesc={this.closeAssign.bind(this)}
  1320. roleName={"财务专员"}
  1321. requestMethod={"post"}
  1322. />
  1323. <Modal
  1324. visible={this.state.boHuiVisible}
  1325. width="400px"
  1326. title="驳回备注"
  1327. footer=""
  1328. onOk={this.boHuiOk}
  1329. onCancel={this.boHuiCancel}
  1330. >
  1331. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1332. <Spin spinning={this.state.loading}>
  1333. <FormItem
  1334. labelCol={{ span: 5 }}
  1335. wrapperCol={{ span: 16 }}
  1336. label={
  1337. <span>
  1338. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1339. </span>
  1340. }
  1341. >
  1342. <Input
  1343. type="textarea"
  1344. rows={4}
  1345. placeholder="请输入驳回原因"
  1346. value={this.state.content}
  1347. onChange={(e) => {
  1348. this.setState({ content: e.target.value });
  1349. }}
  1350. />
  1351. </FormItem>
  1352. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1353. <Button
  1354. type="primary"
  1355. htmlType="submit"
  1356. style={{ marginRight: 20 }}
  1357. >
  1358. 驳回
  1359. </Button>
  1360. <Button
  1361. type="default"
  1362. onClick={() => {
  1363. this.boHuiCancel();
  1364. }}
  1365. >
  1366. 取消
  1367. </Button>
  1368. </FormItem>
  1369. </Spin>
  1370. </Form>
  1371. </Modal>
  1372. </div>
  1373. );
  1374. },
  1375. });
  1376. export default outsourcingPaiDan;