outOutsourcingList.jsx 43 KB

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