approvedOutsourcing.jsx 46 KB

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