list.vue 307 KB

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