outsourceTaskAssignment.jsx 42 KB

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