list.vue 317 KB

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