list.vue 288 KB

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