outsourceTaskAssignment.jsx 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  1. import React from "react";
  2. import $ from "jquery/src/ajax";
  3. import "@/manageCenter/financialManage/distribute/public.less";
  4. import {Button, Form, Input, Select, Spin, Table, message, Modal, Tabs, Tag, Tooltip} from "antd";
  5. import Assign from "@/manageCenter/publicComponent/assign";
  6. import ResolutionDetail from "@/resolutionDetail";
  7. import OrderRiZi from "@/orderRiZi.jsx";
  8. import OrderDetail from "../../order/orderNew/changeComponent/orderDetail";
  9. import {
  10. getProcessStatus,
  11. getLiquidationStatus,
  12. getApprovedState,
  13. splitUrl,
  14. getProjectStatus,
  15. getboutique,
  16. ShowModal
  17. } from "@/tools";
  18. import ShowModalDiv from "@/showModal.jsx";
  19. import ResolutionPro from "../task/resolutionPro";
  20. import {ChooseList} from "../../order/orderNew/chooseList";
  21. import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
  22. import OrderItemStatus from "../../../common/orderItemStatus";
  23. import EnterpriseNameChange from "../../../common/enterpriseNameChange";
  24. const FormItem = Form.Item;
  25. const {TabPane} = Tabs
  26. const OutsourceTaskAssignment = React.createClass({
  27. loadData(pageNo) {
  28. this.state.data = [];
  29. this.setState({
  30. loading: true,
  31. });
  32. $.ajax({
  33. method: "get",
  34. dataType: "json",
  35. crossDomain: false,
  36. url: globalConfig.context + "/api/admin/orderProject/orderTaskList",
  37. data: {
  38. pageNo: pageNo || 1,
  39. pageSize: this.state.pagination.pageSize,
  40. specially: 1, //经理
  41. name: this.state.nameSearch, //客户名称
  42. orderNo: this.state.orderNoSearch, //订单编号
  43. taskId: this.state.taskNoSearch, //任务编号
  44. depId: this.state.departmenttSearch, //订单部门
  45. taskStatus: this.state.taskStatus, //任务状态
  46. adminName: this.state.adminName, //任务受理人
  47. outsource: 1,
  48. },
  49. success: function (data) {
  50. ShowModal(this);
  51. let theArr = [];
  52. if (!data.data || !data.data.list) {
  53. if (data.error && data.error.length) {
  54. message.warning(data.error[0].message);
  55. }
  56. } else {
  57. for (let i = 0; i < data.data.list.length; i++) {
  58. let thisdata = data.data.list[i];
  59. if (thisdata.splitList) {
  60. thisdata.splitList.forEach((item) => {
  61. item.key = item.id;
  62. });
  63. }
  64. theArr.push({
  65. key: thisdata.id,
  66. orderNo: thisdata.orderNo, //订单编号
  67. id: thisdata.id, //任务ID
  68. taskName: thisdata.taskName, //名称
  69. cname: thisdata.cname, //项目品类
  70. receiverName: thisdata.receiverName, //受理人
  71. projectStatus: thisdata.projectStatus, //项目状态
  72. taskStatus: thisdata.taskStatus, //任务状态
  73. taskDate: thisdata.taskDate, //分配时间
  74. commodityQuantity: thisdata.commodityQuantity, //数量
  75. userName: thisdata.userName, //用户名
  76. depName: thisdata.depName, //部门名称
  77. splitStatus: thisdata.splitStatus, //拆分状态
  78. splitList: thisdata.splitList,
  79. });
  80. }
  81. }
  82. this.state.pagination.current = data.data.pageNo;
  83. this.state.pagination.total = data.data.totalCount;
  84. if (data.data && data.data.list && !data.data.list.length) {
  85. this.state.pagination.current = 0;
  86. this.state.pagination.total = 0;
  87. }
  88. this.setState({
  89. dataSource: theArr,
  90. page: data.data.pageNo,
  91. pagination: this.state.pagination,
  92. });
  93. }.bind(this),
  94. }).always(
  95. function () {
  96. this.setState({
  97. loading: false,
  98. });
  99. }.bind(this)
  100. );
  101. },
  102. getInitialState() {
  103. return {
  104. orderData: [],
  105. orderNo: "",
  106. jiedian: [],
  107. jiedianNew: [],
  108. activeKey: "1",
  109. searchMore: true,
  110. assignVisible: false,
  111. declarationBatch: 1,
  112. dataInfor: {},
  113. releaseDate: [],
  114. roleName: "",
  115. boHuivisible: false,
  116. departmentArr: [],
  117. selectedRowKeys: [],
  118. selectedRows: [],
  119. paginations: false,
  120. loading: false,
  121. pagination: {
  122. defaultCurrent: 1,
  123. defaultPageSize: 10,
  124. showQuickJumper: true,
  125. pageSize: 10,
  126. onChange: function (page) {
  127. this.loadData(page);
  128. }.bind(this),
  129. showTotal: function (total) {
  130. return "共" + total + "条数据";
  131. },
  132. },
  133. columns: [
  134. {
  135. title: "任务编号",
  136. dataIndex: "id",
  137. key: "id",
  138. },
  139. {
  140. title: "任务名称",
  141. dataIndex: "taskName",
  142. key: "taskName",
  143. },
  144. {
  145. title: "订单编号",
  146. dataIndex: "orderNo",
  147. key: "orderNo",
  148. },
  149. {
  150. title: "业务类别",
  151. dataIndex: "cname",
  152. key: "cname",
  153. },
  154. {
  155. title: "客户名称",
  156. dataIndex: "userName",
  157. key: "userName",
  158. render: text => {
  159. return (
  160. <Tooltip title={text}>
  161. <div style={{
  162. maxWidth:'150px',
  163. overflow:'hidden',
  164. textOverflow: "ellipsis",
  165. whiteSpace:'nowrap',
  166. }}>{text}</div>
  167. </Tooltip>
  168. )
  169. }
  170. },
  171. {
  172. title: "项目状态",
  173. dataIndex: "projectStatus",
  174. key: "projectStatus",
  175. render: (text) => {
  176. return getProjectStatus(text);
  177. },
  178. },
  179. {
  180. title: "分配时间",
  181. dataIndex: "taskDate",
  182. key: "taskDate",
  183. },
  184. {
  185. title: "任务数量",
  186. dataIndex: "commodityQuantity",
  187. key: "commodityQuantity",
  188. render: (text, record) => {
  189. if (record.splitStatus == 1) {
  190. return (
  191. <span>
  192. {text}{" "}
  193. <Tag color="#108ee9" style={{ float: "right" }}>
  194. 已拆
  195. </Tag>
  196. </span>
  197. );
  198. } else {
  199. return text;
  200. }
  201. },
  202. },
  203. {
  204. title: "订单部门",
  205. dataIndex: "depName",
  206. key: "depName",
  207. },
  208. {
  209. title: "操作",
  210. dataIndex: "caozuo",
  211. key: "caouzo",
  212. render: (text, record) => {
  213. return (
  214. <div>
  215. <Button
  216. type="primary"
  217. style={{ margin: "0 10px" }}
  218. disabled={record.splitStatus == 1 ? true : false}
  219. onClick={(e) => {
  220. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  221. }}
  222. >
  223. 转交
  224. </Button>
  225. <Button
  226. type="primary"
  227. style={{ margin: "0 10px" }}
  228. disabled={record.splitStatus == 1 ? true : false}
  229. onClick={(e) => {
  230. e.stopPropagation(), this.evaluate(record, "咨询师");
  231. }}
  232. >
  233. 分配任务
  234. </Button>
  235. {record.splitStatus == 0 ? (
  236. <Button
  237. type="primary"
  238. style={{ margin: "0 10px" }}
  239. onClick={(e) => {
  240. e.stopPropagation();
  241. this.setState({
  242. resolutionVisible: true,
  243. resolutionName: record.taskName,
  244. resolutionNumber: record.commodityQuantity,
  245. resolutionId: record.id,
  246. });
  247. }}
  248. >
  249. 拆分项目
  250. </Button>
  251. ) : (
  252. ""
  253. )}
  254. </div>
  255. );
  256. },
  257. },
  258. ],
  259. dataSource: [],
  260. searchTime: [],
  261. columnsX: [
  262. {
  263. title: "业务项目名称",
  264. dataIndex: "commodityName",
  265. key: "commodityName",
  266. },
  267. {
  268. title: "项目类别",
  269. dataIndex: "cname",
  270. key: "cname",
  271. },
  272. {
  273. title: "项目数量",
  274. dataIndex: "commodityQuantity",
  275. key: "commodityQuantity",
  276. render: (text, record) => {
  277. if (record.splitStatus == 1) {
  278. return (
  279. <span>
  280. {text}{" "}
  281. <Tag
  282. color="#108ee9"
  283. onClick={(e) => {
  284. e.stopPropagation();
  285. this.showRes(record);
  286. }}
  287. >
  288. 已拆
  289. </Tag>
  290. </span>
  291. );
  292. } else {
  293. return text;
  294. }
  295. },
  296. },
  297. {
  298. title: "金额(万元)",
  299. dataIndex: "commodityPrice",
  300. key: "commodityPrice",
  301. },
  302. {
  303. title: "负责人",
  304. dataIndex: "contacts",
  305. key: "contacts",
  306. },
  307. {
  308. title: "负责人电话",
  309. dataIndex: "contactsMobile",
  310. key: "contactsMobile",
  311. },
  312. {
  313. title: "主要项目",
  314. dataIndex: "main",
  315. key: "main",
  316. render: (text) => {
  317. return text ? "是" : "否";
  318. },
  319. },
  320. {
  321. title: "项目说明",
  322. dataIndex: "taskComment",
  323. key: "taskComment",
  324. render: (text) => {
  325. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  326. },
  327. },
  328. ],
  329. dataSourceX: [],
  330. resVisible: false,
  331. displayFees: "none",
  332. costReduction: '',
  333. officialCost: '',
  334. };
  335. },
  336. /* 分派 */
  337. evaluate(record, nub) {
  338. this.state.assignData = record;
  339. this.setState(
  340. {
  341. nub,
  342. },
  343. () => {
  344. this.setState({
  345. assignVisible: true,
  346. });
  347. }
  348. );
  349. },
  350. componentWillMount() {
  351. this.departmentList();
  352. this.loadData();
  353. },
  354. tableRowClick(record) {
  355. this.state.RowData = record;
  356. this.setState({
  357. visible: true,
  358. });
  359. this.xiangqing(record.orderNo);
  360. this.xiangmu(record.orderNo);
  361. },
  362. // 拆分详细
  363. showRes(record) {
  364. this.setState({
  365. resVisible: true,
  366. resRecord: record,
  367. });
  368. },
  369. resCancel() {
  370. this.setState({
  371. resVisible: false,
  372. });
  373. },
  374. //订单详情
  375. xiangqing(orderNos) {
  376. $.ajax({
  377. method: "get",
  378. dataType: "json",
  379. crossDomain: false,
  380. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  381. data: {
  382. orderNo: orderNos,
  383. },
  384. success: function (data) {
  385. if (data.error.length || data.data.list == "") {
  386. if (data.error && data.error.length) {
  387. message.warning(data.error[0].message);
  388. }
  389. } else {
  390. let thisdata = data.data;
  391. this.setState({
  392. orderUid: thisdata.uid,
  393. orderNo: thisdata.orderNo, //订单编号
  394. contractNo: thisdata.contractNo, //合同编号
  395. userName: thisdata.userName, //客户名称
  396. signDate: thisdata.signDate, //签单时间
  397. processStatus: thisdata.processStatus, //流程状态
  398. liquidationStatus: thisdata.liquidationStatus, //结算状态
  399. contacts: thisdata.contacts, //企业联系人
  400. contactMobile: thisdata.contactMobile, //联系人电话
  401. legalPerson: thisdata.legalPerson, //法人
  402. legalPersonTel: thisdata.legalPersonTel, //法人电话
  403. firstAmount: thisdata.firstAmount, //签单金额
  404. totalAmount: thisdata.totalAmount, //首付金额
  405. approval: thisdata.approval, //特批状态
  406. settlementAmount: thisdata.settlementAmount, //已收款项
  407. orderRemarks: thisdata.orderRemarks, //订单留言
  408. orgCodeUrl: thisdata.contractPictureUrl
  409. ? splitUrl(
  410. thisdata.contractPictureUrl,
  411. ",",
  412. globalConfig.avatarHost + "/upload"
  413. )
  414. : [], //图片地址
  415. salesmanName: thisdata.salesmanName, //营销员名称
  416. salesmanMobile: thisdata.salesmanMobile, //营销员电话
  417. financeName: thisdata.financeName, //财务名称
  418. financeMobile: thisdata.financeMobile, //财务电话
  419. oldSalesmanName: thisdata.oldSalesmanName, //营销员名称
  420. oldSalesmanMobile: thisdata.oldSalesmanMobile, //营销员电话
  421. nowFinance: thisdata.nowFinance, //财务名称
  422. nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
  423. depName: thisdata.depName, //订单部门
  424. deleteSign:thisdata.deleteSign,
  425. });
  426. }
  427. }.bind(this),
  428. }).always(
  429. function () {
  430. this.setState({
  431. loading: false,
  432. });
  433. }.bind(this)
  434. );
  435. },
  436. //项目列表
  437. xiangmu(orderNos) {
  438. $.ajax({
  439. method: "get",
  440. dataType: "json",
  441. crossDomain: false,
  442. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  443. data: {
  444. orderNo: orderNos,
  445. },
  446. success: function (data) {
  447. let theArr = [];
  448. if (data.error.length || data.data.list == "") {
  449. if (data.error && data.error.length) {
  450. message.warning(data.error[0].message);
  451. }
  452. } else {
  453. for (let i = 0; i < data.data.length; i++) {
  454. let thisdata = data.data[i];
  455. thisdata.key = i;
  456. theArr.push(thisdata);
  457. }
  458. }
  459. this.setState({
  460. dataSourceX: theArr,
  461. });
  462. }.bind(this),
  463. }).always(
  464. function () {
  465. this.setState({
  466. loading: false,
  467. });
  468. }.bind(this)
  469. );
  470. },
  471. //关闭详情
  472. visitCancel() {
  473. this.setState({
  474. visible: false,
  475. activeKey: "1"
  476. });
  477. this.loadData(this.state.page);
  478. },
  479. visitOk() {
  480. this.setState({
  481. visible: false,
  482. });
  483. this.reset();
  484. this.loadData(this.state.page);
  485. },
  486. closeDesc(e, s) {
  487. this.state.showDesc = e;
  488. if (s) {
  489. this.loadData(this.state.page);
  490. }
  491. },
  492. closeAssign(e, s) {
  493. this.state.roleName = "";
  494. this.state.assignVisible = e;
  495. if (s) {
  496. this.loadData(this.state.page);
  497. }
  498. },
  499. nextCancel() {
  500. this.setState({
  501. addnextVisible: false,
  502. displayFees: "none",
  503. costReduction: '',
  504. officialCost: '',
  505. });
  506. },
  507. //点击打卡项目详情
  508. tableRowClickX(record) {
  509. if (record.type == "1") {
  510. this.setState({
  511. displayFees: "block",
  512. costReduction: record.costReduction,
  513. officialCost: record.officialCost,
  514. });
  515. }else{
  516. this.setState({
  517. displayFees: "none",
  518. });
  519. }
  520. this.setState({
  521. jid: record.id, //项目ID
  522. kid: record.commodityId, //商品ID
  523. commodityName: record.commodityName, //金额
  524. commodityPrice: record.commodityPrice, //金额
  525. commodityQuantity: record.commodityQuantity, //数量
  526. taskComment: record.taskComment, //备注
  527. main: record.main.toString(), //是否为主要
  528. addnextVisible: true,
  529. dataInfor:record,
  530. addState: 0,
  531. });
  532. },
  533. search() {
  534. this.loadData();
  535. },
  536. reset() {
  537. this.state.nameSearch = "";
  538. this.state.releaseDate = [];
  539. this.state.orderNoSearch = "";
  540. this.state.taskNoSearch = "";
  541. this.state.departmenttSearch = undefined;
  542. this.state.distribution = undefined;
  543. },
  544. searchSwitch() {
  545. this.setState({
  546. searchMore: !this.state.searchMore,
  547. });
  548. },
  549. //部门
  550. departmentList() {
  551. this.setState({
  552. loading: true,
  553. });
  554. $.ajax({
  555. method: "get",
  556. dataType: "json",
  557. crossDomain: false,
  558. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  559. data: {},
  560. success: function (data) {
  561. let thedata = data.data;
  562. let theArr = [];
  563. if (!thedata) {
  564. if (data.error && data.error.length) {
  565. message.warning(data.error[0].message);
  566. }
  567. thedata = {};
  568. } else {
  569. thedata.map(function (item, index) {
  570. theArr.push({
  571. key: index,
  572. name: item.name,
  573. id: item.id,
  574. });
  575. });
  576. }
  577. this.setState({
  578. departmentArr: theArr,
  579. });
  580. }.bind(this),
  581. }).always(
  582. function () {
  583. this.setState({
  584. loading: false,
  585. });
  586. }.bind(this)
  587. );
  588. },
  589. resolutionCancel() {
  590. this.setState({
  591. resolutionVisible: false,
  592. });
  593. },
  594. rizhi() {
  595. this.setState({
  596. loading: true,
  597. });
  598. $.ajax({
  599. method: "get",
  600. dataType: "json",
  601. crossDomain: false,
  602. url: "/api/admin/newOrder/selectOrderLog",
  603. data: {
  604. orderNo: this.state.orderNo,
  605. },
  606. success: function (data) {
  607. let theArr = [];
  608. let thisData = data.data;
  609. if (!thisData.length) {
  610. if (data.error && data.error.length) {
  611. message.warning(data.error[0].message);
  612. }
  613. thisData = {};
  614. } else {
  615. for (let i = 0; i < data.data.length; i++) {
  616. let thisdata = data.data[i];
  617. theArr.push({
  618. processName: thisdata.processName,
  619. adminName: thisdata.adminName,
  620. createDate: thisdata.createDate,
  621. remarks: thisdata.remarks,
  622. });
  623. }
  624. }
  625. this.setState({
  626. dataSourceY: theArr,
  627. });
  628. }.bind(this),
  629. }).always(
  630. function () {
  631. this.setState({
  632. loading: false,
  633. });
  634. }.bind(this)
  635. );
  636. },
  637. closeOrderLog() {
  638. this.setState({
  639. avisible: false,
  640. });
  641. },
  642. getOrderLog() {
  643. this.setState({
  644. avisible: true,
  645. });
  646. this.rizhi();
  647. },
  648. orderChange(key) {
  649. this.setState({
  650. activeKey: key,
  651. });
  652. if (key == 2) {
  653. this.orderDetailData(this.state.orderNo);
  654. this.xiangmu(this.state.orderNo);
  655. this.jiedian(this.state.orderNo);
  656. this.jiedianNew(this.state.orderNo);
  657. }
  658. },
  659. //节点列表
  660. jiedian(orderNos) {
  661. $.ajax({
  662. method: "get",
  663. dataType: "json",
  664. crossDomain: false,
  665. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  666. data: {
  667. orderNo: orderNos,
  668. },
  669. success: function (data) {
  670. let theArr = [];
  671. let thisData = [];
  672. if (data.error.length || data.data.list == "") {
  673. if (data.error && data.error.length) {
  674. message.warning(data.error[0].message);
  675. }
  676. } else {
  677. for (let i = 0; i < data.data.length; i++) {
  678. thisData = data.data[i];
  679. theArr.push({
  680. key: i,
  681. dunSubject: thisData.dunSubject
  682. ? thisData.dunSubject.toString()
  683. : "", //催款科目
  684. id: thisData.id, //节点Id
  685. money: thisData.money, //催款金额
  686. dunStatus: thisData.dunStatus, //催款状态
  687. });
  688. }
  689. this.setState({
  690. jiedian: theArr,
  691. });
  692. }
  693. }.bind(this),
  694. });
  695. },
  696. jiedianNew(orderNos) {
  697. $.ajax({
  698. method: "get",
  699. dataType: "json",
  700. crossDomain: false,
  701. url:
  702. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  703. data: {
  704. orderNo: orderNos,
  705. },
  706. success: function (data) {
  707. if (data.error && data.error.length) {
  708. message.warning(data.error[0].message);
  709. } else {
  710. let theArr = [];
  711. let thisData = [];
  712. let arr = data.data || [];
  713. let totalCui = 0;
  714. for (let i = 0; i < arr.length; i++) {
  715. thisData = arr[i];
  716. totalCui += +thisData.money;
  717. theArr.push({
  718. key: i,
  719. dunSubject: thisData.dunSubject
  720. ? thisData.dunSubject.toString()
  721. : "", //催款科目
  722. id: thisData.id, //节点Id
  723. money: thisData.money, //催款金额
  724. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  725. commodityName: thisData.commodityName,
  726. projectType: thisData.projectType,
  727. dunTypeName: thisData.dunTypeName,
  728. status: thisData.status,
  729. waitDay: thisData.waitDay,
  730. effectiveCount: thisData.effectiveCount,
  731. startDate: thisData.startDate,
  732. dunType: thisData.dunType,
  733. appropriationRatio: thisData.appropriationRatio,
  734. customizeName: thisData.customizeName,
  735. customizeTimes: thisData.customizeTimes,
  736. });
  737. }
  738. if (!totalCui) {
  739. totalCui = 0;
  740. }
  741. totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
  742. this.setState({
  743. jiedianNew: theArr,
  744. totalCui,
  745. });
  746. }
  747. }.bind(this),
  748. }).always(
  749. function () {
  750. this.setState({
  751. loading: false,
  752. });
  753. }.bind(this)
  754. );
  755. },
  756. orderDetailData(orderNos) {
  757. this.setState({
  758. loading: true,
  759. });
  760. $.ajax({
  761. method: "get",
  762. dataType: "json",
  763. crossDomain: false,
  764. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  765. data: {
  766. orderNo: orderNos,
  767. },
  768. success: function (data) {
  769. if (data.error.length || data.data.list == "") {
  770. if (data.error && data.error.length) {
  771. message.warning(data.error[0].message);
  772. this.setState({
  773. loading: false,
  774. });
  775. }
  776. } else {
  777. let thisdata = data.data;
  778. this.setState({
  779. orderUid: thisdata.uid,
  780. loading: false,
  781. userName: thisdata.userName,
  782. primaryOrderNo: thisdata.primaryOrder,
  783. additionalOrder: thisdata.additionalOrder,
  784. contractNo: thisdata.contractNo,
  785. orderData: thisdata,
  786. isAddition: thisdata.additionalOrder ? true : false,
  787. contractPictureUrl: thisdata.contractPictureUrl
  788. ? splitUrl(
  789. thisdata.contractPictureUrl,
  790. ",",
  791. globalConfig.avatarHost + "/upload"
  792. )
  793. : [],
  794. deleteSign:thisdata.deleteSign,
  795. });
  796. }
  797. }.bind(this),
  798. });
  799. },
  800. changeList(arr) {
  801. const newArr = [];
  802. this.state.columns.forEach(item => {
  803. arr.forEach(val => {
  804. if (val === item.title) {
  805. newArr.push(item);
  806. }
  807. });
  808. });
  809. this.setState({
  810. changeList: newArr
  811. });
  812. },
  813. render() {
  814. const expandedRowRender = (e) => {
  815. const data = e.splitList;
  816. let columns = [];
  817. if (e.splitList instanceof Array && e.splitList.length) {
  818. columns = [
  819. {
  820. title: "任务编号",
  821. dataIndex: "splitSuper",
  822. key: "splitSuper",
  823. render: (text, record) => {
  824. return text + "-" + record.splitId;
  825. },
  826. },
  827. {
  828. title: "任务名称",
  829. dataIndex: "taskName",
  830. key: "taskName",
  831. },
  832. {
  833. title: "订单编号",
  834. dataIndex: "orderNo",
  835. key: "orderNo",
  836. },
  837. {
  838. title: "业务类别",
  839. dataIndex: "cname",
  840. key: "cname",
  841. },
  842. {
  843. title: "客户名称",
  844. dataIndex: "userName",
  845. key: "userName",
  846. render: text => {
  847. return (
  848. <Tooltip title={text}>
  849. <div style={{
  850. maxWidth:'150px',
  851. overflow:'hidden',
  852. textOverflow: "ellipsis",
  853. whiteSpace:'nowrap',
  854. }}>{text}</div>
  855. </Tooltip>
  856. )
  857. }
  858. },
  859. {
  860. title: "项目状态",
  861. dataIndex: "projectStatus",
  862. key: "projectStatus",
  863. render: (text) => {
  864. return getProjectStatus(text);
  865. },
  866. },
  867. {
  868. title: "分配时间",
  869. dataIndex: "taskDate",
  870. key: "taskDate",
  871. },
  872. {
  873. title: "任务数量",
  874. dataIndex: "commodityQuantity",
  875. key: "commodityQuantity",
  876. },
  877. {
  878. title: "订单部门",
  879. dataIndex: "depName",
  880. key: "depName",
  881. },
  882. {
  883. title: "拆分操作人",
  884. dataIndex: "splitAname",
  885. key: "splitAname",
  886. },
  887. {
  888. title: "项目负责人",
  889. dataIndex: "receiverName",
  890. key: "receiverName",
  891. },
  892. {
  893. title: "拆分时间",
  894. dataIndex: "splitTimes",
  895. key: "splitTimes",
  896. },
  897. {
  898. title: "操作",
  899. dataIndex: "caozuo",
  900. key: "caouzo",
  901. render: (text, record) => {
  902. return (
  903. <div>
  904. <Button
  905. type="primary"
  906. style={{ margin: "0 10px" }}
  907. disabled={record.distributeSign == 1 ? true : false}
  908. onClick={(e) => {
  909. e.stopPropagation(), this.evaluate(record, "咨询师经理");
  910. }}
  911. >
  912. 转交
  913. </Button>
  914. <Button
  915. type="primary"
  916. style={{ margin: "0 10px" }}
  917. disabled={record.distributeSign == 1 ? true : false}
  918. onClick={(e) => {
  919. e.stopPropagation(), this.evaluate(record, "咨询师");
  920. }}
  921. >
  922. 分配任务
  923. </Button>
  924. </div>
  925. );
  926. },
  927. },
  928. ];
  929. return (
  930. <Table
  931. size="middle"
  932. columns={columns}
  933. dataSource={data}
  934. pagination={false}
  935. onRowClick={this.tableRowClick.bind(this)}
  936. />
  937. );
  938. } else {
  939. columns = [];
  940. return (
  941. <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
  942. 此项目暂未拆分
  943. </p>
  944. );
  945. }
  946. };
  947. const rowSelection = {
  948. selectedRowKeys: this.state.selectedRowKeys,
  949. onChange: (selectedRowKeys, selectedRows) => {
  950. this.setState({
  951. selectedRows: selectedRows.slice(-1),
  952. selectedRowKeys: selectedRowKeys.slice(-1),
  953. });
  954. },
  955. };
  956. const formItemLayout = {
  957. labelCol: { span: 8 },
  958. wrapperCol: { span: 14 },
  959. };
  960. let departmentArr = this.state.departmentArr || [];
  961. return (
  962. <div className="user-content">
  963. {this.state.resVisible ? (
  964. <ResolutionDetail
  965. cancel={this.resCancel}
  966. detail={this.state.resRecord}
  967. visible={this.state.resVisible}
  968. id={this.state.resRecord.orderNo}
  969. />
  970. ) : (
  971. ""
  972. )}
  973. <ResolutionPro
  974. resolutionVisible={this.state.resolutionVisible}
  975. number={this.state.resolutionNumber}
  976. name={this.state.resolutionName}
  977. cancel={this.resolutionCancel}
  978. id={this.state.resolutionId}
  979. loadData={this.loadData}
  980. />
  981. <ShowModalDiv ShowModal={this.state.showModal} />
  982. <div className="content-title">
  983. <span>外包任务派单</span>
  984. </div>
  985. <Tabs defaultActiveKey="1" onChange={this.callback} className="test">
  986. <TabPane tab="搜索" key="1">
  987. <div className="user-search">
  988. <Input
  989. placeholder="客户名称"
  990. value={this.state.nameSearch}
  991. style={{ marginLeft: 10 }}
  992. onChange={(e) => {
  993. this.setState({ nameSearch: e.target.value });
  994. }}
  995. />
  996. <Input
  997. placeholder="订单编号"
  998. value={this.state.orderNoSearch}
  999. onChange={(e) => {
  1000. this.setState({ orderNoSearch: e.target.value });
  1001. }}
  1002. />
  1003. <Input
  1004. placeholder="任务编号"
  1005. value={this.state.taskNoSearch}
  1006. onChange={(e) => {
  1007. this.setState({ taskNoSearch: e.target.value });
  1008. }}
  1009. />
  1010. <Select
  1011. placeholder="选择部门"
  1012. style={{ width: 150, marginRight: "10px" }}
  1013. value={this.state.departmenttSearch}
  1014. onChange={(e) => {
  1015. this.setState({ departmenttSearch: e });
  1016. }}
  1017. >
  1018. {departmentArr.map(function (item) {
  1019. return (
  1020. <Select.Option key={item.id}>{item.name}</Select.Option>
  1021. );
  1022. })}
  1023. </Select>
  1024. <Button type="primary" onClick={this.search}>
  1025. 搜索
  1026. </Button>
  1027. <Button onClick={()=>{
  1028. this.reset();
  1029. this.loadData();
  1030. }}>重置</Button>
  1031. {/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch.bind(this)} /></span>
  1032. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1033. <span>订单时间 :</span>
  1034. <RangePicker
  1035. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1036. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1037. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1038. </div> */}
  1039. </div>
  1040. </TabPane>
  1041. <TabPane tab="更改表格显示数据" key="2">
  1042. <div style={{ marginLeft: 10 }}>
  1043. <ChooseList
  1044. columns={this.state.columns}
  1045. changeFn={this.changeList}
  1046. changeList={this.state.changeList}
  1047. top={55}
  1048. margin={11}
  1049. />
  1050. </div>
  1051. </TabPane>
  1052. </Tabs>
  1053. <div className="patent-table">
  1054. <Spin spinning={this.state.loading}>
  1055. <Table
  1056. columns={
  1057. this.state.changeList
  1058. ? this.state.changeList
  1059. : this.state.columns
  1060. }
  1061. dataSource={this.state.dataSource}
  1062. expandedRowRender={expandedRowRender}
  1063. // rowSelection={rowSelection}
  1064. pagination={this.state.pagination}
  1065. onRowClick={this.tableRowClick.bind(this)}
  1066. bordered
  1067. size="middle"
  1068. />
  1069. </Spin>
  1070. </div>
  1071. <Assign
  1072. title="任务"
  1073. selApi={"/api/admin/orderProject/projectDistribution"}
  1074. data={this.state.assignData}
  1075. showDesc={this.state.assignVisible}
  1076. closeDesc={this.closeAssign.bind(this)}
  1077. fenpaiData={8}
  1078. type={this.state.nub == "咨询师经理" ? 1 : 2}
  1079. roleName={this.state.nub}
  1080. requestMethod={"post"}
  1081. />
  1082. <Modal
  1083. className="customeDetails"
  1084. maskClosable={false}
  1085. footer=""
  1086. title=""
  1087. width="900px"
  1088. visible={this.state.visible}
  1089. onOk={this.visitOk}
  1090. onCancel={this.visitCancel}
  1091. >
  1092. <Tabs activeKey={this.state.activeKey} onChange={this.orderChange} tabBarExtraContent={
  1093. <div style={{fontWeight:'bold',paddingRight:'15px'}}>
  1094. <OrderItemStatus deleteSign={this.state.deleteSign}/>
  1095. </div>
  1096. }>
  1097. <TabPane tab="任务详情" key="1">
  1098. <Form
  1099. layout="horizontal"
  1100. onSubmit={this.handleSubmit}
  1101. id="demand-form"
  1102. style={{ paddingBottom: "40px" }}
  1103. >
  1104. <Spin spinning={this.state.loading}>
  1105. <div className="clearfix">
  1106. <FormItem
  1107. className="half-item"
  1108. {...formItemLayout}
  1109. label="订单编号"
  1110. >
  1111. <span>{this.state.orderNo}</span>
  1112. </FormItem>
  1113. <FormItem
  1114. className="half-item"
  1115. {...formItemLayout}
  1116. label="合同编号"
  1117. >
  1118. <span>{this.state.contractNo}</span>
  1119. </FormItem>
  1120. <FormItem
  1121. className="half-item"
  1122. {...formItemLayout}
  1123. label="客户名称"
  1124. >
  1125. <span>{this.state.userName}</span>
  1126. <EnterpriseNameChange
  1127. type='journal'
  1128. style={{ marginLeft: 10 }}
  1129. enterpriseId={this.state.orderUid}/>
  1130. </FormItem>
  1131. <FormItem
  1132. className="half-item"
  1133. {...formItemLayout}
  1134. label="合同签订时间"
  1135. >
  1136. <span>{this.state.signDate}</span>
  1137. </FormItem>
  1138. <FormItem
  1139. className="half-item"
  1140. {...formItemLayout}
  1141. label="流程状态"
  1142. >
  1143. <span>{getProcessStatus(this.state.processStatus)}</span>
  1144. </FormItem>
  1145. <FormItem
  1146. className="half-item"
  1147. {...formItemLayout}
  1148. label="结算状态"
  1149. >
  1150. <span>
  1151. {getLiquidationStatus(this.state.liquidationStatus)}
  1152. </span>
  1153. </FormItem>
  1154. <FormItem
  1155. className="half-item"
  1156. {...formItemLayout}
  1157. label="企业联系人"
  1158. >
  1159. <span>{this.state.contacts}</span>
  1160. </FormItem>
  1161. <FormItem
  1162. className="half-item"
  1163. {...formItemLayout}
  1164. label="联系人电话"
  1165. >
  1166. <span>{this.state.contactMobile}</span>
  1167. </FormItem>
  1168. <FormItem
  1169. className="half-item"
  1170. {...formItemLayout}
  1171. label="企业法人"
  1172. >
  1173. <span>{this.state.legalPerson}</span>
  1174. </FormItem>
  1175. <FormItem
  1176. className="half-item"
  1177. {...formItemLayout}
  1178. label="法人电话"
  1179. >
  1180. <span>{this.state.legalPersonTel}</span>
  1181. </FormItem>
  1182. <FormItem
  1183. className="half-item"
  1184. {...formItemLayout}
  1185. label="签单金额(万元)"
  1186. >
  1187. <span>{this.state.totalAmount}</span>
  1188. </FormItem>
  1189. <FormItem
  1190. className="half-item"
  1191. {...formItemLayout}
  1192. label="首付金额(万元)"
  1193. >
  1194. <span>{this.state.firstAmount}</span>
  1195. </FormItem>
  1196. <FormItem
  1197. className="half-item"
  1198. {...formItemLayout}
  1199. label="特批立项"
  1200. >
  1201. <span>{getApprovedState(this.state.approval)}</span>
  1202. </FormItem>
  1203. <FormItem
  1204. className="half-item"
  1205. {...formItemLayout}
  1206. label="已收款项(万元)"
  1207. >
  1208. <span>{this.state.settlementAmount}</span>
  1209. </FormItem>
  1210. <div className="clearfix">
  1211. <FormItem
  1212. labelCol={{ span: 4 }}
  1213. wrapperCol={{ span: 16 }}
  1214. label="订单留言"
  1215. >
  1216. <p style={{ width: 500, wordWrap: "break-word" }}>
  1217. {this.state.orderRemarks}
  1218. </p>
  1219. </FormItem>
  1220. </div>
  1221. <div className="clearfix">
  1222. <FormItem
  1223. className="half-item"
  1224. {...formItemLayout}
  1225. label="订单负责人"
  1226. >
  1227. <span>{this.state.salesmanName}</span>
  1228. </FormItem>
  1229. <FormItem
  1230. className="half-item"
  1231. {...formItemLayout}
  1232. label="订单负责人电话"
  1233. >
  1234. <span>{this.state.salesmanMobile}</span>
  1235. </FormItem>
  1236. <FormItem
  1237. className="half-item"
  1238. {...formItemLayout}
  1239. label="订单部门"
  1240. >
  1241. <span>{this.state.depName}</span>
  1242. </FormItem>
  1243. </div>
  1244. <div className="clearfix">
  1245. <FormItem
  1246. className="half-item"
  1247. {...formItemLayout}
  1248. label="当前财务负责人"
  1249. >
  1250. <span>{this.state.nowFinance}</span>
  1251. </FormItem>
  1252. <FormItem
  1253. className="half-item"
  1254. {...formItemLayout}
  1255. label="当前财务负责人电话"
  1256. >
  1257. <span>{this.state.nowFinanceMobile}</span>
  1258. </FormItem>
  1259. </div>
  1260. <div className="clearfix">
  1261. <FormItem
  1262. className="half-item"
  1263. {...formItemLayout}
  1264. style={{ opacity: ".5" }}
  1265. label="原订单负责人"
  1266. >
  1267. <span>{this.state.oldSalesmanName}</span>
  1268. </FormItem>
  1269. <FormItem
  1270. className="half-item"
  1271. {...formItemLayout}
  1272. style={{ opacity: ".5" }}
  1273. label="原订单负责人电话"
  1274. >
  1275. <span>{this.state.oldSalesmanMobile}</span>
  1276. </FormItem>
  1277. </div>
  1278. <div className="clearfix">
  1279. <FormItem
  1280. className="half-item"
  1281. {...formItemLayout}
  1282. style={{ opacity: ".5" }}
  1283. label="实际财务操作人"
  1284. >
  1285. <span>{this.state.financeName}</span>
  1286. </FormItem>
  1287. <FormItem
  1288. className="half-item"
  1289. {...formItemLayout}
  1290. style={{ opacity: ".5" }}
  1291. label="实际财务操作人电话"
  1292. >
  1293. <span>{this.state.financeMobile}</span>
  1294. </FormItem>
  1295. </div>
  1296. <div className="clearfix">
  1297. <FormItem
  1298. className="half-item"
  1299. {...formItemLayout}
  1300. label="订单留言"
  1301. >
  1302. <span>{this.state.orderRemarks}</span>
  1303. </FormItem>
  1304. <FormItem
  1305. className="half-item"
  1306. {...formItemLayout}
  1307. label=""
  1308. >
  1309. <Button onClick={this.getOrderLog}>查看订单日志</Button>
  1310. </FormItem>
  1311. </div>
  1312. <OrderRiZi
  1313. dataSourcerizhi={this.state.dataSourceY}
  1314. closeOrderLog={this.closeOrderLog}
  1315. visible={this.state.avisible}
  1316. loading={this.state.loading}
  1317. />
  1318. <div>
  1319. <span style={{ marginLeft: "50px", fontSize: "20px" }}>
  1320. 项目业务
  1321. </span>
  1322. {this.state.processStatus == 0 ? (
  1323. <Button
  1324. type="primary"
  1325. onClick={this.addDetailed}
  1326. style={{
  1327. float: "right",
  1328. marginRight: "50px",
  1329. marginBottom: "15px",
  1330. }}
  1331. >
  1332. 添加项目明细
  1333. </Button>
  1334. ) : (
  1335. ""
  1336. )}
  1337. </div>
  1338. <div className="patent-table">
  1339. <Spin spinning={this.state.loading}>
  1340. <Table
  1341. columns={this.state.columnsX}
  1342. dataSource={this.state.dataSourceX}
  1343. pagination={this.state.paginations}
  1344. onRowClick={this.tableRowClickX}
  1345. bordered
  1346. size="middle"
  1347. />
  1348. </Spin>
  1349. </div>
  1350. </div>
  1351. </Spin>
  1352. </Form>
  1353. </TabPane>
  1354. <TabPane tab="订单详情" key="2">
  1355. <Spin spinning={this.state.loading}>
  1356. <OrderDetail
  1357. orderUid={this.state.orderUid}
  1358. orderData={this.state.orderData}
  1359. getOrderLog={this.getOrderLog}
  1360. dataSourceX={this.state.dataSourceX}
  1361. contactList={this.state.jiedian}
  1362. orderNo={this.state.orderNo}
  1363. totalCui={this.state.totalCui}
  1364. contactListNew={this.state.jiedianNew}
  1365. pictureUrl={this.state.contractPictureUrl}
  1366. />
  1367. </Spin>
  1368. </TabPane>
  1369. </Tabs>
  1370. </Modal>
  1371. {this.state.addnextVisible && <ProjectDetailsReadOnly
  1372. infor={this.state.dataInfor}
  1373. visible={this.state.addnextVisible}
  1374. onCancel={this.nextCancel}
  1375. />}
  1376. </div>
  1377. );
  1378. },
  1379. });
  1380. export default OutsourceTaskAssignment;