outsourcingPaiDan.jsx 42 KB

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