checkOutsourcing.jsx 48 KB

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