outOutsourcingList.jsx 44 KB

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