addService.jsx 188 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277
  1. import React from "react";
  2. import {
  3. Table,
  4. Modal,
  5. message,
  6. Spin,
  7. Input,
  8. Select,
  9. Button,
  10. Form,
  11. Upload,
  12. Popconfirm,
  13. AutoComplete,
  14. DatePicker,
  15. Col,
  16. Tabs,
  17. Tag
  18. } from "antd";
  19. import $ from "jquery/src/ajax";
  20. import "../userMangagement.less";
  21. import "../billing.less";
  22. import moment from "moment";
  23. import Picture from "@/manageCenter/publicComponent/picture";
  24. import OrderRiZi from "@/orderRiZi.jsx";
  25. import {
  26. orderTypes,
  27. customerType,
  28. jiedian,
  29. tepi,
  30. boutique,
  31. } from "../../../dataDic.js";
  32. import {
  33. splitUrl,
  34. getProcessStatus,
  35. getLiquidationStatus,
  36. getboutique,
  37. getApprovedState,
  38. getjiedian,
  39. getCuikuan,
  40. getProjectStatus,
  41. moneyVerify
  42. } from "../../../tools.js";
  43. import {cuiJieDian} from "@/dataDic.js"
  44. import PicturesWall from "./changeComponent/picturesWall.js";
  45. import { changeType, getChangeType } from "./changeComponent/changeDetailYxgly";
  46. // const Options = Select.Option;
  47. const Option = AutoComplete.Option;
  48. const confirm = Modal.confirm;
  49. const NewService = Form.create()(
  50. React.createClass({
  51. //查看项目列表
  52. loadData(record) {
  53. this.state.data = [];
  54. this.setState({
  55. loading: true
  56. });
  57. $.ajax({
  58. method: "get",
  59. dataType: "json",
  60. crossDomain: false,
  61. url: globalConfig.context + "/api/admin/newOrder/getOrderTask",
  62. data: {
  63. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  64. },
  65. success: function(data) {
  66. let theArr = [];
  67. if (!data.data) {
  68. if (data.error && data.error.length) {
  69. message.warning(data.error[0].message);
  70. }
  71. } else {
  72. for (let i = 0; i < data.data.length; i++) {
  73. let thisdata = data.data[i];
  74. theArr.push({
  75. key: i,
  76. id: thisdata.id,
  77. orderNo: thisdata.orderNo, //订单编号
  78. commodityId: thisdata.commodityId, //项目ID
  79. commodityName: thisdata.commodityName, //项目名称
  80. cname: thisdata.cname, //项目类别
  81. commodityPrice: thisdata.commodityPrice, //项目价格
  82. commodityQuantity: thisdata.commodityQuantity, //项目数量
  83. main: thisdata.main, //是否为主要任务
  84. taskComment: thisdata.taskComment, //任务说明
  85. contacts: thisdata.contacts, //联系人
  86. contactsMobile: thisdata.contactsMobile, //联系人电话
  87. projectStatus: thisdata.projectStatus, //项目状态
  88. sort: thisdata.cSort
  89. });
  90. }
  91. }
  92. this.departmentList();
  93. this.setState({
  94. dataSource: theArr,
  95. pagination: false,
  96. // 禁用变更类型
  97. changeFlag: false
  98. });
  99. }.bind(this)
  100. }).always(
  101. function() {
  102. this.setState({
  103. loading: false
  104. });
  105. }.bind(this)
  106. );
  107. },
  108. //收款节点
  109. loadDatas(record) {
  110. this.state.data = [];
  111. this.setState({
  112. loading: true
  113. });
  114. $.ajax({
  115. method: "get",
  116. dataType: "json",
  117. crossDomain: false,
  118. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  119. data: {
  120. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  121. },
  122. success: function(data) {
  123. let theArr = [];
  124. if (!data.data) {
  125. if (data.error && data.error.length) {
  126. message.warning(data.error[0].message);
  127. }
  128. } else {
  129. for (let i = 0; i < data.data.length; i++) {
  130. let thisdata = data.data[i];
  131. theArr.push({
  132. key: i,
  133. id: thisdata.id
  134. });
  135. }
  136. }
  137. this.setState({
  138. dataSource: theArr,
  139. pagination: false
  140. });
  141. }.bind(this)
  142. }).always(
  143. function() {
  144. this.setState({
  145. loading: false
  146. });
  147. }.bind(this)
  148. );
  149. },
  150. getInitialState() {
  151. return {
  152. isCaoGao: false,
  153. cuiFlag: false,
  154. startRemarks: "",
  155. remarksC: "",
  156. loading: false,
  157. visible: false,
  158. status: 4,
  159. orgCodeUrl: [],
  160. voucherUrl: [],
  161. customerArr: [],
  162. // 禁用变更类型转换
  163. changeFlag: false,
  164. // 合同额禁用
  165. hetongFlag: true,
  166. // 项目及催款禁用
  167. listFlag: true,
  168. mark: false,
  169. activeKey: "1",
  170. typeChange: [],
  171. bussStats: false,
  172. checkedKeys: [],
  173. lookflowList: [],
  174. contractUrl: [],
  175. applicationUrl: [],
  176. changeAmount: "0",
  177. active: {
  178. applySign: false
  179. },
  180. lookState: false,
  181. signBillVisible: false,
  182. commod: "",
  183. columns: [
  184. {
  185. title: "业务项目名称",
  186. dataIndex: "commodityName",
  187. key: "commodityName"
  188. },
  189. {
  190. title: "项目类别",
  191. dataIndex: "cname",
  192. key: "cname"
  193. },
  194. {
  195. title: "项目数量",
  196. dataIndex: "commodityQuantity",
  197. key: "commodityQuantity"
  198. },
  199. {
  200. title: "金额(万元)",
  201. dataIndex: "commodityPrice",
  202. key: "commodityPrice"
  203. },
  204. {
  205. title: "负责人",
  206. dataIndex: "contacts",
  207. key: "contacts"
  208. },
  209. {
  210. title: "负责人电话",
  211. dataIndex: "contactsMobile",
  212. key: "contactsMobile"
  213. },
  214. {
  215. title: "项目状态",
  216. dataIndex: "projectStatus",
  217. key: "projectStatus",
  218. render: text => {
  219. return getProjectStatus(text);
  220. }
  221. },
  222. {
  223. title: "主要项目",
  224. dataIndex: "main",
  225. key: "main",
  226. render: text => {
  227. return text ? "是" : "否";
  228. }
  229. },
  230. {
  231. title: "项目说明",
  232. dataIndex: "taskComment",
  233. key: "taskComment",
  234. render: text => {
  235. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  236. }
  237. },
  238. {
  239. title: "操作",
  240. dataIndex: "ABC",
  241. key: "ABC",
  242. render: (text, record) => {
  243. return (
  244. <div>
  245. {this.state.processStatus == 0 ? (
  246. <Button
  247. onClick={e => {
  248. e.stopPropagation();
  249. this.showConfirm(this.delectRow, record);
  250. }}
  251. >
  252. 删除
  253. </Button>
  254. ) : (
  255. ""
  256. )}
  257. </div>
  258. );
  259. }
  260. }
  261. ],
  262. proColumns: [
  263. {
  264. title: "变更状态",
  265. dataIndex: "type",
  266. key: "type",
  267. render: text => {
  268. let str = "";
  269. let color = "";
  270. if (text == 1) {
  271. str = "增";
  272. color = "#87d068";
  273. } else if (text == 2) {
  274. str = "改";
  275. color = "#108ee9";
  276. } else if (text == 3) {
  277. str = "删";
  278. color = "#f50";
  279. }
  280. return (
  281. <Tag
  282. color={color}
  283. style={{ display: text == 0 ? "none" : "inline-block" }}
  284. >
  285. {str}
  286. </Tag>
  287. );
  288. }
  289. },
  290. {
  291. title: "业务项目名称",
  292. dataIndex: "commodityName",
  293. key: "commodityName"
  294. },
  295. {
  296. title: "项目类别",
  297. dataIndex: "cname",
  298. key: "cname"
  299. },
  300. {
  301. title: "项目数量",
  302. dataIndex: "commodityQuantity",
  303. key: "commodityQuantity"
  304. },
  305. {
  306. title: "金额(万元)",
  307. dataIndex: "commodityPrice",
  308. key: "commodityPrice"
  309. },
  310. {
  311. title: "主要项目",
  312. dataIndex: "main",
  313. key: "main",
  314. render: text => {
  315. return text ? "是" : "否";
  316. }
  317. },
  318. {
  319. title: "项目说明",
  320. dataIndex: "taskComment",
  321. key: "taskComment",
  322. render: text => {
  323. return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
  324. }
  325. },
  326. {
  327. title: "操作",
  328. dataIndex: "ABC",
  329. key: "ABC",
  330. render: (text, record) => {
  331. return (
  332. <div>
  333. <Button
  334. onClick={e => {
  335. e.stopPropagation();
  336. this.showConfirm(this.changeDeletePro, record);
  337. }}
  338. disabled={this.state.listFlag}
  339. >
  340. 删除
  341. </Button>
  342. </div>
  343. );
  344. }
  345. }
  346. ],
  347. columnsrizhi: [
  348. {
  349. title: "流程",
  350. dataIndex: "processName",
  351. key: "processName"
  352. },
  353. {
  354. title: "操作人",
  355. dataIndex: "adminName",
  356. key: "adminName"
  357. },
  358. {
  359. title: "时间",
  360. dataIndex: "createDate",
  361. key: "createDate"
  362. }
  363. ],
  364. contactList: [],
  365. loading: false,
  366. ContactsLists: [
  367. {
  368. title: "催款科目",
  369. dataIndex: "dunSubject",
  370. key: "dunSubject",
  371. render: (text, record) => {
  372. return (
  373. <Select
  374. placeholder="请选择催款科目"
  375. value={record.dunSubject}
  376. style={{ width: "150px" }}
  377. disabled
  378. onChange={e => {
  379. record.dunSubject = e;
  380. this.setState({ contactList: this.state.contactList });
  381. }}
  382. >
  383. {jiedian.map(function(item) {
  384. return (
  385. <Select.Option key={item.value}>{item.key}</Select.Option>
  386. );
  387. })}
  388. </Select>
  389. );
  390. }
  391. },
  392. {
  393. title: "金额(万元)",
  394. dataIndex: "money",
  395. key: "money",
  396. render: (text, record) => {
  397. return (
  398. <Input
  399. value={record.money}
  400. placeholder="请输入金额(必填项)"
  401. disabled
  402. key={record.id}
  403. required="required"
  404. onChange={e => {
  405. record.money = e.target.value;
  406. this.setState({ contactList: this.state.contactList });
  407. }}
  408. style={{ width: "120px" }}
  409. />
  410. );
  411. }
  412. },
  413. {
  414. title: "催款状态",
  415. dataIndex: "dunStatus",
  416. key: "dunStatus",
  417. render: text => {
  418. return getCuikuan(text);
  419. }
  420. },
  421. {
  422. title: "操作",
  423. dataIndex: "dels",
  424. key: "dels",
  425. render: (text, record) => {
  426. return (
  427. <div>
  428. {
  429. <Popconfirm
  430. title="是否删除?"
  431. onConfirm={() => {
  432. this.confirmDelet(record.key);
  433. }}
  434. okText="删除"
  435. cancelText="不删除"
  436. >
  437. <Button
  438. style={{
  439. marginRight: "10px",
  440. color: "#ffffff",
  441. background: "#f00",
  442. border: "none",
  443. display:
  444. this.state.processStatus == 0 ? "block" : "none"
  445. }}
  446. >
  447. 删除
  448. </Button>
  449. </Popconfirm>
  450. }
  451. {record.id ? (
  452. ""
  453. ) : (
  454. <Button type="primary" onClick={this.contactSave}>
  455. 保存
  456. </Button>
  457. )}
  458. </div>
  459. );
  460. }
  461. }
  462. ],
  463. ContactsListsNew: [
  464. {
  465. title: "项目名称",
  466. dataIndex: "commodityName",
  467. key: "commodityName",
  468. render: (text, record, index) => {
  469. let dataArr = this.state.dataSource || [];
  470. if (text) {
  471. return <span>{text}</span>;
  472. }
  473. return (
  474. <Select
  475. placeholder="请选择名称"
  476. style={{ width: "150px" }}
  477. disabled={
  478. this.state.getLoad && record.sortName ? true : false
  479. }
  480. onChange={e => {
  481. record.sortName = e;
  482. dataArr.forEach(item => {
  483. if (item.commodityName == record.sortName) {
  484. record.cname = item.cname;
  485. record.tid = item.id;
  486. record.isSave = true;
  487. record.sort = item.sort;
  488. cuiJieDian.forEach(item => {
  489. if (item.value == record.sort) {
  490. record.arr = item.children;
  491. let yearFlag = true;
  492. if (record.sort == 6) {
  493. yearFlag = false;
  494. }
  495. this.setState({
  496. getLoad: true,
  497. yearFlag
  498. });
  499. }
  500. });
  501. }
  502. });
  503. }}
  504. >
  505. {dataArr.map(item => {
  506. return (
  507. <Select.Option key={item.id} value={item.commodityName}>
  508. {item.commodityName}
  509. </Select.Option>
  510. );
  511. })}
  512. </Select>
  513. );
  514. }
  515. },
  516. {
  517. title: "项目分类",
  518. dataIndex: "projectType",
  519. key: "projectType",
  520. render: (text, record) => {
  521. if (text) {
  522. let arr = this.state.dataSource || [];
  523. let str = "";
  524. for (let i = 0; i < arr.length; i++) {
  525. if (this.state.dataSource[i].sort == text) {
  526. str = this.state.dataSource[i].cname;
  527. return <span>{str}</span>;
  528. }
  529. }
  530. }
  531. if (this.state.getLoad) {
  532. return (
  533. <Select
  534. style={{ width: "150px" }}
  535. placeholder="请选择分类"
  536. value={record.cname}
  537. >
  538. <Select.Option key={record.sort} value={record.cname}>
  539. {record.cname}
  540. </Select.Option>
  541. </Select>
  542. );
  543. } else {
  544. return (
  545. <Select style={{ width: "150px" }} placeholder="请选择分类">
  546. <Select.Option key={record.sort} value={record.cname}>
  547. {record.cname}
  548. </Select.Option>
  549. </Select>
  550. );
  551. }
  552. }
  553. },
  554. {
  555. title: "催款科目",
  556. dataIndex: "dunTypeName",
  557. key: "dunTypeName",
  558. render: (text, record) => {
  559. if (text) {
  560. return <span>{text}</span>;
  561. }
  562. if (this.state.getLoad) {
  563. let arr = record.arr || [];
  564. return (
  565. <Select
  566. style={{ width: "150px" }}
  567. placeholder="请选择分类"
  568. onChange={e => {
  569. record.dunType = e;
  570. if (e != 1) {
  571. this.setState({
  572. timeFlag: true
  573. });
  574. } else {
  575. this.setState({
  576. timeFlag: false
  577. });
  578. }
  579. if (e == 1 && record.sort == 6) {
  580. this.setState({
  581. yearFlag: true
  582. });
  583. } else if (e != 1 && record.sort == 6) {
  584. this.setState({
  585. yearFlag: false
  586. });
  587. }
  588. if (record.sort == 3 && e == 3) {
  589. this.setState({
  590. boFlag: true
  591. });
  592. } else {
  593. this.setState({
  594. boFlag: false
  595. });
  596. }
  597. }}
  598. >
  599. {arr.map(item => {
  600. record;
  601. return (
  602. <Select.Option key={item.value} value={item.value}>
  603. {item.key}
  604. </Select.Option>
  605. );
  606. })}
  607. </Select>
  608. );
  609. } else {
  610. return (
  611. <Select style={{ width: "150px" }} placeholder="请选择分类">
  612. <Select.Option
  613. key={0}
  614. value={"请选择上一项"}
  615. ></Select.Option>
  616. </Select>
  617. );
  618. }
  619. }
  620. },
  621. {
  622. title: "首付时间(特批需选择时间)",
  623. dataIndex: "waitDay",
  624. key: "waitDay",
  625. render: (text, record) => {
  626. if (record.dunTypeName) {
  627. if (text == 0) {
  628. var str = "当天";
  629. } else if (!text) {
  630. var str = "";
  631. } else {
  632. var str = text + "天";
  633. }
  634. return <span>{str}</span>;
  635. }
  636. return (
  637. <Select
  638. placeholder="请选择时间"
  639. style={{ width: "150px" }}
  640. disabled={
  641. this.state.approval != 0 && !this.state.timeFlag
  642. ? false
  643. : true
  644. }
  645. onChange={e => {
  646. record.waitDay = e;
  647. }}
  648. >
  649. <Select.Option key={0}>当天</Select.Option>
  650. <Select.Option key={3}>3天</Select.Option>
  651. <Select.Option key={5}>5天</Select.Option>
  652. <Select.Option key={7}>7天</Select.Option>
  653. <Select.Option key={15}>15天</Select.Option>
  654. </Select>
  655. );
  656. }
  657. },
  658. {
  659. title: "金额(万元)",
  660. dataIndex: "money",
  661. key: "money",
  662. render: (text, record) => {
  663. if (record.dunTypeName) {
  664. if (record.appropriationRatio && !record.money) {
  665. return <span>{record.appropriationRatio}(拨款比例)</span>;
  666. } else if (record.appropriationRatio && record.money) {
  667. return (
  668. <span>
  669. {text}(比例:{record.appropriationRatio})
  670. </span>
  671. );
  672. } else {
  673. return <span>{text}</span>;
  674. }
  675. }
  676. if (this.state.boFlag) {
  677. return (
  678. <div>
  679. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  680. <Select
  681. placeholder="选择"
  682. defaultValue={"金额"}
  683. onChange={e => {
  684. record.boStatus = e;
  685. }}
  686. >
  687. <Select.Option key={true}>比例</Select.Option>
  688. <Select.Option key={false}>金额</Select.Option>
  689. </Select>
  690. </div>
  691. <div style={{ float: "right" }}>
  692. <Input
  693. value={record.money}
  694. placeholder="请根据左侧类型填写"
  695. key={record.id}
  696. required="required"
  697. onChange={e => {
  698. record.money = e.target.value;
  699. this.setState({
  700. contactList: this.state.contactList
  701. });
  702. }}
  703. style={{ width: "120px" }}
  704. />
  705. </div>
  706. </div>
  707. );
  708. } else {
  709. return (
  710. <div>
  711. <Input
  712. value={record.money}
  713. placeholder="请输入金额(必填项)"
  714. key={record.id}
  715. required="required"
  716. onChange={e => {
  717. record.money = e.target.value;
  718. this.setState({ contactList: this.state.contactList });
  719. }}
  720. style={{ width: "120px" }}
  721. />
  722. </div>
  723. );
  724. }
  725. }
  726. },
  727. {
  728. title: "服务年限",
  729. dataIndex: "startDate",
  730. key: "startDate",
  731. render: (text, record) => {
  732. if (record.dunTypeName) {
  733. return <span>{text}</span>;
  734. }
  735. return (
  736. <Select
  737. placeholder="请选择年限"
  738. style={{ width: "150px" }}
  739. disabled={this.state.yearFlag ? true : false}
  740. onChange={e => {
  741. record.effectiveCount = e;
  742. }}
  743. >
  744. {/* <Select.Option key={null}>无</Select.Option> */}
  745. <Select.Option key={1}>一年</Select.Option>
  746. <Select.Option key={3}>两年</Select.Option>
  747. <Select.Option key={5}>三年</Select.Option>
  748. <Select.Option key={7}>四年</Select.Option>
  749. <Select.Option key={9}>五年</Select.Option>
  750. </Select>
  751. );
  752. }
  753. },
  754. {
  755. title: "催款状态",
  756. dataIndex: "status",
  757. key: "status",
  758. render: text => {
  759. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  760. }
  761. },
  762. {
  763. title: "操作",
  764. dataIndex: "dels",
  765. key: "dels",
  766. render: (text, record, index) => {
  767. return (
  768. <div>
  769. {this.state.processStatus == 0 ? (
  770. <Popconfirm
  771. title="是否删除?"
  772. onConfirm={() => {
  773. this.confirmDeletNew(record);
  774. }}
  775. okText="删除"
  776. cancelText="不删除"
  777. >
  778. <Button
  779. style={{
  780. marginRight: "10px",
  781. color: "#ffffff",
  782. background: "#f00",
  783. border: "none"
  784. }}
  785. >
  786. 删除
  787. </Button>
  788. </Popconfirm>
  789. ) : (
  790. ""
  791. )}
  792. {record.isSave ? (
  793. <Button
  794. type="primary"
  795. onClick={e => {
  796. this.contactSaveNew(record);
  797. }}
  798. >
  799. 保存
  800. </Button>
  801. ) : (
  802. ""
  803. )}
  804. </div>
  805. );
  806. }
  807. }
  808. ],
  809. changeCuiList: [
  810. {
  811. title: "变更状态",
  812. dataIndex: "type",
  813. key: "type",
  814. render: text => {
  815. let str = "";
  816. let color = "";
  817. if (text == 1) {
  818. str = "增";
  819. color = "#87d068";
  820. } else if (text == 2) {
  821. str = "改";
  822. color = "#108ee9";
  823. } else if (text == 3) {
  824. str = "删";
  825. color = "#f50";
  826. }
  827. return (
  828. <Tag
  829. color={color}
  830. style={{ display: text == 0 ? "none" : "inline-block" }}
  831. >
  832. {str}
  833. </Tag>
  834. );
  835. }
  836. },
  837. {
  838. title: "项目名称",
  839. dataIndex: "commodityName",
  840. key: "commodityName",
  841. render: (text, record, index) => {
  842. let dataArr = this.state.proDataSource || [];
  843. if (text) {
  844. return <span>{text}</span>;
  845. }
  846. return (
  847. <Select
  848. placeholder="请选择名称"
  849. style={{ width: "150px" }}
  850. disabled={
  851. this.state.getLoad && record.sortName ? true : false
  852. }
  853. onChange={e => {
  854. record.sortName = e;
  855. dataArr.forEach(item => {
  856. if (item.commodityName == record.sortName) {
  857. record.cname = item.cname;
  858. record.ctid = item.id;
  859. record.isSave = true;
  860. record.sort = item.cSort;
  861. cuiJieDian.forEach(item => {
  862. if (item.value == record.sort) {
  863. record.arr = item.children;
  864. let yearFlag = true;
  865. if (record.sort == 6) {
  866. yearFlag = false;
  867. }
  868. this.setState({
  869. getLoad: true,
  870. yearFlag
  871. });
  872. }
  873. });
  874. }
  875. });
  876. }}
  877. >
  878. {dataArr.map(item => {
  879. return (
  880. <Select.Option key={item.id} value={item.commodityName}>
  881. {item.commodityName}
  882. </Select.Option>
  883. );
  884. })}
  885. </Select>
  886. );
  887. }
  888. },
  889. {
  890. title: "项目分类",
  891. dataIndex: "projectType",
  892. key: "projectType",
  893. render: (text, record) => {
  894. if (text) {
  895. let arr = this.state.proDataSource || [];
  896. let str = "";
  897. for (let i = 0; i < arr.length; i++) {
  898. if (this.state.proDataSource[i].cSort == text) {
  899. str = this.state.proDataSource[i].cname;
  900. return <span>{str}</span>;
  901. }
  902. }
  903. }
  904. if (this.state.getLoad) {
  905. return (
  906. <Select
  907. style={{ width: "150px" }}
  908. placeholder="请选择分类"
  909. value={record.cname}
  910. >
  911. <Select.Option key={record.sort} value={record.cname}>
  912. {record.cname}
  913. </Select.Option>
  914. </Select>
  915. );
  916. } else {
  917. return (
  918. <Select style={{ width: "150px" }} placeholder="请选择分类">
  919. <Select.Option key={record.sort} value={record.cname}>
  920. {record.cname}
  921. </Select.Option>
  922. </Select>
  923. );
  924. }
  925. }
  926. },
  927. {
  928. title: "催款科目",
  929. dataIndex: "dunTypeName",
  930. key: "dunTypeName",
  931. render: (text, record) => {
  932. if (text) {
  933. return <span>{text}</span>;
  934. }
  935. if (this.state.getLoad) {
  936. let arr = record.arr || [];
  937. return (
  938. <Select
  939. style={{ width: "150px" }}
  940. placeholder="请选择分类"
  941. onChange={e => {
  942. record.dunType = e;
  943. if (e != 1) {
  944. this.setState({
  945. timeFlag: true
  946. });
  947. } else {
  948. this.setState({
  949. timeFlag: false
  950. });
  951. }
  952. if (e == 1 && record.sort == 6) {
  953. this.setState({
  954. yearFlag: true
  955. });
  956. } else if (e != 1 && record.sort == 6) {
  957. this.setState({
  958. yearFlag: false
  959. });
  960. }
  961. if (record.sort == 3 && e == 3) {
  962. this.setState({
  963. boFlag: true
  964. });
  965. } else {
  966. this.setState({
  967. boFlag: false
  968. });
  969. }
  970. }}
  971. >
  972. {arr.map(item => {
  973. record;
  974. return (
  975. <Select.Option key={item.value} value={item.value}>
  976. {item.key}
  977. </Select.Option>
  978. );
  979. })}
  980. </Select>
  981. );
  982. } else {
  983. return (
  984. <Select style={{ width: "150px" }} placeholder="请选择分类">
  985. <Select.Option
  986. key={0}
  987. value={"请选择上一项"}
  988. ></Select.Option>
  989. </Select>
  990. );
  991. }
  992. }
  993. },
  994. {
  995. title: "首付时间(特批需选择时间)",
  996. dataIndex: "waitDay",
  997. key: "waitDay",
  998. render: (text, record) => {
  999. if (record.dunTypeName) {
  1000. if (text == 0) {
  1001. var str = "当天";
  1002. } else if (!text) {
  1003. var str = "";
  1004. } else {
  1005. var str = text + "天";
  1006. }
  1007. return <span>{str}</span>;
  1008. }
  1009. return (
  1010. <Select
  1011. placeholder="请选择时间"
  1012. style={{ width: "150px" }}
  1013. disabled={
  1014. this.state.approval != 0 && !this.state.timeFlag
  1015. ? false
  1016. : true
  1017. }
  1018. onChange={e => {
  1019. record.waitDay = e;
  1020. }}
  1021. >
  1022. <Select.Option key={0}>当天</Select.Option>
  1023. <Select.Option key={3}>3天</Select.Option>
  1024. <Select.Option key={5}>5天</Select.Option>
  1025. <Select.Option key={7}>7天</Select.Option>
  1026. <Select.Option key={15}>15天</Select.Option>
  1027. </Select>
  1028. );
  1029. }
  1030. },
  1031. {
  1032. title: "金额(万元)",
  1033. dataIndex: "money",
  1034. key: "money",
  1035. render: (text, record) => {
  1036. if (record.dunTypeName) {
  1037. if (record.appropriationRatio && !record.money) {
  1038. return <span>{record.appropriationRatio}(拨款比例)</span>;
  1039. } else if (record.appropriationRatio && record.money) {
  1040. return (
  1041. <span>
  1042. {text}(比例:{record.appropriationRatio})
  1043. </span>
  1044. );
  1045. } else {
  1046. return <span>{text}</span>;
  1047. }
  1048. }
  1049. if (this.state.boFlag) {
  1050. return (
  1051. <div>
  1052. <div style={{ width: 70, float: "left", marginRight: 5 }}>
  1053. <Select
  1054. placeholder="选择"
  1055. defaultValue={"金额"}
  1056. onChange={e => {
  1057. record.boStatus = e;
  1058. }}
  1059. >
  1060. <Select.Option key={true}>比例</Select.Option>
  1061. <Select.Option key={false}>金额</Select.Option>
  1062. </Select>
  1063. </div>
  1064. <div style={{ float: "right" }}>
  1065. <Input
  1066. value={record.money}
  1067. placeholder="请根据左侧类型填写"
  1068. key={record.id}
  1069. required="required"
  1070. onChange={e => {
  1071. record.money = e.target.value;
  1072. this.setState({
  1073. contactList: this.state.contactList
  1074. });
  1075. }}
  1076. style={{ width: "120px" }}
  1077. />
  1078. </div>
  1079. </div>
  1080. );
  1081. } else {
  1082. return (
  1083. <div>
  1084. <Input
  1085. value={record.money}
  1086. placeholder="请输入金额(必填项)"
  1087. key={record.id}
  1088. required="required"
  1089. onChange={e => {
  1090. record.money = e.target.value;
  1091. this.setState({ contactList: this.state.contactList });
  1092. }}
  1093. style={{ width: "120px" }}
  1094. />
  1095. </div>
  1096. );
  1097. }
  1098. }
  1099. },
  1100. {
  1101. title: "服务年限",
  1102. dataIndex: "startDate",
  1103. key: "startDate",
  1104. render: (text, record) => {
  1105. if (record.dunTypeName) {
  1106. return <span>{text}</span>;
  1107. }
  1108. return (
  1109. <Select
  1110. placeholder="请选择年限"
  1111. style={{ width: "150px" }}
  1112. disabled={this.state.yearFlag ? true : false}
  1113. onChange={e => {
  1114. record.effectiveCount = e;
  1115. }}
  1116. >
  1117. {/* <Select.Option key={null}>无</Select.Option> */}
  1118. <Select.Option key={1}>一年</Select.Option>
  1119. <Select.Option key={3}>两年</Select.Option>
  1120. <Select.Option key={5}>三年</Select.Option>
  1121. <Select.Option key={7}>四年</Select.Option>
  1122. <Select.Option key={9}>五年</Select.Option>
  1123. </Select>
  1124. );
  1125. }
  1126. },
  1127. {
  1128. title: "催款状态",
  1129. dataIndex: "status",
  1130. key: "status",
  1131. render: text => {
  1132. return <span>{text == 1 ? "已启动" : "未启动"}</span>;
  1133. }
  1134. },
  1135. {
  1136. title: "操作",
  1137. dataIndex: "dels",
  1138. key: "dels",
  1139. render: (text, record, index) => {
  1140. return (
  1141. <div>
  1142. <Popconfirm
  1143. title="是否删除?"
  1144. onConfirm={() => {
  1145. this.changeDeleteCui(record);
  1146. }}
  1147. okText="删除"
  1148. cancelText="不删除"
  1149. >
  1150. <Button
  1151. disabled={this.state.listCuiFlag}
  1152. style={{
  1153. marginRight: "10px"
  1154. }}
  1155. >
  1156. 删除
  1157. </Button>
  1158. </Popconfirm>
  1159. {record.isSave ? (
  1160. <Button
  1161. type="primary"
  1162. onClick={e => {
  1163. this.changeSaveCui(record);
  1164. }}
  1165. >
  1166. 保存
  1167. </Button>
  1168. ) : (
  1169. ""
  1170. )}
  1171. </div>
  1172. );
  1173. }
  1174. }
  1175. ]
  1176. };
  1177. },
  1178. departmentList() {
  1179. this.setState({
  1180. loading: true
  1181. });
  1182. $.ajax({
  1183. method: "get",
  1184. dataType: "json",
  1185. crossDomain: false,
  1186. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  1187. data: {},
  1188. success: function(data) {
  1189. let thedata = data.data;
  1190. let theArr = [];
  1191. if (!thedata) {
  1192. if (data.error && data.error.length) {
  1193. message.warning(data.error[0].message);
  1194. }
  1195. thedata = {};
  1196. } else {
  1197. thedata.map(function(item, index) {
  1198. theArr.push({
  1199. key: index,
  1200. name: item.name,
  1201. id: item.id,
  1202. depNo: item.depNo
  1203. });
  1204. });
  1205. }
  1206. this.setState({
  1207. departmentArr: theArr
  1208. });
  1209. }.bind(this)
  1210. }).always(
  1211. function() {
  1212. this.setState({
  1213. loading: false
  1214. });
  1215. }.bind(this)
  1216. );
  1217. },
  1218. //新建订单、编辑订单保存
  1219. handleSubmit(e) {
  1220. e.preventDefault();
  1221. let theorgCodeUrl = [];
  1222. if (this.state.orgCodeUrl.length) {
  1223. let picArr = [];
  1224. this.state.orgCodeUrl.map(function(item) {
  1225. if (
  1226. item.response &&
  1227. item.response.data &&
  1228. item.response.data.length
  1229. ) {
  1230. picArr.push(item.response.data);
  1231. }
  1232. });
  1233. theorgCodeUrl = picArr.join(",");
  1234. }
  1235. if (this.props.userDetaile) {
  1236. if (this.state.totalAmount === "") {
  1237. message.warning("签单金额不能为空");
  1238. this.refs.signFirstPayment.focus();
  1239. return false;
  1240. }
  1241. if (this.state.firstAmount === "") {
  1242. message.warning("首付金额不能为空");
  1243. this.refs.signFirstPayment.focus();
  1244. return false;
  1245. }
  1246. if (moneyVerify(this.state.firstAmount)) {
  1247. return;
  1248. }
  1249. if (moneyVerify(this.state.totalAmount)) {
  1250. return;
  1251. }
  1252. if (!theorgCodeUrl) {
  1253. message.warning("图片过大,上传失败");
  1254. this.refs.signFirstPayment.focus();
  1255. return false;
  1256. }
  1257. if (!this.state.signDate) {
  1258. message.warning("签单日期不能为空");
  1259. this.refs.signFirstPayment.focus();
  1260. return false;
  1261. }
  1262. if (!this.state.orderRemarks) {
  1263. message.warning("订单留言不能为空");
  1264. this.refs.signFirstPayment.focus();
  1265. return false;
  1266. }
  1267. } else {
  1268. }
  1269. const arr = this.state.contactListNew || [];
  1270. for (let i = 0; i < arr.length; i++) {
  1271. if (
  1272. arr[i].dunType == 1 &&
  1273. arr[i].waitDay != null &&
  1274. this.state.approval == 0
  1275. ) {
  1276. message.warning(
  1277. "非特批存在填写催款节点首付时间的情况,请删除后重新填写保存"
  1278. );
  1279. return false;
  1280. } else if (
  1281. arr[i].dunType == 1 &&
  1282. arr[i].waitDay == null &&
  1283. this.state.approval == 1
  1284. ) {
  1285. message.warning(
  1286. "特批存在首付催款节点未填写时间的情况,请删除后重新填写保存"
  1287. );
  1288. return false;
  1289. }
  1290. if (!this.state.contactListNew[i].id && this.props.userDetaile) {
  1291. message.warning("请保存催款节点");
  1292. return false;
  1293. }
  1294. }
  1295. this.setState({
  1296. loading: true
  1297. });
  1298. let api = this.props.userDetaile
  1299. ? "/api/admin/newOrder/updateServiceOrderNew"
  1300. : "/api/admin/newOrder/createOrder";
  1301. $.ajax({
  1302. method: "POST",
  1303. dataType: "json",
  1304. crossDomain: false,
  1305. url: globalConfig.context + api,
  1306. data: !this.props.userDetaile
  1307. ? {
  1308. uid: this.state.autoId,
  1309. orderType: this.state.orderType
  1310. }
  1311. : {
  1312. orderNo: this.state.orderNo, //订单编号
  1313. totalAmount: this.state.totalAmount, //总金额
  1314. firstAmount: this.state.firstAmount, //首付
  1315. isSubmit: this.state.isSubmit, //保存草稿还是提交
  1316. signDate: this.state.signDate, //签单日期
  1317. contacts: this.state.contacts, //企业负责人
  1318. contactMobile: this.state.contactMobile, //负责人联系方式
  1319. legalPerson: this.state.legalPerson, //企业法人
  1320. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  1321. approval: this.state.approval, //特批状态
  1322. orderRemarks: this.state.orderRemarks, //订单备注
  1323. contractPictureUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  1324. orderDep: this.state.organizationSearch
  1325. }
  1326. }).done(
  1327. function(data) {
  1328. this.setState({
  1329. loading: false
  1330. });
  1331. if (!data.error.length) {
  1332. message.success("保存成功!");
  1333. this.handleOk();
  1334. if (this.state.autoId) {
  1335. this.loadData();
  1336. }
  1337. } else {
  1338. message.warning(data.error[0].message);
  1339. }
  1340. }.bind(this)
  1341. );
  1342. },
  1343. //订单详情修改
  1344. xiangqingClick(e) {
  1345. e.preventDefault();
  1346. this.setState({
  1347. loading: true
  1348. });
  1349. if (this.state.approval == 2 || this.state.approval == 3) {
  1350. message.warning("特批状态不正确");
  1351. this.setState({
  1352. loading: false
  1353. });
  1354. return;
  1355. }
  1356. $.ajax({
  1357. url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
  1358. method: "post",
  1359. data: {
  1360. orderNo: this.state.orderNo, //订单编号
  1361. totalAmount: this.state.totalAmount, //总金额
  1362. firstAmount: this.state.firstAmount, //首付
  1363. isSubmit: this.state.isSubmit, //保存草稿还是提交
  1364. signDate: this.state.selTime, //签单日期
  1365. contacts: this.state.contacts, //企业负责人
  1366. contactMobile: this.state.contactMobile, //负责人联系方式
  1367. legalPerson: this.state.legalPerson, //企业法人
  1368. legalPersonTel: this.state.legalPersonTel, //企业法人联系电话
  1369. approval: this.state.approval, //特批状态
  1370. orderRemarks: this.state.orderRemarks //订单备注
  1371. }
  1372. }).done(
  1373. function(data) {
  1374. this.setState({
  1375. loading: false
  1376. });
  1377. if (!data.error.length) {
  1378. message.success("保存成功!");
  1379. this.loaduser();
  1380. } else {
  1381. message.warning(data.error[0].message);
  1382. }
  1383. }.bind(this)
  1384. );
  1385. },
  1386. //查看基本详情基本信息
  1387. loaduser(record) {
  1388. this.state.orderList = [];
  1389. $.ajax({
  1390. method: "get",
  1391. dataType: "json",
  1392. crossDomain: false,
  1393. url: globalConfig.context + "/api/admin/newOrder/getOrderNewDetail",
  1394. data: {
  1395. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  1396. },
  1397. success: function(data) {
  1398. let thisData = data.data;
  1399. if (!thisData) {
  1400. if (data.error && data.error.length) {
  1401. message.warning(data.error[0].message);
  1402. }
  1403. thisData = {};
  1404. }
  1405. if (thisData.approval == 2) {
  1406. thisData.approval = "特批通过";
  1407. } else if (thisData.approval == 3) {
  1408. thisData.approval = "特批驳回";
  1409. }
  1410. this.setState({
  1411. id: thisData.id,
  1412. kehuId: thisData.buyerId,
  1413. orderNo: thisData.orderNo, //订单编号
  1414. orderType: thisData.orderType, //订单类型
  1415. firstAmount: thisData.firstAmount, //首付金额
  1416. totalAmount: thisData.totalAmount, //总金额
  1417. settlementAmount: thisData.settlementAmount, //结算金额
  1418. liquidationStatus: thisData.liquidationStatus, //清算状态
  1419. processStatus: thisData.processStatus, //流程状态
  1420. approval: thisData.approval.toString(), //特批状态
  1421. orderRemarks: thisData.orderRemarks, //订单备注
  1422. contractNo: thisData.contractNo, //合同编号
  1423. contacts: thisData.contacts, //联系人
  1424. contactMobile: thisData.contactMobile, //联系人电话
  1425. legalPerson: thisData.legalPerson, //法人
  1426. legalPersonTel: thisData.legalPersonTel, //法人电话
  1427. contractNo: thisData.contractNo, //合同编号
  1428. orgCodeUrl: thisData.contractPictureUrl
  1429. ? splitUrl(
  1430. thisData.contractPictureUrl,
  1431. ",",
  1432. globalConfig.avatarHost + "/upload"
  1433. )
  1434. : [], //图片地址
  1435. signDate: thisData.signDate, //签单时间
  1436. userName: thisData.userName, //客户名称
  1437. salesmanName: thisData.salesmanName, //营销员名称
  1438. salesmanMobile: thisData.salesmanMobile, //营销员电话
  1439. oldSalesmanName: thisData.oldSalesmanName, //营销员名称
  1440. oldSalesmanMobile: thisData.oldSalesmanMobile, //营销员电话
  1441. financeName: thisData.financeName, //财务名称
  1442. financeMobile: thisData.financeMobile, //财务电话
  1443. nowFinanceMobile: thisData.nowFinanceMobile,
  1444. nowFinance: thisData.nowFinance,
  1445. contractNo: thisData.contractNo, //合同编号
  1446. approval:
  1447. thisData.approval == 0
  1448. ? thisData.approval.toString()
  1449. : thisData.approval,
  1450. organizationSearch: thisData.orderDep,
  1451. depName: thisData.depName,
  1452. status: thisData.status,
  1453. outsource: thisData.outsource
  1454. });
  1455. // console.log("kkkk",this.state.processStatus);
  1456. }.bind(this)
  1457. }).always(
  1458. function() {
  1459. this.setState({
  1460. loading: false
  1461. });
  1462. }.bind(this)
  1463. );
  1464. },
  1465. //节点列表
  1466. jiedian(orderNos) {
  1467. $.ajax({
  1468. method: "get",
  1469. dataType: "json",
  1470. crossDomain: false,
  1471. url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
  1472. data: {
  1473. orderNo: orderNos
  1474. },
  1475. success: function(data) {
  1476. let theArr = [];
  1477. let thisData = [];
  1478. if (data.error.length || data.data.list == "") {
  1479. if (data.error && data.error.length) {
  1480. message.warning(data.error[0].message);
  1481. }
  1482. } else {
  1483. for (let i = 0; i < data.data.length; i++) {
  1484. thisData = data.data[i];
  1485. theArr.push({
  1486. key: i,
  1487. dunSubject: thisData.dunSubject
  1488. ? thisData.dunSubject.toString()
  1489. : "", //催款科目
  1490. id: thisData.id, //节点Id
  1491. money: thisData.money, //催款金额
  1492. dunStatus: thisData.dunStatus, //催款状态
  1493. orderNo: thisData.orderNo
  1494. });
  1495. }
  1496. this.setState({
  1497. contactList: theArr
  1498. });
  1499. }
  1500. }.bind(this)
  1501. }).always(
  1502. function() {
  1503. this.setState({
  1504. loading: false
  1505. });
  1506. }.bind(this)
  1507. );
  1508. },
  1509. //查看催款节点
  1510. jiedianNew(orderNos) {
  1511. $.ajax({
  1512. method: "get",
  1513. dataType: "json",
  1514. crossDomain: false,
  1515. url:
  1516. globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
  1517. data: {
  1518. orderNo: orderNos
  1519. },
  1520. success: function(data) {
  1521. if (data.error && data.error.length) {
  1522. message.warning(data.error[0].message);
  1523. } else {
  1524. let theArr = [];
  1525. let thisData = [];
  1526. let arr = data.data || [];
  1527. let totalCui = 0;
  1528. for (let i = 0; i < arr.length; i++) {
  1529. thisData = arr[i];
  1530. totalCui += +thisData.money;
  1531. theArr.push({
  1532. key: i,
  1533. dunSubject: thisData.dunSubject
  1534. ? thisData.dunSubject.toString()
  1535. : "", //催款科目
  1536. id: thisData.id, //节点Id
  1537. money: thisData.money, //催款金额
  1538. // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
  1539. commodityName: thisData.commodityName,
  1540. projectType: thisData.projectType,
  1541. dunTypeName: thisData.dunTypeName,
  1542. status: thisData.status,
  1543. waitDay: thisData.waitDay,
  1544. effectiveCount: thisData.effectiveCount,
  1545. startDate: thisData.startDate,
  1546. dunType: thisData.dunType,
  1547. appropriationRatio: thisData.appropriationRatio
  1548. });
  1549. }
  1550. if (!totalCui) {
  1551. totalCui = 0;
  1552. }
  1553. totalCui = (Math.round(totalCui * 10000) / 10000).toFixed(4);
  1554. this.setState({
  1555. contactListNew: theArr,
  1556. totalCui
  1557. });
  1558. }
  1559. }.bind(this)
  1560. }).always(
  1561. function() {
  1562. this.setState({
  1563. loading: false
  1564. });
  1565. }.bind(this)
  1566. );
  1567. },
  1568. //催款节点保存
  1569. contactSave(record) {
  1570. for (let i = 0; i < this.state.contactList.length; i++) {
  1571. if (moneyVerify(this.state.contactList[i].money)) {
  1572. return;
  1573. }
  1574. }
  1575. this.setState({
  1576. loading: true
  1577. });
  1578. $.ajax({
  1579. url: globalConfig.context + "/api/admin/newOrder/createOrderDun",
  1580. method: "post",
  1581. data: {
  1582. orderNo: this.state.orderNo,
  1583. orderDun: JSON.stringify(this.state.contactList)
  1584. }
  1585. }).done(
  1586. function(data) {
  1587. this.setState({
  1588. loading: false
  1589. });
  1590. if (!data.error.length) {
  1591. message.success("保存成功!");
  1592. this.jiedian(record.orderNo);
  1593. } else {
  1594. message.warning(data.error[0].message);
  1595. }
  1596. }.bind(this)
  1597. );
  1598. },
  1599. //催款节点保存
  1600. contactSaveNew(record) {
  1601. if (record.boStatus == "false") {
  1602. record.boStatus = false;
  1603. } else if (record.boStatus == "true") {
  1604. record.boStatus = true;
  1605. }
  1606. if (!this.state.yearFlag) {
  1607. if (!record.effectiveCount) {
  1608. message.warning("请选择服务年限");
  1609. return;
  1610. }
  1611. } else {
  1612. record.effectiveCount = "";
  1613. }
  1614. if (record.money == "") {
  1615. message.warning("请填写金额");
  1616. return;
  1617. }
  1618. if (record.boStatus) {
  1619. if (
  1620. typeof +record.money == "number" &&
  1621. +record.money >= 0 &&
  1622. +record.money <= 1
  1623. ) {
  1624. record.appropriationRatio = record.money;
  1625. } else {
  1626. message.warning("金额比例填写错误,比例范围0~1");
  1627. return;
  1628. }
  1629. }
  1630. if (!record.dunType) {
  1631. message.warning("请选择对应科目");
  1632. return;
  1633. }
  1634. if (record.dunType != 1) {
  1635. record.waitDay = "";
  1636. }
  1637. this.setState({
  1638. loading: true
  1639. });
  1640. if (record.boStatus) {
  1641. $.ajax({
  1642. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1643. method: "post",
  1644. data: {
  1645. orderNo: record.orderNo,
  1646. tid: record.tid,
  1647. projectType: record.sort,
  1648. dunType: record.dunType,
  1649. appropriationRatio: record.appropriationRatio,
  1650. waitDay: record.waitDay,
  1651. effectiveCount: record.effectiveCount
  1652. }
  1653. }).done(
  1654. function(data) {
  1655. this.setState({
  1656. loading: false
  1657. });
  1658. if (!data.error.length) {
  1659. message.success("保存成功!");
  1660. this.setState({
  1661. cuiFlag: false,
  1662. boFlag: false,
  1663. addFlag: false
  1664. });
  1665. this.jiedianNew(record.orderNo);
  1666. } else {
  1667. message.warning(data.error[0].message);
  1668. }
  1669. }.bind(this)
  1670. );
  1671. } else {
  1672. $.ajax({
  1673. url: globalConfig.context + "/api/admin/newOrderDun/createDun",
  1674. method: "post",
  1675. data: {
  1676. orderNo: record.orderNo,
  1677. tid: record.tid,
  1678. projectType: record.sort,
  1679. dunType: record.dunType,
  1680. money: record.money,
  1681. waitDay: record.waitDay,
  1682. effectiveCount: record.effectiveCount
  1683. }
  1684. }).done(
  1685. function(data) {
  1686. this.setState({
  1687. loading: false
  1688. });
  1689. if (!data.error.length) {
  1690. message.success("保存成功!");
  1691. this.setState({
  1692. cuiFlag: false,
  1693. boFlag: false,
  1694. addFlag: false
  1695. });
  1696. this.jiedianNew(record.orderNo);
  1697. } else {
  1698. message.warning(data.error[0].message);
  1699. }
  1700. }.bind(this)
  1701. );
  1702. }
  1703. },
  1704. //点击新增催款节点
  1705. addcontact() {
  1706. this.state.contactList.push({
  1707. key: this.state.contactList.length,
  1708. money: "",
  1709. dunSubject: undefined,
  1710. orderNo: this.state.orderNo,
  1711. dunTarget: this.state.kehuId
  1712. });
  1713. this.setState({
  1714. contactList: this.state.contactList
  1715. });
  1716. },
  1717. //点击新增催款节点
  1718. addcontactNew() {
  1719. this.state.contactListNew.push({
  1720. key: this.state.contactListNew.length,
  1721. money: "",
  1722. dunSubject: undefined,
  1723. orderNo: this.state.orderNo,
  1724. dunTarget: this.state.kehuId
  1725. });
  1726. this.setState({
  1727. contactListNew: this.state.contactListNew,
  1728. cuiFlag: true
  1729. });
  1730. },
  1731. //删除收款节点
  1732. confirmDelet(index) {
  1733. this.state.contactList.splice(index, 1);
  1734. this.setState({
  1735. contactList: this.state.contactList
  1736. });
  1737. this.contactSave();
  1738. },
  1739. //删除收款节点
  1740. confirmDeletNew(index) {
  1741. if (index.id) {
  1742. this.state.contactListNew.splice(index.id, 1);
  1743. this.setState({
  1744. contactListNew: this.state.contactListNew,
  1745. cuiFlag: false,
  1746. addFlag: false,
  1747. boFlag: false
  1748. });
  1749. $.ajax({
  1750. url: globalConfig.context + "/api/admin/newOrderDun/deleteDun",
  1751. method: "post",
  1752. data: {
  1753. id: index.id
  1754. }
  1755. }).done(
  1756. function(data) {
  1757. this.setState({
  1758. loading: false
  1759. });
  1760. if (!data.error.length) {
  1761. message.success("删除成功!");
  1762. this.setState({
  1763. cuiFlag: false
  1764. });
  1765. this.jiedianNew(this.state.orderNo);
  1766. } else {
  1767. message.warning(data.error[0].message);
  1768. }
  1769. }.bind(this)
  1770. );
  1771. } else {
  1772. this.state.contactListNew.splice(index.key, 1);
  1773. this.setState({
  1774. contactListNew: this.state.contactListNew,
  1775. cuiFlag: false,
  1776. addFlag: false,
  1777. boFlag: false
  1778. });
  1779. }
  1780. },
  1781. handleOk() {
  1782. this.setState({
  1783. visible: false,
  1784. mark: false
  1785. });
  1786. this.props.closeDesc(false, true);
  1787. },
  1788. handleCancel() {
  1789. if (this.state.orderType == undefined) {
  1790. return false;
  1791. }
  1792. if (!this.state.autoId) {
  1793. return false;
  1794. }
  1795. this.setState({
  1796. visible: false,
  1797. mark: false
  1798. });
  1799. this.props.closeDesc(false);
  1800. },
  1801. handleCancelclose() {
  1802. this.setState(
  1803. {
  1804. visible: false,
  1805. mark: false,
  1806. cuiFlag: false,
  1807. addFlag: false,
  1808. boFlag: false,
  1809. isJilu: false
  1810. },
  1811. () => {
  1812. this.setState({
  1813. activeKey: "1"
  1814. });
  1815. }
  1816. );
  1817. this.props.closeDesc(false);
  1818. this.reset();
  1819. },
  1820. //点击签单
  1821. handleCancels() {
  1822. this.setState({
  1823. isSubmit: 1
  1824. });
  1825. },
  1826. //点击签单
  1827. handleCancelq() {
  1828. this.setState({
  1829. isSubmit: 0
  1830. });
  1831. },
  1832. //删除
  1833. delectRow(record) {
  1834. this.setState({
  1835. loading: true
  1836. });
  1837. $.ajax({
  1838. method: "post",
  1839. dataType: "json",
  1840. crossDomain: false,
  1841. url: globalConfig.context + "/api/admin/newOrder/deleteOrderTask",
  1842. data: {
  1843. id: record.id
  1844. }
  1845. }).done(
  1846. function(data) {
  1847. if (!data.error.length) {
  1848. message.success("删除成功!");
  1849. this.setState({
  1850. loading: false
  1851. });
  1852. this.jiedian(this.state.orderNo);
  1853. this.jiedianNew(this.state.orderNo);
  1854. this.loaduser();
  1855. this.loadData();
  1856. } else {
  1857. message.warning(data.error[0].message);
  1858. }
  1859. }.bind(this)
  1860. );
  1861. },
  1862. nextCancel() {
  1863. this.setState({
  1864. addnextVisible: false,
  1865. changeVisible: false
  1866. });
  1867. },
  1868. rizhi() {
  1869. this.setState({
  1870. loading: true
  1871. });
  1872. $.ajax({
  1873. method: "get",
  1874. dataType: "json",
  1875. crossDomain: false,
  1876. url: "/api/admin/newOrder/selectOrderLog",
  1877. data: {
  1878. orderNo: this.props.datauser.orderNo
  1879. },
  1880. success: function(data) {
  1881. let theArr = [];
  1882. let thisData = data.data;
  1883. if (!thisData.length) {
  1884. if (data.error && data.error.length) {
  1885. message.warning(data.error[0].message);
  1886. }
  1887. thisData = {};
  1888. } else {
  1889. for (let i = 0; i < data.data.length; i++) {
  1890. let thisdata = data.data[i];
  1891. theArr.push({
  1892. processName: thisdata.processName,
  1893. adminName: thisdata.adminName,
  1894. createDate: thisdata.createDate,
  1895. remarks: thisdata.remarks
  1896. });
  1897. }
  1898. }
  1899. this.setState({
  1900. dataSourcerizhi: theArr
  1901. });
  1902. }.bind(this)
  1903. }).always(
  1904. function() {
  1905. this.setState({
  1906. loading: false
  1907. });
  1908. }.bind(this)
  1909. );
  1910. },
  1911. //查看订单日志
  1912. getOrderLog() {
  1913. this.setState({
  1914. rizhivisible: true
  1915. });
  1916. this.rizhi();
  1917. },
  1918. closeOrderLog() {
  1919. this.setState({
  1920. rizhivisible: false
  1921. });
  1922. },
  1923. callback(key) {
  1924. this.setState({
  1925. activeKey: key
  1926. });
  1927. if (key === "1") {
  1928. this.jiedian(this.props.datauser.orderNo);
  1929. this.jiedianNew(this.props.datauser.orderNo);
  1930. // this.loaduser();
  1931. }
  1932. if (key === "3") {
  1933. this.getChangeData();
  1934. }
  1935. if (key === "2") {
  1936. let url = window.location.href.substring(7);
  1937. $.ajax({
  1938. method: "get",
  1939. dataType: "json",
  1940. crossDomain: false,
  1941. url:
  1942. globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  1943. data: {
  1944. orderNo: this.props.datauser.orderNo
  1945. },
  1946. success: function(data) {
  1947. // console.log(data.data);
  1948. if (data.data && data.data.length) {
  1949. let thisdata = data.data[data.data.length - 1];
  1950. if (thisdata.status === 0 || thisdata.processState == 0) {
  1951. this.setState({
  1952. changeId: thisdata.id,
  1953. typeChange: thisdata.type,
  1954. totalAmount: thisdata.totalAmount,
  1955. settlementAmount: thisdata.settlementAmount,
  1956. changeAmount: thisdata.changeAmount,
  1957. remarksC: thisdata.remarks,
  1958. startRemarks: thisdata.zxsRemarks,
  1959. isCaoGao: true,
  1960. changeFlag: true,
  1961. voucherUrl: thisdata.voucherUrl
  1962. ? splitUrl(
  1963. thisdata.voucherUrl,
  1964. ",",
  1965. globalConfig.avatarHost + "/upload",
  1966. url
  1967. )
  1968. : []
  1969. });
  1970. this.proList();
  1971. this.cuiList();
  1972. let e = thisdata.type;
  1973. if (e == 1) {
  1974. this.setState({
  1975. hetongFlag: false,
  1976. listFlag: false,
  1977. listCuiFlag: false,
  1978. tuiKuanFlag: false
  1979. });
  1980. } else if (e == 2) {
  1981. this.setState({
  1982. hetongFlag: true,
  1983. listFlag: false,
  1984. listCuiFlag: false,
  1985. tuiKuanFlag: true
  1986. });
  1987. } else if (e == 3) {
  1988. this.setState({
  1989. listFlag: false,
  1990. hetongFlag: false,
  1991. listCuiFlag: false,
  1992. tuiKuanFlag: false
  1993. });
  1994. } else if (e == 4) {
  1995. this.setState({
  1996. listFlag: false,
  1997. listCuiFlag: false,
  1998. hetongFlag: false,
  1999. tuiKuanFlag: true
  2000. });
  2001. } else if (e == 5) {
  2002. this.setState({
  2003. listFlag: false,
  2004. listCuiFlag: false,
  2005. hetongFlag: true,
  2006. tuiKuanFlag: true
  2007. });
  2008. } else {
  2009. this.setState({
  2010. listFlag: true,
  2011. hetongFlag: true,
  2012. listCuiFlag: true,
  2013. tuiKuanFlag: false
  2014. });
  2015. }
  2016. } else {
  2017. this.setState({
  2018. listFlag: false,
  2019. hetongFlag: false,
  2020. listCuiFlag: false,
  2021. tuiKuanFlag: false,
  2022. // 置空
  2023. changeId: undefined
  2024. });
  2025. }
  2026. } else {
  2027. this.setState({
  2028. isCaoGao: false
  2029. });
  2030. }
  2031. }.bind(this)
  2032. });
  2033. }
  2034. },
  2035. cuiList(id) {
  2036. $.ajax({
  2037. method: "get",
  2038. dataType: "json",
  2039. crossDomain: false,
  2040. url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
  2041. data: {
  2042. id: id || this.state.changeId
  2043. },
  2044. success: function(data) {
  2045. if (data.data && data.data.length) {
  2046. if (id) {
  2047. this.setState({
  2048. listCuiFlag: true
  2049. });
  2050. }
  2051. this.setState({
  2052. cuiDataSource: data.data
  2053. });
  2054. }
  2055. }.bind(this)
  2056. });
  2057. },
  2058. proList(id) {
  2059. $.ajax({
  2060. method: "get",
  2061. dataType: "json",
  2062. crossDomain: false,
  2063. url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
  2064. data: {
  2065. id: id || this.state.changeId
  2066. },
  2067. success: function(data) {
  2068. if (data.data && data.data.length) {
  2069. if (id) {
  2070. this.setState({
  2071. listFlag: true
  2072. });
  2073. }
  2074. this.setState({
  2075. proDataSource: data.data
  2076. });
  2077. }
  2078. }.bind(this)
  2079. });
  2080. },
  2081. getOrgCodeUrl(e) {
  2082. this.setState({ orgCodeUrl: e });
  2083. },
  2084. getVoucherUrl(e) {
  2085. this.setState({ voucherUrl: e });
  2086. },
  2087. //加载(自动补全)
  2088. supervisor(e, state) {
  2089. //客户名称与服务名称自动补全
  2090. let api = state
  2091. ? "/api/admin/customer/getCustomerByName"
  2092. : "/api/admin/order/getBusinessProjectByName";
  2093. $.ajax({
  2094. method: "get",
  2095. dataType: "json",
  2096. crossDomain: false,
  2097. url: globalConfig.context + api,
  2098. data: state
  2099. ? {
  2100. name: e,
  2101. type: this.state.customType
  2102. }
  2103. : {
  2104. businessName: e
  2105. },
  2106. success: function(data) {
  2107. let thedata = data.data;
  2108. if (!thedata) {
  2109. if (data.error && data.error.length) {
  2110. message.warning(data.error[0].message);
  2111. }
  2112. thedata = {};
  2113. }
  2114. this.setState({
  2115. states: state,
  2116. customerArr: thedata
  2117. });
  2118. }.bind(this)
  2119. }).always(
  2120. function() {
  2121. this.setState({
  2122. loading: false
  2123. });
  2124. }.bind(this)
  2125. );
  2126. },
  2127. supervisorCui(e) {
  2128. //客户名称与服务名称自动补全
  2129. let api = "/api/admin/order/getBusinessProjectByName";
  2130. $.ajax({
  2131. method: "get",
  2132. dataType: "json",
  2133. crossDomain: false,
  2134. url: globalConfig.context + api,
  2135. data: {
  2136. businessName: e
  2137. },
  2138. success: function(data) {
  2139. let thedata = data.data;
  2140. if (!thedata) {
  2141. if (data.error && data.error.length) {
  2142. message.warning(data.error[0].message);
  2143. }
  2144. thedata = {};
  2145. }
  2146. this.setState({
  2147. customerCuiArr: thedata
  2148. });
  2149. }.bind(this)
  2150. }).always(
  2151. function() {
  2152. this.setState({
  2153. loading: false
  2154. });
  2155. }.bind(this)
  2156. );
  2157. },
  2158. //上级主管输入框失去焦点是判断客户是否存在
  2159. selectAuto(value) {
  2160. let kid = [];
  2161. let fwList = this.state.customerArr;
  2162. fwList.map(function(item) {
  2163. if (value == item.bname) {
  2164. kid = item;
  2165. }
  2166. });
  2167. this.setState({
  2168. commodityName: value,
  2169. gid: kid.id,
  2170. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2171. commodityFirstPayment:
  2172. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2173. });
  2174. },
  2175. selectAutoCui(value) {
  2176. let kid = [];
  2177. let fwList = this.state.customerCuiArr;
  2178. fwList.map(function(item) {
  2179. if (value == item.bname) {
  2180. kid = item;
  2181. }
  2182. });
  2183. this.setState({
  2184. commodityNameCui: value,
  2185. cid: kid.id,
  2186. //commodityPrice:kid.price==0?kid.price.toString():kid.price,
  2187. commodityFirstPayment:
  2188. kid.firstPayment == 0 ? kid.firstPayment.toString() : kid.firstPayment
  2189. });
  2190. },
  2191. //客户
  2192. selectAutoCUT(value) {
  2193. let autoIds;
  2194. let fwList = this.state.customerArr;
  2195. fwList.map(function(item) {
  2196. if (value == item.name) {
  2197. autoIds = item.id;
  2198. }
  2199. });
  2200. this.setState({
  2201. customerName: value,
  2202. autoId: autoIds
  2203. });
  2204. },
  2205. //服务值改变时请求客户名称
  2206. httpChange(e) {
  2207. this.state.gid = "";
  2208. if (e.length >= 1) {
  2209. this.supervisor(e, false);
  2210. }
  2211. this.setState({
  2212. commodityName: e
  2213. });
  2214. },
  2215. httpChangeCui(e) {
  2216. if (e.length >= 1) {
  2217. this.supervisorCui(e, false);
  2218. }
  2219. this.setState({
  2220. commodityNameCui: e
  2221. });
  2222. },
  2223. //客户名称自动补全
  2224. customerChange(e) {
  2225. if (this.state.customType) {
  2226. this.state.autoId = "";
  2227. if (e.length >= 2) {
  2228. this.supervisor(e, true);
  2229. }
  2230. this.setState({
  2231. customerName: e
  2232. });
  2233. } else {
  2234. this.setState({
  2235. customerName: ""
  2236. });
  2237. message.warning("客户所属类型必须指定");
  2238. }
  2239. },
  2240. //点击添加项目明细
  2241. addDetailed() {
  2242. this.setState({
  2243. gid: "",
  2244. customerArr: [],
  2245. commodityName: "",
  2246. commodityQuantity: "",
  2247. commodityId: "",
  2248. taskComment: "",
  2249. main: undefined,
  2250. commodityPrice: "",
  2251. addState: 1,
  2252. addnextVisible: true
  2253. });
  2254. },
  2255. //新建项目明细保存
  2256. nextSubmit(e) {
  2257. e.preventDefault();
  2258. if (this.state.gid == undefined || !this.state.gid) {
  2259. message.warning("服务名称不匹配!");
  2260. return false;
  2261. }
  2262. if (!this.state.commodityPrice) {
  2263. message.warning("请输入金额!");
  2264. this.refs.commodityPrice.focus();
  2265. return false;
  2266. }
  2267. let reg = /^([0]|[1-9][0-9]*)$/;
  2268. if (
  2269. !this.state.commodityQuantity ||
  2270. !reg.test(this.state.commodityQuantity)
  2271. ) {
  2272. message.warning("请输入正确商品数量!");
  2273. this.refs.commodityQuantity.focus();
  2274. return false;
  2275. }
  2276. if (!this.state.main) {
  2277. message.warning("请选择是否为主要项目!");
  2278. this.refs.commodityQuantity.focus();
  2279. return false;
  2280. }
  2281. this.setState({
  2282. loading: true
  2283. });
  2284. let api = this.state.addState
  2285. ? "/api/admin/newOrder/addOrderTask"
  2286. : "/api/bianji";
  2287. $.ajax({
  2288. method: "POST",
  2289. dataType: "json",
  2290. crossDomain: false,
  2291. url: globalConfig.context + api,
  2292. data: {
  2293. commodityId: this.state.gid, //商品ID
  2294. orderNo: this.props.datauser.orderNo, //订单编号
  2295. commodityName: this.state.commodityName, //商品名称
  2296. commodityQuantity: this.state.commodityQuantity, //商品数量
  2297. commodityPrice: this.state.commodityPrice, //签单总价
  2298. taskComment: this.state.taskComment, //服务说明
  2299. main: this.state.main //是否为主要项目
  2300. }
  2301. }).done(
  2302. function(data) {
  2303. this.setState({
  2304. loading: false
  2305. });
  2306. if (!data.error.length) {
  2307. message.success("保存成功!");
  2308. this.nextCancel();
  2309. //this.loaduser(this.props.datauser);
  2310. this.loadData();
  2311. } else {
  2312. message.warning(data.error[0].message);
  2313. }
  2314. }.bind(this)
  2315. );
  2316. },
  2317. //点击打卡项目详情
  2318. tableRowClick(record) {
  2319. this.setState({
  2320. jid: record.id, //项目ID
  2321. kid: record.commodityId, //商品ID
  2322. commodityName: record.commodityName, //金额
  2323. commodityPrice: record.commodityPrice, //金额
  2324. commodityQuantity: record.commodityQuantity, //数量
  2325. taskComment: record.taskComment, //备注
  2326. main: record.main.toString(), //是否为主要
  2327. addnextVisible: true,
  2328. addState: 0
  2329. });
  2330. },
  2331. //修改项目详情
  2332. tabRowSave(e) {
  2333. e.preventDefault();
  2334. if (!this.state.commodityPrice) {
  2335. message.warning("金额不能为空!");
  2336. return false;
  2337. }
  2338. let reg = /^([0]|[1-9][0-9]*)$/;
  2339. if (
  2340. !this.state.commodityQuantity ||
  2341. !reg.test(this.state.commodityQuantity)
  2342. ) {
  2343. message.warning("请输入正确商品数量!");
  2344. return false;
  2345. }
  2346. if (!this.state.main) {
  2347. message.warning("请选择是否为主要项目!");
  2348. this.refs.commodityQuantity.focus();
  2349. return false;
  2350. }
  2351. $.ajax({
  2352. method: "POST",
  2353. dataType: "json",
  2354. crossDomain: false,
  2355. url: globalConfig.context + "/api/admin/newOrder/updateOrderTask",
  2356. data: {
  2357. id: this.state.jid, //项目ID
  2358. commodityId: this.state.kid, //商品ID
  2359. orderNo: this.props.datauser.orderNo, //订单编号
  2360. main: this.state.main, //是否为主要
  2361. commodityPrice: this.state.commodityPrice, //金额
  2362. commodityQuantity: this.state.commodityQuantity, //数量
  2363. taskComment: this.state.taskComment //备注
  2364. }
  2365. }).done(
  2366. function(data) {
  2367. this.setState({
  2368. loading: false
  2369. });
  2370. if (!data.error.length) {
  2371. message.success("保存成功!");
  2372. this.nextCancel();
  2373. //this.loaduser(this.props.datauser);
  2374. this.loadData();
  2375. } else {
  2376. message.warning(data.error[0].message);
  2377. }
  2378. }.bind(this)
  2379. );
  2380. },
  2381. //签单时间选择
  2382. selTime(e, index) {
  2383. this.setState({
  2384. entryTime: e,
  2385. signDate: e,
  2386. selTime: index
  2387. });
  2388. },
  2389. //退单操作
  2390. //点击退单
  2391. tuikuan() {
  2392. this.setState({
  2393. lookVisible: true,
  2394. contractUrl: [],
  2395. applicationUrl: [],
  2396. reason: ""
  2397. });
  2398. },
  2399. //关闭退单
  2400. noCancel() {
  2401. this.setState({
  2402. lookVisible: false
  2403. });
  2404. },
  2405. //点击确认退单
  2406. tuidanOk() {
  2407. let contractUrls = [];
  2408. let applicationUrls = [];
  2409. if (this.state.contractUrl.length) {
  2410. let picArr = [];
  2411. this.state.contractUrl.map(function(item) {
  2412. if (
  2413. item.response &&
  2414. item.response.data &&
  2415. item.response.data.length
  2416. ) {
  2417. picArr.push(item.response.data);
  2418. }
  2419. });
  2420. contractUrls = picArr.join(",");
  2421. }
  2422. if (this.state.applicationUrl.length) {
  2423. let picArr = [];
  2424. this.state.applicationUrl.map(function(item) {
  2425. if (
  2426. item.response &&
  2427. item.response.data &&
  2428. item.response.data.length
  2429. ) {
  2430. picArr.push(item.response.data);
  2431. }
  2432. });
  2433. applicationUrls = picArr.join(",");
  2434. }
  2435. $.ajax({
  2436. method: "POST",
  2437. dataType: "json",
  2438. crossDomain: false,
  2439. url: globalConfig.context + "/api/admin/newOrder/addOrderRefund",
  2440. data: {
  2441. orderNo: this.state.orderNo, //订单编号
  2442. contractUrl: contractUrls.length ? contractUrls : "", //终止合同
  2443. applicationUrl: applicationUrls.length ? applicationUrls : "", //退单申请表
  2444. reason: this.state.reason //退单原因
  2445. }
  2446. }).done(
  2447. function(data) {
  2448. this.setState({
  2449. loading: false
  2450. });
  2451. if (!data.error.length) {
  2452. message.success("退单成功!");
  2453. this.noCancel();
  2454. this.handleCancelclose();
  2455. } else {
  2456. message.warning(data.error[0].message);
  2457. }
  2458. }.bind(this)
  2459. );
  2460. },
  2461. //开单选择订单类型骚操作
  2462. orderTypeFn(e) {
  2463. if (e == 0) {
  2464. this.setState({
  2465. bussStats: true,
  2466. orderType: e
  2467. });
  2468. this.category();
  2469. } else {
  2470. this.setState({
  2471. contractType: undefined,
  2472. bussStats: false,
  2473. orderType: e
  2474. });
  2475. }
  2476. },
  2477. //品类数据获取
  2478. category() {
  2479. $.ajax({
  2480. method: "get",
  2481. dataType: "json",
  2482. crossDomain: false,
  2483. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  2484. data: {},
  2485. success: function(data) {
  2486. let thedata = data.data;
  2487. let theArr = [];
  2488. if (!thedata) {
  2489. if (data.error && data.error.length) {
  2490. message.warning(data.error[0].message);
  2491. }
  2492. thedata = {};
  2493. } else {
  2494. thedata.map(function(item, index) {
  2495. theArr.push({
  2496. key: index,
  2497. name: item.cname,
  2498. id: item.id
  2499. });
  2500. });
  2501. }
  2502. this.setState({
  2503. contractType: undefined,
  2504. categoryArr: theArr
  2505. });
  2506. }.bind(this)
  2507. });
  2508. },
  2509. //变更申请
  2510. changeApply() {
  2511. if (this.state.processStatus <= 4) {
  2512. message.warning("当前订单流程不能发起变更!");
  2513. return false;
  2514. }
  2515. if (this.state.changeAmount === "") {
  2516. message.warning("申请退款金额不能为空!");
  2517. // console.log(this.state.changeAmount);
  2518. return false;
  2519. }
  2520. if (this.state.remarksC.trim() == "") {
  2521. message.warning("请正确填写变更原因");
  2522. return false;
  2523. }
  2524. if (this.state.startRemarks.trim() == "") {
  2525. message.warning("请正确填写备注信息");
  2526. return false;
  2527. }
  2528. let theorgCodeUrl = [];
  2529. if (this.state.voucherUrl.length) {
  2530. let picArr = [];
  2531. this.state.voucherUrl.map(function(item) {
  2532. if (
  2533. item.response &&
  2534. item.response.data &&
  2535. item.response.data.length
  2536. ) {
  2537. picArr.push(item.response.data);
  2538. }
  2539. });
  2540. theorgCodeUrl = picArr.join(",");
  2541. }
  2542. this.setState({
  2543. loading: true
  2544. });
  2545. if (this.state.typeChange == 0) {
  2546. $.ajax({
  2547. method: "post",
  2548. dataType: "json",
  2549. crossDomain: false,
  2550. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2551. data: {
  2552. orderNo: this.state.orderNo, //订单编号
  2553. processState: 1,
  2554. status: 1,
  2555. startRemarks: this.state.startRemarks,
  2556. remarks: this.state.remarksC,
  2557. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2558. totalAmount: this.state.totalAmount,
  2559. settlementAmount: this.state.settlementAmount,
  2560. changeAmount: this.state.changeAmount,
  2561. applicant: this.state.salesmanName,
  2562. depName: this.state.depName,
  2563. type: this.state.typeChange
  2564. }
  2565. }).done(
  2566. function(data) {
  2567. this.setState({
  2568. loading: false
  2569. });
  2570. if (!data.error.length) {
  2571. message.success("发起变更成功");
  2572. this.handleCancelclose();
  2573. } else {
  2574. message.warning(data.error[0].message);
  2575. }
  2576. }.bind(this)
  2577. );
  2578. } else {
  2579. $.ajax({
  2580. method: "post",
  2581. dataType: "json",
  2582. crossDomain: false,
  2583. url: globalConfig.context + "/api/admin/orderChange/addOrderChange",
  2584. data: {
  2585. orderNo: this.state.orderNo, //订单编号
  2586. processState: 0,
  2587. status: 0,
  2588. startRemarks: this.state.startRemarks,
  2589. remarks: this.state.remarksC,
  2590. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  2591. totalAmount: this.state.totalAmount,
  2592. settlementAmount: this.state.settlementAmount,
  2593. changeAmount: this.state.changeAmount,
  2594. applicant: this.state.salesmanName,
  2595. depName: this.state.depName,
  2596. type: this.state.typeChange
  2597. }
  2598. }).done(
  2599. function(data) {
  2600. this.setState({
  2601. loading: false
  2602. });
  2603. if (!data.error.length) {
  2604. message.success("发起变更草稿");
  2605. this.setState(
  2606. {
  2607. isCaoGao: true,
  2608. loading: false
  2609. },
  2610. () => {
  2611. this.callback("2");
  2612. }
  2613. );
  2614. } else {
  2615. message.warning(data.error[0].message);
  2616. }
  2617. }.bind(this)
  2618. );
  2619. }
  2620. },
  2621. reset() {
  2622. this.setState({
  2623. startRemarks: "",
  2624. remarksC: "",
  2625. voucherUrl: [],
  2626. totalAmount: undefined,
  2627. settlementAmount: undefined,
  2628. changeAmount: "0",
  2629. applicant: undefined,
  2630. depNameChange: undefined,
  2631. typeChange: []
  2632. });
  2633. },
  2634. componentWillReceiveProps(nextProps) {
  2635. //props改变时触发
  2636. this.state.visible = nextProps.showDesc;
  2637. this.state.signBillVisible = nextProps.signBillVisible;
  2638. if (this.state.signBillVisible) {
  2639. this.loaduser(nextProps.uid);
  2640. }
  2641. if (nextProps.userDetaile && nextProps.showDesc) {
  2642. this.loaduser(nextProps.datauser);
  2643. this.jiedian(nextProps.datauser.orderNo);
  2644. this.jiedianNew(nextProps.datauser.orderNo);
  2645. this.loadData(nextProps.datauser);
  2646. this.getChangeData(nextProps.datauser);
  2647. } else {
  2648. this.setState({
  2649. orderType: undefined,
  2650. customerName: "",
  2651. autoId: "",
  2652. customerArr: [],
  2653. contractType: undefined,
  2654. bussStats: false,
  2655. customType: undefined
  2656. });
  2657. }
  2658. },
  2659. //查看变更记录
  2660. getChangeData(record) {
  2661. this.setState({
  2662. loading: true
  2663. });
  2664. $.ajax({
  2665. method: "get",
  2666. dataType: "json",
  2667. crossDomain: false,
  2668. url: globalConfig.context + "/api/admin/orderChange/orderChangeDetails",
  2669. data: {
  2670. orderNo: record ? record.orderNo : this.props.datauser.orderNo
  2671. },
  2672. success: function(data) {
  2673. this.setState({
  2674. loading: false
  2675. });
  2676. let url = window.location.href.substring(7);
  2677. // console.log(data.data);
  2678. if (data.data && data.data.length) {
  2679. let thisdata = data.data[data.data.length - 1];
  2680. let obj = {
  2681. id: thisdata.id,
  2682. typeChange: thisdata.type,
  2683. totalAmount: thisdata.totalAmount,
  2684. settlementAmount: thisdata.settlementAmount,
  2685. changeAmount: thisdata.changeAmount,
  2686. remarksC: thisdata.remarks,
  2687. startRemarks: thisdata.zxsRemarks,
  2688. voucherUrl: thisdata.voucherUrl
  2689. ? splitUrl(
  2690. thisdata.voucherUrl,
  2691. ",",
  2692. globalConfig.avatarHost + "/upload",
  2693. url
  2694. )
  2695. : []
  2696. };
  2697. this.proList(thisdata.id);
  2698. this.cuiList(thisdata.id);
  2699. this.setState({
  2700. //判断是否有合同变更记录
  2701. isJilu: true,
  2702. detailChange: obj
  2703. });
  2704. }
  2705. }.bind(this)
  2706. });
  2707. },
  2708. showConfirm(fn, record) {
  2709. confirm({
  2710. title: "确定删除此项目吗?",
  2711. content: (
  2712. <span style={{ color: "red" }}>
  2713. 删除后会将该项目下的所有催款节点自动清除!!!
  2714. </span>
  2715. ),
  2716. onOk() {
  2717. fn(record);
  2718. },
  2719. onCancel() {}
  2720. });
  2721. },
  2722. changeAddPro() {
  2723. this.setState({
  2724. changeVisible: true,
  2725. gid: "",
  2726. customerArr: [],
  2727. commodityName: "",
  2728. commodityQuantity: "",
  2729. commodityId: "",
  2730. taskComment: "",
  2731. main: undefined,
  2732. commodityPrice: ""
  2733. });
  2734. },
  2735. changeProSubmit() {
  2736. if (this.state.gid == undefined || !this.state.gid) {
  2737. message.warning("服务名称不匹配!");
  2738. return false;
  2739. }
  2740. if (!this.state.commodityPrice) {
  2741. message.warning("请输入金额!");
  2742. this.refs.commodityPrice.focus();
  2743. return false;
  2744. }
  2745. let reg = /^([0]|[1-9][0-9]*)$/;
  2746. if (
  2747. !this.state.commodityQuantity ||
  2748. !reg.test(this.state.commodityQuantity)
  2749. ) {
  2750. message.warning("请输入正确商品数量!");
  2751. this.refs.commodityQuantity.focus();
  2752. return false;
  2753. }
  2754. if (!this.state.main) {
  2755. message.warning("请选择是否为主要项目!");
  2756. this.refs.commodityQuantity.focus();
  2757. return false;
  2758. }
  2759. this.setState({
  2760. loading: true
  2761. });
  2762. let type = 0;
  2763. if (this.state.typeChange == 4 || this.state.typeChange == 5) {
  2764. type = 1;
  2765. }
  2766. $.ajax({
  2767. method: "post",
  2768. dataType: "json",
  2769. crossDomain: false,
  2770. url: globalConfig.context + "/api/admin/orderChange/addChangeTask",
  2771. data: {
  2772. commodityId: this.state.gid, //商品ID
  2773. orderNo: this.props.datauser.orderNo, //订单编号
  2774. commodityName: this.state.commodityName, //商品名称
  2775. commodityQuantity: this.state.commodityQuantity, //商品数量
  2776. commodityPrice: this.state.commodityPrice, //签单总价
  2777. taskComment: this.state.taskComment, //服务说明
  2778. main: this.state.main, //是否为主要项目
  2779. cid: this.state.changeId, //变更ID
  2780. type
  2781. },
  2782. success: function(data) {
  2783. let theArr = [];
  2784. if (data.error && data.error.length) {
  2785. message.warning(data.error[0].message);
  2786. } else {
  2787. message.success("保存成功");
  2788. this.nextCancel();
  2789. this.proList();
  2790. }
  2791. }.bind(this)
  2792. }).always(
  2793. function() {
  2794. this.setState({
  2795. loading: false
  2796. });
  2797. }.bind(this)
  2798. );
  2799. },
  2800. changeDeletePro(record) {
  2801. this.setState({
  2802. loading: true
  2803. });
  2804. $.ajax({
  2805. method: "post",
  2806. dataType: "json",
  2807. crossDomain: false,
  2808. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  2809. data: {
  2810. id: record.id,
  2811. type: 3
  2812. },
  2813. success: function(data) {
  2814. let theArr = [];
  2815. if (data.error && data.error.length) {
  2816. message.warning(data.error[0].message);
  2817. } else {
  2818. message.success("删除成功");
  2819. this.proList();
  2820. }
  2821. }.bind(this)
  2822. }).always(
  2823. function() {
  2824. this.setState({
  2825. loading: false
  2826. });
  2827. }.bind(this)
  2828. );
  2829. },
  2830. //点击新增变更催款节点
  2831. changeAddCui() {
  2832. this.state.cuiDataSource.push({
  2833. key: this.state.cuiDataSource.length,
  2834. money: "",
  2835. dunSubject: undefined,
  2836. orderNo: this.state.orderNo,
  2837. dunTarget: this.state.kehuId
  2838. });
  2839. this.setState({
  2840. cuiDataSource: this.state.cuiDataSource,
  2841. cuiFlag: true
  2842. });
  2843. },
  2844. //删除变更收款节点
  2845. changeDeleteCui(index) {
  2846. if (index.id) {
  2847. this.state.cuiDataSource.splice(index.id, 1);
  2848. this.setState({
  2849. contactListNew: this.state.cuiDataSource,
  2850. cuiFlag: false,
  2851. addFlag: false,
  2852. boFlag: false
  2853. });
  2854. $.ajax({
  2855. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  2856. method: "post",
  2857. data: {
  2858. id: index.id,
  2859. type: 3,
  2860. }
  2861. }).done(
  2862. function(data) {
  2863. this.setState({
  2864. loading: false
  2865. });
  2866. if (!data.error.length) {
  2867. message.success("删除成功!");
  2868. this.setState({
  2869. cuiFlag: false
  2870. });
  2871. this.cuiList();
  2872. } else {
  2873. message.warning(data.error[0].message);
  2874. }
  2875. }.bind(this)
  2876. );
  2877. } else {
  2878. this.state.cuiDataSource.splice(index.key, 1);
  2879. this.setState({
  2880. cuiDataSource: this.state.cuiDataSource,
  2881. cuiFlag: false,
  2882. addFlag: false,
  2883. boFlag: false
  2884. });
  2885. }
  2886. },
  2887. changeSaveCui(record) {
  2888. if (record.boStatus == "false") {
  2889. record.boStatus = false;
  2890. } else if (record.boStatus == "true") {
  2891. record.boStatus = true;
  2892. }
  2893. if (!this.state.yearFlag) {
  2894. if (!record.effectiveCount) {
  2895. message.warning("请选择服务年限");
  2896. return;
  2897. }
  2898. } else {
  2899. record.effectiveCount = "";
  2900. }
  2901. if (record.money == "") {
  2902. message.warning("请填写金额");
  2903. return;
  2904. }
  2905. if (record.boStatus) {
  2906. if (
  2907. typeof +record.money == "number" &&
  2908. +record.money >= 0 &&
  2909. +record.money <= 1
  2910. ) {
  2911. record.appropriationRatio = record.money;
  2912. } else {
  2913. message.warning("金额比例填写错误,比例范围0~1");
  2914. return;
  2915. }
  2916. }
  2917. if (!record.dunType) {
  2918. message.warning("请选择对应科目");
  2919. return;
  2920. }
  2921. if (record.dunType != 1) {
  2922. record.waitDay = "";
  2923. }
  2924. this.setState({
  2925. loading: true
  2926. });
  2927. if (record.boStatus) {
  2928. $.ajax({
  2929. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2930. method: "post",
  2931. data: {
  2932. orderNo: record.orderNo,
  2933. ctid: record.ctid,
  2934. projectType: record.sort,
  2935. dunType: record.dunType,
  2936. appropriationRatio: record.appropriationRatio,
  2937. waitDay: record.waitDay,
  2938. effectiveCount: record.effectiveCount,
  2939. cid: this.state.changeId //变更ID
  2940. }
  2941. }).done(
  2942. function(data) {
  2943. this.setState({
  2944. loading: false
  2945. });
  2946. if (!data.error.length) {
  2947. message.success("保存成功!");
  2948. this.setState({
  2949. cuiFlag: false,
  2950. boFlag: false,
  2951. addFlag: false
  2952. });
  2953. this.cuiList();
  2954. } else {
  2955. message.warning(data.error[0].message);
  2956. }
  2957. }.bind(this)
  2958. );
  2959. } else {
  2960. $.ajax({
  2961. url: globalConfig.context + "/api/admin/orderChange/addChangeDun",
  2962. method: "post",
  2963. data: {
  2964. orderNo: record.orderNo,
  2965. ctid: record.ctid,
  2966. projectType: record.sort,
  2967. dunType: record.dunType,
  2968. money: record.money,
  2969. waitDay: record.waitDay,
  2970. effectiveCount: record.effectiveCount,
  2971. cid: this.state.changeId //变更ID
  2972. }
  2973. }).done(
  2974. function(data) {
  2975. this.setState({
  2976. loading: false
  2977. });
  2978. if (!data.error.length) {
  2979. message.success("保存成功!");
  2980. this.setState({
  2981. cuiFlag: false,
  2982. boFlag: false,
  2983. addFlag: false
  2984. });
  2985. this.cuiList();
  2986. } else {
  2987. message.warning(data.error[0].message);
  2988. }
  2989. }.bind(this)
  2990. );
  2991. }
  2992. },
  2993. submitChange() {
  2994. if (this.state.processStatus <= 4) {
  2995. message.warning("当前订单流程不能发起变更!");
  2996. return false;
  2997. }
  2998. if (this.state.changeAmount === "") {
  2999. message.warning("申请退款金额不能为空!");
  3000. return false;
  3001. }
  3002. if (this.state.remarksC.trim() == "") {
  3003. message.warning("请正确填写变更原因");
  3004. return false;
  3005. }
  3006. if (this.state.startRemarks.trim() == "") {
  3007. message.warning("请正确填写备注信息");
  3008. return false;
  3009. }
  3010. let theorgCodeUrl = [];
  3011. if (this.state.voucherUrl.length) {
  3012. let picArr = [];
  3013. this.state.voucherUrl.map(function(item) {
  3014. if (
  3015. item.response &&
  3016. item.response.data &&
  3017. item.response.data.length
  3018. ) {
  3019. picArr.push(item.response.data);
  3020. }
  3021. });
  3022. theorgCodeUrl = picArr.join(",");
  3023. }
  3024. this.setState({
  3025. loading: true
  3026. });
  3027. $.ajax({
  3028. url: globalConfig.context + "/api/admin/orderChange/updateOrderChange",
  3029. method: "post",
  3030. data: {
  3031. id: this.state.changeId,
  3032. changeType: 0,
  3033. orderNo: this.state.orderNo, //订单编号
  3034. processState: 0,
  3035. startRemarks: this.state.startRemarks,
  3036. remarks: this.state.remarksC,
  3037. voucherUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
  3038. totalAmount: this.state.totalAmount,
  3039. settlementAmount: this.state.settlementAmount,
  3040. changeAmount: this.state.changeAmount,
  3041. applicant: this.state.salesmanName,
  3042. depName: this.state.depName,
  3043. type: this.state.typeChange
  3044. }
  3045. }).done(
  3046. function(data) {
  3047. if (!data.error.length) {
  3048. this.setState({
  3049. loading: false
  3050. });
  3051. message.success("发起变更成功");
  3052. this.handleCancelclose();
  3053. } else {
  3054. message.warning(data.error[0].message);
  3055. }
  3056. }.bind(this)
  3057. );
  3058. },
  3059. editCui(record) {
  3060. this.setState({
  3061. editCuiVisible: true,
  3062. editCuiMoney: record.money,
  3063. editCuiTid: record.tid,
  3064. editCuiId: record.id
  3065. });
  3066. console.log(record);
  3067. },
  3068. editPro(record) {
  3069. this.setState({
  3070. editProVisible: true,
  3071. editProMoney: record.commodityPrice,
  3072. editProTid: record.tid,
  3073. editProId: record.id
  3074. });
  3075. console.log(record);
  3076. },
  3077. submitEditCui() {
  3078. this.setState({
  3079. loading: true
  3080. })
  3081. $.ajax({
  3082. url: globalConfig.context + "/api/admin/orderChange/updateChangeDun",
  3083. method: "post",
  3084. data: {
  3085. id: this.state.editCuiId,
  3086. type: this.state.editCuiTid ? 2 : 1,
  3087. money: this.state.editCuiMoney
  3088. }
  3089. }).done(
  3090. function(data) {
  3091. this.setState({
  3092. loading: false
  3093. });
  3094. if (!data.error.length) {
  3095. message.success("修改成功!");
  3096. this.cuiList();
  3097. this.setState({
  3098. editCuiVisible: false
  3099. });
  3100. } else {
  3101. message.warning(data.error[0].message);
  3102. }
  3103. }.bind(this)
  3104. );
  3105. },
  3106. submitEditPro() {
  3107. this.setState({
  3108. loading: true
  3109. })
  3110. $.ajax({
  3111. url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
  3112. method: "post",
  3113. data: {
  3114. id: this.state.editProId,
  3115. type: this.state.editProTid ? 2 : 1,
  3116. commodityPrice: this.state.editProMoney
  3117. }
  3118. }).done(
  3119. function(data) {
  3120. this.setState({
  3121. loading: false
  3122. });
  3123. if (!data.error.length) {
  3124. message.success("修改成功!");
  3125. this.proList();
  3126. this.setState({
  3127. editProVisible: false
  3128. });
  3129. } else {
  3130. message.warning(data.error[0].message);
  3131. }
  3132. }.bind(this)
  3133. );
  3134. },
  3135. render() {
  3136. const FormItem = Form.Item;
  3137. const { TabPane } = Tabs;
  3138. const { TextArea } = Input;
  3139. const formItemLayout = {
  3140. labelCol: { span: 8 },
  3141. wrapperCol: { span: 14 }
  3142. };
  3143. const contractData = this.state.contractData;
  3144. const formItemList = [
  3145. {
  3146. label: "企业联系人",
  3147. content: <span>{this.state.contacts}</span>
  3148. },
  3149. {
  3150. label: "联系人电话",
  3151. content: <span>{this.state.contactMobile}</span>
  3152. },
  3153. {
  3154. label: "企业法人",
  3155. content: <span>{this.state.legalPerson}</span>
  3156. },
  3157. {
  3158. label: "法人电话",
  3159. content: <span>{this.state.legalPersonTel}</span>
  3160. }
  3161. // {
  3162. // label: "签单金额(万元)",
  3163. // content: <span>{this.state.totalAmount}</span>
  3164. // },
  3165. // {
  3166. // label: "首付金额(万元)",
  3167. // content: <span>{this.state.firstAmount}</span>
  3168. // },
  3169. // {
  3170. // label: "特批立项",
  3171. // content: <span>{getApprovedState(this.state.approval)}</span>
  3172. // },
  3173. // {
  3174. // label: "合同签订时间",
  3175. // content: <span>{this.state.signDate}</span>
  3176. // },
  3177. // {
  3178. // label: "订单部门",
  3179. // content: <span>{this.state.depName}</span>
  3180. // }
  3181. ];
  3182. const dataSources = this.state.customerArr || [];
  3183. const cuiDataList = this.state.contactList || [];
  3184. let departmentArr = this.state.departmentArr || [];
  3185. const options = this.state.states
  3186. ? dataSources.map(group => (
  3187. <Select.Option key={group.id} value={group.name}>
  3188. {group.name}
  3189. </Select.Option>
  3190. ))
  3191. : dataSources.map((group, index) => (
  3192. <Select.Option key={index} value={group.bname}>
  3193. {group.bname}
  3194. </Select.Option>
  3195. ));
  3196. return (
  3197. <div>
  3198. <Modal
  3199. maskClosable={false}
  3200. visible={this.state.visible}
  3201. onOk={this.handleOk}
  3202. onCancel={this.handleCancelclose}
  3203. width={!this.props.userDetaile ? "600px" : "900px"}
  3204. title={!this.props.userDetaile ? "创建订单" : ""}
  3205. footer=""
  3206. // width={1300}
  3207. className="admin-desc-content"
  3208. >
  3209. <Form
  3210. layout="horizontal"
  3211. onSubmit={this.handleSubmit}
  3212. // id="demand-form"
  3213. style={{ paddingBottom: "40px" }}
  3214. >
  3215. <Spin spinning={this.state.loading}>
  3216. <div className="clearfix">
  3217. {!this.props.userDetaile ? (
  3218. <div className="clearfix">
  3219. <div className="clearfix">
  3220. <FormItem {...formItemLayout} label="订单类型">
  3221. <Select
  3222. placeholder="请选择订单类型"
  3223. style={{ width: "200px" }}
  3224. value={this.state.orderType}
  3225. onChange={e => {
  3226. this.setState({ orderType: e });
  3227. }}
  3228. >
  3229. {orderTypes.map(function(item) {
  3230. return (
  3231. <Select.Option key={item.value}>
  3232. {item.key}
  3233. </Select.Option>
  3234. );
  3235. })}
  3236. </Select>
  3237. <span className="mandatory">*</span>
  3238. </FormItem>
  3239. </div>
  3240. <FormItem {...formItemLayout} label="客户所属类型">
  3241. <Select
  3242. placeholder="请选择客户所属类型"
  3243. style={{ width: "200px" }}
  3244. value={this.state.customType}
  3245. onChange={e => {
  3246. this.setState({ customType: e });
  3247. }}
  3248. >
  3249. {customerType.map(function(item) {
  3250. return (
  3251. <Select.Option key={item.value}>
  3252. {item.key}
  3253. </Select.Option>
  3254. );
  3255. })}
  3256. </Select>
  3257. </FormItem>
  3258. <div className="clearfix">
  3259. <FormItem {...formItemLayout} label="客户名称">
  3260. <AutoComplete
  3261. className="certain-category-search"
  3262. dropdownClassName="certain-category-search-dropdown"
  3263. dropdownMatchSelectWidth={false}
  3264. dropdownStyle={{ width: 200 }}
  3265. size="large"
  3266. style={{ width: "200px" }}
  3267. dataSource={options}
  3268. placeholder="输入名称"
  3269. value={this.state.customerName}
  3270. onChange={this.customerChange}
  3271. filterOption={true}
  3272. onSelect={this.selectAutoCUT}
  3273. >
  3274. <Input />
  3275. </AutoComplete>
  3276. <span className="mandatory">*</span>
  3277. </FormItem>
  3278. </div>
  3279. <div className="addSave" style={{ marginTop: "15px" }}>
  3280. <Button
  3281. className="cancel"
  3282. type="primary"
  3283. onClick={this.handleCancel}
  3284. style={{ marginLeft: "150px" }}
  3285. htmlType="submit"
  3286. >
  3287. 开单
  3288. </Button>
  3289. <Button
  3290. className="cancel"
  3291. type="ghost"
  3292. onClick={this.handleCancelclose}
  3293. style={{ marginLeft: "50px" }}
  3294. >
  3295. 取消
  3296. </Button>
  3297. </div>
  3298. </div>
  3299. ) : (
  3300. <Tabs
  3301. onChange={this.callback}
  3302. activeKey={this.state.activeKey}
  3303. >
  3304. <TabPane tab={"编辑订单"} key="1">
  3305. <div className="clearfix">
  3306. <div className="clearfix">
  3307. <FormItem
  3308. className="half-item"
  3309. {...formItemLayout}
  3310. label="合同编号"
  3311. >
  3312. {<span>{this.state.contractNo}</span>}
  3313. </FormItem>
  3314. <FormItem
  3315. className="half-item"
  3316. {...formItemLayout}
  3317. label="订单编号"
  3318. >
  3319. <span>{this.state.orderNo}</span>
  3320. </FormItem>
  3321. <FormItem
  3322. className="half-item"
  3323. {...formItemLayout}
  3324. label="流程状态"
  3325. >
  3326. <span>
  3327. {getProcessStatus(this.state.processStatus)}
  3328. </span>
  3329. </FormItem>
  3330. <FormItem
  3331. className="half-item"
  3332. {...formItemLayout}
  3333. label="结算状态"
  3334. >
  3335. <span>
  3336. {getLiquidationStatus(
  3337. this.state.liquidationStatus
  3338. )}
  3339. </span>
  3340. </FormItem>
  3341. {this.state.processStatus === 0 ? (
  3342. <div className="clearfix">
  3343. <FormItem
  3344. className="half-item"
  3345. {...formItemLayout}
  3346. label="特批立项"
  3347. >
  3348. <Select
  3349. placeholder="请选择客户所属类型"
  3350. style={{ width: "240px" }}
  3351. value={getApprovedState(
  3352. this.state.approval
  3353. )}
  3354. onChange={e => {
  3355. this.setState({ approval: e });
  3356. }}
  3357. >
  3358. {/* {tepi.map(function(item) {
  3359. // if(item.key == "特批通过" || item.key == "特批驳回")
  3360. return (
  3361. <Select.Option key={item.value}>
  3362. {item.key}
  3363. </Select.Option>
  3364. );
  3365. })} */}
  3366. <Select.Option key={0}>
  3367. 非特批
  3368. </Select.Option>
  3369. <Select.Option key={1}>特批</Select.Option>
  3370. </Select>
  3371. </FormItem>
  3372. <FormItem
  3373. className="half-item"
  3374. {...formItemLayout}
  3375. label="合同签订时间"
  3376. >
  3377. <DatePicker
  3378. style={{
  3379. marginTop: "2px",
  3380. // width: "240px",
  3381. height: "32px"
  3382. }}
  3383. showTime
  3384. format="YYYY-MM-DD"
  3385. onOk={() => {}}
  3386. value={
  3387. this.state.signDate
  3388. ? moment(this.state.signDate)
  3389. : null
  3390. }
  3391. onChange={(data, dataString) => {
  3392. this.setState({ signDate: dataString });
  3393. }}
  3394. />
  3395. <span
  3396. className="mandatory"
  3397. style={{ marginLeft: 20 }}
  3398. >
  3399. *
  3400. </span>
  3401. </FormItem>
  3402. <FormItem
  3403. className="half-item"
  3404. {...formItemLayout}
  3405. label="订单部门"
  3406. >
  3407. <Select
  3408. placeholder="请输入订单部门"
  3409. style={{ width: 240 }}
  3410. value={this.state.organizationSearch}
  3411. onChange={e => {
  3412. this.setState({ organizationSearch: e });
  3413. }}
  3414. >
  3415. {departmentArr.map(function(item) {
  3416. return (
  3417. <Select.Option key={item.id}>
  3418. {item.name}
  3419. </Select.Option>
  3420. );
  3421. })}
  3422. </Select>
  3423. </FormItem>
  3424. </div>
  3425. ) : (
  3426. <div className="clearfix">
  3427. <FormItem
  3428. className="half-item"
  3429. {...formItemLayout}
  3430. label="特批立项"
  3431. >
  3432. <span>
  3433. {getApprovedState(this.state.approval)}
  3434. </span>
  3435. </FormItem>
  3436. <FormItem
  3437. className="half-item"
  3438. {...formItemLayout}
  3439. label="合同签订时间"
  3440. >
  3441. <span>{this.state.signDate}</span>
  3442. </FormItem>
  3443. <FormItem
  3444. className="half-item"
  3445. {...formItemLayout}
  3446. label="订单部门"
  3447. >
  3448. <span>{this.state.depName}</span>
  3449. </FormItem>
  3450. <FormItem
  3451. className="half-item"
  3452. {...formItemLayout}
  3453. label="是否外包"
  3454. >
  3455. <span>
  3456. {this.state.outsource == 0 ? "否" : "是"}
  3457. </span>
  3458. </FormItem>
  3459. </div>
  3460. )}
  3461. </div>
  3462. <h3
  3463. style={{
  3464. marginLeft: 10,
  3465. fontWeight: 800,
  3466. marginBottom: 10
  3467. }}
  3468. >
  3469. 收款项目
  3470. </h3>
  3471. {this.state.processStatus === 0 ? (
  3472. <div className="clearfix">
  3473. <FormItem
  3474. className="half-item"
  3475. {...formItemLayout}
  3476. label="签单金额(万元)"
  3477. >
  3478. <Input
  3479. placeholder="签单金额"
  3480. ref="signTotalAmount"
  3481. value={this.state.totalAmount}
  3482. onChange={e => {
  3483. this.setState({
  3484. totalAmount: e.target.value
  3485. });
  3486. }}
  3487. style={{ width: "240px" }}
  3488. />
  3489. {/* <span className="mandatory">*</span> */}
  3490. </FormItem>
  3491. <FormItem
  3492. className="half-item"
  3493. {...formItemLayout}
  3494. label="首付金额(万元)"
  3495. >
  3496. <Input
  3497. placeholder="请输入实签首款金额"
  3498. ref="signFirstPayment"
  3499. value={this.state.firstAmount}
  3500. onChange={e => {
  3501. this.setState({
  3502. firstAmount: e.target.value
  3503. });
  3504. }}
  3505. style={{ width: "240px" }}
  3506. />
  3507. {/* <span className="mandatory">*</span> */}
  3508. </FormItem>
  3509. <FormItem
  3510. className="half-item"
  3511. {...formItemLayout}
  3512. label="已收款项"
  3513. >
  3514. <span>
  3515. {this.state.settlementAmount + "万元"}
  3516. </span>
  3517. {/* {this.state.settlementAmount ? (
  3518. <Button
  3519. type="primary"
  3520. onClick={this.tuikuan}
  3521. style={{
  3522. float: "right",
  3523. marginRight: "50px",
  3524. marginBottom: "15px"
  3525. }}
  3526. >
  3527. 退单
  3528. </Button>
  3529. ) : (
  3530. ""
  3531. )} */}
  3532. </FormItem>
  3533. </div>
  3534. ) : (
  3535. <div className="clearfix">
  3536. <FormItem
  3537. className="half-item"
  3538. {...formItemLayout}
  3539. label="签单金额(万元)"
  3540. >
  3541. <span>{this.state.totalAmount}</span>
  3542. </FormItem>
  3543. <FormItem
  3544. className="half-item"
  3545. {...formItemLayout}
  3546. label="首付金额(万元)"
  3547. >
  3548. <span>{this.state.firstAmount}</span>
  3549. </FormItem>
  3550. <FormItem
  3551. className="half-item"
  3552. {...formItemLayout}
  3553. label="已收款项"
  3554. >
  3555. <span>
  3556. {this.state.settlementAmount + "万元"}
  3557. </span>
  3558. {/* {this.state.settlementAmount ? (
  3559. <Button
  3560. type="primary"
  3561. onClick={this.tuikuan}
  3562. style={{
  3563. float: "right",
  3564. marginRight: "50px",
  3565. marginBottom: "15px"
  3566. }}
  3567. >
  3568. 退单
  3569. </Button>
  3570. ) : (
  3571. ""
  3572. )} */}
  3573. </FormItem>
  3574. </div>
  3575. )}
  3576. <h3
  3577. style={{
  3578. marginLeft: 10,
  3579. fontWeight: 800,
  3580. marginBottom: 10
  3581. }}
  3582. >
  3583. 联系信息
  3584. </h3>
  3585. {this.state.processStatus == 0 ? (
  3586. <div className="clearfix">
  3587. <div className="clearfix">
  3588. <FormItem
  3589. className="half-item"
  3590. {...formItemLayout}
  3591. label="客户名称"
  3592. >
  3593. <span>{this.state.userName}</span>
  3594. </FormItem>
  3595. </div>
  3596. <FormItem
  3597. className="half-item"
  3598. {...formItemLayout}
  3599. label="企业联系人"
  3600. >
  3601. <Input
  3602. placeholder="请输入联系人"
  3603. ref="signTotalAmount"
  3604. value={this.state.contacts}
  3605. onChange={e => {
  3606. this.setState({ contacts: e.target.value });
  3607. }}
  3608. style={{ width: "240px" }}
  3609. />
  3610. </FormItem>
  3611. <FormItem
  3612. className="half-item"
  3613. {...formItemLayout}
  3614. label="联系人电话"
  3615. >
  3616. <Input
  3617. placeholder="请输入联系人电话"
  3618. ref="signTotalAmount"
  3619. value={this.state.contactMobile}
  3620. onChange={e => {
  3621. this.setState({
  3622. contactMobile: e.target.value
  3623. });
  3624. }}
  3625. style={{ width: "240px" }}
  3626. />
  3627. </FormItem>
  3628. <FormItem
  3629. className="half-item"
  3630. {...formItemLayout}
  3631. label="企业法人"
  3632. >
  3633. <Input
  3634. placeholder="请输入法人"
  3635. ref="signTotalAmount"
  3636. value={this.state.legalPerson}
  3637. onChange={e => {
  3638. this.setState({
  3639. legalPerson: e.target.value
  3640. });
  3641. }}
  3642. style={{ width: "240px" }}
  3643. />
  3644. </FormItem>
  3645. <FormItem
  3646. className="half-item"
  3647. {...formItemLayout}
  3648. label="法人电话"
  3649. >
  3650. <Input
  3651. placeholder="请输入法人电话"
  3652. ref="signTotalAmount"
  3653. value={this.state.legalPersonTel}
  3654. onChange={e => {
  3655. this.setState({
  3656. legalPersonTel: e.target.value
  3657. });
  3658. }}
  3659. style={{ width: "240px" }}
  3660. />
  3661. </FormItem>
  3662. </div>
  3663. ) : (
  3664. <div className="clearfix">
  3665. {formItemList.map((data, index) => {
  3666. return (
  3667. <FormItem
  3668. className="half-item"
  3669. {...formItemLayout}
  3670. key={index}
  3671. label={data.label}
  3672. >
  3673. {data.content}
  3674. </FormItem>
  3675. );
  3676. })}
  3677. </div>
  3678. )}
  3679. <div className="clearfix">
  3680. {this.state.processStatus == 0 ? (
  3681. <FormItem
  3682. labelCol={{ span: 4 }}
  3683. wrapperCol={{ span: 18 }}
  3684. label={
  3685. <span>
  3686. <strong style={{ color: "#f00" }}>*</strong>
  3687. 合同扫描件
  3688. </span>
  3689. }
  3690. >
  3691. <PicturesWall
  3692. fileList={this.getOrgCodeUrl}
  3693. pictureUrl={this.state.orgCodeUrl}
  3694. url="/api/admin/order/uploadOrderImg"
  3695. sign=""
  3696. />
  3697. <p>图片建议:要清晰。</p>
  3698. <Button
  3699. style={{
  3700. float: "right",
  3701. marginRight: "140px",
  3702. marginTop: "20px"
  3703. }}
  3704. onClick={this.getOrderLog}
  3705. >
  3706. 查看订单日志
  3707. </Button>
  3708. </FormItem>
  3709. ) : (
  3710. <FormItem
  3711. labelCol={{ span: 4 }}
  3712. wrapperCol={{ span: 18 }}
  3713. label="合同扫描件"
  3714. >
  3715. <Upload
  3716. className="demandDetailShow-upload"
  3717. listType="picture-card"
  3718. fileList={this.state.orgCodeUrl}
  3719. onPreview={file => {
  3720. this.setState({
  3721. previewImage: file.url || file.thumbUrl,
  3722. previewVisible: true
  3723. });
  3724. }}
  3725. ></Upload>
  3726. <Modal
  3727. maskClosable={false}
  3728. footer={null}
  3729. visible={this.state.previewVisible}
  3730. onCancel={() => {
  3731. this.setState({ previewVisible: false });
  3732. }}
  3733. >
  3734. <img
  3735. alt=""
  3736. style={{ width: "100%" }}
  3737. src={this.state.previewImage || ""}
  3738. />
  3739. </Modal>
  3740. <Button
  3741. style={{
  3742. float: "right",
  3743. marginRight: "140px",
  3744. marginTop: "20px"
  3745. }}
  3746. onClick={this.getOrderLog}
  3747. >
  3748. 查看订单日志
  3749. </Button>
  3750. </FormItem>
  3751. )}
  3752. </div>
  3753. <div className="clearfix">
  3754. {this.state.processStatus == 0 ? (
  3755. <div className="clearfix">
  3756. <FormItem
  3757. labelCol={{ span: 4 }}
  3758. wrapperCol={{ span: 16 }}
  3759. label="订单留言"
  3760. >
  3761. <Input
  3762. type="textarea"
  3763. placeholder="请输入订单留言"
  3764. rows={4}
  3765. value={this.state.orderRemarks}
  3766. onChange={e => {
  3767. this.setState({
  3768. orderRemarks: e.target.value
  3769. });
  3770. }}
  3771. style={{ width: "95%" }}
  3772. />
  3773. <span className="mandatory">*</span>
  3774. </FormItem>
  3775. </div>
  3776. ) : (
  3777. <FormItem
  3778. labelCol={{ span: 4 }}
  3779. wrapperCol={{ span: 16 }}
  3780. label="订单留言"
  3781. >
  3782. <p
  3783. style={{ width: 500, wordWrap: "break-word" }}
  3784. >
  3785. {this.state.orderRemarks}
  3786. </p>
  3787. </FormItem>
  3788. )}
  3789. </div>
  3790. <div className="clearfix">
  3791. <FormItem
  3792. className="half-item"
  3793. {...formItemLayout}
  3794. label="订单负责人"
  3795. >
  3796. <span>{this.state.salesmanName}</span>
  3797. </FormItem>
  3798. <FormItem
  3799. className="half-item"
  3800. {...formItemLayout}
  3801. label="订单负责人电话"
  3802. >
  3803. <span>{this.state.salesmanMobile}</span>
  3804. </FormItem>
  3805. </div>
  3806. <div className="clearfix">
  3807. <FormItem
  3808. className="half-item"
  3809. {...formItemLayout}
  3810. label="当前财务负责人"
  3811. >
  3812. <span>{this.state.nowFinance}</span>
  3813. </FormItem>
  3814. <FormItem
  3815. className="half-item"
  3816. {...formItemLayout}
  3817. label="当前财务负责人电话"
  3818. >
  3819. <span>{this.state.nowFinanceMobile}</span>
  3820. </FormItem>
  3821. </div>
  3822. <div className="clearfix">
  3823. <FormItem
  3824. className="half-item"
  3825. {...formItemLayout}
  3826. style={{ opacity: ".5" }}
  3827. label="原订单负责人"
  3828. >
  3829. <span>{this.state.oldSalesmanName}</span>
  3830. </FormItem>
  3831. <FormItem
  3832. className="half-item"
  3833. {...formItemLayout}
  3834. style={{ opacity: ".5" }}
  3835. label="原订单负责人电话"
  3836. >
  3837. <span>{this.state.oldSalesmanMobile}</span>
  3838. </FormItem>
  3839. </div>
  3840. <div className="clearfix">
  3841. <FormItem
  3842. className="half-item"
  3843. style={{ opacity: ".5" }}
  3844. {...formItemLayout}
  3845. label="实际财务操作人"
  3846. >
  3847. <span>{this.state.financeName}</span>
  3848. </FormItem>
  3849. <FormItem
  3850. className="half-item"
  3851. {...formItemLayout}
  3852. style={{ opacity: ".5" }}
  3853. label="实际财务操作人电话"
  3854. >
  3855. <span>{this.state.financeMobile}</span>
  3856. </FormItem>
  3857. </div>
  3858. <div>
  3859. <span
  3860. style={{ marginLeft: "50px", fontSize: "20px" }}
  3861. >
  3862. 项目业务
  3863. </span>
  3864. {this.state.processStatus == 0 ? (
  3865. <Button
  3866. type="primary"
  3867. onClick={this.addDetailed}
  3868. style={{
  3869. float: "right",
  3870. marginRight: "50px",
  3871. marginBottom: "15px"
  3872. }}
  3873. >
  3874. 添加项目明细
  3875. </Button>
  3876. ) : (
  3877. ""
  3878. )}
  3879. </div>
  3880. <div
  3881. className="patent-table"
  3882. style={{ marginBottom: 10 }}
  3883. >
  3884. <Spin spinning={this.state.loading}>
  3885. <Table
  3886. columns={this.state.columns}
  3887. dataSource={this.state.dataSource}
  3888. pagination={this.state.pagination}
  3889. onRowClick={this.tableRowClick}
  3890. bordered
  3891. size="small"
  3892. />
  3893. </Spin>
  3894. </div>
  3895. <div
  3896. style={{
  3897. display: cuiDataList.length ? "block" : "none"
  3898. }}
  3899. >
  3900. <span
  3901. style={{ marginLeft: "50px", fontSize: "20px" }}
  3902. >
  3903. 旧催款节点
  3904. </span>
  3905. <Button
  3906. type="primary"
  3907. // onClick={this.addcontact}
  3908. disabled
  3909. onClick={e => {
  3910. cuiDataList.length
  3911. ? this.addcontact()
  3912. : this.addcontactNew();
  3913. }}
  3914. style={{
  3915. float: "right",
  3916. marginRight: "50px",
  3917. marginBottom: "15px",
  3918. display:
  3919. this.state.processStatus == 0
  3920. ? "block"
  3921. : "none"
  3922. }}
  3923. >
  3924. 添加催款节点
  3925. </Button>
  3926. </div>
  3927. <div
  3928. className="clearfix"
  3929. style={{
  3930. display: cuiDataList.length ? "block" : "none"
  3931. }}
  3932. >
  3933. <Spin spinning={this.state.loading}>
  3934. <Form layout="horizontal">
  3935. <Table
  3936. pagination={false}
  3937. columns={this.state.ContactsLists}
  3938. dataSource={this.state.contactList}
  3939. scroll={{ x: "max-content", y: 0 }}
  3940. bordered
  3941. size="small"
  3942. />
  3943. <Col
  3944. span={24}
  3945. offset={9}
  3946. style={{ marginTop: "15px" }}
  3947. ></Col>
  3948. </Form>
  3949. </Spin>
  3950. </div>
  3951. <div
  3952. style={{
  3953. display: cuiDataList.length ? "none" : "block"
  3954. }}
  3955. >
  3956. <span
  3957. style={{
  3958. marginLeft: "50px",
  3959. fontSize: "20px"
  3960. }}
  3961. >
  3962. 新催款节点
  3963. </span>
  3964. <span
  3965. style={{
  3966. display: "inline-block",
  3967. marginLeft: 10,
  3968. color: "red"
  3969. }}
  3970. >
  3971. 金额总计(万元): {this.state.totalCui}
  3972. </span>
  3973. <Button
  3974. type="primary"
  3975. disabled={this.state.addFlag ? true : false}
  3976. // onClick={this.addcontact}
  3977. onClick={e => {
  3978. this.setState({ addFlag: true });
  3979. this.addcontactNew();
  3980. }}
  3981. style={{
  3982. float: "right",
  3983. marginRight: "50px",
  3984. marginBottom: "15px",
  3985. display:
  3986. this.state.processStatus == 0
  3987. ? "block"
  3988. : "none"
  3989. }}
  3990. >
  3991. 添加催款节点
  3992. </Button>
  3993. </div>
  3994. <div
  3995. className="clearfix"
  3996. style={{
  3997. display: cuiDataList.length ? "none" : "block"
  3998. }}
  3999. >
  4000. <Spin spinning={this.state.loading}>
  4001. <Form layout="horizontal">
  4002. <Table
  4003. pagination={false}
  4004. columns={this.state.ContactsListsNew}
  4005. dataSource={this.state.contactListNew}
  4006. scroll={{ x: "max-content", y: 0 }}
  4007. bordered
  4008. size="small"
  4009. />
  4010. <Col
  4011. span={24}
  4012. offset={9}
  4013. style={{ marginTop: "15px" }}
  4014. ></Col>
  4015. </Form>
  4016. </Spin>
  4017. </div>
  4018. {this.state.processStatus == 0 ? (
  4019. <div
  4020. className="addSave"
  4021. style={{ marginTop: "15px" }}
  4022. >
  4023. <Button
  4024. className="cancel"
  4025. type="primary"
  4026. onClick={this.handleCancels}
  4027. style={{ marginLeft: "200px" }}
  4028. htmlType="submit"
  4029. >
  4030. 签单
  4031. </Button>
  4032. <Button
  4033. className="cancel"
  4034. type="primary"
  4035. onClick={this.handleCancelq}
  4036. style={{ marginLeft: "50px" }}
  4037. htmlType="submit"
  4038. >
  4039. 保存
  4040. </Button>
  4041. <Button
  4042. className="cancel"
  4043. type="ghost"
  4044. onClick={this.handleCancelclose}
  4045. style={{ marginLeft: "50px" }}
  4046. >
  4047. 取消
  4048. </Button>
  4049. </div>
  4050. ) : (
  4051. ""
  4052. )}
  4053. </div>
  4054. </TabPane>
  4055. <TabPane tab="合同变更发起" key="2">
  4056. {
  4057. <div>
  4058. <div className="clearfix">
  4059. <FormItem
  4060. className="half-item"
  4061. {...formItemLayout}
  4062. label="客户名称"
  4063. >
  4064. <span>{this.state.userName}</span>
  4065. </FormItem>
  4066. </div>
  4067. <div className="clearfix">
  4068. <FormItem
  4069. className="half-item"
  4070. {...formItemLayout}
  4071. label="合同编号"
  4072. >
  4073. <span>{this.state.contractNo}</span>
  4074. </FormItem>
  4075. </div>
  4076. <div className="clearfix">
  4077. <FormItem
  4078. className="half-item"
  4079. {...formItemLayout}
  4080. label="申请变更部门"
  4081. >
  4082. {/* {!this.state.mark ? ( */}
  4083. <span>{this.state.depName}</span>
  4084. {/* ) : (
  4085. <span>{contractData.depName}</span>
  4086. )} */}
  4087. </FormItem>
  4088. <FormItem
  4089. className="half-item"
  4090. {...formItemLayout}
  4091. label="申请人"
  4092. >
  4093. <span>{this.state.salesmanName}</span>
  4094. </FormItem>
  4095. </div>
  4096. <div className="clearfix">
  4097. <FormItem
  4098. labelCol={{ span: 4 }}
  4099. wrapperCol={{ span: 18 }}
  4100. label="变更类型"
  4101. >
  4102. {/* {!this.state.mark ? ( */}
  4103. <Select
  4104. placeholder="选择合同变更类型"
  4105. style={{ width: 200 }}
  4106. disabled={this.state.changeFlag}
  4107. value={this.state.typeChange}
  4108. onChange={e => {
  4109. this.setState({
  4110. typeChange: e,
  4111. changeFlag: true
  4112. });
  4113. if (e == 1) {
  4114. this.setState({
  4115. hetongFlag: false,
  4116. listFlag: false,
  4117. listCuiFlag: false,
  4118. tuiKuanFlag: false
  4119. });
  4120. } else if (e == 2) {
  4121. this.setState({
  4122. hetongFlag: true,
  4123. listFlag: false,
  4124. listCuiFlag: false,
  4125. tuiKuanFlag: true
  4126. });
  4127. } else if (e == 3) {
  4128. this.setState({
  4129. listFlag: false,
  4130. hetongFlag: false,
  4131. listCuiFlag: false,
  4132. tuiKuanFlag: false
  4133. });
  4134. } else if (e == 4) {
  4135. this.setState({
  4136. listFlag: false,
  4137. listCuiFlag: false,
  4138. hetongFlag: false,
  4139. tuiKuanFlag: true
  4140. });
  4141. } else if (e == 5) {
  4142. this.setState({
  4143. listFlag: false,
  4144. listCuiFlag: false,
  4145. hetongFlag: true,
  4146. tuiKuanFlag: true
  4147. });
  4148. } else {
  4149. this.setState({
  4150. listFlag: true,
  4151. hetongFlag: true,
  4152. listCuiFlag: true,
  4153. tuiKuanFlag: false
  4154. });
  4155. }
  4156. }}
  4157. value={this.state.typeChange}
  4158. >
  4159. <Option value={0}>退单退款</Option>
  4160. <Option value={1}>项目及金额变更</Option>
  4161. <Option value={2}>仅项目变更</Option>
  4162. <Option value={3}>仅金额变更</Option>
  4163. <Option value={4}>重报</Option>
  4164. <Option value={5}>赠送</Option>
  4165. </Select>
  4166. <Button
  4167. onClick={e => {
  4168. this.setState({
  4169. listFlag: false,
  4170. hetongFlag: false,
  4171. listCuiFlag: false,
  4172. tuiKuanFlag: false,
  4173. startRemarks: "",
  4174. remarksC: "",
  4175. voucherUrl: [],
  4176. changeAmount: "0",
  4177. applicant: undefined,
  4178. depNameChange: undefined,
  4179. typeChange: [],
  4180. changeFlag: false
  4181. });
  4182. }}
  4183. >
  4184. 重置
  4185. </Button>
  4186. </FormItem>
  4187. </div>
  4188. <div className="clearfix">
  4189. <FormItem
  4190. labelCol={{ span: 4 }}
  4191. wrapperCol={{ span: 18 }}
  4192. label="合同额(万元)"
  4193. >
  4194. {/* {!this.state.mark ? ( */}
  4195. <Input
  4196. placeholder="请输入合同额"
  4197. disabled={this.state.hetongFlag}
  4198. ref="signTotalAmount"
  4199. value={this.state.totalAmount}
  4200. onChange={e => {
  4201. this.setState({
  4202. totalAmount: e.target.value
  4203. });
  4204. }}
  4205. style={{ width: "240px" }}
  4206. />
  4207. {/* ) : (
  4208. <span>{contractData.totalAmount}</span>
  4209. )} */}
  4210. </FormItem>
  4211. <FormItem
  4212. labelCol={{ span: 4 }}
  4213. wrapperCol={{ span: 18 }}
  4214. label="已收款(万元)"
  4215. >
  4216. <span>{this.state.settlementAmount}</span>
  4217. </FormItem>
  4218. <FormItem
  4219. labelCol={{ span: 4 }}
  4220. wrapperCol={{ span: 18 }}
  4221. label="申请退款(万元)"
  4222. >
  4223. {/* {!this.state.mark ? ( */}
  4224. <Input
  4225. placeholder="请输入申请退款"
  4226. ref="signTotalAmount"
  4227. disabled={this.state.tuiKuanFlag}
  4228. value={this.state.changeAmount}
  4229. onChange={e => {
  4230. this.setState({
  4231. changeAmount: e.target.value
  4232. });
  4233. }}
  4234. style={{ width: "240px" }}
  4235. />
  4236. {/* ) : (
  4237. <span>{contractData.changeAmount}</span>
  4238. )} */}
  4239. </FormItem>
  4240. </div>
  4241. {/* 动态展示项目以及催款节点 */}
  4242. <div
  4243. style={{
  4244. display: this.state.isCaoGao ? "block" : "none"
  4245. }}
  4246. >
  4247. <div>
  4248. <span
  4249. style={{
  4250. marginLeft: "50px",
  4251. fontSize: "20px"
  4252. }}
  4253. >
  4254. 项目业务
  4255. </span>
  4256. <Button
  4257. type="primary"
  4258. onClick={this.changeAddPro}
  4259. disabled={this.state.listFlag}
  4260. style={{
  4261. float: "right",
  4262. marginRight: "50px",
  4263. marginBottom: "15px"
  4264. }}
  4265. >
  4266. 添加项目明细
  4267. </Button>
  4268. </div>
  4269. <div
  4270. className="patent-table"
  4271. style={{ marginBottom: 10 }}
  4272. >
  4273. <Spin spinning={this.state.loading}>
  4274. <Table
  4275. columns={this.state.proColumns}
  4276. dataSource={this.state.proDataSource}
  4277. pagination={this.state.pagination}
  4278. onRowDoubleClick={
  4279. this.listFlag ? "" : this.editPro
  4280. }
  4281. bordered
  4282. size="small"
  4283. />
  4284. </Spin>
  4285. </div>
  4286. <div>
  4287. <span
  4288. style={{
  4289. marginLeft: "50px",
  4290. fontSize: "20px"
  4291. }}
  4292. >
  4293. 催款节点
  4294. </span>
  4295. {/* <span
  4296. style={{
  4297. display: "inline-block",
  4298. marginLeft: 10,
  4299. color: "red"
  4300. }}
  4301. >
  4302. 金额总计(万元): {this.state.totalCui}
  4303. </span> */}
  4304. <Button
  4305. type="primary"
  4306. onClick={e => {
  4307. this.changeAddCui();
  4308. }}
  4309. disabled={this.state.listCuiFlag}
  4310. style={{
  4311. float: "right",
  4312. marginRight: "50px",
  4313. marginBottom: "15px"
  4314. }}
  4315. >
  4316. 添加催款节点
  4317. </Button>
  4318. </div>
  4319. <div className="clearfix">
  4320. <Spin spinning={this.state.loading}>
  4321. <Form layout="horizontal">
  4322. <Table
  4323. pagination={false}
  4324. columns={this.state.changeCuiList}
  4325. dataSource={this.state.cuiDataSource}
  4326. scroll={{ x: "max-content", y: 0 }}
  4327. onRowDoubleClick={
  4328. this.listCuiFlag ? "" : this.editCui
  4329. }
  4330. bordered
  4331. size="small"
  4332. />
  4333. <Col
  4334. span={24}
  4335. offset={9}
  4336. style={{ marginTop: "15px" }}
  4337. ></Col>
  4338. </Form>
  4339. </Spin>
  4340. </div>
  4341. </div>
  4342. <div className="clearfix">
  4343. <FormItem
  4344. style={{ height: "auto" }}
  4345. labelCol={{ span: 4 }}
  4346. wrapperCol={{ span: 18 }}
  4347. label="变更原因"
  4348. >
  4349. {/* {!this.state.mark ? ( */}
  4350. <TextArea
  4351. rows={4}
  4352. placeholder="请输入变更原因"
  4353. ref="signTotalAmount"
  4354. style={{ width: "95%" }}
  4355. value={this.state.remarksC}
  4356. onChange={e => {
  4357. this.setState({
  4358. remarksC: e.target.value
  4359. });
  4360. }}
  4361. />
  4362. {/* ) : (
  4363. <span>{contractData.remarks}</span>
  4364. )} */}
  4365. </FormItem>
  4366. </div>
  4367. <div className="clearfix">
  4368. <FormItem
  4369. style={{ height: "auto" }}
  4370. labelCol={{ span: 4 }}
  4371. wrapperCol={{ span: 18 }}
  4372. label="备注"
  4373. >
  4374. {/* {!this.state.mark ? ( */}
  4375. <TextArea
  4376. rows={4}
  4377. placeholder="请输入备注"
  4378. ref="signTotalAmount"
  4379. style={{ width: "95%" }}
  4380. value={this.state.startRemarks}
  4381. onChange={e => {
  4382. this.setState({
  4383. startRemarks: e.target.value
  4384. });
  4385. }}
  4386. />
  4387. {/* ) : (
  4388. <span>{contractData.startRemarks}</span>
  4389. )} */}
  4390. </FormItem>
  4391. </div>
  4392. {/* ---- */}
  4393. <div className="clearfix">
  4394. <FormItem
  4395. labelCol={{ span: 4 }}
  4396. wrapperCol={{ span: 18 }}
  4397. label="变更凭证"
  4398. >
  4399. {/* {!this.state.mark ? ( */}
  4400. <PicturesWall
  4401. fileList={this.getVoucherUrl}
  4402. pictureUrl={this.state.voucherUrl}
  4403. url="/api/admin/orderChange/uploadFile"
  4404. sign="order_change_file"
  4405. />
  4406. {/* ) : (
  4407. <div>
  4408. <Upload
  4409. className="demandDetailShow-upload"
  4410. listType="picture-card"
  4411. fileList={this.state.voucherUrl}
  4412. onPreview={file => {
  4413. this.setState({
  4414. previewImage:
  4415. file.url || file.thumbUrl,
  4416. previewVisible: true
  4417. });
  4418. }}
  4419. />
  4420. <Modal
  4421. maskClosable={false}
  4422. footer={null}
  4423. visible={this.state.previewVisible}
  4424. onCancel={() => {
  4425. this.setState({
  4426. previewVisible: false
  4427. });
  4428. }}
  4429. >
  4430. <img
  4431. alt=""
  4432. style={{ width: "100%" }}
  4433. src={this.state.previewImage || ""}
  4434. />
  4435. </Modal>
  4436. </div>
  4437. )} */}
  4438. <p>图片建议:要清晰。</p>
  4439. </FormItem>
  4440. </div>
  4441. {/* {!this.state.mark ? ( */}
  4442. <div className="clearfix">
  4443. <Button
  4444. type="primary"
  4445. style={{ float: "right", marginRight: 40 }}
  4446. // onClick={this.changeApply}
  4447. onClick={e => {
  4448. if (this.state.isCaoGao) {
  4449. this.submitChange();
  4450. } else {
  4451. this.changeApply();
  4452. }
  4453. }}
  4454. >
  4455. {this.state.isCaoGao
  4456. ? "发起变更申请"
  4457. : this.state.typeChange == 0
  4458. ? "发起变更申请"
  4459. : "下一步"}
  4460. </Button>
  4461. </div>
  4462. {/* ) : (
  4463. ""
  4464. )} */}
  4465. </div>
  4466. }
  4467. </TabPane>
  4468. {this.state.isJilu ? (
  4469. <TabPane tab={"最近变更记录"} key="3">
  4470. <div>
  4471. <div className="clearfix">
  4472. <FormItem
  4473. className="half-item"
  4474. {...formItemLayout}
  4475. label="客户名称"
  4476. >
  4477. <span>{this.state.userName}</span>
  4478. </FormItem>
  4479. </div>
  4480. <div className="clearfix">
  4481. <FormItem
  4482. className="half-item"
  4483. {...formItemLayout}
  4484. label="合同编号"
  4485. >
  4486. <span>{this.state.contractNo}</span>
  4487. </FormItem>
  4488. </div>
  4489. <div className="clearfix">
  4490. <FormItem
  4491. className="half-item"
  4492. {...formItemLayout}
  4493. label="申请变更部门"
  4494. >
  4495. <span>{this.state.depName}</span>
  4496. </FormItem>
  4497. <FormItem
  4498. className="half-item"
  4499. {...formItemLayout}
  4500. label="申请人"
  4501. >
  4502. <span>{this.state.salesmanName}</span>
  4503. </FormItem>
  4504. </div>
  4505. <div className="clearfix">
  4506. <FormItem
  4507. labelCol={{ span: 4 }}
  4508. wrapperCol={{ span: 18 }}
  4509. label="变更类型"
  4510. >
  4511. <span>
  4512. {getChangeType(
  4513. this.state.detailChange.typeChange
  4514. )}
  4515. </span>
  4516. </FormItem>
  4517. </div>
  4518. <div className="clearfix">
  4519. <FormItem
  4520. labelCol={{ span: 4 }}
  4521. wrapperCol={{ span: 18 }}
  4522. label="合同额(万元)"
  4523. >
  4524. <span>
  4525. {this.state.detailChange.totalAmount}
  4526. </span>
  4527. </FormItem>
  4528. <FormItem
  4529. labelCol={{ span: 4 }}
  4530. wrapperCol={{ span: 18 }}
  4531. label="已收款(万元)"
  4532. >
  4533. <span>
  4534. {this.state.detailChange.settlementAmount}
  4535. </span>
  4536. </FormItem>
  4537. <FormItem
  4538. labelCol={{ span: 4 }}
  4539. wrapperCol={{ span: 18 }}
  4540. label="申请退款(万元)"
  4541. >
  4542. <span>
  4543. {this.state.detailChange.changeAmount}
  4544. </span>
  4545. </FormItem>
  4546. </div>
  4547. {/* 动态展示项目以及催款节点 */}
  4548. <div>
  4549. <div>
  4550. <span
  4551. style={{
  4552. marginLeft: "50px",
  4553. fontSize: "20px"
  4554. }}
  4555. >
  4556. 项目业务
  4557. </span>
  4558. </div>
  4559. <div
  4560. className="patent-table"
  4561. style={{ marginBottom: 10 }}
  4562. >
  4563. <Spin spinning={this.state.loading}>
  4564. <Table
  4565. columns={this.state.proColumns}
  4566. dataSource={this.state.proDataSource}
  4567. pagination={this.state.pagination}
  4568. // onRowClick={this.tableRowClick}
  4569. bordered
  4570. size="small"
  4571. />
  4572. </Spin>
  4573. </div>
  4574. <div>
  4575. <span
  4576. style={{
  4577. marginLeft: "50px",
  4578. fontSize: "20px"
  4579. }}
  4580. >
  4581. 催款节点
  4582. </span>
  4583. {/* <span
  4584. style={{
  4585. display: "inline-block",
  4586. marginLeft: 10,
  4587. color: "red"
  4588. }}
  4589. >
  4590. 金额总计(万元): {this.state.totalCui}
  4591. </span> */}
  4592. </div>
  4593. <div className="clearfix">
  4594. <Spin spinning={this.state.loading}>
  4595. <Form layout="horizontal">
  4596. <Table
  4597. pagination={false}
  4598. columns={this.state.changeCuiList}
  4599. dataSource={this.state.cuiDataSource}
  4600. scroll={{ x: "max-content", y: 0 }}
  4601. bordered
  4602. size="small"
  4603. />
  4604. <Col
  4605. span={24}
  4606. offset={9}
  4607. style={{ marginTop: "15px" }}
  4608. ></Col>
  4609. </Form>
  4610. </Spin>
  4611. </div>
  4612. </div>
  4613. <div className="clearfix">
  4614. <FormItem
  4615. style={{ height: "auto" }}
  4616. labelCol={{ span: 4 }}
  4617. wrapperCol={{ span: 18 }}
  4618. label="变更原因"
  4619. >
  4620. <span>{this.state.detailChange.remarksC}</span>
  4621. </FormItem>
  4622. </div>
  4623. <div className="clearfix">
  4624. <FormItem
  4625. style={{ height: "auto" }}
  4626. labelCol={{ span: 4 }}
  4627. wrapperCol={{ span: 18 }}
  4628. label="备注"
  4629. >
  4630. <span>
  4631. {this.state.detailChange.startRemarks}
  4632. </span>
  4633. </FormItem>
  4634. </div>
  4635. {/* ---- */}
  4636. <div className="clearfix">
  4637. <FormItem
  4638. labelCol={{ span: 4 }}
  4639. wrapperCol={{ span: 18 }}
  4640. label="变更凭证"
  4641. >
  4642. <div>
  4643. <Upload
  4644. className="demandDetailShow-upload"
  4645. listType="picture-card"
  4646. fileList={
  4647. this.state.detailChange.voucherUrl
  4648. }
  4649. onPreview={file => {
  4650. this.setState({
  4651. previewImage: file.url || file.thumbUrl,
  4652. previewVisible: true
  4653. });
  4654. }}
  4655. />
  4656. <Modal
  4657. maskClosable={false}
  4658. footer={null}
  4659. visible={this.state.previewVisible}
  4660. onCancel={() => {
  4661. this.setState({
  4662. previewVisible: false
  4663. });
  4664. }}
  4665. >
  4666. <img
  4667. alt=""
  4668. style={{ width: "100%" }}
  4669. src={this.state.previewImage || ""}
  4670. />
  4671. </Modal>
  4672. </div>
  4673. </FormItem>
  4674. </div>
  4675. </div>
  4676. </TabPane>
  4677. ) : (
  4678. ""
  4679. )}
  4680. </Tabs>
  4681. )}
  4682. </div>
  4683. </Spin>
  4684. </Form>
  4685. </Modal>
  4686. <Modal
  4687. maskClosable={false}
  4688. visible={this.state.addnextVisible}
  4689. onOk={this.nextCancel}
  4690. onCancel={this.nextCancel}
  4691. width="800px"
  4692. title={this.state.addState ? "添加项目任务" : "项目任务详情"}
  4693. footer=""
  4694. className="admin-desc-content"
  4695. >
  4696. <Form
  4697. layout="horizontal"
  4698. onSubmit={this.nextSubmit}
  4699. // id="demand-form"
  4700. >
  4701. <Spin spinning={this.state.loading}>
  4702. {this.state.addState ? (
  4703. <div className="clearfix">
  4704. <FormItem
  4705. className="half-item"
  4706. {...formItemLayout}
  4707. label="服务名称"
  4708. >
  4709. <AutoComplete
  4710. className="certain-category-search"
  4711. dropdownClassName="certain-category-search-dropdown"
  4712. dropdownMatchSelectWidth={false}
  4713. dropdownStyle={{ width: 200 }}
  4714. style={{ width: "200px" }}
  4715. dataSource={options}
  4716. placeholder="输入服务名称"
  4717. value={this.state.commodityName}
  4718. onChange={this.httpChange}
  4719. filterOption={true}
  4720. onSelect={this.selectAuto}
  4721. >
  4722. <Input />
  4723. </AutoComplete>
  4724. <span className="mandatory">*</span>
  4725. </FormItem>
  4726. <FormItem
  4727. className="half-item"
  4728. {...formItemLayout}
  4729. label="服务数量"
  4730. >
  4731. <Input
  4732. placeholder="请输入服务数量"
  4733. value={this.state.commodityQuantity}
  4734. style={{ width: "200px" }}
  4735. onChange={e => {
  4736. this.setState({ commodityQuantity: e.target.value });
  4737. }}
  4738. ref="commodityQuantity"
  4739. />
  4740. <span className="mandatory">*</span>
  4741. </FormItem>
  4742. <FormItem
  4743. className="half-item"
  4744. {...formItemLayout}
  4745. label="实签价格(万元)"
  4746. >
  4747. <Input
  4748. placeholder="请输入实签价格"
  4749. value={this.state.commodityPrice}
  4750. style={{ width: "200px" }}
  4751. onChange={e => {
  4752. this.setState({ commodityPrice: e.target.value });
  4753. }}
  4754. ref="commodityPrice"
  4755. />
  4756. <span className="mandatory">*</span>
  4757. </FormItem>
  4758. <FormItem
  4759. className="half-item"
  4760. {...formItemLayout}
  4761. label="主要业务"
  4762. >
  4763. <Select
  4764. placeholder="选择是否为主要业务"
  4765. style={{ width: "200px" }}
  4766. value={this.state.main}
  4767. onChange={e => {
  4768. this.setState({ main: e });
  4769. }}
  4770. >
  4771. {boutique.map(function(item) {
  4772. return (
  4773. <Select.Option key={item.value}>
  4774. {item.key}
  4775. </Select.Option>
  4776. );
  4777. })}
  4778. </Select>
  4779. <span className="mandatory">*</span>
  4780. </FormItem>
  4781. <div className="clearfix">
  4782. <FormItem
  4783. labelCol={{ span: 4 }}
  4784. wrapperCol={{ span: 16 }}
  4785. label="服务说明"
  4786. >
  4787. <Input
  4788. type="textarea"
  4789. placeholder="请输入服务说明"
  4790. value={this.state.taskComment}
  4791. onChange={e => {
  4792. this.setState({ taskComment: e.target.value });
  4793. }}
  4794. />
  4795. </FormItem>
  4796. </div>
  4797. <FormItem
  4798. wrapperCol={{ span: 12, offset: 4 }}
  4799. className="half-middle"
  4800. >
  4801. <Button
  4802. className="submitSave"
  4803. type="primary"
  4804. htmlType="submit"
  4805. >
  4806. 保存
  4807. </Button>
  4808. <Button
  4809. className="submitSave"
  4810. type="ghost"
  4811. onClick={this.nextCancel}
  4812. >
  4813. 取消
  4814. </Button>
  4815. </FormItem>
  4816. </div>
  4817. ) : (
  4818. <div className="clearfix">
  4819. {this.state.processStatus == 0 ? (
  4820. <div className="clearfix">
  4821. <FormItem
  4822. className="half-item"
  4823. {...formItemLayout}
  4824. label="项目名称"
  4825. >
  4826. <span>{this.state.commodityName}</span>
  4827. </FormItem>
  4828. <FormItem
  4829. className="half-item"
  4830. {...formItemLayout}
  4831. label="项目数量"
  4832. >
  4833. <Input
  4834. placeholder="请输入数量"
  4835. value={this.state.commodityQuantity}
  4836. style={{ width: "200px" }}
  4837. onChange={e => {
  4838. this.setState({
  4839. commodityQuantity: e.target.value
  4840. });
  4841. }}
  4842. />
  4843. <span className="mandatory">*</span>
  4844. </FormItem>
  4845. <FormItem
  4846. className="half-item"
  4847. {...formItemLayout}
  4848. label="金额(万元)"
  4849. >
  4850. <Input
  4851. placeholder="请输入签单金额"
  4852. value={this.state.commodityPrice}
  4853. style={{ width: "200px" }}
  4854. onChange={e => {
  4855. this.setState({ commodityPrice: e.target.value });
  4856. }}
  4857. />
  4858. <span className="mandatory">*</span>
  4859. </FormItem>
  4860. <FormItem
  4861. className="half-item"
  4862. {...formItemLayout}
  4863. label="主要项目"
  4864. >
  4865. <Select
  4866. placeholder="选择是否为主要业务"
  4867. style={{ width: "200px" }}
  4868. value={this.state.main}
  4869. onChange={e => {
  4870. this.setState({ main: e });
  4871. }}
  4872. >
  4873. {boutique.map(function(item) {
  4874. return (
  4875. <Select.Option key={item.value}>
  4876. {item.key}
  4877. </Select.Option>
  4878. );
  4879. })}
  4880. </Select>
  4881. <span className="mandatory">*</span>
  4882. </FormItem>
  4883. <div className="clearfix">
  4884. <FormItem
  4885. labelCol={{ span: 4 }}
  4886. wrapperCol={{ span: 16 }}
  4887. label="服务说明"
  4888. >
  4889. <Input
  4890. type="textarea"
  4891. placeholder="请输入服务说明"
  4892. value={this.state.taskComment}
  4893. onChange={e => {
  4894. this.setState({ taskComment: e.target.value });
  4895. }}
  4896. />
  4897. </FormItem>
  4898. </div>
  4899. <FormItem
  4900. wrapperCol={{ span: 12, offset: 4 }}
  4901. className="half-middle"
  4902. >
  4903. <Button
  4904. className="submitSave"
  4905. type="primary"
  4906. onClick={this.tabRowSave}
  4907. >
  4908. 保存
  4909. </Button>
  4910. <Button
  4911. className="submitSave"
  4912. type="ghost"
  4913. onClick={this.nextCancel}
  4914. >
  4915. 取消
  4916. </Button>
  4917. </FormItem>
  4918. </div>
  4919. ) : (
  4920. <div className="clearfix">
  4921. <FormItem
  4922. className="half-item"
  4923. {...formItemLayout}
  4924. label="项目名称"
  4925. >
  4926. <span>{this.state.commodityName}</span>
  4927. </FormItem>
  4928. <FormItem
  4929. className="half-item"
  4930. {...formItemLayout}
  4931. label="项目数量"
  4932. >
  4933. <span>{this.state.commodityQuantity}</span>
  4934. </FormItem>
  4935. <FormItem
  4936. className="half-item"
  4937. {...formItemLayout}
  4938. label="金额(万元)"
  4939. >
  4940. <span>{this.state.commodityPrice}</span>
  4941. </FormItem>
  4942. <FormItem
  4943. className="half-item"
  4944. {...formItemLayout}
  4945. label="主要项目"
  4946. >
  4947. <span>{getboutique(this.state.main)}</span>
  4948. </FormItem>
  4949. <div className="clearfix">
  4950. <FormItem
  4951. labelCol={{ span: 4 }}
  4952. wrapperCol={{ span: 16 }}
  4953. label="服务说明"
  4954. >
  4955. <span>{this.state.taskComment}</span>
  4956. </FormItem>
  4957. </div>
  4958. </div>
  4959. )}
  4960. </div>
  4961. )}
  4962. </Spin>
  4963. </Form>
  4964. </Modal>
  4965. <Modal
  4966. maskClosable={false}
  4967. visible={this.state.changeVisible}
  4968. onOk={this.nextCancel}
  4969. onCancel={this.nextCancel}
  4970. width="800px"
  4971. title={"添加变更项目"}
  4972. footer=""
  4973. className="admin-desc-content"
  4974. >
  4975. <Form
  4976. layout="horizontal"
  4977. // id="demand-form"
  4978. >
  4979. <Spin spinning={this.state.loading}>
  4980. <div className="clearfix">
  4981. <FormItem
  4982. className="half-item"
  4983. {...formItemLayout}
  4984. label="服务名称"
  4985. >
  4986. <AutoComplete
  4987. className="certain-category-search"
  4988. dropdownClassName="certain-category-search-dropdown"
  4989. dropdownMatchSelectWidth={false}
  4990. dropdownStyle={{ width: 200 }}
  4991. style={{ width: "200px" }}
  4992. dataSource={options}
  4993. placeholder="输入服务名称"
  4994. value={this.state.commodityName}
  4995. onChange={this.httpChange}
  4996. filterOption={true}
  4997. onSelect={this.selectAuto}
  4998. >
  4999. <Input />
  5000. </AutoComplete>
  5001. <span className="mandatory">*</span>
  5002. </FormItem>
  5003. <FormItem
  5004. className="half-item"
  5005. {...formItemLayout}
  5006. label="服务数量"
  5007. >
  5008. <Input
  5009. placeholder="请输入服务数量"
  5010. value={this.state.commodityQuantity}
  5011. style={{ width: "200px" }}
  5012. onChange={e => {
  5013. this.setState({ commodityQuantity: e.target.value });
  5014. }}
  5015. ref="commodityQuantity"
  5016. />
  5017. <span className="mandatory">*</span>
  5018. </FormItem>
  5019. <FormItem
  5020. className="half-item"
  5021. {...formItemLayout}
  5022. label="实签价格(万元)"
  5023. >
  5024. <Input
  5025. placeholder="请输入实签价格"
  5026. value={this.state.commodityPrice}
  5027. style={{ width: "200px" }}
  5028. onChange={e => {
  5029. this.setState({ commodityPrice: e.target.value });
  5030. }}
  5031. ref="commodityPrice"
  5032. />
  5033. <span className="mandatory">*</span>
  5034. </FormItem>
  5035. <FormItem
  5036. className="half-item"
  5037. {...formItemLayout}
  5038. label="主要业务"
  5039. >
  5040. <Select
  5041. placeholder="选择是否为主要业务"
  5042. style={{ width: "200px" }}
  5043. value={this.state.main}
  5044. onChange={e => {
  5045. this.setState({ main: e });
  5046. }}
  5047. >
  5048. {boutique.map(function(item) {
  5049. return (
  5050. <Select.Option key={item.value}>
  5051. {item.key}
  5052. </Select.Option>
  5053. );
  5054. })}
  5055. </Select>
  5056. <span className="mandatory">*</span>
  5057. </FormItem>
  5058. <div className="clearfix">
  5059. <FormItem
  5060. labelCol={{ span: 4 }}
  5061. wrapperCol={{ span: 16 }}
  5062. label="服务说明"
  5063. >
  5064. <Input
  5065. type="textarea"
  5066. placeholder="请输入服务说明"
  5067. value={this.state.taskComment}
  5068. onChange={e => {
  5069. this.setState({ taskComment: e.target.value });
  5070. }}
  5071. />
  5072. </FormItem>
  5073. </div>
  5074. <FormItem
  5075. wrapperCol={{ span: 12, offset: 4 }}
  5076. className="half-middle"
  5077. >
  5078. <Button
  5079. className="submitSave"
  5080. type="primary"
  5081. onClick={this.changeProSubmit}
  5082. >
  5083. 保存
  5084. </Button>
  5085. <Button
  5086. className="submitSave"
  5087. type="ghost"
  5088. onClick={this.nextCancel}
  5089. >
  5090. 取消
  5091. </Button>
  5092. </FormItem>
  5093. </div>
  5094. </Spin>
  5095. </Form>
  5096. </Modal>
  5097. <Modal
  5098. maskClosable={false}
  5099. visible={this.state.lookVisible}
  5100. onOk={this.noCancel}
  5101. onCancel={this.noCancel}
  5102. width="800px"
  5103. title={"退单申请"}
  5104. footer=""
  5105. className="admin-desc-content"
  5106. >
  5107. <Form layout="horizontal">
  5108. <Spin spinning={this.state.loading}>
  5109. <div className="clearfix">
  5110. <FormItem
  5111. labelCol={{ span: 4 }}
  5112. wrapperCol={{ span: 16 }}
  5113. label="终止合同"
  5114. >
  5115. <Picture
  5116. fileList={e => {
  5117. this.setState({ contractUrl: e });
  5118. }}
  5119. pictureUrl={this.state.contractUrl}
  5120. visible={this.props.visible}
  5121. data={{
  5122. sign: "order_refund_file",
  5123. url: "/api/admin/newOrder/uploadRefundOrderFile",
  5124. number: 8
  5125. }}
  5126. />
  5127. </FormItem>
  5128. </div>
  5129. <div className="clearfix">
  5130. <FormItem
  5131. labelCol={{ span: 4 }}
  5132. wrapperCol={{ span: 16 }}
  5133. label="退单申请表"
  5134. >
  5135. <Picture
  5136. fileList={e => {
  5137. this.setState({ applicationUrl: e });
  5138. }}
  5139. pictureUrl={this.state.applicationUrl}
  5140. visible={this.props.visible}
  5141. data={{
  5142. sign: "order_refund_file",
  5143. url: "/api/admin/newOrder/uploadRefundOrderFile",
  5144. number: 8
  5145. }}
  5146. />
  5147. </FormItem>
  5148. </div>
  5149. <div className="clearfix">
  5150. <FormItem
  5151. labelCol={{ span: 4 }}
  5152. wrapperCol={{ span: 16 }}
  5153. label="退单理由"
  5154. >
  5155. <Input
  5156. type="textarea"
  5157. placeholder="请输入退单理由"
  5158. rows={4}
  5159. value={this.state.reason}
  5160. onChange={e => {
  5161. this.setState({ reason: e.target.value });
  5162. }}
  5163. />
  5164. </FormItem>
  5165. </div>
  5166. <div className="clearfix">
  5167. <Button
  5168. className="cancel"
  5169. type="primary"
  5170. onClick={this.tuidanOk}
  5171. style={{ marginLeft: "50px" }}
  5172. htmlType="submit"
  5173. >
  5174. 确定退单
  5175. </Button>
  5176. <Button
  5177. className="cancel"
  5178. type="ghost"
  5179. onClick={this.noCancel}
  5180. style={{ marginLeft: "50px" }}
  5181. >
  5182. 取消
  5183. </Button>
  5184. </div>
  5185. </Spin>
  5186. </Form>
  5187. </Modal>
  5188. <Modal
  5189. title="修改项目金额"
  5190. visible={this.state.editProVisible}
  5191. onOk={this.submitEditPro}
  5192. width={300}
  5193. okText={"保存"}
  5194. onCancel={() => {
  5195. this.setState({
  5196. editProVisible: false
  5197. });
  5198. }}
  5199. >
  5200. <div className="clearfix">
  5201. <FormItem
  5202. labelCol={{ span: 6 }}
  5203. wrapperCol={{ span: 14 }}
  5204. label="项目金额"
  5205. >
  5206. <Input
  5207. placeholder="请输入金额"
  5208. rows={4}
  5209. value={this.state.editProMoney}
  5210. onChange={e => {
  5211. this.setState({ editProMoney: e.target.value });
  5212. }}
  5213. />
  5214. </FormItem>
  5215. </div>
  5216. </Modal>
  5217. <Modal
  5218. title="修改催款节点金额"
  5219. visible={this.state.editCuiVisible}
  5220. onOk={this.submitEditCui}
  5221. okText={"保存"}
  5222. width={300}
  5223. onCancel={e => {
  5224. this.setState({
  5225. editCuiVisible: false
  5226. });
  5227. }}
  5228. >
  5229. <div className="clearfix">
  5230. <FormItem
  5231. labelCol={{ span: 6 }}
  5232. wrapperCol={{ span: 14 }}
  5233. label="催款金额"
  5234. >
  5235. <Input
  5236. placeholder="请输入金额"
  5237. rows={4}
  5238. value={this.state.editCuiMoney}
  5239. onChange={e => {
  5240. this.setState({ editCuiMoney: e.target.value });
  5241. }}
  5242. />
  5243. </FormItem>
  5244. </div>
  5245. </Modal>
  5246. <OrderRiZi
  5247. dataSourcerizhi={this.state.dataSourcerizhi}
  5248. closeOrderLog={this.closeOrderLog}
  5249. visible={this.state.rizhivisible}
  5250. loading={this.state.loading}
  5251. />
  5252. </div>
  5253. );
  5254. }
  5255. })
  5256. );
  5257. export default Form.create()(NewService);