list.vue 310 KB

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