outOutsourcingList.jsx 47 KB

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