outOutsourcingList.jsx 43 KB

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