outsourceTaskAssignment.jsx 44 KB

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