projectAssignment.jsx 46 KB

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