approvedOutsourcing.jsx 45 KB

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