outOutsourcingList.jsx 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import moment from "moment";
  4. import "./public.less";
  5. import {
  6. Button,
  7. Form,
  8. Input,
  9. Select,
  10. Spin,
  11. Table,
  12. message,
  13. DatePicker,
  14. Modal,
  15. Upload,
  16. Tabs,
  17. Tag
  18. } from "antd";
  19. import Assign from "@/manageCenter/publicComponent/assign";
  20. import ResolutionDetail from "@/resolutionDetail";
  21. import {
  22. getjiedian,
  23. getProcessStatus,
  24. getApproval,
  25. getNewOrderType,
  26. getLiquidationStatus,
  27. getProjectStatus,
  28. splitUrl,
  29. getprovince
  30. } from "@/tools";
  31. import ImgList from "../../../common/imgList";
  32. import {ChooseList} from "../../order/orderNew/chooseList";
  33. import {getProjectName} from "../../../tools";
  34. import OrderItemStatus from "../../../common/orderItemStatus";
  35. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  36. import ContentUrl from "../../order/orderNew/contentUrl";
  37. const FormItem = Form.Item;
  38. const outsourcingPaiDan = React.createClass({
  39. loadData(pageNo) {
  40. this.state.data = [];
  41. this.setState({
  42. loading: true,
  43. });
  44. $.ajax({
  45. method: "get",
  46. dataType: "json",
  47. crossDomain: false,
  48. url: globalConfig.context + "/api/admin/financial/allUnassignedOrder",
  49. data: {
  50. pageNo: pageNo || 1,
  51. pageSize: this.state.pagination.pageSize,
  52. buyerName: this.state.nameSearch, //客户名称
  53. orderNo: this.state.orderNoSearch,
  54. startTime: this.state.releaseDate[0],
  55. endTime: this.state.releaseDate[1],
  56. processStatus: this.state.processStatus,
  57. outsource: 1,
  58. },
  59. success: function (data) {
  60. let theArr = [];
  61. if (!data.data || !data.data.list) {
  62. if (data.error && data.error.length) {
  63. message.warning(data.error[0].message);
  64. }
  65. } else {
  66. for (let i = 0; i < data.data.list.length; i++) {
  67. let thisdata = data.data.list[i];
  68. theArr.push({
  69. key: i,
  70. orderNo: thisdata.orderNo,
  71. approval: thisdata.approval,
  72. orderType: thisdata.orderType,
  73. processStatus: thisdata.processStatus,
  74. signTotalAmount: thisdata.signTotalAmount,
  75. buyerName: thisdata.buyerName,
  76. sellerName: thisdata.sellerName,
  77. createTime: thisdata.createTime
  78. ? new Date(thisdata.createTime).toLocaleString()
  79. : "",
  80. signTime: thisdata.signTime,
  81. contractNo: thisdata.contractNo,
  82. financeId: thisdata.financeId,
  83. departmentName: thisdata.departmentName,
  84. outsourceName: thisdata.outsourceName,
  85. });
  86. }
  87. }
  88. if (data.data && data.data.list && !data.data.list.length) {
  89. this.state.pagination.current = 0;
  90. this.state.pagination.total = 0;
  91. }
  92. this.setState({
  93. totalPage: data.data.totalPage,
  94. dataSource: theArr,
  95. pagination: this.state.pagination,
  96. });
  97. }.bind(this),
  98. }).always(
  99. function () {
  100. this.setState({
  101. loading: false,
  102. });
  103. }.bind(this)
  104. );
  105. },
  106. getInitialState() {
  107. return {
  108. rotateDeg: 0,
  109. searchMore: true,
  110. assignVisible: false,
  111. releaseDate: [],
  112. totalPage: 0,
  113. boHuivisible: false,
  114. selectedRowKeys: [],
  115. selectedRows: [],
  116. modKey: "1",
  117. width: "800px",
  118. loading: false,
  119. pagination: {
  120. defaultCurrent: 1,
  121. defaultPageSize: 10,
  122. showQuickJumper: true,
  123. pageSize: 10,
  124. onChange: function (page) {
  125. this.loadData(page);
  126. }.bind(this),
  127. showTotal: function (total) {
  128. return "共" + total + "条数据";
  129. },
  130. },
  131. columns: [
  132. {
  133. title: "订单编号",
  134. dataIndex: "orderNo",
  135. key: "orderNo",
  136. },
  137. {
  138. title: "合同编号",
  139. dataIndex: "contractNo",
  140. key: "contractNo",
  141. },
  142. {
  143. title: "下单时间",
  144. dataIndex: "createTime",
  145. key: "createTime",
  146. },
  147. {
  148. title: "签单时间",
  149. dataIndex: "signTime",
  150. key: "signTime",
  151. },
  152. {
  153. title: "签单客户",
  154. dataIndex: "buyerName",
  155. key: "buyerName",
  156. render: (text) => {
  157. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  158. },
  159. },
  160. {
  161. title: "外包公司",
  162. dataIndex: "outsourceName",
  163. key: "outsourceName",
  164. render: (text) => {
  165. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  166. },
  167. },
  168. {
  169. title: "流程状态",
  170. dataIndex: "processStatus",
  171. key: "processStatus",
  172. render: (text) => {
  173. return getProcessStatus(text);
  174. },
  175. },
  176. {
  177. title: "订单部门",
  178. dataIndex: "departmentName",
  179. key: "departmentName",
  180. render: (text) => {
  181. return text && text.length > 8 ? text.substr(0, 8) + "..." : text;
  182. },
  183. },
  184. {
  185. title: "订单总金额(万)",
  186. dataIndex: "signTotalAmount",
  187. key: "signTotalAmount",
  188. },
  189. {
  190. title: "是否特批",
  191. dataIndex: "approval",
  192. key: "approval",
  193. render: (text) => {
  194. return getApproval(text);
  195. },
  196. },
  197. {
  198. title: "订单负责人",
  199. dataIndex: "sellerName",
  200. key: "sellerName",
  201. },
  202. {
  203. title: "操作",
  204. dataIndex: "caozuo",
  205. key: "caouzo",
  206. render: (text, recard) => {
  207. return <div>{this.judgeFenpai(recard)}</div>;
  208. },
  209. },
  210. ],
  211. columnsX: [
  212. {
  213. title: "业务项目名称",
  214. dataIndex: "commodityName",
  215. key: "commodityName",
  216. render: (text, record) => {
  217. return <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span>{"-" + record.id}</span>
  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 getProjectName(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 getProjectName(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. orderUid: thisData.uid,
  646. id: thisData.id,
  647. orderList: thisData,
  648. approval:
  649. thisData.approval == 0
  650. ? thisData.approval.toString()
  651. : thisData.approval,
  652. orderRemarks: thisData.orderRemarks,
  653. orgCodeUrl: thisData.contractPictureUrl
  654. ? splitUrl(
  655. thisData.contractPictureUrl,
  656. ",",
  657. globalConfig.avatarHost + "/upload"
  658. )
  659. : [],
  660. replenishUrl: thisData.agreementUrl
  661. ? splitUrl(
  662. thisData.agreementUrl,
  663. ",",
  664. globalConfig.avatarHost + "/upload"
  665. )
  666. : [],
  667. contentUrl:thisData.serviceContent
  668. ? splitUrl(
  669. thisData.serviceContent,
  670. ",",
  671. globalConfig.avatarHost + "/upload"
  672. )
  673. : [], //图片地址
  674. orderNo: thisData.orderNo, //订单编号
  675. buyerId: thisData.buyerId,
  676. depName: thisData.depName,
  677. deleteSign:thisData.deleteSign,
  678. });
  679. }.bind(this),
  680. }).always(
  681. function () {
  682. this.setState({
  683. loading: false,
  684. });
  685. }.bind(this)
  686. );
  687. },
  688. rizhi() {
  689. this.setState({
  690. loading: true,
  691. });
  692. $.ajax({
  693. method: "get",
  694. dataType: "json",
  695. crossDomain: false,
  696. url: "/api/admin/newOrder/selectOrderLog",
  697. data: {
  698. orderNo: this.state.orderNo,
  699. },
  700. success: function (data) {
  701. let theArr = [];
  702. let thisData = data.data;
  703. if (!thisData.length) {
  704. if (data.error && data.error.length) {
  705. message.warning(data.error[0].message);
  706. }
  707. thisData = {};
  708. } else {
  709. for (let i = 0; i < data.data.length; i++) {
  710. let thisdata = data.data[i];
  711. theArr.push({
  712. processName: thisdata.processName,
  713. adminName: thisdata.adminName,
  714. createDate: thisdata.createDate,
  715. remarks: thisdata.remarks,
  716. });
  717. }
  718. }
  719. this.setState({
  720. dataSourceY: theArr,
  721. });
  722. }.bind(this),
  723. }).always(
  724. function () {
  725. this.setState({
  726. loading: false,
  727. });
  728. }.bind(this)
  729. );
  730. },
  731. closeOrderLog() {
  732. this.setState({
  733. avisible: false,
  734. });
  735. },
  736. getOrderLog() {
  737. this.setState({
  738. avisible: true,
  739. });
  740. this.rizhi();
  741. },
  742. closeModal() {
  743. this.setState({
  744. visible: false,
  745. modKey: "1",
  746. width: "800px",
  747. });
  748. },
  749. closeDesc(e, s) {
  750. this.state.showDesc = e;
  751. if (s) {
  752. this.loadData(this.state.page);
  753. }
  754. },
  755. closeAssign(e, s) {
  756. this.state.assignVisible = e;
  757. if (s) {
  758. if (
  759. this.state.pagination.current == this.state.totalPage &&
  760. this.state.pagination.total % 10 == 1
  761. ) {
  762. this.loadData(this.state.page - 1);
  763. } else {
  764. this.loadData(this.state.page);
  765. }
  766. }
  767. },
  768. search() {
  769. this.loadData();
  770. },
  771. downImg() {
  772. let num = 0;
  773. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  774. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  775. num = i;
  776. }
  777. }
  778. if (num == this.state.orgCodeUrl.length - 1) {
  779. return message.warning("已经是最后一张了哦");
  780. }
  781. this.state.previewImage = this.state.orgCodeUrl[num + 1].url;
  782. this.setState({
  783. previewImage: this.state.previewImage,
  784. rotateDeg: 0,
  785. });
  786. },
  787. upImg() {
  788. let num = 0;
  789. for (let i = 0; i < this.state.orgCodeUrl.length; i++) {
  790. if (this.state.orgCodeUrl[i].url == this.state.previewImage) {
  791. num = i;
  792. }
  793. }
  794. if (num == 0) {
  795. return message.warning("已经是第一张了哦");
  796. }
  797. this.state.previewImage = this.state.orgCodeUrl[num - 1].url;
  798. this.setState({
  799. previewImage: this.state.previewImage,
  800. rotateDeg: 0,
  801. });
  802. },
  803. rotate() {
  804. let rotateDeg = this.state.rotateDeg + 90;
  805. this.setState({
  806. rotateDeg,
  807. });
  808. },
  809. downImgs() {
  810. let num = 0;
  811. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  812. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  813. num = i;
  814. }
  815. }
  816. if (num == this.state.replenishUrl.length - 1) {
  817. return message.warning("已经是最后一张了哦");
  818. }
  819. this.state.previewImage = this.state.replenishUrl[num + 1].url;
  820. this.setState({
  821. previewImage: this.state.previewImage,
  822. rotateDeg: 0,
  823. });
  824. },
  825. upImgs() {
  826. let num = 0;
  827. for (let i = 0; i < this.state.replenishUrl.length; i++) {
  828. if (this.state.replenishUrl[i].url == this.state.previewImage) {
  829. num = i;
  830. }
  831. }
  832. if (num == 0) {
  833. return message.warning("已经是第一张了哦");
  834. }
  835. this.state.previewImage = this.state.replenishUrl[num - 1].url;
  836. this.setState({
  837. previewImage: this.state.previewImage,
  838. rotateDeg: 0,
  839. });
  840. },
  841. rotates() {
  842. let rotateDeg = this.state.rotateDeg + 90;
  843. this.setState({
  844. rotateDeg,
  845. });
  846. },
  847. reset() {
  848. this.state.nameSearch = "";
  849. this.state.releaseDate = [];
  850. this.state.orderNoSearch = "";
  851. this.state.processStatus = [];
  852. this.loadData();
  853. },
  854. searchSwitch() {
  855. this.setState({
  856. searchMore: !this.state.searchMore,
  857. });
  858. },
  859. changeList(arr) {
  860. const newArr = [];
  861. this.state.columns.forEach(item => {
  862. arr.forEach(val => {
  863. if (val === item.title) {
  864. newArr.push(item);
  865. }
  866. });
  867. });
  868. this.setState({
  869. changeList: newArr
  870. });
  871. },
  872. render() {
  873. const { RangePicker } = DatePicker;
  874. const { TabPane } = Tabs;
  875. const theData = this.state.orderList || {};
  876. const formItemLayout = {
  877. labelCol: { span: 10 },
  878. wrapperCol: { span: 12 },
  879. };
  880. const jsDate = this.state.jsDate || [];
  881. return (
  882. <div className="user-content">
  883. {this.state.resVisible ? (
  884. <ResolutionDetail
  885. cancel={this.resCancel}
  886. detail={this.state.resRecord}
  887. visible={this.state.resVisible}
  888. id={this.state.resRecord.orderNo}
  889. />
  890. ) : (
  891. ""
  892. )}
  893. <div className="content-title">
  894. <span>外省外包列表</span>
  895. </div>
  896. <Tabs defaultActiveKey="1" className="test">
  897. <TabPane tab="搜索" key="1">
  898. <div className="user-search">
  899. <Input
  900. placeholder="客户名称"
  901. value={this.state.nameSearch}
  902. onChange={(e) => {
  903. this.setState({ nameSearch: e.target.value });
  904. }}
  905. />
  906. <Input
  907. placeholder="订单编号"
  908. value={this.state.orderNoSearch}
  909. onChange={(e) => {
  910. this.setState({ orderNoSearch: e.target.value });
  911. }}
  912. />
  913. <Select
  914. placeholder="流程状态"
  915. onChange={(e) => {
  916. this.setState({ processStatus: e });
  917. }}
  918. style={{ width: 160, marginRight: 5 }}
  919. value={this.state.processStatus}
  920. >
  921. <Option value="2">未分配</Option>
  922. <Option value="3">已分配</Option>
  923. </Select>
  924. <span style={{ marginRight: 10 }}>下单时间 :</span>
  925. <RangePicker
  926. value={[
  927. this.state.releaseDate[0]
  928. ? moment(this.state.releaseDate[0])
  929. : null,
  930. this.state.releaseDate[1]
  931. ? moment(this.state.releaseDate[1])
  932. : null,
  933. ]}
  934. onChange={(data, dataString) => {
  935. this.setState({ releaseDate: dataString });
  936. }}
  937. />
  938. <Button
  939. type="primary"
  940. onClick={this.search}
  941. style={{ marginLeft: 10 }}
  942. >
  943. 搜索
  944. </Button>
  945. <Button onClick={this.reset}>重置</Button>
  946. </div>
  947. </TabPane>
  948. <TabPane tab="更改表格显示数据" key="2">
  949. <div style={{ marginLeft: 10 }}>
  950. <ChooseList
  951. columns={this.state.columns}
  952. changeFn={this.changeList}
  953. changeList={this.state.changeList}
  954. top={55}
  955. margin={11}
  956. />
  957. </div>
  958. </TabPane>
  959. </Tabs>
  960. <div className="patent-table">
  961. <Spin spinning={this.state.loading}>
  962. <Table
  963. columns={
  964. this.state.changeList
  965. ? this.state.changeList
  966. : this.state.columns
  967. }
  968. dataSource={this.state.dataSource}
  969. scroll={{ x: 1500, y: 0 }}
  970. size="small"
  971. bordered
  972. rowSelection={false}
  973. pagination={this.state.pagination}
  974. onRowClick={this.tableRowClick.bind(this)}
  975. />
  976. </Spin>
  977. </div>
  978. <div className="patent-desc">
  979. {this.state.visible ? <Modal
  980. maskClosable={false}
  981. visible={this.state.visible}
  982. onCancel={this.closeModal}
  983. width={this.state.width}
  984. footer=""
  985. className="admin-desc-content"
  986. >
  987. <Tabs
  988. onChange={this.callBack}
  989. type="card"
  990. activeKey={this.state.modKey}
  991. tabBarExtraContent={
  992. <div style={{fontWeight:'bold',paddingRight:'15px'}}>
  993. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  994. </div>
  995. }
  996. >
  997. <TabPane tab="项目概况" key="1">
  998. {this.state.modKey === "1" ? <Form layout="horizontal" id="demand-form">
  999. <Spin spinning={this.state.loading}>
  1000. <div className="clearfix">
  1001. <FormItem
  1002. className="half-item"
  1003. {...formItemLayout}
  1004. label="订单编号"
  1005. >
  1006. <span>{this.state.orderNo}</span>
  1007. </FormItem>
  1008. <FormItem
  1009. className="half-item"
  1010. {...formItemLayout}
  1011. label="签单时间"
  1012. >
  1013. <span>{theData.signDate}</span>
  1014. </FormItem>
  1015. <FormItem
  1016. className="half-item"
  1017. {...formItemLayout}
  1018. label="客户名称"
  1019. >
  1020. <span>{theData.userName}</span>
  1021. <EnterpriseNameChange
  1022. type='journal'
  1023. style={{ marginLeft: 10 }}
  1024. enterpriseId={this.state.orderUid}/>
  1025. </FormItem>
  1026. <FormItem
  1027. className="half-item"
  1028. {...formItemLayout}
  1029. label="流转状态"
  1030. >
  1031. <span>{getProcessStatus(theData.processStatus)}</span>
  1032. </FormItem>
  1033. <FormItem
  1034. className="half-item"
  1035. {...formItemLayout}
  1036. label="订单类型"
  1037. >
  1038. <span>{getNewOrderType(theData.orderType)}</span>
  1039. </FormItem>
  1040. <FormItem
  1041. className="half-item"
  1042. {...formItemLayout}
  1043. label="结算状态"
  1044. >
  1045. <span>
  1046. {getLiquidationStatus(theData.liquidationStatus)}
  1047. </span>
  1048. </FormItem>
  1049. <FormItem
  1050. className="half-item"
  1051. {...formItemLayout}
  1052. label="签单总金额(万元)"
  1053. >
  1054. <span>{theData.totalAmount}</span>
  1055. </FormItem>
  1056. <FormItem
  1057. className="half-item"
  1058. {...formItemLayout}
  1059. label="首付款(万元)"
  1060. >
  1061. <span>{theData.firstAmount}</span>
  1062. </FormItem>
  1063. <FormItem
  1064. className="half-item"
  1065. {...formItemLayout}
  1066. label="已收款(万元)"
  1067. >
  1068. <span>{theData.settlementAmount}</span>
  1069. </FormItem>
  1070. <FormItem
  1071. className="half-item"
  1072. {...formItemLayout}
  1073. label="是否特批"
  1074. >
  1075. <span>{getApproval(theData.approval)}</span>
  1076. </FormItem>
  1077. {/*this.props.data.orderStatus=='6'&&<FormItem className="half-item" {...formItemLayout} label="已退(万元)">
  1078. <span>{this.props.data.refundAmount}</span>
  1079. </FormItem>*/}
  1080. </div>
  1081. <div className="clearfix">
  1082. <FormItem
  1083. labelCol={{ span: 5 }}
  1084. wrapperCol={{ span: 18 }}
  1085. label="合同扫描件"
  1086. >
  1087. {/*<Upload*/}
  1088. {/* className="demandDetailShow-upload"*/}
  1089. {/* listType="picture-card"*/}
  1090. {/* fileList={this.state.orgCodeUrl}*/}
  1091. {/* onPreview={(file) => {*/}
  1092. {/* this.setState({*/}
  1093. {/* previewImage: file.url || file.thumbUrl,*/}
  1094. {/* previewVisible: true,*/}
  1095. {/* });*/}
  1096. {/* }}*/}
  1097. {/*/>*/}
  1098. {this.state.visible && this.state.orgCodeUrl && this.state.modKey === "1" ? <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  1099. <ImgList fileList={this.state.orgCodeUrl} domId={'outOutsourcingList1'}/>
  1100. </div> : <div/>}
  1101. <Modal
  1102. maskClosable={false}
  1103. footer={null}
  1104. width={"50%"}
  1105. visible={this.state.previewVisible}
  1106. onCancel={() => {
  1107. this.setState({
  1108. previewVisible: false,
  1109. rotateDeg: 0,
  1110. });
  1111. }}
  1112. >
  1113. <img
  1114. alt=""
  1115. style={{
  1116. width: "100%",
  1117. transform: `rotate(${this.state.rotateDeg}deg)`,
  1118. }}
  1119. src={this.state.previewImage || ""}
  1120. />
  1121. <Button
  1122. onClick={this.rotate}
  1123. style={{
  1124. position: "relative",
  1125. left: "50%",
  1126. transform: "translateX(-50%)",
  1127. }}
  1128. >
  1129. 旋转
  1130. </Button>
  1131. <Button
  1132. onClick={this.upImg}
  1133. style={{
  1134. position: "absolute",
  1135. left: -81,
  1136. top: "50%",
  1137. transform: "translateY(-50%)",
  1138. }}
  1139. >
  1140. 上一张
  1141. </Button>
  1142. <Button
  1143. onClick={this.downImg}
  1144. style={{
  1145. position: "absolute",
  1146. right: -81,
  1147. top: "50%",
  1148. transform: "translateY(-50%)",
  1149. }}
  1150. >
  1151. 下一张
  1152. </Button>
  1153. </Modal>
  1154. <Button
  1155. style={{
  1156. float: "right",
  1157. marginRight: "140px",
  1158. marginTop: "20px",
  1159. }}
  1160. onClick={this.getOrderLog}
  1161. >
  1162. 查看订单日志
  1163. </Button>
  1164. </FormItem>
  1165. <FormItem
  1166. labelCol={{ span: 5 }}
  1167. wrapperCol={{ span: 18 }}
  1168. label="补充协议"
  1169. >
  1170. {/*<Upload*/}
  1171. {/* className="demandDetailShow-upload"*/}
  1172. {/* listType="picture-card"*/}
  1173. {/* fileList={this.state.replenishUrl}*/}
  1174. {/* onPreview={(file) => {*/}
  1175. {/* this.setState({*/}
  1176. {/* previewImage: file.url || file.thumbUrl,*/}
  1177. {/* previewVisibles: true,*/}
  1178. {/* });*/}
  1179. {/* }}*/}
  1180. {/*/>*/}
  1181. {this.state.visible && this.state.replenishUrl && this.state.modKey === "1" ? <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
  1182. <ImgList fileList={this.state.replenishUrl} domId={'outOutsourcingList2'}/>
  1183. </div> : <div/>}
  1184. <Modal
  1185. maskClosable={false}
  1186. footer={null}
  1187. width={"50%"}
  1188. visible={this.state.previewVisibles}
  1189. onCancel={() => {
  1190. this.setState({
  1191. previewVisibles: false,
  1192. rotateDeg: 0,
  1193. });
  1194. }}
  1195. >
  1196. <img
  1197. alt=""
  1198. style={{
  1199. width: "100%",
  1200. transform: `rotate(${this.state.rotateDeg}deg)`,
  1201. }}
  1202. src={this.state.previewImage || ""}
  1203. />
  1204. <Button
  1205. onClick={this.rotates}
  1206. style={{
  1207. position: "relative",
  1208. left: "50%",
  1209. transform: "translateX(-50%)",
  1210. }}
  1211. >
  1212. 旋转
  1213. </Button>
  1214. <Button
  1215. onClick={this.upImgs}
  1216. style={{
  1217. position: "absolute",
  1218. left: -81,
  1219. top: "50%",
  1220. transform: "translateY(-50%)",
  1221. }}
  1222. >
  1223. 上一张
  1224. </Button>
  1225. <Button
  1226. onClick={this.downImgs}
  1227. style={{
  1228. position: "absolute",
  1229. right: -81,
  1230. top: "50%",
  1231. transform: "translateY(-50%)",
  1232. }}
  1233. >
  1234. 下一张
  1235. </Button>
  1236. </Modal>
  1237. </FormItem>
  1238. </div>
  1239. <ContentUrl
  1240. processStatus={1}
  1241. domId = {"cingListContents"}
  1242. contentUrl = {this.state.contentUrl}
  1243. imgId = {"cingListContentsImg"}
  1244. />
  1245. <div className="clearfix">
  1246. <FormItem
  1247. className="half-item"
  1248. {...formItemLayout}
  1249. label="合同编号"
  1250. >
  1251. <span>{theData.contractNo}</span>
  1252. </FormItem>
  1253. <FormItem
  1254. className="half-item"
  1255. {...formItemLayout}
  1256. label="订单部门"
  1257. >
  1258. <span>{theData.depName}</span>
  1259. </FormItem>
  1260. </div>
  1261. <div className="clearfix">
  1262. <FormItem
  1263. labelCol={{ span: 5 }}
  1264. wrapperCol={{ span: 18 }}
  1265. label="订单留言"
  1266. >
  1267. <p style={{ width: 500, wordWrap: "break-word" }}>
  1268. {this.state.orderRemarks}
  1269. </p>
  1270. </FormItem>
  1271. </div>
  1272. <div className="clearfix">
  1273. <FormItem
  1274. labelCol={{ span: 5 }}
  1275. wrapperCol={{ span: 18 }}
  1276. label="收款节点"
  1277. >
  1278. {jsDate.map((item) => {
  1279. return (
  1280. <p>
  1281. {getjiedian(item.dunSubject)} -- {item.money} 万元
  1282. </p>
  1283. );
  1284. })}
  1285. </FormItem>
  1286. </div>
  1287. <div className="clearfix">
  1288. <FormItem
  1289. className="half-item"
  1290. {...formItemLayout}
  1291. label="订单负责人"
  1292. >
  1293. <span>{theData.salesmanName}</span>
  1294. </FormItem>
  1295. <FormItem
  1296. className="half-item"
  1297. {...formItemLayout}
  1298. label="订单负责人电话"
  1299. >
  1300. <span>{theData.salesmanMobile}</span>
  1301. </FormItem>
  1302. <FormItem
  1303. className="half-item"
  1304. {...formItemLayout}
  1305. label="财务负责人"
  1306. >
  1307. <span>{theData.financeName}</span>
  1308. </FormItem>
  1309. <FormItem
  1310. className="half-item"
  1311. {...formItemLayout}
  1312. label="财务负责人电话"
  1313. >
  1314. <span>{theData.financeMobile}</span>
  1315. </FormItem>
  1316. </div>
  1317. <Modal
  1318. visible={this.state.avisible}
  1319. className="admin-desc-content"
  1320. width="800px"
  1321. maskClosable={false}
  1322. title="订单日志"
  1323. footer={null}
  1324. onCancel={this.closeOrderLog}
  1325. >
  1326. <div className="patent-table">
  1327. <Spin spinning={this.state.loading}>
  1328. <Table
  1329. columns={this.state.columnsY}
  1330. dataSource={this.state.dataSourceY}
  1331. pagination={false}
  1332. />
  1333. </Spin>
  1334. </div>
  1335. </Modal>
  1336. <div className="clearfix">
  1337. <p style={{ fontSize: 18, marginLeft: 20 }}>项目业务</p>
  1338. <div className="patent-table">
  1339. <Spin spinning={this.state.loading}>
  1340. <Table
  1341. columns={this.state.columnsX}
  1342. dataSource={this.state.dataSourceX}
  1343. size="small"
  1344. bordered
  1345. pagination={this.state.pagination}
  1346. onRowClick={this.tableRowClick}
  1347. />
  1348. </Spin>
  1349. </div>
  1350. </div>
  1351. </Spin>
  1352. </Form> : <div/>}
  1353. </TabPane>
  1354. <TabPane tab="外包详情" key="2">
  1355. <div className="clearfix">
  1356. <p style={{ color: "red" }}>
  1357. 提示:查看备注请点击表格左侧加号按钮~
  1358. </p>
  1359. <div className="patent-table">
  1360. <Spin spinning={this.state.loading}>
  1361. <Table
  1362. columns={this.state.columnsW}
  1363. dataSource={this.state.dataSourceW}
  1364. pagination={this.state.pagination}
  1365. expandedRowRender={(record) => (
  1366. <p style={{ margin: 0 }}>{record.remarks}</p>
  1367. )}
  1368. scroll={{ x: 300, y: 0 }}
  1369. />
  1370. </Spin>
  1371. </div>
  1372. </div>
  1373. </TabPane>
  1374. </Tabs>
  1375. </Modal> : <div/>}
  1376. </div>
  1377. <Assign
  1378. title="订单"
  1379. selApi="/api/admin/financial/distributionFinance"
  1380. data={this.state.assignData}
  1381. fenpaiData={4}
  1382. showDesc={this.state.assignVisible}
  1383. closeDesc={this.closeAssign.bind(this)}
  1384. roleName={"财务专员"}
  1385. requestMethod={"post"}
  1386. />
  1387. <Modal
  1388. visible={this.state.boHuiVisible}
  1389. width="400px"
  1390. title="驳回备注"
  1391. footer=""
  1392. onOk={this.boHuiOk}
  1393. onCancel={this.boHuiCancel}
  1394. >
  1395. <Form layout="horizontal" onSubmit={this.boHuiSubmit}>
  1396. <Spin spinning={this.state.loading}>
  1397. <FormItem
  1398. labelCol={{ span: 5 }}
  1399. wrapperCol={{ span: 16 }}
  1400. label={
  1401. <span>
  1402. <strong style={{ color: "#f00" }}>*</strong>驳回原因
  1403. </span>
  1404. }
  1405. >
  1406. <Input
  1407. type="textarea"
  1408. rows={4}
  1409. placeholder="请输入驳回原因"
  1410. value={this.state.content}
  1411. onChange={(e) => {
  1412. this.setState({ content: e.target.value });
  1413. }}
  1414. />
  1415. </FormItem>
  1416. <FormItem wrapperCol={{ span: 12, offset: 5 }}>
  1417. <Button
  1418. type="primary"
  1419. htmlType="submit"
  1420. style={{ marginRight: 20 }}
  1421. >
  1422. 驳回
  1423. </Button>
  1424. <Button
  1425. type="default"
  1426. onClick={() => {
  1427. this.boHuiCancel();
  1428. }}
  1429. >
  1430. 取消
  1431. </Button>
  1432. </FormItem>
  1433. </Spin>
  1434. </Form>
  1435. </Modal>
  1436. </div>
  1437. );
  1438. },
  1439. });
  1440. export default outsourcingPaiDan;