outOutsourcingList.jsx 43 KB

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