outOutsourcingList.jsx 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468
  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. Tooltip
  19. } from "antd";
  20. import Assign from "@/manageCenter/publicComponent/assign";
  21. import ResolutionDetail from "@/resolutionDetail";
  22. import {
  23. getjiedian,
  24. getProcessStatus,
  25. getApproval,
  26. getNewOrderType,
  27. getLiquidationStatus,
  28. getProjectStatus,
  29. splitUrl,
  30. getprovince
  31. } from "@/tools";
  32. import ImgList from "../../../common/imgList";
  33. import { ChooseList } from "../../order/orderNew/chooseList";
  34. import { getProjectName } from "../../../tools";
  35. import OrderItemStatus from "../../../common/orderItemStatus";
  36. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  37. import ContentUrl from "../../order/orderNew/contentUrl";
  38. import { salesList } from "@/dataDic.js";
  39. const FormItem = Form.Item;
  40. const outsourcingPaiDan = React.createClass({
  41. loadData(pageNo) {
  42. this.state.data = [];
  43. this.setState({
  44. loading: true,
  45. });
  46. $.ajax({
  47. method: "get",
  48. dataType: "json",
  49. crossDomain: false,
  50. url: globalConfig.context + "/api/admin/financial/allUnassignedOrder",
  51. data: {
  52. pageNo: pageNo || 1,
  53. pageSize: this.state.pagination.pageSize,
  54. buyerName: this.state.nameSearch, //客户名称
  55. orderNo: this.state.orderNoSearch,
  56. startTime: this.state.releaseDate[0],
  57. endTime: this.state.releaseDate[1],
  58. processStatus: this.state.processStatus,
  59. outsource: 1,
  60. },
  61. success: function (data) {
  62. let theArr = [];
  63. if (!data.data || !data.data.list) {
  64. if (data.error && data.error.length) {
  65. message.warning(data.error[0].message);
  66. }
  67. } else {
  68. for (let i = 0; i < data.data.list.length; i++) {
  69. let thisdata = data.data.list[i];
  70. theArr.push({
  71. key: i,
  72. orderNo: thisdata.orderNo,
  73. approval: thisdata.approval,
  74. orderType: thisdata.orderType,
  75. processStatus: thisdata.processStatus,
  76. signTotalAmount: thisdata.signTotalAmount,
  77. buyerName: thisdata.buyerName,
  78. sellerName: thisdata.sellerName,
  79. createTime: thisdata.createTime
  80. ? new Date(thisdata.createTime).toLocaleString()
  81. : "",
  82. signTime: thisdata.signTime,
  83. contractNo: thisdata.contractNo,
  84. financeId: thisdata.financeId,
  85. departmentName: thisdata.departmentName,
  86. outsourceName: thisdata.outsourceName,
  87. });
  88. }
  89. }
  90. if (data.data && data.data.list && !data.data.list.length) {
  91. this.state.pagination.current = 0;
  92. this.state.pagination.total = 0;
  93. }
  94. this.setState({
  95. totalPage: data.data.totalPage,
  96. dataSource: theArr,
  97. pagination: this.state.pagination,
  98. });
  99. }.bind(this),
  100. }).always(
  101. function () {
  102. this.setState({
  103. loading: false,
  104. });
  105. }.bind(this)
  106. );
  107. },
  108. getInitialState() {
  109. return {
  110. rotateDeg: 0,
  111. searchMore: true,
  112. assignVisible: false,
  113. releaseDate: [],
  114. totalPage: 0,
  115. boHuivisible: false,
  116. selectedRowKeys: [],
  117. selectedRows: [],
  118. modKey: "1",
  119. width: "800px",
  120. loading: false,
  121. pagination: {
  122. defaultCurrent: 1,
  123. defaultPageSize: 10,
  124. showQuickJumper: true,
  125. pageSize: 10,
  126. onChange: function (page) {
  127. this.loadData(page);
  128. }.bind(this),
  129. showTotal: function (total) {
  130. return "共" + total + "条数据";
  131. },
  132. },
  133. columns: [
  134. {
  135. title: "订单编号",
  136. dataIndex: "orderNo",
  137. key: "orderNo",
  138. },
  139. {
  140. title: "合同编号",
  141. dataIndex: "contractNo",
  142. key: "contractNo",
  143. },
  144. {
  145. title: "下单时间",
  146. dataIndex: "createTime",
  147. key: "createTime",
  148. },
  149. {
  150. title: "签单时间",
  151. dataIndex: "signTime",
  152. key: "signTime",
  153. },
  154. {
  155. title: "签单客户",
  156. dataIndex: "buyerName",
  157. key: "buyerName",
  158. render: (text) => {
  159. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  160. },
  161. },
  162. {
  163. title: "外包公司",
  164. dataIndex: "outsourceName",
  165. key: "outsourceName",
  166. render: (text) => {
  167. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  168. },
  169. },
  170. {
  171. title: "流程状态",
  172. dataIndex: "processStatus",
  173. key: "processStatus",
  174. render: (text) => {
  175. return getProcessStatus(text);
  176. },
  177. },
  178. {
  179. title: "订单部门",
  180. dataIndex: "departmentName",
  181. key: "departmentName",
  182. render: (text) => {
  183. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  184. },
  185. },
  186. {
  187. title: "订单总金额(万)",
  188. dataIndex: "signTotalAmount",
  189. key: "signTotalAmount",
  190. },
  191. {
  192. title: "是否特批",
  193. dataIndex: "approval",
  194. key: "approval",
  195. render: (text) => {
  196. return getApproval(text);
  197. },
  198. },
  199. {
  200. title: "订单负责人",
  201. dataIndex: "sellerName",
  202. key: "sellerName",
  203. },
  204. {
  205. title: "操作",
  206. dataIndex: "caozuo",
  207. key: "caouzo",
  208. render: (text, recard) => {
  209. return <div>{this.judgeFenpai(recard)}</div>;
  210. },
  211. },
  212. ],
  213. columnsX: [
  214. {
  215. title: "业务项目名称",
  216. dataIndex: "commodityName",
  217. key: "commodityName",
  218. render: (text, record) => {
  219. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  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. orderUid: thisData.uid,
  648. id: thisData.id,
  649. orderList: thisData,
  650. approval:
  651. thisData.approval == 0
  652. ? thisData.approval.toString()
  653. : thisData.approval,
  654. orderRemarks: thisData.orderRemarks,
  655. orgCodeUrl: thisData.contractPictureUrl
  656. ? splitUrl(
  657. thisData.contractPictureUrl,
  658. ",",
  659. globalConfig.avatarHost + "/upload"
  660. )
  661. : [],
  662. replenishUrl: thisData.agreementUrl
  663. ? splitUrl(
  664. thisData.agreementUrl,
  665. ",",
  666. globalConfig.avatarHost + "/upload"
  667. )
  668. : [],
  669. contentUrl: thisData.serviceContent
  670. ? splitUrl(
  671. thisData.serviceContent,
  672. ",",
  673. globalConfig.avatarHost + "/upload"
  674. )
  675. : [], //图片地址
  676. orderNo: thisData.orderNo, //订单编号
  677. buyerId: thisData.buyerId,
  678. depName: thisData.depName,
  679. deleteSign: thisData.deleteSign,
  680. });
  681. }.bind(this),
  682. }).always(
  683. function () {
  684. this.setState({
  685. loading: false,
  686. });
  687. }.bind(this)
  688. );
  689. },
  690. rizhi() {
  691. this.setState({
  692. loading: true,
  693. });
  694. $.ajax({
  695. method: "get",
  696. dataType: "json",
  697. crossDomain: false,
  698. url: "/api/admin/newOrder/selectOrderLog",
  699. data: {
  700. orderNo: this.state.orderNo,
  701. },
  702. success: function (data) {
  703. let theArr = [];
  704. let thisData = data.data;
  705. if (!thisData.length) {
  706. if (data.error && data.error.length) {
  707. message.warning(data.error[0].message);
  708. }
  709. thisData = {};
  710. } else {
  711. for (let i = 0; i < data.data.length; i++) {
  712. let thisdata = data.data[i];
  713. theArr.push({
  714. processName: thisdata.processName,
  715. adminName: thisdata.adminName,
  716. createDate: thisdata.createDate,
  717. remarks: thisdata.remarks,
  718. });
  719. }
  720. }
  721. this.setState({
  722. dataSourceY: theArr,
  723. });
  724. }.bind(this),
  725. }).always(
  726. function () {
  727. this.setState({
  728. loading: false,
  729. });
  730. }.bind(this)
  731. );
  732. },
  733. closeOrderLog() {
  734. this.setState({
  735. avisible: false,
  736. });
  737. },
  738. getOrderLog() {
  739. this.setState({
  740. avisible: true,
  741. });
  742. this.rizhi();
  743. },
  744. closeModal() {
  745. this.setState({
  746. visible: false,
  747. modKey: "1",
  748. width: "800px",
  749. });
  750. },
  751. closeDesc(e, s) {
  752. this.state.showDesc = e;
  753. if (s) {
  754. this.loadData(this.state.page);
  755. }
  756. },
  757. closeAssign(e, s) {
  758. this.state.assignVisible = e;
  759. if (s) {
  760. if (
  761. this.state.pagination.current == this.state.totalPage &&
  762. this.state.pagination.total % 10 == 1
  763. ) {
  764. this.loadData(this.state.page - 1);
  765. } else {
  766. this.loadData(this.state.page);
  767. }
  768. }
  769. },
  770. search() {
  771. this.loadData();
  772. },
  773. downImg() {
  774. let num = 0;
  775. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  776. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  777. num = i;
  778. }
  779. }
  780. if (num == this.state.orgCodeUrl.length - 1) {
  781. return message.warning("已经是最后一张了哦");
  782. }
  783. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  784. this.setState({
  785. previewImage: this.state.previewImage,
  786. rotateDeg: 0,
  787. });
  788. },
  789. upImg() {
  790. let num = 0;
  791. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  792. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  793. num = i;
  794. }
  795. }
  796. if (num == 0) {
  797. return message.warning("已经是第一张了哦");
  798. }
  799. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  800. this.setState({
  801. previewImage: this.state.previewImage,
  802. rotateDeg: 0,
  803. });
  804. },
  805. rotate() {
  806. let rotateDeg = this.state.rotateDeg + 90;
  807. this.setState({
  808. rotateDeg,
  809. });
  810. },
  811. downImgs() {
  812. let num = 0;
  813. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  814. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  815. num = i;
  816. }
  817. }
  818. if (num == this.state.replenishUrl.length - 1) {
  819. return message.warning("已经是最后一张了哦");
  820. }
  821. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  822. this.setState({
  823. previewImage: this.state.previewImage,
  824. rotateDeg: 0,
  825. });
  826. },
  827. upImgs() {
  828. let num = 0;
  829. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  830. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  831. num = i;
  832. }
  833. }
  834. if (num == 0) {
  835. return message.warning("已经是第一张了哦");
  836. }
  837. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  838. this.setState({
  839. previewImage: this.state.previewImage,
  840. rotateDeg: 0,
  841. });
  842. },
  843. rotates() {
  844. let rotateDeg = this.state.rotateDeg + 90;
  845. this.setState({
  846. rotateDeg,
  847. });
  848. },
  849. reset() {
  850. this.state.nameSearch = "";
  851. this.state.releaseDate = [];
  852. this.state.orderNoSearch = "";
  853. this.state.processStatus = [];
  854. this.loadData();
  855. },
  856. searchSwitch() {
  857. this.setState({
  858. searchMore: !this.state.searchMore,
  859. });
  860. },
  861. changeList(arr) {
  862. const newArr = [];
  863. this.state.columns.forEach(item => {
  864. arr.forEach(val => {
  865. if (val === item.title) {
  866. newArr.push(item);
  867. }
  868. });
  869. });
  870. this.setState({
  871. changeList: newArr
  872. });
  873. },
  874. render() {
  875. const { RangePicker } = DatePicker;
  876. const { TabPane } = Tabs;
  877. const theData = this.state.orderList || {};
  878. const formItemLayout = {
  879. labelCol: { span: 10 },
  880. wrapperCol: { span: 12 },
  881. };
  882. const jsDate = this.state.jsDate || [];
  883. return (
  884. <div className="user-content">
  885. {this.state.resVisible ? (
  886. <ResolutionDetail
  887. cancel={this.resCancel}
  888. detail={this.state.resRecord}
  889. visible={this.state.resVisible}
  890. id={this.state.resRecord.orderNo}
  891. />
  892. ) : (
  893. ""
  894. )}
  895. <div className="content-title">
  896. <span>外省外包列表</span>
  897. </div>
  898. <Tabs defaultActiveKey="1" className="test">
  899. <TabPane tab="搜索" key="1">
  900. <div className="user-search">
  901. <Input
  902. placeholder="客户名称"
  903. value={this.state.nameSearch}
  904. onChange={(e) => {
  905. this.setState({ nameSearch: e.target.value });
  906. }}
  907. />
  908. <Input
  909. placeholder="订单编号"
  910. value={this.state.orderNoSearch}
  911. onChange={(e) => {
  912. this.setState({ orderNoSearch: e.target.value });
  913. }}
  914. />
  915. <Select
  916. placeholder="流程状态"
  917. onChange={(e) => {
  918. this.setState({ processStatus: e });
  919. }}
  920. style={{ width: 160, marginRight: 5 }}
  921. value={this.state.processStatus}
  922. >
  923. <Option value="2">未分配</Option>
  924. <Option value="3">已分配</Option>
  925. </Select>
  926. <span style={{ marginRight: 10 }}>下单时间 :</span>
  927. <RangePicker
  928. value={[
  929. this.state.releaseDate[0]
  930. ? moment(this.state.releaseDate[0])
  931. : null,
  932. this.state.releaseDate[1]
  933. ? moment(this.state.releaseDate[1])
  934. : null,
  935. ]}
  936. onChange={(data, dataString) => {
  937. this.setState({ releaseDate: dataString });
  938. }}
  939. />
  940. <Button
  941. type="primary"
  942. onClick={this.search}
  943. style={{ marginLeft: 10 }}
  944. >
  945. 搜索
  946. </Button>
  947. <Button onClick={this.reset}>重置</Button>
  948. </div>
  949. </TabPane>
  950. <TabPane tab="更改表格显示数据" key="2">
  951. <div style={{ marginLeft: 10 }}>
  952. <ChooseList
  953. columns={this.state.columns}
  954. changeFn={this.changeList}
  955. changeList={this.state.changeList}
  956. top={55}
  957. margin={11}
  958. />
  959. </div>
  960. </TabPane>
  961. </Tabs>
  962. <div className="patent-table">
  963. <Spin spinning={this.state.loading}>
  964. <Table
  965. columns={
  966. this.state.changeList
  967. ? this.state.changeList
  968. : this.state.columns
  969. }
  970. dataSource={this.state.dataSource}
  971. scroll={{ x: 1500, y: 0 }}
  972. size="small"
  973. bordered
  974. rowSelection={false}
  975. pagination={this.state.pagination}
  976. onRowClick={this.tableRowClick.bind(this)}
  977. />
  978. </Spin>
  979. </div>
  980. <div className="patent-desc">
  981. {this.state.visible ? <Modal
  982. maskClosable={false}
  983. visible={this.state.visible}
  984. onCancel={this.closeModal}
  985. width={this.state.width}
  986. footer=""
  987. className="admin-desc-content"
  988. >
  989. <Tabs
  990. onChange={this.callBack}
  991. type="card"
  992. activeKey={this.state.modKey}
  993. tabBarExtraContent={
  994. <div style={{ fontWeight: 'bold', paddingRight: '15px' }}>
  995. <OrderItemStatus deleteSign={this.state.deleteSign} />
  996. </div>
  997. }
  998. >
  999. <TabPane tab="项目概况" key="1">
  1000. {this.state.modKey === "1" ? <Form layout="horizontal" id="demand-form">
  1001. <Spin spinning={this.state.loading}>
  1002. <div className="clearfix">
  1003. <FormItem
  1004. className="half-item"
  1005. {...formItemLayout}
  1006. label="订单编号"
  1007. >
  1008. <span>{this.state.orderNo}</span>
  1009. </FormItem>
  1010. <FormItem
  1011. className="half-item"
  1012. {...formItemLayout}
  1013. label="签单时间"
  1014. >
  1015. <span>{theData.signDate}</span>
  1016. </FormItem>
  1017. <FormItem
  1018. className="half-item"
  1019. {...formItemLayout}
  1020. label="客户名称"
  1021. >
  1022. <span>{theData.userName}</span>
  1023. <EnterpriseNameChange
  1024. type='journal'
  1025. style={{ marginLeft: 10 }}
  1026. enterpriseId={this.state.orderUid} />
  1027. </FormItem>
  1028. <FormItem
  1029. className="half-item"
  1030. {...formItemLayout}
  1031. label="销售类型"
  1032. >
  1033. <span>
  1034. {(["私有客户-", "签单客户-"][theData.userType] || " ") +
  1035. (salesList[theData.salesType] || "")}
  1036. {
  1037. theData.other != null && theData.other != "" &&
  1038. <Tooltip title={theData.other}>
  1039. <span>
  1040. {"(" + theData.other.toString().slice(0, 10) + (theData.other.toString().length > 9 ? "...)" : ")")}
  1041. </span>
  1042. </Tooltip>
  1043. }
  1044. </span>
  1045. </FormItem>
  1046. <FormItem
  1047. className="half-item"
  1048. {...formItemLayout}
  1049. label="流转状态"
  1050. >
  1051. <span>{getProcessStatus(theData.processStatus)}</span>
  1052. </FormItem>
  1053. <FormItem
  1054. className="half-item"
  1055. {...formItemLayout}
  1056. label="订单类型"
  1057. >
  1058. <span>{getNewOrderType(theData.orderType)}</span>
  1059. </FormItem>
  1060. <FormItem
  1061. className="half-item"
  1062. {...formItemLayout}
  1063. label="结算状态"
  1064. >
  1065. <span>
  1066. {getLiquidationStatus(theData.liquidationStatus)}
  1067. </span>
  1068. </FormItem>
  1069. <FormItem
  1070. className="half-item"
  1071. {...formItemLayout}
  1072. label="签单总金额(万元)"
  1073. >
  1074. <span>{theData.totalAmount}</span>
  1075. </FormItem>
  1076. <FormItem
  1077. className="half-item"
  1078. {...formItemLayout}
  1079. label="首付款(万元)"
  1080. >
  1081. <span>{theData.firstAmount}</span>
  1082. </FormItem>
  1083. <FormItem
  1084. className="half-item"
  1085. {...formItemLayout}
  1086. label="已收款(万元)"
  1087. >
  1088. <span>{theData.settlementAmount}</span>
  1089. </FormItem>
  1090. <FormItem
  1091. className="half-item"
  1092. {...formItemLayout}
  1093. label="是否特批"
  1094. >
  1095. <span>{getApproval(theData.approval)}</span>
  1096. </FormItem>
  1097. {/*this.props.data.orderStatus=='6'&&<FormItem className="half-item" {...formItemLayout} label="已退(万元)">
  1098. <span>{this.props.data.refundAmount}</span>
  1099. </FormItem>*/}
  1100. </div>
  1101. <div className="clearfix">
  1102. <FormItem
  1103. labelCol={{ span: 5 }}
  1104. wrapperCol={{ span: 18 }}
  1105. label="合同扫描件"
  1106. >
  1107. {/*<Upload*/}
  1108. {/* className="demandDetailShow-upload"*/}
  1109. {/* listType="picture-card"*/}
  1110. {/* fileList={this.state.orgCodeUrl}*/}
  1111. {/* onPreview={(file) => {*/}
  1112. {/* this.setState({*/}
  1113. {/* previewImage: file.url || file.thumbUrl,*/}
  1114. {/* previewVisible: true,*/}
  1115. {/* });*/}
  1116. {/* }}*/}
  1117. {/*/>*/}
  1118. {this.state.visible && this.state.orgCodeUrl && this.state.modKey === "1" ? <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1119. <ImgList fileList={this.state.orgCodeUrl} domId={'outOutsourcingList1'} />
  1120. </div> : <div />}
  1121. <Modal
  1122. maskClosable={false}
  1123. footer={null}
  1124. width={"50%"}
  1125. visible={this.state.previewVisible}
  1126. onCancel={() => {
  1127. this.setState({
  1128. previewVisible: false,
  1129. rotateDeg: 0,
  1130. });
  1131. }}
  1132. >
  1133. <img
  1134. alt=""
  1135. style={{
  1136. width: "100%",
  1137. transform: `rotate(${this.state.rotateDeg}deg)`,
  1138. }}
  1139. src={this.state.previewImage || ""}
  1140. />
  1141. <Button
  1142. onClick={this.rotate}
  1143. style={{
  1144. position: "relative",
  1145. left: "50%",
  1146. transform: "translateX(-50%)",
  1147. }}
  1148. >
  1149. 旋转
  1150. </Button>
  1151. <Button
  1152. onClick={this.upImg}
  1153. style={{
  1154. position: "absolute",
  1155. left: -81,
  1156. top: "50%",
  1157. transform: "translateY(-50%)",
  1158. }}
  1159. >
  1160. 上一张
  1161. </Button>
  1162. <Button
  1163. onClick={this.downImg}
  1164. style={{
  1165. position: "absolute",
  1166. right: -81,
  1167. top: "50%",
  1168. transform: "translateY(-50%)",
  1169. }}
  1170. >
  1171. 下一张
  1172. </Button>
  1173. </Modal>
  1174. <Button
  1175. style={{
  1176. float: "right",
  1177. marginRight: "140px",
  1178. marginTop: "20px",
  1179. }}
  1180. onClick={this.getOrderLog}
  1181. >
  1182. 查看订单日志
  1183. </Button>
  1184. </FormItem>
  1185. <FormItem
  1186. labelCol={{ span: 5 }}
  1187. wrapperCol={{ span: 18 }}
  1188. label="补充协议"
  1189. >
  1190. {/*<Upload*/}
  1191. {/* className="demandDetailShow-upload"*/}
  1192. {/* listType="picture-card"*/}
  1193. {/* fileList={this.state.replenishUrl}*/}
  1194. {/* onPreview={(file) => {*/}
  1195. {/* this.setState({*/}
  1196. {/* previewImage: file.url || file.thumbUrl,*/}
  1197. {/* previewVisibles: true,*/}
  1198. {/* });*/}
  1199. {/* }}*/}
  1200. {/*/>*/}
  1201. {this.state.visible && this.state.replenishUrl && this.state.modKey === "1" ? <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
  1202. <ImgList fileList={this.state.replenishUrl} domId={'outOutsourcingList2'} />
  1203. </div> : <div />}
  1204. <Modal
  1205. maskClosable={false}
  1206. footer={null}
  1207. width={"50%"}
  1208. visible={this.state.previewVisibles}
  1209. onCancel={() => {
  1210. this.setState({
  1211. previewVisibles: false,
  1212. rotateDeg: 0,
  1213. });
  1214. }}
  1215. >
  1216. <img
  1217. alt=""
  1218. style={{
  1219. width: "100%",
  1220. transform: `rotate(${this.state.rotateDeg}deg)`,
  1221. }}
  1222. src={this.state.previewImage || ""}
  1223. />
  1224. <Button
  1225. onClick={this.rotates}
  1226. style={{
  1227. position: "relative",
  1228. left: "50%",
  1229. transform: "translateX(-50%)",
  1230. }}
  1231. >
  1232. 旋转
  1233. </Button>
  1234. <Button
  1235. onClick={this.upImgs}
  1236. style={{
  1237. position: "absolute",
  1238. left: -81,
  1239. top: "50%",
  1240. transform: "translateY(-50%)",
  1241. }}
  1242. >
  1243. 上一张
  1244. </Button>
  1245. <Button
  1246. onClick={this.downImgs}
  1247. style={{
  1248. position: "absolute",
  1249. right: -81,
  1250. top: "50%",
  1251. transform: "translateY(-50%)",
  1252. }}
  1253. >
  1254. 下一张
  1255. </Button>
  1256. </Modal>
  1257. </FormItem>
  1258. </div>
  1259. <ContentUrl
  1260. processStatus={1}
  1261. domId={"cingListContents"}
  1262. contentUrl={this.state.contentUrl}
  1263. imgId={"cingListContentsImg"}
  1264. />
  1265. <div className="clearfix">
  1266. <FormItem
  1267. className="half-item"
  1268. {...formItemLayout}
  1269. label="合同编号"
  1270. >
  1271. <span>{theData.contractNo}</span>
  1272. </FormItem>
  1273. <FormItem
  1274. className="half-item"
  1275. {...formItemLayout}
  1276. label="订单部门"
  1277. >
  1278. <span>{theData.depName}</span>
  1279. </FormItem>
  1280. </div>
  1281. <div className="clearfix">
  1282. <FormItem
  1283. labelCol={{ span: 5 }}
  1284. wrapperCol={{ span: 18 }}
  1285. label="订单留言"
  1286. >
  1287. <p style={{ width: 500, wordWrap: "break-word" }}>
  1288. {this.state.orderRemarks}
  1289. </p>
  1290. </FormItem>
  1291. </div>
  1292. <div className="clearfix">
  1293. <FormItem
  1294. labelCol={{ span: 5 }}
  1295. wrapperCol={{ span: 18 }}
  1296. label="收款节点"
  1297. >
  1298. {jsDate.map((item) => {
  1299. return (
  1300. <p>
  1301. {getjiedian(item.dunSubject)} -- {item.money} 万元
  1302. </p>
  1303. );
  1304. })}
  1305. </FormItem>
  1306. </div>
  1307. <div className="clearfix">
  1308. <FormItem
  1309. className="half-item"
  1310. {...formItemLayout}
  1311. label="订单负责人"
  1312. >
  1313. <span>{theData.salesmanName}</span>
  1314. </FormItem>
  1315. <FormItem
  1316. className="half-item"
  1317. {...formItemLayout}
  1318. label="订单负责人电话"
  1319. >
  1320. <span>{theData.salesmanMobile}</span>
  1321. </FormItem>
  1322. <FormItem
  1323. className="half-item"
  1324. {...formItemLayout}
  1325. label="财务负责人"
  1326. >
  1327. <span>{theData.financeName}</span>
  1328. </FormItem>
  1329. <FormItem
  1330. className="half-item"
  1331. {...formItemLayout}
  1332. label="财务负责人电话"
  1333. >
  1334. <span>{theData.financeMobile}</span>
  1335. </FormItem>
  1336. </div>
  1337. <Modal
  1338. visible={this.state.avisible}
  1339. className="admin-desc-content"
  1340. width="800px"
  1341. maskClosable={false}
  1342. title="订单日志"
  1343. footer={null}
  1344. onCancel={this.closeOrderLog}
  1345. >
  1346. <div className="patent-table">
  1347. <Spin spinning={this.state.loading}>
  1348. <Table
  1349. columns={this.state.columnsY}
  1350. dataSource={this.state.dataSourceY}
  1351. pagination={false}
  1352. />
  1353. </Spin>
  1354. </div>
  1355. </Modal>
  1356. <div className="clearfix">
  1357. <p style={{ fontSize: 18, marginLeft: 20 }}>项目业务</p>
  1358. <div className="patent-table">
  1359. <Spin spinning={this.state.loading}>
  1360. <Table
  1361. columns={this.state.columnsX}
  1362. dataSource={this.state.dataSourceX}
  1363. size="small"
  1364. bordered
  1365. pagination={this.state.pagination}
  1366. onRowClick={this.tableRowClick}
  1367. />
  1368. </Spin>
  1369. </div>
  1370. </div>
  1371. </Spin>
  1372. </Form> : <div />}
  1373. </TabPane>
  1374. <TabPane tab="外包详情" key="2">
  1375. <div className="clearfix">
  1376. <p style={{ color: "red" }}>
  1377. 提示:查看备注请点击表格左侧加号按钮~
  1378. </p>
  1379. <div className="patent-table">
  1380. <Spin spinning={this.state.loading}>
  1381. <Table
  1382. columns={this.state.columnsW}
  1383. dataSource={this.state.dataSourceW}
  1384. pagination={this.state.pagination}
  1385. expandedRowRender={(record) => (
  1386. <p style={{ margin: 0 }}>{record.remarks}</p>
  1387. )}
  1388. scroll={{ x: 300, y: 0 }}
  1389. />
  1390. </Spin>
  1391. </div>
  1392. </div>
  1393. </TabPane>
  1394. </Tabs>
  1395. </Modal> : <div />}
  1396. </div>
  1397. <Assign
  1398. title="订单"
  1399. selApi="/api/admin/financial/distributionFinance"
  1400. data={this.state.assignData}
  1401. fenpaiData={4}
  1402. showDesc={this.state.assignVisible}
  1403. closeDesc={this.closeAssign.bind(this)}
  1404. roleName={"财务专员"}
  1405. requestMethod={"post"}
  1406. />
  1407. <Modal
  1408. visible={this.state.boHuiVisible}
  1409. width="400px"
  1410. title="驳回备注"
  1411. footer=""
  1412. onOk={this.boHuiOk}
  1413. onCancel={this.boHuiCancel}
  1414. >
  1415. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1416. <Spin spinning={this.state.loading}>
  1417. <FormItem
  1418. labelCol={{ span: 5 }}
  1419. wrapperCol={{ span: 16 }}
  1420. label={
  1421. <span>
  1422. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1423. </span>
  1424. }
  1425. >
  1426. <Input
  1427. type="textarea"
  1428. rows={4}
  1429. placeholder="请输入驳回原因"
  1430. value={this.state.content}
  1431. onChange={(e) => {
  1432. this.setState({ content: e.target.value });
  1433. }}
  1434. />
  1435. </FormItem>
  1436. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1437. <Button
  1438. type="primary"
  1439. htmlType="submit"
  1440. style={{ marginRight: 20 }}
  1441. >
  1442. 驳回
  1443. </Button>
  1444. <Button
  1445. type="default"
  1446. onClick={() => {
  1447. this.boHuiCancel();
  1448. }}
  1449. >
  1450. 取消
  1451. </Button>
  1452. </FormItem>
  1453. </Spin>
  1454. </Form>
  1455. </Modal>
  1456. </div>
  1457. );
  1458. },
  1459. });
  1460. export default outsourcingPaiDan;