addService.jsx 211 KB

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