list.vue 325 KB

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