outOutsourcingList.jsx 44 KB

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