outOutsourcingList.jsx 45 KB

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