list.vue 309 KB

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