outsourcingPaiDan.jsx 44 KB

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