list.vue 310 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <el-form-item :label="$t('listofitems')" class="toolbar_formitem_n1">
  7. </el-form-item>
  8. <el-form-item >
  9. <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
  10. <div v-if="true" style="display: flex;align-items: center;height: 40px;">
  11. <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
  12. <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
  13. <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
  14. <el-option :label="$t('Itemno')" value=2 ></el-option>
  15. </el-select>
  16. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  17. </el-input>
  18. </div>
  19. </el-form-item>
  20. <el-form-item >
  21. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('state.states') }}</span>
  22. <el-select v-model="status" style="width:120px;" :placeholder="$t('defaultText.pleaseChoose')" @change="searchList" size="small">
  23. <el-option :label="$t('all')" value=0 ></el-option>
  24. <el-option :label="$t('ongoing')" value=1 ></el-option>
  25. <el-option :label="$t('state.completed')" value=2 ></el-option>
  26. <el-option :label="$t('state.undone')" value=3 ></el-option>
  27. <el-option :label="$t('paused')" value=4 ></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <!-- 主项目筛选 -->
  31. <el-form-item v-if="user.timeType.mainProjectState == '1'">
  32. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('zhu-xiang-mu') }}</span>
  33. <el-select v-model="projectMainId" style="width:110px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  34. <el-option v-for="item in mainProjectList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <!-- 分类筛选 -->
  38. <el-form-item >
  39. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
  40. <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  41. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item style="float:right;" v-if="permissions.projectImport || permissions.projectExport || permissions.projectClassification || (user.company.packageProject == 1 && permissions.projectCostOfItems)">
  45. <el-dropdown>
  46. <el-link type="primary" :underline="false">{{ $t('viewmore') }}<i class="el-icon-arrow-down el-icon--right"></i></el-link>
  47. <el-dropdown-menu slot="dropdown">
  48. <el-dropdown-item v-if="permissions.projectImport">
  49. <el-link type="primary" :underline="false" @click="importProjectBefore">{{ $t('importproject') }}</el-link>
  50. <!-- <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  51. <el-link type="primary" :underline="false" >{{ $t('importproject') }}</el-link>
  52. </el-upload> -->
  53. </el-dropdown-item>
  54. <el-dropdown-item v-if="permissions.projectImport">
  55. <el-link type="primary" :underline="false" @click="downloadmb" v-if="user.company.packageCustomer == 1 || user.company.packageProvider == 1 || user.timeType.mainProjectState == 1 || user.companyId == '936' || user.timeType.reportCc == 1">{{ $t('Downloadthetemplate') }}</el-link>
  56. <el-link type="primary" :underline="false" href="./upload/项目导入模板.xlsx" :download="$t('importtemplateproject') + '.xlsx'" v-else-if="user.timeType.projectWithDept==0">{{ $t('Downloadthetemplate') }}</el-link>
  57. <!--项目带所属部门的-->
  58. <el-link type="primary" :underline="false" href="./upload/项目导入模板_部门.xlsx" download="项目导入模板+部门.xlsx" v-else>{{ $t('Downloadthetemplate') }}</el-link>
  59. </el-dropdown-item>
  60. <el-dropdown-item v-if="permissions.projectExport" :disabled="exportDisabled">
  61. <el-link type="primary" :underline="false" @click="exportProjectData" :download="$t('exportProject') + '.xlsx'">{{ $t('exportProject') }}</el-link>
  62. </el-dropdown-item>
  63. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectExport">
  64. <el-link type="primary" :underline="false" v-if="user.companyId==936" @click="groupTaskDialog=true" :download="$t('exportingTaskGroups') +'.xlsx'">{{ $t('exportingTaskGroups') }}</el-link>
  65. <el-link type="primary" :underline="false" v-else @click="exportProjectGroup" :download="$t('exportingTaskGroups') +'.xlsx'">{{ $t('exportingTaskGroups') }}</el-link>
  66. </el-dropdown-item>
  67. <el-dropdown-item v-if="user.company.packageProject == 1 && permissions.projectCostOfItems">
  68. <el-link type="primary" :underline="false" @click="showBaseCostItemDialog">{{ $t('baselinecostitem') }}</el-link>
  69. </el-dropdown-item>
  70. <el-dropdown-item v-if="permissions.projectClassification">
  71. <el-link type="primary" :underline="false" @click="showClfDialog = true">{{ $t('classificationmanagement') }}</el-link>
  72. </el-dropdown-item>
  73. <el-dropdown-item v-if="user.timeType.mainProjectState == 1">
  74. <el-link type="primary" :underline="false" @click="mainProjectDialog = true">{{ $t('masterprojectmanagement') }}</el-link>
  75. </el-dropdown-item>
  76. <el-dropdown-item v-if="permissions.projectPhase && user.company.packageProject == 1">
  77. <el-link type="primary" :underline="false" @click="phaseProjectDialog = true">{{ $t('projectstagemanagement') }}</el-link>
  78. </el-dropdown-item>
  79. <el-dropdown-item v-if="user.timeType.projectLevelState == 1">
  80. <el-link type="primary" :underline="false" @click="projectLevelDialog = true">{{ $t('projectlevelmanagement') }}</el-link>
  81. </el-dropdown-item>
  82. <el-dropdown-item v-if="user.timeType.syncFanwei==1||user.timeType.syncSap==1">
  83. <el-link type="primary" :underline="false" @click="syncProjectDig=true, synchronizationInputVal = ''">{{'同步项目信息'}}</el-link>
  84. </el-dropdown-item>
  85. <el-dropdown-item v-if="user.companyId==3385 && permissions.projectClassification">
  86. <el-link type="primary" :underline="false" @click="functionalDivisionDig=true,getFunctionalList()">{{'职能分工设置'}}</el-link>
  87. </el-dropdown-item>
  88. <el-dropdown-item v-if="user.timeType.projectManDay == 1 && permissions.projectClassification">
  89. <el-link type="primary" :underline="false" @click="projectManDaySettingDialog = true;getManDaySetting()">{{ '预估工时配置' }}</el-link>
  90. </el-dropdown-item>
  91. <el-dropdown-item v-if="user.companyId == 10 || user.companyId == 5608">
  92. <el-link type="primary" :underline="false" @click="importTaskDialog = true">{{ '项目任务导入' }}</el-link>
  93. </el-dropdown-item>
  94. </el-dropdown-menu>
  95. </el-dropdown>
  96. </el-form-item>
  97. <!-- <el-form-item style="float:right;" v-if="user.role == 1||user.role == 2||user.role == 5"> -->
  98. <el-form-item style="float:right;" v-if="permissions.projectNew">
  99. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{ $t('newproject') }}</el-link>
  100. </el-form-item>
  101. <el-form-item style="float:right;" v-if="permissions.projectResources">
  102. <!-- <router-link to="/projectGantt"> -->
  103. <el-link type="primary" :underline="false" @click="isganttshow = true">{{ $t('resourceallocation') }}</el-link>
  104. <!-- </router-link> -->
  105. <el-dialog v-if="isganttshow" :visible.sync="isganttshow" width="90vw" top="3vh" style="height:96%" class="ganttdialog">
  106. <projectgantt></projectgantt>
  107. </el-dialog>
  108. </el-form-item>
  109. <br/>
  110. <br v-if="user.companyId == 936">
  111. <!-- 时间段筛选 -->
  112. <el-form-item>
  113. <span style="margin-left:15px;margin-right:5px;color:#606266;">时间段</span>
  114. <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="manageSelect()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:290px;margin-left:5px"></el-date-picker>
  115. </el-form-item>
  116. <!-- 项目经理筛选 -->
  117. <el-form-item>
  118. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('projectmanager') }}</span>
  119. <el-select v-if="user.userNameNeedTranslate != 1" v-model="inchagerId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="manageSelect" size="small" filterable popper-class="managePopperClass">
  120. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  121. <span style="float: left">{{ item.name }}</span>
  122. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  123. </el-option>
  124. </el-select>
  125. <selectCat v-if="user.userNameNeedTranslate == 1" :filterable="true" :size="'mini'" :subject="users" :subjectId="inchagerId" :distinction="'1'" :clearable="true" @selectCal="selectCal"></selectCat>
  126. </el-form-item>
  127. <el-form-item>
  128. <span style="margin-left:25px;margin-right:5px;color:#606266;">{{ $t('participantin') }}</span>
  129. <el-select v-if="user.userNameNeedTranslate != 1" v-model="participationId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="participationSelect" size="small" filterable popper-class="managePopperClass">
  130. <el-option v-for="item in users" :key="item.id" :label="user.companyId == 936 ? item.name + '\u3000' + item.jobNumber : item.name" :value="item.id">
  131. <span style="float: left">{{ item.name }}</span>
  132. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  133. </el-option>
  134. </el-select>
  135. <selectCat v-if="user.userNameNeedTranslate == 1" :filterable="true" :size="'mini'" :subject="users" :subjectId="participationId" :distinction="'2'" :clearable="true" @selectCal="selectCal"></selectCat>
  136. </el-form-item>
  137. <!-- 部门筛选 -->
  138. <el-form-item v-if="user.timeType.projectWithDept">
  139. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('lable.department') }}</span>
  140. <el-cascader v-model="deptId" style="width:140px;" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
  141. :props="{ checkStrictly: true, expandTrigger: 'hover' }" :show-all-levels="false" clearable filterable @change="searchClfList" size="small"
  142. ></el-cascader>
  143. </el-form-item>
  144. </el-form>
  145. </el-col>
  146. <!--列表-->
  147. <el-table ref="projectlistOfWudulist" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist" @sort-change="tableSort">
  148. <el-table-column type="selection" width="60" :selectable="isSelectable">
  149. <!-- creator 项目创建人 incharger 项目负责人 -->
  150. </el-table-column>
  151. <!-- <el-table-column type="index" width="60" v-else>
  152. <template slot-scope="scope" >
  153. {{scope.$index+1+(page-1)*size}}
  154. </template>
  155. </el-table-column> -->
  156. <el-table-column prop="projectCode" :label="$t('Itemno')" sortable="custom" width="150"></el-table-column>
  157. <el-table-column prop="contractCode" :label="$t('contractno')" width="200" v-if="user.companyId == '936'">
  158. <template slot-scope="scope">
  159. <!-- <div v-if="scope.row.projectSeparate">
  160. {{scope.row.projectSeparate.contractCode}}
  161. </div> -->
  162. <div v-if="scope.row.projectSeparate">
  163. <div v-if="scope.row.projectSeparate.contractCode">
  164. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.contractCode.length > 15">
  165. <div>
  166. <span>{{scope.row.projectSeparate.contractCode}}</span>
  167. </div>
  168. <div slot="reference" class="kans">
  169. <span>{{scope.row.projectSeparate.contractCode}}...</span>
  170. </div>
  171. </el-popover>
  172. <div v-else>
  173. <span>{{scope.row.projectSeparate.contractCode}}</span>
  174. </div>
  175. </div>
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <!-- <el-table-column prop="projectCategorySub" label="项目分组" width="200" v-if="user.companyId == '428'">
  180. <template slot-scope="scope">
  181. <div v-if="scope.row.projectSeparate">
  182. <div v-if="scope.row.projectSeparate.projectCategorySub">
  183. <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectSeparate.projectCategorySub.length > 15">
  184. <div>
  185. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  186. </div>
  187. <div slot="reference" class="kans">
  188. <span>{{scope.row.projectSeparate.projectCategorySub}}...</span>
  189. </div>
  190. </el-popover>
  191. <div v-else>
  192. <span>{{scope.row.projectSeparate.projectCategorySub}}</span>
  193. </div>
  194. </div>
  195. </div>
  196. </template>
  197. </el-table-column> -->
  198. <el-table-column prop="categoryName" :label="$t('projectclassification')" sortable="custom" width="140"></el-table-column>
  199. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" sortable="custom">
  200. <template slot-scope="scope">
  201. <!-- <el-popover placement="top" width="400" trigger="hover" v-if="scope.row.projectName.length > 15">
  202. <div>
  203. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  204. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  205. </div>
  206. <div slot="reference" class="kans">
  207. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName.substring(0,15)}}...</el-link>
  208. <span v-if="user.company.packageProject==0" >{{scope.row.projectName.substring(0,15)}}...</span>
  209. </div>
  210. </el-popover>
  211. <div v-else>
  212. <el-link type="primary" v-if="user.company.packageProject==1" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  213. <span v-if="user.company.packageProject==0" >{{scope.row.projectName}}</span>
  214. </div> -->
  215. <div>
  216. <el-link type="primary" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&scope.row.isPublic==0))" :underline="false" :href="'#/projectInside/'+scope.row.id">{{scope.row.projectName}}</el-link>
  217. <span v-else>{{scope.row.projectName}}</span>
  218. </div>
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable="custom" width="200" v-if="user.timeType.projectWithDept">
  222. <template slot-scope="scope">
  223. <TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText>
  224. </template>
  225. </el-table-column>
  226. <el-table-column prop="projectMainName" :label="$t('zhu-xiang-mu')" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
  227. </el-table-column>
  228. <el-table-column prop="inchargerName" :label="$t('projectmanager')" sortable="custom" min-width="150">
  229. <template slot-scope="scope">
  230. <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
  231. <span v-if="user.userNameNeedTranslate != 1">
  232. {{scope.row.inchargerName}}
  233. </span>
  234. <span v-if="user.userNameNeedTranslate == 1">
  235. <TranslationOpenDataText type='userName' :openid='scope.row.inchargerName'></TranslationOpenDataText>
  236. </span>
  237. </el-link>
  238. </template>
  239. </el-table-column>
  240. <div v-if="user.timeType.projectCustom">
  241. <el-table-column :prop="`plate${+index+1}`" sortable="custom" width="200" v-for="(item, index) in dataList" :key="item.id" :label="item.customName" v-if="item.customType!=1" ></el-table-column>
  242. </div>
  243. <!-- 项目阶段 -->
  244. <!-- 换位置之前看下项目阶段发起的请求 -->
  245. <el-table-column prop="currentStage" :label="$t('projectphase')" sortable="custom" min-width="150" width="220" v-if="user.company.packageProject == 1">
  246. <template slot-scope="scope">
  247. {{scope.row.currentStageId == null ? $t('nostage') : scope.row.currentStageName}}
  248. <el-link v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId)" type="primary" :underline="false" @click="showChangeStageDialog(scope.row.id, scope.row.currentStageId)">
  249. <i class="el-icon-edit"></i>
  250. </el-link>
  251. </template>
  252. </el-table-column>
  253. <el-table-column prop="participator" :label="$t('participants')" :min-width="user.company.packageCustomer != 1 ? '100' : '300'" sortable v-if="user.company.packageProject==0">
  254. <template slot-scope="scope">
  255. <!-- <v-for v-for="par in scope.row.participator" :key="par.id" >
  256. <el-link style="margin-right:10px;" type="primary" @click="showUser(par.id)">{{par.name}}</el-link>
  257. </v-for> -->
  258. <div v-if="scope.row.participator.length > 5">
  259. <el-popover placement="top" width="500" trigger="hover" v-if="scope.row.participator.length > 0">
  260. <span v-for="par in scope.row.participator" :key="par.id">
  261. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  262. <span v-if="user.userNameNeedTranslate != 1">
  263. {{par.name}}
  264. </span>
  265. <span v-if="user.userNameNeedTranslate == 1">
  266. <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
  267. </span>
  268. </el-link>
  269. </span>
  270. <div slot="reference" class="addss">
  271. <span v-for="par in scope.row.participator" :key="par.id">
  272. <el-link style="margin-right:10px;" :underline="false" type="primary" @click="showUser(par.id)">
  273. <span v-if="user.userNameNeedTranslate != 1">
  274. {{par.name}}
  275. </span>
  276. <span v-if="user.userNameNeedTranslate == 1">
  277. <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
  278. </span>
  279. </el-link>
  280. </span>
  281. </div>
  282. </el-popover>
  283. </div>
  284. <div v-else>
  285. <span v-for="par in scope.row.participator" :key="par.id" >
  286. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate != 1">
  287. {{par.name}}
  288. </el-link>
  289. <el-link style="margin-right:10px;" type="primary" :underline="false" @click="showUser(par.id)" v-if="user.userNameNeedTranslate == 1">
  290. <TranslationOpenDataText type='userName' :openid='par.name'></TranslationOpenDataText>
  291. </el-link>
  292. </span>
  293. </div>
  294. </template>
  295. </el-table-column>
  296. <!-- 客户管理 -->
  297. <el-table-column prop="customerName" :label="$t('ke-hu')" min-width="190" v-if="user.company.packageCustomer == 1" sortable="custom">
  298. <template slot-scope="scope">
  299. <el-popover placement="top" width="250" trigger="hover" v-if="scope.row.customerName&&scope.row.customerName.length > 12">
  300. <div slot="reference" class="kans">
  301. <span >{{scope.row.customerName.substring(0,12)}}...</span>
  302. </div>
  303. <span >{{scope.row.customerName}}</span>
  304. </el-popover>
  305. <div v-else>
  306. <span >{{scope.row.customerName}}</span>
  307. </div>
  308. </template>
  309. </el-table-column>
  310. <!-- 研究中心 -->
  311. <el-table-column prop="associateDegreeNames" :label="centerNameDegree" min-width="190" v-if="user.timeType.isCro == 1" sortable="custom">
  312. <template slot-scope="scope">
  313. <!-- <div>
  314. {{scope.row.associateDegreeNames}}
  315. </div> -->
  316. <el-popover placement="top" width="300" trigger="hover" v-if="scope.row.associateDegreeNames&&scope.row.associateDegreeNames.length > 12">
  317. <div slot="reference" class="kans">
  318. <span >{{scope.row.associateDegreeNames.substring(0,12)}}...</span>
  319. </div>
  320. <span >{{scope.row.associateDegreeNames}}</span>
  321. </el-popover>
  322. <div v-else>
  323. <span >{{scope.row.associateDegreeNames}}</span>
  324. </div>
  325. </template>
  326. </el-table-column>
  327. <!-- 级别 -->
  328. <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
  329. <template slot-scope="scope">
  330. <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
  331. <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
  332. </template>
  333. </el-table-column>
  334. <!-- 合同金额 -->
  335. <el-table-column prop="contractAmount" :label="'合同金额'" width="200" v-if="user.company.packageProject==1" align="right">
  336. <template slot-scope="scope" >
  337. <span>¥{{Number(scope.row.contractAmount).toFixed(2)}}</span>
  338. </template>
  339. </el-table-column>
  340. <!-- 日报审核人 -->
  341. <el-table-column prop="projectAuditorName" :label="'日报审核人'" sortable="custom" min-width="150" v-if="user.company.companyName=='成都明夷电子科技有限公司'">
  342. <template slot-scope="scope">
  343. <el-link type="primary" :underline="false" @click="showUser(scope.row.projectAuditorId)">
  344. {{scope.row.projectAuditorName}}
  345. </el-link>
  346. </template>
  347. </el-table-column>
  348. <!-- 供应商 -->
  349. <!-- <el-table-column prop="providerNames" label="供应商" min-width="190" v-if="user.company.packageProvider">
  350. </el-table-column> -->
  351. <!-- <div v-if="user.company.packageProvider"> -->
  352. <template>
  353. <div v-for="(item, index) in listHeader" :key="index">
  354. <el-table-column prop="providerNames" :label="item" min-width="190" v-if="user.company.packageProvider">
  355. <template slot-scope="scope">
  356. <div>
  357. {{item | mobans(scope.row.providerInfoList)}}
  358. </div>
  359. </template>
  360. </el-table-column>
  361. </div>
  362. </template>
  363. <el-table-column prop="status" :label="$t('state.states')" min-width="100" sortable="custom">
  364. <template slot-scope="scope">
  365. {{scope.row.status == null?"-":statusTxt[scope.row.status]}}
  366. </template>
  367. </el-table-column>
  368. <!--专业项目协作-->
  369. <el-table-column prop="planStartDate" :label="$t('time.startDate')" min-width="96" >
  370. </el-table-column>
  371. <el-table-column prop="planEndDate" :label="$t('expirationdate')" min-width="96" >
  372. </el-table-column>
  373. <el-table-column prop="progress" :label="$t('completeness')" min-width="100" v-if="user.company.packageProject == 1">
  374. <template slot-scope="scope">
  375. {{scope.row.progress==null?"-":scope.row.progress}}%
  376. </template>
  377. </el-table-column>
  378. <el-table-column prop="manDay" :label="'预估工时'" min-width="150" v-if="user.timeType.projectManDay == 1">
  379. <template slot-scope="scope">
  380. {{scope.row.manDay==null?"":scope.row.manDay}}<span v-if="scope.row.manDay">人天({{scope.row.estimatedWorkTime}}h)</span>
  381. </template>
  382. </el-table-column>
  383. <el-table-column prop="residueEstimatedWorkTime" :label="'剩余预估工时'" min-width="120" v-if="user.timeType.projectManDay == 1">
  384. <template slot-scope="scope">
  385. {{scope.row.residueEstimatedWorkTime==null?"":scope.row.residueEstimatedWorkTime}}<span v-if="scope.row.residueEstimatedWorkTime">h</span>
  386. </template>
  387. </el-table-column>
  388. <el-table-column :label="$t('operation')" :width="showColumnWidth" align="left" fixed="right" v-if="showColumnWidth != '0' || permissions.projectManagement">
  389. <template slot-scope="scope">
  390. <el-button v-if="(permissions.projectManagement || user.id==scope.row.creatorId) && user.timeType.mainProjectState != '1' && !user.timeType.hideSubproject" size="mini" @click="subProject(scope.row)">{{ $t('lable.subproject') }}</el-button>
  391. <el-button size="mini" v-if="permissions.projectParticipator || permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId" type="primary" @click="handleAdd(scope.$index, scope.row)">{{ $t('bian-ji') }}</el-button>
  392. <!-- <el-button v-if="permissions.projectManagement || user.id==scope.row.creatorId" size="mini" @click="deletePro(scope.$index, scope.row)">删除</el-button> -->
  393. <el-dropdown class="customdropdown" split-button size="mini" @click="finishPro(scope.row)" v-if="(permissions.projectManagement || user.id==scope.row.creatorId || user.id==scope.row.inchargerId) && scope.row.status == 1" placement="bottom-start">
  394. {{ $t('wan-cheng') }}
  395. <el-dropdown-menu slot="dropdown" class="customdropdown_menu">
  396. <el-button size="mini" @click="cancelPro(scope.row)" class="customdropdown_menu_btn">{{ $t('btn.undo') }}</el-button><br>
  397. <el-button size="mini" @click="suspendPro(scope.row)" class="customdropdown_menu_btn">{{ $t('zan-ting') }}</el-button><br>
  398. </el-dropdown-menu>
  399. </el-dropdown>
  400. <el-button v-if="(permissions.projectManagement || user.id==scope.row.inchargerId || user.id==scope.row.creatorId) && scope.row.status >= 2" size="mini" @click="restartPro(scope.row)">{{ $t('zhong-qi') }}</el-button>
  401. </template>
  402. </el-table-column>
  403. </el-table>
  404. <!--工具条-->
  405. <el-col :span="24" class="toolbar">
  406. <el-button size="small" @click="batchSetWudulistBtn1" v-if="(user.timeType.customDegreeActive || user.company.packageProject) && (showColumnWidth != '0' || permissions.projectManagement)">{{ $t('btn.cancel') }}</el-button>
  407. <template v-if="user.timeType.customDegreeActive && (showColumnWidth != '0' || permissions.projectManagement)">
  408. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(true)">{{ $t('volumeset') }} {{user.timeType.customDegreeName}}</el-button>
  409. <el-button size="small" type="primary" @click="batchSetWudulistBtn2(false)">{{ $t('pi-liang-tian-jia') }} {{user.timeType.customDegreeName}}</el-button>
  410. </template>
  411. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  412. <el-button size="small" type="primary" @click="addTaskGroup()" >{{'批量增加任务分组'}}</el-button>
  413. </template>
  414. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  415. <el-button size="small" type="primary" @click="setGroupIncharger()" >{{'批量设置分组负责人'}}</el-button>
  416. </template>
  417. <template v-if="user.company.packageProject && (showColumnWidth != '0' || permissions.projectManagement)">
  418. <el-button size="small" type="primary" @click="addGroupPerson()" :loading="addGroupPersonBtnLoading">{{ $t('groupparticipantsinbatches') }}</el-button>
  419. </template>
  420. <template v-if="(showColumnWidth != '0' || permissions.projectManagement)">
  421. <el-button size="small" type="primary" @click="addProPreson()">{{ $t('projectparticipantsinbatches') }}</el-button>
  422. <el-button size="small" type="primary" v-if="permissions.projectManagement" @click="batchIncharger()">{{ $t('projectmanagersinbatches') }}</el-button>
  423. <el-button size="small" type="primary" v-if="user.roleName='超级管理员'" @click="batchDelete()" :loading="isDeleting">批量删除</el-button>
  424. </template>
  425. <el-pagination :key="projectListPageComponentKey"
  426. @size-change="handleSizeChange"
  427. @current-change="handleCurrentChange"
  428. :page-sizes="[20 , 50 , 80 , 100]"
  429. :page-size="size"
  430. :current-page.sync="page"
  431. layout="total, sizes, prev, pager, next"
  432. :total="total"
  433. style="float:right;"
  434. ></el-pagination>
  435. </el-col>
  436. <!--新增界面-->
  437. <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
  438. <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
  439. <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
  440. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject')" v-if="user.companyId!=936">
  441. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  442. <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)" maxlength="50" show-word-limit="true"></el-input>
  443. </el-form-item>
  444. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.companyId==936" prop="code">
  445. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  446. <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="50" show-word-limit="true"></el-input>
  447. </el-form-item>
  448. <el-form-item :label="$t('zhu-xiang-mu')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.mainProjectState == '1'">
  449. <!-- <el-select v-model="addForm.projectMainId" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id" @change="projectManagementChange"> -->
  450. <el-select v-model="addForm.projectMainId" clearable @change="projectManagementChange">
  451. <el-option v-for="(item) in mainProjectList" :key="item.id" :value="item.id" :label="item.name + '\u3000' + item.code">
  452. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.code }}</span>
  453. <span style="float: right;margin-left: 20px">{{ item.name }}</span>
  454. </el-option>
  455. </el-select>
  456. </el-form-item>
  457. <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
  458. <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  459. <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
  460. <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
  461. </el-select>
  462. </el-form-item>
  463. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  464. <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
  465. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="255" show-word-limit="true"></el-input>
  466. </el-form-item>
  467. <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
  468. <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
  469. <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator" show-word-limit></el-input>
  470. </el-form-item>
  471. <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
  472. <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
  473. <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
  474. <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
  475. </el-select>
  476. <el-tooltip effect="dark" :content="$t('zheng-shi-xiang-mu-zhi-dui-can-yu-ren-kai-fang-fei-xiang-mu-dui-suo-you-cheng-yuan-kai-fang')" placement="top-start">
  477. <i class="el-icon-question"></i>
  478. </el-tooltip>
  479. <div v-if="user.company.packageCustomer == 1" style="display: inline-block;width: 50%">
  480. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ke-hu') }}</span>
  481. <el-select v-model="addForm.customerId" clearable="true" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:70%;" :disabled="canOnlyModParticipator">
  482. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  483. </el-select>
  484. </div>
  485. </el-form-item>
  486. <el-form-item :label="$t('subordinatedepartments')" :prop="user.companyId == 936 ? 'deptId' : false" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.timeType.projectWithDept">
  487. <el-cascader v-model="addForm.deptId" :options="departmentList" :placeholder="$t('defaultText.pleaseChoose')" :disabled="canOnlyModParticipator"
  488. :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable filterable @change="cascaderChange" style="width: 100%"
  489. v-if="user.userNameNeedTranslate != 1">
  490. ></el-cascader>
  491. <vueCascader :size="'medium'" :widthStr="'430'" :filterable="true" :clearable="true" :subject="departmentList" :subjectId="addForm.deptId" :radios="true" :distinction="'20'" :disabled="canOnlyModParticipator" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
  492. </el-form-item>
  493. <!-- 供应商 -->
  494. <!-- <el-form-item label="供应商" v-if="user.company.packageProvider">
  495. <el-select v-model="addForm.supplierId" multiple collapse-tags style="width:32%;" placeholder="请选择供应商">
  496. <el-option v-for="item in supplierList" :key="item.id" :label="item.providerName" :value="item.id">
  497. </el-option>
  498. </el-select>
  499. </el-form-item> -->
  500. <el-form-item :label="$t('supplier')" v-if="user.company.packageProvider">
  501. <el-select v-model="addForm.supplierId" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  502. <span v-for="(item, index) in supplierList" :key="index">
  503. <el-option :label="item.providerName" :value="item.id"></el-option>
  504. </span>
  505. </el-select>
  506. </el-form-item>
  507. <el-form-item :label="yonghuUser.customDegreeName" v-if="yonghuUser.customDegreeActive == 1">
  508. <el-select v-model="auseList" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width: 100%" :disabled="canOnlyModParticipator">
  509. <span v-for="(item, index) in ause" :key="index">
  510. <el-option :label="item.name" :value="item.id"></el-option>
  511. </span>
  512. </el-select>
  513. </el-form-item>
  514. <!-- <el-form-item label="客户" v-if="user.company.packageCustomer == 1">
  515. <el-select v-model="addForm.customerId" clearable="true" filterable placeholder="请选择客户" style="width:100%;" >
  516. <el-option v-for="item in customerList" :key="item.id" :label="item.customerName" :value="item.id"></el-option>
  517. </el-select>
  518. </el-form-item> -->
  519. <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  520. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
  521. <div slot="content" style="width:780px">{{addForm.userNames}}</div>
  522. <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
  523. </el-tooltip>
  524. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
  525. <div slot="content" style="width:780px">
  526. <span v-for="(item, index) in addFormUserNames" :key="index">
  527. <!-- {{item}} -->
  528. <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
  529. <span v-if="index < addFormUserNames.length - 1">,</span>
  530. </span>
  531. </div>
  532. <div @click="showChooseMembTree" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  533. <span v-for="(item, index) in addFormUserNames" :key="index">
  534. <!-- {{item}} -->
  535. <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
  536. <span v-if="index < addFormUserNames.length - 1">,</span>
  537. </span>
  538. </div>
  539. </el-tooltip>
  540. </el-form-item>
  541. <el-form-item :label="$t('projectmanager')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0)">
  542. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator || projectManagerEdit">
  543. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  544. <span style="float: left">{{ item.name }}</span>
  545. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  546. </el-option>
  547. </el-select>
  548. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
  549. </el-form-item>
  550. <span v-if="user.companyId != 469">
  551. <el-form-item :label="$t('newspaperauditor')" v-show="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4 || user.timeType.reportAuditType == 6" v-if="user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0)">
  552. <el-select v-if="user.userNameNeedTranslate != '1'" @change="$forceUpdate()" v-model="addForm.auditUserIds" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" :multiple="user.timeType.reportAuditType != 6" >
  553. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  554. </el-select>
  555. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.auditUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="user.timeType.reportAuditType != 6" @selectCal="selectCal"></selectCat>
  556. </el-form-item>
  557. </span>
  558. <el-form-item v-if="user.timeType.reportCc == 1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))" label="日报抄送人" >
  559. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="addForm.ccUserIds" multiple="true" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable placeholder="请选择抄送人" style="width:100%;" >
  560. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  561. </el-select>
  562. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.ccUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="true" @selectCal="selectCal"></selectCat>
  563. </el-form-item>
  564. <!--专业项目协作版本功能 -->
  565. <el-form-item :label="$t('ji-bie')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  566. <el-select v-model="addForm.level" :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" v-if="user.timeType.projectLevelState == 1" :disabled="canOnlyModParticipator || isShowProjectName">
  567. <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
  568. </el-select>
  569. <el-select v-model="addForm.level" :placeholder="this.$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator" v-else>
  570. <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
  571. </el-select>
  572. <!-- 增加合同金额字段 -->
  573. <!-- <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
  574. <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;" @blur="contractAmountChange(addForm.contractAmount)"
  575. placeholder="整数" clearable @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : false"></el-input><span style="margin-left:10px;">元</span> -->
  576. </el-form-item>
  577. <!-- 增加合同金额字段 -->
  578. <el-form-item :label="$t('contractamount')" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  579. <el-input id="contractAmount" v-model="addForm.contractAmount" :disabled="canOnlyModParticipator" style="width:32%;" @input="contractAmountChange(addForm.contractAmount)" :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;position:absolute;">{{ $t('yuan') }}</span>
  580. <template v-if="title == $t('modifytheproject') && contractAmountReasonShow">
  581. <span style="margin-left:63px;margin-right:10px;">{{ $t('modifythereason') }}</span>
  582. <el-input v-model="addForm.changeContractReason" style="width:33%" clearable :placeholder="$t('contractamountasd')"></el-input>
  583. </template>
  584. </el-form-item>
  585. <el-form-item :label="$t('ommencementDate')" prop="planStartDate" v-if="(user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  586. <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
  587. :editable="false" style="width:32%;"
  588. format="yyyy-MM-dd"
  589. value-format="yyyy-MM-dd"
  590. :clearable="false" type="date"
  591. :placeholder="$t('optiondate')"></el-date-picker>
  592. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
  593. <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
  594. :editable="false" :disabled="canOnlyModParticipator"
  595. format="yyyy-MM-dd"
  596. value-format="yyyy-MM-dd"
  597. :clearable="false" type="date"
  598. :placeholder="$t('optiondate')"></el-date-picker>
  599. </el-form-item>
  600. <!-- 增加BU字段 绎维固定字段 -->
  601. <el-form-item label="BU" v-if="user.companyId == '862'">
  602. <el-cascader ref="deptCascader" v-model="addForm.bu" style="width: 250px" :show-all-levels="false" :disabled="canOnlyModParticipator"
  603. :options="buOption" :props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable v-show="user.userNameNeedTranslate != 1"></el-cascader>
  604. <vueCascader :size="'small'" :subjectId="addForm.bu" :widthStr="'200'" :clearable="true" :subject="buOption" :radios="true" :distinction="'32'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  605. </el-form-item>
  606. <!-- 增加项目人天字段 绎维固定字段 -->
  607. <el-form-item v-if="user.timeType.projectManDay == 1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  608. <template slot="label"><span v-if="manDaySetting.projectManDayFillMode == 2 || (manDaySetting.projectManDayFillMode == 1 && addForm.fromOutside == 0)" style="padding:5px;color:red;">*</span>项目人天</template>
  609. <el-input v-model.number="addForm.manDay" :placeholder="$t('peaseenterthe')" @input="jisuanEstimatedWorkTime(addForm.manDay)" style="width: 100px"></el-input>
  610. <span style="margin-left:10px;position:absolute;">人天(预估工时:<el-input size="small" v-model.number="addForm.estimatedWorkTime" :placeholder="$t('peaseenterthe')" @input="jisuanManDay(addForm.estimatedWorkTime)" style="width: 100px"></el-input>h)</span>
  611. <el-tooltip effect="dark" :content="$t('根据系统基础设置每日正常工作时长计算,1人天为一个每日正常工作时长')" placement="top-start" style="margin-left:180px">
  612. <i class="el-icon-question" style="color:#606266"></i>
  613. </el-tooltip>
  614. <span style="margin-left:63px;margin-right:10px;" v-if="user.companyId != 936" >{{'管控开始日期'}}</span>
  615. <el-date-picker v-model="addForm.manDayStartDate" v-if="user.companyId != 936"
  616. :editable="false" style="width:20%;"
  617. format="yyyy-MM-dd"
  618. value-format="yyyy-MM-dd"
  619. :clearable="false" type="date"
  620. :placeholder="$t('optiondate')"></el-date-picker>
  621. <el-tooltip effect="dark" :content="$t('从该日期起,填报工时开始占用预算人天工时')" placement="top-start" style="margin-left:10px" v-if="user.companyId != 936">
  622. <i class="el-icon-question" style="color:#606266"></i>
  623. </el-tooltip>
  624. </el-form-item>
  625. <el-form-item :label="$t('projectoutput')" prop="outputValue" v-if="user.timeType.outputValueStatus == 1">
  626. <el-input id="outputValue" v-model="addForm.outputValue" style="width:32%;" :disabled="canOnlyModParticipator"
  627. placeholder="" clearable @keyup.native="restrictNumber('outputValue')">
  628. </el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  629. </el-form-item>
  630. <!-- 单个公司的固定字段 -->
  631. <div v-if="user.companyId == '936'">
  632. <el-form-item :label="$t('contractno')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  633. <el-input v-model="addForm.contractCode" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || isShowProjectName"></el-input>
  634. </el-form-item>
  635. <el-form-item :label="$t('warrantystartime')">
  636. <el-date-picker v-model="addForm.warrantyStartDate"
  637. :editable="false" style="width:32%;" :disabled="canOnlyModParticipator"
  638. format="yyyy-MM-dd"
  639. value-format="yyyy-MM-dd"
  640. :clearable="false" type="date"
  641. :placeholder="$t('optiondate')"></el-date-picker>
  642. <span style="margin-left:63px;margin-right:10px;" >{{ $t('warrantyexpirationtime') }}</span>
  643. <el-date-picker v-model="addForm.warrantyEndDate" style="width:33%;" :disabled="canOnlyModParticipator"
  644. :editable="false"
  645. format="yyyy-MM-dd"
  646. value-format="yyyy-MM-dd"
  647. :clearable="false" type="date"
  648. :placeholder="$t('optiondate')"></el-date-picker>
  649. </el-form-item>
  650. <el-form-item :label="$t('IndependentProject')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  651. <!-- <el-input v-model="addForm.projectCategorySub" placeholder="请输入自主项目类别" clearable></el-input> -->
  652. <el-select v-model="addForm.projectCategorySub" :placeholder="$t('defaultText.pleaseChoose')" clearable :disabled="canOnlyModParticipator">
  653. <el-option :value="$t('softwareproject')" :label="$t('softwareproject')"></el-option>
  654. <el-option :value="$t('hardwareproject')" :label="$t('hardwareproject')"></el-option>
  655. <el-option :value="$t('integrationproject')" :label="$t('integrationproject')"></el-option>
  656. <el-option :value="$t('fu-wu-xiang-mu')" :label="$t('fu-wu-xiang-mu')"></el-option>
  657. </el-select>
  658. </el-form-item>
  659. <el-form-item :label="$t('region')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  660. <el-input v-model="addForm.region" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || isShowProjectName"></el-input>
  661. </el-form-item>
  662. <el-form-item :label="$t('subordinateBU')" >
  663. <el-input v-model="addForm.bu" :placeholder="$t('subordinateBU')" clearable :disabled="canOnlyModParticipator"></el-input>
  664. </el-form-item>
  665. </div>
  666. <!-- 用户自己定义的字段 -->
  667. <div style="margin-top: 20px" v-if="dataList.length > 0 && user.timeType.projectCustom">
  668. <el-form-item v-for="(item, index) in dataList" :key="item.id" :label="item.customName">
  669. <div v-if="item.customType == 0">
  670. <el-input v-model="item.value" clearable placeholder="请输入内容" @input="ipts(item.value, index)"></el-input>
  671. </div>
  672. <div v-if="item.customType == 1">
  673. <el-upload
  674. list-type="picture-card"
  675. ref="upload" :file-list="item.value" :action="index" :auto-upload="true" :limit="2" :disabled="item.valuelist.length == '2'" :http-request="fileUpload">
  676. <i slot="default" class="el-icon-plus"></i>
  677. <div slot="file" slot-scope="{file}">
  678. <img
  679. class="el-upload-list__item-thumbnail"
  680. :src="file.url" alt=""
  681. >
  682. <span class="el-upload-list__item-actions">
  683. <span
  684. class="el-upload-list__item-preview"
  685. @click="handlePictureCardPreview(file)"
  686. >
  687. <i class="el-icon-zoom-in"></i>
  688. </span>
  689. <span
  690. v-if="!disabled"
  691. class="el-upload-list__item-delete"
  692. @click="handleRemove(file, index)"
  693. >
  694. <i class="el-icon-delete"></i>
  695. </span>
  696. </span>
  697. </div>
  698. </el-upload>
  699. </div>
  700. <div v-if="item.customType == 2">
  701. <el-date-picker v-model="item.value" type="date" placeholder="请选择日期" value-format="yyyy-MM-dd"></el-date-picker>
  702. </div>
  703. </el-form-item>
  704. </div>
  705. <!-- <div v-if="user.companyId == '428'">
  706. <el-form-item :label="$t('projectgroup')" >
  707. <el-input v-model="addForm.projectCategorySub" maxlength="50" show-word-limit :placeholder="$t('peaseenterthe')" clearable></el-input>
  708. </el-form-item>
  709. </div> -->
  710. <!-- 项目基线 -->
  711. <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1 && !canOnlyModParticipator && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  712. <el-tabs v-model="activeName" @tab-click="handleClick">
  713. <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
  714. <div style="padding-top:10px;">
  715. <!--新版 -->
  716. <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
  717. <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
  718. <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
  719. :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  720. </span>
  721. <!-- 合计 -->
  722. <div style="margin-top: 10px;float:right;">
  723. <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
  724. <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
  725. <span v-else>{{addForm.budget | numberToCurrency}}</span>
  726. <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
  727. </div>
  728. </div>
  729. </el-tab-pane>
  730. <el-tab-pane :label="$t('keynodes')" name="baseCostPanep" v-if="user.companyId == '936'">
  731. <div style="padding-top:10px;">
  732. <!--新版 -->
  733. <div class="keyNodes">
  734. <div class="keyNodesName">{{ $t('nameofthenode') }}</div>
  735. <div class="keyNodesTime">{{ $t('plannedcompletiontime') }}</div>
  736. <div class="keyNodesTime">{{ $t('actualcompletiontime') }}</div>
  737. <div class="keyNodesTime">{{ $t('state.states') }}</div>
  738. </div>
  739. <div class="keyNodes" v-for="item in projectKeyNodesData" :key="item.nodesId">
  740. <div class="keyNodesName">{{item.nodesName}}</div>
  741. <div class="keyNodesTime">
  742. <el-date-picker v-model="item.planCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  743. </div>
  744. <div class="keyNodesTime">
  745. <el-date-picker v-model="item.actualCompleteDate" clearable style="width: 80%" size="small" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" :placeholder="$t('optiondate')"></el-date-picker>
  746. </div>
  747. <div class="keyNodesTime">
  748. <el-select v-model="item.states" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" size="small">
  749. <el-option :label="$t('zheng-chang')" value="0"></el-option>
  750. <el-option :label="$t('yan-qi')" value="1"></el-option>
  751. <el-option :label="$t('wan-cheng')" value="2"></el-option>
  752. </el-select>
  753. </div>
  754. </div>
  755. </div>
  756. </el-tab-pane>
  757. <el-tab-pane :label="$t('engineering')" name="engineeringProfession" v-if="user.company.packageEngineering == 1">
  758. <div style="padding-top:10px;" class="gongcheng">
  759. <el-table :data="projectProfessionList" size="small" :key="Math.random()" :height="'400px'">
  760. <el-table-column prop="professionId" width="200">
  761. <template slot-scope="scope">
  762. <el-select v-model="scope.row.professionId" >
  763. <el-option v-for="item in professionList" :key="item.id" :label="item.name" :value="item.id"/>
  764. </el-select>
  765. </template>
  766. <template slot="header" >
  767. <span style="font-size:14px;font-weight:normal;">{{ $t('nameprofessional') }}</span>
  768. </template>
  769. </el-table-column>
  770. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  771. <template slot-scope="scope">
  772. <div><el-input type="number" v-model="scope.row.percentage"></el-input></div>
  773. </template>
  774. </el-table-column>
  775. <el-table-column prop="membNames" :label="$t('personnelproportion')">
  776. <template slot-scope="scope">
  777. <span style="margin:0 5px;" v-for="item in scope.row.membList" :key="item.membId">
  778. <span v-if="user.userNameNeedTranslate != 1">{{item.membName}}({{item.percentage}}%)</span>
  779. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.membName'></TranslationOpenDataText>({{item.percentage}}%)</span>
  780. </span>
  781. <el-link @click="showEditPpMembs(scope.row)">{{(scope.row.membList == null || scope.row.membList.length == 0)?$t('professionalparticipants'):$t('setup')}}</el-link>
  782. </template>
  783. </el-table-column>
  784. <el-table-column prop="inchargerName" width="200" :label="$t('head')">
  785. <template slot-scope="scope">
  786. <el-select v-model="scope.row.inchargerId" v-if="user.userNameNeedTranslate != 1">
  787. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  788. </el-select>
  789. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="participator" :subjectId="scope.row.inchargerId" :other="scope.$index" :distinction="'4'" @selectCal="selectCal"></selectCat>
  790. </template>
  791. </el-table-column>
  792. <el-table-column width="80">
  793. <template slot-scope="scope">
  794. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteItem(scope.$index)"></el-button>
  795. </template>
  796. <template slot="header" >
  797. <el-link type="primary" :underline="false" @click="addItem">{{ $t('addTian') }}</el-link>
  798. </template>
  799. </el-table-column>
  800. </el-table>
  801. </div>
  802. </el-tab-pane>
  803. <!-- <el-tab-pane label="相关领导" name="leaders" >
  804. <div style="padding-top:10px;">
  805. <el-input @focus="showChooseLeaderTree" v-model="addForm.notifyUserNames" placeholder="请选择需要接收审核通知的相关领导"></el-input>
  806. </div>
  807. </el-tab-pane> -->
  808. </el-tabs>
  809. </div>
  810. </el-form>
  811. </div>
  812. <div slot="footer" class="dialog-footer;">
  813. <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectManagement || user.id==deleteVif) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
  814. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  815. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  816. </div>
  817. </el-dialog>
  818. <!-- 图片放大弹窗 -->
  819. <el-dialog :visible.sync="imgUrlListFlg" width="70%" :before-close="xhutDown">
  820. <img width="100%" :src="imgUrlLists" alt="">
  821. </el-dialog>
  822. <!--用户详细信息弹出框-->
  823. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  824. <div class="line"><span>{{ $t('lable.name') }}</span>
  825. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  826. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='userDetail.name'></TranslationOpenDataText></span>
  827. </div>
  828. <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
  829. <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
  830. <div class="line"><span>{{ $t('jiao-se') }}</span><span>{{userDetail.roleName}}</span></div>
  831. <div class="line"><span>{{ $t('lable.department') }}</span>
  832. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  833. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='userDetail.departmentName'></TranslationOpenDataText></span>
  834. </div>
  835. <div slot="footer" class="dialog-footer">
  836. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  837. </div>
  838. </el-dialog>
  839. <!-- 子项目列表 -->
  840. <el-dialog :title="$t('listofsubitems')" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  841. <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
  842. <el-table-column width="120" :label="$t('subprojectno')" prop="code"></el-table-column>
  843. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  844. <el-table-column :label="$t('operation')" width="220">
  845. <template slot-scope="scope" >
  846. <el-switch
  847. @change="changSubStatus(scope.row)"
  848. v-model="scope.row.status"
  849. active-color="#13ce66"
  850. inactive-color="#ff4949"
  851. style="margin-right: 20px;">
  852. </el-switch>
  853. <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji') }}</el-button>
  854. <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  855. </template>
  856. </el-table-column>
  857. </el-table>
  858. <div slot="footer" class="dialog-footer">
  859. <el-button type="default" :disabled="subProjectList.length == 0" @click="forSubProjectlist = list.filter(a=>a.id != currentProject.id);copySubPListVisible = true;" style="align:left;">复制到其他项目</el-button>
  860. <el-button type="primary" @click="subProjectVisible = false" >{{ $t('Shutdown') }}</el-button>
  861. <el-button type="primary" @click="addNewSubProject()" >{{ $t('addsubitems') }}</el-button>
  862. </div>
  863. </el-dialog>
  864. <!--选择项目弹出框-->
  865. <el-dialog title="选择要复制到的目标项目" v-if="copySubPListVisible" :visible.sync="copySubPListVisible" :close-on-click-modal="false" customClass="customWidth" width="700px">
  866. <el-table ref="projectForSubCopy" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="forSubProjectlist" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedProlistForSub" @sort-change="tableSort">
  867. <el-table-column type="selection" width="60" >
  868. </el-table-column>
  869. <el-table-column prop="projectCode" :label="$t('Itemno')" width="150"></el-table-column>
  870. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250">
  871. </el-table-column>
  872. </el-table>
  873. <div slot="footer" class="dialog-footer">
  874. <el-button @click.native="copySubPListVisible = false">{{ $t('btn.cancel') }}</el-button>
  875. <el-button type="primary" @click="submitCopySubProject()" >{{ $t('btn.submit') }}</el-button>
  876. </div>
  877. </el-dialog>
  878. <!-- 新增子项目弹出框 -->
  879. <el-dialog :title="$t('modifysubproject')" v-if="addSubProject" :visible.sync="addSubProject" :close-on-click-modal="false" customClass="customWidth" width="500px">
  880. <el-form ref="form2" :model="temaddForm" :rules="rules" label-width="100px">
  881. <!-- <el-form-item label="项目编号" prop="code"> -->
  882. <el-form-item :label="$t('Itemno')">
  883. <el-input v-model="temaddForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  884. </el-form-item>
  885. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  886. <el-input v-model="temaddForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  887. </el-form-item>
  888. </el-form>
  889. <div slot="footer" class="dialog-footer">
  890. <el-button @click.native="addSubProject = false">{{ $t('btn.cancel') }}</el-button>
  891. <el-button type="primary" @click="submitInsertSubProject" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  892. </div>
  893. </el-dialog>
  894. <!-- 项目基线成本项配置弹出框 -->
  895. <el-dialog :title="$t('baselinecostitemmanagement')" show-header="false" v-if="showBaseConfig" :visible.sync="showBaseConfig" :close-on-click-modal="false" customClass="customWidth" width="600px">
  896. <el-table :data="baseCostItemList" highlight-current-row height="400" style="width: 100%;">
  897. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  898. <template slot-scope="scope" >
  899. {{scope.$index+1+(page-1)*size}}
  900. </template>
  901. </el-table-column>
  902. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  903. <el-table-column prop="alarmType" :label="$t('yu-jing')">
  904. <template slot-scope="scope">
  905. <span>{{scope.row.alarmType ? $t('hourscostwarning') : $t('wu-yu-jing')}}</span>
  906. </template>
  907. </el-table-column>
  908. <el-table-column :label="$t('operation')" width="150">
  909. <template slot-scope="scope" >
  910. <el-button size="small" type="primary" @click="addNewBaseItem(scope.row)">{{ $t('bian-ji') }}</el-button>
  911. <el-button size="small" type="danger" @click="deleteBaseItem(scope.row)">{{ $t('btn.delete') }}</el-button>
  912. </template>
  913. </el-table-column>
  914. </el-table>
  915. <div slot="footer" class="dialog-footer">
  916. <el-button type="primary" @click="showBaseConfig = false" >{{ $t('Shutdown') }}</el-button>
  917. <el-button type="primary" @click="addNewBaseItem()" >{{ $t('newcostitem') }}</el-button>
  918. </div>
  919. </el-dialog>
  920. <!-- 项目关键节点配置弹出框 -->
  921. <el-dialog :title="$t('keyprojectnodes')" show-header="false" v-if="keyNodesIsShow" :visible.sync="keyNodesIsShow" :close-on-click-modal="false" customClass="customWidth" width="600px">
  922. <el-table :data="keyNodesList" highlight-current-row height="400" style="width: 100%;">
  923. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  924. <template slot-scope="scope" >
  925. {{scope.$index+1+(page-1)*size}}
  926. </template>
  927. </el-table-column>
  928. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  929. <el-table-column :label="$t('operation')" width="150">
  930. <template slot-scope="scope" >
  931. <el-button size="small" type="primary" @click="addNewkeyNodes(scope.row)">{{ $t('bian-ji') }}</el-button>
  932. <el-button size="small" type="danger" @click="deletekeyNodes(scope.row)">{{ $t('btn.delete') }}</el-button>
  933. </template>
  934. </el-table-column>
  935. </el-table>
  936. <div slot="footer" class="dialog-footer">
  937. <el-button type="primary" @click="keyNodesIsShow = false" >{{ $t('Shutdown') }}</el-button>
  938. <el-button type="primary" @click="addNewkeyNodes()" >{{$t('addingKeyNodes')}}</el-button>
  939. </div>
  940. </el-dialog>
  941. <!-- 分类条目配置 -->
  942. <el-dialog :title="$t('projectclassificationqwe')" show-header="false" v-if="showClfDialog" :visible.sync="showClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  943. <el-table :data="baseClfList" highlight-current-row height="400" style="width: 100%;">
  944. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  945. <template slot-scope="scope" >
  946. {{scope.$index+1}}
  947. </template>
  948. </el-table-column>
  949. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  950. <el-table-column :label="$t('operation')" :width="user.companyId == '862' ? '300px' : '180px'">
  951. <template slot-scope="scope" >
  952. <el-button size="small" type="primary" @click="auditProcess(scope.row)" v-if="user.companyId == '862'" >{{ $t('AuditProcess') }}</el-button>
  953. <el-button size="small" type="primary" @click="addNewClf(scope.row)">{{ $t('bian-ji') }}</el-button>
  954. <el-button size="small" type="danger" @click="deleteClf(scope.row)">{{ $t('btn.delete') }}</el-button>
  955. </template>
  956. </el-table-column>
  957. </el-table>
  958. <div slot="footer" class="dialog-footer">
  959. <el-button type="primary" @click="showClfDialog = false" >{{ $t('Shutdown') }}</el-button>
  960. <el-button type="primary" @click="addNewClf()" >{{ $t('newCategoryItem') }}</el-button>
  961. </div>
  962. </el-dialog>
  963. <!-- 主项目配置 -->
  964. <el-dialog :title="$t('masterprojectmanagement')" show-header="false" v-if="mainProjectDialog" :visible.sync="mainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="800px">
  965. <el-table :data="mainProjectList" highlight-current-row height="400" style="width: 100%;">
  966. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  967. <template slot-scope="scope" >
  968. {{scope.$index+1+(page-1)*size}}
  969. </template>
  970. </el-table-column>
  971. <el-table-column prop="code" :label="$t('bian-hao')" ></el-table-column>
  972. <el-table-column prop="name" :label="$t('names')" ></el-table-column>
  973. <el-table-column prop="categoryName" :label="$t('fen-lei-ming-cheng')" ></el-table-column>
  974. <el-table-column :label="$t('operation')" width="150">
  975. <template slot-scope="scope" >
  976. <el-button size="small" type="primary" @click="addManPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  977. <el-button size="small" type="danger" @click="deleteManPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  978. </template>
  979. </el-table-column>
  980. </el-table>
  981. <div slot="footer" class="dialog-footer">
  982. <el-button type="primary" @click="mainProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  983. <el-button type="primary" @click="addManPro()" >{{ $t('addzhuxiang') }}</el-button>
  984. </div>
  985. </el-dialog>
  986. <!-- 项目阶段配置 -->
  987. <el-dialog :title="$t('projectstagemanagement')" show-header="false" v-if="phaseProjectDialog" :visible.sync="phaseProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  988. <el-table :data="phaseList" highlight-current-row height="400" style="width: 100%;">
  989. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  990. <template slot-scope="scope" >
  991. {{scope.$index+1+(page-1)*size}}
  992. </template>
  993. </el-table-column>
  994. <el-table-column prop="projectStageName" :label="$t('phasename')" ></el-table-column>
  995. <el-table-column :label="$t('operation')" width="150">
  996. <template slot-scope="scope" >
  997. <el-button size="small" type="primary" @click="addPanthPro(scope.row)">{{ $t('bian-ji') }}</el-button>
  998. <el-button size="small" type="danger" @click="deletePanthPro(scope.row)">{{ $t('btn.delete') }}</el-button>
  999. </template>
  1000. </el-table-column>
  1001. </el-table>
  1002. <div slot="footer" class="dialog-footer">
  1003. <el-button type="primary" @click="phaseProjectDialog = false" >{{ $t('Shutdown') }}</el-button>
  1004. <el-button type="primary" @click="addPanthPro()" >{{ $t('newprojectstage') }}</el-button>
  1005. </div>
  1006. </el-dialog>
  1007. <!-- 项目级别管理 -->
  1008. <el-dialog :title="$t('projectlevelmanagement')" show-header="false" v-if="projectLevelDialog" :visible.sync="projectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1009. <el-table :data="levelList" highlight-current-row height="400" style="width: 100%;" >
  1010. <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
  1011. <template slot-scope="scope" >
  1012. {{scope.$index+1+(page-1)*size}}
  1013. </template>
  1014. </el-table-column>
  1015. <el-table-column prop="projectLevelName" :label="$t('levelnames')" ></el-table-column>
  1016. <el-table-column :label="$t('operation')" width="150">
  1017. <template slot-scope="scope" >
  1018. <el-button size="small" type="primary" @click="addProjectLevel(scope.row)">{{ $t('bian-ji') }}</el-button>
  1019. <el-button size="small" type="danger" @click="deleteProjectLevel(scope.row)">{{ $t('btn.delete') }}</el-button>
  1020. </template>
  1021. </el-table-column>
  1022. </el-table>
  1023. <div slot="footer" class="dialog-footer">
  1024. <el-button type="primary" @click="projectLevelDialog = false" >{{ $t('Shutdown') }}</el-button>
  1025. <el-button type="primary" @click="addProjectLevel()" >{{ $t('newProjectLevel') }}</el-button>
  1026. </div>
  1027. </el-dialog>
  1028. <el-dialog title="项目预估工时配置" show-header="false" v-if="projectManDaySettingDialog" :visible.sync="projectManDaySettingDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1029. <el-form label-width="200px" :form="manDaySetting">
  1030. <el-form-item :label="'预估工时是否必填'" >
  1031. <el-select v-model="manDaySetting.projectManDayFillMode" :placeholder="$t('defaultText.pleaseChoose')" >
  1032. <el-option label="非必填" :value="0"></el-option>
  1033. <el-option label="工时系统创建的项目必填" :value="1"></el-option>
  1034. <el-option label="工时系统和外部同步的项目都必填" :value="2"></el-option>
  1035. </el-select>
  1036. </el-form-item>
  1037. <el-form-item :label="'项目工时剩余提醒百分比'" >
  1038. <el-input v-model="manDaySetting.projectWarningPercent" type="number" style="width:200px;">
  1039. </el-input>%
  1040. </el-form-item>
  1041. <el-form-item :label="'项目工时不足时'" >
  1042. <el-select v-model="manDaySetting.projectFronzeOnLack" :placeholder="$t('defaultText.pleaseChoose')" >
  1043. <el-option label="禁止填报" :value="1"></el-option>
  1044. <el-option label="可以填报,仅提醒" :value="0"></el-option>
  1045. </el-select>
  1046. </el-form-item>
  1047. <el-form-item :label="'分组工时剩余提醒百分比'" v-if="user.company.packageProject == 1">
  1048. <el-input v-model="manDaySetting.groupWarningPercent" type="number" style="width:200px;">
  1049. </el-input>%
  1050. </el-form-item>
  1051. <el-form-item :label="'分组工时不足时'" v-if="user.company.packageProject == 1" >
  1052. <el-select v-model="manDaySetting.groupFronzeOnLack" :placeholder="$t('defaultText.pleaseChoose')" >
  1053. <el-option label="禁止填报" :value="1"></el-option>
  1054. <el-option label="可以填报,仅提醒" :value="0"></el-option>
  1055. </el-select>
  1056. </el-form-item>
  1057. </el-form>
  1058. <div slot="footer" class="dialog-footer">
  1059. <el-button type="default" @click="projectManDaySettingDialog = false" >{{ $t('Shutdown') }}</el-button>
  1060. <el-button type="primary" @click="saveProjectManDaySetting()" >保存</el-button>
  1061. </div>
  1062. </el-dialog>
  1063. <!-- 导出任务分组 -->
  1064. <el-dialog :title="'导出任务分组'" show-header="false" v-if="groupTaskDialog" :visible.sync="groupTaskDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1065. <el-form>
  1066. <el-form-item :label="'自主项目类别'">
  1067. <el-select v-model="projectCategorySubId" :placeholder="$t('defaultText.pleaseChoose')" clearable >
  1068. <el-option v-for="item in projectCategorySubList" :key="item.value" :label="item.label" :value="item.value"></el-option>
  1069. </el-select>
  1070. </el-form-item>
  1071. </el-form>
  1072. <div slot="footer" class="dialog-footer">
  1073. <el-button type="primary" @click="groupTaskDialog = false" >{{ $t('Shutdown') }}</el-button>
  1074. <el-button type="primary" @click="exportProjectGroup" >{{ '导出' }}</el-button>
  1075. </div>
  1076. </el-dialog>
  1077. <!-- 新增/编辑项目级别 -->
  1078. <el-dialog :title="$t('modifyingtheprojectLevel')" v-if="addProjectLevelDialog" :visible.sync="addProjectLevelDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1079. <el-form ref="form2" :model="addLevelForm" :rules="rules" label-width="120px">
  1080. <el-form-item :label="$t('projectLevelName')" prop="projectLevelName">
  1081. <el-input v-model="addLevelForm.projectLevelName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1082. </el-form-item>
  1083. </el-form>
  1084. <div slot="footer" class="dialog-footer">
  1085. <el-button @click="addProjectLevelDialog = false">{{ $t('btn.cancel') }}</el-button>
  1086. <el-button type="primary" @click="submitLevelPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1087. </div>
  1088. </el-dialog>
  1089. <!-- 新增/编辑 分类条目 -->
  1090. <el-dialog :title="$t('addmodifycategoryentry')" v-if="addClfDialog" :visible.sync="addClfDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1091. <el-form ref="form2" :model="addClf" :rules="rules" label-width="100px">
  1092. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  1093. <el-form-item :label="$t('fen-lei-ming-cheng')" prop="name">
  1094. <el-input v-model="addClf.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1095. </el-form-item>
  1096. </el-form>
  1097. <div slot="footer" class="dialog-footer">
  1098. <el-button @click.native="addClfDialog = false">{{ $t('btn.cancel') }}</el-button>
  1099. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1100. </div>
  1101. </el-dialog>
  1102. <!-- 分类条目有关审核流程设置 -->
  1103. <el-dialog :title="$t('AuditProcess')" v-if="auditProcessDialog" :visible.sync="auditProcessDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1104. <el-form ref="form2" :model="auditProcess" :rules="rules" label-width="150px">
  1105. <!-- <el-form-item :label="$t('mainProjectName')" prop="name"> -->
  1106. <el-form-item :label="$t('AuditProcess')" prop="name">
  1107. <template>
  1108. <el-checkbox v-model="addClf.proInchargerAudit" >项目审核人审核</el-checkbox>
  1109. <div style="width: 120px ; text-align: center;"><i class="el-icon-bottom"></i></div>
  1110. <el-checkbox v-model="addClf.proBuAudit" >项目所属BU负责人审核</el-checkbox>
  1111. </template>
  1112. </el-form-item>
  1113. </el-form>
  1114. <div slot="footer" class="dialog-footer">
  1115. <el-button @click.native="auditProcessDialog = false">{{ $t('btn.cancel') }}</el-button>
  1116. <el-button type="primary" @click="submitClf" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1117. </div>
  1118. </el-dialog>
  1119. <!-- 新增/编辑主项目 -->
  1120. <el-dialog :title="$t('modifythemainproject')" v-if="addFlgmainProjectDialog" :visible.sync="addFlgmainProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1121. <el-form ref="form2" :model="addMainForm" :rules="rules" label-width="100px">
  1122. <!-- <el-form-item label="主项目编号" prop="code"> -->
  1123. <el-form-item :label="$t('mainProjectNo')">
  1124. <el-input v-model="addMainForm.code" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1125. </el-form-item>
  1126. <el-form-item :label="$t('mainProjectName')" prop="name">
  1127. <el-input v-model="addMainForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1128. </el-form-item>
  1129. <el-form-item :label="$t('projectclassification')">
  1130. <el-select v-model="addMainForm.categoryId" :placeholder="$t('defaultText.pleaseChoose')" clearable >
  1131. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1132. </el-select>
  1133. </el-form-item>
  1134. </el-form>
  1135. <div slot="footer" class="dialog-footer">
  1136. <el-button @click.native="addFlgmainProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  1137. <el-button type="primary" @click="submitManPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1138. </div>
  1139. </el-dialog>
  1140. <!-- 新增/编辑项目阶段 -->
  1141. <el-dialog :title="$t('modifyingtheprojectphase')" v-if="addFlgPanthProjectDialog" :visible.sync="addFlgPanthProjectDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1142. <el-form ref="form2" :model="addPanthForm" :rules="rules" label-width="120px">
  1143. <el-form-item :label="$t('projectStageName')" prop="name">
  1144. <el-input v-model="addPanthForm.projectStageName" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1145. </el-form-item>
  1146. </el-form>
  1147. <div slot="footer" class="dialog-footer">
  1148. <el-button @click.native="addFlgPanthProjectDialog = false">{{ $t('btn.cancel') }}</el-button>
  1149. <el-button type="primary" @click="submitPanthPro" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1150. </div>
  1151. </el-dialog>
  1152. <el-dialog :title="$t('modificationcostitem')" v-if="addBaseItemDialog" :visible.sync="addBaseItemDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1153. <el-form ref="form2" :model="addForm" :rules="rules" label-width="100px">
  1154. <el-form-item :label="$t('nameofcostitem')" prop="name">
  1155. <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1156. </el-form-item>
  1157. <el-form-item :label="$t('yu-jing')" prop="alarmType">
  1158. <el-radio v-model="addForm.alarmType" :label="0">{{ $t('wu-yu-jing') }}</el-radio>
  1159. <el-radio v-model="addForm.alarmType" :label="1">{{ $t('hourscostwarning') }}</el-radio>
  1160. </el-form-item>
  1161. </el-form>
  1162. <div slot="footer" class="dialog-footer">
  1163. <el-button @click.native="addBaseItemDialog = false">{{ $t('btn.cancel') }}</el-button>
  1164. <el-button type="primary" @click="submitInsertBaseItem" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1165. </div>
  1166. </el-dialog>
  1167. <el-dialog :title="$t('modifyingKeyNodesn')" v-if="addBasekeyNodesialog" :visible.sync="addBasekeyNodesialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1168. <el-form ref="form2" :model="addFormkeyNodes" :rules="rules" label-width="120px">
  1169. <el-form-item :label="$t('keyNodeNames')" prop="name">
  1170. <el-input v-model.trim="addFormkeyNodes.name" :placeholder="$t('peaseenterthe')" clearable></el-input>
  1171. </el-form-item>
  1172. </el-form>
  1173. <div slot="footer" class="dialog-footer">
  1174. <el-button @click.native="addBasekeyNodesialog = false">{{ $t('btn.cancel') }}</el-button>
  1175. <el-button type="primary" @click="submitkeyNodes" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  1176. </div>
  1177. </el-dialog>
  1178. <!-- 按部门选择人员 -->
  1179. <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1180. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1181. <div v-if="user.userNameNeedTranslate == '1'">
  1182. <el-input placeholder="请输入内容" v-model.trim="filterText" class="input-with-select" @keyup.enter.native="echartDepartment()">
  1183. <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
  1184. </el-input>
  1185. </div>
  1186. <div class="tree" style="height:400px">
  1187. <el-scrollbar style="height:100%">
  1188. <el-input
  1189. :placeholder="$t('keywordfiltering')"
  1190. v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
  1191. </el-input>
  1192. <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
  1193. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
  1194. highlight-current :filter-node-method="filterNode">
  1195. <span class="custom-tree-node" slot-scope="{ node, data }">
  1196. <span v-if="user.userNameNeedTranslate == '1'">
  1197. <span v-if="node.data.children">
  1198. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1199. </span>
  1200. <span v-else>
  1201. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1202. </span>
  1203. </span>
  1204. <span v-if="user.userNameNeedTranslate != '1'">
  1205. {{ node.label }}
  1206. </span>
  1207. <!-- {{ node.label }} -->
  1208. </span>
  1209. </el-tree>
  1210. </el-scrollbar>
  1211. </div>
  1212. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1213. <div slot="footer" class="dialog-footer">
  1214. <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
  1215. <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
  1216. </div>
  1217. </el-dialog>
  1218. <!-- 按部门选择相关领导,弃用 -->
  1219. <!-- <el-dialog title="选择相关领导" v-if="chooseLeaderVisible" :visible.sync="chooseLeaderVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1220. <div class="tree" style="height:400px">
  1221. <el-scrollbar style="height:100%">
  1222. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1223. ref="chooseLeaderTree" @check-change="onLeaderTreeItemChange" :default-checked-keys="addForm.notifyUserIds"
  1224. highlight-current ></el-tree>
  1225. </el-scrollbar>
  1226. </div>
  1227. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  1228. <div slot="footer" class="dialog-footer">
  1229. <el-button @click="chooseLeaderVisible = false" >取消</el-button>
  1230. <el-button type="primary" @click="chooseLeader()" >确定</el-button>
  1231. </div>
  1232. </el-dialog> -->
  1233. <!-- 项目专业人员的设置 -->
  1234. <el-dialog :title="$t('setupprojectprofessionals')" v-if="editPpMembDialog" :visible.sync="editPpMembDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1235. <div class="gongcheng">
  1236. <el-table :data="curProfessionRow.membList" height="400">
  1237. <el-table-column prop="name" :label="$t('professionals')">
  1238. <template slot-scope="scope">
  1239. <el-select v-model="scope.row.membId" v-if="user.userNameNeedTranslate != 1" filterable :placeholder="$t('professionaladdsparticipant')" style="width:100%;" >
  1240. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  1241. </el-option>
  1242. </el-select>
  1243. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="scope.row.membId" :distinction="'11'" :other="scope.$index" @selectCal="selectCal"></selectCat>
  1244. </template>
  1245. </el-table-column>
  1246. <el-table-column prop="percentage" width="120" :label="$t('zhan-bi')">
  1247. <template slot-scope="scope">
  1248. <el-input type="number" v-model="scope.row.percentage"></el-input>
  1249. </template>
  1250. </el-table-column>
  1251. <el-table-column width="80">
  1252. <template slot-scope="scope">
  1253. <el-button icon="el-icon-delete" size="mini" style="margin-left:10px;" @click.stop.native="deleteMembItem(scope.$index)"></el-button>
  1254. </template>
  1255. <template slot="header" >
  1256. <el-link @click="addMembItem" type="primary">{{ $t('addTian') }}</el-link>
  1257. </template>
  1258. </el-table-column>
  1259. </el-table>
  1260. <div slot="footer" class="dialog-footer">
  1261. <el-button @click="editPpMembDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1262. <el-button type="primary" @click="addPpMemb" >{{ $t('btn.determine') }}</el-button>
  1263. </div>
  1264. </div>
  1265. </el-dialog>
  1266. <!-- 批量修改自定义维度 -->
  1267. <el-dialog :title="checkoradd ? $t('changes') : $t('pi-liang-tian-jia')" :visible.sync="checkedWuduDialog" v-if="checkedWuduDialog" width="40%">
  1268. <el-form model="" label-width="20%">
  1269. <el-form-item :label="$t('setup') + user.timeType.customDegreeName">
  1270. <el-select v-model="checkedWuduArr" value-key="id" :placeholder="$t('defaultText.pleaseChoose') + user.timeType.customDegreeName" multiple style="width: 100%">
  1271. <el-option v-for="item in ause" :key="item.id" :label="item.name" :value="item"></el-option>
  1272. </el-select>
  1273. </el-form-item>
  1274. </el-form>
  1275. <div slot="footer" class="dialog-footer">
  1276. <el-button @click="checkedWuduDialog = false">{{ $t('btn.cancel') }}</el-button>
  1277. <el-button type="primary" @click="batchSetWudulistBtn3" v-if="checkoradd">{{ $t('btn.determine') }}</el-button>
  1278. <el-button type="primary" @click="batchSetWudulistBtn4" v-if="!checkoradd">{{ $t('btn.determine') }}</el-button>
  1279. </div>
  1280. </el-dialog>
  1281. <!-- 批量添加参与人 -->
  1282. <el-dialog :title="isAddGroupPerson ? $t('groupparticipantsinbatches') : $t('projectparticipantsinbatches')" v-if="addGroupPersonDialog" :visible.sync="addGroupPersonDialog" width="600px">
  1283. <el-form label-width="20%">
  1284. <el-form-item :label="$t('screening.selectPeople')">
  1285. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != '1'">
  1286. <div slot="content" style="width:450px">{{addGroupPersonData.personNames}}</div>
  1287. <el-input @focus="addGroupPersonP" v-model="addGroupPersonData.personNames"></el-input>
  1288. </el-tooltip>
  1289. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == '1'">
  1290. <div slot="content" style="width:580px">
  1291. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1292. <!-- {{item}} -->
  1293. <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
  1294. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1295. </span>
  1296. </div>
  1297. <div @click="addGroupPersonP" style="width: 450px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
  1298. <span v-for="(item, index) in addGroupPersonDataPersonNames" :key="index">
  1299. <!-- {{item}} -->
  1300. <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
  1301. <span v-if="index < addGroupPersonDataPersonNames.length - 1">,</span>
  1302. </span>
  1303. </div>
  1304. </el-tooltip>
  1305. </el-form-item>
  1306. <el-form-item :label="$t('xuan-ze-fen-zu')" v-if="isAddGroupPerson">
  1307. <el-select v-model="addGroupPersonData.group" multiple :placeholder="$t('selectagroup')" style="width:100%">
  1308. <el-option v-for="item in addGroupList"
  1309. :key="item.groupIds"
  1310. :label="item.name"
  1311. :value="item.groupIds"></el-option>
  1312. </el-select>
  1313. </el-form-item>
  1314. </el-form>
  1315. <div slot="footer" class="dialog-footer">
  1316. <el-button @click="addGroupPersonDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1317. <el-button type="primary" @click="addGroupPersonSure()" v-if="isAddGroupPerson">{{ $t('btn.determine') }}</el-button>
  1318. <el-button type="primary" @click="addProPersonSure()" v-else>{{ $t('btn.determine') }}</el-button>
  1319. </div>
  1320. <el-dialog append-to-body :title="$t('screening.selectPeople')" v-if="addGroupPersonPdialog" :visible.sync="addGroupPersonPdialog" width="40%">
  1321. <div class="tree" style="height:300px">
  1322. <el-scrollbar style="height:100%">
  1323. <el-input
  1324. :placeholder="$t('keywordfiltering')"
  1325. v-model="filterText2"
  1326. v-if="user.userNameNeedTranslate != 1">
  1327. </el-input>
  1328. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1329. ref="chooseMembTree2" @check-change="addPersonCheck"
  1330. highlight-current :filter-node-method="filterNode" :default-checked-keys="addGroupPersonData.person">
  1331. <span class="custom-tree-node" slot-scope="{ node, data }">
  1332. <span v-if="user.userNameNeedTranslate == '1'">
  1333. <span v-if="node.data.children">
  1334. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1335. </span>
  1336. <span v-else>
  1337. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1338. </span>
  1339. </span>
  1340. <span v-if="user.userNameNeedTranslate != '1'">
  1341. {{ node.label }}
  1342. </span>
  1343. </span>
  1344. </el-tree>
  1345. </el-scrollbar>
  1346. </div>
  1347. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  1348. <div slot="footer" class="dialog-footer">
  1349. <el-button @click="addGroupPersonPdialog = false" >{{ $t('btn.cancel') }}</el-button>
  1350. <el-button type="primary" @click="addPersonSure()" >{{ $t('btn.determine') }}</el-button>
  1351. </div>
  1352. </el-dialog>
  1353. </el-dialog>
  1354. <!-- 批量设置项目经理 -->
  1355. <el-dialog :title="$t('projectmanagersinbatches')" v-if="batchInchargerDialog" :visible.sync="batchInchargerDialog" width="500px">
  1356. <el-form model="" label-width="120px">
  1357. <el-form-item :label="$t('setupprojectmanager')">
  1358. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="paramInchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" filterable clearable>
  1359. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  1360. <span style="float: left">{{item.name}}</span>
  1361. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  1362. </el-option>
  1363. </el-select>
  1364. <selectCat :size="'small'" :widthStr="'272'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="paramInchargerId" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1365. </el-form-item>
  1366. </el-form>
  1367. <div slot="footer" class="dialog-footer">
  1368. <el-button @click="batchInchargerDialog = false" >{{ $t('btn.cancel') }}</el-button>
  1369. <el-button type="primary" @click="batchInchargerSure()">{{ $t('btn.determine') }}</el-button>
  1370. </div>
  1371. </el-dialog>
  1372. <el-dialog :title="$t('importproject')" v-if="importProjectBeforeDialog" :visible.sync="importProjectBeforeDialog" width="30%">
  1373. <el-checkbox v-model="paramData1" style="margin-left:10px">{{ $t('dui-yi-you-xiang-mu-jin-hang-xin-xi-geng-xin') }}</el-checkbox>
  1374. <el-checkbox v-model="changeParticipation" @change="changeParticipationValue(changeParticipation)" style="margin-left:10px" >{{ '根据文件中参与人对现有的进行删减' }}</el-checkbox>
  1375. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1376. <el-upload ref="upload" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  1377. <el-button type="primary">{{ $t('importproject') }}</el-button>
  1378. </el-upload>
  1379. </div>
  1380. </el-dialog>
  1381. <el-dialog :title="$t('xiu-gai-xiang-mu-dang-qian-jie-duan')" v-if="changeStageDialogVisible" :visible.sync="changeStageDialogVisible" width="300px">
  1382. <el-select v-model="curChangeProject.curStageId" filterable :placeholder="$t('pleaseselecttheprojectphase')" style="margin: 0 auto;">
  1383. <el-option v-for="(item, index) in phaseList" :key="index" :label="item.projectStageName" :value="item.id"> </el-option>
  1384. </el-select>
  1385. <div slot="footer" class="dialog-footer" style="text-algin:center;">
  1386. <el-button type="primary" @click="confirmChangeStage">{{ $t('btn.determine') }}</el-button>
  1387. </div>
  1388. </el-dialog>
  1389. <el-dialog append-to-body :title="$t('projectimportresult')" v-if="showImportResult" :visible.sync="showImportResult" width="40%">
  1390. <div >
  1391. {{importResultMsg}}
  1392. </div>
  1393. </el-dialog>
  1394. <!-- 职能分工设置 -->
  1395. <el-dialog :title="'职能分工设置'" v-if="functionalDivisionDig" :visible.sync="functionalDivisionDig" width="80%">
  1396. <el-table border :data="functionalList" style="width: 100%">
  1397. <el-table-column prop="id" label="序号" width="50" type="index" align="center"
  1398. :index="index=>index+1"/>
  1399. <el-table-column prop="timeType" label="工时类型" align="center">
  1400. <template slot-scope="scope">
  1401. <span v-show="!scope.row.editFlag">{{scope.row.timeType}}</span>
  1402. <el-select v-show="scope.row.editFlag" v-model="scope.row.timeType" placeholder="请选择">
  1403. <el-option
  1404. v-for="item in timeTypeList"
  1405. :key="item.value"
  1406. :label="item.label"
  1407. :value="item.label">
  1408. </el-option>
  1409. </el-select>
  1410. </template>
  1411. </el-table-column>
  1412. <el-table-column prop="roleId" label="角色" align="center">
  1413. <template slot-scope="scope">
  1414. <span v-show="!scope.row.editFlag">{{scope.row.role}}</span>
  1415. <el-select v-show="scope.row.editFlag" v-model="scope.row.role" placeholder="请选择">
  1416. <el-option
  1417. v-for="item in roleList"
  1418. :key="item.value"
  1419. :label="item.label"
  1420. :value="item.label">
  1421. </el-option>
  1422. </el-select>
  1423. </template>
  1424. </el-table-column>
  1425. <el-table-column prop="jobRespon" label="工作职责" align="center">
  1426. <template slot-scope="scope">
  1427. <span v-show="!scope.row.editFlag">{{scope.row.jobRespon}}</span>
  1428. <el-input v-show="scope.row.editFlag"
  1429. v-model="scope.row.jobRespon">
  1430. </el-input>
  1431. </template>
  1432. </el-table-column>
  1433. <el-table-column prop="workContext" label="工作内容" align="center">
  1434. <template slot-scope="scope">
  1435. <a v-if="scope.row.id" @click="workContextDig=true,getWorkContextList(scope.row.id)" style="color:#409EFF">{{'数据维护'}}</a>
  1436. <a v-else>{{'数据维护'}}</a>
  1437. </template>
  1438. </el-table-column>
  1439. <el-table-column label="操作" width="120" align="center">
  1440. <template slot-scope="scope">
  1441. <div style="display: flex;">
  1442. <el-button size="small"
  1443. type="text"
  1444. icon="CircleCheck"
  1445. v-show="scope.row.editFlag"
  1446. @click="functionalSubmit(scope.row)">确定
  1447. </el-button>
  1448. <el-button size="small"
  1449. type="text"
  1450. icon="CircleClose"
  1451. v-show="scope.row.editFlag"
  1452. @click="functionalCancel(scope.row,scope.$index,'functional')">取消
  1453. </el-button>
  1454. <el-button size="small"
  1455. icon="Edit"
  1456. type="text"
  1457. v-show="!scope.row.editFlag"
  1458. @click="functionalEditVersion(scope.row)"> 编辑
  1459. </el-button>
  1460. <el-button size="small"
  1461. icon="Delete"
  1462. type="text"
  1463. v-show="!scope.row.editFlag"
  1464. @click="functionalDelVersion(scope.row,scope.$index)">删除
  1465. </el-button>
  1466. </div>
  1467. </template>
  1468. </el-table-column>
  1469. </el-table>
  1470. <div slot="footer" class="dialog-footer">
  1471. <el-button @click="addFunctional('functional')" type="primary">添加一行</el-button>
  1472. <el-button @click="functionalDivisionDig = false" >{{ $t('btn.cancel') }}</el-button>
  1473. <el-button type="primary" @click="submitFunctional()">{{ $t('btn.determine') }}</el-button>
  1474. </div>
  1475. </el-dialog>
  1476. <!-- 工作内容dig -->
  1477. <el-dialog :title="'工作内容'" v-if="workContextDig" :visible.sync="workContextDig" width="40%">
  1478. <el-table border :data="workContextList" style="width: 100%">
  1479. <el-table-column prop="id" label="序号" width="50" type="index" align="center"
  1480. :index="index=>index+1"/>
  1481. <el-table-column prop="workContext" label="工作内容" align="center">
  1482. <template slot-scope="scope">
  1483. <span v-show="!scope.row.editFlag">{{scope.row.workContext}}</span>
  1484. <el-input v-show="scope.row.editFlag"
  1485. v-model="scope.row.workContext">
  1486. </el-input>
  1487. </template>
  1488. </el-table-column>
  1489. <el-table-column label="操作" width="120" align="center">
  1490. <template slot-scope="scope">
  1491. <div style="display: flex;">
  1492. <el-button size="small"
  1493. type="text"
  1494. icon="CircleCheck"
  1495. v-show="scope.row.editFlag"
  1496. @click="functionalSubmit(scope.row)">确定
  1497. </el-button>
  1498. <el-button size="small"
  1499. type="text"
  1500. icon="CircleClose"
  1501. v-show="scope.row.editFlag"
  1502. @click="functionalCancel(scope.row,scope.$index,'workContext')">取消
  1503. </el-button>
  1504. <el-button size="small"
  1505. icon="Edit"
  1506. type="text"
  1507. v-show="!scope.row.editFlag"
  1508. @click="functionalEditVersion(scope.row)"> 编辑
  1509. </el-button>
  1510. <el-button size="small"
  1511. icon="Delete"
  1512. type="text"
  1513. v-show="!scope.row.editFlag"
  1514. @click="workContextDelVersion(scope.row,scope.$index)">删除
  1515. </el-button>
  1516. </div>
  1517. </template>
  1518. </el-table-column>
  1519. </el-table>
  1520. <div slot="footer" class="dialog-footer">
  1521. <el-button @click="addFunctional('workContext')" type="primary">添加一行</el-button>
  1522. <el-button @click="workContextDig = false" >{{ $t('btn.cancel') }}</el-button>
  1523. <el-button type="primary" @click="submitWorkContext()">{{ $t('btn.determine') }}</el-button>
  1524. </div>
  1525. </el-dialog>
  1526. <!-- 批量增加任务分组 -->
  1527. <!-- <el-dialog :title="'批量增加任务分组'" v-if="addTaskGroupDig" :visible.sync="addTaskGroupDig" width="40%">
  1528. <el-form label-width="20%">
  1529. <el-form-item :label="'分组名称:'">
  1530. <el-input v-model="batchAddTaskGroupName" placeholder="请输入内容"></el-input>
  1531. </el-form-item>
  1532. </el-form>
  1533. <div slot="footer" class="dialog-footer">
  1534. <el-button @click="addTaskGroupDig = false,this.batchAddTaskGroupName=null">{{ $t('btn.cancel') }}</el-button>
  1535. <el-button type="primary" @click="batchAddTaskGroup()">{{ $t('btn.determine') }}</el-button>
  1536. </div>
  1537. </el-dialog> -->
  1538. <!-- 批量设置任务分组负责人 -->
  1539. <el-dialog :title="'批量设置任务分组负责人'" v-if="addTaskGroupInchargerDig" :visible.sync="addTaskGroupInchargerDig" width="40%">
  1540. <el-form label-width="20%">
  1541. <el-form-item :label="'分组名称:'">
  1542. <el-select v-model="hasSetGroupName" placeholder="请选择">
  1543. <el-option
  1544. v-for="item in hasSetGroupList"
  1545. :key="item.value"
  1546. :label="item.label"
  1547. :value="item.label">
  1548. </el-option>
  1549. </el-select>
  1550. </el-form-item>
  1551. <el-form-item :label="'分组负责人:'">
  1552. <el-select v-if="user.userNameNeedTranslate != '1'" v-model="hasSetGroupInchargerId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 80%" filterable clearable>
  1553. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  1554. <span style="float: left">{{item.name}}</span>
  1555. <span style="float: right; color: #8492a6;" v-if="user.companyId == 936">{{ item.jobNumber }}</span>
  1556. </el-option>
  1557. </el-select>
  1558. <selectCat :size="'small'" :widthStr="'272'" v-if="user.userNameNeedTranslate == '1'" :subject="users" :subjectId="hasSetGroupInchargerId" :distinction="'6'" @selectCal="selectCal"></selectCat>
  1559. </el-form-item>
  1560. </el-form>
  1561. <div slot="footer" class="dialog-footer">
  1562. <el-button @click="addTaskGroupInchargerDig = false,this.hasSetGroupInchargerId=null,this.hasSetGroupName=null">{{ $t('btn.cancel') }}</el-button>
  1563. <el-button type="primary" @click="batchSetGroupIncharger()">{{ $t('btn.determine') }}</el-button>
  1564. </div>
  1565. </el-dialog>
  1566. <!-- 项目同步弹窗 -->
  1567. <el-dialog title="项目服务同步" :visible.sync="syncProjectDig" width="600px" :before-close="handleClose">
  1568. <el-form label-width="0">
  1569. <div class="synchronization">
  1570. <div class="synchronizationLabel">
  1571. <el-select v-model="synchronizationVal" placeholder="请选择" @change="synchronizationChange()">
  1572. <el-option label="已同步项目" value="0"></el-option>
  1573. <el-option label="未同步项目" value="1"></el-option>
  1574. </el-select>
  1575. </div>
  1576. <el-form-item style="flex: 1" v-if="synchronizationVal == 0">
  1577. <el-select filterable collapse-tags clearable v-model="hasChooseProjectCode" multiple placeholder="请选择" style="width:100%">
  1578. <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.projectCode">
  1579. <span style="float: right; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  1580. <span style="float: left;">{{ item.projectName }}</span>
  1581. </el-option>
  1582. </el-select>
  1583. </el-form-item>
  1584. <el-form-item style="flex: 1" v-if="synchronizationVal == 1">
  1585. <el-input placeholder="请输入项目编号" v-model="synchronizationInputVal" clearable></el-input>
  1586. </el-form-item>
  1587. </div>
  1588. </el-form>
  1589. <span slot="footer" class="dialog-footer">
  1590. <el-button @click="syncProjectDig = false">取 消</el-button>
  1591. <el-button type="primary" @click="syncProjectForThird(hasChooseProjectCode)">开始同步</el-button>
  1592. </span>
  1593. </el-dialog>
  1594. <!--导入数据,下载模板 -->
  1595. <el-dialog :title="$t('wdorkplanimport')" v-if="importTaskDialog" :visible.sync="importTaskDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1596. <el-form ref="form4" >
  1597. <el-form-item :label="'1. '+$t('qing-xian-xia-zai-mo-ban-bing-tian-xie-hou-shang-chuan')" >
  1598. <el-link type="primary" :underline="false" href="./upload/多项目任务导入模板.xlsx" download="多项目任务模板.xlsx'">下载多项目任务模板</el-link>
  1599. </el-form-item>
  1600. </el-form>
  1601. <div slot="footer" class="dialog-footer">
  1602. <el-upload ref="upload" action="#" :limit="1" :http-request="importTask" :show-file-list="false">
  1603. <el-button type="primary" :underline="false" style="width:100%;" :loading="loadingExport">{{ $t('uoloadFiles') }}</el-button>
  1604. </el-upload>
  1605. </div>
  1606. </el-dialog>
  1607. <!-- 新增任务分组弹出框 -->
  1608. <el-dialog v-if="addTaskGroupDig" :visible.sync="addTaskGroupDig" :close-on-click-modal="false" customClass="customWidth" width="600px">
  1609. <div slot="title" >
  1610. <el-tabs v-model="createGroupWay">
  1611. <el-tab-pane :label="$t('newgrouping')" name="new">
  1612. <el-form ref="formGrouping" :model="groupForm" :rules="formGrouping" style="margin-top:40px;">
  1613. <el-form-item prop="name">
  1614. <el-input v-model.trim="groupForm.name" :placeholder="$t('pleaseenteragroupname')" maxlength="50"
  1615. show-word-limit clearable></el-input>
  1616. </el-form-item>
  1617. <el-button type="primary" @click="addGroup('formGrouping')" style="width:100%;" >{{ $t('create') }}</el-button>
  1618. </el-form>
  1619. </el-tab-pane>
  1620. <el-tab-pane :label="$t('creatintemplate')" name="template">
  1621. <el-card class="template_box" :style="t.selected?'border: 1px solid #409eff;':''" v-for="(t,tIndex) in groupTemplateList" :key="t.id" @click.native="choseTemplate(tIndex)">
  1622. <div>
  1623. <el-row >
  1624. <el-col :span="22">
  1625. <div><span>{{t.name}}</span>
  1626. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  1627. @click="setTemplate(t)"><i class="el-icon-setting" v-show="t.isSystem == 0" ></i>
  1628. </el-link>
  1629. <el-link :underline="false" type="primary" style="color:#aaa;margin-left:10px;"
  1630. @click="deleteTemplate(t)"><i class="el-icon-delete" v-show="t.isSystem == 0" ></i>
  1631. </el-link>
  1632. </div>
  1633. <div style="margin-top:10px;">
  1634. <span style="color:#8c8c8c;font-size:12px;" v-for="(s,index) in t.stagesList" :key="s.id">
  1635. <i class="el-icon-arrow-right" v-if="index>0"></i>
  1636. {{s.stagesName}}</span>
  1637. </div>
  1638. </el-col>
  1639. <el-col :span="2">
  1640. <i class="el-icon-check" v-show="t.selected" style="font-size:20px;color:#409eff;margin-top:12px;"></i>
  1641. </el-col>
  1642. </el-row>
  1643. </div>
  1644. </el-card>
  1645. <el-button type="primary" @click="addTemplateGroup" style="width:100%;" >{{ $t('create') }}</el-button>
  1646. </el-tab-pane>
  1647. </el-tabs>
  1648. </div>
  1649. <el-dialog :title="$t('bian-ji-mo-ban')" append-to-body v-if="setTemplateDialog" :visible.sync="setTemplateDialog" width="500px">
  1650. <el-form label-width="20%">
  1651. <el-form-item :label="$t('mo-ban-ming-cheng')"><el-input v-model="setTemplateData.name" style="width:80%" clearable></el-input></el-form-item>
  1652. <el-form-item label=""><el-checkbox v-model="setTemplateData.creWithPro">{{ $t('suixiangmuzidongchuangjian') }}</el-checkbox></el-form-item>
  1653. <el-form-item v-for="item,index in setTemplateData.stagesList" :key="item.id" :label="index == 0 ? '任务列表' : ''">
  1654. <el-input v-model="item.stagesName" style="width:70%" clearable></el-input>
  1655. <el-link :underline="false" type="primary" style="color:#aaa;" @click="deleteStages(item,index)" v-if="index != 0">
  1656. <i class="el-icon-delete"></i>
  1657. </el-link>
  1658. </el-form-item>
  1659. <el-link style="margin-left:20%" :underline="false" type="primary" @click="addStages()">{{ $t('xin-zeng-ren-wu-lie-biao') }}</el-link>
  1660. </el-form>
  1661. <div slot="footer" class="dialog-footer">
  1662. <el-button type="primary" @click="setTemplateDialog = false">{{ $t('btn.cancel') }}</el-button>
  1663. <el-button type="primary" @click="setTemplateSave()">{{ $t('save') }}</el-button>
  1664. </div>
  1665. </el-dialog>
  1666. </el-dialog>
  1667. </section>
  1668. </template>
  1669. <style scoped>
  1670. .input-with-select .el-input-group__prepend {
  1671. background-color: #fff;
  1672. }
  1673. .line {
  1674. padding:10px;
  1675. }
  1676. .line span{
  1677. font-size:15px;
  1678. }
  1679. .line span:nth-child(even){
  1680. float:right;
  1681. }
  1682. .kans {
  1683. width: 230px;
  1684. overflow:hidden;
  1685. white-space:nowrap;
  1686. text-overflow: ellipsis;
  1687. }
  1688. a {
  1689. text-decoration: none;
  1690. }
  1691. .router-link-active {
  1692. text-decoration: none;
  1693. }
  1694. </style>
  1695. <script>
  1696. import util from "../../common/js/util";
  1697. import projectgantt from "./project_gantt.vue"
  1698. // 自定义select组件
  1699. import selectCat from "@/components/select.vue"
  1700. import vueCascader from "@/components/cascader.vue"
  1701. export default {
  1702. components:{
  1703. projectgantt,
  1704. selectCat,
  1705. vueCascader,
  1706. },
  1707. data() {
  1708. return {
  1709. importTaskDialog: false,
  1710. manDaySetting:{},
  1711. projectManDaySettingDialog: false,
  1712. projectListPageComponentKey: 1,
  1713. isDeleting: false,
  1714. forSubProjectlist:[],
  1715. copySubPListVisible: false,
  1716. projectManagerEdit: false,
  1717. canOnlyModParticipator: false,
  1718. curChangeProject:null,
  1719. changeStageDialogVisible: false,
  1720. addFlgmainProjectDialog: false,
  1721. addFlgPanthProjectDialog: false,
  1722. addProjectLevelDialog: false,
  1723. mainProjectList: [],
  1724. mainProjectDialog: false,
  1725. projectLevelDialog: false,
  1726. showImportResult: false,
  1727. importResultMsg:null,
  1728. isganttshow: false,
  1729. deleteAlertMsg: null,
  1730. chosenLeaders:[],
  1731. baseClfList:[],
  1732. chooseLeaderVisible:false,
  1733. projectProfessionItem:null,
  1734. curProfessionRow:null,
  1735. editPpMembDialog:false,
  1736. professionList:[],
  1737. projectProfessionList:[],
  1738. activeName:"baseCostPanel",
  1739. chosenMembCount:0,
  1740. chosenMembList:[],//选中的人员
  1741. allMembData:[],
  1742. auditProcessDialog: false,
  1743. deptMembData: [
  1744. {
  1745. id: 0,
  1746. label: this.$t('lable.unassigned'),
  1747. }
  1748. ],
  1749. option: [],
  1750. depData: {
  1751. id: -1,
  1752. label: this.$t('lable.allStaff'),
  1753. },
  1754. defaultProps: {
  1755. children: 'children',
  1756. label: 'label'
  1757. },
  1758. wxFilterText: '',
  1759. mainProjectId:'',
  1760. filterName:null,
  1761. chooseParticipVisible: false,
  1762. projectBaseCostData:[],
  1763. addBaseItemDialog:false,
  1764. showBaseConfig:false,
  1765. customerList:[],
  1766. roleArray:[this.$t('role.ordinaryEmployees'),this.$t('role.superAdministrator'), this.$t('role.systemAdministrator'), this.$t('role.companyTop'),this.$t('role.financialAdministrator'), this.$t('role.projectManager')],
  1767. status:"1",
  1768. statusTxt:["-",this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone'),this.$t('paused')],
  1769. importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
  1770. importanceListLable:[this.$t('zheng-chang'), this.$t('jin-ji'), this.$t('zhong-yao'), this.$t('zhong-yao-qie-jin-ji'), this.$t('di-feng-xian'), this.$t('zhong-feng-xian'), this.$t('gao-feng-xian')],
  1771. searchField:'1',
  1772. keyword:null,
  1773. user: JSON.parse(sessionStorage.getItem("user")),
  1774. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1775. userDetailVisible: false,
  1776. userDetail:{},
  1777. date: new Date(),
  1778. users: [],
  1779. participator:[],
  1780. tableHeight: 0,
  1781. listLoading: false,
  1782. total: 0,
  1783. page: 1,
  1784. size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
  1785. list: [],
  1786. subProjectVisible: false,
  1787. subProjectList: [],//子项目列表
  1788. currentProject:{},
  1789. addSubProject: false,
  1790. addFormVisible: false,
  1791. addLoading: false,
  1792. groupTaskDialog:false,
  1793. addUp: 0, // 合计
  1794. title: "",
  1795. addForm: {
  1796. name: '',
  1797. userId: [],
  1798. level:1,
  1799. bu:'',
  1800. id: '',
  1801. code: '',
  1802. projectDesc: '',
  1803. alarmType: 0
  1804. },
  1805. addFormUserNames: [],
  1806. temaddForm: {},
  1807. rules: {
  1808. name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1809. code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
  1810. projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1811. projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  1812. deptId: [{ required: true, message: '请选择所属部门', trigger: "blur" }]
  1813. },
  1814. ause: [],
  1815. auseList: [],
  1816. yonghuUser: [],
  1817. filterText: '',
  1818. filterText2: '',
  1819. showClfDialog: false,
  1820. addClfDialog:false,
  1821. addClf:{name:'',id:''},
  1822. addMainForm:{
  1823. name:'',
  1824. id:'',
  1825. code: '',
  1826. categoryId: ''
  1827. },
  1828. addPanthForm: {
  1829. id: '',
  1830. projectStageName: ''
  1831. },
  1832. addLevelForm: {
  1833. id: '',
  1834. projectStageName: ''
  1835. },
  1836. statusClf:null,
  1837. permissionsObj: {},
  1838. checkedPForSubArr:[],
  1839. checkedProjectArr: [],
  1840. checkedWuduDialog: false,
  1841. checkedWuduArr: [],
  1842. checkoradd: true,
  1843. addGroupPersonBtnLoading: false,
  1844. addGroupPersonDialog: false,
  1845. addGroupList: [],
  1846. addGroupPersonData: {
  1847. group: [],
  1848. person: null,
  1849. personNames: ''
  1850. },
  1851. addGroupPersonPdialog: false,
  1852. showColumnWidth: '300',
  1853. deleteVif: null,
  1854. isAddGroupPerson: true,
  1855. projectMainId: '',
  1856. supplierList: '',
  1857. sortProp: '',
  1858. sortOrder: null,
  1859. currentCell: null, // 当前单击的是哪一个单元格
  1860. phaseList: [],
  1861. phaseProjectId: '', // 阶段项目id
  1862. phaseProjectValie: null, // 阶段项目值
  1863. listHeader: [], // 列表表头
  1864. rowid: '',
  1865. phaseProjectDialog: false, // 项目阶段
  1866. levelList: [], // 项目级别
  1867. departmentList: [],
  1868. deptId: [],
  1869. buOption:[],
  1870. contractAmountOld: 0,
  1871. contractAmountReasonShow: false,
  1872. centerNameDegree: '',
  1873. batchInchargerDialog: false,
  1874. paramInchargerId: '',
  1875. inchagerId: '',
  1876. keyNodesIsShow: false,
  1877. keyNodesList: [],
  1878. projectKeyNodesData: [],
  1879. addBasekeyNodesialog: false,
  1880. addFormkeyNodes: {
  1881. name: ''
  1882. },
  1883. participationId: '',
  1884. importProjectBeforeDialog: false,
  1885. paramData1: false,
  1886. chosenListBackup: [], // 备份
  1887. searchPersonnelFlg: false,
  1888. searchPersonnelFlgnum: 1,
  1889. createDate: [], // 项目筛选时间段
  1890. exportDisabled: false,
  1891. exportNotification: null,
  1892. dataList: [],
  1893. dataListBf: [],
  1894. imgUrlLists: '',
  1895. imgUrlListFlg: false,
  1896. estimatedWorkTime:'',
  1897. projectCategorySubList:[
  1898. {
  1899. value: 1,
  1900. label: '纯软件项目'
  1901. },
  1902. {
  1903. value: 2,
  1904. label: '纯硬件项目'
  1905. },
  1906. {
  1907. value: 3,
  1908. label: '集成项目'
  1909. },
  1910. {
  1911. value: 4,
  1912. label: '服务项目'
  1913. }
  1914. ],
  1915. projectCategorySubId:'',
  1916. // 威派格定制(只有管理员才能更改项目名称,编号,级别,合同,大区,经理)
  1917. isShowProjectName: false,
  1918. //职能相关字段
  1919. functionalDivisionDig:false,
  1920. functionalList:[],
  1921. timeTypeList:[
  1922. {
  1923. value: 1,
  1924. label: '项目工时'
  1925. },
  1926. {
  1927. value: 2,
  1928. label: '非项目工时'
  1929. },
  1930. ],
  1931. roleList:[
  1932. {
  1933. value: 1,
  1934. label: 'CRC&LM'
  1935. },
  1936. {
  1937. value: 2,
  1938. label: 'PM'
  1939. },
  1940. ],
  1941. //工作内容
  1942. workContextDig:false,
  1943. functionalId:null,
  1944. workContextList:[],
  1945. oldValue:null,
  1946. addTaskGroupDig:false,
  1947. batchAddTaskGroupName:null,
  1948. hasSetGroupName:null,
  1949. hasSetGroupInchargerId:null,
  1950. hasSetGroupList:[],
  1951. addTaskGroupInchargerDig:false,
  1952. filterNodePersonnel: [],
  1953. syncProjectDig:false,
  1954. allProjectList:[],
  1955. hasChooseProjectCode:[],
  1956. synchronizationVal: '0',
  1957. synchronizationInputVal: '',
  1958. groupTemplateList:[],
  1959. createGroupWay:'new',
  1960. groupForm:{},
  1961. setTemplateDialog: false,
  1962. selectedGroup:{},
  1963. changeParticipation:false,
  1964. };
  1965. },
  1966. // 过滤器
  1967. filters: {
  1968. numberToCurrency(value) {
  1969. if (!value) return '0.00'
  1970. // 将数值截取,保留两位小数
  1971. value = value.toFixed(2)
  1972. // 获取整数部分
  1973. const intPart = Math.trunc(value)
  1974. // 整数部分处理,增加,
  1975. const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
  1976. // 预定义小数部分
  1977. let floatPart = '.00'
  1978. // 将数值截取为小数部分和整数部分
  1979. const valueArray = value.toString().split('.')
  1980. if (valueArray.length === 2) { // 有小数部分
  1981. floatPart = valueArray[1].toString() // 取得小数部分
  1982. return intPartFormat + '.' + floatPart
  1983. }
  1984. return intPartFormat + floatPart
  1985. },
  1986. mobans(value, valueList) {
  1987. for(var i in valueList) {
  1988. if(valueList[i].providerCateGoryName == value) {
  1989. return valueList[i].providerInfoName
  1990. }
  1991. }
  1992. },
  1993. },
  1994. watch: {
  1995. filterText(val) {
  1996. let { userNameNeedTranslate } = JSON.parse(sessionStorage.getItem("user"))
  1997. if(userNameNeedTranslate != 1) {
  1998. this.$refs.chooseMembTree.filter(val);
  1999. }
  2000. if(!val) {
  2001. this.$refs.chooseMembTree.filter(val);
  2002. }
  2003. },
  2004. filterText2(val) {
  2005. this.$refs.chooseMembTree2.filter(val);
  2006. }
  2007. },
  2008. updated () {
  2009. // console.log('执行upload生命周期')
  2010. this.$nextTick(()=>{
  2011. this.$refs.projectlistOfWudulist.doLayout();
  2012. })
  2013. },
  2014. methods: {
  2015. // 批量导入任务
  2016. importTask(item) {
  2017. //首先判断文件类型
  2018. this.loadingExport = true
  2019. let str = item.file.name.split(".");
  2020. let format = str[str.length - 1];
  2021. if (format != "xls" && format != "xlsx") {
  2022. this.loadingExport = false
  2023. this.$message({
  2024. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2025. type: "error"
  2026. });
  2027. } else {
  2028. this.listLoading = true;
  2029. let formData = new FormData();
  2030. formData.append("file", item.file);
  2031. formData.append("isMultiProject", 1);
  2032. this.http.uploadFile('/task/importTask', formData,
  2033. res => {
  2034. this.$refs.upload.clearFiles();
  2035. this.listLoading = false;
  2036. this.loadingExport = false
  2037. if (res.code == "ok") {
  2038. this.$message({
  2039. message: this.$t('other.importSuccess'),
  2040. type: "success"
  2041. });
  2042. this.importTaskDialog = false;
  2043. } else {
  2044. this.$message({
  2045. message: res.msg,
  2046. type: "error"
  2047. });
  2048. }
  2049. },
  2050. error => {
  2051. this.$refs.upload.clearFiles();
  2052. this.listLoading = false;
  2053. this.loadingExport = false
  2054. this.$message({
  2055. message: error,
  2056. type: "error"
  2057. });
  2058. });
  2059. }
  2060. },
  2061. saveProjectManDaySetting() {
  2062. this.http.post('/estimate-time-setting/save', this.manDaySetting,
  2063. res => {
  2064. if (res.code == "ok") {
  2065. this.projectManDaySettingDialog = false;
  2066. } else {
  2067. this.$message({
  2068. message: res.msg,
  2069. type: "error"
  2070. });
  2071. }
  2072. },
  2073. error => {
  2074. this.$message({
  2075. message: error,
  2076. type: "error"
  2077. });
  2078. });
  2079. },
  2080. //获取项目预估工时配置数据
  2081. getManDaySetting() {
  2082. this.http.post('/estimate-time-setting/get', {
  2083. companyId: this.user.companyId
  2084. },
  2085. res => {
  2086. if (res.code == "ok") {
  2087. this.manDaySetting = res.data;
  2088. } else {
  2089. this.$message({
  2090. message: res.msg,
  2091. type: "error"
  2092. });
  2093. }
  2094. },
  2095. error => {
  2096. this.$message({
  2097. message: error,
  2098. type: "error"
  2099. });
  2100. });
  2101. },
  2102. submitCopySubProject() {
  2103. //获取选中的项目
  2104. if (this.checkedPForSubArr.length == 0) {
  2105. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2106. return
  2107. }
  2108. var targetPIds = JSON.stringify(this.checkedPForSubArr.map((a)=>{return a.id}));
  2109. //http post请求提交
  2110. this.http.post('/sub-project/copyToProjects', {
  2111. projectId: this.currentProject.id,
  2112. targetProjectIds: targetPIds,
  2113. },
  2114. res => {
  2115. if (res.code == "ok") {
  2116. this.$message({
  2117. message: '操作成功',
  2118. type: "success"
  2119. });
  2120. this.copySubPListVisible = false;
  2121. } else {
  2122. this.$message({
  2123. message: res.msg,
  2124. type: "error"
  2125. });
  2126. }
  2127. },
  2128. error => {
  2129. this.$message({
  2130. message: error,
  2131. type: "error"
  2132. });
  2133. });
  2134. },
  2135. confirmChangeStage() {
  2136. let currentStageName = ''
  2137. for(var i in this.phaseList) {
  2138. if(this.phaseList[i].id == this.curChangeProject.curStageId) {
  2139. currentStageName = this.phaseList[i].projectStageName
  2140. }
  2141. }
  2142. this.http.post('/project/changeCurrentStage', {
  2143. projectId: this.curChangeProject.projectId,
  2144. currentStageId: this.curChangeProject.curStageId,
  2145. currentStageName: currentStageName
  2146. },
  2147. res => {
  2148. if (res.code == "ok") {
  2149. this.getList()
  2150. this.changeStageDialogVisible = false;
  2151. } else {
  2152. this.$message({
  2153. message: res.msg,
  2154. type: "error"
  2155. });
  2156. }
  2157. },
  2158. error => {
  2159. this.$message({
  2160. message: error,
  2161. type: "error"
  2162. });
  2163. });
  2164. },
  2165. showChangeStageDialog(projectId, curStageId) {
  2166. this.curChangeProject = {projectId: projectId, curStageId: curStageId};
  2167. this.changeStageDialogVisible = true;
  2168. },
  2169. addNewkeyNodes(row) {
  2170. this.addBasekeyNodesialog = true
  2171. if(row) {
  2172. this.addFormkeyNodes = row
  2173. } else {
  2174. this.addFormkeyNodes = {
  2175. name: ''
  2176. }
  2177. }
  2178. },
  2179. // 获取关键节点
  2180. getkeyNodes() {
  2181. this.http.post('/project-key-nodes-setting/list', {},
  2182. res => {
  2183. if (res.code == "ok") {
  2184. // this.keyNodesIsShow = true
  2185. this.keyNodesList = res.data
  2186. } else {
  2187. this.$message({
  2188. message: res.msg,
  2189. type: "error"
  2190. });
  2191. }
  2192. },
  2193. error => {
  2194. this.$message({
  2195. message: error,
  2196. type: "error"
  2197. });
  2198. });
  2199. },
  2200. hoverCall(row) {
  2201. this.rowid=row.id
  2202. },
  2203. handCall() {
  2204. this.rowid = ''
  2205. },
  2206. // 获取阶段
  2207. obtainPhase(item) {
  2208. this.http.post('/project-stage/list', {},
  2209. res => {
  2210. if (res.code == "ok") {
  2211. // this.phaseList = res.data
  2212. this.$set(this, 'phaseList', res.data)
  2213. } else {
  2214. this.$message({
  2215. message: res.msg,
  2216. type: "error"
  2217. });
  2218. }
  2219. },
  2220. error => {
  2221. this.$message({
  2222. message: error,
  2223. type: "error"
  2224. });
  2225. });
  2226. },
  2227. // 获取级别
  2228. getProjectLevel(){
  2229. this.http.post('/project-level/list', {},
  2230. res => {
  2231. if (res.code == "ok") {
  2232. this.levelList = res.data
  2233. // this.$set(this, 'levelList', res.data)
  2234. } else {
  2235. this.$message({
  2236. message: res.msg,
  2237. type: "error"
  2238. });
  2239. }
  2240. },
  2241. error => {
  2242. this.$message({
  2243. message: error,
  2244. type: "error"
  2245. });
  2246. });
  2247. },
  2248. addProjectLevel(row){
  2249. this.addProjectLevelDialog = true
  2250. if(!row) {
  2251. this.addLevelForm = {
  2252. projectLevelName: '',
  2253. id: ''
  2254. // companyId:''
  2255. }
  2256. } else {
  2257. this.addLevelForm = {
  2258. id: row.id,
  2259. projectLevelName: row.projectLevelName
  2260. // companyId: row.companyId
  2261. }
  2262. }
  2263. },
  2264. deleteProjectLevel(row) {
  2265. this.$confirm($t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectlevels'), {
  2266. confirmButtonText: this.$t('btn.determine'),
  2267. cancelButtonText: this.$t('btn.cancel'),
  2268. type: "warning"
  2269. })
  2270. .then(() => {
  2271. this.listLoading = true;
  2272. this.http.post('/project-level/delete',{
  2273. id: row.id
  2274. },
  2275. res => {
  2276. this.listLoading = false;
  2277. if (res.code == "ok") {
  2278. this.$message({
  2279. message: this.$t('message.successfullyDeleted'),
  2280. type: "success"
  2281. });
  2282. this.getProjectLevel();
  2283. } else {
  2284. this.$message({
  2285. message: res.msg,
  2286. type: "error"
  2287. });
  2288. }
  2289. },
  2290. error => {
  2291. this.listLoading = false;
  2292. this.$message({
  2293. message: error,
  2294. type: "error"
  2295. });
  2296. }
  2297. );
  2298. })
  2299. .catch(() => {});
  2300. },
  2301. submitLevelPro(){
  2302. this.http.post('/project-level/addOrMod',this.addLevelForm,
  2303. res => {
  2304. if (res.code == "ok") {
  2305. this.addProjectLevelDialog = false;
  2306. this.getProjectLevel()
  2307. } else {
  2308. this.$message({
  2309. message: res.msg,
  2310. type: "error"
  2311. });
  2312. }
  2313. },
  2314. error => {
  2315. this.$message({
  2316. message: error,
  2317. type: "error"
  2318. });
  2319. }
  2320. );
  2321. },
  2322. // 表格点击
  2323. tableCellClassName({row, column, rowIndex, columnIndex}) {
  2324. row.index=rowIndex;
  2325. column.index=columnIndex;
  2326. },
  2327. // clickCell(row,column) {
  2328. // // console.log('can can need',row,column)
  2329. // this.currentCell = row.index + ',' + column.index;
  2330. // this.phaseProjectValie = row.currentStageId ? row.currentStageId : ''
  2331. // if(this.permissions.projectManagement || this.user.id==row.inchargerId || this.user.id==row.creatorId) {
  2332. // this.phaseProjectId = row.id
  2333. // setTimeout(() => {
  2334. // // 获得焦点
  2335. // this.$refs[row.index + ',' + column.index].focus();
  2336. // })
  2337. // }
  2338. // },
  2339. // selectChange() {
  2340. // let currentStageName = ''
  2341. // for(var i in this.phaseList) {
  2342. // if(this.phaseList[i].id == this.phaseProjectValie) {
  2343. // currentStageName = this.phaseList[i].projectStageName
  2344. // }
  2345. // }
  2346. // this.http.post('/project/changeCurrentStage', {
  2347. // projectId: this.phaseProjectId,
  2348. // currentStageId: this.phaseProjectValie,
  2349. // currentStageName: currentStageName
  2350. // },
  2351. // res => {
  2352. // if (res.code == "ok") {
  2353. // this.getList()
  2354. // } else {
  2355. // this.$message({
  2356. // message: res.msg,
  2357. // type: "error"
  2358. // });
  2359. // }
  2360. // },
  2361. // error => {
  2362. // this.$message({
  2363. // message: error,
  2364. // type: "error"
  2365. // });
  2366. // });
  2367. // },
  2368. // hideSelect() {
  2369. // var that = this
  2370. // setTimeout(() => {
  2371. // that.currentCell = null
  2372. // }, 500)
  2373. // },
  2374. // 点击主项目事件
  2375. projectManagementChange() {
  2376. let categoryId = ''
  2377. for(var i in this.mainProjectList) {
  2378. if(this.mainProjectList[i].id == this.addForm.projectMainId) {
  2379. categoryId = this.mainProjectList[i].categoryId
  2380. }
  2381. }
  2382. categoryId == '' ? '' : this.addForm.category = categoryId
  2383. // console.log(this.addForm)
  2384. },
  2385. tableSort({column, prop, order}){
  2386. if(prop == 'inchargerName' || prop == 'customerName' || prop == 'projectCode' || prop == 'categoryName' || prop == 'projectName' || prop == 'status' || prop == 'currentStage' || prop == 'departmentName' || prop == 'associateDegreeNames'){
  2387. this.sortOrder = order
  2388. this.sortProp = prop
  2389. this.getList()
  2390. }
  2391. },
  2392. fileUpload(file) {
  2393. //首先判断文件类型
  2394. console.log(file)
  2395. let str = file.file.name.split(".");
  2396. let indexLi = file.action
  2397. let format = str[str.length - 1];
  2398. if (format != "jpg" && format != "jpeg" && format != "png") {
  2399. this.$message({
  2400. message: "请选择.jpg或.jpeg文件",
  2401. type: "error"
  2402. });
  2403. } else {
  2404. let formData = new FormData();
  2405. formData.append("multipartFile", file.file);
  2406. this.http.uploadFile('/common/uploadFile', formData,
  2407. res => {
  2408. if (res.code == "ok") {
  2409. this.dataList[indexLi].valuelist.push(res.data)
  2410. this.$forceUpdate()
  2411. this.$message({
  2412. message: "上传成功",
  2413. type: "success"
  2414. });
  2415. } else {
  2416. this.$message({
  2417. message: res.msg,
  2418. type: "error"
  2419. });
  2420. }
  2421. },
  2422. error => {
  2423. this.$message({
  2424. message: error,
  2425. type: "error"
  2426. });
  2427. });
  2428. }
  2429. },
  2430. handleRemove(file, index) {
  2431. let uploadFiles = this.$refs.upload[0].uploadFiles
  2432. for (var i = 0; i < uploadFiles.length; i++) {
  2433. if (uploadFiles[i]['url'] == file.url) {
  2434. uploadFiles.splice(i, 1)
  2435. this.dataList[index].valuelist.splice(i, 1)
  2436. }
  2437. }
  2438. },
  2439. handlePictureCardPreview(file) {
  2440. console.log(file)
  2441. this.imgUrlLists = file.url;
  2442. this.imgUrlListFlg = true;
  2443. // this.$set(this, 'imgUrlListFlg', true)
  2444. // console.log(this.imgUrlListFlg)
  2445. this.$forceUpdate()
  2446. },
  2447. xhutDown(done) {
  2448. this.imgUrlListFlg = false
  2449. done()
  2450. this.$forceUpdate()
  2451. },
  2452. ipts(i, item) {
  2453. this.$forceUpdate()
  2454. },
  2455. getObtain() {
  2456. this.http.post('/project-custom/getProjectCustom', {},
  2457. res => {
  2458. if(res.code == 'ok') {
  2459. var yaunz = []
  2460. for(var i in res.data) {
  2461. if(res.data[i].customType == '1') {
  2462. this.$set(res.data[i], 'value', [])
  2463. this.$set(res.data[i], 'valuelist', [])
  2464. } else {
  2465. this.$set(res.data[i], 'value', '')
  2466. this.$set(res.data[i], 'valuelist', [])
  2467. }
  2468. yaunz.push(res.data[i])
  2469. }
  2470. this.dataList = yaunz
  2471. this.dataListBf = yaunz
  2472. } else {
  2473. this.$message({
  2474. message: error,
  2475. type: "error"
  2476. });
  2477. }
  2478. },
  2479. error => {;
  2480. this.$message({
  2481. message: error,
  2482. type: "error"
  2483. });
  2484. });
  2485. },
  2486. //获取项目列表
  2487. getSupplierList() {
  2488. this.http.post('/provider-info/list', {
  2489. pageIndex: 1,
  2490. // pageSize: 999,
  2491. pageSize: -1,
  2492. keyword: ''
  2493. },
  2494. res => {
  2495. if (res.code == "ok") {
  2496. this.supplierList = res.data.records;
  2497. } else {
  2498. this.$message({
  2499. message: res.msg,
  2500. type: "error"
  2501. });
  2502. }
  2503. },
  2504. error => {
  2505. this.$message({
  2506. message: error,
  2507. type: "error"
  2508. });
  2509. });
  2510. },
  2511. addManPro(row) {
  2512. this.addFlgmainProjectDialog = true
  2513. if(!row) {
  2514. this.addMainForm = {
  2515. name: '',
  2516. id: '',
  2517. code: '',
  2518. categoryId: ''
  2519. }
  2520. } else {
  2521. this.addMainForm = {
  2522. id: row.id,
  2523. code: row.code,
  2524. name: row.name,
  2525. categoryId: row.categoryId,
  2526. }
  2527. }
  2528. },
  2529. addPanthPro(row) {
  2530. this.addFlgPanthProjectDialog = true
  2531. if(!row) {
  2532. this.addPanthForm = {
  2533. projectStageName: '',
  2534. id: '',
  2535. companyId:''
  2536. }
  2537. } else {
  2538. this.addPanthForm = {
  2539. id: row.id,
  2540. projectStageName: row.projectStageName,
  2541. companyId: row.companyId
  2542. }
  2543. }
  2544. },
  2545. // 获取主项目
  2546. getMainProject() {
  2547. this.http.post('/project-main/list',{},res => {
  2548. if(res.code == 'ok'){
  2549. this.mainProjectList = res.data
  2550. }else {
  2551. this.$message({
  2552. message: res.msg,
  2553. type: 'error'
  2554. })
  2555. }
  2556. },err => {
  2557. this.$message({
  2558. message: err,
  2559. type: 'error'
  2560. })
  2561. })
  2562. },
  2563. checkedProlistForSub(e) {
  2564. this.checkedPForSubArr = e;
  2565. },
  2566. // 批量修改自定义维度
  2567. checkedWudulist(e){
  2568. // console.log(e);
  2569. this.checkedProjectArr = e
  2570. },
  2571. batchSetWudulistBtn1(){
  2572. this.$refs.projectlistOfWudulist.clearSelection()
  2573. this.checkedWuduArr = [],
  2574. this.addGroupPersonData = {
  2575. group: null,
  2576. person: null,
  2577. personNames: ''
  2578. }
  2579. },
  2580. batchSetWudulistBtn2(e){
  2581. if(this.checkedProjectArr.length == 0){
  2582. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2583. return
  2584. }
  2585. this.checkoradd = e
  2586. this.checkedWuduDialog = true
  2587. },
  2588. batchSetWudulistBtn3(){
  2589. if(this.checkedWuduArr.length == 0){
  2590. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  2591. return
  2592. }
  2593. let projectIds = []
  2594. for(let i=0; i<this.checkedProjectArr.length; i++){
  2595. projectIds.push(this.checkedProjectArr[i].id)
  2596. }
  2597. let degreeIds = []
  2598. let degreeNames = []
  2599. for(let s=0; s<this.checkedWuduArr.length; s++){
  2600. degreeIds.push(this.checkedWuduArr[s].id)
  2601. degreeNames.push(this.checkedWuduArr[s].name)
  2602. }
  2603. this.http.post('/project/saveBatchAccoDegrees',{
  2604. ids: JSON.stringify(projectIds),
  2605. associateDegrees: degreeIds.toString(),
  2606. associateDegreeNames: degreeNames.toString()
  2607. },res => {
  2608. if(res.code == 'ok'){
  2609. this.checkedWuduDialog = false
  2610. this.batchSetWudulistBtn1()
  2611. this.$message({
  2612. message: this.$t('setupthesuccess'),
  2613. type: 'success'
  2614. })
  2615. this.getList()
  2616. }else {
  2617. this.$message({
  2618. message: res.msg,
  2619. type: 'error'
  2620. })
  2621. }
  2622. },err => {
  2623. this.$message({
  2624. message: err,
  2625. type: 'error'
  2626. })
  2627. })
  2628. },
  2629. batchSetWudulistBtn4(){
  2630. if(this.checkedWuduArr.length == 0){
  2631. this.$message(this.$t('defaultText.pleaseChoose') + this.user.timeType.customDegreeName)
  2632. return
  2633. }
  2634. let projectIds = []
  2635. for(let i=0; i<this.checkedProjectArr.length; i++){
  2636. projectIds.push(this.checkedProjectArr[i].id)
  2637. }
  2638. let degreeIds = []
  2639. let degreeNames = []
  2640. for(let s=0; s<this.checkedWuduArr.length; s++){
  2641. degreeIds.push(this.checkedWuduArr[s].id)
  2642. degreeNames.push(this.checkedWuduArr[s].name)
  2643. }
  2644. this.http.post('/project/addBatchAccoDegrees',{
  2645. ids: JSON.stringify(projectIds),
  2646. associateDegrees: degreeIds.toString(),
  2647. associateDegreeNames: degreeNames.toString()
  2648. },res => {
  2649. if(res.code == 'ok'){
  2650. this.checkedWuduDialog = false
  2651. this.batchSetWudulistBtn1()
  2652. this.$message({
  2653. message: this.$t('addsuccessful'),
  2654. type: 'success'
  2655. })
  2656. this.getList()
  2657. }else {
  2658. this.$message({
  2659. message: res.msg,
  2660. type: 'error'
  2661. })
  2662. }
  2663. },err => {
  2664. this.$message({
  2665. message: err,
  2666. type: 'error'
  2667. })
  2668. })
  2669. },
  2670. isSelectable(row,index){
  2671. if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectManagement){
  2672. return true
  2673. }else{
  2674. return false
  2675. }
  2676. },
  2677. test(row){
  2678. // console.log(row);
  2679. },
  2680. //批量增加任务分组
  2681. addTaskGroup(){
  2682. if(this.checkedProjectArr.length == 0){
  2683. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2684. return
  2685. }
  2686. this.addTaskGroupDig=true
  2687. },
  2688. // 重新定义了 addGroup 方法
  2689. addGroup(formName) {
  2690. // return
  2691. let proArr = []
  2692. for(let i=0;i<this.checkedProjectArr.length;i++){
  2693. proArr.push(this.checkedProjectArr[i].id)
  2694. }
  2695. this.groupForm={
  2696. ...this.groupForm,
  2697. projectIds:proArr.join(',')
  2698. }
  2699. this.$refs[formName].validate((valid) => {
  2700. if (valid) {
  2701. this.http.post('/task-group/save',this.groupForm,
  2702. res => {
  2703. if (res.code == "ok") {
  2704. this.$message({
  2705. message: "操作成功",
  2706. type: "success"
  2707. });
  2708. } else {
  2709. this.$message({
  2710. message: res.msg,
  2711. type: "error"
  2712. });
  2713. }
  2714. },
  2715. error => {
  2716. this.$message({
  2717. message: error,
  2718. type: "error"
  2719. });
  2720. });
  2721. } else {
  2722. console.log('error submit!!');
  2723. return false;
  2724. }
  2725. });
  2726. },
  2727. createGroup() {
  2728. this.addGroupDialog = true;
  2729. this.groupForm = {projectId: this.curProjectId};
  2730. },
  2731. batchAddTaskGroup(){
  2732. if(!this.batchAddTaskGroupName){
  2733. this.$message({
  2734. message: '请填写分组名称',
  2735. type: 'warning'
  2736. })
  2737. return
  2738. }
  2739. let proArr = []
  2740. for(let i=0;i<this.checkedProjectArr.length;i++){
  2741. proArr.push(this.checkedProjectArr[i].id)
  2742. }
  2743. this.http.post("/task-group/batchSaveTaskGroup",{
  2744. taskGroupName:this.batchAddTaskGroupName,
  2745. projectIds:proArr.join(",")
  2746. },res=>{
  2747. if(res.code == 'ok'){
  2748. this.$message({
  2749. message: '操作成功',
  2750. type: 'success'
  2751. })
  2752. this.addTaskGroupDig=false
  2753. this.batchAddTaskGroupName=null
  2754. }else {
  2755. this.$message({
  2756. message: res.msg,
  2757. type: 'error'
  2758. })
  2759. }
  2760. },err=>{
  2761. this.$message({
  2762. message: err,
  2763. type: 'error'
  2764. })
  2765. })
  2766. },
  2767. //批量设置分组负责人
  2768. setGroupIncharger(){
  2769. let proArr = []
  2770. for(let i=0;i<this.checkedProjectArr.length;i++){
  2771. proArr.push(this.checkedProjectArr[i].id)
  2772. }
  2773. if(this.checkedProjectArr.length == 0){
  2774. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2775. return
  2776. }
  2777. this.addTaskGroupInchargerDig=true
  2778. this.http.post("/task-group/getAllHadGroup",{
  2779. projectIds:proArr.join(",")
  2780. },res=>{
  2781. if(res.code == 'ok'){
  2782. this.hasSetGroupList=res.data
  2783. }else {
  2784. this.$message({
  2785. message: res.msg,
  2786. type: 'error'
  2787. })
  2788. }
  2789. },err=>{
  2790. this.$message({
  2791. message: err,
  2792. type: 'error'
  2793. })
  2794. })
  2795. },
  2796. batchSetGroupIncharger(){
  2797. if(!this.hasSetGroupName){
  2798. this.$message({
  2799. message: '请选择任务分组',
  2800. type: 'warning'
  2801. })
  2802. return
  2803. }
  2804. if(!this.hasSetGroupInchargerId){
  2805. this.$message({
  2806. message: '请选择分组负责人',
  2807. type: 'warning'
  2808. })
  2809. return
  2810. }
  2811. let proArr = []
  2812. for(let i=0;i<this.checkedProjectArr.length;i++){
  2813. proArr.push(this.checkedProjectArr[i].id)
  2814. }
  2815. this.http.post("/task-group/batchSetGroupIncharger",{
  2816. taskGroupName:this.hasSetGroupName,
  2817. projectIds:proArr.join(","),
  2818. inchargerId:this.hasSetGroupInchargerId
  2819. },res=>{
  2820. if(res.code == 'ok'){
  2821. this.$message({
  2822. message: '操作成功',
  2823. type: 'success'
  2824. })
  2825. this.addTaskGroupInchargerDig=false
  2826. this.hasSetGroupInchargerId=null
  2827. this.hasSetGroupName=null
  2828. }else {
  2829. this.$message({
  2830. message: res.msg,
  2831. type: 'error'
  2832. })
  2833. }
  2834. },err=>{
  2835. this.$message({
  2836. message: err,
  2837. type: 'error'
  2838. })
  2839. })
  2840. },
  2841. // 批量添加分组参与人员
  2842. addGroupPerson(){
  2843. let proArr = []
  2844. if(this.checkedProjectArr.length == 0){
  2845. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2846. return
  2847. }
  2848. this.addGroupPersonBtnLoading = true
  2849. this.isAddGroupPerson = true
  2850. for(let i=0;i<this.checkedProjectArr.length;i++){
  2851. proArr.push(this.checkedProjectArr[i].id)
  2852. }
  2853. this.http.post('/project/getProjectsGroups',{
  2854. projectIdArray: JSON.stringify(proArr)
  2855. },res => {
  2856. if(res.code == 'ok'){
  2857. // console.log('分组',res.data);
  2858. this.addGroupList = res.data
  2859. this.addGroupPersonBtnLoading = false
  2860. this.addGroupPersonDialog = true
  2861. }else {
  2862. this.$message({
  2863. message: res.msg,
  2864. type: 'error'
  2865. })
  2866. }
  2867. },err => {
  2868. this.$message({
  2869. message: err,
  2870. type: 'error'
  2871. })
  2872. })
  2873. },
  2874. addGroupPersonP(){
  2875. this.filterText2 = ''
  2876. this.addGroupPersonPdialog = true
  2877. },
  2878. addPersonCheck(){
  2879. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  2880. var list = chosenList.filter(item=>item.isUser == 1);
  2881. this.chosenMembCount = list.length;
  2882. // console.log(list);
  2883. },
  2884. addPersonSure(){
  2885. this.addGroupPersonPdialog = false
  2886. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  2887. let list = chosenList.filter(item=>item.isUser == 1);
  2888. let listIDs = []
  2889. let listNames = ''
  2890. let listNamesList = []
  2891. for(let i=0;i<list.length;i++){
  2892. listIDs.push(list[i].id)
  2893. listNames += list[i].label + ','
  2894. listNamesList.push(list[i].label)
  2895. }
  2896. this.addGroupPersonData.person = listIDs
  2897. this.addGroupPersonData.personNames = listNames
  2898. this.addGroupPersonDataPersonNames = listNamesList
  2899. console.log('触发', this.addGroupPersonDataPersonNames)
  2900. },
  2901. addGroupPersonSure(){
  2902. if(this.addGroupPersonData.group.length == 0 || this.addGroupPersonData.person == null){
  2903. this.$message({
  2904. message: this.$t('pleaseselectpersonnelasd'),
  2905. type: 'warning'
  2906. })
  2907. return
  2908. }
  2909. let groupList = []
  2910. for(let i=0;i<this.addGroupPersonData.group.length;i++){
  2911. groupList = [...groupList,...this.addGroupPersonData.group[i]]
  2912. }
  2913. this.http.post('/project/batchAddMembToGroup',{
  2914. membIdArray: JSON.stringify(this.addGroupPersonData.person),
  2915. groupIds: JSON.stringify(groupList)
  2916. },res => {
  2917. if(res.code == 'ok'){
  2918. this.addGroupPersonDialog = false,
  2919. this.batchSetWudulistBtn1()
  2920. this.$message({
  2921. message: this.$t('addsuccessful'),
  2922. type: 'success'
  2923. })
  2924. this.getList()
  2925. }else {
  2926. this.$message({
  2927. message: res.msg,
  2928. type: 'error'
  2929. })
  2930. }
  2931. },err => {
  2932. this.$message({
  2933. message: err,
  2934. type: 'error'
  2935. })
  2936. })
  2937. },
  2938. batchDelete(){
  2939. if(this.checkedProjectArr.length == 0){
  2940. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2941. return
  2942. }
  2943. let proArr = []
  2944. for(let i=0;i<this.checkedProjectArr.length;i++){
  2945. proArr.push(this.checkedProjectArr[i].id)
  2946. // proArr += this.checkedProjectArr[i].id + ','
  2947. }
  2948. this.isDeleting = true;
  2949. // proArr = proArr.substring(0,proArr.length - 1)
  2950. this.http.post('/project/batchDeleteProject',{
  2951. projectIdArray: JSON.stringify(proArr)
  2952. },res => {
  2953. this.isDeleting = false;
  2954. if(res.code == 'ok'){
  2955. this.$message({
  2956. message: this.$t('message.successfullyDeleted'),
  2957. type: 'success'
  2958. })
  2959. this.getList()
  2960. }else {
  2961. this.$message({
  2962. message: res.msg,
  2963. type: 'error'
  2964. })
  2965. }
  2966. },err => {
  2967. this.$message({
  2968. message: err,
  2969. type: 'error'
  2970. })
  2971. })
  2972. },
  2973. // 批量设置项目经理
  2974. batchIncharger(){
  2975. if(this.checkedProjectArr.length == 0){
  2976. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  2977. return
  2978. }
  2979. this.batchInchargerDialog = true
  2980. this.paramInchargerId = ''
  2981. },
  2982. batchInchargerSure(){
  2983. if(!this.paramInchargerId){
  2984. this.$message({
  2985. message: this.$t('pleaseselecttheprojectmanager'),
  2986. type: 'warning'
  2987. })
  2988. return
  2989. }
  2990. let proArr = ''
  2991. for(let i=0;i<this.checkedProjectArr.length;i++){
  2992. // proArr.push(this.checkedProjectArr[i].id)
  2993. proArr += this.checkedProjectArr[i].id + ','
  2994. }
  2995. proArr = proArr.substring(0,proArr.length - 1)
  2996. this.http.post('/project/batchExchangeIncharger',{
  2997. inchargerId: this.paramInchargerId,
  2998. projectIds: proArr
  2999. },res => {
  3000. if(res.code == 'ok'){
  3001. this.batchInchargerDialog = false
  3002. this.$message({
  3003. message: this.$t('setupthesuccess'),
  3004. type: 'success'
  3005. })
  3006. this.getList()
  3007. }else {
  3008. this.$message({
  3009. message: res.msg,
  3010. type: 'error'
  3011. })
  3012. }
  3013. },err => {
  3014. this.$message({
  3015. message: err,
  3016. type: 'error'
  3017. })
  3018. })
  3019. },
  3020. // 批量添加项目参与人
  3021. addProPreson(){
  3022. if(this.checkedProjectArr.length == 0){
  3023. this.$message(this.$t('defaultText.pleaseSelectSnItem'))
  3024. return
  3025. }
  3026. this.addGroupPersonDialog = true
  3027. this.isAddGroupPerson = false
  3028. },
  3029. addProPersonSure(){
  3030. if(this.addGroupPersonData.person == null){
  3031. this.$message({
  3032. message: this.$t('pleaseselectpersonnel'),
  3033. type: 'warning'
  3034. })
  3035. return
  3036. }
  3037. let proArr = []
  3038. for(let i=0;i<this.checkedProjectArr.length;i++){
  3039. proArr.push(this.checkedProjectArr[i].id)
  3040. // proArr += this.checkedProjectArr[i].id + ','
  3041. }
  3042. // proArr = proArr.substring(0,proArr.length - 1)
  3043. this.http.post('/project/batchSetParticipation',{
  3044. userIds: JSON.stringify(this.addGroupPersonData.person),
  3045. projectIdArray: JSON.stringify(proArr)
  3046. },res => {
  3047. if(res.code == 'ok'){
  3048. this.addGroupPersonDialog = false,
  3049. this.batchSetWudulistBtn1()
  3050. this.$message({
  3051. message: this.$t('addsuccessful'),
  3052. type: 'success'
  3053. })
  3054. this.getList()
  3055. }else {
  3056. this.$message({
  3057. message: res.msg,
  3058. type: 'error'
  3059. })
  3060. }
  3061. },err => {
  3062. this.$message({
  3063. message: err,
  3064. type: 'error'
  3065. })
  3066. })
  3067. },
  3068. filterNode(value, data) {
  3069. // if (!value) return true;
  3070. // return data.label.indexOf(value) !== -1;
  3071. let { userNameNeedTranslate } = this.user
  3072. console.log(value, data, '《=== 执行')
  3073. if (!value) return true;
  3074. if(userNameNeedTranslate != '1') {
  3075. return data.label.indexOf(value) !== -1;
  3076. } else {
  3077. return this.filterNodePersonnel.some(item => item.includes(data.label))
  3078. }
  3079. },
  3080. //重启项目
  3081. restartPro(row) {
  3082. this.http.post('/project/start',{id: row.id},
  3083. res => {
  3084. if (res.code == "ok") {
  3085. this.$message({
  3086. message: this.$t('restartthesuccess'),
  3087. type: "success"
  3088. });
  3089. row.status = 1;
  3090. } else {
  3091. this.$message({
  3092. message: res.msg,
  3093. type: "error"
  3094. });
  3095. }
  3096. },
  3097. error => {
  3098. this.$message({
  3099. message: error,
  3100. type: "error"
  3101. });
  3102. });
  3103. },
  3104. //撤销项目
  3105. cancelPro(row) {
  3106. this.http.post('/project/cancel',{id: row.id},
  3107. res => {
  3108. if (res.code == "ok") {
  3109. this.$message({
  3110. message: this.$t('Revocationofsuccess'),
  3111. type: "success"
  3112. });
  3113. row.status = 3;
  3114. } else {
  3115. this.$message({
  3116. message: res.msg,
  3117. type: "error"
  3118. });
  3119. }
  3120. },
  3121. error => {
  3122. this.$message({
  3123. message: error,
  3124. type: "error"
  3125. });
  3126. });
  3127. },
  3128. // 暂停项目
  3129. suspendPro(row) {
  3130. this.http.post('/project/suspend',{id: row.id},
  3131. res => {
  3132. if (res.code == "ok") {
  3133. this.$message({
  3134. message: this.$t('suspensionofsuccess'),
  3135. type: "success"
  3136. });
  3137. row.status = 4;
  3138. } else {
  3139. this.$message({
  3140. message: res.msg,
  3141. type: "error"
  3142. });
  3143. }
  3144. },
  3145. error => {
  3146. this.$message({
  3147. message: error,
  3148. type: "error"
  3149. });
  3150. });
  3151. },
  3152. //完成项目
  3153. finishPro(row) {
  3154. this.http.post('/project/finish',{id: row.id},
  3155. res => {
  3156. if (res.code == "ok") {
  3157. this.$message({
  3158. message: this.$t('projectcompletion'),
  3159. type: "success"
  3160. });
  3161. row.status = 2;
  3162. } else {
  3163. this.$message({
  3164. message: res.msg,
  3165. type: "error"
  3166. });
  3167. }
  3168. },
  3169. error => {
  3170. this.$message({
  3171. message: error,
  3172. type: "error"
  3173. });
  3174. });
  3175. },
  3176. exportProjectData() {
  3177. let param = {
  3178. status: this.status,
  3179. }
  3180. if(this.keyword){param.searchField = this.searchField;param.keyword = this.keyword}
  3181. if(this.projectMainId){param.projectMainId = this.projectMainId}
  3182. if(this.statusClf){param.category = this.statusClf}
  3183. if(this.deptId.length){param.deptId = this.deptId[this.deptId.length-1]}
  3184. if(this.inchagerId){param.inchagerId = this.inchagerId}
  3185. if(this.participationId){param.participation = this.participationId}
  3186. this.exportDisabled = true
  3187. this.exportNotification = this.$notify({
  3188. title: '导出项目',
  3189. message: '项目导出中、请稍后...',
  3190. duration: 0,
  3191. showClose: false
  3192. });
  3193. //导出项目
  3194. this.http.post('/project/exportData',param,
  3195. res => {
  3196. this.exportDisabled = false
  3197. this.exportNotification.close()
  3198. if (res.code == "ok") {
  3199. var filePath = res.data;
  3200. const a = document.createElement('a'); // 创建a标签
  3201. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  3202. a.setAttribute('href', filePath);// href链接
  3203. a.click(); //自执行点击事件
  3204. a.remove();
  3205. }
  3206. },
  3207. error => {
  3208. this.exportDisabled = false
  3209. this.exportNotification.close()
  3210. this.$message({
  3211. message: error,
  3212. type: "error"
  3213. });
  3214. }
  3215. );
  3216. },
  3217. // 编辑模板
  3218. setTemplate(t){
  3219. console.log(t);
  3220. this.setTemplateData = t
  3221. this.setTemplateData.needDelete = []
  3222. this.setTemplateDialog = true
  3223. },
  3224. choseTemplate(tIndex) {
  3225. // this.groupTemplateList.forEach((g)=>{
  3226. // g.selected = false;
  3227. // })
  3228. this.sidebarIndex = tIndex
  3229. // this.groupTemplateList[tIndex].selected = true;
  3230. this.groupTemplateList.forEach((g, i)=>{
  3231. if(tIndex == i) {
  3232. g.selected = !g.selected;
  3233. }
  3234. })
  3235. },
  3236. //删除模板
  3237. deleteTemplate(t) {
  3238. var that = this;
  3239. this.$confirm(this.$t('que-ren-yao-shan-chu')+"["+t.name+"]"+this.$t('ma'), this.$t('other.prompts'), {
  3240. //type: 'warning'
  3241. }).then(() => {
  3242. this.http.post('/group-template/deleteTemplate', {id: t.id},
  3243. res => {
  3244. if (res.code == "ok") {
  3245. this.getGroupTemplate();
  3246. this.$message({
  3247. message: this.$t('deletingTemplateSuccessfully'),
  3248. type: "success"
  3249. });
  3250. } else {
  3251. this.$message({
  3252. message: res.msg,
  3253. type: "error"
  3254. });
  3255. }
  3256. }
  3257. );
  3258. });
  3259. },
  3260. //创建模板
  3261. createTemplate() {
  3262. this.saveTemplateLoading = true;
  3263. this.http.post('/group-template/addTemplate', this.templateForm,
  3264. res => {
  3265. this.saveTemplateLoading = false;
  3266. if (res.code == "ok") {
  3267. this.addToTmpDialog = false;
  3268. this.getGroupTemplate();
  3269. this.$message({
  3270. message: this.$t('addTemplateSuccessfully'),
  3271. type: "success"
  3272. });
  3273. } else {
  3274. this.$message({
  3275. message: res.msg,
  3276. type: "error"
  3277. });
  3278. }
  3279. }
  3280. );
  3281. },
  3282. setTemplateSave(){
  3283. if(this.setTemplateData.name == '' || this.setTemplateData.name == null){
  3284. this.$message({
  3285. message: this.$t('mo-ban-ming-cheng-bu-neng-wei-kong'),
  3286. type: 'error'
  3287. })
  3288. return
  3289. }
  3290. for(let i in this.setTemplateData.stagesList){
  3291. if(this.setTemplateData.stagesList[i].stagesName == '' || this.setTemplateData.stagesList[i].stagesName == null){
  3292. this.$message({
  3293. message: this.$t('ren-wu-lie-biao-ming-cheng-bu-neng-wei-kong'),
  3294. type: 'error'
  3295. })
  3296. return
  3297. }
  3298. }
  3299. this.http.post('/task-group/setTemplate',this.setTemplateData,
  3300. res => {
  3301. if(res.code == 'ok'){
  3302. this.$message({
  3303. message: this.$t('message.modifyTheSuccess'),
  3304. type: 'success'
  3305. })
  3306. this.getGroupTemplate()
  3307. this.setTemplateDialog = false
  3308. }else{
  3309. this.$message({
  3310. message: res.msg,
  3311. type: 'error'
  3312. })
  3313. }
  3314. },err => {
  3315. this.$message({
  3316. message: err,
  3317. type: 'error'
  3318. })
  3319. })
  3320. },
  3321. addStages(){
  3322. this.setTemplateData.stagesList.push({
  3323. stagesName: '',
  3324. templateId: this.setTemplateData.id
  3325. })
  3326. },
  3327. deleteStages(item,index){
  3328. this.setTemplateData.needDelete.push(item.id)
  3329. this.setTemplateData.stagesList.splice(index,1)
  3330. console.log('deletestages',item.id);
  3331. },
  3332. exportProjectGroup() {
  3333. //导出项目分组
  3334. this.http.post('/project/exportGroupData',{projectCategorySubId:this.projectCategorySubId},
  3335. res => {
  3336. if (res.code == "ok") {
  3337. var filePath = res.data;
  3338. const a = document.createElement('a'); // 创建a标签
  3339. a.setAttribute('download', this.$t('projecttaskgroupexport') + '.xlsx');// download属性
  3340. a.setAttribute('href', filePath);// href链接
  3341. a.click(); //自执行点击事件
  3342. a.remove();
  3343. }
  3344. },
  3345. error => {
  3346. this.$message({
  3347. message: error,
  3348. type: "error"
  3349. });
  3350. }
  3351. );
  3352. },
  3353. userssHu() {
  3354. this.http.post('/time-type/getCompanyTimeSetting',{
  3355. companyId: this.user.companyId
  3356. },
  3357. res => {
  3358. if (res.code == "ok") {
  3359. this.yonghuUser = res.data
  3360. // console.log(this.yonghuUser)
  3361. }
  3362. },
  3363. error => {
  3364. this.$message({
  3365. message: error,
  3366. type: "error"
  3367. });
  3368. }
  3369. );
  3370. },
  3371. yanjiuzx() {
  3372. this.http.post('/report-extra-degree/getAll ',{},
  3373. res => {
  3374. if (res.code == "ok") {
  3375. // console.log(res, '过来的数据')
  3376. this.ause = res.data
  3377. } else {
  3378. this.$message({
  3379. message: res.msg,
  3380. type: "error"
  3381. });
  3382. }
  3383. },
  3384. error => {
  3385. this.$message({
  3386. message: error,
  3387. type: "error"
  3388. });
  3389. }
  3390. );
  3391. },
  3392. selectPublic() {
  3393. if (this.addForm.isPublic == 1) {
  3394. this.participator = this.users;
  3395. } else {
  3396. this.participator = [];
  3397. }
  3398. },
  3399. addPpMemb() {
  3400. //检查合计比例是否到达100%
  3401. let p = 0;
  3402. let hasNoMemb = false;
  3403. this.curProfessionRow.membList.forEach(m=>{
  3404. p += parseInt(m.percentage);
  3405. //检查人员是否选择
  3406. if (m.membId == null) {
  3407. hasNoMemb = true;
  3408. }
  3409. });
  3410. if (hasNoMemb) {
  3411. this.$message({
  3412. message: this.$t('professionalscannotbeempty'),
  3413. type: "error"
  3414. });
  3415. return;
  3416. }
  3417. //检查人员不能重复
  3418. let hasDuplicate = false;
  3419. this.curProfessionRow.membList.forEach(m=>{
  3420. if (this.curProfessionRow.membList.filter(innerM=>innerM.membId == m.membId).length>1) {
  3421. hasDuplicate = true;
  3422. }
  3423. });
  3424. if (hasDuplicate) {
  3425. this.$message({
  3426. message: this.$t('professionalscannotrepeat'),
  3427. type: "error"
  3428. });
  3429. return;
  3430. }
  3431. if (p != 100) {
  3432. this.$message({
  3433. message: this.$t('totalproportionmust'),
  3434. type: "error"
  3435. });
  3436. return;
  3437. }
  3438. this.editPpMembDialog = false;
  3439. this.curProfessionRow.membList.forEach(m=>{
  3440. m.membName = this.participator.filter(p=>p.id == m.membId)[0].name;
  3441. });
  3442. this.projectProfessionItem.membList = JSON.parse(JSON.stringify(this.curProfessionRow.membList));
  3443. },
  3444. //删除专业人员
  3445. deleteMembItem(index) {
  3446. this.curProfessionRow.membList.splice(index,1);
  3447. },
  3448. //添加专业人员
  3449. addMembItem() {
  3450. if (this.curProfessionRow.membList == null) {
  3451. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  3452. } else {
  3453. let p = 0;
  3454. this.curProfessionRow.membList.forEach(m=>{
  3455. p += parseInt(m.percentage);
  3456. });
  3457. this.curProfessionRow.membList.push({membId:null, percentage:100-p});
  3458. }
  3459. this.$forceUpdate();
  3460. },
  3461. showEditPpMembs(row) {
  3462. this.projectProfessionItem = row;
  3463. this.curProfessionRow = JSON.parse(JSON.stringify(row));
  3464. if (this.curProfessionRow.membList == null || this.curProfessionRow.membList.length == 0) {
  3465. this.curProfessionRow.membList = [{membId:null, percentage:100}];
  3466. }
  3467. this.editPpMembDialog = true;
  3468. },
  3469. getProjectNotifyUserList(projectId) {
  3470. this.http.post("/project-notify-user/get", {projectId: projectId},
  3471. res => {
  3472. if (res.code == "ok") {
  3473. var chosenLeaderIds = [];
  3474. var chosenLeaderNames = '';
  3475. var leaderList = res.data;
  3476. this.chosenLeaders = leaderList;
  3477. for(var j in leaderList) {
  3478. chosenLeaderIds.push(leaderList[j].userId)
  3479. chosenLeaderNames += leaderList[j].userName+',';
  3480. }
  3481. if (chosenLeaderNames.length > 0) {
  3482. chosenLeaderNames = chosenLeaderNames.substring(0, chosenLeaderNames.length -1);
  3483. }
  3484. this.addForm.notifyUserIds = chosenLeaderIds;
  3485. this.addForm.notifyUserNames = chosenLeaderNames;
  3486. } else {
  3487. this.$message({
  3488. message: res.msg,
  3489. type: "error"
  3490. });
  3491. }
  3492. },
  3493. error => {
  3494. this.$message({
  3495. message: error,
  3496. type: "error"
  3497. });
  3498. });
  3499. },
  3500. addTemplateGroup() {
  3501. var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)))
  3502. console.log(param, '你看看啊')
  3503. for(var i in param) {
  3504. delete param[i].stagesList
  3505. }
  3506. if(param.length < 1) {
  3507. this.$message({
  3508. message: this.$t('qngxuanz'),
  3509. type: "error"
  3510. });
  3511. return
  3512. }
  3513. var s = null
  3514. var k = ''
  3515. if (s){
  3516. this.addGroupDialog = false;
  3517. this.$message({
  3518. message: this.$t('projectalreadyhasgroup')+'['+k+'],'+this.$t('changethegroupname'),
  3519. type: "error"
  3520. });
  3521. return
  3522. }
  3523. console.log('将要闯过去的值', param)
  3524. let proArr = []
  3525. for(let i=0;i<this.checkedProjectArr.length;i++){
  3526. proArr.push(this.checkedProjectArr[i].id)
  3527. }
  3528. // return
  3529. // this.http.post('/task-group/createFromTemplate',param,
  3530. this.http.post('/task-group/createFromTemplate',{
  3531. templateJson: JSON.stringify(param),
  3532. projectId: this.curProjectId,
  3533. projectIds:proArr.join(",")
  3534. },
  3535. res => {
  3536. if (res.code == "ok") {
  3537. this.$message({
  3538. message: "操作成功",
  3539. type: "success"
  3540. });
  3541. this.addTaskGroupDig = false;
  3542. } else {
  3543. this.$message({
  3544. message: res.msg,
  3545. type: "error"
  3546. });
  3547. }
  3548. },
  3549. error => {
  3550. this.$message({
  3551. message: error,
  3552. type: "error"
  3553. });
  3554. });
  3555. },
  3556. getProjectProfessions(projectId) {
  3557. this.http.post("/project-profession/get", {projectId: projectId},
  3558. res => {
  3559. if (res.code == "ok") {
  3560. this.projectProfessionList = res.data;
  3561. } else {
  3562. this.$message({
  3563. message: res.msg,
  3564. type: "error"
  3565. });
  3566. }
  3567. },
  3568. error => {
  3569. this.$message({
  3570. message: error,
  3571. type: "error"
  3572. });
  3573. });
  3574. },
  3575. checkProjectProfession() {
  3576. //检查合计比例是否到达100%
  3577. let p = 0;
  3578. let hasNoMemb = false;
  3579. let hasNoProfession = false;
  3580. let hasNoMembList = false;
  3581. this.projectProfessionList.forEach(m=>{
  3582. p += parseInt(m.percentage);
  3583. //检查人员是否选择
  3584. if (m.inchargerId == null) {
  3585. hasNoMemb = true;
  3586. }
  3587. if (m.professionId == null) {
  3588. hasNoProfession = true;
  3589. }
  3590. if (m.membList == null) {
  3591. hasNoMembList = true;
  3592. }
  3593. });
  3594. if (hasNoProfession) {
  3595. this.$message({
  3596. message: this.$t('majorcannotbeempty'),
  3597. type: "error"
  3598. });
  3599. return false;
  3600. }
  3601. if (hasNoMembList) {
  3602. this.$message({
  3603. message: this.$t('personnelcannotbeleftblank'),
  3604. type: "error"
  3605. });
  3606. return false;
  3607. }
  3608. if (hasNoMemb) {
  3609. this.$message({
  3610. message: this.$t('leadercannotbeblank'),
  3611. type: "error"
  3612. });
  3613. return false;
  3614. }
  3615. //检查专业不能重复
  3616. let hasDuplicate = false;
  3617. this.projectProfessionList.forEach(m=>{
  3618. if (this.projectProfessionList.filter(innerM=>innerM.professionId == m.professionId).length>1) {
  3619. hasDuplicate = true;
  3620. }
  3621. });
  3622. if (hasDuplicate) {
  3623. this.$message({
  3624. message: this.$t('shouldnotberepeated'),
  3625. type: "error"
  3626. });
  3627. return false;
  3628. }
  3629. if (this.projectProfessionList.length > 0 && p != 100) {
  3630. this.$message({
  3631. message: this.$t('numberomajorsmust'),
  3632. type: "error"
  3633. });
  3634. return false;
  3635. }
  3636. return true;
  3637. },
  3638. //保存项目专业
  3639. saveProjectProfessions(projectId) {
  3640. var list = this.projectProfessionList.filter(p=>p.professionId != null);
  3641. list.forEach(p=>p.inchargerName = this.participator.filter(m=>m.id == p.inchargerId)[0].name);
  3642. list.forEach(p=>p.professionName = this.professionList.filter(m=>m.id == p.professionId)[0].name);
  3643. this.http.post("/project-profession/modify", {projectId: projectId, json: JSON.stringify(list)},
  3644. res => {
  3645. if (res.code == "ok") {
  3646. return false;
  3647. } else {
  3648. this.$message({
  3649. message: res.msg,
  3650. type: "error"
  3651. });
  3652. }
  3653. },
  3654. error => {
  3655. this.$message({
  3656. message: error,
  3657. type: "error"
  3658. });
  3659. });
  3660. },
  3661. //删除项目专业
  3662. deleteItem(index) {
  3663. this.projectProfessionList.splice(index,1);
  3664. },
  3665. //添加项目专业
  3666. addItem() {
  3667. let p = 0;
  3668. this.projectProfessionList.forEach(m=>{
  3669. p += parseInt(m.percentage);
  3670. });
  3671. this.projectProfessionList.push( { professionId:null, inchargerId:null,membIds:[], percentage: 100-p});
  3672. },
  3673. getProfessionList() {
  3674. this.http.post("/profession/getAll", {},
  3675. res => {
  3676. if (res.code == "ok") {
  3677. var list = res.data;
  3678. this.professionList = list;
  3679. } else {
  3680. this.$message({
  3681. message: res.msg,
  3682. type: "error"
  3683. });
  3684. }
  3685. },
  3686. error => {
  3687. this.$message({
  3688. message: error,
  3689. type: "error"
  3690. });
  3691. });
  3692. },
  3693. restrictNumber(targetId) {
  3694. let inpu = document.getElementById(targetId);
  3695. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3696. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3697. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3698. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3699. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3700. inpu.value = parseFloat(inpu.value);
  3701. }
  3702. },
  3703. showChooseLeaderTree() {
  3704. this.chosenMembCount = this.chosenLeaders.length;
  3705. this.chooseLeaderVisible = true;
  3706. },
  3707. onLeaderTreeItemChange() {
  3708. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  3709. var list = chosenList.filter(item=>item.isUser == 1);
  3710. this.chosenMembCount = list.length;
  3711. },
  3712. showChooseMembTree() {
  3713. this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
  3714. this.chosenMembCount = this.participator.length;
  3715. this.chooseParticipVisible = true;
  3716. this.filterText = ''
  3717. this.wxFilterText = ''
  3718. if(this.user.userNameNeedTranslate == 1) {
  3719. this.getDepartment()
  3720. }
  3721. let that = this
  3722. setTimeout(()=>{
  3723. that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
  3724. }, 500)
  3725. console.log(this.chosenListBackup, '备份的数据')
  3726. },
  3727. onTreeItemChange() {
  3728. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3729. var list = chosenList.filter(item=>item.isUser == 1);
  3730. this.chosenMembCount = list.length;
  3731. },
  3732. findUserInTree() {
  3733. if (this.filterName == '') {
  3734. this.deptMembData = this.allMembData;
  3735. } else {
  3736. var list = this.findRecursively(this.filterName, this.allMembData);
  3737. this.deptMembData = list;
  3738. }
  3739. },
  3740. findRecursively(username, list) {
  3741. var filterList = [];
  3742. for (var i=0;i<list.length; i++) {
  3743. if (list[i].isUser == 1) {
  3744. if (list[i].label.indexOf(username) >= 0) {
  3745. //匹配上了
  3746. filterList.push(list[i]);
  3747. }
  3748. } else if (list[i].children != null && list[i].children.length > 0) {
  3749. var subList = this.findRecursively(username, list[i].children);
  3750. if (subList.length > 0) {
  3751. subList.forEach(s=>filterList.push(s));
  3752. }
  3753. }
  3754. }
  3755. return filterList;
  3756. },
  3757. //确定选择参与人
  3758. chooseParticip() {
  3759. this.chooseParticipVisible = false;
  3760. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3761. if(this.searchPersonnelFlg) {
  3762. chosenList = [...chosenList, ...this.chosenListBackup]
  3763. }
  3764. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3765. this.addForm.userNames = '';
  3766. this.addFormUserNames = []
  3767. this.addForm.userId = [];
  3768. this.participator = [];
  3769. for (var i=0;i<this.chosenMembList.length; i++) {
  3770. this.addForm.userId.push(this.chosenMembList[i].id);
  3771. this.addForm.userNames += this.chosenMembList[i].label+',';
  3772. this.addFormUserNames.push(this.chosenMembList[i].label)
  3773. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3774. this.participator.push(item);
  3775. }
  3776. if (this.addForm.userNames.length > 0) {
  3777. this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
  3778. // this.addFormUserNames = this.addFormUserNames.substring(0, this.addFormUserNames.length-1);
  3779. }
  3780. console.log(this.addForm.userId)
  3781. console.log(this.addForm.userNames)
  3782. console.log(this.addFormUserNames)
  3783. },
  3784. //选中相关领导
  3785. // chooseLeader() {
  3786. // this.chooseLeaderVisible = false;
  3787. // var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  3788. // var chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3789. // this.addForm.notifyUserNames = '';
  3790. // this.addForm.notifyUserIds = [];
  3791. // this.chosenLeaders = [];
  3792. // for (var i=0;i<chosenMembList.length; i++) {
  3793. // this.addForm.notifyUserIds.push(chosenMembList[i].id);
  3794. // this.addForm.notifyUserNames += chosenMembList[i].label+',';
  3795. // var item = {userId:chosenMembList[i].id, userName:chosenMembList[i].label};
  3796. // this.chosenLeaders.push(item);
  3797. // }
  3798. // if (this.addForm.notifyUserNames.length > 0) {
  3799. // this.addForm.notifyUserNames = this.addForm.notifyUserNames.substring(0, this.addForm.notifyUserNames.length-1);
  3800. // }
  3801. // },
  3802. // 获取部门列表
  3803. getDepartment() {
  3804. this.http.post("/department/listAllMemb", {},
  3805. res => {
  3806. if (res.code == "ok") {
  3807. var list = res.data;
  3808. //设置员工到部门下面
  3809. this.setUserToDept(list);
  3810. this.deptMembData = list;
  3811. console.log(this.deptMembData, '看看数据')
  3812. //用于筛选过滤
  3813. this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
  3814. } else {
  3815. this.$message({
  3816. message: res.msg,
  3817. type: "error"
  3818. });
  3819. }
  3820. },
  3821. error => {
  3822. this.$message({
  3823. message: error,
  3824. type: "error"
  3825. });
  3826. });
  3827. },
  3828. // 获取部门列表
  3829. getDepartment2() {
  3830. this.http.post(
  3831. this.port.manage.depList,{},
  3832. (res) => {
  3833. if (res.code == "ok") {
  3834. var list = res.data
  3835. this.buOption = this.changeArr(JSON.parse(JSON.stringify(list)));
  3836. } else {
  3837. this.$message({
  3838. message: res.msg,
  3839. type: "error",
  3840. });
  3841. }
  3842. },
  3843. (error) => {
  3844. this.$message({
  3845. message: error,
  3846. type: "error",
  3847. });
  3848. }
  3849. );
  3850. },
  3851. // 修改数组
  3852. changeArr(arr) {
  3853. for (var i = 0; i < arr.length; i++) {
  3854. if(arr[i].id != -1 && arr[i].id != 0) {
  3855. // if(arr[i].userList) {
  3856. // if(arr[i].userList.length > 0) {
  3857. // arr[i].children = arr[i].userList
  3858. // }
  3859. // }
  3860. if (arr[i].children != null && arr[i].children.length>0) {
  3861. arr[i].children = this.changeArr(arr[i].children);
  3862. }
  3863. arr[i].id && (arr[i].value = arr[i].id);
  3864. delete arr[i].id;
  3865. }
  3866. }
  3867. for(var i in arr) {
  3868. if(arr[i].id == -1 || arr[i].id == 0) {
  3869. arr.splice(i,1)
  3870. }
  3871. }
  3872. return arr;
  3873. },
  3874. // 企业微信搜索
  3875. echartDepartment() {
  3876. console.log('我点击了搜索')
  3877. if(this.filterText != '') {
  3878. this.http.post("/user/getEmployeeList", {
  3879. keyword: this.filterText,
  3880. cursor: '',
  3881. departmentId: -1,
  3882. pageIndex: 1,
  3883. pageSize: 1000
  3884. },
  3885. res => {
  3886. if (res.code == "ok") {
  3887. this.filterNodePersonnel = res.data.records.map(item => item.name)
  3888. this.$refs.chooseMembTree.filter(this.filterText);
  3889. } else {
  3890. this.$message({
  3891. message: res.msg,
  3892. type: "error"
  3893. });
  3894. }
  3895. },
  3896. error => {
  3897. this.$message({
  3898. message: error,
  3899. type: "error"
  3900. });
  3901. });
  3902. } else {
  3903. this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
  3904. this.searchPersonnelFlg = false
  3905. this.getDepartment()
  3906. }
  3907. },
  3908. setUserToDept(list) {
  3909. for (var i in list) {
  3910. if (list[i].children != null) {
  3911. this.setUserToDept(list[i].children);
  3912. }
  3913. if (list[i].userList != null) {
  3914. if (list[i].children == null) {
  3915. list[i].children = [];
  3916. }
  3917. list[i].userList.forEach(element => {
  3918. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  3919. list[i].children.push(obj);
  3920. });
  3921. }
  3922. }
  3923. },
  3924. // 获取分类条目
  3925. getClfConfigList() {
  3926. this.http.get('/project-category/list',
  3927. res => {
  3928. if (res.code == "ok") {
  3929. this.baseClfList = res.data;
  3930. // console.log("获取分类条目",res.data);
  3931. this.$forceUpdate();
  3932. } else {
  3933. this.$message({
  3934. message: res.msg,
  3935. type: "error"
  3936. });
  3937. }
  3938. },
  3939. error => {
  3940. this.$message({
  3941. message: error,
  3942. type: "error"
  3943. });
  3944. }
  3945. );
  3946. },
  3947. // 新增/编辑 分类条目
  3948. addNewClf(row) {
  3949. this.addClfDialog = true;
  3950. if (row == null) {
  3951. this.addClf = {}
  3952. } else {
  3953. this.addClf = row;
  3954. }
  3955. },
  3956. // 提交
  3957. submitClf() {
  3958. this.addClf.proBuAudit ? this.addClf.proBuAudit =1 : this.addClf.proBuAudit = 0
  3959. this.addClf.proInchargerAudit ? this.addClf.proInchargerAudit = 1 : this.addClf.proInchargerAudit = 0
  3960. this.http.post('/project-category/addOrMod',this.addClf,
  3961. res => {
  3962. if (res.code == "ok") {
  3963. this.addClfDialog = false;
  3964. this.auditProcessDialog=false;
  3965. this.baseClfList = res.data;
  3966. // this.$forceUpdate();
  3967. // console.log(res.data);
  3968. } else {
  3969. this.$message({
  3970. message: res.msg,
  3971. type: "error"
  3972. });
  3973. }
  3974. },
  3975. error => {
  3976. this.$message({
  3977. message: error,
  3978. type: "error"
  3979. });
  3980. }
  3981. );
  3982. },
  3983. // 提交
  3984. submitManPro() {
  3985. this.http.post('/project-main/addOrMod',this.addMainForm,
  3986. res => {
  3987. if (res.code == "ok") {
  3988. this.addFlgmainProjectDialog = false;
  3989. this.getMainProject()
  3990. } else {
  3991. this.$message({
  3992. message: res.msg,
  3993. type: "error"
  3994. });
  3995. }
  3996. },
  3997. error => {
  3998. this.$message({
  3999. message: error,
  4000. type: "error"
  4001. });
  4002. }
  4003. );
  4004. },
  4005. // 分类绑定审核流程设置
  4006. auditProcess(row) {
  4007. this.auditProcessDialog = true;
  4008. row.proBuAudit ? row.proBuAudit = true : row.proBuAudit = false
  4009. row.proInchargerAudit ? row.proInchargerAudit = true : row.proInchargerAudit = false
  4010. if (row == null) {
  4011. this.addClf = {}
  4012. } else {
  4013. this.addClf = row;
  4014. }
  4015. },
  4016. // 提交项目阶段
  4017. submitPanthPro() {
  4018. this.http.post('/project-stage/addOrMod',this.addPanthForm,
  4019. res => {
  4020. if (res.code == "ok") {
  4021. this.addFlgPanthProjectDialog = false;
  4022. this.obtainPhase()
  4023. } else {
  4024. this.$message({
  4025. message: res.msg,
  4026. type: "error"
  4027. });
  4028. }
  4029. },
  4030. error => {
  4031. this.$message({
  4032. message: error,
  4033. type: "error"
  4034. });
  4035. }
  4036. );
  4037. },
  4038. // 删除
  4039. deleteClf(row) {
  4040. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingCategoryEntry'), {
  4041. confirmButtonText: this.$t('btn.determine'),
  4042. cancelButtonText: this.$t('btn.cancel'),
  4043. type: "warning"
  4044. })
  4045. .then(() => {
  4046. this.listLoading = true;
  4047. this.http.post('/project-category/delete',{
  4048. id: row.id
  4049. },
  4050. res => {
  4051. this.listLoading = false;
  4052. if (res.code == "ok") {
  4053. this.$message({
  4054. message: this.$t('message.successfullyDeleted'),
  4055. type: "success"
  4056. });
  4057. this.getClfConfigList();
  4058. } else {
  4059. this.$message({
  4060. message: res.msg,
  4061. type: "error"
  4062. });
  4063. }
  4064. },
  4065. error => {
  4066. this.listLoading = false;
  4067. this.$message({
  4068. message: error,
  4069. type: "error"
  4070. });
  4071. }
  4072. );
  4073. })
  4074. .catch(() => {});
  4075. },
  4076. // 删除主项目
  4077. deleteManPro(row) {
  4078. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethemainproject'), {
  4079. confirmButtonText: this.$t('btn.determine'),
  4080. cancelButtonText: this.$t('btn.cancel'),
  4081. type: "warning"
  4082. })
  4083. .then(() => {
  4084. this.listLoading = true;
  4085. this.http.post('/project-main/delete',{
  4086. id: row.id
  4087. },
  4088. res => {
  4089. this.listLoading = false;
  4090. if (res.code == "ok") {
  4091. this.$message({
  4092. message: this.$t('message.successfullyDeleted'),
  4093. type: "success"
  4094. });
  4095. this.getMainProject();
  4096. } else {
  4097. this.$message({
  4098. message: res.msg,
  4099. type: "error"
  4100. });
  4101. }
  4102. },
  4103. error => {
  4104. this.listLoading = false;
  4105. this.$message({
  4106. message: error,
  4107. type: "error"
  4108. });
  4109. }
  4110. );
  4111. })
  4112. .catch(() => {});
  4113. },
  4114. // 删除项目阶段
  4115. deletePanthPro(row) {
  4116. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingprojectphases'), {
  4117. confirmButtonText: this.$t('btn.determine'),
  4118. cancelButtonText: this.$t('btn.cancel'),
  4119. type: "warning"
  4120. })
  4121. .then(() => {
  4122. this.listLoading = true;
  4123. this.http.post('/project-stage/delete ',{
  4124. id: row.id
  4125. },
  4126. res => {
  4127. this.listLoading = false;
  4128. if (res.code == "ok") {
  4129. this.$message({
  4130. message: this.$t('message.successfullyDeleted'),
  4131. type: "success"
  4132. });
  4133. this.obtainPhase();
  4134. } else {
  4135. this.$message({
  4136. message: res.msg,
  4137. type: "error"
  4138. });
  4139. }
  4140. },
  4141. error => {
  4142. this.listLoading = false;
  4143. this.$message({
  4144. message: error,
  4145. type: "error"
  4146. });
  4147. }
  4148. );
  4149. })
  4150. .catch(() => {});
  4151. },
  4152. // 分类筛选
  4153. searchClfList(){
  4154. this.page = 1;
  4155. this.getList();
  4156. },
  4157. manageSelect(){
  4158. this.page = 1
  4159. this.getList()
  4160. },
  4161. getProjectBaseConfigList() {
  4162. this.http.post('/project-basecost-setting/list',{},
  4163. res => {
  4164. if (res.code == "ok") {
  4165. this.baseCostItemList = res.data;
  4166. this.$forceUpdate();
  4167. } else {
  4168. this.$message({
  4169. message: res.msg,
  4170. type: "error"
  4171. });
  4172. }
  4173. },
  4174. error => {
  4175. this.$message({
  4176. message: error,
  4177. type: "error"
  4178. });
  4179. }
  4180. );
  4181. },
  4182. deletekeyNodes(row) {
  4183. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletingKeyNode'), {
  4184. confirmButtonText: this.$t('btn.determine'),
  4185. cancelButtonText: this.$t('btn.cancel'),
  4186. type: "warning"
  4187. })
  4188. .then(() => {
  4189. this.listLoading = true;
  4190. this.http.post('/project-key-nodes-setting/delete',{
  4191. id: row.id
  4192. },
  4193. res => {
  4194. this.listLoading = false;
  4195. if (res.code == "ok") {
  4196. this.$message({
  4197. message: this.$t('message.successfullyDeleted'),
  4198. type: "success"
  4199. });
  4200. this.getkeyNodes();
  4201. } else {
  4202. this.$message({
  4203. message: res.msg,
  4204. type: "error"
  4205. });
  4206. }
  4207. },
  4208. error => {
  4209. this.listLoading = false;
  4210. this.$message({
  4211. message: error,
  4212. type: "error"
  4213. });
  4214. }
  4215. );
  4216. })
  4217. .catch(() => {});
  4218. },
  4219. syncProjectForThird(hasChooseProjectCode){
  4220. let url=''
  4221. let param={}
  4222. if(this.user.timeType.syncFanwei==1){
  4223. // 美莱德同步项目信息来源泛微
  4224. url='/project/syncProjectWithFanwei'
  4225. }else if(this.user.timeType.syncSap==1){
  4226. // 依斯倍同步项目信息来源SAP
  4227. url='/project/syncProjectWithSap'
  4228. if(hasChooseProjectCode){
  4229. param={
  4230. projectCodes: this.synchronizationVal == '0' ? hasChooseProjectCode.toString() : this.synchronizationInputVal
  4231. }
  4232. }
  4233. }
  4234. this.$confirm('确认同步项目数据?','提示',{
  4235. confirmButtonText: '确定',
  4236. cancelButtonText: '取消',
  4237. type: 'info'
  4238. }).then(()=>{
  4239. const loading = this.$loading({
  4240. lock: true,
  4241. text: '正在同步中,请耐心等待。',
  4242. spinner: 'el-icon-loading',
  4243. background: 'rgba(0, 0, 0, 0.7)'
  4244. });
  4245. this.http.post(url,param,
  4246. res => {
  4247. loading.close();
  4248. console.log(res, 'res')
  4249. if (res.code == "ok") {
  4250. this.$message({
  4251. message: '项目同步成功',
  4252. type: "success"
  4253. });
  4254. this.syncProjectDig=false
  4255. this.hasChooseProjectCode=[]
  4256. } else {
  4257. this.$message({
  4258. message: res.msg,
  4259. type: "error"
  4260. });
  4261. }
  4262. },
  4263. error => {
  4264. loading.close();
  4265. console.log(error, 'res')
  4266. this.$message({
  4267. message: error,
  4268. type: "error"
  4269. });
  4270. }
  4271. );
  4272. }).catch(() => {
  4273. });
  4274. },
  4275. deleteBaseItem(row) {
  4276. this.$confirm(this.$t('operationmaycausedatalossAreyousuredeletethedata'),this.$t('deletethecostbaselineitem'), {
  4277. confirmButtonText: this.$t('btn.determine'),
  4278. cancelButtonText: this.$t('btn.cancel'),
  4279. type: "warning"
  4280. })
  4281. .then(() => {
  4282. this.listLoading = true;
  4283. this.http.post('/project-basecost-setting/delete',{
  4284. id: row.id
  4285. },
  4286. res => {
  4287. this.listLoading = false;
  4288. if (res.code == "ok") {
  4289. this.$message({
  4290. message: this.$t('message.successfullyDeleted'),
  4291. type: "success"
  4292. });
  4293. this.getProjectBaseConfigList();
  4294. } else {
  4295. this.$message({
  4296. message: res.msg,
  4297. type: "error"
  4298. });
  4299. }
  4300. },
  4301. error => {
  4302. this.listLoading = false;
  4303. this.$message({
  4304. message: error,
  4305. type: "error"
  4306. });
  4307. }
  4308. );
  4309. })
  4310. .catch(() => {});
  4311. },
  4312. submitInsertBaseItem() {
  4313. this.http.post('/project-basecost-setting/addOrMod',this.addForm,
  4314. res => {
  4315. if (res.code == "ok") {
  4316. this.addBaseItemDialog = false;
  4317. this.baseCostItemList = res.data;
  4318. this.$forceUpdate();
  4319. } else {
  4320. this.$message({
  4321. message: res.msg,
  4322. type: "error"
  4323. });
  4324. }
  4325. },
  4326. error => {
  4327. this.$message({
  4328. message: error,
  4329. type: "error"
  4330. });
  4331. }
  4332. );
  4333. },
  4334. submitkeyNodes() {
  4335. // console.log(this.addForm, '提交的参数')
  4336. // return
  4337. this.http.post('/project-key-nodes-setting/addOrMod',this.addFormkeyNodes,
  4338. res => {
  4339. if (res.code == "ok") {
  4340. this.addBasekeyNodesialog = false;
  4341. this.keyNodesList = res.data;
  4342. this.$forceUpdate();
  4343. } else {
  4344. this.$message({
  4345. message: res.msg,
  4346. type: "error"
  4347. });
  4348. }
  4349. },
  4350. error => {
  4351. this.$message({
  4352. message: error,
  4353. type: "error"
  4354. });
  4355. }
  4356. );
  4357. },
  4358. showBaseCostItemDialog() {
  4359. this.showBaseConfig = true;
  4360. },
  4361. addNewBaseItem(row) {
  4362. this.addBaseItemDialog = true;
  4363. if (row == null) {
  4364. this.addForm = {alarmType: 0}
  4365. } else {
  4366. this.addForm = JSON.parse(JSON.stringify(row));
  4367. }
  4368. },
  4369. //获取客户列表
  4370. getCustomerList() {
  4371. this.http.post('/customer-info/getAll', {
  4372. },
  4373. res => {
  4374. if (res.code == "ok") {
  4375. this.customerList = res.data;
  4376. } else {
  4377. this.$message({
  4378. message: res.msg,
  4379. type: "error"
  4380. });
  4381. }
  4382. },
  4383. error => {
  4384. this.$message({
  4385. message: error,
  4386. type: "error"
  4387. });
  4388. });
  4389. },
  4390. importProjectBefore(){
  4391. this.paramData1 = false
  4392. this.changeParticipation = false
  4393. this.importProjectBeforeDialog = true
  4394. },
  4395. changeParticipationValue(value){
  4396. this.paramData1=value
  4397. },
  4398. importProject(item) {
  4399. //首先判断文件类型
  4400. let str = item.file.name.split(".");
  4401. let format = str[str.length - 1];
  4402. if (format != "xls" && format != "xlsx") {
  4403. this.$message({
  4404. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  4405. type: "error"
  4406. });
  4407. } else {
  4408. this.listLoading = true;
  4409. let formData = new FormData();
  4410. formData.append("file", item.file);
  4411. formData.append("userId", this.user.id);
  4412. formData.append('key',this.paramData1 ? 1 : 0)
  4413. formData.append('changeParticipation',this.changeParticipation ? 1 : 0)
  4414. this.http.uploadFile('/project/importData', formData,
  4415. res => {
  4416. this.$refs.upload.clearFiles();
  4417. this.listLoading = false;
  4418. if (res.code == "ok") {
  4419. // this.$message({
  4420. // message: res.data,
  4421. // type: "success"
  4422. // },5000);
  4423. //弹窗显示
  4424. this.showImportResult = true;
  4425. this.importProjectBeforeDialog = false
  4426. this.importResultMsg = res.data;
  4427. this.getList();
  4428. } else {
  4429. this.$message({
  4430. message: res.msg,
  4431. type: "error"
  4432. });
  4433. }
  4434. },
  4435. error => {
  4436. this.$refs.upload.clearFiles();
  4437. this.listLoading = false;
  4438. this.$message({
  4439. message: error,
  4440. type: "error"
  4441. });
  4442. });
  4443. }
  4444. },
  4445. number(){
  4446. //     this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
  4447. // this.addForm.budget = this.addForm.budget.replace('.','');
  4448. },
  4449. deleteSubPro(subProject) {
  4450. this.$confirm(this.$t('makesuretodeletethesubproject') + subProject.name + this.$t('ma'),this.$t('deletesubproject'), {
  4451. confirmButtonText: this.$t('btn.determine'),
  4452. cancelButtonText: this.$t('btn.cancel'),
  4453. type: "warning"
  4454. })
  4455. .then(() => {
  4456. this.listLoading = true;
  4457. this.http.post('/sub-project/deleteProject',{
  4458. id: subProject.id
  4459. },
  4460. res => {
  4461. this.listLoading = false;
  4462. if (res.code == "ok") {
  4463. this.$message({
  4464. message: this.$t('message.successfullyDeleted'),
  4465. type: "success"
  4466. });
  4467. this.subProject(this.currentProject);
  4468. } else {
  4469. this.$message({
  4470. message: res.msg,
  4471. type: "error"
  4472. });
  4473. }
  4474. },
  4475. error => {
  4476. this.listLoading = false;
  4477. this.$message({
  4478. message: error,
  4479. type: "error"
  4480. });
  4481. }
  4482. );
  4483. })
  4484. .catch(() => {});
  4485. },
  4486. searchList() {
  4487. this.page = 1;
  4488. this.getList();
  4489. },
  4490. addNewSubProject(subProject) {
  4491. if (subProject == null) {
  4492. this.temaddForm = {projectId: this.currentProject.id, level:1}
  4493. } else {
  4494. let aac = JSON.parse(JSON.stringify(subProject))
  4495. aac.status=aac.status==true?1:0
  4496. this.temaddForm = JSON.parse(JSON.stringify(aac));
  4497. }
  4498. this.addSubProject = true;
  4499. },
  4500. //显示子项目
  4501. subProject(item) {
  4502. this.subProjectVisible = true;
  4503. this.currentProject = item;
  4504. this.http.post('/sub-project/list', {
  4505. projectId: item.id
  4506. },
  4507. res => {
  4508. if (res.code == "ok") {
  4509. for(let i = 0; i < res.data.length; i++){
  4510. res.data[i].status=res.data[i].status==1?true:false
  4511. }
  4512. this.subProjectList = res.data
  4513. } else {
  4514. this.$message({
  4515. message: res.msg,
  4516. type: "error"
  4517. });
  4518. }
  4519. },
  4520. error => {
  4521. this.$message({
  4522. message: error,
  4523. type: "error"
  4524. });
  4525. });
  4526. },
  4527. //显示用户详情
  4528. showUser(userId) {
  4529. this.userDetailVisible = true;
  4530. this.http.post(this.port.manage.userDetail, {
  4531. userId: userId
  4532. },
  4533. res => {
  4534. if (res.code == "ok") {
  4535. this.userDetail = res.data;
  4536. } else {
  4537. this.$message({
  4538. message: res.msg,
  4539. type: "error"
  4540. });
  4541. }
  4542. },
  4543. error => {
  4544. this.$message({
  4545. message: error,
  4546. type: "error"
  4547. });
  4548. });
  4549. },
  4550. //选择参与人
  4551. changeParticipator() {
  4552. //检查是否在参与人中,如果没有需要加入到参与人中
  4553. // console.log('addform',this.addForm.userId,this.users);
  4554. this.participator = [];
  4555. this.addForm.userId.forEach(u=>{
  4556. var list = this.users.filter(au=>au.id == u);
  4557. if (list.length > 0) {
  4558. var findUser = list[0];
  4559. this.participator.push(findUser);
  4560. } else {
  4561. console.log('未找到用户: '+u);
  4562. }
  4563. })
  4564. },
  4565. getUsers() {
  4566. // this.http.post(this.port.manage.list, {
  4567. // departmentId: -1,
  4568. // pageIndex: 1,
  4569. // // pageSize: 99999
  4570. // pageSize: -1
  4571. // },
  4572. this.http.post('/user/getSimpleActiveUserList', {},
  4573. res => {
  4574. if (res.code == "ok") {
  4575. this.users = res.data;
  4576. } else {
  4577. this.$message({
  4578. message: res.msg,
  4579. type: "error"
  4580. });
  4581. }
  4582. },
  4583. error => {
  4584. this.$message({
  4585. message: error,
  4586. type: "error"
  4587. });
  4588. });
  4589. },
  4590. //分页
  4591. handleCurrentChange(val) {
  4592. this.page = val;
  4593. this.getList();
  4594. },
  4595. handleSizeChange(val) {
  4596. this.size = val;
  4597. localStorage.projectPageSize = this.size;
  4598. this.page = 1
  4599. this.getList();
  4600. },
  4601. participationSelect(){
  4602. this.page = 1
  4603. this.getList()
  4604. },
  4605. //获取项目列表
  4606. getList() {
  4607. localStorage.projectPageIndex = this.page;
  4608. this.listLoading = true;
  4609. let parameter = {
  4610. pageIndex: this.page,
  4611. pageSize: this.size,
  4612. keyword:this.keyword,
  4613. searchField: this.searchField,
  4614. status: this.status,
  4615. category: this.statusClf,
  4616. projectMainId: this.projectMainId,
  4617. inchagerId: this.inchagerId,
  4618. participation: this.participationId,
  4619. }
  4620. if(this.createDate) {
  4621. parameter.startDate = this.createDate[0]
  4622. parameter.endDate = this.createDate[1]
  4623. }
  4624. if(this.sortOrder){
  4625. if(this.sortProp == 'inchargerName'){
  4626. parameter.sortProp = "incharger_id"
  4627. }else if(this.sortProp == 'customerName'){
  4628. parameter.sortProp = "customer_id"
  4629. }else if(this.sortProp == 'projectCode'){
  4630. parameter.sortProp = 'project_code'
  4631. }else if(this.sortProp == 'categoryName'){
  4632. parameter.sortProp = 'category'
  4633. }else if(this.sortProp == 'projectName'){
  4634. parameter.sortProp = 'project_name'
  4635. }else if(this.sortProp == 'status'){
  4636. parameter.sortProp = 'status'
  4637. }else if(this.sortProp == 'currentStage'){
  4638. parameter.sortProp = 'current_stage_name'
  4639. }else if(this.sortProp == 'departmentName'){
  4640. parameter.sortProp = 'dept_id'
  4641. }else if(this.sortProp == 'associateDegreeNames'){
  4642. parameter.sortProp = 'associate_degrees'
  4643. }
  4644. if(this.sortOrder == 'descending'){
  4645. parameter.sortOrder = 0
  4646. }else if(this.sortOrder == 'ascending'){
  4647. parameter.sortOrder = 1
  4648. }
  4649. }
  4650. if(this.deptId.length > 0) {
  4651. parameter.deptId = this.deptId[this.deptId.length - 1]
  4652. } else {
  4653. parameter.deptId = ''
  4654. }
  4655. this.http.post(this.port.project.listPage, parameter,
  4656. res => {
  4657. this.listLoading = false;
  4658. if (res.code == "ok") {
  4659. var list = res.data.records;
  4660. for(var i in list) {
  4661. var participator = list[i].participator , str = "";
  4662. for(var j in participator) {
  4663. if(j == participator.length-1) {
  4664. str += participator[j].name
  4665. } else {
  4666. str += participator[j].name + ','
  4667. }
  4668. }
  4669. list[i].userNames = str;
  4670. }
  4671. this.centerNameDegree = res.data.degrees
  4672. this.showColumnWidth = this.showColumn(list)
  4673. this.list = list;
  4674. this.total = res.data.total;
  4675. // this.$nextTick(()=>{
  4676. // this.$refs.projectlistOfWudulist.doLayout();
  4677. // })
  4678. this.listHeader = res.data.nameList;
  4679. } else {
  4680. this.$message({
  4681. message: res.msg,
  4682. type: "error"
  4683. });
  4684. }
  4685. },
  4686. error => {
  4687. this.listLoading = false;
  4688. this.$message({
  4689. message: error,
  4690. type: "error"
  4691. });
  4692. });
  4693. },
  4694. showColumn(list){
  4695. if(!this.permissions.projectManagement){
  4696. let creat = false
  4697. let incha = false
  4698. for(let i in list){
  4699. if(this.user.id == list[i].creatorId){
  4700. creat = true
  4701. }
  4702. if(this.user.id == list[i].inchargerId){
  4703. incha = true
  4704. }
  4705. }
  4706. if(creat){
  4707. return '300'
  4708. }else {
  4709. if(incha){
  4710. return '210'
  4711. } else if (this.permissions.projectParticipator) {//编辑参与人权限
  4712. return '110'
  4713. } else {
  4714. return '0'
  4715. }
  4716. }
  4717. }else {
  4718. return '300'
  4719. }
  4720. },
  4721. // 合同金额发生改变,需弹出修改原因的输入框
  4722. contractAmountChange(value){
  4723. if(this.contractAmountOld != value){
  4724. this.contractAmountReasonShow = true
  4725. }else{
  4726. this.contractAmountReasonShow = false
  4727. this.addForm.changeContractReason = ''
  4728. }
  4729. },
  4730. //获取分组模板列表
  4731. getGroupTemplate() {
  4732. this.http.post('/group-template/getList',{},
  4733. res => {
  4734. if (res.code == "ok") {
  4735. this.groupTemplateList = res.data;
  4736. this.groupTemplateList[0].selected = true;
  4737. } else {
  4738. this.$message({
  4739. message: res.msg,
  4740. type: "error"
  4741. });
  4742. }
  4743. },
  4744. error => {
  4745. this.$message({
  4746. message: error,
  4747. type: "error"
  4748. });
  4749. });
  4750. },
  4751. // 处理数据
  4752. chulishuju(data) {
  4753. console.log(data, 12345)
  4754. console.log(this.dataListBf, '看看')
  4755. let arrLists = JSON.parse(JSON.stringify(this.dataListBf))
  4756. var arr = []
  4757. for(var s in arrLists) {
  4758. for(var p in data.plateMap) {
  4759. if(arrLists[s].customName == p && arrLists[s].customType != '1') {
  4760. arrLists[s].value = data.plateMap[p]
  4761. }
  4762. if(arrLists[s].customName == p && arrLists[s].customType == '1' && data.plateMap[p] != null && data.plateMap[p] != ''){
  4763. var sel = data.plateMap[p].split(',')
  4764. var live = []
  4765. for(var dd in sel) {
  4766. var obj = {}
  4767. obj.name = p
  4768. // obj.url = this.pictureAddress + '/upload/' + sel[dd]
  4769. obj.url = '/upload/' + sel[dd]
  4770. live.push(obj)
  4771. }
  4772. console.log('值值hi', this.pictureAddress)
  4773. arrLists[s].value = live
  4774. arrLists[s].valuelist = sel
  4775. }
  4776. }
  4777. }
  4778. this.dataList = arrLists
  4779. console.log(this.form, 9999)
  4780. console.log(this.dataList, 8888)
  4781. this.dialogVisible = true
  4782. },
  4783. //显示新增界面
  4784. handleAdd(i, item) {
  4785. this.canOnlyModParticipator = false;
  4786. this.projectManagerEdit = false
  4787. this.contractAmountReasonShow = false
  4788. if(i == -1) {
  4789. if(this.user.companyId == '936') {
  4790. this.isShowProjectName = false
  4791. }
  4792. this.title = this.$t('newproject');
  4793. this.addForm = {
  4794. name: '',
  4795. isPublic:0,
  4796. userId: [],
  4797. userNames:'',
  4798. code:'',
  4799. inchargerId:null,
  4800. level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
  4801. customerId:null,
  4802. notifyUserNames:'',
  4803. chosenLeaders:[],
  4804. category:null,
  4805. creatorId: this.user.id,
  4806. projectMainId: '',
  4807. outputValue: '',
  4808. bu: [],
  4809. manDay:0,
  4810. fromOutside: 0,
  4811. // deptId: []
  4812. }
  4813. this.estimatedWorkTime=''
  4814. for(var i in this.dataList) {
  4815. var str = 'plate' + (+i + 1)
  4816. this.$set(this.addForm,str, '')
  4817. }
  4818. if(this.user.timeType.projectWithDept) {
  4819. this.$set(this.addForm, 'deptId', [])
  4820. }
  4821. if(this.user.companyId == '936') {
  4822. this.$set(this.addForm, 'contractCode', '')
  4823. this.$set(this.addForm, 'warrantyStartDate', '')
  4824. this.$set(this.addForm, 'warrantyEndDate', '')
  4825. this.$set(this.addForm, 'projectCategorySub', '')
  4826. this.$set(this.addForm, 'region', '')
  4827. this.$set(this.addForm, 'bu', '')
  4828. }
  4829. if(this.user.timeType.projectManDay){
  4830. this.$set(this.addForm, 'manDay',0)
  4831. this.$set(this.addForm, 'manDayStartDate','')
  4832. }
  4833. // if(this.user.companyId == '428') {
  4834. // this.$set(this.addForm, 'projectCategorySub', '')
  4835. // }
  4836. this.projectBaseCostData = [];
  4837. this.auseList = [];
  4838. for (var m=0;m<this.baseCostItemList.length; m++) {
  4839. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  4840. }
  4841. // 关键节点
  4842. if(this.user.companyId == '936') {
  4843. this.projectKeyNodesData = []
  4844. for (var m=0;m<this.keyNodesList.length; m++) {
  4845. this.projectKeyNodesData.push({nodesId: this.keyNodesList[m].id, nodesName:this.keyNodesList[m].name, planCompleteDate: null, actualCompleteDate: null, states: '0'});
  4846. }
  4847. // console.log(this.projectKeyNodesData, '节点值')
  4848. }
  4849. } else {
  4850. console.log('点击来编辑执行')
  4851. const usersJson = JSON.parse(sessionStorage.getItem("user"))
  4852. if(usersJson.companyId == '936') {
  4853. if(usersJson.roleName != '超级管理员' && usersJson.roleName != '系统管理员') {
  4854. this.isShowProjectName = true
  4855. } else {
  4856. this.isShowProjectName = false
  4857. }
  4858. }
  4859. console.log(this.isShowProjectName, '看看值')
  4860. this.http.post('/project/detailTwo', {id: item.id},
  4861. res => {
  4862. if (res.code == "ok") {
  4863. this.chulishuju(res.data)
  4864. this.estimatedWorkTime=res.data.estimatedWorkTime==null?0:res.data.estimatedWorkTime
  4865. this.addForm.estimatedWorkTime=res.data.estimatedWorkTime==null?0:res.data.estimatedWorkTime
  4866. }
  4867. });
  4868. //编辑时,非 (管理全部项目,项目创建人,项目经理),有编辑项目参与人权限的人,可以进行参与人的修改
  4869. if (!(this.permissions.projectManagement || this.user.id==item.inchargerId || this.user.id == item.creatorId) && this.permissions.projectParticipator) {
  4870. this.canOnlyModParticipator = true;
  4871. }
  4872. if(this.permissions.projectManagement || this.user.id == item.creatorId) {
  4873. this.projectManagerEdit = false
  4874. } else {
  4875. this.projectManagerEdit = true
  4876. }
  4877. this.title = this.$t('modifytheproject');
  4878. var list = item.participator;
  4879. if (item.isPublic == 1) {
  4880. list = this.users;
  4881. }
  4882. var arr = [];
  4883. var names = '';
  4884. let namesLiss = [] // 企业微信用到的参与者
  4885. for(var j in list) {
  4886. arr.push(list[j].id)
  4887. names += list[j].name+',';
  4888. namesLiss.push(list[j].name)
  4889. }
  4890. if (names.length > 0) {
  4891. names = names.substring(0, names.length -1);
  4892. }
  4893. this.addFormUserNames = namesLiss
  4894. var listList = JSON.parse(JSON.stringify(item)),
  4895. arrList = [],
  4896. array = [];
  4897. if (listList.deptCascade != "0" && listList.deptCascade != null) {
  4898. if (listList.deptCascade.indexOf(",") > -1) {
  4899. arrList = listList.deptCascade.split(",");
  4900. } else {
  4901. arrList = [].concat(listList.deptCascade);
  4902. }
  4903. }
  4904. for (var i in arrList) {
  4905. array.push(parseInt(arrList[i]));
  4906. }
  4907. let buascaderList = []
  4908. if(item.buId) {
  4909. let buArrList = item.buId.split(',')
  4910. for(var i in buArrList) {
  4911. buArrList[i] = +buArrList[i]
  4912. }
  4913. buascaderList = buArrList
  4914. }
  4915. // console.log(array, '转换', listList)
  4916. this.addForm = {
  4917. id: item.id,
  4918. name: item.projectName,
  4919. isPublic: item.isPublic,
  4920. userId: arr,
  4921. userNames:names,
  4922. code:item.projectCode,
  4923. inchargerId: item.inchargerId,
  4924. level: item.level,
  4925. planStartDate: item.planStartDate,
  4926. planEndDate: item.planEndDate,
  4927. budget: item.budget,
  4928. baseMan: item.baseMan,
  4929. contractAmount: item.contractAmount,
  4930. baseFee: item.baseFee,
  4931. baseRisk1: item.baseRisk1,
  4932. baseRisk2: item.baseRisk2,
  4933. baseOutsourcing: item.baseOutsourcing,
  4934. customerId:item.customerId==0?null:item.customerId,
  4935. category:item.category,
  4936. projectDesc: item.projectDesc,
  4937. projectMainId: item.projectMainId,
  4938. creatorId: item.creatorId,
  4939. outputValue: item.outputValue,
  4940. // deptId: array.reverse(),
  4941. changeContractReason: '',
  4942. bu: buascaderList,
  4943. manDay:item.manDay==null?0:item.manDay,
  4944. manDayStartDate:item.manDayStartDate,
  4945. manDayDisable:item.manDay,
  4946. fromOutside:item.fromOutside
  4947. }
  4948. for(var i in this.dataList) {
  4949. var str = 'plate' + (+i + 1)
  4950. if(this.dataList[i].customType != '1') {
  4951. this.$set(this.addForm,str, this.dataList[i].value==null?'':this.dataList[i].value)
  4952. } else {
  4953. this.$set(this.addForm,str,this.dataList[i].valuelist.join('@'))
  4954. }
  4955. }
  4956. this.contractAmountOld = item.contractAmount ? item.contractAmount : 0
  4957. // console.log(this.addForm, '数据')
  4958. if(this.user.timeType.projectWithDept) {
  4959. this.$set(this.addForm, 'deptId', array.reverse())
  4960. }
  4961. // 判断公司id是否等于936
  4962. if(this.user.companyId == '936') {
  4963. if(item.projectSeparate) {
  4964. this.$set(this.addForm, 'contractCode', item.projectSeparate.contractCode)
  4965. this.$set(this.addForm, 'warrantyStartDate', item.projectSeparate.warrantyStartDate)
  4966. this.$set(this.addForm, 'warrantyEndDate', item.projectSeparate.warrantyEndDate)
  4967. this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  4968. this.$set(this.addForm, 'region', item.projectSeparate.region)
  4969. this.$set(this.addForm, 'bu', item.projectSeparate.bu)
  4970. } else {
  4971. this.$set(this.addForm, 'contractCode', '')
  4972. this.$set(this.addForm, 'warrantyStartDate', '')
  4973. this.$set(this.addForm, 'warrantyEndDate', '')
  4974. this.$set(this.addForm, 'projectCategorySub', '')
  4975. this.$set(this.addForm, 'region', '')
  4976. this.$set(this.addForm, 'bu', '')
  4977. }
  4978. }
  4979. // if(this.user.companyId == '428') {
  4980. // if(item.projectSeparate) {
  4981. // this.$set(this.addForm, 'projectCategorySub', item.projectSeparate.projectCategorySub)
  4982. // } else {
  4983. // this.$set(this.addForm, 'projectCategorySub', '')
  4984. // }
  4985. // }
  4986. // 判断是否有供应商
  4987. if(this.user.company.packageProvider) {
  4988. // this.addForm.supplierId = item.providerIds.split(',')
  4989. if(item.providerIds) {
  4990. let arr = []
  4991. let zhhi = item.providerIds.split(',')
  4992. for(let i in zhhi) {
  4993. arr.push(+zhhi[i] + 0)
  4994. }
  4995. this.$set(this.addForm, 'supplierId', arr)
  4996. // console.log( this.addForm.supplierId)
  4997. } else {
  4998. this.$set(this.addForm, 'supplierId', [])
  4999. }
  5000. }
  5001. // 判断是否有供应商结尾
  5002. this.deleteVif = item.creatorId
  5003. // console.log("handleadd",this.deleteVif,this.addForm)
  5004. if(item.associateDegrees != null && item.associateDegrees != 'null' && item.associateDegrees != '') {
  5005. var spli = item.associateDegrees.split(',')
  5006. var sl = []
  5007. for(var i in spli) {
  5008. var num = +spli[i] + 0
  5009. sl.push(num)
  5010. }
  5011. this.auseList = sl
  5012. // console.log(this.auseList)
  5013. } else {
  5014. this.auseList = []
  5015. }
  5016. // var spli = item.associateDegrees.split(',')
  5017. // var sl = []
  5018. // for(var i in spli) {
  5019. // var num = +spli[i] + 0
  5020. // sl.push(num)
  5021. // }
  5022. // this.auseList = sl
  5023. // console.log(this.auseList)
  5024. this.changeParticipator();
  5025. this.getProjectBaseData(item.id);
  5026. this.getProjectKeyNodeData(item.id)
  5027. if (this.user.company.packageEngineering == 1) {
  5028. this.getProjectProfessions(item.id);
  5029. }
  5030. //获取项目的相关领导
  5031. // this.getProjectNotifyUserList(item.id);
  5032. this.getProjectAutorList(item.id);
  5033. if (this.user.timeType.reportCc == 1) {
  5034. this.getProjectCcUserList(item.id);
  5035. }
  5036. // this.findUserInTree()
  5037. }
  5038. this.addFormVisible = true;
  5039. if (this.user.timeType.projectManDay == 1) {
  5040. this.getManDaySetting();
  5041. }
  5042. if (this.user.company.packageEngineering == 1) {
  5043. if (this.professionList.length == 0) {
  5044. this.getProfessionList();
  5045. }
  5046. }
  5047. },
  5048. //获取项目日报抄送人
  5049. getProjectCcUserList(projectId) {
  5050. this.http.post('/project-ccuser/getList',{projectId: projectId},
  5051. res => {
  5052. if (res.code == "ok") {
  5053. this.addForm.ccUserIds = res.data.map(function(item) {
  5054. return item.userId;
  5055. });
  5056. this.$forceUpdate()
  5057. } else {
  5058. this.$message({
  5059. message: res.msg,
  5060. type: "error"
  5061. });
  5062. }
  5063. },
  5064. error => {
  5065. this.listLoading = false;
  5066. this.$message({
  5067. message: error,
  5068. type: "error"
  5069. });
  5070. }
  5071. );
  5072. },
  5073. //获取项目审核人
  5074. getProjectAutorList(projectId) {
  5075. this.http.post('/project-auditor/getList',{projectId: projectId},
  5076. res => {
  5077. if (res.code == "ok") {
  5078. if (this.user.timeType.reportAuditType == 6) {
  5079. //单个日报审核人,单选
  5080. var arr = res.data.map(function(item) {
  5081. return item.auditorId;
  5082. });
  5083. if (arr.length > 0) {
  5084. this.addForm.auditUserIds = arr[0];
  5085. } else {
  5086. this.addForm.auditUserIds = null;
  5087. }
  5088. } else {
  5089. this.addForm.auditUserIds = res.data.map(function(item) {
  5090. return item.auditorId;
  5091. });
  5092. }
  5093. this.$forceUpdate()
  5094. } else {
  5095. this.$message({
  5096. message: res.msg,
  5097. type: "error"
  5098. });
  5099. }
  5100. },
  5101. error => {
  5102. this.listLoading = false;
  5103. this.$message({
  5104. message: error,
  5105. type: "error"
  5106. });
  5107. }
  5108. );
  5109. },
  5110. getProjectBaseData(projectId) {
  5111. this.http.post('/project-basecost/get',{projectId: projectId},
  5112. res => {
  5113. if (res.code == "ok") {
  5114. this.projectBaseCostData = res.data;
  5115. } else {
  5116. this.$message({
  5117. message: res.msg,
  5118. type: "error"
  5119. });
  5120. }
  5121. },
  5122. error => {
  5123. this.listLoading = false;
  5124. this.$message({
  5125. message: error,
  5126. type: "error"
  5127. });
  5128. }
  5129. );
  5130. },
  5131. getProjectKeyNodeData(projectId) {
  5132. this.http.post('/project-key-nodes/get',{projectId: projectId},
  5133. res => {
  5134. if (res.code == "ok") {
  5135. this.projectKeyNodesData = res.data;
  5136. } else {
  5137. this.$message({
  5138. message: res.msg,
  5139. type: "error"
  5140. });
  5141. }
  5142. },
  5143. error => {
  5144. this.listLoading = false;
  5145. this.$message({
  5146. message: error,
  5147. type: "error"
  5148. });
  5149. }
  5150. );
  5151. },
  5152. //提交子项目创建修改请求
  5153. submitInsertSubProject () {
  5154. this.$refs.form2.validate(valid => {
  5155. if (valid) {
  5156. this.http.post('/sub-project/saveOrUpdate',this.temaddForm,
  5157. res => {
  5158. if (res.code == "ok") {
  5159. this.$message({
  5160. message: this.$t('operationissuccessful'),
  5161. type: "success"
  5162. });
  5163. this.subProject(this.currentProject);
  5164. this.addSubProject = false;
  5165. } else {
  5166. this.$message({
  5167. message: res.msg,
  5168. type: "error"
  5169. });
  5170. }
  5171. },
  5172. error => {
  5173. this.listLoading = false;
  5174. this.$message({
  5175. message: error,
  5176. type: "error"
  5177. });
  5178. }
  5179. );
  5180. }
  5181. });
  5182. },
  5183. // 项目基线合计
  5184. addUpfun() {
  5185. var total = 0;
  5186. for (var i=0;i<this.projectBaseCostData.length; i++) {
  5187. if (this.projectBaseCostData[i].baseAmount) {
  5188. total += parseFloat(this.projectBaseCostData[i].baseAmount);
  5189. }
  5190. }
  5191. this.addForm.budget = total;
  5192. // var a = '0'
  5193. // var q = '0'
  5194. // var w = '0'
  5195. // var e = '0'
  5196. // var r = '0'
  5197. // // this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
  5198. // if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
  5199. // a = 0
  5200. // } else {
  5201. // a = this.addForm.baseMan
  5202. // }
  5203. // if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
  5204. // if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
  5205. // if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
  5206. // if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
  5207. // this.addForm.budget = +a + +q + +w + +e + +r
  5208. },
  5209. submitInsert() {
  5210. this.$refs.form1.validate(valid => {
  5211. if (valid) {
  5212. if (this.user.company.packageEngineering == 1) {
  5213. if (!this.checkProjectProfession()) {//检查不通过,直接返回
  5214. return;
  5215. }
  5216. }
  5217. this.addLoading = true;
  5218. let formData = new FormData();
  5219. formData.append("name", this.addForm.name);
  5220. if(this.addForm.projectDesc != null) {
  5221. formData.append("projectDesc", this.addForm.projectDesc);
  5222. }
  5223. if(this.addForm.id != null) {
  5224. formData.append("id", this.addForm.id);
  5225. }
  5226. if(this.addForm.isPublic != null) {
  5227. formData.append("isPublic", this.addForm.isPublic);
  5228. }
  5229. if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
  5230. for(var j in this.addForm.userId) {
  5231. formData.append("userId", this.addForm.userId[j]);
  5232. }
  5233. }
  5234. if(this.addForm.inchargerId != null) {
  5235. formData.append("inchargerId", this.addForm.inchargerId);
  5236. }
  5237. if(this.addForm.code != null) {
  5238. formData.append("code", this.addForm.code);
  5239. }
  5240. if(this.addForm.planStartDate != null) {
  5241. formData.append("planStartDate", this.addForm.planStartDate);
  5242. }
  5243. if(this.addForm.planEndDate != null) {
  5244. formData.append("planEndDate", this.addForm.planEndDate);
  5245. }
  5246. if(this.addForm.level != null) {
  5247. formData.append("level", this.addForm.level);
  5248. }
  5249. if(this.addForm.contractAmount != null) {
  5250. formData.append("contractAmount", this.addForm.contractAmount);
  5251. }
  5252. if(this.contractAmountReasonShow){
  5253. formData.append("changeContractReason", this.addForm.changeContractReason);
  5254. }
  5255. if (this.projectBaseCostData != null) {
  5256. formData.append("projectBaseCostData", JSON.stringify(this.projectBaseCostData));
  5257. //计算总预算成本
  5258. if (this.addForm.budget == null) {
  5259. this.addForm.budget = 0;
  5260. }
  5261. formData.append("budget", this.addForm.budget);
  5262. }
  5263. if (this.addForm.customerId == null) {
  5264. formData.append("customerId", 0);
  5265. } else {
  5266. formData.append("customerId", this.addForm.customerId);
  5267. }
  5268. if (this.addForm.contractAmount) {
  5269. formData.append("contractAmount", this.addForm.contractAmount);
  5270. } else {
  5271. formData.append("contractAmount", 0);
  5272. }
  5273. if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
  5274. formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
  5275. }
  5276. if (this.user.timeType.outputValueStatus == 1){
  5277. formData.append("outputValue",this.addForm.outputValue ? this.addForm.outputValue : 0)
  5278. }
  5279. var listId = []
  5280. var listName = []
  5281. for(var i in this.auseList) {
  5282. for(var j in this.ause) {
  5283. if(this.auseList[i] == this.ause[j].id) {
  5284. listId.push(this.ause[j].id);
  5285. listName.push(this.ause[j].name);
  5286. break;
  5287. }
  5288. }
  5289. }
  5290. listId.toString()
  5291. listName.toString()
  5292. formData.append("associateDegrees", listId)
  5293. formData.append("associateDegreeNames", listName)
  5294. //日报审核人
  5295. if (this.addForm.auditUserIds) {
  5296. if (this.user.timeType.reportAuditType == 6) {
  5297. formData.append("auditUserIds", this.addForm.auditUserIds);
  5298. } else {
  5299. formData.append("auditUserIds", JSON.stringify(this.addForm.auditUserIds));
  5300. }
  5301. }
  5302. //日报抄送人
  5303. if (this.addForm.ccUserIds) {
  5304. formData.append("ccUserIds", JSON.stringify(this.addForm.ccUserIds));
  5305. }
  5306. if(this.addForm.category != null) {
  5307. formData.append("category", this.addForm.category);
  5308. }
  5309. if(this.user.timeType.mainProjectState == '1' && this.addForm.projectMainId) {
  5310. formData.append("projectMainId", this.addForm.projectMainId);
  5311. }
  5312. // 提交供应商
  5313. // 线判断是否有供应商
  5314. if(this.user.company.packageProvider) {
  5315. let suppStrName = []
  5316. for(let is in this.addForm.supplierId) {
  5317. for(let js in this.supplierList) {
  5318. if(this.addForm.supplierId[is] == this.supplierList[js].id) {
  5319. suppStrName.push(this.supplierList[js].providerName)
  5320. }
  5321. }
  5322. }
  5323. formData.append("providerNames", suppStrName.toString());
  5324. formData.append("providerIds", this.addForm.supplierId.toString());
  5325. }
  5326. // 判断公司id是否等于 936
  5327. if(this.user.companyId == '936') {
  5328. formData.append("contractCode", this.addForm.contractCode ? this.addForm.contractCode : '');
  5329. formData.append("warrantyStartDate", this.addForm.warrantyStartDate ? this.addForm.warrantyStartDate : '');
  5330. formData.append("warrantyEndDate", this.addForm.warrantyEndDate ? this.addForm.warrantyEndDate : '');
  5331. formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  5332. formData.append("region", this.addForm.region ? this.addForm.region : '');
  5333. // 关键节点
  5334. formData.append("projectKeyNodesData", JSON.stringify(this.projectKeyNodesData));
  5335. }
  5336. // if(this.user.companyId == '428') {
  5337. // formData.append("projectCategorySub", this.addForm.projectCategorySub ? this.addForm.projectCategorySub : '');
  5338. // }
  5339. if(this.user.timeType.projectWithDept) {
  5340. if(this.addForm.deptId != null && this.addForm.deptId != '') {
  5341. // formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
  5342. if(Array.isArray(this.addForm.deptId)) {
  5343. formData.append("deptId", this.addForm.deptId[this.addForm.deptId.length - 1])
  5344. } else {
  5345. formData.append("deptId", this.addForm.deptId)
  5346. }
  5347. }
  5348. }
  5349. formData.append("buId", this.addForm.bu ? this.addForm.bu : '');
  5350. if(this.user.timeType.projectManDay){
  5351. //检验预估人天的必填属性
  5352. if (this.manDaySetting.projectManDayFillMode == 2 || (this.manDaySetting.projectManDayFillMode == 1 && this.addForm.fromOutside == 0)) {
  5353. if (!this.addForm.manDay) {
  5354. this.$message({
  5355. message: '预估工时不能为0',
  5356. type: "error"
  5357. });
  5358. this.addLoading = false;
  5359. return;
  5360. }
  5361. }
  5362. formData.append("manDay", this.addForm.manDay ? this.addForm.manDay : '');
  5363. formData.append("manDayStartDate", this.addForm.manDayStartDate ? this.addForm.manDayStartDate : '');
  5364. }
  5365. for(var i in this.dataList) {
  5366. var str = 'plate' + (+i + 1)
  5367. if(this.dataList[i].customType != '1') {
  5368. formData.append(str,this.dataList[i].value==null?'':this.dataList[i].value);
  5369. } else {
  5370. formData.append(str,this.dataList[i].valuelist.join('@'));
  5371. }
  5372. }
  5373. // formData.append("associateDegreeNames", listName)
  5374. //console.log("addform",this.addForm);
  5375. // for (const key of formData.keys()) {
  5376. // console.log(key + ': ' + formData.get(key));
  5377. // }
  5378. // return
  5379. this.http.uploadFile(this.port.project.add,formData,
  5380. res => {
  5381. this.addLoading = false;
  5382. if (res.code == "ok") {
  5383. this.$message({
  5384. message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
  5385. type: "success"
  5386. });
  5387. this.addFormVisible = false;
  5388. this.getList();
  5389. if (this.user.company.packageEngineering == 1) {
  5390. this.saveProjectProfessions(res.data);
  5391. }
  5392. } else {
  5393. this.$message({
  5394. message: res.msg,
  5395. type: "error"
  5396. });
  5397. }
  5398. },
  5399. error => {
  5400. this.addLoading = false;
  5401. this.$message({
  5402. message: error,
  5403. type: "error"
  5404. });
  5405. });
  5406. }
  5407. });
  5408. },
  5409. cascaderChange(e) {
  5410. // console.log(e)
  5411. // console.log(this.addForm)
  5412. // if(e.length )
  5413. // console.log(e)
  5414. },
  5415. // 删除
  5416. deletePro(i, item) {
  5417. this.$confirm(this.$t('makesuretodeletetheitem')+"[" + item.name + "]"+this.$t('ma'),this.$t('deletetheproject'), {
  5418. confirmButtonText: this.$t('btn.determine'),
  5419. cancelButtonText: this.$t('btn.cancel'),
  5420. type: "warning"
  5421. })
  5422. .then(() => {
  5423. this.listLoading = true;
  5424. this.http.post(this.port.project.delete,{
  5425. id: item.id
  5426. },
  5427. res => {
  5428. this.listLoading = false;
  5429. if (res.code == "ok") {
  5430. this.$message({
  5431. message: this.$t('message.successfullyDeleted'),
  5432. type: "success"
  5433. });
  5434. this.getList();
  5435. this.addFormVisible = false
  5436. } else if (res.code == 'reconfirm') {
  5437. this.deleteAlertMsg = res.msg;
  5438. this.forceDeletePro(item.id);
  5439. } else {
  5440. this.$message({
  5441. message: res.msg,
  5442. type: "error"
  5443. });
  5444. }
  5445. },
  5446. error => {
  5447. this.listLoading = false;
  5448. this.$message({
  5449. message: error,
  5450. type: "error"
  5451. });
  5452. }
  5453. );
  5454. })
  5455. .catch(() => {});
  5456. },
  5457. // 模板下载
  5458. downloadmb(){
  5459. this.http.post('/project/getTemplate',{
  5460. companyId: this.user.companyId
  5461. },res => {
  5462. if(res.code == 'ok'){
  5463. var filePath = res.data;
  5464. const a = document.createElement('a'); // 创建a标签
  5465. var fileName = filePath.split('/')[2];
  5466. a.setAttribute('download', fileName);// download属性
  5467. a.setAttribute('href', filePath);// href链接
  5468. a.click(); //自执行点击事件
  5469. a.remove();
  5470. }else{
  5471. this.$message({
  5472. message: res.msg,
  5473. type: 'error'
  5474. })
  5475. }
  5476. },err => {
  5477. this.$message({
  5478. message: err,
  5479. type: 'error'
  5480. })
  5481. })
  5482. },
  5483. //强制删除项目
  5484. forceDeletePro(deleteProId) {
  5485. this.$confirm(this.deleteAlertMsg,this.$t('deletetheproject'), {
  5486. confirmButtonText: this.$t('btn.determine'),
  5487. cancelButtonText: this.$t('btn.cancel'),
  5488. type: "warning"
  5489. })
  5490. .then(() => {
  5491. this.listLoading = true;
  5492. this.http.post(this.port.project.delete,{
  5493. id: deleteProId ,force:1
  5494. },
  5495. res => {
  5496. this.listLoading = false;
  5497. if (res.code == "ok") {
  5498. this.$message({
  5499. message: this.$t('message.successfullyDeleted'),
  5500. type: "success"
  5501. });
  5502. this.getList();
  5503. this.addFormVisible = false;
  5504. } else {
  5505. this.$message({
  5506. message: res.msg,
  5507. type: "error"
  5508. });
  5509. }
  5510. },
  5511. error => {
  5512. this.listLoading = false;
  5513. this.$message({
  5514. message: error,
  5515. type: "error"
  5516. });
  5517. }
  5518. );
  5519. })
  5520. .catch(() => {});
  5521. },
  5522. detail(i) {
  5523. this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
  5524. },
  5525. // 获取部门
  5526. getDepartmentList() {
  5527. this.http.post( this.port.manage.depList, {},
  5528. res => {
  5529. if (res.code == "ok") {
  5530. let dptlist = JSON.parse(JSON.stringify(res.data));
  5531. this.departmentList = this.changeArr(dptlist);
  5532. } else {
  5533. this.$message({
  5534. message: res.msg,
  5535. type: "error"
  5536. });
  5537. }
  5538. },error => {
  5539. this.$message({
  5540. message: error,
  5541. type: "error"
  5542. });
  5543. });
  5544. },
  5545. changeArr(arr) {
  5546. for (var i = 0; i < arr.length; i++) {
  5547. if(arr[i].id != -1 && arr[i].id != 0) {
  5548. if (arr[i].children != null && arr[i].children.length>0) {
  5549. arr[i].children = this.changeArr(arr[i].children);
  5550. }
  5551. arr[i].id && (arr[i].value = arr[i].id);
  5552. delete arr[i].id;
  5553. }
  5554. }
  5555. for(var i in arr) {
  5556. if(arr[i].id == -1 || arr[i].id == 0) {
  5557. arr.splice(i,1)
  5558. }
  5559. }
  5560. return arr;
  5561. },
  5562. // 自定义组件事件
  5563. selectCal(obj) {
  5564. if(obj.distinction == '1') {
  5565. this.inchagerId = obj.id
  5566. this.manageSelect()
  5567. } else if(obj.distinction == '2') {
  5568. this.participationId = obj.id
  5569. this.participationSelect()
  5570. } else if(obj.distinction == '3') {
  5571. this.addForm.inchargerId = obj.id
  5572. // console.log(this.participator)
  5573. this.participator = JSON.parse(JSON.stringify(this.participator))
  5574. } else if(obj.distinction =='4') {
  5575. this.projectProfessionList[obj.other].inchargerId = obj.id
  5576. } else if(obj.distinction =='5') {
  5577. this.paramInchargerId = obj.id
  5578. }else if(obj.distinction =='6') {
  5579. this.hasSetGroupInchargerId = obj.id
  5580. } else if(obj.distinction == '10') {
  5581. let userList = obj.arrUserList
  5582. let arr = []
  5583. for(var i in userList) {
  5584. arr.push(userList[i].id)
  5585. }
  5586. this.participator = JSON.parse(JSON.stringify(this.participator))
  5587. this.addForm.auditUserIds = arr
  5588. } else if(obj.distinction == '11') {
  5589. let userList = obj.id
  5590. console.log(obj)
  5591. this.curProfessionRow.membList[obj.other].membId = userList
  5592. }
  5593. },
  5594. vueCasader(obj) {
  5595. console.log(obj, '<-==== 接收的数据')
  5596. if(obj.distinction == '32') {
  5597. let arr = []
  5598. arr.push(obj.id)
  5599. this.addForm.bu = arr.join(",")
  5600. } else if(obj.distinction == '20') {
  5601. this.addForm.deptId = obj.id
  5602. }
  5603. console.log(this.addForm)
  5604. },
  5605. changSubStatus(subProject) {
  5606. this.http.post('/sub-project/updateStatus',{
  5607. id: subProject.id,
  5608. status: subProject.status?1:0
  5609. },
  5610. res => {
  5611. this.listLoading = false;
  5612. if (res.code == "ok") {
  5613. this.$message({
  5614. message: subProject.status?"开启成功":"关闭成功",
  5615. type: "success"
  5616. });
  5617. this.subProject(this.currentProject);
  5618. } else {
  5619. this.$message({
  5620. message: res.msg,
  5621. type: "error"
  5622. });
  5623. }
  5624. },
  5625. error => {
  5626. this.$message({
  5627. message: error,
  5628. type: "error"
  5629. });
  5630. }
  5631. );
  5632. },
  5633. //计算预估工时
  5634. jisuanEstimatedWorkTime(manDay){
  5635. this.addForm.estimatedWorkTime=manDay*this.user.timeType.allday
  5636. },
  5637. //计算预估工时
  5638. jisuanManDay(estimatedWorkTime){
  5639. this.addForm.manDay=estimatedWorkTime/this.user.timeType.allday
  5640. },
  5641. getProjectList(){
  5642. this.http.post(this.port.project.list,{
  5643. },
  5644. res => {
  5645. this.listLoading = false;
  5646. if (res.code == "ok") {
  5647. this.allProjectList=res.data
  5648. } else {
  5649. this.$message({
  5650. message: res.msg,
  5651. type: "error"
  5652. });
  5653. }
  5654. },
  5655. error => {
  5656. this.$message({
  5657. message: error,
  5658. type: "error"
  5659. });
  5660. }
  5661. );
  5662. },
  5663. //点击添加
  5664. addFunctional(type){
  5665. if(type=="functional"){
  5666. this.functionalList.push({
  5667. "id":null,
  5668. 'timeType': '项目工时',
  5669. 'role': 'CRC&LM',
  5670. 'jobRespon': '',
  5671. "companyId":this.user.companyId,
  5672. 'editFlag': true, // 可编辑标识
  5673. 'isSubmit': 0, // 是否点击确定标识
  5674. })
  5675. }else if(type=="workContext"){
  5676. this.workContextList.push({
  5677. "id":null,
  5678. "proFunId":this.functionalId,
  5679. 'workContext':null,
  5680. 'editFlag': true, // 可编辑标识
  5681. 'isSubmit': 0, // 是否点击确定标识
  5682. })
  5683. }
  5684. },
  5685. // 确定
  5686. functionalSubmit(row){
  5687. row.editFlag = false
  5688. row.isSubmit = 1
  5689. },
  5690. // 取消
  5691. functionalCancel(row, index,type){
  5692. row.editFlag = false
  5693. if (row.isSubmit) {
  5694. if(type=="functional"){
  5695. // this.functionalList[index]=this.oldValue
  5696. this.$set(this.functionalList,index,this.oldValue);
  5697. }else if(type=="workContext"){
  5698. this.workContextList[index] = this.oldValue
  5699. }
  5700. }
  5701. else if(!row.id){
  5702. if(type=="functional"){
  5703. this.functionalDelVersion(row,index);
  5704. }else if(type=="workContext"){
  5705. this.workContextDelVersion(row,index);
  5706. }
  5707. }
  5708. },
  5709. // 编辑
  5710. functionalEditVersion(row){
  5711. // v.value = JSON.parse(JSON.stringify(row));
  5712. this.oldValue= Object.assign({}, row);;
  5713. console.log("row",row,"old",this.oldValue)
  5714. row.editFlag = true;
  5715. },
  5716. // 删除
  5717. functionalDelVersion (row,index){
  5718. console.log("index",index,'row',row)
  5719. if(row.id==null){
  5720. this.functionalList.splice(index, 1)
  5721. return
  5722. }
  5723. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  5724. confirmButtonText: '确定',
  5725. cancelButtonText: '取消',
  5726. type: 'warning'
  5727. }).then(() => {
  5728. this.functionalList.splice(index, 1)
  5729. this.http.post('/project/deleteFunctionalDivision',{
  5730. id:row.id,
  5731. },
  5732. res => {
  5733. if (res.code == "ok") {
  5734. this.$message({
  5735. message: '删除成功',
  5736. type: "success"
  5737. });
  5738. } else {
  5739. this.$message({
  5740. message: res.msg,
  5741. type: "error"
  5742. });
  5743. }
  5744. },
  5745. error => {
  5746. this.$message({
  5747. message: error,
  5748. type: "error"
  5749. });
  5750. }
  5751. );
  5752. }).catch(() => {
  5753. this.$message({
  5754. type: 'info',
  5755. message: '已取消删除'
  5756. });
  5757. });
  5758. },
  5759. // 删除
  5760. workContextDelVersion (row,index){
  5761. if(row.id==null){
  5762. this.workContextList.splice(index, 1)
  5763. return
  5764. }
  5765. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  5766. confirmButtonText: '确定',
  5767. cancelButtonText: '取消',
  5768. type: 'warning'
  5769. }).then(() => {
  5770. this.workContextList.splice(index, 1)
  5771. this.http.post('/project/deleteFunWorkContext',{
  5772. id:row.id,
  5773. },
  5774. res => {
  5775. if (res.code == "ok") {
  5776. this.$message({
  5777. message: '删除成功',
  5778. type: "success"
  5779. });
  5780. } else {
  5781. this.$message({
  5782. message: res.msg,
  5783. type: "error"
  5784. });
  5785. }
  5786. },
  5787. error => {
  5788. this.$message({
  5789. message: error,
  5790. type: "error"
  5791. });
  5792. }
  5793. );
  5794. }).catch(() => {
  5795. this.$message({
  5796. type: 'info',
  5797. message: '已取消删除'
  5798. });
  5799. });
  5800. },
  5801. //保存职能分工
  5802. submitFunctional(){
  5803. this.http.post('/project/editFunctionalDivision',{
  5804. json:JSON.stringify(this.functionalList),
  5805. },
  5806. res => {
  5807. if (res.code == "ok") {
  5808. this.$message({
  5809. message: '操作成功',
  5810. type: "success"
  5811. });
  5812. this.getFunctionalList()
  5813. } else {
  5814. this.$message({
  5815. message: res.msg,
  5816. type: "error"
  5817. });
  5818. }
  5819. },
  5820. error => {
  5821. this.$message({
  5822. message: error,
  5823. type: "error"
  5824. });
  5825. }
  5826. );
  5827. },
  5828. //保存工作内容
  5829. submitWorkContext(){
  5830. for(var index in this.workContextList){
  5831. if(!this.workContextList[index].workContext){
  5832. this.$message({
  5833. message: "请填写工作内容",
  5834. type: "error"
  5835. });
  5836. return
  5837. }
  5838. }
  5839. this.http.post('/project/editFunWorkContext',{
  5840. json:JSON.stringify(this.workContextList),
  5841. },
  5842. res => {
  5843. if (res.code == "ok") {
  5844. this.$message({
  5845. message: '操作成功',
  5846. type: "success"
  5847. });
  5848. // this.workContextDig = false
  5849. this.getWorkContextList()
  5850. } else {
  5851. this.$message({
  5852. message: res.msg,
  5853. type: "error"
  5854. });
  5855. }
  5856. },
  5857. error => {
  5858. this.$message({
  5859. message: error,
  5860. type: "error"
  5861. });
  5862. }
  5863. );
  5864. },
  5865. //获取职能列表
  5866. getFunctionalList(){
  5867. this.http.post('/project/getFunctionalDivisionList',{},
  5868. res => {
  5869. if (res.code == "ok") {
  5870. this.functionalList=res.data
  5871. } else {
  5872. this.$message({
  5873. message: res.msg,
  5874. type: "error"
  5875. });
  5876. }
  5877. },
  5878. error => {
  5879. this.$message({
  5880. message: error,
  5881. type: "error"
  5882. });
  5883. }
  5884. );
  5885. },
  5886. //获取工作内容
  5887. getWorkContextList(item){
  5888. if(item){
  5889. this.functionalId=item
  5890. }
  5891. this.http.post('/project/getFunWorkContextList',{
  5892. id:this.functionalId
  5893. },
  5894. res => {
  5895. if (res.code == "ok") {
  5896. this.workContextList=res.data
  5897. } else {
  5898. this.$message({
  5899. message: res.msg,
  5900. type: "error"
  5901. });
  5902. }
  5903. },
  5904. error => {
  5905. this.$message({
  5906. message: error,
  5907. type: "error"
  5908. });
  5909. }
  5910. );
  5911. },
  5912. //获取角色列表
  5913. getRoleList(){
  5914. this.http.post('/permission/getRoleList',{
  5915. companyId:this.user.companyId,
  5916. },
  5917. res => {
  5918. if (res.code == "ok") {
  5919. this.roleList=res.data
  5920. } else {
  5921. this.$message({
  5922. message: res.msg,
  5923. type: "error"
  5924. });
  5925. }
  5926. },
  5927. error => {
  5928. this.$message({
  5929. message: error,
  5930. type: "error"
  5931. });
  5932. }
  5933. );
  5934. },
  5935. synchronizationChange() {
  5936. if(this.synchronizationVal == '1') {
  5937. this.hasChooseProjectCode = []
  5938. } else {
  5939. this.synchronizationInputVal = ''
  5940. }
  5941. }
  5942. },
  5943. created() {
  5944. let height = window.innerHeight;
  5945. this.tableHeight = height - 225;
  5946. const that = this;
  5947. window.onresize = function temp() {
  5948. that.tableHeight = window.innerHeight - 195;
  5949. };
  5950. },
  5951. mounted() {
  5952. this.userssHu()
  5953. this.getDepartment();
  5954. this.getDepartment2();
  5955. this.projectListPageComponentKey++;
  5956. //localStorage中为string类型,需转化为int类型才会发生渲染
  5957. if (localStorage.projectPageIndex) {
  5958. this.page = parseInt(localStorage.projectPageIndex);
  5959. }
  5960. this.getList();
  5961. this.getUsers();
  5962. this.getCustomerList();
  5963. this.getProjectBaseConfigList();
  5964. this.getClfConfigList()
  5965. this.yanjiuzx()
  5966. this.getObtain()
  5967. this.getProjectList()
  5968. this.getGroupTemplate()
  5969. // this.getRoleList()
  5970. // 判断是否有供应商字段
  5971. if(this.user.company.packageProvider == 1){
  5972. this.getSupplierList()
  5973. // this.getPhase()
  5974. }
  5975. if(this.user.company.packageProject == 1) {
  5976. this.obtainPhase()
  5977. }
  5978. // this.getSupplierList()
  5979. if(this.user.timeType.mainProjectState == 1){
  5980. this.getMainProject()
  5981. }
  5982. if(this.user.timeType.projectLevelState == 1){
  5983. this.getProjectLevel()
  5984. }
  5985. // 判断释放为专业版
  5986. if(this.user.company.packageProject == 1) {
  5987. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:5,label:this.$t('di-feng-xian')},{id:6,label:this.$t('zhong-feng-xian')},{id:7,label:this.$t('gao-feng-xian')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  5988. } else {
  5989. this.importanceList = [{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}]
  5990. }
  5991. // 获取部门
  5992. if(this.user.timeType.projectWithDept) {
  5993. this.getDepartmentList()
  5994. }
  5995. if(this.user.companyId == '936') {
  5996. this.getkeyNodes()
  5997. }
  5998. if (this.user.timeType.projectManDay == 1) {
  5999. this.getManDaySetting();
  6000. }
  6001. },
  6002. };
  6003. </script>
  6004. <style lang="scss" scoped>
  6005. .synchronization {
  6006. display: flex;
  6007. justify-content: space-between;
  6008. // align-items: center;
  6009. .synchronizationLabel {
  6010. width: 140px;
  6011. }
  6012. }
  6013. .rg_span{
  6014. display: inline-block;
  6015. }
  6016. .rg_span span {
  6017. text-align: right;
  6018. box-sizing: border-box;
  6019. padding-right: 10px;
  6020. }
  6021. .el-dialog__title {
  6022. display: inline-table;
  6023. margin-top: 20px;
  6024. }
  6025. .addss {
  6026. width: 100%;
  6027. overflow: hidden;
  6028. white-space: nowrap;
  6029. text-overflow: ellipsis;
  6030. }
  6031. .keyNodes {
  6032. display: flex;
  6033. width: 100%;
  6034. box-sizing: border-box;
  6035. padding: 10px 30px;
  6036. }
  6037. .keyNodes .keyNodesTime {
  6038. width: 190px;
  6039. display: flex;
  6040. justify-content: center;
  6041. }
  6042. .keyNodes .keyNodesName {
  6043. width: 260px;
  6044. display: flex;
  6045. align-items: center;
  6046. overflow: hidden;
  6047. text-overflow: ellipsis;
  6048. }
  6049. .dialogSwitch {
  6050. }
  6051. // 111
  6052. </style>
  6053. <style>
  6054. .managePopperClass{
  6055. width: 190px;
  6056. }
  6057. .el-dropdown-link {
  6058. color: #409EFF;
  6059. }
  6060. .customdropdown{
  6061. margin-left: 10px;
  6062. }
  6063. .customdropdown .el-dropdown__caret-button{
  6064. height: 27px;
  6065. }
  6066. .customdropdown .el-button--mini:nth-child(1){
  6067. height: 27px;
  6068. }
  6069. .customdropdown_menu{
  6070. padding: 0;
  6071. }
  6072. .customdropdown_menu_btn{
  6073. border-color: transparent;
  6074. }
  6075. .ganttdialog .el-dialog__body{
  6076. height: 550px;
  6077. }
  6078. .toolbar_formitem_n1{
  6079. margin-right: 0 !important;
  6080. }
  6081. .wpgCssClass .el-form-item__label{
  6082. font-weight: 600;
  6083. }
  6084. .gongcheng .el-table .cell{
  6085. overflow: inherit !important;
  6086. }
  6087. </style>