outOutsourcingList.jsx 42 KB

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