list.vue 317 KB

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