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