outsourcingPaiDan.jsx 44 KB

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