outOutsourcingList.jsx 41 KB

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