projectManageDetaile.jsx 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294
  1. import React from 'react';
  2. import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import '../userMangagement.less';
  6. import {orderType} from '../../../../dataDic.js';
  7. import {getOrderType,getProjectState,getTaskStatus,getOrderChannel,getOrderState,getPaymentState ,getApprovedState} from '../../../../tools.js';
  8. const MySettlementDetaile = Form.create()(React.createClass({
  9. loadData(record) {
  10. this.setState({
  11. loading: true
  12. });
  13. $.ajax({
  14. method: "get",
  15. dataType: "json",
  16. crossDomain: false,
  17. url: globalConfig.context + '/api/admin/techproject/getProjectTask',
  18. data: {
  19. contractId:record?record.id:this.props.datauser.id
  20. },
  21. success: function (data) {
  22. let theArr =[];
  23. if (!data.data) {
  24. if (data.error && data.error.length) {
  25. message.warning(data.error[0].message);
  26. };
  27. } else {
  28. for (let i = 0; i < data.data.length; i++) {
  29. let thisdata = data.data[i];
  30. theArr.push({
  31. key:i,
  32. taskId:thisdata.taskId,
  33. commodityName:thisdata.commodityName,
  34. commodityQuantity:thisdata.commodityQuantity,
  35. technicianName:thisdata.technicianName,
  36. taskStatus:thisdata.taskStatus,
  37. deleteSign:thisdata.deleteSign,
  38. taskComment:thisdata.taskComment,
  39. });
  40. };
  41. }
  42. this.setState({
  43. dataSource: theArr,
  44. });
  45. }.bind(this),
  46. }).always(function () {
  47. this.setState({
  48. loading: false
  49. });
  50. }.bind(this));
  51. },
  52. getInitialState() {
  53. return {
  54. loading: false,
  55. visible: false,
  56. contractState:false,
  57. projectVisible:false,
  58. selectedRowKey:[],
  59. orderSelect:false,
  60. orgCodeUrl:[],
  61. customerArr:[],
  62. checkedKeys: [],
  63. //派单
  64. columns: [
  65. {
  66. title: '任务名称',
  67. dataIndex: 'commodityName',
  68. key: 'commodityName'
  69. },{
  70. title: '任务数量',
  71. dataIndex: 'commodityQuantity',
  72. key: 'commodityQuantity'
  73. }, {
  74. title: '任务负责人',
  75. dataIndex: 'technicianName',
  76. key: 'technicianName'
  77. }, {
  78. title: '任务状态',
  79. dataIndex: 'taskStatus',
  80. key: 'taskStatus',
  81. render:(text)=>{return getTaskStatus(text)}
  82. }, {
  83. title: '是否锁定',
  84. dataIndex: 'deleteSign',
  85. key: 'deleteSign',
  86. render:(text)=>{return text==2?'锁定':'未锁定'}
  87. },{
  88. title: '任务说明',
  89. dataIndex: 'taskComment',
  90. key: 'taskComment',
  91. render:(text) => {
  92. return(
  93. text&&text.length>6?text.substr(0,8)+'...':text
  94. )
  95. }
  96. },{
  97. title: '操作',
  98. dataIndex: 'rrtk',
  99. key: 'rrtk',
  100. render:(text,record,index)=>{
  101. return (
  102. <div>
  103. {record.taskStatus<=1&&<Popconfirm title={'您将删除项目任务 【'+record.commodityName+'】,系统将自动同步作废项目资料单,请确认!'} onConfirm={(e)=>{this.voidOperation(record)}} okText="确认" cancelText="取消">
  104. <Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation()}} type="danger">删除</Button>
  105. </Popconfirm>}
  106. {record.taskStatus<1&&<Button style={{marginRight:'5px'}} onClick={(e) =>{ e.stopPropagation(),this.confirmDelet(record)}} type="primary">派单</Button>}
  107. </div>
  108. )
  109. }
  110. }
  111. ],
  112. userList:[
  113. {
  114. title: '用户编号',
  115. dataIndex: 'userNo',
  116. key: 'userNo'
  117. }, {
  118. title: '用户姓名',
  119. dataIndex: 'name',
  120. key: 'name'
  121. },{
  122. title: '部门机构',
  123. dataIndex: 'departmentName',
  124. key: 'departmentName'
  125. }, {
  126. title: '职务',
  127. dataIndex: 'position',
  128. key: 'position'
  129. },{
  130. title: '联系手机',
  131. dataIndex: 'mobile',
  132. key: 'mobile'
  133. }, {
  134. title: '操作',
  135. dataIndex: 'abc',
  136. key: 'abc',
  137. render:(text,record,index)=>{
  138. return (
  139. <Popconfirm title={'您确认将订单分配给【'+record.departmentName+'-'+record.name+'】进行业务跟进?'} onConfirm={(e)=>{this.confirmSelect(record)}} okText="确认" cancelText="取消">
  140. <Button style={{marginRight:'5px'}} type="primary">选定</Button>
  141. </Popconfirm>
  142. )
  143. }
  144. }
  145. ],
  146. contractList:[
  147. {
  148. title: '姓名',
  149. dataIndex: 'name',
  150. key: 'name'
  151. }, {
  152. title: '部门',
  153. dataIndex: 'depatrment',
  154. key: 'depatrment'
  155. },{
  156. title: '联系方式',
  157. dataIndex: 'mobile',
  158. key: 'mobile'
  159. },{
  160. title: '是否为主要联系人',
  161. dataIndex: 'major',
  162. key: 'major',
  163. render:(text) => {
  164. return text?'是':"否"
  165. }
  166. }, {
  167. title: '职务',
  168. dataIndex: 'position',
  169. key: 'position'
  170. },{
  171. title: '微信',
  172. dataIndex: 'wechat',
  173. key: 'wechat'
  174. },{
  175. title: 'QQ',
  176. dataIndex: 'qq',
  177. key: 'qq'
  178. },
  179. ],
  180. };
  181. },
  182. seeOrder(){
  183. this.seeOrderAjax();
  184. this.setState({
  185. seeState:true,
  186. orderVisible:true
  187. })
  188. },
  189. seeContract(){
  190. this.contract();
  191. this.setState({
  192. seeState:false,
  193. orderVisible:true
  194. })
  195. },
  196. orderCancel(){
  197. this.setState({
  198. orderVisible:false
  199. })
  200. },
  201. //查看联系人
  202. contract(){
  203. $.ajax({
  204. method: "get",
  205. dataType: "json",
  206. crossDomain: false,
  207. url: globalConfig.context + '/api/admin/customer/findAllContacts',
  208. data: {
  209. uid: this.state.buyerId
  210. },
  211. success: function (data) {
  212. let thisData = data.data;
  213. if (!thisData) {
  214. if (data.error && data.error.length) {
  215. message.warning(data.error[0].message);
  216. };
  217. thisData = {};
  218. };
  219. this.setState({
  220. contractArr:thisData,
  221. });
  222. }.bind(this),
  223. }).always(function () {
  224. this.setState({
  225. loading: false
  226. });
  227. }.bind(this));
  228. },
  229. //查看订单
  230. seeOrderAjax(){
  231. $.ajax({
  232. method: "get",
  233. dataType: "json",
  234. crossDomain: false,
  235. url: globalConfig.context + '/api/admin/order/getServiceOrderDetail',
  236. data: {
  237. orderNo: this.state.orderNok
  238. },
  239. success: function (data) {
  240. let thisData = data.data;
  241. if (!thisData) {
  242. if (data.error && data.error.length) {
  243. message.warning(data.error[0].message);
  244. };
  245. thisData = {};
  246. };
  247. this.setState({
  248. orderArr:thisData,
  249. });
  250. }.bind(this),
  251. }).always(function () {
  252. this.setState({
  253. loading: false
  254. });
  255. }.bind(this));
  256. },
  257. //查看详情
  258. loaduser(record){
  259. if(record){
  260. $.ajax({
  261. method: "get",
  262. dataType: "json",
  263. crossDomain: false,
  264. url: globalConfig.context + '/api/admin/techproject/getProjectDetail',
  265. data: {
  266. contractId: record.id,
  267. buyerType:record.buyerType
  268. },
  269. success: function (data) {
  270. let thisData = data.data;
  271. if (!thisData) {
  272. if (data.error && data.error.length) {
  273. message.warning(data.error[0].message);
  274. };
  275. thisData = {};
  276. };
  277. this.setState({
  278. buyerId:thisData.uid,
  279. id:record.id,
  280. orderNok:thisData.orderNo,
  281. orderList:thisData,
  282. technicianName:thisData.technicianName, //项目负责人
  283. });
  284. }.bind(this),
  285. }).always(function () {
  286. this.setState({
  287. loading: false
  288. });
  289. }.bind(this));
  290. }
  291. },
  292. //删除
  293. voidOperation(record){
  294. this.setState({
  295. loading: true
  296. });
  297. $.ajax({
  298. method: "get",
  299. dataType: "json",
  300. crossDomain: false,
  301. url: globalConfig.context + '/api/admin/techproject/deleteProjectTask',
  302. data: {
  303. taskId:record.taskId
  304. }
  305. }).done(function (data) {
  306. if (!data.error.length) {
  307. message.success('操作成功');
  308. this.setState({
  309. loading: false,
  310. });
  311. this.loadData();
  312. } else {
  313. message.warning(data.error[0].message);
  314. };
  315. }.bind(this));
  316. },
  317. //订单编辑保存
  318. handleOk(e) {
  319. this.setState({
  320. visible: false,
  321. });
  322. this.props.closeDesc(false, true);
  323. },
  324. handleCancel(e) {
  325. this.setState({
  326. visible: false,
  327. });
  328. this.props.closeDesc(false);
  329. },
  330. //新建项目
  331. projectOk(e) {
  332. this.setState({
  333. projectVisible: false,
  334. });
  335. this.props.closeDesc(false, true);
  336. },
  337. projectCancel(e) {
  338. this.setState({
  339. projectVisible: false,
  340. });
  341. this.props.closeDesc(false);
  342. },
  343. //选定订单
  344. orderOk() {
  345. this.setState({
  346. orderSelect: false,
  347. });
  348. },
  349. componentWillMount() {
  350. },
  351. nextCancel() {
  352. this.setState({
  353. addnextVisible: false
  354. })
  355. },
  356. //查看订单明细
  357. orderDetails(record){
  358. if(record){
  359. $.ajax({
  360. method: "get",
  361. dataType: "json",
  362. crossDomain: false,
  363. url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail',
  364. data: {
  365. taskId: record.taskId
  366. },
  367. success: function (data) {
  368. let thisData = data.data;
  369. if (!thisData) {
  370. if (data.error && data.error.length) {
  371. message.warning(data.error[0].message);
  372. };
  373. thisData = {};
  374. };
  375. this.setState({
  376. taskId:thisData.taskId,
  377. taskNo:thisData.taskNo,
  378. projectNo:thisData.projectNo,
  379. categoryId:thisData.categoryId,
  380. commodityName:thisData.commodityName,
  381. taskStatus:thisData.taskStatus,
  382. taskComment:thisData.taskComment,
  383. deletedSign:thisData.deletedSign,
  384. taskAllocatorName:thisData.taskAllocatorName,
  385. taskReceiverName:thisData.taskReceiverName,
  386. taskDistributionTime:thisData.taskDistributionTime,
  387. });
  388. }.bind(this),
  389. }).always(function () {
  390. this.setState({
  391. loading: false
  392. });
  393. }.bind(this));
  394. }
  395. },
  396. //创建项目保存
  397. admissibleOrder(){
  398. if(!this.state.autoId||!this.state.customerName){
  399. message.warning('客户名称不匹配');
  400. return false;
  401. };
  402. if(!this.state.projectName){
  403. message.warning('请选择项目负责人');
  404. return false;
  405. };
  406. if(!this.state.contractType){
  407. message.warning('请选择业务品类');
  408. return false;
  409. };
  410. if(this.state.signComment&&this.state.signComment.length>45){
  411. message.warning('项目说明字数不能超过45字');
  412. return false;
  413. };
  414. this.setState({
  415. loading: true
  416. });
  417. $.ajax({
  418. method: "POST",
  419. dataType: "json",
  420. crossDomain: false,
  421. url: globalConfig.context + '/api/admin/techproject/createProject',
  422. data: {
  423. uid:this.state.autoId,
  424. signComment:this.state.signComment,
  425. aid:this.state.aid,
  426. projectType:0,
  427. contractType:this.state.contractType
  428. }
  429. }).done(function(data) {
  430. this.setState({
  431. loading: false
  432. });
  433. if(!data.error.length) {
  434. message.success('创建成功!');
  435. this.projectOk()
  436. } else {
  437. message.warning(data.error[0].message);
  438. }
  439. }.bind(this));
  440. },
  441. //派单
  442. //操作分配
  443. confirmDelet(index){
  444. this.setState({
  445. taskIds:index.taskId,
  446. userDetaile:false,
  447. distributionVisible:true
  448. });
  449. },
  450. distributionCancel(){
  451. this.setState({
  452. distributionVisible:false
  453. })
  454. },
  455. distributionOk(){
  456. this.setState({
  457. distributionVisible:false
  458. })
  459. },
  460. //分配对象列表
  461. contactList(){
  462. $.ajax({
  463. method: "get",
  464. dataType: "json",
  465. crossDomain: false,
  466. url: globalConfig.context + '/api/admin/superviser/adminList',
  467. data: {
  468. pageNo: 1,
  469. pageSize: 99,
  470. departmentId:this.state.departmenttList,
  471. name:this.state.financeNameSearch,
  472. },
  473. success: function (data) {
  474. let theArr = [];
  475. if (!data.data) {
  476. if (data.error && data.error.length) {
  477. message.warning(data.error[0].message);
  478. };
  479. } else {
  480. for (let i = 0; i < data.data.list.length; i++) {
  481. let thisdata = data.data.list[i];
  482. theArr.push({
  483. key: i,
  484. id: thisdata.id,
  485. userNo: thisdata.userNo,
  486. name:thisdata.name,
  487. departmentName:thisdata.departmentName,
  488. departmentId:thisdata.departmentId,
  489. position:thisdata.position,
  490. mobile:thisdata.mobile,
  491. });
  492. };
  493. };
  494. this.setState({
  495. distributionList: theArr,
  496. });
  497. }.bind(this),
  498. }).always(function () {
  499. this.setState({
  500. loading: false
  501. });
  502. }.bind(this));
  503. },
  504. //选定对象
  505. confirmSelect(record){
  506. if(this.state.projectVisible){
  507. this.setState({
  508. aid:record.id,
  509. projectName:record.name
  510. })
  511. this.distributionOk();
  512. return false
  513. }
  514. this.setState({
  515. loading: true
  516. });
  517. $.ajax({
  518. method: "POST",
  519. dataType: "json",
  520. crossDomain: false,
  521. url: globalConfig.context + "/api/admin/techproject/distributionTask",
  522. data: {
  523. taskId:this.state.taskIds,
  524. taskReceiverId:record.id
  525. }
  526. }).done(function (data) {
  527. if (!data.error.length) {
  528. message.success('分派成功!');
  529. this.setState({
  530. loading: false,
  531. });
  532. this.distributionOk();
  533. this.loadData();
  534. } else {
  535. message.warning(data.error[0].message);
  536. };
  537. }.bind(this));
  538. },
  539. searchOrder(){
  540. this.contactList();
  541. },
  542. resetOrder(){
  543. this.state.departmenttList=undefined;
  544. this.state.financeNameSearch='';
  545. this.setState({
  546. distributionList:[]
  547. })
  548. },
  549. //添加任务
  550. addTask(){
  551. this.setState({
  552. commodityQuantity:'',
  553. commodityName:'',
  554. taskComment:'',
  555. kid:'',
  556. commodityId:undefined,
  557. addTaskState:true,
  558. addnextVisible:true,
  559. customerArr:[]
  560. });
  561. },
  562. //客户名称自动补全
  563. //加载(自动补全)
  564. supervisor(e,state){ //客户名称与服务名称自动补全
  565. let api=state?'/api/admin/customer/findCustomerByName':'/api/admin/order/getBusinessProjectByName';
  566. $.ajax({
  567. method: "get",
  568. dataType: "json",
  569. crossDomain: false,
  570. url: globalConfig.context + api,
  571. data:state?{
  572. name:e
  573. }:{
  574. businessName:e
  575. },
  576. success: function (data) {
  577. let thedata=data.data;
  578. if (!thedata) {
  579. if (data.error && data.error.length) {
  580. message.warning(data.error[0].message);
  581. };
  582. thedata = {};
  583. };
  584. this.setState({
  585. states:state,
  586. customerArr:thedata,
  587. });
  588. }.bind(this),
  589. }).always(function () {
  590. this.setState({
  591. loading: false
  592. });
  593. }.bind(this));
  594. },
  595. //服务值改变时请求客户名称
  596. httpChange(e){
  597. if(e.length>=2){
  598. this.supervisor(e,false);
  599. }
  600. this.setState({
  601. commodityName:e
  602. })
  603. },
  604. //上级主管输入框失去焦点是判断客户是否存在
  605. selectAuto(value){
  606. let kid=[];
  607. let fwList=this.state.customerArr;
  608. fwList.map(function(item){
  609. if(value==item.bname){
  610. kid=item.id
  611. }
  612. })
  613. this.setState({
  614. kid:kid,
  615. commodityName:value,
  616. })
  617. },
  618. customerChange(e){
  619. if(e.length>=2){
  620. this.supervisor(e,true);
  621. }
  622. this.setState({
  623. customerName:e
  624. })
  625. },
  626. //客户
  627. selectAutoCUT(value){
  628. let autoIds;
  629. let fwList=this.state.customerArr;
  630. fwList.map(function(item){
  631. if(value==item.name){
  632. autoIds=item.id
  633. }
  634. })
  635. this.setState({
  636. customerName:value,
  637. autoId:autoIds
  638. })
  639. },
  640. //任务新建、编辑保存
  641. taskSumbit(e) {
  642. e.preventDefault();
  643. if(this.state.addTaskState){
  644. if(!this.state.kid){
  645. message.warning('请输入服务项目名称');
  646. return false;
  647. };
  648. if(!this.state.commodityQuantity){
  649. message.warning('请输入数量');
  650. return false;
  651. };
  652. }
  653. this.props.form.validateFields((err, values) => {
  654. if(!err) {
  655. this.setState({
  656. loading: true
  657. });
  658. let api=this.state.addTaskState?'/api/admin/techproject/addProjectTask':'/api/admin/techproject/updateProjectTask';
  659. $.ajax({
  660. method: "POST",
  661. dataType: "json",
  662. crossDomain: false,
  663. url: globalConfig.context + api,
  664. data: this.state.addTaskState?{
  665. contractId:this.props.datauser.id,
  666. commodityId:this.state.kid,
  667. commodityName:this.state.commodityName,
  668. commodityQuantity:this.state.commodityQuantity,
  669. taskComment:this.state.taskComment,
  670. }:{
  671. taskId:this.state.taskId,
  672. commodityId:this.state.kid?this.state.kid:this.state.commodityId,
  673. taskComment:this.state.taskComment
  674. }
  675. }).done(function(data) {
  676. this.setState({
  677. loading: false
  678. });
  679. if(!data.error.length) {
  680. message.success('保存成功!');
  681. this.nextCancel();
  682. this.loadData();
  683. } else {
  684. message.warning(data.error[0].message);
  685. }
  686. }.bind(this));
  687. }
  688. });
  689. },
  690. //任务项目各种骚操作
  691. removeItem(){ //撤项
  692. this.removeList(0)
  693. },
  694. Knot(){ //结项
  695. this.removeList(1)
  696. },
  697. removeList(e){
  698. this.setState({
  699. loading: true
  700. });
  701. $.ajax({
  702. method: "get",
  703. dataType: "json",
  704. crossDomain: false,
  705. url: globalConfig.context + '/api/admin/techproject/revokeOrComplete',
  706. data: {
  707. contractId:this.props.datauser.id,
  708. operatorType:e
  709. }
  710. }).done(function(data) {
  711. this.setState({
  712. loading: false
  713. });
  714. if(!data.error.length) {
  715. message.success('操作成功!');
  716. this.handleOk()
  717. } else {
  718. message.warning(data.error[0].message);
  719. }
  720. }.bind(this));
  721. },
  722. //品类数据获取
  723. category(){
  724. this.setState({
  725. loading: true
  726. });
  727. $.ajax({
  728. method: "get",
  729. dataType: "json",
  730. crossDomain: false,
  731. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  732. data: {
  733. },
  734. success: function(data) {
  735. let thedata = data.data;
  736. let theArr=[];
  737. if(!thedata) {
  738. if(data.error && data.error.length) {
  739. message.warning(data.error[0].message);
  740. };
  741. thedata = {};
  742. }else{
  743. thedata.map(function(item,index){
  744. theArr.push({
  745. key:index,
  746. name:item.cname,
  747. id:item.id,
  748. })
  749. })
  750. }
  751. this.setState({
  752. contractType:undefined,
  753. categoryArr:theArr,
  754. })
  755. }.bind(this),
  756. }).always(function() {
  757. this.setState({
  758. loading: false
  759. });
  760. }.bind(this));
  761. },
  762. tableRowClick(record, index) {
  763. this.setState({
  764. addTaskState:false,
  765. addnextVisible:true,
  766. });
  767. this.orderDetails(record)
  768. },
  769. componentWillReceiveProps(nextProps) { //props改变时触发
  770. this.state.projectVisible = nextProps.newProject;
  771. this.state.visible = nextProps.showDesc;
  772. if(nextProps.userDetaile && nextProps.showDesc ) {
  773. if(nextProps.datauser && nextProps.datauser.id ) {
  774. this.loaduser(nextProps.datauser);
  775. this.loadData(nextProps.datauser);
  776. }
  777. }else{
  778. this.category();
  779. this.setState({
  780. customerArr:[],
  781. customerName:'',
  782. autoId:'',
  783. signComment:'',
  784. projectName:'',
  785. aid:'',
  786. contractType:undefined
  787. })
  788. }
  789. },
  790. render() {
  791. const FormItem = Form.Item
  792. const formItemLayout = {
  793. labelCol: { span: 8 },
  794. wrapperCol: { span: 14 },
  795. };
  796. const rowSelection = {
  797. selectedRowKey: this.state.selectedRowKey,
  798. onChange: (selectedRowKey, selectedRows) => {
  799. this.setState({
  800. selectedRows: selectedRows.slice(-1),
  801. selectedRowKey: selectedRowKey.slice(-1)
  802. });
  803. },
  804. onSelectAll: (selected, selectedRows, changeRows) => {
  805. this.setState({
  806. selectedRowKey:[]
  807. })
  808. },
  809. };
  810. const categoryList=this.state.categoryArr ||[];
  811. let departmentArr = this.props.departmentArr || [];
  812. const hasSelected = this.state.selectedRowKey.length > 0;
  813. const orderDetaiel=this.state.orderList || [];
  814. const dataSources=this.state.customerArr || [];
  815. const orderArr=this.state.orderArr ||[];
  816. const options = this.state.states?dataSources.map((group,index) =>
  817. <Select.Option key={index} value={group.name}>{group.name}</Select.Option>
  818. ):dataSources.map((group,index) =>
  819. <Select.Option key={index} value={group.bname}>{group.bname}</Select.Option>
  820. )
  821. return(
  822. <div>
  823. <Modal maskClosable={false} visible={this.state.visible}
  824. onOk={this.handleOk} onCancel={this.handleCancel}
  825. width='1000px'
  826. title={this.props.projectState?'项目管理':'项目详情' }
  827. footer=''
  828. className="admin-desc-content">
  829. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} onSubmit={this.handleSubmit}>
  830. <Spin spinning={this.state.loading}>
  831. <div className="clearfix">
  832. <div className="clearfix">
  833. <FormItem className="half-item"
  834. {...formItemLayout}
  835. label="订单编号" >
  836. <span>{orderDetaiel.orderNo}</span>
  837. {orderDetaiel.orderNo&&!this.props.queryProject?<Button onClick={this.seeOrder} style={{float:'right',fontSize:'12px'}}>查看订单</Button>:''}
  838. </FormItem>
  839. <FormItem className="half-item"
  840. {...formItemLayout}
  841. label="项目编号" >
  842. <span>{orderDetaiel.serialNumber}</span>
  843. </FormItem>
  844. <FormItem className="half-item"
  845. {...formItemLayout}
  846. label="客户名称" >
  847. <span>{orderDetaiel.buyerName}</span>
  848. {orderDetaiel.buyerName&&<Button onClick={this.seeContract} style={{float:'right',fontSize:'12px'}}>查看联系人</Button>}
  849. </FormItem>
  850. <FormItem className="half-item"
  851. {...formItemLayout}
  852. label="客户省份" >
  853. <span>{orderDetaiel.buyerProvince}</span>
  854. </FormItem>
  855. <FormItem className="half-item"
  856. {...formItemLayout}
  857. label="项目类型" >
  858. <span>{getOrderType(orderDetaiel.projectType)}</span>
  859. </FormItem>
  860. <FormItem className="half-item"
  861. {...formItemLayout}
  862. label="项目负责人" >
  863. <span>{orderDetaiel.principalName}</span>
  864. </FormItem>
  865. <FormItem className="half-item"
  866. {...formItemLayout}
  867. label="项目状态" >
  868. <span>{getProjectState(orderDetaiel.projectStatus)}</span>
  869. </FormItem>
  870. <FormItem className="half-item"
  871. {...formItemLayout}
  872. label="是否锁定" >
  873. <span>{orderDetaiel.deleteSign==2?'锁定':'未锁定'}</span>
  874. </FormItem>
  875. <FormItem className="half-item"
  876. {...formItemLayout}
  877. label="立项时间" >
  878. <span>{orderDetaiel.signDate}</span>
  879. </FormItem>
  880. <FormItem className="half-item"
  881. {...formItemLayout}
  882. label="业务品类" >
  883. <span>{orderDetaiel.projectType}</span>
  884. </FormItem>
  885. <div className='clearfix'>
  886. <FormItem
  887. labelCol={{ span: 4 }}
  888. wrapperCol={{ span: 16 }}
  889. label="立项说明" >
  890. <span>{orderDetaiel.signComment}</span>
  891. </FormItem>
  892. </div>
  893. </div>
  894. <div className='clearfix'>
  895. <FormItem className="half-item"
  896. {...formItemLayout}
  897. label="结项日期" >
  898. <span>{orderDetaiel.completeDate}</span>
  899. </FormItem>
  900. </div>
  901. <div className='clearfix'>
  902. <FormItem
  903. labelCol={{ span: 4 }}
  904. wrapperCol={{ span: 16 }}
  905. label="结项说明" >
  906. <span>{orderDetaiel.completeComment}</span>
  907. </FormItem>
  908. </div>
  909. <div className='clearfix'>
  910. <FormItem className="half-item"
  911. {...formItemLayout}
  912. label="是否作废" >
  913. <span>{orderDetaiel.deleteSign==1?'作废':'未作废'}</span>
  914. </FormItem>
  915. </div>
  916. <div>
  917. <span style={{marginLeft:'50px',fontSize:'20px'}}>项目任务</span>
  918. {orderDetaiel.projectStatus<3&&!this.props.queryProject?<Button type='primary' onClick={this.addTask} style={{float:'right',marginRight:'100px'}}>添加任务</Button>:''}
  919. </div>
  920. <div className="patent-table">
  921. <Spin spinning={this.state.loading}>
  922. <Table columns={this.state.columns}
  923. dataSource={this.state.dataSource}
  924. pagination={false}
  925. onRowClick={this.tableRowClick}
  926. />
  927. </Spin>
  928. </div>
  929. {!this.props.projectState?<div>
  930. </div>:
  931. <div style={{marginTop:'30px',paddingLeft:'100px'}}>
  932. <Button type="danger" onClick={this.removeItem}>撤项</Button>
  933. <Button type="primary" onClick={this.Knot} style={{margin:'15px'}}>结项</Button>
  934. <Button type="ghost" onClick={this.handleCancel}>返回</Button>
  935. </div>}
  936. </div>
  937. </Spin>
  938. </Form >
  939. </Modal>
  940. <Modal maskClosable={false} visible={this.state.addnextVisible}
  941. onOk={this.nextCancel} onCancel={this.nextCancel}
  942. width='800px'
  943. title={this.state.addTaskState?'添加任务':'任务详情'}
  944. footer=''
  945. className="admin-desc-content">
  946. <Form layout="horizontal" id="demand-form" onSubmit={this.taskSumbit}>
  947. <Spin spinning={this.state.loading}>
  948. {this.state.addTaskState?<div className="clearfix">
  949. <FormItem className="half-item"
  950. {...formItemLayout}
  951. label="服务项目名称" >
  952. <AutoComplete
  953. className="certain-category-search"
  954. dropdownClassName="certain-category-search-dropdown"
  955. dropdownMatchSelectWidth={false}
  956. dropdownStyle={{ width: 200 }}
  957. style={{ width: '200px' }}
  958. dataSource={options}
  959. placeholder="输入服务名称"
  960. value={this.state.commodityName}
  961. onChange={this.httpChange}
  962. filterOption={true}
  963. onSelect={this.selectAuto}
  964. >
  965. <Input/>
  966. </AutoComplete>
  967. <span className="mandatory">*</span>
  968. </FormItem>
  969. <FormItem className="half-item"
  970. {...formItemLayout}
  971. label="数量" >
  972. <Input style={{ width: '200px' }} placeholder="输入数量"
  973. value={this.state.commodityQuantity}
  974. onChange={(e)=>{this.setState({commodityQuantity:e.target.value})}}/>
  975. <span className="mandatory">*</span>
  976. </FormItem>
  977. <div className='clearfix'>
  978. <FormItem
  979. labelCol={{ span: 4 }}
  980. wrapperCol={{ span: 16 }}
  981. label="任务说明" >
  982. <Input type="textarea" placeholder="请输入订单留言" rows={4}
  983. value={this.state.taskComment}
  984. onChange={(e)=>{this.setState({taskComment:e.target.value})}}/>
  985. </FormItem>
  986. </div>
  987. </div>:
  988. <div className="clearfix">
  989. <FormItem className="half-item"
  990. {...formItemLayout}
  991. label="项目编号" >
  992. <span>{this.state.projectNo}</span>
  993. </FormItem>
  994. <FormItem className="half-item"
  995. {...formItemLayout}
  996. label="任务编号" >
  997. <span>{this.state.taskNo}</span>
  998. </FormItem>
  999. {this.state.taskStatus<1?<FormItem className="half-item"
  1000. {...formItemLayout}
  1001. label="服务项目名称" >
  1002. <AutoComplete
  1003. className="certain-category-search"
  1004. dropdownClassName="certain-category-search-dropdown"
  1005. dropdownMatchSelectWidth={false}
  1006. dropdownStyle={{ width: 200 }}
  1007. style={{ width: '200px' }}
  1008. dataSource={options}
  1009. placeholder="输入服务名称"
  1010. value={this.state.commodityName}
  1011. onChange={this.httpChange}
  1012. filterOption={true}
  1013. onSelect={this.selectAuto}
  1014. >
  1015. <Input/>
  1016. </AutoComplete>
  1017. <span className="mandatory">*</span>
  1018. </FormItem>:
  1019. <FormItem className="half-item"
  1020. {...formItemLayout}
  1021. label="服务项目名称" >
  1022. <span>{this.state.commodityName}</span>
  1023. </FormItem>}
  1024. <FormItem className="half-item"
  1025. {...formItemLayout}
  1026. label="任务状态" >
  1027. <span>{getTaskStatus(this.state.taskStatus)}</span>
  1028. </FormItem>
  1029. <FormItem className="half-item"
  1030. {...formItemLayout}
  1031. label="是否锁定" >
  1032. <span>{this.state.deletedSign==2?'锁定':'未锁定'}</span>
  1033. </FormItem>
  1034. <div className='clearfix'>
  1035. {this.state.taskStatus<1?<FormItem
  1036. labelCol={{ span: 4 }}
  1037. wrapperCol={{ span: 16 }}
  1038. label="任务说明" >
  1039. <Input type="textarea" placeholder="请输入订单留言" rows={4} value={this.state.taskComment}
  1040. onChange={(e)=>{this.setState({taskComment:e.target.value})}}/>
  1041. </FormItem>:
  1042. <FormItem className="half-item"
  1043. {...formItemLayout}
  1044. label="任务说明" >
  1045. <span>{this.state.taskComment}</span>
  1046. </FormItem>}
  1047. </div>
  1048. <div className='clearfix'>
  1049. <FormItem className="half-item"
  1050. {...formItemLayout}
  1051. label="派单人" >
  1052. <span>{this.state.taskAllocatorName}</span>
  1053. </FormItem>
  1054. <FormItem className="half-item"
  1055. {...formItemLayout}
  1056. label="派单时间" >
  1057. <span>{this.state.taskDistributionTime}</span>
  1058. </FormItem>
  1059. <FormItem className="half-item"
  1060. {...formItemLayout}
  1061. label="资料负责人" >
  1062. <span>{this.state.taskReceiverName}</span>
  1063. </FormItem>
  1064. </div>
  1065. </div>}
  1066. {this.state.taskStatus<1||this.state.addTaskState?<div className="clearfix" style={{marginBottom:'20px'}}>
  1067. <Button className="setSave" type="primary" htmlType="submit">保存</Button>
  1068. <Button className="cancel" type="ghost" onClick={this.nextCancel}>返回</Button>
  1069. </div>:''}
  1070. </Spin>
  1071. </Form >
  1072. </Modal>
  1073. <Modal maskClosable={false} visible={this.state.projectVisible}
  1074. onOk={this.projectOk} onCancel={this.projectCancel}
  1075. width='600px'
  1076. title='创建项目'
  1077. footer=''
  1078. className="admin-desc-content">
  1079. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1080. <Spin spinning={this.state.loading}>
  1081. <div className="clearfix">
  1082. <div className='clearfix'>
  1083. <div className="clearfix">
  1084. <FormItem
  1085. {...formItemLayout}
  1086. label="客户名称" >
  1087. <AutoComplete
  1088. className="certain-category-search"
  1089. dropdownClassName="certain-category-search-dropdown"
  1090. dropdownMatchSelectWidth={false}
  1091. dropdownStyle={{ width: 200 }}
  1092. size="large"
  1093. style={{ width: '200px' }}
  1094. dataSource={options}
  1095. placeholder="输入客户名称"
  1096. value={this.state.customerName}
  1097. onChange={this.customerChange}
  1098. filterOption={true}
  1099. onBlur={this.blurCutor}
  1100. onSelect={this.selectAutoCUT}
  1101. >
  1102. <Input/>
  1103. </AutoComplete>
  1104. <span className="mandatory">*</span>
  1105. </FormItem>
  1106. </div>
  1107. <div className='clearfix'>
  1108. <FormItem
  1109. {...formItemLayout}
  1110. label="项目负责人" >
  1111. <span style={{width:'150px'}}>{this.state.projectName}</span>
  1112. <Button onClick={this.confirmDelet} style={{float:'right',marginRight:'50px'}}>选择</Button>
  1113. </FormItem>
  1114. </div>
  1115. <div className='clearfix'>
  1116. <FormItem
  1117. {...formItemLayout}
  1118. label="业务品类" >
  1119. <Select placeholder="请选择业务品类"
  1120. style={{ width:'200px'}}
  1121. value={this.state.contractType}
  1122. onChange={(e)=>{this.setState({contractType:e})}}>
  1123. {
  1124. categoryList.map(function (item) {
  1125. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1126. })
  1127. }
  1128. </Select>
  1129. <span className="mandatory">*</span>
  1130. </FormItem>
  1131. </div>
  1132. <div className='clearfix'>
  1133. <FormItem
  1134. labelCol={{ span: 8 }}
  1135. wrapperCol={{ span: 12 }}
  1136. label="项目说明" >
  1137. <Input type="textarea" placeholder="请输入签单备注" rows={4} value={this.state.signComment}
  1138. onChange={(e)=>{this.setState({signComment:e.target.value})}}/>
  1139. </FormItem>
  1140. </div>
  1141. </div>
  1142. </div>
  1143. <FormItem wrapperCol={{ span: 12, offset: 4 }} className="half-middle">
  1144. <Button type="primary" onClick={this.admissibleOrder} style={{marginLeft:'55px'}}>保存</Button>
  1145. <Button className="submitSave" type="ghost" onClick={this.projectCancel}>返回</Button>
  1146. </FormItem>
  1147. </Spin>
  1148. </Form >
  1149. </Modal>
  1150. <Modal maskClosable={false} visible={this.state.distributionVisible}
  1151. onOk={this.distributionOk} onCancel={this.distributionCancel}
  1152. width='800px'
  1153. title='分派任务单'
  1154. footer=''
  1155. className="admin-desc-content">
  1156. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1157. <Spin spinning={this.state.loading}>
  1158. <div>
  1159. <Select placeholder="部门"
  1160. style={{ width: 150 ,marginRight:'10px',marginLeft:'10px'}}
  1161. value={this.state.departmenttList}
  1162. onChange={(e) => { this.setState({ departmenttList: e }) }}>
  1163. {
  1164. departmentArr.map(function (item) {
  1165. return <Select.Option key={item.id} >{item.name}</Select.Option>
  1166. })
  1167. }
  1168. </Select>
  1169. <Input placeholder="咨询师" style={{width:'150px',marginLeft:'10px'}}
  1170. value={this.state.financeNameSearch}
  1171. onChange={(e) => { this.setState({ financeNameSearch: e.target.value }); }} />
  1172. <Button type="primary" onClick={this.searchOrder} style={{marginLeft:'10px',marginRight:'10px'}}>搜索</Button>
  1173. <Button onClick={this.resetOrder}>重置</Button>
  1174. </div>
  1175. <div className="patent-table" style={{marginTop:'10px'}}>
  1176. <Spin spinning={this.state.loading}>
  1177. <Table columns={this.state.userList}
  1178. dataSource={this.state.distributionList}
  1179. pagination={false}
  1180. />
  1181. </Spin>
  1182. </div>
  1183. </Spin>
  1184. </Form>
  1185. </Modal>
  1186. <Modal maskClosable={false} visible={this.state.orderVisible}
  1187. onOk={this.orderCancel} onCancel={this.orderCancel}
  1188. width='800px'
  1189. title={this.state.seeState?'查看订单':'查看联系人'}
  1190. footer=''
  1191. className="admin-desc-content">
  1192. <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
  1193. <Spin spinning={this.state.loading}>
  1194. <div className="patent-table" style={{marginTop:'10px'}}>
  1195. <Spin spinning={this.state.loading}>
  1196. {this.state.seeState?
  1197. <div className="clearfix">
  1198. <FormItem className="half-item"
  1199. {...formItemLayout}
  1200. label="订单编号" >
  1201. <span>{orderArr.orderNo}</span>
  1202. </FormItem>
  1203. <FormItem className="half-item"
  1204. {...formItemLayout}
  1205. label="下单时间" >
  1206. <span>{orderArr.createTime}</span>
  1207. </FormItem>
  1208. <FormItem className="half-item"
  1209. {...formItemLayout}
  1210. label="客户名称" >
  1211. <span>{orderArr.buyerName}</span>
  1212. </FormItem>
  1213. <FormItem className="half-item"
  1214. {...formItemLayout}
  1215. label="订单类型" >
  1216. <span>{getOrderType(orderArr.orderType)}</span>
  1217. </FormItem>
  1218. <FormItem className="half-item"
  1219. {...formItemLayout}
  1220. label="订单渠道" >
  1221. <span>{getOrderChannel(orderArr.orderChannel)}</span>
  1222. </FormItem>
  1223. <FormItem className="half-item"
  1224. {...formItemLayout}
  1225. label="订单状态" >
  1226. <span>{getOrderState(orderArr.orderStatus)}</span>
  1227. </FormItem>
  1228. <FormItem className="half-item"
  1229. {...formItemLayout}
  1230. label="已收款项" >
  1231. <span>{orderArr.actuallyTotalAmount+'万元'}</span>
  1232. </FormItem>
  1233. <FormItem className="half-item"
  1234. {...formItemLayout}
  1235. label="结算状态" >
  1236. <span>{getPaymentState(orderArr.liquidationStatus)}</span>
  1237. </FormItem>
  1238. <FormItem className="half-item"
  1239. {...formItemLayout}
  1240. label="市价订单金额" >
  1241. <span>{orderArr.orderAmount+'万元'}</span>
  1242. </FormItem>
  1243. <FormItem className="half-item"
  1244. {...formItemLayout}
  1245. label="市价首款金额" >
  1246. <span>{orderArr.firstPayment+'万元'}</span>
  1247. </FormItem>
  1248. <div className='clearfix'>
  1249. <FormItem className="half-item"
  1250. {...formItemLayout}
  1251. label="实签订单金额" >
  1252. <span>{orderArr.signTotalAmount+'万元'}</span>
  1253. </FormItem>
  1254. <FormItem className="half-item"
  1255. {...formItemLayout}
  1256. label="实签首款金额" >
  1257. <span>{orderArr.signFirstPayment+'万元'}</span>
  1258. </FormItem>
  1259. <FormItem className="half-item"
  1260. {...formItemLayout}
  1261. label="特批立项" >
  1262. <span>{getApprovedState(orderArr.approval)}</span>
  1263. </FormItem>
  1264. <div className='clearfix'>
  1265. <FormItem
  1266. labelCol={{ span: 4 }}
  1267. wrapperCol={{ span: 16 }}
  1268. label="订单留言" >
  1269. <span>{orderArr.orderRemarks}</span>
  1270. </FormItem>
  1271. </div>
  1272. </div>
  1273. </div>:
  1274. <Table columns={this.state.contractList}
  1275. dataSource={this.state.contractArr}
  1276. pagination={false}
  1277. />}
  1278. </Spin>
  1279. </div>
  1280. </Spin>
  1281. </Form>
  1282. </Modal>
  1283. </div>
  1284. )
  1285. }
  1286. }));
  1287. export default MySettlementDetaile;