list.vue 308 KB

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