daily.vue 330 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  31. <el-select v-model="selectState" size="small" @change="stateChange" style="100%">
  32. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  33. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  34. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  35. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  36. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  37. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  38. </el-select></div>
  39. <div>
  40. <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate">
  41. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  42. <!-- <span>{{ node.label }}</span> -->
  43. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  44. <span v-if="user.userNameNeedTranslate == '1'">
  45. <span v-if="node.data.children">
  46. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  47. </span>
  48. <span v-else>
  49. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  50. </span>
  51. </span>
  52. <span v-if="user.userNameNeedTranslate != '1'">
  53. {{ node.label }}
  54. </span>
  55. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  56. </span>
  57. <div style="position: absolute;right: 15px;">
  58. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  59. <!-- 未填报 -->
  60. {{$t('state.DidNotFillIn')}}
  61. </span>
  62. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  63. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  64. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  67. <!-- 待审核 -->
  68. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  71. <!-- 已通过 -->
  72. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  75. <!-- 未通过 -->
  76. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  79. <!-- 待提交 -->
  80. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. </div>
  83. </span>
  84. </el-tree>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  89. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  90. -
  91. -
  92. -
  93. </div>
  94. </div>
  95. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  96. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  97. <div class="allDaily" style="float:left;flex-grow:1">
  98. <!--系统管理员和部门负责人 -->
  99. <div class="report_title" style="display:flex;justify-content: space-between;">
  100. <span>
  101. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  102. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  103. <!-- {{depData != null ?depData.label:""}} -->
  104. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  105. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  106. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  107. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  108. <span v-if="targetUid == null">
  109. <!-- - 已提交 -->
  110. -{{$t('state.hasBeenSubmitted')}}
  111. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  112. <!-- 待提交 -->
  113. {{$t('state.waitingsubmit')}}
  114. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  115. <!-- 漏填 -->
  116. {{$t('state.missFillReport')}}
  117. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  118. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  119. </span>
  120. </span>
  121. </span>
  122. <span style="float:right;">
  123. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  124. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  125. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  126. <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  127. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  128. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  129. <!--部门负责人给个导出工时的功能 -->
  130. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  131. </span>
  132. </div>
  133. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  134. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  135. <i class="fa fa-circle"></i>
  136. <!-- {{item1.name}} -->
  137. <span v-if="user.userNameNeedTranslate == '1'">
  138. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  139. </span>
  140. <span v-if="user.userNameNeedTranslate != '1'">
  141. {{item1.name}}
  142. </span>
  143. <span style="margin-left:30px;">
  144. <span style="margin-right:20px;">
  145. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  146. <!-- 工作总时长: -->
  147. {{$t('other.totalWorkingHours')}}
  148. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  149. <span >{{item1.reportTime | amounts}}</span>h
  150. </span>
  151. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  152. <i class="iconfont firerock-iconliucheng1"></i>
  153. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  154. <!-- 审批流程 -->
  155. {{$t('other.approvalProcess')}}
  156. </span>
  157. </span>
  158. </span>
  159. <div class="checkbtn" style="padding-right:20px;">
  160. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  161. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  162. </div>
  163. <div class="one_daily_body">
  164. <el-timeline>
  165. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  166. <el-card shadow="never">
  167. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  168. <span v-if="user.company.packageEngineering == 0">
  169. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  170. <span v-if="item2.isDeptAudit==0">
  171. <span v-if="item2.projectAuditState==0">
  172. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  173. <span v-if="item2.projectAuditorName != null">(
  174. <!-- {{item2.projectAuditorName}} -->
  175. <span v-if="user.userNameNeedTranslate == '1'">
  176. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  177. </span>
  178. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  179. )</span>
  180. <!-- 审核 --> {{$t('other.audit')}}
  181. </span>
  182. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  183. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  184. <span v-if="item2.projectAuditorName != null">(
  185. <!-- {{item2.projectAuditorName}} -->
  186. <span v-if="user.userNameNeedTranslate == '1'">
  187. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  188. </span>
  189. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  190. )</span>
  191. <!-- 审核通过 --> {{$t('state.approved')}}
  192. </span>
  193. </span>
  194. <span v-else-if="item2.isDeptAudit==1">
  195. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  196. ({{$t('other.await')}}
  197. <span v-if="user.userNameNeedTranslate == '1'">
  198. <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
  199. </span>
  200. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  201. {{$t('other.audit')}})
  202. </span>
  203. ]</span>
  204. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  205. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  206. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  207. </span>
  208. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  209. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  210. </span>
  211. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  212. <span v-if="user.company.packageEngineering == 1">
  213. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  214. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  215. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  216. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  217. (
  218. <span v-if="user.userNameNeedTranslate != 1">
  219. {{item2.projectAuditorName}}
  220. </span>
  221. <span v-if="user.userNameNeedTranslate == 1">
  222. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  223. </span>
  224. )
  225. </span>{{$t('other.audit')}} ]</span>
  226. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!--每个项目上单独审核 -->
  231. <span style="float:right;">
  232. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  233. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  234. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  235. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  236. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  237. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  238. <!--自己可以撤回待审核状态的报告 -->
  239. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  240. </span>
  241. </p>
  242. <!--任务分组和阶段 -->
  243. <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
  244. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  245. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  246. <!-- 自定义日报文本 -->
  247. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  248. <p v-if="user.company.packageEngineering == 1">
  249. {{$t('other.professionalProgress')}}:
  250. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  251. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  252. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  253. </el-tooltip>
  254. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  255. <i class="iconfont firerock-iconshenhetongguo"></i>
  256. </el-tooltip>
  257. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  258. <i class="iconfont firerock-iconshenhebohui"></i>
  259. </el-tooltip>
  260. </span>
  261. </p>
  262. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  263. </p>
  264. <div v-if="item2.multiWorktime==0">
  265. <p style="display: inline-block;">{{$t('time.duration')}}:
  266. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  267. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  268. {{item2.time.toFixed(1)}}h
  269. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  270. </p>
  271. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  272. </div>
  273. <div v-if="item2.multiWorktime==1" >
  274. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  275. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  276. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  277. <p style="display: inline-block;">{{$t('time.duration')}}:
  278. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  279. {{timeItem.time.toFixed(1)}}h
  280. </p>
  281. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  282. </div>
  283. </div>
  284. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  285. <!--照片的显示 -->
  286. <p v-if="item2.pics != null && item2.pics.length > 0">
  287. <el-image v-for="(pic, index) in item2.pics" :key="index"
  288. style="width: 100px; height: 100px; margin-right:10px;"
  289. :src="pic"
  290. :preview-src-list="item2.pics">
  291. </el-image>
  292. </p>
  293. </el-card>
  294. </el-timeline-item>
  295. </el-timeline>
  296. </div>
  297. </div>
  298. <!-- 简陋的无报告提示 -->
  299. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. </el-card>
  306. </div>
  307. <!-- 填写日报的dialog -->
  308. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" style="height:95%" :close-on-click-modal="false" @closed="guanbi()" custom-class="editReportDialog" ref="editReportDialog">
  309. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  310. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  311. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  312. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  313. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  314. <span class="spnn" v-if="workForm.userNames">
  315. <span v-for="(item, index) in workForm.userNames" :key="index">
  316. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  317. <span v-if="index < workForm.userNames.length - 1">,</span>
  318. </span>
  319. </span>
  320. <span class="spnn hover" v-else>
  321. {{$t('defaultText.pleaseSelectAsubstitute')}}
  322. </span>
  323. </div>
  324. </el-form-item>
  325. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  326. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  327. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  328. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  329. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  330. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
  331. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  332. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  333. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  334. <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
  335. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
  336. <span v-if="user.timeType.syncDingding==1&&!workForm.time">{{$t('other.noAttendanceRecord')}}</span>
  337. </el-form-item>
  338. <!-- 000000 -->
  339. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  340. <div v-if="reportTimeType.multiWorktime==0">
  341. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  342. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  343. <el-select v-model="domain.timeType" style="width:200px;"
  344. v-if="reportTimeType.type == 0"
  345. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  346. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  347. @change="onTimeTypeChange(domain.timeType)">
  348. <el-option
  349. v-for="item in timeType"
  350. :key="item.value"
  351. :label="item.label"
  352. :value="item.value">
  353. </el-option>
  354. </el-select>
  355. <!-- 数字时长选择 -->
  356. <el-select v-model="domain.workingTime" style="width:200px;"
  357. v-if="reportTimeType.type == 1"
  358. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  359. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  360. @change="seleChn(0,domain)">
  361. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  362. </el-select>
  363. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  364. <span v-if="reportTimeType.type == 2">
  365. <!--时间范围选择 -->
  366. <el-time-picker
  367. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  368. v-model="domain.startTime"
  369. :placeholder="$t('time.startTime')"
  370. style="width:120px;"
  371. format="HH:mm"
  372. value-format="HH:mm"
  373. :picker-options="{
  374. start: '08:00',
  375. end: '23:30'
  376. }"
  377. @change="iptChang()">
  378. </el-time-picker> - <el-time-picker
  379. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  380. v-model="domain.endTime"
  381. :placeholder="$t('time.endTime')"
  382. style="width:120px;"
  383. format="HH:mm"
  384. value-format="HH:mm"
  385. :picker-options="{
  386. start: '08:00',
  387. end: '23:30',
  388. minTime: domain.startTime
  389. }"
  390. @change="iptChang()">
  391. </el-time-picker>
  392. </span>
  393. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  394. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  395. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  396. </div>
  397. </el-form-item>
  398. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  399. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  400. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  401. @change="selectProject(domain, index)"
  402. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  403. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  404. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  405. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  406. <span style="float: right;">{{ item.projectName }}</span>
  407. </el-option>
  408. </el-select>
  409. <template v-if="user.timeType.mainProjectState != 1">
  410. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  411. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  412. <!--子项目 -->
  413. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  414. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  416. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  417. </el-select>
  418. </template>
  419. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  420. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  421. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  422. </el-link>
  423. <!-- <el-link type="primary" v-if="canEdit"
  424. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  425. </el-form-item>
  426. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  427. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  428. </el-form-item>
  429. <!--如果设置了工时成本预警的预算成本项-->
  430. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  431. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  432. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  433. </el-select>
  434. </el-form-item>
  435. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  436. <!-- 任务分组 -->
  437. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  438. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  439. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  440. </el-select>
  441. <!-- 项目的阶段 -->
  442. <span v-if="domain.stages != null && domain.stages.length> 0"
  443. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  444. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  445. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  446. @change="changeStages(domain, index)"
  447. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  448. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  449. </el-select>
  450. </el-form-item>
  451. <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3">
  452. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  453. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  454. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  455. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  456. </el-option>
  457. </el-select>
  458. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="domain.projectAuditorId ? true : false" :flgs="true" @selectCatCli="selectCatCli"></selectCat>
  459. </el-form-item>
  460. <!-- 111111 -->
  461. <el-form-item label="审核人" v-if="user.timeType.reportAuditType == 3">
  462. <el-select v-model="domain.auditorFirst" placeholder="第一审核人" :disabled="!domain.canEdit" style="width:200px;">
  463. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  464. </el-select>
  465. <template v-if="user.timeType.auditLevel > 1">
  466. <i class="el-icon-right"></i>
  467. <el-select v-model="domain.auditorSec" placeholder="第二审核人" :disabled="!domain.canEdit" style="width:200px;">
  468. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  469. </el-select>
  470. </template>
  471. <template v-if="user.timeType.auditLevel > 2">
  472. <i class="el-icon-right"></i>
  473. <el-select v-model="domain.auditorThird" placeholder="第三审核人" :disabled="!domain.canEdit" style="width:200px;">
  474. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  475. </el-select>
  476. </template>
  477. </el-form-item>
  478. <el-form-item label="抄送人" v-if="user.timeType.reportAuditType == 3">
  479. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  480. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  481. </el-select>
  482. </el-form-item>
  483. <!-- 相关维度/自定义维度 -->
  484. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  485. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;">
  486. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  487. </el-option>
  488. </el-select>
  489. </el-form-item>
  490. <!-- 相关数值 -->
  491. <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  492. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  493. </el-form-item>
  494. <!-- 自定义文本 -->
  495. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  496. <el-input :disabled="!domain.canEdit" v-model="domain.customText" type="textarea" :rows="1" style="width:75%;margin-right:7%" maxlength="1000" show-word-limit></el-input>
  497. </el-form-item>
  498. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  499. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  500. <div style="width:300px;">
  501. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="5" :show-tooltip="false" :step="5" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  502. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}{{$t('time.hour')}}</span></el-col>
  503. </div>
  504. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  505. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  506. </div>
  507. </el-form-item>
  508. <!--工程专业版本模式下, 各个专业的进度填报 -->
  509. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  510. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  511. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  512. <el-input size="mini" style="width:60px;" v-model="item.progress"
  513. @keyup.native="onProgressChange"
  514. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  515. </span>
  516. </el-form-item>
  517. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  518. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  519. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  521. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  522. </el-select>
  523. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  524. </el-form-item>
  525. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  526. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  527. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable
  528. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  529. </el-form-item>
  530. </div>
  531. <!--多个工作事项填报的情况 -->
  532. <div v-if="reportTimeType.multiWorktime==1">
  533. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  534. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  535. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  536. @change="selectProject(domain, index)"
  537. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  538. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  539. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  540. <span style="float: right;">{{ item.projectName }}</span>
  541. </el-option>
  542. </el-select>
  543. <template v-if="user.timeType.mainProjectState != 1">
  544. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  545. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  546. <!--子项目 -->
  547. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  548. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  549. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  550. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  551. </el-select>
  552. </template>
  553. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  554. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  555. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  556. </el-link>
  557. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  558. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  559. </div>
  560. <!-- <el-link type="primary" v-if="canEdit"
  561. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  562. </el-form-item>
  563. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  564. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  565. </el-form-item>
  566. <!--如果设置了工时成本预警的预算成本项-->
  567. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  568. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  569. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  570. </el-select>
  571. </el-form-item>
  572. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  573. <!-- 任务分组 -->
  574. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  575. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  576. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  577. </el-select>
  578. <!-- 项目的阶段 -->
  579. <span v-if="domain.stages != null && domain.stages.length> 0"
  580. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  581. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  582. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  583. @change="changeStages(domain, index)"
  584. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  585. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  586. </el-select>
  587. </el-form-item>
  588. <el-form-item :label="$t('other.projectAuditor')" >
  589. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  590. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  591. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  592. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  593. </el-option>
  594. </el-select>
  595. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" :flgs="true" @selectCatCli="selectCatCli"></selectCat>
  596. </el-form-item>
  597. <!--工程专业版本模式下, 各个专业的进度填报 -->
  598. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  599. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  600. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  601. <el-input size="mini" style="width:60px;" v-model="item.progress"
  602. @keyup.native="onProgressChange"
  603. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  604. </span>
  605. </el-form-item>
  606. <!-- 相关维度 -->
  607. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  608. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')">
  609. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  610. </el-option>
  611. </el-select>
  612. </el-form-item>
  613. <!-- 相关数值 -->
  614. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
  615. <el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  616. </el-form-item>
  617. <!-- 自定义文本 -->
  618. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
  619. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  620. </el-form-item>
  621. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  622. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  623. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  624. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  625. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  626. </el-select>
  627. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  628. </el-form-item>
  629. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  630. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  631. <i v-if="tIndex>0&&workForm.domains[index].state>=2" @click="removeTimeItem(domain,tIndex)" class="el-icon-delete" style="position:absolute;right:-7px;top:-7px;font-size:16px;"></i>
  632. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  633. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  634. <span v-if="reportTimeType.type == 2">
  635. <!-- <span> -->
  636. <!--时间范围选择 -->
  637. <el-time-picker
  638. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  639. v-model="timeItem.startTime"
  640. :placeholder="$t('time.startTime')"
  641. style="width:120px;"
  642. format="HH:mm"
  643. value-format="HH:mm"
  644. :picker-options="{
  645. start: '00:00',
  646. end: '23:59',
  647. }"
  648. @change="iptChangs()">
  649. </el-time-picker> - <el-time-picker
  650. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  651. v-model="timeItem.endTime"
  652. :placeholder="$t('time.endTime')"
  653. style="width:120px;"
  654. format="HH:mm"
  655. value-format="HH:mm"
  656. :picker-options="{
  657. start: '00:00',
  658. end: '23:59',
  659. minTime: timeItem.startTime
  660. }"
  661. @change="iptChangs()">
  662. </el-time-picker>
  663. </span>
  664. </el-form-item>
  665. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  666. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  667. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  668. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  669. ></el-input>
  670. </el-form-item>
  671. </div>
  672. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  673. </div>
  674. <!--照片的显示 -->
  675. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  676. <el-image v-for="(pic, index) in domain.pics" :key="index"
  677. style="width: 100px; height: 100px; margin-right:10px;"
  678. :src="pic"
  679. :preview-src-list="domain.pics">
  680. </el-image>
  681. </p>
  682. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  683. </div>
  684. <span id="workFormsItemBottom"></span>
  685. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;position:sticky;bottom:70px;background:#fff;z-index:1010">{{$t('other.addMore')}}</el-link>
  686. </el-form>
  687. <span slot="footer" class="dialog-footer">
  688. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  689. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  690. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  691. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  692. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  693. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  694. </span>
  695. </el-dialog>
  696. <!-- 按周填报 -->
  697. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  698. <!-- 按周填报-已填工时-点击 -->
  699. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  700. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  701. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  702. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  703. <el-table-column prop="state" :label="$t('state.states')">
  704. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  705. </el-table-column>
  706. <!-- <el-table-column label="操作">
  707. <template slot-scope="scope">
  708. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  709. </template>
  710. </el-table-column> -->
  711. </el-table>
  712. <span slot="footer" class="dialog-footer">
  713. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  714. </span>
  715. </el-dialog>
  716. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  717. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  718. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" style="margin-right: 18px" :clearable="false"></el-date-picker>
  719. <el-button @click="handleGetPrevWeek()">{{$t('time.lastWeek')}}</el-button>
  720. <el-button @click="handleGetNextvWeek()">{{$t('time.nextWeek')}}</el-button>
  721. <el-button @click="getCurrentWeek()">{{$t('time.thisWeek')}}</el-button>
  722. <el-button @click="newDates()">{{$t('time.addedDate')}}</el-button>
  723. </el-form-item>
  724. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  725. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  726. <template slot-scope="scope">
  727. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData(weekDay)}})
  728. </template>
  729. </el-table-column>
  730. <el-table-column fixed="left" :label="$t('other.hoursFilled')+ '(h)'" width="100" prop="filledTime" align="center">
  731. <template slot-scope="scope">
  732. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  733. <p v-else></p>
  734. </template>
  735. </el-table-column>
  736. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  737. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
  738. <template slot-scope="scope">
  739. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  740. <el-button v-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 3 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h</el-button>
  741. <el-button v-else-if="scope.row[item.projectName].workingTime != null && scope.row[item.projectName].workingTime != '' && reportTimeType.type == 1 && scope.row[item.projectName].workingTime > 0" type="text" slot="reference">{{scope.row[item.projectName].workingTime}} h</el-button>
  742. <el-button v-else-if="scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}</el-button>
  743. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  744. </div>
  745. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  746. <el-button v-if="scope.row[item.projectName].time != null && scope.row[item.projectName].time != '' && reportTimeType.type == 2" type="text" slot="reference">{{scope.row[item.projectName].time[0]}} - {{scope.row[item.projectName].time[1]}}</el-button>
  747. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  748. </div>
  749. </template>
  750. </el-table-column>
  751. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  752. <template slot-scope="scope">
  753. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
  754. <span v-else>{{$t('other.noAttendanceRecord')}}</span>
  755. </template>
  756. </el-table-column>
  757. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  758. <template slot-scope="scope">
  759. <div class="zhiss">
  760. <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
  761. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  762. </div>
  763. </template>
  764. </el-table-column>
  765. </el-table>
  766. </el-form>
  767. <!-- 按周填报项目筛选 -->
  768. <div v-if="selConShow" class="selConStyle">
  769. <div class="selConStyle_title">{{$t('defaultText.pleaseSelectTheItemYouWantToFillIn')}}</div>
  770. <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
  771. <el-option
  772. v-for="item in fillProjectList"
  773. :disabled="item.status!=1 && item.status!=4"
  774. :key="item.id"
  775. :label="item.projectName"
  776. :value="item.id">
  777. </el-option>
  778. </el-select>
  779. </div>
  780. <span slot="footer" class="dialog-footer" v-if="selConShow">
  781. <el-button @click="selListqx()">{{$t('btn.cancel')}}</el-button>
  782. <el-button type="primary" @click="selListFun()">{{$t('btn.nextStep')}}</el-button>
  783. <!-- :loading="submitingReport" -->
  784. </span>
  785. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  786. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button>
  787. <el-button @click="zhoAddqx()">{{$t('btn.cancel')}}</el-button>
  788. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  789. </span>
  790. </el-dialog>
  791. <!-- 选择时间 -->
  792. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  793. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  794. <span slot="footer" class="dialog-footer">
  795. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  796. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  797. </span>
  798. </el-dialog>
  799. <!-- 按周填报弹窗 -->
  800. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  801. <div>
  802. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  803. <p>{{$t('lable.subproject')}}</p>
  804. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  805. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  806. </el-select>
  807. </div>
  808. <!--如果设置了工时成本预警的预算成本项-->
  809. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  810. <p>{{$t('lable.budgetSource')}}</p>
  811. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  812. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  813. </el-select>
  814. </div>
  815. <!-- 任务分组 -->
  816. <div class="zhoFel" v-if="user.company.packageProject == 1">
  817. <p>{{$t('lable.taskGrouping')}}</p>
  818. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  819. @change="getGroupStages(zhoBao, 0)">
  820. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  821. </el-select>
  822. </div>
  823. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  824. <p>{{$t('other.inputStage')}}</p>
  825. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  826. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  827. </el-select>
  828. </div>
  829. <div class="zhoFel" v-if="user.timeType.reportAuditType != 3">
  830. <p>{{$t('other.reviewer')}}</p>
  831. <el-select v-model="zhoBao.projectAuditorId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  832. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  833. </el-select>
  834. </div>
  835. <template v-if="user.timeType.reportAuditType == 3">
  836. <div class="zhoFel">
  837. <p>第一审核人</p>
  838. <el-select v-model="zhoBao.auditorFirst" placeholder="第一审核人" style="width: 355px">
  839. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  840. </el-select>
  841. </div>
  842. <div class="zhoFel">
  843. <p>第二审核人</p>
  844. <el-select v-model="zhoBao.auditorSec" placeholder="第二审核人" style="width: 355px">
  845. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  846. </el-select>
  847. </div>
  848. <div class="zhoFel">
  849. <p>第三审核人</p>
  850. <el-select v-model="zhoBao.auditorThird" placeholder="第三审核人" style="width: 355px">
  851. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  852. </el-select>
  853. </div>
  854. <div class="zhoFel">
  855. <p>抄送人</p>
  856. <el-select v-model="zhoBao.ccUserid" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  857. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  858. </el-select>
  859. </div>
  860. </template>
  861. <!-- 自定义维度 -->
  862. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  863. <p>{{user.timeType.customDegreeName}}</p>
  864. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  865. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  866. </el-select>
  867. </div>
  868. <!-- 自定义数值 -->
  869. <div class="zhoFel" v-if="user.timeType.customDataActive">
  870. <p>{{user.timeType.customDataName}}</p>
  871. <el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
  872. </div>
  873. <!-- 自定义文本 -->
  874. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  875. <p>{{user.timeType.customTextName}}</p>
  876. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  877. </div>
  878. <div class="zhoFel" v-if="reportTimeType.type == 2">
  879. <p>{{$t('other.timeSelection')}}</p>
  880. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  881. </div>
  882. <div class="zhoFel" v-if="reportTimeType.type == 1">
  883. <p>{{$t('other.chooseDuration')}}</p>
  884. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  885. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  886. </el-select>
  887. </div>
  888. <div class="zhoFel" v-if="reportTimeType.type == 3">
  889. <p>{{$t('lable.percentageOfTime')}}</p>
  890. <div style="width:355px;display: flex;align-items: center;">
  891. <el-col span="23"><el-slider style="margin-left: 5px;width:249px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)"></el-slider></el-col>
  892. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}{{$t('time.hour')}}</span></el-col>
  893. </div>
  894. </div>
  895. <div class="zhoFel">
  896. <p>{{$t('other.workMatters')}}</p>
  897. <el-input type="textarea" v-model="zhoBao.con" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  898. </div>
  899. </div>
  900. <span slot="footer" class="dialog-footer">
  901. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  902. <el-button type="primary" @click="btnTianxiaes()">{{$t('btn.determine')}}</el-button>
  903. </span>
  904. </el-dialog>
  905. <!-- 批量日报审核 -->
  906. <el-dialog :title="$t('other.bulkProjectReportReview')" :visible.sync="approveDialogVisible" width="500px" >
  907. <el-checkbox v-model="isAllSelect" :label="$t('btn.selectAll')" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  908. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  909. </el-tree>
  910. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">{{$t('other.responsibleForTheProjectLength')}}</div>
  911. <span slot="footer" class="dialog-footer">
  912. <el-button @click="approveDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  913. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">{{$t('state.approved')}}</el-button>
  914. </span>
  915. </el-dialog>
  916. <!--导出报表条件选择 -->
  917. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  918. <el-form ref="form3" :model="exportParam" >
  919. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  920. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  921. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  922. </el-select>
  923. </el-form-item>
  924. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  925. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  926. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  927. </el-form-item>
  928. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  929. <el-date-picker
  930. v-model="exportParam.dateRange" :editable="false"
  931. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  932. :clearable="true"
  933. :range-separator="$t('other.to')"
  934. type="daterange"
  935. :start-placeholder="$t('time.startDate')"
  936. :end-placeholder="$t('time.endDate')"
  937. ></el-date-picker>
  938. </el-form-item>
  939. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  940. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  941. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  942. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  943. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  944. </el-select>
  945. </el-form-item>
  946. </el-form>
  947. <div slot="footer" class="dialog-footer">
  948. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  949. </div>
  950. </el-dialog>
  951. <!--导出报表条件选择 -->
  952. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  953. <el-form ref="form3" :model="exportParam" >
  954. <el-form-item prop="range" :label="$t('time.dateRange')">
  955. <el-date-picker
  956. v-model="exportParam.dateRange" :editable="false"
  957. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  958. :clearable="true"
  959. :range-separator="$t('other.to')"
  960. type="daterange"
  961. :start-placeholder="$t('time.startDate')"
  962. :end-placeholder="$t('time.endDate')"
  963. ></el-date-picker>
  964. </el-form-item>
  965. </el-form>
  966. <div slot="footer" class="dialog-footer">
  967. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  968. </div>
  969. </el-dialog>
  970. <!--人员列表 -->
  971. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  972. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  973. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  974. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  975. <el-table-column type="selection"></el-table-column>
  976. <el-table-column prop="label" :label="$t('lable.name')" >
  977. <template slot-scope="scope">
  978. <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)') : scope.row.label}}</span>
  979. </template>
  980. </el-table-column>
  981. <el-table-column prop="deptName" :label="$t('lable.department')" >
  982. </el-table-column>
  983. </el-table>
  984. </el-tab-pane>
  985. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  986. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  987. <el-table-column prop="label" :label="$t('lable.name')" >
  988. <template slot-scope="scope">
  989. <!-- <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天 - ' + leaveTypeName[scope.row.leaveType] + ')' : '(请假' + scope.row.leaveTimes + 'h - ' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span> -->
  990. <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')') : scope.row.label}}</span>
  991. </template>
  992. </el-table-column>
  993. <el-table-column prop="deptName" :label="$t('lable.department')" >
  994. </el-table-column>
  995. </el-table>
  996. </el-tab-pane>
  997. </el-tabs>
  998. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  999. <el-table-column type="selection"></el-table-column>
  1000. <el-table-column prop="label" :label="$t('lable.name')" ></el-table-column>
  1001. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1002. </el-table-column>
  1003. </el-table>
  1004. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1005. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1006. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1007. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1008. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1009. </div>
  1010. </el-dialog>
  1011. <!-- 按部门选择人员 -->
  1012. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1013. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1014. <div class="tree" style="height:400px">
  1015. <el-scrollbar style="height:100%">
  1016. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  1017. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1018. highlight-current :filter-node-method="filterNode">
  1019. <span class="custom-tree-node" slot-scope="{ node, data }">
  1020. <span v-if="user.userNameNeedTranslate == '1'">
  1021. <span v-if="node.data.children">
  1022. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1023. </span>
  1024. <span v-else>
  1025. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1026. </span>
  1027. </span>
  1028. <span v-if="user.userNameNeedTranslate != '1'">
  1029. {{ node.label }}
  1030. </span>
  1031. </span>
  1032. </el-tree>
  1033. </el-scrollbar>
  1034. </div>
  1035. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1036. <div slot="footer" class="dialog-footer">
  1037. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1038. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1039. </div>
  1040. </el-dialog>
  1041. <el-dialog
  1042. v-if="monthWorkTimeDialog"
  1043. :visible.sync="monthWorkTimeDialog"
  1044. :close-on-click-modal="false"
  1045. customClass="customWidth selectworktime"
  1046. width="63%"
  1047. title=""
  1048. >
  1049. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1050. <el-tabs v-model="activeName" @tab-click="handleClick">
  1051. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1052. <div class="selectworktime_export" style="margin-top:10px;">
  1053. <div class="selectworktime_export_l">
  1054. <el-date-picker
  1055. class="selecteworktime_datapick"
  1056. v-model="WorktimeDatepickValue"
  1057. value-format="yyyy-MM-dd"
  1058. type="daterange"
  1059. align="right"
  1060. unlink-panels
  1061. :range-separator="$t('other.to')"
  1062. :start-placeholder="$t('time.startDate')"
  1063. :end-placeholder="$t('time.endDate')"
  1064. :default-time="['12:00:00', '12:00:00']"
  1065. size="small"
  1066. popper-class="selecteorktime_datapick_popper"
  1067. @change="showMonthWorkTime()"
  1068. >
  1069. </el-date-picker>
  1070. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1071. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1072. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1073. <!-- 222 -->
  1074. </div>
  1075. <div>
  1076. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1077. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1078. </el-input>
  1079. </div>
  1080. <el-link
  1081. type="primary"
  1082. style="float: right; vertical-align: middle;height:32px"
  1083. @click="exportMembWorkHours()"
  1084. >{{$t('export.exportData')}}</el-link
  1085. >
  1086. </div>
  1087. <el-table ref="hasworkTbl"
  1088. :data="monthWorkDataS"
  1089. v-el-table-infinite-scroll="listScroll"
  1090. border
  1091. :height="500"
  1092. highlight-current-row
  1093. style="width: 100%"
  1094. v-loading="tbload"
  1095. :lazy="true"
  1096. >
  1097. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1098. <template slot-scope="scope">
  1099. {{ scope.$index + 1 }}
  1100. </template>
  1101. </el-table-column>
  1102. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1103. <template slot-scope="scope">
  1104. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1105. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1106. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1107. <!-- {{scope.row.name}} -->
  1108. </span>
  1109. </template>
  1110. </el-table-column>
  1111. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1112. <template slot-scope="scope">
  1113. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1114. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1115. </template>
  1116. </el-table-column>
  1117. <el-table-column
  1118. min-width="105"
  1119. v-for="(item, index) in pickDateArray"
  1120. :key="index"
  1121. :label="item.label"
  1122. align="center"
  1123. >
  1124. <template slot-scope="scope">
  1125. <div
  1126. style="color: red"
  1127. v-if="
  1128. scope.row.worktimeList.filter(
  1129. (w) =>
  1130. w.createDate==item.date
  1131. ).length > 0 &&
  1132. scope.row.worktimeList.filter(
  1133. (w) =>w.createDate==item.date
  1134. )[0].workingTime < reportTimeType.allday
  1135. "
  1136. >
  1137. {{
  1138. scope.row.worktimeList.filter(
  1139. (w) =>w.createDate==item.date
  1140. )[0].workingTime.toFixed(1)
  1141. }}
  1142. </div>
  1143. <div
  1144. style="color: #20a0ff"
  1145. v-if="
  1146. scope.row.worktimeList.filter(
  1147. (w) =>w.createDate==item.date
  1148. ).length > 0 &&
  1149. scope.row.worktimeList.filter(
  1150. (w) =>w.createDate==item.date
  1151. )[0].workingTime > reportTimeType.allday
  1152. "
  1153. >
  1154. {{
  1155. scope.row.worktimeList.filter(
  1156. (w) =>w.createDate==item.date
  1157. )[0].workingTime.toFixed(1)
  1158. }}
  1159. </div>
  1160. <div
  1161. v-if="
  1162. scope.row.worktimeList.filter(
  1163. (w) =>w.createDate==item.date
  1164. ).length > 0 &&
  1165. scope.row.worktimeList.filter(
  1166. (w) =>w.createDate==item.date
  1167. )[0].workingTime == reportTimeType.allday
  1168. "
  1169. >
  1170. {{
  1171. scope.row.worktimeList.filter(
  1172. (w) =>w.createDate==item.date
  1173. )[0].workingTime
  1174. }}
  1175. </div>
  1176. <div
  1177. v-if="
  1178. scope.row.worktimeList.filter(
  1179. (w) =>w.createDate==item.date
  1180. ).length == 0
  1181. "
  1182. >
  1183. 0
  1184. </div>
  1185. <div
  1186. v-if="
  1187. scope.row.worktimeList.filter(
  1188. (w) =>w.createDate==item.date
  1189. ).length > 0 &&
  1190. typeof scope.row.worktimeList.filter(
  1191. (w) =>w.createDate==item.date
  1192. )[0].workingTime == 'string'
  1193. "
  1194. >
  1195. {{
  1196. scope.row.worktimeList.filter(
  1197. (w) =>w.createDate==item.date
  1198. )[0].workingTime
  1199. }}
  1200. </div>
  1201. </template>
  1202. </el-table-column>
  1203. </el-table>
  1204. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1205. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1206. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1207. <label style="font-size: 16px">员工每日已填报工时数</label>
  1208. <el-link
  1209. type="primary"
  1210. style="float: right; margin-right: 60px"
  1211. @click="exportMembWorkHours()"
  1212. >导出已填报数据</el-link
  1213. > -->
  1214. <!-- <el-button >导出</el-button> -->
  1215. <!-- </div> -->
  1216. </el-tab-pane>
  1217. <el-tab-pane :label="$t('other.unfilledPersonList')" name="second" >
  1218. <div class="selectworktime_export" style="margin-top:10px">
  1219. <div class="selectworktime_export_l">
  1220. <el-date-picker
  1221. class="selecteworktime_datapick"
  1222. v-model="WorktimeDatepickValue"
  1223. value-format="yyyy-MM-dd"
  1224. type="daterange"
  1225. align="right"
  1226. unlink-panels
  1227. :range-separator="$t('other.to')"
  1228. :start-placeholder="$t('time.startDate')"
  1229. :end-placeholder="$t('time.endDate')"
  1230. :default-time="['12:00:00', '12:00:00']"
  1231. size="small"
  1232. popper-class="selecteorktime_datapick_popper"
  1233. @change="showMonthNotWorkTime()"
  1234. >
  1235. </el-date-picker>
  1236. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1237. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1238. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1239. </div>
  1240. <div>
  1241. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1242. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1243. </el-input>
  1244. </div>
  1245. <el-link
  1246. type="primary"
  1247. style="float: right; vertical-align: middle;height:32px"
  1248. @click="exportMembNotWorkHours()"
  1249. >{{$t('export.exportData')}}</el-link
  1250. >
  1251. </div>
  1252. <el-table
  1253. ref="hasworkTbl2"
  1254. :data="monthNotWorkDateS"
  1255. v-el-table-infinite-scroll="notListScroll"
  1256. border
  1257. :height="500"
  1258. highlight-current-row
  1259. style="width: 100%"
  1260. v-loading="tbload"
  1261. lazy
  1262. >
  1263. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1264. <template slot-scope="scope">
  1265. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1266. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1267. </template>
  1268. </el-table-column>
  1269. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1270. <template slot-scope="scope">
  1271. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1272. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1273. </template>
  1274. </el-table-column>
  1275. <el-table-column
  1276. min-width="200"
  1277. :label="$t('weekDay.date')"
  1278. align="center"
  1279. prop="createDate"
  1280. >
  1281. </el-table-column>
  1282. <el-table-column
  1283. min-width="200"
  1284. :label="$t('state.states')"
  1285. align="center"
  1286. prop="status"
  1287. />
  1288. <el-table-column
  1289. min-width="200"
  1290. :label="$t('other.attendanceData')"
  1291. prop="cardTime"
  1292. align="center"
  1293. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1294. </el-table>
  1295. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" :title="$t('message.loading')+'...'" type="success" center :closable="false" show-icon></el-alert>
  1296. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1297. </el-tab-pane>
  1298. </el-tabs>
  1299. </el-dialog>
  1300. <!--驳回弹出框 -->
  1301. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1302. <div>
  1303. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="$t('defaultText.pleaseEnterYourDecision')+(denyForm.i==0?$t('btn.rejected'):$t('btn.undo'))+$t('other.reason')" />
  1304. </div>
  1305. <div slot="footer" class="dialog-footer">
  1306. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1307. <el-button type="primary" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1308. </div>
  1309. </el-dialog>
  1310. <!-- 通过弹出框 -->
  1311. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1312. <div>
  1313. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1314. </div>
  1315. <div slot="footer" class="dialog-footer">
  1316. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1317. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1318. </div>
  1319. </el-dialog>
  1320. <!--批量导入日报 -->
  1321. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1322. <p>1. {{$t('other.download')}}
  1323. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx'" :download="$t('template.EmployeeTimeImportTemplate')+'.xlsx'">{{$t('template.EmployeeHoursStatisticsTemplate') + '.xlsx'}}</el-link>
  1324. </p>
  1325. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1326. <p style="display: flex;justify-content: center;">
  1327. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1328. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1329. </el-upload>
  1330. </p>
  1331. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1332. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1333. </div>
  1334. </el-dialog>
  1335. <!-- 工时导入记录弹窗 -->
  1336. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1337. <div style="height: 452px">
  1338. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1339. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1340. <el-table-column prop="userName" :label="$t('other.operator')"> </el-table-column>
  1341. <el-table-column prop="datel" :label="$t('other.document')">
  1342. <template slot-scope="scope">
  1343. <div>
  1344. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1345. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1346. </div>
  1347. </template>
  1348. </el-table-column>
  1349. </el-table>
  1350. <el-col :span="24" class="paginatis">
  1351. <el-pagination
  1352. @size-change="handleSizeChange"
  1353. @current-change="handleCurrentChange"
  1354. :page-sizes="[20 , 50 , 80 , 100]"
  1355. :page-size="20"
  1356. layout="total, sizes, prev, pager, next"
  1357. :total="toViewForm.total"
  1358. style="float:right;"
  1359. ></el-pagination>
  1360. </el-col>
  1361. </div>
  1362. </el-dialog>
  1363. <!--基于企业微信考勤数据的工时导入 -->
  1364. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1365. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1366. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1367. </el-step>
  1368. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1369. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1370. </el-steps>
  1371. <div v-if="active==0" style="padding:30px;height:360px;">
  1372. <div style="margin-top:50px;margin-left:280px;">
  1373. <el-date-picker
  1374. v-model="importWxParam.date" :editable="false"
  1375. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1376. :clearable="true"
  1377. :range-separator="$t('other.to')"
  1378. type="daterange"
  1379. :start-placeholder="$t('time.startDate')"
  1380. :end-placeholder="$t('time.endDate')"
  1381. @change="loadCheckInData"
  1382. ></el-date-picker>
  1383. </div>
  1384. </div>
  1385. <div v-if="active==1" style="padding:10px;">
  1386. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1387. style="width: 100%;margin-top:5px;" >
  1388. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1389. <template slot-scope="scope">
  1390. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1391. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1392. </template>
  1393. </el-table-column>
  1394. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1395. </el-table-column>
  1396. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1397. <el-table-column prop="username" :label="$t('screening.employeename')" ></el-table-column>
  1398. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1399. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1400. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1401. <template slot-scope="scope">
  1402. {{scope.row.workHours.toFixed(1)}}h
  1403. </template>
  1404. </el-table-column>
  1405. </el-table>
  1406. </div>
  1407. <div v-if="active==2" >
  1408. <p style="display: flex;justify-content: center;height:390px;">
  1409. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1410. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1411. </el-upload>
  1412. </p>
  1413. </div>
  1414. <div slot="title">
  1415. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1416. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1417. </div>
  1418. <span slot="footer">
  1419. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1420. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1421. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1422. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1423. </span>
  1424. </el-dialog>
  1425. <!--工时批量代填 -->
  1426. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1427. <div>
  1428. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1429. v-model="importWxParam.date" :editable="false"
  1430. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1431. :clearable="true"
  1432. :range-separator="$t('other.to')"
  1433. type="daterange"
  1434. :start-placeholder="$t('time.startDate')"
  1435. :end-placeholder="$t('time.endDate')"
  1436. @change="loadCheckInData"
  1437. ></el-date-picker>
  1438. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1439. </div>
  1440. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1441. :key="timeStamp"
  1442. style="width: 100%;margin-top:5px;" ref="tab">
  1443. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1444. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left"></el-table-column>
  1445. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1446. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1447. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1448. <template slot-scope="scope">
  1449. {{scope.row.workHours.toFixed(1)}}h
  1450. </template>
  1451. </el-table-column>
  1452. <!--项目名称列表 -->
  1453. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1454. <template slot-scope="scope">
  1455. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1456. </template>
  1457. </el-table-column>
  1458. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1459. <template slot-scope="scope">
  1460. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1461. </template>
  1462. </el-table-column>
  1463. </el-table>
  1464. </el-dialog>
  1465. <!--基于企业微信考勤数据的工时导入 -->
  1466. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1467. <div>
  1468. <span>{{importResultMsg}}</span>
  1469. </div>
  1470. <span slot="footer" class="dialog-footer">
  1471. <el-button type="primary" @click="showImportResult=false">{{$t('btn.submit')}}</el-button>
  1472. </span>
  1473. </el-dialog>
  1474. <!-- 审核流程展示 -->
  1475. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1476. <div style="padding:20px 40px 20px 0">
  1477. <el-timeline :reverse="false">
  1478. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">{{item.msg}}</el-timeline-item>
  1479. </el-timeline>
  1480. </div>
  1481. </el-dialog>
  1482. </section>
  1483. </template>
  1484. <script>
  1485. // 左右滑动
  1486. import dragMixin from "@/common/js/tensile.js";
  1487. import util from "../../common/js/util";
  1488. // 自定义select组件
  1489. import selectCat from "@/components/select.vue"
  1490. // 引入自定义级联组件
  1491. import vueCascader from "@/components/cascader.vue"
  1492. let _that = this
  1493. export default {
  1494. mixins: [dragMixin],
  1495. components: {
  1496. selectCat,
  1497. vueCascader
  1498. },
  1499. data() {
  1500. return {
  1501. translation: '1', // 1、文字, 2、部门, 3、人员
  1502. exportLoad: false,
  1503. getPickerOptions: {
  1504. disabledDate: (time) => {
  1505. var date = new Date();
  1506. var year = date.getFullYear();
  1507. var month = date.getMonth() + 1;
  1508. if (month >= 1 && month <= 9) {
  1509. month = "0" + month;
  1510. }
  1511. var currentdate = year.toString() + month.toString();
  1512. var timeyear = time.getFullYear();
  1513. var timemonth = time.getMonth() + 1;
  1514. if (timemonth >= 1 && timemonth <= 9) {
  1515. timemonth = "0" + timemonth;
  1516. }
  1517. var timedate = timeyear.toString() + timemonth.toString();
  1518. if(this.user.timeType.fillAhead == 0){
  1519. return currentdate < timedate;
  1520. }else{
  1521. return false
  1522. }
  1523. }
  1524. },
  1525. alalal: '8.0',
  1526. timeBasecostList:null,
  1527. tbload: false,
  1528. exportTimeDialog: false,
  1529. searchKeyword: '',
  1530. monthWorkDataS: [],
  1531. monthNotWorkDateS: [],
  1532. pickDateArray:[],
  1533. WorktimeDatepickValue: [],
  1534. activeName:"first",
  1535. isLeave: 0,
  1536. submitingReport: false,
  1537. importResultMsg:null,
  1538. showImportResult:false,
  1539. importingData: false,
  1540. isDraft: 0,
  1541. timeStamp: 0,
  1542. projectColumns:[],
  1543. checkinLoading:false,
  1544. importWxParam:{date:null,},
  1545. active:0,
  1546. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1547. importWxDialog:false,
  1548. importDialog:false,
  1549. denyForm:null,
  1550. denyReasonDialog:false,
  1551. monthWorkTimeDialog: false,
  1552. isSubstitude:false,
  1553. isFill:false,
  1554. unFillList:[],
  1555. fillList:[],
  1556. fillMembList:[],
  1557. fillMembList_leave: [],
  1558. membListVisible: false,
  1559. isBatch:0,//是否是批量填报
  1560. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1561. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1562. weekDay : [this.$t('weekDay.sunday'), this.$t('weekDay.monday'), this.$t('weekDay.tuesday'), this.$t('weekDay.wednesday'), this.$t('weekDay.thursday'), this.$t('weekDay.friday'), this.$t('weekDay.saturday')],
  1563. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1564. fillStatusList: [],
  1565. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1566. exportDialog:false,
  1567. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1568. subProjectList:[],
  1569. canEdit: true,
  1570. timeRange:[0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  1571. selectTime:null,
  1572. reportTimeType:{},
  1573. curDate:'',
  1574. isAllSelect: false,
  1575. approveDialogVisible:false,
  1576. deptId:null,
  1577. targetUid: null,
  1578. membCount:0,
  1579. selectState:"-1",
  1580. user: JSON.parse(sessionStorage.getItem("user")),
  1581. allUsersList: [],
  1582. showAddMore:false,
  1583. allDate: [],
  1584. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1585. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1586. choseDay: 0,
  1587. tableHeight: 0,
  1588. listLoading: false,
  1589. projectList: [], //项目列表
  1590. fillProjectList: [],
  1591. reportList: [], //日报列表
  1592. reportNames:[], //批量审批列表
  1593. selCon:[], //筛选条件
  1594. selProjectList:[], //筛选后项目列表
  1595. selConShow: true,
  1596. dialogVisible: false, //项目弹窗
  1597. report: '',
  1598. workForm: {
  1599. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1600. domains: [{
  1601. id: null,
  1602. projectId: "",
  1603. workingTime: "",
  1604. timeType:0,
  1605. content: "",
  1606. state: 2,
  1607. multiWorktime:0,
  1608. worktimeList:[],
  1609. degreeId: null,
  1610. auditUserList: []
  1611. }],
  1612. },
  1613. workRules: {
  1614. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  1615. },
  1616. chooseParticipVisible: false,
  1617. logining: false,
  1618. isDisable: false,
  1619. timeType:[],
  1620. deptMembData: [
  1621. ],
  1622. //部门人员树状结构
  1623. data: [
  1624. {
  1625. id: -1,
  1626. label: this.$t('lable.allStaff'),
  1627. membCount:0
  1628. },
  1629. {
  1630. id: 0,
  1631. label: this.$t('lable.unassigned'),
  1632. }
  1633. ],
  1634. allData:{},
  1635. batchShowData:{},
  1636. option: [],
  1637. depData: {
  1638. id: -1,
  1639. label: this.$t('lable.allStaff'),
  1640. },
  1641. defaultProps: {
  1642. children: 'children',
  1643. label: 'label'
  1644. },
  1645. isNew: false,
  1646. selected: false,
  1647. valuet: new Date(),
  1648. domObj: null,
  1649. participator:[],
  1650. chosenMembCount:0,
  1651. jsDay: 0,
  1652. jsTime: 0,
  1653. falsss: false,
  1654. weidu: [],
  1655. weiduList: [],
  1656. yonghuUser: [],
  1657. dateAr: [],
  1658. batchSubFillDialog: false,
  1659. isSubstiS: false,
  1660. diasZho: false,
  1661. zhoData: [],
  1662. zhoRqi: [],
  1663. btnZho: false,
  1664. zhoLoading: false,
  1665. changdu: 6,
  1666. tianxieDialogVisible: false,
  1667. scopess: {},
  1668. zhoBao: {
  1669. time: '',
  1670. workingTime: '',
  1671. progress: '',
  1672. con: '',
  1673. subProjectId: '',
  1674. stage: '',
  1675. subProjectList: [],
  1676. stages: [],
  1677. },
  1678. zhoBaoIdx: '',
  1679. zhoBaoName: '',
  1680. zhis: {},
  1681. dealList: [],
  1682. toViewDialogVisible: false,
  1683. toViewList: [],
  1684. toViewloading: true,
  1685. toViewForm: {
  1686. pageIndex: '1',
  1687. pageSize: '20',
  1688. total: 0,
  1689. },
  1690. toViewloadings: false,
  1691. tabPositionss: 'top',
  1692. monthTotal: 0,
  1693. monthTotalPage: 0,
  1694. monthTotalLages: 20,
  1695. monthWorkData: [],
  1696. monthNotWorkDate: [],
  1697. monthWorkDataS1: [],
  1698. monthnotTotal: 0,
  1699. monthnotTotalPage: 0,
  1700. monthnotTotalLages: 20,
  1701. monthNotWorkDateS1: [],
  1702. deptMembDataText: '',
  1703. isFlag: false,
  1704. isMore: false,
  1705. stateKey: '0',
  1706. expandDate: [],
  1707. notifySelList:[],
  1708. departmentList: [],
  1709. approvalProcessDialog: false,
  1710. approvalProcessData: [],
  1711. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  1712. leaveTypeName: [this.$t('leave.personalLeave'),this.$t('leave.sickLeave'),this.$t('leave.annualLeave'),this.$t('leave.maternityLeave'),this.$t('leave.marriageLeave'),this.$t('leave.bereavementLeave'),this.$t('leave.leave'),this.$t('leave.paternityLeave'),this.$t('leave.other')],
  1713. isWeekend: false,
  1714. canCancelInDialog: false,
  1715. approveinData: {},
  1716. approveinDialog: false,
  1717. reportCanDelete: false,
  1718. weeklyFilledTimeDialog: false,
  1719. weeklyFilledTimeList: [],
  1720. weeklyFilledTimeLoading: false,
  1721. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  1722. weeklyFilledTimeCanDelete: false,
  1723. weeklyFilledTimeDate: null,
  1724. leaveAllNum: 0
  1725. };
  1726. },
  1727. watch: {
  1728. deptMembDataText(val) {
  1729. this.$refs.chooseMembTree.filter(val);
  1730. }
  1731. },
  1732. filters: {
  1733. // 过滤
  1734. amounts(value) {
  1735. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1736. return 0
  1737. }
  1738. var zhi = +value + 0
  1739. return zhi.toFixed(1)
  1740. },
  1741. // zhoData
  1742. zhoData(value, arr) {
  1743. var dateArray = value.split("-");
  1744. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1745. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  1746. // console.log(arr[date.getDay()])
  1747. // return "周" + "日一二三四五六".charAt(date.getDay());
  1748. return arr[date.getDay()]
  1749. },
  1750. // 过滤数字
  1751. numbers(value) {
  1752. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1753. return 0
  1754. }
  1755. return value
  1756. },
  1757. },
  1758. methods: {
  1759. test(){
  1760. console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
  1761. },
  1762. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  1763. this.weeklyFilledTimeDialog = true
  1764. this.weeklyFilledTimeLoading = true
  1765. this.weeklyFilledTimeDate = parameterDate
  1766. this.http.post('/report/getReportList',{
  1767. date: parameterDate,
  1768. userId: this.user.id
  1769. },res => {
  1770. this.weeklyFilledTimeLoading = false
  1771. if(res.code == 'ok'){
  1772. this.weeklyFilledTimeList = res.data[0].data
  1773. let candelete = true
  1774. for(let i in this.weeklyFilledTimeList){
  1775. if(this.weeklyFilledTimeList[i].state < 2){
  1776. candelete = false
  1777. }
  1778. }
  1779. this.weeklyFilledTimeCanDelete = candelete
  1780. }else {
  1781. this.$message({
  1782. message: res.msg,
  1783. type: 'error'
  1784. })
  1785. }
  1786. },err => {
  1787. this.weeklyFilledTimeLoading = false
  1788. this.$message({
  1789. message: err,
  1790. type: 'error'
  1791. })
  1792. })
  1793. },
  1794. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  1795. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  1796. confirmButtonText: this.$t('btn.determine'),
  1797. cancelButtonText: this.$t('btn.cancel'),
  1798. type: "warning"
  1799. })
  1800. .then(() => {
  1801. this.http.post('/report/delete',{
  1802. userId: this.user.id,
  1803. date: this.weeklyFilledTimeDate
  1804. },res => {
  1805. if (res.code == "ok") {
  1806. this.$message({
  1807. message: this.$t('message.successfullyDeleted'),
  1808. type: "success"
  1809. });
  1810. this.getWeeklyWorkTime()
  1811. this.getReportList();
  1812. this.getDepartment();
  1813. this.weeklyFilledTimeDialog = false;
  1814. } else {
  1815. this.$message({
  1816. message: res.msg,
  1817. type: "error"
  1818. });
  1819. }
  1820. },error => {
  1821. this.$message({
  1822. message: error,
  1823. type: "error"
  1824. });
  1825. }
  1826. );
  1827. }).catch(() => {});
  1828. },
  1829. getApprovalProcess(item){
  1830. // console.log('this.date',this.choseDate);
  1831. this.http.post('/report-log/get',{
  1832. creatorId: item.id,
  1833. createDate: sessionStorage.msg
  1834. },res => {
  1835. if(res.code == 'ok'){
  1836. this.approvalProcessDialog = true
  1837. this.approvalProcessData = res.data
  1838. }else{
  1839. this.$message({
  1840. message: res.msg,
  1841. type: 'error'
  1842. })
  1843. }
  1844. },err => {
  1845. this.$message({
  1846. message: err,
  1847. type: 'error'
  1848. })
  1849. })
  1850. },
  1851. filterNode(value, data) {
  1852. if (!value) return true;
  1853. return data.label.indexOf(value) !== -1;
  1854. },
  1855. triggerCalculateOT(index) {
  1856. var str = this.workForm.domains[index].overtimeHours + ''
  1857. if(str.indexOf('.') != '-1') {
  1858. var s = str.split('.')[0]
  1859. var st = str.split('.')[1]
  1860. var sts = st.split('')
  1861. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  1862. }
  1863. },
  1864. searchScreen(e){
  1865. if(e){
  1866. this.monthNotWorkDateS1 = []
  1867. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1868. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  1869. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  1870. }
  1871. }
  1872. if (this.monthNotWorkDateS1.length > 50) {
  1873. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  1874. }else{
  1875. this.monthNotWorkDateS = this.monthNotWorkDateS1
  1876. }
  1877. // if (this.monthNotWorkDateS1.length > 0) {
  1878. // setTimeout(() => {
  1879. // this.tableListenernot()
  1880. // }, 1000);
  1881. // }
  1882. }else{
  1883. this.monthWorkDataS1 = []
  1884. for (let i = 0; i < this.monthWorkData.length; i++) {
  1885. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  1886. this.monthWorkDataS1.push(this.monthWorkData[i])
  1887. }
  1888. }
  1889. if (this.monthWorkDataS1.length > 50) {
  1890. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  1891. }else{
  1892. this.monthWorkDataS = this.monthWorkDataS1
  1893. }
  1894. // if (this.monthWorkDataS1.length > 0) {
  1895. // setTimeout(() => {
  1896. // this.tableListener()
  1897. // }, 1000);
  1898. // }
  1899. }
  1900. },
  1901. addUpload(data) {
  1902. // var zhi = data.fileName.split('.')[0]
  1903. // var sss = zhi + '.xlsx'
  1904. // return
  1905. var filePath = '/upload/' + data.serverName;
  1906. const a = document.createElement('a'); // 创建a标签
  1907. a.setAttribute('download', data.fileName);// download属性
  1908. a.setAttribute('href', filePath);// href链接
  1909. a.click(); //自执行点击事件
  1910. a.remove();
  1911. },
  1912. restrictNumber(targetId) {
  1913. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1914. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1915. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1916. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1917. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1918. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1919. inpu.value = parseFloat(inpu.value);
  1920. }
  1921. },
  1922. //获取项目下的任务分组
  1923. getTaskGroups(domain, index) {
  1924. domain.groupId=null;
  1925. this.http.post('/task-group/listMyJoinGroup',{
  1926. projectId: domain.projectId,
  1927. isSubstitude: this.isSubstitude ? 1 : 0
  1928. },
  1929. res => {
  1930. if (res.code == "ok") {
  1931. this.workForm.domains[index].taskGroups = res.data;
  1932. this.$forceUpdate();
  1933. }
  1934. },
  1935. error => {
  1936. this.$message({
  1937. message: error,
  1938. type: "error"
  1939. });
  1940. }
  1941. );
  1942. },
  1943. //下载带企业微信考勤数据的工时统计模板
  1944. downloadCheckInExcel() {
  1945. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  1946. startDate: this.importWxParam.date[0],
  1947. endDate: this.importWxParam.date[1],
  1948. },
  1949. res => {
  1950. if (res.code == "ok") {
  1951. var filePath = res.data;
  1952. const a = document.createElement('a'); // 创建a标签
  1953. var data = filePath.split("/");
  1954. a.setAttribute('download', data[data.length-1]);// download属性
  1955. a.setAttribute('href', filePath);// href链接
  1956. a.click(); //自执行点击事件
  1957. a.remove();
  1958. } else {
  1959. this.$message({
  1960. message: res.msg,
  1961. type: "error"
  1962. });
  1963. }
  1964. },
  1965. error => {
  1966. this.checkinLoading = false;
  1967. this.$message({
  1968. message: error,
  1969. type: "error"
  1970. });
  1971. }
  1972. );
  1973. },
  1974. pre() {
  1975. if (this.active == 0) return;
  1976. this.active--;
  1977. },
  1978. next() {
  1979. this.active++;
  1980. },
  1981. triggerTotalTime(index) {
  1982. var item = this.checkinList[index];
  1983. var total = 0.0;
  1984. for (var i=0;i<this.projectColumns.length; i++) {
  1985. var key = this.projectColumns[i];
  1986. if (item[key] != null && item[key] != '') {
  1987. total += parseFloat(item[key]);
  1988. }
  1989. }
  1990. item.totalFillTime = total;
  1991. },
  1992. //提交批量代填的数据
  1993. submitBatchSubFillData() {
  1994. var data = JSON.stringify(this.checkinList);
  1995. this.http.post('/user-corpwx-time/submitProjectTime',{
  1996. json: data,
  1997. projectColumns: JSON.stringify(this.projectColumns)
  1998. },
  1999. res => {
  2000. if (res.code == "ok") {
  2001. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2002. this.importWxDialog = false;
  2003. }
  2004. },
  2005. error => {
  2006. this.checkinLoading = false;
  2007. this.$message({
  2008. message: error,
  2009. type: "error"
  2010. });
  2011. }
  2012. );
  2013. },
  2014. loadCheckInData() {
  2015. if (this.importWxParam.date == null) {
  2016. this.checkinList = [];
  2017. return;
  2018. }
  2019. this.checkinLoading = true;
  2020. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2021. startDate: this.importWxParam.date[0],
  2022. endDate: this.importWxParam.date[1],
  2023. },
  2024. res => {
  2025. if (res.code == "ok") {
  2026. this.checkinLoading = false;
  2027. this.checkinList = res.data.list;
  2028. this.projectColumns = res.data.projects;
  2029. // 自定义表格会导致表格错乱,需重新计算表格
  2030. this.$nextTick(()=>{
  2031. this.$refs.tab.doLayout()
  2032. })
  2033. }
  2034. },
  2035. error => {
  2036. this.checkinLoading = false;
  2037. this.$message({
  2038. message: error,
  2039. type: "error"
  2040. });
  2041. }
  2042. );
  2043. },
  2044. batchImportWxData(item) {
  2045. //首先判断文件类型
  2046. let str = item.file.name.split(".");
  2047. let format = str[str.length - 1];
  2048. if (format != "xls" && format != "xlsx") {
  2049. this.$message({
  2050. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2051. type: "error"
  2052. });
  2053. } else {
  2054. this.importingData = true;
  2055. let formData = new FormData();
  2056. formData.append("file", item.file);
  2057. formData.append("companyId", this.user.companyId);
  2058. formData.append("withCheckIn", 1);
  2059. this.http.uploadFile('/report/importData', formData,
  2060. res => {
  2061. this.$refs.upload.clearFiles();
  2062. this.showImportResult = true;
  2063. this.importingData = false;
  2064. if (res.code == "ok") {
  2065. //换成弹出框,以免有人等了半天回来啥也没看到
  2066. this.importResultMsg = this.$t('other.successful') + ':' + this.$t('other.importSuccess') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  2067. this.getReportList();
  2068. this.importWxDialog = false;
  2069. } else {
  2070. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2071. }
  2072. },
  2073. error => {
  2074. this.$refs.upload.clearFiles();
  2075. this.listLoading = false;
  2076. this.$message({
  2077. message: error,
  2078. type: "error"
  2079. });
  2080. });
  2081. }
  2082. },
  2083. batchImportData(item) {
  2084. //首先判断文件类型
  2085. let str = item.file.name.split(".");
  2086. let format = str[str.length - 1];
  2087. if (format != "xls" && format != "xlsx") {
  2088. this.$message({
  2089. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2090. type: "error"
  2091. });
  2092. } else {
  2093. this.importingData = true;
  2094. let formData = new FormData();
  2095. formData.append("file", item.file);
  2096. formData.append("companyId", this.user.companyId);
  2097. this.http.uploadFile('/report/importData', formData,
  2098. res => {
  2099. this.$refs.upload.clearFiles();
  2100. this.importingData = false;
  2101. this.showImportResult = true;
  2102. if (res.code == "ok") {
  2103. //换成弹出框,以免有人等了半天回来啥也没看到
  2104. this.importResultMsg = this.$t('other.importSuccess')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  2105. this.getReportList();
  2106. this.importWXDialog = false;
  2107. } else {
  2108. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2109. }
  2110. },
  2111. error => {
  2112. this.$refs.upload.clearFiles();
  2113. this.importingData = false;
  2114. this.$message({
  2115. message: error,
  2116. type: "error"
  2117. });
  2118. });
  2119. }
  2120. },
  2121. userssHu() {
  2122. this.http.post('/time-type/getCompanyTimeSetting',{
  2123. companyId: this.user.companyId
  2124. },
  2125. res => {
  2126. if (res.code == "ok") {
  2127. this.yonghuUser = res.data
  2128. }
  2129. },
  2130. error => {
  2131. this.$message({
  2132. message: error,
  2133. type: "error"
  2134. });
  2135. }
  2136. );
  2137. },
  2138. iptBlur(i) {
  2139. if(this.isBatch == 0) {
  2140. return
  2141. }
  2142. this.http.post('/report/getWorkDays',{
  2143. startDate: this.workForm.createDate[0],
  2144. endDate: this.workForm.createDate[1]
  2145. },
  2146. res => {
  2147. if (res.code == "ok") {
  2148. this.jsDay = res.data
  2149. this.chuji(i)
  2150. } else {
  2151. this.$message({
  2152. message: res.msg,
  2153. type: "error"
  2154. });
  2155. this.workForm.createDate = [];
  2156. }
  2157. },
  2158. error => {
  2159. this.$message({
  2160. message: error,
  2161. type: "error"
  2162. });
  2163. }
  2164. );
  2165. var sl = this.workForm.domains
  2166. this.chuji(i)
  2167. },
  2168. chuji(i) {
  2169. if(i == 0) {
  2170. this.seleChn(1)
  2171. } else if(i == 1) {
  2172. this.seleChn(0)
  2173. } else if(i == 2) {
  2174. if(this.workForm.domains[0].multiWorktime > 0) {
  2175. this.iptChangs()
  2176. } else {
  2177. this.iptChang()
  2178. }
  2179. } else if(i == 3) {
  2180. this.seleChn(0)
  2181. }
  2182. },
  2183. seleChn(e,domain) {
  2184. if(e == 1) {
  2185. for(var i in this.workForm.domains) {
  2186. if(this.workForm.domains[i].timeType == 0) {
  2187. this.workForm.domains[i].workingTime = 8
  2188. } else {
  2189. this.workForm.domains[i].workingTime = 4
  2190. }
  2191. }
  2192. }
  2193. var quanbu = 0
  2194. var spl = this.workForm.domains
  2195. var zhi = ''
  2196. for(var i in spl) {
  2197. var sp = +spl[i].workingTime + 0
  2198. zhi = this.jsDay * sp
  2199. quanbu = +quanbu + zhi
  2200. }
  2201. this.jsTime = quanbu
  2202. let worktime = this.jsTime
  2203. // 自动计算加班时长
  2204. if(this.isBatch != 0){
  2205. worktime = this.jsTime / this.jsDay
  2206. }
  2207. if(this.user.timeType.fillOvertime && domain){
  2208. let isover = false
  2209. let alltime = 0
  2210. let allover = 0 //此处alltime同上面的worktime
  2211. for(let d in spl){
  2212. if(spl[d].isOvertime){
  2213. isover = true
  2214. allover += spl[d].overtimeHours*1
  2215. }
  2216. alltime += spl[d].workingTime*1
  2217. }
  2218. if(domain.overtimeHours){
  2219. allover = allover - domain.overtimeHours
  2220. }
  2221. if(worktime*1 > this.user.timeType.allday){
  2222. if(isover){
  2223. if(alltime > (allover + this.user.timeType.allday)){
  2224. this.$set(domain,'isOvertime',true)
  2225. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  2226. }else{
  2227. this.$set(domain,'isOvertime',false)
  2228. this.$set(domain,'overtimeHours',null)
  2229. if(alltime < (allover + this.user.timeType.allday)){
  2230. let overtime = allover + this.user.timeType.allday - alltime
  2231. for(let pi in spl){
  2232. if(spl[pi].overtimeHours){
  2233. if((overtime - spl[pi].overtimeHours*1) > 0){
  2234. overtime = overtime - spl[pi].overtimeHours*1
  2235. this.$set(spl[pi],'isOvertime',false)
  2236. this.$set(spl[pi],'overtimeHours',null)
  2237. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  2238. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  2239. break
  2240. }else{
  2241. this.$set(spl[pi],'isOvertime',false)
  2242. this.$set(spl[pi],'overtimeHours',null)
  2243. break
  2244. }
  2245. }
  2246. }
  2247. }
  2248. }
  2249. }else{
  2250. this.$set(domain,'isOvertime',true)
  2251. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  2252. }
  2253. }else{
  2254. for(let di in spl){
  2255. this.$set(spl[di],'isOvertime',false)
  2256. this.$set(spl[di],'overtimeHours',null)
  2257. }
  2258. }
  2259. }
  2260. },
  2261. iptChang() {
  2262. var sl = this.workForm.domains
  2263. var quanbu = 0
  2264. var zhi = ''
  2265. for(var i in sl) {
  2266. if(sl[i].startTime && sl[i].endTime) {
  2267. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  2268. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  2269. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2270. var leave1=date3%(24*3600*1000)
  2271. var hours=Math.floor(leave1/(3600*1000))
  2272. var leave2=leave1%(3600*1000)
  2273. var minutes=Math.floor(leave2/(60*1000))
  2274. var shi = hours+'.'+ minutes
  2275. var sll = +shi + 0
  2276. zhi = this.jsDay * sll
  2277. quanbu = +quanbu + zhi
  2278. }
  2279. }
  2280. this.jsTime = quanbu
  2281. },
  2282. iptChangs() {
  2283. var sl = this.workForm.domains
  2284. var quanbu = 0
  2285. var zhi = ''
  2286. for(var i in sl) {
  2287. for(var j in sl[i].worktimeList){
  2288. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  2289. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  2290. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  2291. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2292. var leave1=date3%(24*3600*1000)
  2293. var hours=Math.floor(leave1/(3600*1000))
  2294. var leave2=leave1%(3600*1000)
  2295. var minutes=Math.floor(leave2/(60*1000))
  2296. var shi = hours+'.'+ minutes
  2297. var sll = +shi + 0
  2298. zhi = this.jsDay * sll
  2299. quanbu = +quanbu + zhi
  2300. }
  2301. }
  2302. }
  2303. this.jsTime = quanbu
  2304. },
  2305. removeTimeItem(item, index) {
  2306. item.worktimeList.splice(index, 1);
  2307. this.iptChangs()
  2308. },
  2309. //添加工时
  2310. addNewWorktime(index, item) {
  2311. if(item.worktimeList == null ) {
  2312. item.worktimeList = []
  2313. }
  2314. item.worktimeList.push({});
  2315. },
  2316. //复制项目
  2317. copyProject(index) {
  2318. var leftProgress = 10;
  2319. if (this.reportTimeType.type == 3) {
  2320. //计算已经待分配工时比例
  2321. let array = this.workForm.domains;
  2322. let totalProgress = 0;
  2323. for (var i=0;i<array.length; i++) {
  2324. totalProgress += array[i].progress;
  2325. }
  2326. if (totalProgress < 100) {
  2327. leftProgress = 100 - totalProgress;
  2328. }
  2329. }
  2330. var newIndex = index+1;
  2331. var itemDomain = {
  2332. projectId: this.workForm.domains[index].projectId,
  2333. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2334. content: "",
  2335. progress:leftProgress,
  2336. state:2,//2-表示待提交
  2337. };
  2338. this.workForm.domains.splice(newIndex, 0,itemDomain);
  2339. if (this.reportTimeType.type == 0) {
  2340. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2341. var length = this.workForm.domains.length;
  2342. if (length == 2) {
  2343. this.showAddMore = false;
  2344. }
  2345. }
  2346. this.selectProject(itemDomain, newIndex);
  2347. },
  2348. showWorkTime(){
  2349. this.monthWorkTimeDialog = true;
  2350. this.searchKeyword = ''
  2351. this.WorktimeDatepickValue = this.istoMonth()
  2352. if(this.WorktimeDatepickValue.length == 0){
  2353. let newdate = new Date();
  2354. let nowdate = newdate.toLocaleDateString();
  2355. let getauto = this.getAutoWeekDate(nowdate)
  2356. let nowwd = [getauto[0],getauto[6]]
  2357. this.WorktimeDatepickValue = nowwd
  2358. }
  2359. this.showMonthWorkTime()
  2360. },
  2361. handleClick(t,e){
  2362. if (t.name == "first") {
  2363. this.showMonthWorkTime()
  2364. }else{
  2365. this.showMonthNotWorkTime()
  2366. }
  2367. },
  2368. //导出员工每日填报工时数
  2369. exportMembWorkHours() {
  2370. this.http.post(
  2371. "/report/exportUserDailyWorkTime",
  2372. {
  2373. // month: this.date,
  2374. startDate: this.WorktimeDatepickValue[0],
  2375. endDate: this.WorktimeDatepickValue[1],
  2376. },
  2377. (res) => {
  2378. if (res.code == "ok") {
  2379. let url = res.data;
  2380. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2381. }
  2382. },
  2383. (error) => {
  2384. this.$message({
  2385. message: error,
  2386. type: "error",
  2387. });
  2388. }
  2389. );
  2390. },
  2391. exportMembNotWorkHours() {
  2392. this.http.post(
  2393. "/report/exportNoReportUserList",
  2394. {
  2395. // month: this.date,
  2396. startDate: this.WorktimeDatepickValue[0],
  2397. endDate: this.WorktimeDatepickValue[1],
  2398. },
  2399. (res) => {
  2400. if (res.code == "ok") {
  2401. let url = res.data;
  2402. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2403. }
  2404. },
  2405. (error) => {
  2406. this.$message({
  2407. message: error,
  2408. type: "error",
  2409. });
  2410. }
  2411. );
  2412. },
  2413. downloadByA(name, url) {
  2414. const a = document.createElement("a"); // 创建a标签
  2415. a.setAttribute("download", name); // download属性
  2416. a.setAttribute("href", url); // href链接
  2417. a.click(); // 自执行点击事件
  2418. a.remove();
  2419. },
  2420. // 是否本月判断
  2421. istoMonth(){
  2422. let todate = new Date()
  2423. let tomonth = todate.getMonth() + 1
  2424. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  2425. if(this.date == adate){
  2426. return []
  2427. }else{
  2428. let sedate = new Date(this.date)
  2429. let semonth = sedate.getMonth() + 1
  2430. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  2431. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  2432. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  2433. return [sedates1, sedates2]
  2434. }
  2435. },
  2436. showMonthWorkTime() {
  2437. this.monthTotalPage = 0,
  2438. this.tbload = true
  2439. this.http.post(
  2440. "/report/getUserDailyWorkTime",
  2441. // "/report/getNoReportUserList",
  2442. {
  2443. // month: this.date,
  2444. startDate: this.WorktimeDatepickValue[0],
  2445. endDate: this.WorktimeDatepickValue[1],
  2446. },
  2447. (res) => {
  2448. if (res.code == "ok") {
  2449. this.tbload = false;
  2450. this.pickDateArray = res.data.days;
  2451. // console.log('dataarray',res.data.days);
  2452. this.monthWorkData = res.data.list;
  2453. // this.monthWorkDataS = this.monthWorkData
  2454. // this.monthWorkDataS1 = res.data.list
  2455. this.monthTotal = res.data.list.length
  2456. if (this.monthWorkData.length > 50) {
  2457. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  2458. }else{
  2459. this.monthWorkDataS = this.monthWorkData
  2460. }
  2461. this.searchScreen(0)
  2462. // this.monthWorkDataS = infoList
  2463. // 判断
  2464. // if (this.monthWorkDataS1.length > 0) {
  2465. // setTimeout(() => {
  2466. // this.tableListener()
  2467. // }, 1000);
  2468. // }
  2469. this.$nextTick(function(){
  2470. this.$refs.hasworkTbl.doLayout();
  2471. });
  2472. // this.$forceUpdate()
  2473. }
  2474. },
  2475. (error) => {
  2476. this.tbload = false
  2477. this.$message({
  2478. message: error,
  2479. type: "error",
  2480. });
  2481. }
  2482. );
  2483. },
  2484. // tableListener(){
  2485. // let that = this;
  2486. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2487. // // 添加scroll监听事件
  2488. // dom.addEventListener("scroll", function () {
  2489. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2490. // if (scrollDistance < 2) {
  2491. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2492. // that.monthTotalPage++; //当前页数自增
  2493. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2494. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2495. // var infoList = arrList.splice(
  2496. // that.monthTotalPage * that.monthTotalLages,
  2497. // that.monthTotalLages
  2498. // );
  2499. // // 数据添加
  2500. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2501. // }
  2502. // }
  2503. // })
  2504. // },
  2505. showMonthNotWorkTime() {
  2506. this.monthTotalPage = 0,
  2507. this.tbload = true
  2508. this.http.post(
  2509. "/report/getNoReportUserList",
  2510. {
  2511. startDate: this.WorktimeDatepickValue[0],
  2512. endDate: this.WorktimeDatepickValue[1],
  2513. },
  2514. (res) => {
  2515. if (res.code == "ok") {
  2516. this.tbload = false
  2517. this.monthNotWorkDate = res.data;
  2518. // this.monthNotWorkDateS1 = res.data
  2519. this.monthnotTotal = res.data.length
  2520. // 2222111
  2521. if (this.monthNotWorkDate.length > 50) {
  2522. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2523. } else {
  2524. this.monthNotWorkDateS = this.monthNotWorkDate
  2525. }
  2526. this.searchScreen(1)
  2527. // 判断
  2528. // if (this.monthnotworkDateS1.length > 0) {
  2529. // setTimeout(() => {
  2530. // this.tableListenernot()
  2531. // }, 1000);
  2532. // }
  2533. this.$nextTick(function(){
  2534. this.$refs.hasworkTbl2.doLayout();
  2535. });
  2536. }
  2537. },
  2538. (error) => {
  2539. this.tbload = false
  2540. this.$message({
  2541. message: error,
  2542. type: "error",
  2543. });
  2544. }
  2545. );
  2546. },
  2547. // tableListenernot(){
  2548. // let that = this;
  2549. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2550. // dom.addEventListener("scroll", function () {
  2551. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2552. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2553. // if (scrollDistance2 < 2) {
  2554. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2555. // that.monthnotTotalPage++; //当前页数自增
  2556. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2557. // var infoList = arrList.splice(
  2558. // that.monthnotTotalPage * that.monthnotTotalLages,
  2559. // that.monthnotTotalLages
  2560. // );
  2561. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2562. // }
  2563. // }
  2564. // })
  2565. // },
  2566. listScroll(){
  2567. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2568. this.isMore = true
  2569. setTimeout(()=>{
  2570. this.isMore = false
  2571. },1000)
  2572. }else {
  2573. this.isFlag = true
  2574. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2575. this.monthWorkDataS = datalist
  2576. setTimeout(()=>{
  2577. this.isFlag = false
  2578. },300)
  2579. }
  2580. },
  2581. notListScroll(){
  2582. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2583. this.isMore = true
  2584. setTimeout(()=>{
  2585. this.isMore = false
  2586. },1000)
  2587. }else {
  2588. this.isFlag = true
  2589. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2590. this.monthNotWorkDateS = datalist
  2591. // console.log('length',this.monthNotWorkDateS.length)
  2592. setTimeout(()=>{
  2593. this.isFlag = false
  2594. },300)
  2595. }
  2596. },
  2597. // 获取默认这zhou日期参数 222
  2598. getLastWeek(e){
  2599. let newdate = new Date()
  2600. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2601. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2602. if(e){
  2603. this.WorktimeDatepickValue = lastwd
  2604. this.showMonthWorkTime()
  2605. }else{
  2606. this.WorktimeDatepickValue = lastwd
  2607. this.showMonthNotWorkTime()
  2608. }
  2609. },
  2610. getThisWeek(e){
  2611. let newdate = new Date();
  2612. let nowdate = newdate.toLocaleDateString();
  2613. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2614. if(e){
  2615. this.WorktimeDatepickValue = nowwd
  2616. this.showMonthWorkTime()
  2617. }else{
  2618. this.WorktimeDatepickValue = nowwd
  2619. this.showMonthNotWorkTime()
  2620. }
  2621. },
  2622. getDoubleLastWeek(e){
  2623. let newdate = new Date()
  2624. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2625. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2626. if(e){
  2627. this.WorktimeDatepickValue = nextwd
  2628. this.showMonthWorkTime()
  2629. }else{
  2630. this.WorktimeDatepickValue = nextwd
  2631. this.showMonthNotWorkTime()
  2632. }
  2633. },
  2634. alreadyAllDate(stime,etime){
  2635. let diffdate = new Array();
  2636. let i=0;
  2637. while(stime<=etime){
  2638. let dateArray = stime.split("-");
  2639. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2640. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2641. let stimewk = this.weekDay[date.getDay()]
  2642. let timedate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + this.$t('weekDay.month') + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2]) + this.$t('weekDay.day')
  2643. let timeshowdate = (stime.split("-")[1].charAt(0) == 0 ? stime.split("-")[1].charAt(1) : stime.split("-")[1]) + "." + (stime.split("-")[2].charAt(0) == 0 ? stime.split("-")[2].charAt(1) : stime.split("-")[2])
  2644. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2645. let stime_ts = new Date(stime).getTime();
  2646. let next_date = stime_ts + (24*60*60*1000);
  2647. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2648. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2649. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2650. stime = next_dates_y+next_dates_m+next_dates_d;
  2651. i++;
  2652. }
  2653. return diffdate
  2654. },
  2655. getAutoWeekDate(e) {
  2656. let dateString = e;
  2657. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2658. if (dateString.match(dateStringReg)) {
  2659. let presentDate = new Date(dateString),
  2660. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2661. return Array.from(new Array(7), function (val, index) {
  2662. let formatDate = new Date(
  2663. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2664. );
  2665. return (
  2666. formatDate.getFullYear() +
  2667. "-" +
  2668. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2669. "-" +
  2670. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2671. );
  2672. });
  2673. } else {
  2674. throw new Error(
  2675. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2676. );
  2677. }
  2678. },
  2679. onProgressChange() {
  2680. this.$forceUpdate();
  2681. },
  2682. showChooseMembTree() {
  2683. this.chosenMembCount = this.participator.length;
  2684. this.chooseParticipVisible = true;
  2685. },
  2686. onTreeItemChange() {
  2687. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2688. var list = chosenList.filter(item=>item.isUser == 1);
  2689. this.chosenMembCount = list.length;
  2690. },
  2691. findUserInTree() {
  2692. if (this.filterName == '') {
  2693. this.deptMembData = this.allMembData;
  2694. } else {
  2695. var list = this.findRecursively(this.filterName, this.allMembData);
  2696. this.deptMembData = list;
  2697. }
  2698. },
  2699. findRecursively(username, list) {
  2700. var filterList = [];
  2701. for (var i=0;i<list.length; i++) {
  2702. if (list[i].isUser == 1) {
  2703. if (list[i].label.indexOf(username) >= 0) {
  2704. //匹配上了
  2705. filterList.push(list[i]);
  2706. }
  2707. } else if (list[i].children != null && list[i].children.length > 0) {
  2708. var subList = this.findRecursively(username, list[i].children);
  2709. if (subList.length > 0) {
  2710. subList.forEach(s=>filterList.push(s));
  2711. }
  2712. }
  2713. }
  2714. return filterList;
  2715. },
  2716. //确定选择参与人
  2717. chooseParticip() {
  2718. this.chooseParticipVisible = false;
  2719. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2720. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2721. this.workForm.userNames = '';
  2722. this.workForm.userId = [];
  2723. this.participator = [];
  2724. for (var i=0;i<this.chosenMembList.length; i++) {
  2725. this.workForm.userId.push(this.chosenMembList[i].id);
  2726. this.workForm.userNames += this.chosenMembList[i].label+',';
  2727. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2728. this.participator.push(item);
  2729. }
  2730. if (this.workForm.userNames.length > 0) {
  2731. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2732. }
  2733. if(this.user.userNameNeedTranslate == 1) {
  2734. if(this.workForm.userNames) {
  2735. this.workForm.userNames = this.workForm.userNames.split(',')
  2736. }
  2737. }
  2738. },
  2739. notifySel(sel){
  2740. // console.log(sel);
  2741. this.notifySelList = sel
  2742. },
  2743. //微信通知人员填写
  2744. Notify(code) {
  2745. if (this.notifySelList.length == 0) return;
  2746. var ids = '';
  2747. this.notifySelList.forEach(f=>{
  2748. ids += f.id+',';
  2749. })
  2750. this.http.post('/user/pushFillReport',{
  2751. ids: ids, date: this.curDate,
  2752. code: code
  2753. },
  2754. res => {
  2755. if (res.code == "ok") {
  2756. this.$message({
  2757. message: this.$t('message.sentSuccessfully'),
  2758. type: "success"
  2759. });
  2760. }
  2761. },
  2762. error => {
  2763. this.$message({
  2764. message: error,
  2765. type: "error"
  2766. });
  2767. }
  2768. );
  2769. },
  2770. //导出人员列表
  2771. exportMemb() {
  2772. if (this.fillMembList.length == 0) return;
  2773. var ids = '';
  2774. this.fillMembList.forEach(f=>{
  2775. ids += f.id+',';
  2776. })
  2777. this.http.post('/user/exportMembList',{
  2778. ids: ids,isFill: this.isFill, date: this.curDate
  2779. },
  2780. res => {
  2781. if (res.code == "ok") {
  2782. var aTag = document.createElement('a');
  2783. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  2784. aTag.href = res.data;
  2785. aTag.click();
  2786. }
  2787. },
  2788. error => {
  2789. this.$message({
  2790. message: error,
  2791. type: "error"
  2792. });
  2793. }
  2794. );
  2795. },
  2796. showMembList(fill) {
  2797. this.membListVisible = true;
  2798. if (fill == 0) {
  2799. this.fillMembList = this.unFillList;
  2800. this.isFill = false;
  2801. let leaveList = []
  2802. let unleaveList = []
  2803. for(let i in this.fillMembList){
  2804. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  2805. leaveList.push(this.fillMembList[i])
  2806. }else{
  2807. unleaveList.push(this.fillMembList[i])
  2808. }
  2809. }
  2810. this.fillMembList = unleaveList
  2811. this.fillMembList_leave = leaveList
  2812. } else if(fill == 1){
  2813. this.fillMembList = this.fillList.filter(item => item.state != 3);
  2814. this.isFill = true;
  2815. }else{
  2816. this.fillMembList = this.fillList.filter(item => item.state == 3);
  2817. this.isFill = true;
  2818. }
  2819. },
  2820. //获取自己填写的日报状态
  2821. getReportFillStatus() {
  2822. this.http.post('/report/getReportFillStatus',{
  2823. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2824. },
  2825. res => {
  2826. if (res.code == "ok") {
  2827. this.fillStatusList = res.data;
  2828. this.allDate.forEach(d=>{
  2829. var fillInfo = null;
  2830. d.state = null;
  2831. this.fillStatusList.forEach(s=>{
  2832. // console.log(d)
  2833. var d1 = s.createDate.split('-')[2];
  2834. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  2835. // console.log(d2, '我被执行了')
  2836. if (d1.indexOf('0') == 0) {
  2837. d1 = d1.substring(1,d1.length);
  2838. }
  2839. if (d1 == d2) {
  2840. d.state = s.state;
  2841. }
  2842. })
  2843. })
  2844. this.$forceUpdate();
  2845. }
  2846. },
  2847. error => {
  2848. this.$message({
  2849. message: error,
  2850. type: "error"
  2851. });
  2852. }
  2853. );
  2854. },
  2855. scrollFunction () {
  2856. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2857. if (this.domObj.attachEvent) { // IE
  2858. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2859. } else if (this.domObj.addEventListener) {
  2860. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2861. }
  2862. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2863. },
  2864. mouseScroll(event) { // google 浏览器下
  2865. let detail = event.wheelDelta || event.detail
  2866. let moveForwardStep = -1
  2867. let moveBackStep = 1
  2868. let step = 0
  2869. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2870. event.preventDefault() // 阻止浏览器默认事件
  2871. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2872. },
  2873. // //左右滚动
  2874. // wheel(e){
  2875. // var a = document.getElementById("dateScroll");
  2876. // var scroll_width = 80; //滚动一下的距离
  2877. // var e = e || window.event, v;
  2878. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2879. // if(v>3||-v>3) v=-v;
  2880. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2881. // e.preventDefault(); //阻止浏览器的默认滚动
  2882. // },
  2883. showExportDialog() {
  2884. this.exportDialog = true;
  2885. },
  2886. showExportTimeDialog() {
  2887. this.exportTimeDialog = true;
  2888. },
  2889. changeAllTime() {
  2890. //总时长发生改变,自动按比例计算
  2891. this.workForm.domains.forEach(d=>{
  2892. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2893. });
  2894. },
  2895. // 是否加班的单机事件
  2896. check() {
  2897. this.selected = !this.selected
  2898. this.isNew = this.selected
  2899. },
  2900. updateSubProject() {
  2901. this.$forceUpdate();
  2902. },
  2903. //项目选中了, 加载子项目
  2904. selectProject(domain, index) {
  2905. if(!domain.projectId){
  2906. return;
  2907. }
  2908. // console.log('projectId===',domain.projectId);
  2909. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  2910. this.http.post('/sub-project/list',{
  2911. projectId: domain.projectId
  2912. },
  2913. res => {
  2914. //清空之前选中的子项目
  2915. // this.workForm.domains[index].subProjectId = 0;
  2916. if (res.code == "ok") {
  2917. this.workForm.domains[index].subProjectList = res.data;
  2918. this.workForm.domains[index].subProjectId = null;
  2919. this.$forceUpdate();
  2920. }
  2921. },
  2922. error => {
  2923. this.$message({
  2924. message: error,
  2925. type: "error"
  2926. });
  2927. }
  2928. );
  2929. //项目相关的近期任务
  2930. if (this.user.company.packageProject == 1) {
  2931. this.http.post('/task/getRecentTask',{
  2932. projectId: domain.projectId,
  2933. isSubstitude:this.isSubstitude?1:0
  2934. },
  2935. res => {
  2936. if (res.code == "ok") {
  2937. this.workForm.domains[index].allTaskList = res.data;
  2938. this.workForm.domains[index].taskList = res.data;
  2939. this.$forceUpdate();
  2940. }
  2941. },
  2942. error => {
  2943. this.$message({
  2944. message: error,
  2945. type: "error"
  2946. });
  2947. }
  2948. );
  2949. }
  2950. //获取项目相关专业
  2951. if (this.user.company.packageEngineering == 1) {
  2952. this.getProjectProfessions(domain, index);
  2953. }
  2954. // 获取项目相关的维度
  2955. // domain.degreeId = null
  2956. this.$set(domain,'degreeId',null)
  2957. this.dimension(domain, index);
  2958. //获取项目下的任务分组
  2959. this.getTaskGroups(domain, index);
  2960. //获取项目审核人
  2961. if (this.user.timeType.reportAuditType == 0) {
  2962. this.getProjectAuditorList(domain, index);
  2963. } else {
  2964. //按分组的负责人来审核
  2965. domain.projectAuditorId = null;
  2966. domain.projectAuditorName = null;
  2967. domain.auditUserList = null;
  2968. }
  2969. },
  2970. //获取项目审核人
  2971. getProjectAuditorList(domainItem, index) {
  2972. if(domainItem.projectId == '') {
  2973. return
  2974. }
  2975. domainItem.projectAuditorId = null;
  2976. domainItem.projectAuditorName = null;
  2977. this.http.post('/project-auditor/getList',{
  2978. projectId: domainItem.projectId,
  2979. },
  2980. res => {
  2981. if (res.code == "ok") {
  2982. domainItem.auditUserList = res.data;
  2983. if (res.data.length==0) {
  2984. this.$message({
  2985. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  2986. type: "error"
  2987. });
  2988. } else if (res.data.length==1) {
  2989. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  2990. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  2991. }
  2992. this.$forceUpdate();
  2993. }
  2994. },
  2995. error => {
  2996. this.$message({
  2997. message: error,
  2998. type: "error"
  2999. });
  3000. }
  3001. );
  3002. },
  3003. // 获取维度数据
  3004. dimension(domain, index) {
  3005. if(domain.projectId == '') {
  3006. return
  3007. }
  3008. this.http.post('/project/getDegreeList',{
  3009. projectId: domain.projectId,
  3010. },
  3011. res => {
  3012. if (res.code == "ok") {
  3013. // console.log("维度数据",res.data);
  3014. this.workForm.domains[index].wuduList = res.data
  3015. // this.workForm = this.workForm
  3016. this.$forceUpdate()
  3017. }
  3018. },
  3019. error => {
  3020. this.$message({
  3021. message: error,
  3022. type: "error"
  3023. });
  3024. }
  3025. );
  3026. },
  3027. //切换任务阶段
  3028. changeStages(domain, index) {
  3029. if (domain.stage == null || domain.stage == '') {
  3030. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  3031. } else {
  3032. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  3033. }
  3034. this.$forceUpdate();
  3035. },
  3036. getGroupStages(domain, index, keepStage) {
  3037. // console.log(domain);
  3038. if(!domain.groupId){
  3039. domain.projectAuditorId = ''
  3040. domain.stages = []
  3041. if(this.user.timeType.reportAuditType >= 1){
  3042. domain.auditUserList = []
  3043. }
  3044. this.$forceUpdate();
  3045. return
  3046. }
  3047. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  3048. res => {
  3049. if (res.code == "ok") {
  3050. if (!keepStage) {
  3051. domain.stage = '';
  3052. }
  3053. domain.stages = res.data;
  3054. this.$forceUpdate();
  3055. }
  3056. },
  3057. error => {
  3058. this.$message({
  3059. message: error,
  3060. type: "error"
  3061. });
  3062. });
  3063. //检查当前的项目是否需要获取分组的负责人
  3064. if (this.user.timeType.reportAuditType >= 1) {
  3065. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  3066. res => {
  3067. if (res.code == "ok") {
  3068. domain.getProjectAuditorList = res.data;
  3069. domain.auditUserList = res.data;
  3070. if (res.data.length==1) {
  3071. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  3072. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  3073. } else if (res.data.length==0) {
  3074. domain.projectAuditorId = null;
  3075. domain.projectAuditorName = null;
  3076. }
  3077. this.$forceUpdate();
  3078. }
  3079. },
  3080. error => {
  3081. this.$message({
  3082. message: error,
  3083. type: "error"
  3084. });
  3085. });
  3086. }
  3087. },
  3088. getProjectProfessions(domain, index) {
  3089. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  3090. res => {
  3091. if (res.code == "ok") {
  3092. this.workForm.domains[index].professionProgress = res.data;
  3093. this.$forceUpdate();
  3094. }
  3095. },
  3096. error => {
  3097. this.$message({
  3098. message: error,
  3099. type: "error"
  3100. });
  3101. });
  3102. },
  3103. //删除自己的日报
  3104. deleteReport() {
  3105. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3106. confirmButtonText: this.$t('btn.determine'),
  3107. cancelButtonText: this.$t('btn.cancel'),
  3108. type: "warning"
  3109. })
  3110. .then(() => {
  3111. this.listLoading = true;
  3112. this.http.post('/report/delete',{
  3113. userId: this.user.id,
  3114. date: this.workForm.createDate
  3115. },
  3116. res => {
  3117. this.listLoading = false;
  3118. if (res.code == "ok") {
  3119. this.$message({
  3120. message: this.$t('message.successfullyDeleted'),
  3121. type: "success"
  3122. });
  3123. this.getReportList();
  3124. this.getDepartment();
  3125. this.dialogVisible = false;
  3126. } else {
  3127. this.$message({
  3128. message: res.msg,
  3129. type: "error"
  3130. });
  3131. }
  3132. },
  3133. error => {
  3134. this.listLoading = false;
  3135. this.$message({
  3136. message: error,
  3137. type: "error"
  3138. });
  3139. }
  3140. );
  3141. })
  3142. .catch(() => {});
  3143. },
  3144. // 管理员删除日报
  3145. guanli(item) {
  3146. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3147. let param = {date: this.date + day, userId: item.id};
  3148. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3149. confirmButtonText: this.$t('btn.determine'),
  3150. cancelButtonText: this.$t('btn.cancel'),
  3151. type: "warning"
  3152. })
  3153. .then(() => {
  3154. this.listLoading = true;
  3155. this.http.post('/report/delete',param,
  3156. res => {
  3157. this.listLoading = false;
  3158. if (res.code == "ok") {
  3159. this.$message({
  3160. message: this.$t('message.successfullyDeleted'),
  3161. type: "success"
  3162. });
  3163. this.getReportList();
  3164. this.getDepartment();
  3165. this.dialogVisible = false;
  3166. } else {
  3167. this.$message({
  3168. message: res.msg,
  3169. type: "error"
  3170. });
  3171. }
  3172. },
  3173. error => {
  3174. this.listLoading = false;
  3175. this.$message({
  3176. message: error,
  3177. type: "error"
  3178. });
  3179. }
  3180. );
  3181. })
  3182. .catch(() => {});
  3183. },
  3184. //提交批量审核数据
  3185. submitBatchApprove() {
  3186. var data = this.$refs.approveTree.getCheckedNodes();
  3187. var ids = '';
  3188. if (data.length == 0) {
  3189. this.$message({
  3190. message: this.$t('message.Pleaseselectthepersontoreview'),
  3191. type: "error"
  3192. });
  3193. return;
  3194. }
  3195. for (var i=0;i<data.length; i++) {
  3196. ids += data[i].id;
  3197. if (i < data.length-1) {
  3198. ids += ',';
  3199. }
  3200. }
  3201. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3202. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  3203. res => {
  3204. if (res.code == "ok") {
  3205. this.$message({
  3206. message: this.$t('message.Reviewsucceeded'),
  3207. type: "success"
  3208. });
  3209. this.getReportList();
  3210. this.getDepartment();
  3211. this.approveDialogVisible = false;
  3212. } else {
  3213. this.$message({
  3214. message: res.msg,
  3215. type: "error"
  3216. });
  3217. }
  3218. },
  3219. error => {
  3220. this.$message({
  3221. message: error,
  3222. type: "error"
  3223. });
  3224. });
  3225. },
  3226. selectAll() {
  3227. if (this.isAllSelect) {
  3228. var keys = [];
  3229. this.reportNames.forEach(b=>{
  3230. keys.push(b.id);
  3231. })
  3232. this.$refs.approveTree.setCheckedKeys(keys);
  3233. } else {
  3234. this.$refs.approveTree.setCheckedKeys([]);
  3235. }
  3236. },
  3237. //批量审核
  3238. batchApprove() {
  3239. this.approveDialogVisible = true;
  3240. this.reportNames = [];
  3241. for (var i=0;i<this.reportList.length; i++) {
  3242. var report = this.reportList[i];
  3243. var hasUnChecked =false;
  3244. var id = '';
  3245. for (var j=0;j<report.data.length; j++) {
  3246. if (report.data[j].state == 0
  3247. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  3248. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  3249. hasUnChecked = true;
  3250. id += report.data[j].id+',';
  3251. }
  3252. }
  3253. if (hasUnChecked) {
  3254. this.reportNames.push({id:id, label: report.name});
  3255. }
  3256. }
  3257. },
  3258. removeEmptyNode(list) {
  3259. for (var i=0;i<list.length;i++) {
  3260. var cnt = 0;
  3261. if (list[i].membCount == 0) {
  3262. list.splice(i, 1);
  3263. i--;
  3264. } else if (list[i].children != null) {
  3265. this.removeEmptyNode(list[i].children);
  3266. }
  3267. }
  3268. },
  3269. calculateMembCount(list) {
  3270. for (var i in list) {
  3271. var cnt = 0;
  3272. if (list[i].children != null) {
  3273. this.calculateMembCount(list[i].children);
  3274. for (var m in list[i].children) {
  3275. cnt += list[i].children[m].membCount;
  3276. }
  3277. }
  3278. if (list[i].isUser == 1) {
  3279. cnt++;
  3280. this.membCount++;
  3281. }
  3282. list[i].membCount = cnt;
  3283. }
  3284. },
  3285. stateChange() {
  3286. this.membCount = 0;
  3287. if (this.selectState == -1) {
  3288. //全部状态
  3289. this.data = this.allData;
  3290. } else {
  3291. //未填报
  3292. var newData = JSON.parse(JSON.stringify(this.allData));
  3293. this.filterState(this.selectState, newData);
  3294. this.data = newData;
  3295. }
  3296. this.calculateMembCount(this.data);
  3297. this.data[0].membCount = this.membCount;//总人数
  3298. },
  3299. //按状态过滤部门人员
  3300. filterState(state, list) {
  3301. for (var i =0;i<list.length; i++) {
  3302. var obj = list[i];
  3303. if (obj.isUser == 1) {
  3304. var match = false;
  3305. if (state == -2) {
  3306. if (obj.state == null) {
  3307. match = true;
  3308. }
  3309. } else {
  3310. if (obj.state == state) {
  3311. match = true;
  3312. }
  3313. }
  3314. if (!match) {
  3315. list.splice(i, 1);
  3316. i--;
  3317. } else {
  3318. }
  3319. } else {
  3320. if (obj.children != null) {
  3321. this.filterState(state, obj.children);
  3322. }
  3323. }
  3324. }
  3325. },
  3326. // 部门列表点击
  3327. handleNodeClick(data) {
  3328. // this.dealList = data
  3329. this.theValues(data.id, this.allData)
  3330. // this.depData = data;
  3331. var list = [];
  3332. if (data.id == -1) {
  3333. this.deptId = null;
  3334. this.targetUid = null;
  3335. list = this.data;
  3336. } else if (data.isUser == 1) {
  3337. this.deptId = null;
  3338. this.targetUid = data.id;
  3339. } else {
  3340. this.deptId = data.id;
  3341. this.targetUid = null;
  3342. list.push(data);
  3343. }
  3344. this.getReportList();
  3345. if (list.length > 0) {
  3346. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  3347. this.fillList = this.getUserMembListFromDeptList(list, 1)
  3348. }
  3349. },
  3350. theValues(id, item) {
  3351. for(var i in item) {
  3352. if(item[i].id == id) {
  3353. this.depData = item[i]
  3354. if(id == '-1') {
  3355. this.translation = '1'
  3356. } else {
  3357. if(item[i].children) {
  3358. this.translation = '2'
  3359. } else {
  3360. this.translation = '3'
  3361. }
  3362. }
  3363. return
  3364. } else {
  3365. if(item[i].children) {
  3366. this.theValues(id, item[i].children)
  3367. }
  3368. }
  3369. }
  3370. },
  3371. //获取可以选择的代填的人员列表
  3372. getSubstitudeUserDeptList() {
  3373. if (this.deptMembData.length == 0) {
  3374. this.http.post("/department/listMyMembs", {},
  3375. res => {
  3376. if (res.code == "ok") {
  3377. let noAllData = JSON.parse(JSON.stringify(res.data));
  3378. if (noAllData.length > 0) {
  3379. // if (noAllData[0].label == '全部人员') {
  3380. if (noAllData[0].label == this.$t('lable.allStaff')) {
  3381. noAllData.splice(0,1);
  3382. }
  3383. }
  3384. this.setUserToDept(noAllData);
  3385. this.deptMembData = noAllData;
  3386. } else {
  3387. this.$message({
  3388. message: res.msg,
  3389. type: "error"
  3390. });
  3391. }
  3392. },
  3393. error => {
  3394. this.$message({
  3395. message: error,
  3396. type: "error"
  3397. });
  3398. });
  3399. }
  3400. },
  3401. // 获取部门列表
  3402. getDepartment() {
  3403. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3404. var param = {date:this.date + day};
  3405. this.http.post("/report/getMembList", param,
  3406. res => {
  3407. if (res.code == "ok") {
  3408. if(res.data.length == 0){
  3409. // this.$message({
  3410. // message: '请联系管理员设置负责部门',
  3411. // type: 'error'
  3412. // })
  3413. return
  3414. }
  3415. this.departmentList = JSON.parse(JSON.stringify(res.data))
  3416. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  3417. // let noAllData = JSON.parse(JSON.stringify(res.data));
  3418. // if (this.user.role > 0) {
  3419. // }
  3420. list.splice(0,0,{
  3421. id: -1,
  3422. label: this.$t('lable.allStaff'),
  3423. })
  3424. this.membCount = 0;
  3425. //设置员工到部门下面
  3426. this.setUserToDept(list);
  3427. this.data = list;
  3428. // console.log('data',this.data);
  3429. this.expandDate = [this.data[1].id]
  3430. this.allData = list;
  3431. // if (noAllData.length > 0) {
  3432. // if (noAllData[0].label == '全部人员') {
  3433. // noAllData.splice(0,1);
  3434. // }
  3435. // }
  3436. // this.setUserToDept(noAllData);
  3437. // this.deptMembData = noAllData;
  3438. this.option = this.changeArr(list1);
  3439. list[0].membCount = this.membCount;
  3440. if (this.depData.id == -1) {
  3441. this.depData.membCount = this.membCount;
  3442. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  3443. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  3444. } else {
  3445. if (this.depData.isUser == null) {
  3446. var dep = this.findTargetDept(this.data, this.depData.id);
  3447. var membDeptList = [];
  3448. membDeptList.push(dep);
  3449. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  3450. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  3451. }
  3452. }
  3453. if (this.depData.isUser == null) {
  3454. if (this.isFill) {
  3455. this.fillMembList = this.fillList;
  3456. } else {
  3457. this.fillMembList = this.unFillList;
  3458. }
  3459. }
  3460. this.leaveAllNum = 0
  3461. for(let i in this.unFillList){
  3462. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  3463. this.leaveAllNum += 1
  3464. }
  3465. }
  3466. this.stateChange()
  3467. } else {
  3468. this.$message({
  3469. message: res.msg,
  3470. type: "error"
  3471. });
  3472. }
  3473. },
  3474. error => {
  3475. this.$message({
  3476. message: error,
  3477. type: "error"
  3478. });
  3479. });
  3480. this.getReportFillStatus();
  3481. },
  3482. findTargetDept(list, deptId) {
  3483. var t = null;
  3484. for (var i=0;i<list.length; i++) {
  3485. if (list[i].isUser == null && list[i].id == deptId) {
  3486. t = list[i];
  3487. break;
  3488. }
  3489. }
  3490. if (t == null) {
  3491. for (var i=0;i<list.length; i++) {
  3492. if (list[i].children != null && list[i].children.length > 0) {
  3493. t = this.findTargetDept(list[i].children, deptId);
  3494. if (t != null) {
  3495. break;
  3496. }
  3497. }
  3498. }
  3499. }
  3500. return t;
  3501. },
  3502. getUserMembListFromDeptList(list, isFill) {
  3503. var membList = [];
  3504. for (var i in list) {
  3505. var deptName = list[i].label;
  3506. if (list[i].userList != null) {
  3507. list[i].userList.forEach(element => {
  3508. if (isFill == 0) {
  3509. //获取未填的
  3510. if (element.state == null) {
  3511. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  3512. membList.push(obj);
  3513. }
  3514. } else {
  3515. if (element.state != null) {
  3516. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  3517. membList.push(obj);
  3518. }
  3519. }
  3520. });
  3521. }
  3522. if (list[i].children != null) {
  3523. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  3524. }
  3525. }
  3526. return membList;
  3527. },
  3528. setUserToDept(list) {
  3529. for (var i in list) {
  3530. var cnt = 0;
  3531. if (list[i].children != null) {
  3532. this.setUserToDept(list[i].children);
  3533. for (var m in list[i].children) {
  3534. cnt += list[i].children[m].membCount;
  3535. }
  3536. }
  3537. if (list[i].userList != null) {
  3538. if (list[i].children == null) {
  3539. list[i].children = [];
  3540. }
  3541. list[i].userList.forEach(element => {
  3542. var obj = {
  3543. id: element.id,
  3544. label:element.name,
  3545. state:element.state,
  3546. parentId:element.departmentId,
  3547. isUser:1,
  3548. workingTime: element.workingTime,
  3549. leaveDays: element.leaveDays,
  3550. leaveTimes: element.leaveTimes
  3551. };
  3552. list[i].children.push(obj);
  3553. this.membCount++;
  3554. cnt++;
  3555. });
  3556. }
  3557. list[i].membCount = cnt;
  3558. }
  3559. },
  3560. // 修改数组
  3561. changeArr(arr) {
  3562. for (var i = 0; i < arr.length; i++) {
  3563. if(arr[i].id != -1 && arr[i].id != 0) {
  3564. if (arr[i].children != null && arr[i].children.length>0) {
  3565. arr[i].children = this.changeArr(arr[i].children);
  3566. }
  3567. arr[i].id && (arr[i].value = arr[i].id);
  3568. delete arr[i].id;
  3569. }
  3570. }
  3571. for(var i in arr) {
  3572. if(arr[i].id == -1 || arr[i].id == 0) {
  3573. arr.splice(i,1)
  3574. }
  3575. }
  3576. return arr;
  3577. },
  3578. //时间段范围设置改动,监听
  3579. onTimeTypeChange(timeType) {
  3580. this.seleChn(1)
  3581. this.showAddMore = true;
  3582. for(var i in this.workForm.domains) {
  3583. if (this.workForm.domains[i].timeType == 0) {
  3584. this.showAddMore = false;
  3585. break;
  3586. }
  3587. }
  3588. if (this.showAddMore) {
  3589. //检测数量
  3590. if (this.workForm.domains.length == 2) {
  3591. this.showAddMore = false;
  3592. } else {
  3593. this.showAddMore = true;
  3594. }
  3595. }
  3596. },
  3597. getTimeType() {
  3598. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3599. res => {
  3600. if (res.code == "ok") {
  3601. var t = res.data;
  3602. this.reportTimeType = t;
  3603. if (this.reportTimeType.type > 0) {
  3604. this.showAddMore = true;
  3605. }
  3606. //转化时间格式
  3607. if (t.allday != null) {
  3608. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  3609. }
  3610. if (t.am != null) {
  3611. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  3612. }
  3613. if (t.pm != null) {
  3614. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  3615. }
  3616. } else {
  3617. this.$message({
  3618. message: res.msg,
  3619. type: "error"
  3620. });
  3621. }
  3622. },
  3623. error => {
  3624. this.listLoading = false;
  3625. this.$message({
  3626. message: error,
  3627. type: "error"
  3628. });
  3629. });
  3630. },
  3631. // 改变月份 -------
  3632. changeMonthOut() {
  3633. this.getAllDate();
  3634. this.getReportList();
  3635. this.getDepartment();
  3636. },
  3637. // 选择日期
  3638. choseDate(i, item) {
  3639. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  3640. return
  3641. }
  3642. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3643. this.choseDay = i;
  3644. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3645. sessionStorage.msg = this.date + day,
  3646. this.getReportList();
  3647. this.getDepartment();
  3648. this.curDate = item.date;
  3649. },
  3650. canClick(i, item){
  3651. let nowDate = new Date()
  3652. let nowDateYear = nowDate.getFullYear()
  3653. let itemYear = parseInt(this.date.split('-')[0])
  3654. let nowDateMonth = nowDate.getMonth() + 1
  3655. let itemMonth = parseInt(this.date.split('-')[1])
  3656. let nowDateDay = nowDate.getDate()
  3657. let itemDay = parseInt(item.showDate.split('.')[1])
  3658. if(nowDateYear < itemYear){
  3659. return false
  3660. }else if(nowDateYear == itemYear){
  3661. if(nowDateMonth < itemMonth){
  3662. return false
  3663. }else if(nowDateMonth == itemMonth){
  3664. if(nowDateDay < itemDay){
  3665. return false
  3666. }
  3667. }
  3668. }
  3669. },
  3670. // 获取日期列表
  3671. getAllDate(e) {
  3672. var dayArry = [];
  3673. var day = this.getCountDays();
  3674. let curMonthDay = null;
  3675. for (var k = 1; k <= day; k++) {
  3676. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  3677. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3678. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3679. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3680. if(sessionStorage.msg) {
  3681. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3682. this.choseDay = k - 1;
  3683. curMonthDay = str;
  3684. }
  3685. } else {
  3686. if (new Date().getDate() == k) {
  3687. this.choseDay = k - 1;
  3688. }
  3689. }
  3690. } else {
  3691. this.choseDay = 0;
  3692. }
  3693. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3694. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3695. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3696. }
  3697. this.allDate = dayArry;
  3698. //不能超过最大日期
  3699. if (this.choseDay > day-1) {
  3700. this.choseDay = day-1;
  3701. }
  3702. if(sessionStorage.from != 1){
  3703. let nowmonth = new Date().getMonth() + 1
  3704. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  3705. let nowdate = new Date().getDate()
  3706. if(nowd == this.date){
  3707. if(e && sessionStorage.msg){
  3708. }else{
  3709. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  3710. }
  3711. let nowday = new Date(sessionStorage.msg).getDate()
  3712. this.choseDay = nowday - 1
  3713. let monthdate = new Date(sessionStorage.msg)
  3714. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3715. }else{
  3716. if(e && sessionStorage.msg){
  3717. }else{
  3718. sessionStorage.msg = this.date + '-01'
  3719. }
  3720. let monthdate = new Date(sessionStorage.msg)
  3721. this.choseDay = monthdate.getDate() - 1
  3722. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3723. console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  3724. }
  3725. }else{
  3726. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  3727. }
  3728. //从消息点击跳转过来的,直接加载指定日期
  3729. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3730. this.curDate = sessionStorage.msg;
  3731. sessionStorage.from = 0;
  3732. } else {
  3733. // if (curMonthDay != null) {
  3734. // // this.curDate = curMonthDay;
  3735. // let d = new Date(sessionStorage.msg)
  3736. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3737. // } else {
  3738. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  3739. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3740. // }
  3741. }
  3742. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  3743. // if(!sessionStorage.msg){
  3744. // let msgday = this.choseDay + 1
  3745. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  3746. // }
  3747. this.getReportFillStatus();
  3748. },
  3749. getCountDays() {
  3750. var newstr = this.date.replace(/-/g, "/");
  3751. var curDate = new Date(newstr+'/01');
  3752. var curMonth = curDate.getMonth();
  3753. curDate.setMonth(curMonth + 1);
  3754. curDate.setDate(0);
  3755. return curDate.getDate();
  3756. },
  3757. //获取日报列表
  3758. getReportList() {
  3759. this.listLoading = true;
  3760. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3761. let param = {date: this.date + day};
  3762. if (this.deptId) {
  3763. param.deptId = this.deptId;
  3764. }
  3765. if (this.targetUid) {
  3766. param.userId = this.targetUid;
  3767. }
  3768. this.http.post( this.port.report.list, param,
  3769. res => {
  3770. this.listLoading = false;
  3771. if (res.code == "ok") {
  3772. this.reportList = res.data;
  3773. if(document.querySelector("#day"+this.choseDay)){
  3774. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3775. }
  3776. } else {
  3777. this.$message({
  3778. message: res.msg,
  3779. type: "error"
  3780. });
  3781. }
  3782. },
  3783. error => {
  3784. this.listLoading = false;
  3785. this.$message({
  3786. message: error,
  3787. type: "error"
  3788. });
  3789. });
  3790. },
  3791. // 处理数据
  3792. // dealWith() {
  3793. // var tianxie = 0
  3794. // var weixtianxie = 0
  3795. // if(this.selectState == -1) {
  3796. // } else {
  3797. // var arr = []
  3798. // for (var i in this.reportList) {
  3799. // arr.push(this.reportList[i].id)
  3800. // }
  3801. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  3802. // }
  3803. // },
  3804. // getDealWith(item, tx, wtx, arr) {
  3805. // for(var i in item) {
  3806. // if(item[i].children) {
  3807. // this.getDealWith(item[i].children, tx, wtx, arr)
  3808. // } else {
  3809. // if(arr.indexOf(item[i].id) != '-1') {
  3810. // tx = +tx + 1
  3811. // }
  3812. // }
  3813. // }
  3814. // },
  3815. //导出员工工时统计
  3816. exportUserTime() {
  3817. this.listLoading = true;
  3818. var param = {};
  3819. if (this.exportParam.dateRange != null) {
  3820. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3821. }
  3822. this.http.post('/department/exportDeptStatistic', param,
  3823. res => {
  3824. this.listLoading = false;
  3825. if (res.code == "ok") {
  3826. location.href = res.data;
  3827. this.exportTimeDialog = false;
  3828. } else {
  3829. this.$message({
  3830. message: res.msg,
  3831. type: "error"
  3832. });
  3833. }
  3834. },
  3835. error => {
  3836. this.listLoading = false;
  3837. this.$message({
  3838. message: error,
  3839. type: "error"
  3840. });
  3841. });
  3842. },
  3843. //导出日报
  3844. exportReport() {
  3845. this.listLoading = true;
  3846. var param = {};
  3847. if (this.exportParam.dateRange != null) {
  3848. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3849. }
  3850. if (this.exportParam.projectId != null) {
  3851. param.projectId = this.exportParam.projectId;
  3852. }
  3853. if (this.exportParam.departmentId != null) {
  3854. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  3855. }
  3856. param.stateKey = this.stateKey
  3857. // param.departmentId = this.user.departmentId
  3858. this.http.post( this.port.report.export, param,
  3859. res => {
  3860. this.listLoading = false;
  3861. if (res.code == "ok") {
  3862. location.href = res.data;
  3863. this.exportDialog = false;
  3864. } else {
  3865. this.$message({
  3866. message: res.msg,
  3867. type: "error"
  3868. });
  3869. }
  3870. },
  3871. error => {
  3872. this.listLoading = false;
  3873. this.$message({
  3874. message: error,
  3875. type: "error"
  3876. });
  3877. });
  3878. },
  3879. //获取项目列表
  3880. getProjectList() {
  3881. this.listLoading = true;
  3882. this.http.post( this.port.project.list, {},
  3883. res => {
  3884. this.listLoading = false;
  3885. if (res.code == "ok") {
  3886. for(var i in res.data) {
  3887. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3888. res.data[i].projectCode = ''
  3889. }
  3890. }
  3891. this.projectList = res.data;
  3892. // console.log("项目列表",this.projectList);
  3893. } else {
  3894. this.$message({
  3895. message: res.msg,
  3896. type: "error"
  3897. });
  3898. }
  3899. },
  3900. error => {
  3901. this.listLoading = false;
  3902. this.$message({
  3903. message: error,
  3904. type: "error"
  3905. });
  3906. });
  3907. },
  3908. // 获取填报日报的项目下拉列表
  3909. getFillProjectList() {
  3910. this.http.post( this.port.project.list, {
  3911. forReport: 1
  3912. },res => {
  3913. if (res.code == "ok") {
  3914. for(var i in res.data) {
  3915. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3916. res.data[i].projectCode = ''
  3917. }
  3918. }
  3919. this.fillProjectList = res.data;
  3920. } else {
  3921. this.$message({
  3922. message: res.msg,
  3923. type: "error"
  3924. });
  3925. }
  3926. },
  3927. error => {
  3928. this.$message({
  3929. message: error,
  3930. type: "error"
  3931. });
  3932. });
  3933. },
  3934. getBasecostItemList() {
  3935. this.http.post('/project-basecost-setting/getReportBasecostList', {
  3936. companyId: this.user.companyId
  3937. },
  3938. res => {
  3939. if (res.code == "ok") {
  3940. this.timeBasecostList = res.data;
  3941. }
  3942. });
  3943. },
  3944. // 获取个人某天的日报 111111
  3945. getReport() {
  3946. this.http.post( this.port.report.getPort, {
  3947. date: this.workForm.createDate
  3948. },
  3949. res => {
  3950. if (res.code == "ok") {
  3951. var quanbu = 0
  3952. this.jsDay = 1
  3953. var zhi = ''
  3954. var slp = res.data.report
  3955. for(var i in slp) {
  3956. var sp = +slp[i].workingTime + 0
  3957. zhi = this.jsDay * sp
  3958. quanbu = +quanbu + zhi
  3959. }
  3960. this.jsTime = quanbu
  3961. var list = res.data;
  3962. this.report = list;
  3963. this.reportTimeType = this.report.timeType;
  3964. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  3965. this.isWeekend = !this.report.isWorkDay;
  3966. this.canCancelInDialog = false
  3967. if(list.report.length != 0) {
  3968. var arr = [];
  3969. this.canEdit = false;
  3970. let candelete = true
  3971. for(var i in list.report) {
  3972. var flg = null
  3973. list.report[i].isOvertime == 1 ? flg = true : flg = false
  3974. arr.push({
  3975. id: list.report[i].id,
  3976. projectId: list.report[i].projectId,
  3977. workingTime: list.report[i].workingTime,
  3978. content: list.report[i].content,
  3979. state: list.report[i].state,
  3980. timeType: list.report[i].timeType,
  3981. subProjectList: list.report[i].subProjectList,
  3982. taskList: list.report[i].taskList,
  3983. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  3984. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  3985. taskId: list.report[i].taskId,
  3986. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  3987. startTime: list.report[i].startTime,
  3988. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  3989. endTime: list.report[i].endTime,
  3990. isOvertime: flg,
  3991. progress:list.report[i].progress,
  3992. professionProgress: list.report[i].professionProgressList,
  3993. stages:list.report[i].stages,
  3994. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  3995. pics: list.report[i].pics,
  3996. multiWorktime: list.report[i].multiWorktime,
  3997. worktimeList: list.report[i].worktimeList,
  3998. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  3999. wuduList: list.report[i].degreeList,
  4000. taskGroups:list.report[i].taskGroups,
  4001. customData: list.report[i].customData,//自定义的数值
  4002. auditUserList: list.report[i].auditUserList,
  4003. projectAuditorId: list.report[i].projectAuditorId,
  4004. projectAuditorName: list.report[i].projectAuditorName,
  4005. overtimeHours: list.report[i].overtimeHours,
  4006. customText: list.report[i].customText,
  4007. basecostId: list.report[i].basecostId,
  4008. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  4009. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  4010. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  4011. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  4012. canEdit: list.report[i].state >= 2 ? true : false
  4013. })
  4014. if (list.report[i].state >= 2) {
  4015. this.canEdit = true;
  4016. }
  4017. if(list.report[i].state < 2){
  4018. candelete = false
  4019. }
  4020. if (list.report[i].state == 0){
  4021. this.canCancelInDialog = true
  4022. }
  4023. }
  4024. this.reportCanDelete = candelete
  4025. this.workForm = {
  4026. createDate: this.workForm.createDate,
  4027. domains: arr,
  4028. userNames:null,
  4029. userId:null,
  4030. time: list.time
  4031. }
  4032. } else {
  4033. this.workForm = {
  4034. createDate: this.workForm.createDate,
  4035. domains: [{
  4036. id: null,
  4037. projectId: "",
  4038. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4039. content: "",
  4040. progress:100,
  4041. state: 2,
  4042. timeType:0,
  4043. multiWorktime: this.reportTimeType.multiWorktime,
  4044. worktimeList:[{}],
  4045. canEdit: true,
  4046. auditorFirst: '',
  4047. auditorSec: '',
  4048. auditorThird: '',
  4049. ccUserid: ''
  4050. }],
  4051. userId:null,
  4052. userNames:null,
  4053. time: this.report.time
  4054. }
  4055. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  4056. this.$set(this.workForm.domains[0],'isOvertime',true)
  4057. if(this.reportTimeType.type != 2){
  4058. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  4059. }
  4060. }
  4061. if(this.user.timeType.type == 1) {
  4062. var shuzhi = this.user.timeType.allday + ''
  4063. // console.log('执行一次', shuzhi.indexOf('.'))
  4064. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4065. }
  4066. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4067. //默认给第一个,必填字段
  4068. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4069. }
  4070. this.canEdit = true;
  4071. }
  4072. } else {
  4073. this.$message({
  4074. message: res.msg,
  4075. type: "error"
  4076. });
  4077. }
  4078. },
  4079. error => {
  4080. this.$message({
  4081. message: error,
  4082. type: "error"
  4083. });
  4084. });
  4085. },
  4086. guanbi() {
  4087. this.falsss = false
  4088. },
  4089. // 打开日报填写
  4090. fillInReport(i, isBatch) {
  4091. this.isWeekend = false
  4092. this.reportCanDelete = false
  4093. // console.log(this.user.timeType.type, '选择时长')
  4094. if(i != 1) {
  4095. this.falsss = false
  4096. } else {
  4097. this.falsss = true
  4098. }
  4099. if (this.isSubstitude) {
  4100. this.getSubstitudeUserDeptList();
  4101. }
  4102. if(i == -1 || this.isSubstitude) {
  4103. this.isDisable = false;
  4104. } else {
  4105. this.isDisable = true;
  4106. }
  4107. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4108. this.isBatch = isBatch;
  4109. if (this.isBatch == 0 && !this.isSubstitude) {
  4110. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  4111. let weekday = new Date(this.workForm.createDate).getDay()
  4112. if(this.user.companyId == 817){
  4113. if(weekday == 0){
  4114. this.isWeekend = true
  4115. }
  4116. }else{
  4117. if(weekday == 0 || weekday == 6){
  4118. this.isWeekend = true
  4119. }
  4120. }
  4121. this.getReport(i);
  4122. } else {
  4123. // console.log('执行到了这里')
  4124. this.jsTime = 0
  4125. this.jsDay = 0
  4126. this.workForm = {
  4127. createDate: null,//批量填报没有日期
  4128. domains: [{
  4129. id: null,
  4130. projectId: "",
  4131. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4132. content: "",
  4133. progress:100,
  4134. state: 2,
  4135. timeType:0,
  4136. multiWorktime: this.reportTimeType.multiWorktime,
  4137. worktimeList:[{}],
  4138. canEdit: true
  4139. }],
  4140. }
  4141. if(this.user.timeType.type == 1) {
  4142. var shuzhi = this.user.timeType.allday + ''
  4143. // console.log('执行二次')
  4144. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4145. }
  4146. // console.log(this.workForm)
  4147. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  4148. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4149. }
  4150. this.canEdit = true;
  4151. }
  4152. this.dialogVisible = true;
  4153. },
  4154. // 按周填报里内容的填写
  4155. tianxies(item, i, names, row) {
  4156. var idd = ''
  4157. var obj = {}
  4158. for(var l in this.projectList) {
  4159. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  4160. }
  4161. obj.projectId = idd
  4162. this.selectProject(obj, 0)
  4163. // console.log(this.workForm.domains[0], '打印出来的')
  4164. this.tianxieDialogVisible = true
  4165. this.scopess = item
  4166. var sss = {}
  4167. sss.projectId = idd;
  4168. sss.con = item.con
  4169. sss.progress = item.progress
  4170. sss.time = item.time
  4171. sss.groupId = item.groupId
  4172. sss.stage = item.stage;
  4173. sss.workingTime = item.workingTime
  4174. sss.projectAuditorId = item.projectAuditorId;
  4175. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4176. //默认选中第一个
  4177. sss.basecostId = this.timeBasecostList[0].id;
  4178. }
  4179. var that = this
  4180. setTimeout(() =>{
  4181. var isFirstEdit = false;
  4182. if(Object.keys(item).length < 5) {
  4183. //首次点开当前的这个cell,初始化数据
  4184. isFirstEdit = true;
  4185. sss.subProjectId = that.workForm.domains[0].subProjectId
  4186. sss.stage = that.workForm.domains[0].stage
  4187. sss.subProjectList = that.workForm.domains[0].subProjectList
  4188. sss.stages = that.workForm.domains[0].stages
  4189. sss.taskGroups = that.workForm.domains[0].taskGroups;
  4190. sss.auditUserList = obj.auditUserList;
  4191. } else {
  4192. sss.subProjectId = item.subProjectId
  4193. sss.stage = item.stage
  4194. sss.subProjectList = item.subProjectList
  4195. sss.stages = item.stages
  4196. sss.taskGroups = item.taskGroups;
  4197. sss.auditUserList = obj.auditUserList;
  4198. sss.degreeId = item.degreeId;
  4199. sss.customData = item.customData;
  4200. }
  4201. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  4202. //只有一个审核人,自动设置上去
  4203. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  4204. }
  4205. sss.wuduList = row[0].wuduList
  4206. // console.log(sss, '数据')
  4207. that.zhoBaoIdx = i
  4208. that.zhoBaoName = names
  4209. that.zhoBao = sss
  4210. that.zhis = row
  4211. if (sss.groupId) {
  4212. //最后一个参数表示是否保留stage的值,不要重置为空
  4213. this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
  4214. }
  4215. that.$forceUpdate();
  4216. },600);
  4217. },
  4218. // 按周填报里内容的填写点击确定
  4219. btnTianxiaes() {
  4220. if (!this.zhoBao.projectAuditorId && this.user.timeType.reportAuditType != 3) {
  4221. this.$message({
  4222. message: this.$t('message.Pleaseselectareviewer'),
  4223. type: "error"
  4224. });
  4225. return
  4226. }
  4227. if(this.user.timeType.reportAuditType == 3){
  4228. let auditTips = ''
  4229. if(!this.zhoBao.auditorFirst){ auditTips += '第一、' }
  4230. if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  4231. if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  4232. if(auditTips){
  4233. auditTips = auditTips.substring(0,auditTips.length - 1)
  4234. this.$message({
  4235. message: '请选择[' + auditTips + ']审核人',
  4236. type: 'warning'
  4237. })
  4238. return
  4239. }
  4240. }
  4241. let errtips = ''
  4242. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  4243. errtips += this.user.timeType.customDegreeName + '、'
  4244. }
  4245. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  4246. errtips += this.user.timeType.customDataName + '、'
  4247. }
  4248. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  4249. errtips += this.user.timeType.customTextName + '、'
  4250. }
  4251. if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
  4252. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  4253. }
  4254. if(errtips){
  4255. errtips = errtips.substring(0,errtips.length - 1)
  4256. this.$message({
  4257. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  4258. type: 'warning'
  4259. })
  4260. return
  4261. }
  4262. this.tianxieDialogVisible = false
  4263. var zhong = this.zhoData
  4264. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  4265. this.zhoData = zhong
  4266. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  4267. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  4268. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  4269. },
  4270. // 获取本周
  4271. getCurrentWeek() {
  4272. const currentDate = new Date()
  4273. const week = currentDate.getDay()
  4274. const millisecond = 1000 * 60 * 60 * 24
  4275. const minusDay = week != 0 ? week - 1 : 4
  4276. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  4277. var stat = this.dealdate(monday)
  4278. var end
  4279. if(this.user.timeType.fillAhead == 1){
  4280. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4281. const endDate = new Date(currentDate.getTime() + endDay * millisecond)
  4282. end = this.dealdate(endDate)
  4283. }else{
  4284. end = this.dealdate(currentDate)
  4285. }
  4286. this.zhoRqi = [stat, end]
  4287. // console.log('date',currentDate,this.zhoRqi);
  4288. this.zhoRqis()
  4289. // this.jiazai()
  4290. },
  4291. // 获取上周
  4292. handleGetPrevWeek() {
  4293. const Time = new Date(this.zhoRqi[0])
  4294. let weekNum = Time.getDay()
  4295. weekNum = weekNum == 0 ? 7 : weekNum
  4296. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  4297. let fitstDate = new Date(
  4298. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  4299. )
  4300. let startDate = `${fitstDate.getFullYear()}-${
  4301. fitstDate.getMonth() + 1 < 10
  4302. ? '0' + (fitstDate.getMonth() + 1)
  4303. : fitstDate.getMonth() + 1
  4304. }-${
  4305. fitstDate.getDate() < 10
  4306. ? '0' + fitstDate.getDate()
  4307. : fitstDate.getDate()
  4308. }`
  4309. let endDate = `${lastDate.getFullYear()}-${
  4310. lastDate.getMonth() + 1 < 10
  4311. ? '0' + (lastDate.getMonth() + 1)
  4312. : lastDate.getMonth() + 1
  4313. }-${
  4314. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4315. }`
  4316. var stat = this.dealdate(startDate)
  4317. var ends = this.dealdate(endDate)
  4318. var end = this.dateChange(-2, ends)
  4319. this.zhoRqi = [stat, end]
  4320. this.zhoRqis()
  4321. // this.jiazai()
  4322. },
  4323. // 获取下周
  4324. handleGetNextvWeek() {
  4325. const Time = new Date(this.zhoRqi[1])
  4326. let weekNum = Time.getDay()
  4327. weekNum = weekNum == 0 ? 7 : weekNum
  4328. let fitstDate = new Date(
  4329. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  4330. )
  4331. let lastDate = new Date(
  4332. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  4333. )
  4334. let startDate = `${fitstDate.getFullYear()}-${
  4335. fitstDate.getMonth() + 1 < 10
  4336. ? '0' + (fitstDate.getMonth() + 1)
  4337. : fitstDate.getMonth() + 1
  4338. }-${
  4339. fitstDate.getDate() < 10
  4340. ? '0' + fitstDate.getDate()
  4341. : fitstDate.getDate()
  4342. }`
  4343. let endDate = `${lastDate.getFullYear()}-${
  4344. lastDate.getMonth() + 1 < 10
  4345. ? '0' + (lastDate.getMonth() + 1)
  4346. : lastDate.getMonth() + 1
  4347. }-${
  4348. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4349. }`
  4350. var stat = this.dealdate(startDate)
  4351. var ends = this.dealdate(endDate)
  4352. var end = this.dateChange(-2, ends)
  4353. this.zhoRqi = [stat, end]
  4354. this.zhoRqis()
  4355. // this.jiazai()
  4356. },
  4357. // 新增日期
  4358. newDates() {
  4359. // console.log(this.zhoRqi, '看卡')
  4360. let edate = new Date(this.zhoRqi[1])
  4361. let nowdate = new Date()
  4362. let nowdate2
  4363. if(this.user.timeType.fillAhead == 1){
  4364. let week = nowdate.getDay()
  4365. const endDay = week > 5 ? 0 : 5 - week
  4366. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4367. nowdate2 = this.dealdate(endDate)
  4368. }else{
  4369. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4370. }
  4371. if(edate >= nowdate2){
  4372. return
  4373. }
  4374. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  4375. var obj = {}
  4376. obj.zhoDataTime = this.zhoRqi[1]
  4377. obj.he = 0
  4378. for(var j in this.projectList) {
  4379. var xinzhi = this.projectList[j].projectName
  4380. obj[xinzhi] = {}
  4381. obj[xinzhi].time = ''
  4382. obj[xinzhi].con = ''
  4383. obj[xinzhi].progress = 0
  4384. obj[xinzhi].workingTime = 0
  4385. }
  4386. this.zhoData.push(obj)
  4387. if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
  4388. this.getWeeklyCardTime();
  4389. }
  4390. this.getWeeklyWorkTime();
  4391. },
  4392. // 减去时间
  4393. dateChange(num = 1,date = false) {
  4394.   if (!date) {
  4395.     date = new Date();//没有传入值时,默认是当前日期
  4396.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4397.   }
  4398.   date += " 00:00:00";//设置为当天凌晨12点
  4399.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  4400.   date += (86400) * num;//修改后的时间戳
  4401.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4402. var nian = newDate.getFullYear()
  4403. var yue = ''
  4404. var ri = ''
  4405. var yues = (newDate.getMonth() + 1)
  4406. var ris = newDate.getDate()
  4407. yues > 9 ? yue = yues : yue = '0' + yues
  4408. ris > 9 ? ri = ris : ri = '0' + ris
  4409. return nian +'-'+yue+'-'+ri
  4410. },
  4411. // 加载动画
  4412. jiazai() {
  4413. this.zhoLoading = true
  4414. var that = this
  4415. setTimeout(() =>{
  4416. that.zhoLoading = false
  4417. },1000);
  4418. },
  4419. // 转时间格式
  4420. dealdate(date) {
  4421. const dt = new Date(date)
  4422. const y = dt.getFullYear()
  4423. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  4424. const d = (dt.getDate() + '').padStart(2, '0')
  4425. return `${y}-${m}-${d}`
  4426. },
  4427. // 按周填报
  4428. fillInReportss() {
  4429. window.addEventListener('scroll', this.handleScroll, true)
  4430. // this.jiazai()
  4431. this.diasZho = true
  4432. this.getCurrentWeek()
  4433. // 项目数量判断 <=5
  4434. if(this.projectList.length < 5){
  4435. this.selProjectList = this.projectList
  4436. this.selConShow = false
  4437. }
  4438. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  4439. //重新获取工时预警类型的预算项
  4440. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4441. companyId: this.user.companyId
  4442. },
  4443. res => {
  4444. if (res.code == "ok") {
  4445. this.timeBasecostList = res.data;
  4446. }
  4447. });
  4448. }
  4449. },
  4450. // 按周填报的项目筛选
  4451. selListFun(){
  4452. this.selProjectList = []
  4453. if(this.selCon.length){
  4454. for (let i = 0; i < this.selCon.length; i++) {
  4455. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  4456. }
  4457. this.selConShow = false
  4458. }else{
  4459. this.$message({
  4460. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  4461. type:'error'
  4462. })
  4463. }
  4464. },
  4465. getWeeklyCardTime(){ //按周填报获取考勤信息
  4466. let dateStr = []
  4467. for(let i in this.zhoData){
  4468. dateStr.push(this.zhoData[i].zhoDataTime)
  4469. }
  4470. this.http.post('/report/getWeeklyCardTime',{
  4471. dateStr: JSON.stringify(dateStr)
  4472. },res => {
  4473. if(res.code == 'ok'){
  4474. for(let i in res.data){
  4475. let datei = '';
  4476. if (this.user.timeType.showDdCardtime == 1) {
  4477. datei = res.data[i].workDate.split('-');
  4478. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  4479. datei = res.data[i].createDate.split('-');
  4480. }
  4481. for(let m in this.zhoData){
  4482. let datem = new Date(this.zhoData[m].zhoDataTime)
  4483. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4484. let item = {
  4485. startTime: res.data[i].startTime,
  4486. endTime: res.data[i].endTime,
  4487. workHours: res.data[i].workHours
  4488. }
  4489. this.$set(this.zhoData[m],'corpTime',item)
  4490. }
  4491. }
  4492. }
  4493. }else{
  4494. this.$message({
  4495. message: res.msg,
  4496. type: 'error'
  4497. })
  4498. }
  4499. },err => {
  4500. this.$message({
  4501. message: err,
  4502. type: 'error'
  4503. })
  4504. })
  4505. },
  4506. getWeeklyWorkTime(){ //按周填报获取已填工时
  4507. let dateStr = []
  4508. for(let i in this.zhoData){
  4509. dateStr.push(this.zhoData[i].zhoDataTime)
  4510. }
  4511. this.http.post('/report/getWeeklyWorkTime',{
  4512. dateStr: JSON.stringify(dateStr)
  4513. },res => {
  4514. if(res.code == 'ok'){
  4515. for(let n in this.zhoData){
  4516. delete this.zhoData[n].filledTime
  4517. }
  4518. for(let i in res.data){
  4519. let datei = res.data[i].createDate.split('-');
  4520. for(let m in this.zhoData){
  4521. let datem = new Date(this.zhoData[m].zhoDataTime)
  4522. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4523. this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
  4524. let reportTimes = [];
  4525. if (res.data[i].startTime != null) {
  4526. reportTimes = res.data[i].startTime.split(',')
  4527. }
  4528. this.$set(this.zhoData[m],'reportTimes',reportTimes)
  4529. }
  4530. }
  4531. }
  4532. // console.log('zhodata',this.zhoData);
  4533. }else{
  4534. this.$message({
  4535. message: res.msg,
  4536. type: 'error'
  4537. })
  4538. }
  4539. },err => {
  4540. this.$message({
  4541. message: err,
  4542. type: 'error'
  4543. })
  4544. })
  4545. },
  4546. selListqx(){
  4547. this.diasZho = false
  4548. this.selProjectList = []
  4549. this.selCon = []
  4550. },
  4551. handleScroll() {
  4552. this.changdu = this.projectList.length + 1
  4553. },
  4554. // 自动选择时间点的事件
  4555. zhoTimes(item, i, ims, event) {
  4556. var iss = i
  4557. if(item.time == null) {
  4558. return
  4559. } else {
  4560. var zhi = this.zhoData[iss]
  4561. var he = 0
  4562. for(var i in zhi) {
  4563. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  4564. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  4565. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  4566. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  4567. var leave1=date3%(24*3600*1000)
  4568. var hours=Math.floor(leave1/(3600*1000))
  4569. var leave2=leave1%(3600*1000)
  4570. var minutes=Math.floor(leave2/(60*1000))
  4571. var shi = hours+'.'+ minutes
  4572. he += +shi
  4573. }
  4574. }
  4575. zhi.he = he + 'h'
  4576. }
  4577. },
  4578. // 自动选择事件长度的事件
  4579. zhoXuan(item, i) {
  4580. var iss = i
  4581. if(item.time == null) {
  4582. return
  4583. } else {
  4584. var zhi = this.zhoData[iss]
  4585. var he = 0
  4586. for(var i in zhi) {
  4587. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4588. he += +zhi[i].workingTime
  4589. }
  4590. }
  4591. zhi.he = he + 'h'
  4592. }
  4593. },
  4594. // 按时间比例
  4595. addBli(item, i) {
  4596. var iss = i
  4597. if(item.time == null) {
  4598. return
  4599. } else {
  4600. var zhi = this.zhoData[iss]
  4601. var he = 0
  4602. for(var i in zhi) {
  4603. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4604. he += +zhi[i].workingTime
  4605. }
  4606. }
  4607. zhi.he = he.toFixed(1) + 'h'
  4608. }
  4609. },
  4610. zhoRqis() {
  4611. let nowdate = new Date()
  4612. let nowdate2
  4613. if(this.user.timeType.fillAhead == 1){
  4614. const millisecond = 1000 * 60 * 60 * 24
  4615. let week = nowdate.getDay()
  4616. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4617. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4618. nowdate2 = this.dealdate(endDate)
  4619. }else{
  4620. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4621. }
  4622. let edate = new Date(this.zhoRqi[1])
  4623. if(edate >= nowdate2){
  4624. let emon = nowdate2.getMonth() + 1
  4625. let eday = nowdate2.getDate()
  4626. let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
  4627. this.zhoRqi[1] = edate2
  4628. }
  4629. this.zhoData = []
  4630. if(this.zhoRqi) {
  4631. var stime = this.zhoRqi[0]
  4632. var etime = this.zhoRqi[1]
  4633. var zhi = this.getdiffdate(stime, etime)
  4634. var arrst = []
  4635. for(var i in zhi) {
  4636. var obj = {}
  4637. obj.zhoDataTime = zhi[i]
  4638. obj.he = 0
  4639. for(var j in this.projectList) {
  4640. var xinzhi = this.projectList[j].projectName
  4641. obj[xinzhi] = {}
  4642. obj[xinzhi].time = ''
  4643. obj[xinzhi].con = ''
  4644. obj[xinzhi].progress = 0
  4645. obj[xinzhi].workingTime = 0
  4646. }
  4647. arrst.push(obj)
  4648. }
  4649. this.zhoData = arrst
  4650. }
  4651. if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
  4652. this.getWeeklyCardTime()
  4653. // this.getWeeklyFilledTime()
  4654. }
  4655. if (this.zhoData.length) {
  4656. this.getWeeklyWorkTime();
  4657. }
  4658. },
  4659. zhoZhi(res, i) {
  4660. var zhi = 0
  4661. for(var i in res) {
  4662. if(i != 'zhoDataTime' && i != 'he') {
  4663. zhi += +res[i]
  4664. }
  4665. }
  4666. res.he = zhi
  4667. },
  4668. zhoBtn(i) {
  4669. // this.zhoData.split(i, 1)
  4670. var arr = this.zhoData
  4671. arr.splice(i, 1)
  4672. },
  4673. zhoAddlast(){
  4674. this.selConShow = true
  4675. },
  4676. zhoAddqx(){
  4677. this.diasZho = false
  4678. this.selConShow = true
  4679. this.selProjectList = []
  4680. this.selCon = []
  4681. },
  4682. // 提交按周填报
  4683. zhoAdd() {
  4684. var zhi = this.zhoData
  4685. var ll = 0
  4686. if(this.reportTimeType.type == 2) {
  4687. for(var i in zhi) {
  4688. this.dateAr = []
  4689. var alp = []
  4690. var zhis = zhi[i]
  4691. for(var j in zhis) {
  4692. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  4693. let objs = {}
  4694. objs.s = zhis[j].time[0]
  4695. objs.e = zhis[j].time[1]
  4696. alp.push(objs)
  4697. }
  4698. }
  4699. if(zhis.reportTimes){
  4700. for(let k in zhis.reportTimes){
  4701. let objs = {}
  4702. objs.s = zhis.reportTimes[k].split('-')[0]
  4703. objs.e = zhis.reportTimes[k].split('-')[1]
  4704. alp.push(objs)
  4705. }
  4706. }
  4707. this.dateAr = alp
  4708. if(this.dateAr.length > 0) {
  4709. let trus = this.fns()
  4710. ll += 1
  4711. if(!trus) {
  4712. this.$message({
  4713. message: this.$t('message.Filledtimeperiodsoverlap'),
  4714. type: 'error'
  4715. })
  4716. return false
  4717. }
  4718. }
  4719. }
  4720. if(ll == 0) {
  4721. this.$message({
  4722. message: this.$t('message.Pleasefillinthetime'),
  4723. type: 'error'
  4724. })
  4725. return false
  4726. }
  4727. } else if(this.reportTimeType.type == 1){
  4728. for(var i in zhi) {
  4729. var zhis = zhi[i]
  4730. for(var j in zhis) {
  4731. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  4732. ll += 1
  4733. }
  4734. }
  4735. }
  4736. if(ll == 0) {
  4737. this.$message({
  4738. message: this.$t('message.Pleaseselectatime'),
  4739. type: 'error'
  4740. })
  4741. return false
  4742. }
  4743. let overcorp = ''
  4744. for(let n in zhi){
  4745. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  4746. overcorp += zhi[n].zhoDataTime + ','
  4747. }
  4748. }
  4749. if(overcorp != ''){
  4750. overcorp = overcorp.substring(0,overcorp.length - 1)
  4751. this.$message({
  4752. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  4753. type: 'error'
  4754. })
  4755. return
  4756. }
  4757. }
  4758. var submits = []
  4759. let formData = new FormData();
  4760. if(this.reportTimeType.multiWorktime == 1){
  4761. for (var i in this.zhoData) {
  4762. var zhoD = this.zhoData[i]
  4763. var flgs = false
  4764. for(var j in zhoD) {
  4765. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4766. flgs = true
  4767. // formData.append("degreeId", "-1");
  4768. formData.append("id", '-1');
  4769. for(var s in this.projectList) {
  4770. if(j == this.projectList[s].projectName) {
  4771. formData.append("projectId", this.projectList[s].id);
  4772. }
  4773. }
  4774. if(this.user.timeType.reportAuditType == 3){
  4775. let audItem = {}
  4776. if(this.user.timeType.auditLevel > 0){
  4777. audItem.auditorFirst = zhoD[j].auditorFirst
  4778. }
  4779. if(this.user.timeType.auditLevel > 1){
  4780. audItem.auditorSec = zhoD[j].auditorSec
  4781. }
  4782. if(this.user.timeType.auditLevel > 2){
  4783. audItem.auditorThird = zhoD[j].auditorThird
  4784. }
  4785. if(zhoD[j].ccUserid){
  4786. audItem.ccUserid = zhoD[j].ccUserid
  4787. }
  4788. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4789. }
  4790. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4791. formData.append("taskId", 0);
  4792. formData.append("reportTimeType", this.reportTimeType.type);
  4793. formData.append("endTime", '');
  4794. formData.append("startTime", '');
  4795. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4796. var lix = []
  4797. var objjs = {}
  4798. objjs.startTime = zhoD[j].time[0]
  4799. objjs.endTime = zhoD[j].time[1]
  4800. if (zhoD[j].con == null || zhoD[j].con == '') {
  4801. zhoD[j].con == '-'
  4802. }
  4803. objjs.content = zhoD[j].con
  4804. lix.push(objjs)
  4805. var zhiZhi = JSON.stringify(lix)
  4806. zhiZhi = zhiZhi.replace(/,/g,"@");
  4807. formData.append("content", zhiZhi)
  4808. formData.append("isOvertime", 0)
  4809. formData.append("professionProgress", "[]")
  4810. if (zhoD[j].groupId) {
  4811. formData.append("groupId",zhoD[j].groupId)
  4812. } else {
  4813. //解决后台groupId数组越界的问题
  4814. formData.append("groupId",0)
  4815. }
  4816. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4817. formData.append("createDate",zhoD.zhoDataTime)
  4818. if (zhoD[j].projectAuditorId) {
  4819. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4820. }
  4821. if(zhoD[j].basecostId) {
  4822. formData.append("basecostId", zhoD[j].basecostId);
  4823. } else {
  4824. formData.append("basecostId", 0);
  4825. }
  4826. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4827. formData.append('degreeId',zhoD[j].degreeId)
  4828. }else{
  4829. formData.append("degreeId", "-1");
  4830. }
  4831. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4832. formData.append('customData',zhoD[j].customData)
  4833. }else if(this.user.timeType.customDataActive){
  4834. formData.append('customData',0)
  4835. }
  4836. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4837. formData.append('customText',zhoD[j].customText)
  4838. }else if(this.user.timeType.customTextActive){
  4839. formData.append('customText','-')
  4840. }
  4841. }
  4842. }
  4843. }
  4844. } else {
  4845. for (var i in this.zhoData) {
  4846. var zhoD = this.zhoData[i]
  4847. var flgs = false
  4848. if(this.reportTimeType.type == 2) {
  4849. for(var j in zhoD) {
  4850. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4851. flgs = true
  4852. // formData.append("degreeId", "-1");
  4853. formData.append("id", '-1');
  4854. for(var s in this.projectList) {
  4855. if(j == this.projectList[s].projectName) {
  4856. formData.append("projectId", this.projectList[s].id);
  4857. }
  4858. }
  4859. if(this.user.timeType.reportAuditType == 3){
  4860. let audItem = {}
  4861. if(this.user.timeType.auditLevel > 0){
  4862. audItem.auditorFirst = zhoD[j].auditorFirst
  4863. }
  4864. if(this.user.timeType.auditLevel > 1){
  4865. audItem.auditorSec = zhoD[j].auditorSec
  4866. }
  4867. if(this.user.timeType.auditLevel > 2){
  4868. audItem.auditorThird = zhoD[j].auditorThird
  4869. }
  4870. if(zhoD[j].ccUserid){
  4871. audItem.ccUserid = zhoD[j].ccUserid
  4872. }
  4873. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4874. }
  4875. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4876. formData.append("taskId", 0);
  4877. formData.append("reportTimeType", this.reportTimeType.type);
  4878. formData.append("endTime", zhoD[j].time[1]);
  4879. formData.append("startTime", zhoD[j].time[0]);
  4880. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4881. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4882. formData.append("isOvertime", 0)
  4883. formData.append("professionProgress", "[]")
  4884. if (zhoD[j].groupId) {
  4885. formData.append("groupId",zhoD[j].groupId)
  4886. }
  4887. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4888. formData.append("createDate",zhoD.zhoDataTime)
  4889. if (zhoD[j].projectAuditorId) {
  4890. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4891. }
  4892. if(zhoD[j].basecostId) {
  4893. formData.append("basecostId", zhoD[j].basecostId);
  4894. } else {
  4895. formData.append("basecostId", 0);
  4896. }
  4897. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4898. formData.append('degreeId',zhoD[j].degreeId)
  4899. }else{
  4900. formData.append("degreeId", "-1");
  4901. }
  4902. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4903. formData.append('customData',zhoD[j].customData)
  4904. }else if(this.user.timeType.customDataActive){
  4905. formData.append('customData',0)
  4906. }
  4907. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4908. formData.append('customText',zhoD[j].customText)
  4909. }else if(this.user.timeType.customTextActive){
  4910. formData.append('customText','-')
  4911. }
  4912. }
  4913. }
  4914. } else {
  4915. for(var j in zhoD) {
  4916. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].workingTime && zhoD[j].workingTime.length > 0 && zhoD[j].workingTime > 0 && zhoD[j].workingTime != null && zhoD[j].workingTime != 'null') {
  4917. flgs = true
  4918. // formData.append("degreeId", "-1");
  4919. formData.append("id", '-1');
  4920. for(var s in this.projectList) {
  4921. if(j == this.projectList[s].projectName) {
  4922. formData.append("projectId", this.projectList[s].id);
  4923. }
  4924. }
  4925. if(this.user.timeType.reportAuditType == 3){
  4926. let audItem = {}
  4927. if(this.user.timeType.auditLevel > 0){
  4928. audItem.auditorFirst = zhoD[j].auditorFirst
  4929. }
  4930. if(this.user.timeType.auditLevel > 1){
  4931. audItem.auditorSec = zhoD[j].auditorSec
  4932. }
  4933. if(this.user.timeType.auditLevel > 2){
  4934. audItem.auditorThird = zhoD[j].auditorThird
  4935. }
  4936. if(zhoD[j].ccUserid){
  4937. audItem.ccUserid = zhoD[j].ccUserid
  4938. }
  4939. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4940. }
  4941. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  4942. // formData.append("subProjectId", zhoD[j].subProjectId);
  4943. formData.append("taskId", 0);
  4944. formData.append("reportTimeType", this.reportTimeType.type);
  4945. if(this.reportTimeType.type == 1) {
  4946. formData.append("workingTime", zhoD[j].workingTime);
  4947. } else if(this.reportTimeType.type == 2) {
  4948. formData.append("endTime", zhoD[j].time[1]);
  4949. formData.append("startTime", zhoD[j].time[0]);
  4950. } else if(this.reportTimeType.type == 3) {
  4951. formData.append("progress", zhoD[j].progress);
  4952. formData.append("workingTime", zhoD[j].workingTime);
  4953. }
  4954. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4955. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4956. formData.append("isOvertime", 0)
  4957. formData.append("professionProgress", "[]")
  4958. if (zhoD[j].groupId) {
  4959. formData.append("groupId",zhoD[j].groupId)
  4960. }
  4961. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4962. formData.append("createDate",zhoD.zhoDataTime)
  4963. if (zhoD[j].projectAuditorId) {
  4964. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4965. }
  4966. if(zhoD[j].basecostId) {
  4967. formData.append("basecostId", zhoD[j].basecostId);
  4968. } else {
  4969. formData.append("basecostId", 0);
  4970. }
  4971. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4972. formData.append('degreeId',zhoD[j].degreeId)
  4973. }else{
  4974. formData.append("degreeId", "-1");
  4975. }
  4976. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4977. formData.append('customData',zhoD[j].customData)
  4978. }else if(this.user.timeType.customDataActive){
  4979. formData.append('customData',0)
  4980. }
  4981. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4982. formData.append('customText',zhoD[j].customText)
  4983. }else if(this.user.timeType.customTextActive){
  4984. formData.append('customText','-')
  4985. }
  4986. }
  4987. }
  4988. }
  4989. }
  4990. }
  4991. // 自定义维度
  4992. this.submitingReport = true;
  4993. this.http.uploadFile( this.port.report.editPort, formData,
  4994. res => {
  4995. // this.listLoading = false;
  4996. this.submitingReport = false;
  4997. if (res.code == "ok") {
  4998. this.$message({
  4999. message: this.$t('message.fillinsuccessfully'),
  5000. type: "success"
  5001. });
  5002. this.diasZho = false
  5003. this.selConShow = true
  5004. this.zhoData = []
  5005. this.zhoRqi = ''
  5006. this.getReportList();
  5007. this.getDepartment();
  5008. // 关闭弹窗 并 清空
  5009. this.selProjectList = []
  5010. this.selCon = []
  5011. } else {
  5012. this.$message({
  5013. message: res.msg,
  5014. type: "error"
  5015. });
  5016. }
  5017. },
  5018. error => {
  5019. this.submitingReport = false;
  5020. this.$message({
  5021. message: error,
  5022. type: "error"
  5023. });
  5024. });
  5025. },
  5026. ChangeHourMinutestr (str) {
  5027. if (str !== "0" && str !== "" && str !== null) {
  5028. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  5029. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  5030. } else {
  5031. return "";
  5032. }
  5033. },
  5034. // 得到两个日期中间的日期
  5035. getdiffdate(stime,etime){
  5036. //初始化日期列表,数组
  5037. var diffdate = new Array();
  5038. var i=0;
  5039. //开始日期小于等于结束日期,并循环
  5040. while(stime<=etime){
  5041. diffdate[i] = stime;
  5042. //获取开始日期时间戳
  5043. var stime_ts = new Date(stime).getTime();
  5044. //增加一天时间戳后的日期
  5045. var next_date = stime_ts + (24*60*60*1000);
  5046. //拼接年月日,这里的月份会返回(0-11),所以要+1
  5047. var next_dates_y = new Date(next_date).getFullYear()+'-';
  5048. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  5049. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  5050. stime = next_dates_y+next_dates_m+next_dates_d;
  5051. //增加数组key
  5052. i++;
  5053. }
  5054. return diffdate;
  5055. },
  5056. // 添加模块
  5057. addDomain(i) {
  5058. var leftProgress = 10;
  5059. if (this.reportTimeType.type == 3) {
  5060. //计算已经待分配工时比例
  5061. let array = this.workForm.domains;
  5062. let totalProgress = 0;
  5063. for (var i=0;i<array.length; i++) {
  5064. totalProgress += array[i].progress;
  5065. }
  5066. if (totalProgress < 100) {
  5067. leftProgress = 100 - totalProgress;
  5068. }
  5069. }
  5070. var addItem = {
  5071. projectId: "",
  5072. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  5073. content: "",
  5074. progress:leftProgress,
  5075. state:2,//2-表示待提交
  5076. multiWorktime: this.reportTimeType.multiWorktime,
  5077. worktimeList:[{}],
  5078. canEdit: true,
  5079. auditorFirst: '',
  5080. auditorSec: '',
  5081. auditorThird: '',
  5082. ccUserid: ''
  5083. // degreeId: '',
  5084. };
  5085. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5086. this.$set(addItem,'isOvertime',true)
  5087. if(this.reportTimeType.type == 3){
  5088. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  5089. }
  5090. }
  5091. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5092. //默认给第一个,必填字段
  5093. addItem.basecostId = this.timeBasecostList[0].id;
  5094. }
  5095. this.workForm.domains.push(addItem);
  5096. document.getElementById('workFormsItemBottom').scrollIntoView()
  5097. this.canEdit = true
  5098. if (this.reportTimeType.type == 0) {
  5099. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  5100. var length = this.workForm.domains.length;
  5101. if (length == 2) {
  5102. this.showAddMore = false;
  5103. }
  5104. }
  5105. this.chuji()
  5106. },
  5107. // 移除模块
  5108. delDomain(i) {
  5109. this.workForm.domains.splice(i,1)
  5110. let iscan = false
  5111. for(let i in this.workForm.domains){
  5112. if(this.workForm.domains[i].canEdit){
  5113. iscan = true
  5114. }
  5115. }
  5116. this.canEdit = iscan
  5117. //检测当前剩下的一个,时间类型是否是全天
  5118. if (this.reportTimeType.type == 0) {
  5119. if (this.workForm.domains[0].timeType == 0) {
  5120. this.showAddMore = false;
  5121. } else {
  5122. this.showAddMore = true;
  5123. }
  5124. }
  5125. if(this.user.timeType.multiWorktime == 1) {
  5126. this.iptChangs()
  5127. } else {
  5128. this.seleChn(0)
  5129. }
  5130. },
  5131. // 改变月份
  5132. changeMonth() {
  5133. this.isWeekend = false
  5134. let date = new Date()
  5135. let nowmon = date.getMonth() + 1
  5136. let nowday = date.getDate()
  5137. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  5138. if (this.isBatch == 0) {
  5139. if(this.user.timeType.fillAhead == 0){
  5140. let date_a = new Date(this.workForm.createDate)
  5141. if(date_a.getTime() > date.getTime()){
  5142. this.workForm.createDate = nowdate
  5143. }
  5144. }
  5145. //只有按天填报才能获取当天的日报
  5146. if(!this.isSubstitude){
  5147. let weekday = new Date(this.workForm.createDate).getDay()
  5148. if(this.user.companyId == 817){
  5149. if(weekday == 0){
  5150. this.isWeekend = true
  5151. }
  5152. }else{
  5153. if(weekday == 0 || weekday == 6){
  5154. this.isWeekend = true
  5155. }
  5156. }
  5157. this.getReport()
  5158. }
  5159. }else {
  5160. if(this.user.timeType.fillAhead == 0){
  5161. let date_a = new Date(this.workForm.createDate[1])
  5162. if(date_a.getTime() > date.getTime()){
  5163. this.workForm.createDate[1] = nowdate
  5164. let sdate = new Date(this.workForm.createDate[0])
  5165. let edate = new Date(this.workForm.createDate[1])
  5166. if(sdate > edate){
  5167. this.workForm.createDate[0] = this.workForm.createDate[1]
  5168. }
  5169. }
  5170. }
  5171. }
  5172. },
  5173. // 判断时间段
  5174. fns() {
  5175. for (let k in this.dateAr) {
  5176. if (!this.judege(k)) {
  5177. return false
  5178. }
  5179. }
  5180. return true
  5181. },
  5182. judege(idx){
  5183. for (let k in this.dateAr) {
  5184. if (idx !== k) {
  5185. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  5186. return false
  5187. }
  5188. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  5189. return false
  5190. }
  5191. }
  5192. }
  5193. return true
  5194. },
  5195. // 保存日报111111
  5196. submitReport(isDraft) {
  5197. this.isDraft = isDraft;
  5198. this.$refs.workForm.validate(valid => {
  5199. if (valid) {
  5200. this.dateAr = []
  5201. let alp = []
  5202. if(this.user.timeType.multiWorktime != 1) {
  5203. for(var p in this.workForm.domains) {
  5204. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  5205. let objs = {}
  5206. objs.s = this.workForm.domains[p].startTime
  5207. objs.e = this.workForm.domains[p].endTime
  5208. alp.push(objs)
  5209. }
  5210. }
  5211. this.dateAr = alp
  5212. if(this.dateAr.length > 0) {
  5213. let trus = this.fns()
  5214. if(!trus) {
  5215. this.$message({
  5216. message: this.$t('message.Filledtimeperiodsoverlap'),
  5217. type: "error"
  5218. });
  5219. return
  5220. }
  5221. }
  5222. } else {
  5223. for(var p in this.workForm.domains) {
  5224. var slll = this.workForm.domains[p]
  5225. for(var o in slll.worktimeList) {
  5226. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  5227. let objs = {}
  5228. objs.s = slll.worktimeList[o].startTime
  5229. objs.e = slll.worktimeList[o].endTime
  5230. alp.push(objs)
  5231. }
  5232. }
  5233. }
  5234. this.dateAr = alp
  5235. if(this.dateAr.length > 0) {
  5236. let trus = this.fns()
  5237. if(!trus) {
  5238. this.$message({
  5239. message: this.$t('message.Filledtimeperiodsoverlap'),
  5240. type: "error"
  5241. });
  5242. return
  5243. }
  5244. }
  5245. }
  5246. // return
  5247. //代填的情况,检查人员是否已经选择
  5248. if (this.isSubstitude) {
  5249. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  5250. this.$message({
  5251. message: this.$t('message.pleaseselectthepersontofillin'),
  5252. type: "error"
  5253. });
  5254. return;
  5255. }
  5256. }
  5257. //检查时间,全天和上下午不能同时存在
  5258. if (this.reportTimeType.type == 0) {
  5259. var alldayNum = 0;
  5260. var amNum = 0;
  5261. var pmNum = 0;
  5262. for(var i in this.workForm.domains) {
  5263. if (this.workForm.domains[i].timeType == 0) {
  5264. alldayNum ++;
  5265. } else if (this.workForm.domains[i].timeType == 1) {
  5266. amNum++;
  5267. } else if (this.workForm.domains[i].timeType == 2) {
  5268. pmNum++;
  5269. }
  5270. }
  5271. if (alldayNum > 1) {
  5272. this.$message({
  5273. // message: "工作时间-全天,只能选择一次",
  5274. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  5275. type: "error"
  5276. });
  5277. return;
  5278. }
  5279. if (amNum > 1) {
  5280. this.$message({
  5281. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  5282. type: "error"
  5283. });
  5284. return;
  5285. }
  5286. if (pmNum > 1) {
  5287. this.$message({
  5288. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  5289. type: "error"
  5290. });
  5291. return;
  5292. }
  5293. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  5294. this.$message({
  5295. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  5296. type: "error"
  5297. });
  5298. return;
  5299. }
  5300. } else if (this.reportTimeType.type == 3) {
  5301. //总百分比不能超过100%
  5302. let total = 0;
  5303. this.workForm.domains.forEach(w=>{total += w.progress});
  5304. if (total > 100) {
  5305. this.$message({
  5306. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  5307. type: "error"
  5308. });
  5309. return;
  5310. } else if (total < 100) {
  5311. this.$message({
  5312. message: this.$t('message.cannotbesubmitted'),
  5313. type: "error"
  5314. });
  5315. return;
  5316. }
  5317. }
  5318. this.listLoading = true;
  5319. let formData = new FormData();
  5320. formData.append("draft", this.isDraft);
  5321. var totalTime = 0;
  5322. for (var t=0;t<this.workForm.domains.length; t++) {
  5323. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  5324. }
  5325. if (this.reportTimeType.type == 1 && this.workForm.time) {
  5326. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  5327. this.$message({
  5328. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  5329. type: "error"
  5330. });
  5331. return;
  5332. }
  5333. }
  5334. for(var i in this.workForm.domains) {
  5335. if(this.user.timeType.reportAuditType == 3){
  5336. let audItem = {}
  5337. let auditRule = ''
  5338. if(this.workForm.domains[i].id){
  5339. audItem.reportId = this.workForm.domains[i].id
  5340. }
  5341. if(this.user.timeType.auditLevel > 0){
  5342. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第一、' }
  5343. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  5344. }
  5345. if(this.user.timeType.auditLevel > 1){
  5346. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第二、' }
  5347. audItem.auditorSec = this.workForm.domains[i].auditorSec
  5348. }
  5349. if(this.user.timeType.auditLevel > 2){
  5350. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第三、' }
  5351. audItem.auditorThird = this.workForm.domains[i].auditorThird
  5352. }
  5353. if(this.workForm.domains[i].ccUserid){
  5354. audItem.ccUserid = this.workForm.domains[i].ccUserid
  5355. }
  5356. if(auditRule){
  5357. auditRule = auditRule.substring(0,auditRule.length - 1)
  5358. this.$message({
  5359. message: '请指定[' + auditRule + ']审核人',
  5360. type: 'error'
  5361. })
  5362. return
  5363. }
  5364. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5365. }
  5366. if(this.workForm.domains[i].degreeId) {
  5367. // var sss = this.workForm.domains[i].degreeId.toString()
  5368. formData.append("degreeId", this.workForm.domains[i].degreeId);
  5369. } else {
  5370. formData.append("degreeId", -1);
  5371. }
  5372. if(this.workForm.domains[i].customData) {
  5373. // var sss = this.workForm.domains[i].degreeId.toString()
  5374. formData.append("customData", this.workForm.domains[i].customData);
  5375. } else {
  5376. formData.append("customData", 0);
  5377. }
  5378. if(this.workForm.domains[i].customText) {
  5379. formData.append("customText", this.workForm.domains[i].customText);
  5380. } else {
  5381. formData.append("customText", '-');
  5382. }
  5383. if (this.workForm.domains[i].id) {
  5384. formData.append("id", this.workForm.domains[i].id);
  5385. } else {
  5386. formData.append("id", -1);
  5387. }
  5388. formData.append("projectId", this.workForm.domains[i].projectId);
  5389. if (this.workForm.domains[i].subProjectId) {
  5390. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  5391. } else {
  5392. formData.append("subProjectId", 0);
  5393. }
  5394. if (this.workForm.domains[i].groupId) {
  5395. formData.append("groupId", this.workForm.domains[i].groupId);
  5396. } else {
  5397. formData.append("groupId", 0);
  5398. }
  5399. if (this.workForm.domains[i].taskId) {
  5400. formData.append("taskId", this.workForm.domains[i].taskId);
  5401. } else {
  5402. formData.append("taskId", 0);
  5403. }
  5404. if (this.workForm.domains[i].taskFinish == true) {
  5405. formData.append("taskFinish", 1);
  5406. } else {
  5407. formData.append("taskFinish", 0);
  5408. }
  5409. formData.append("reportTimeType", this.reportTimeType.type);
  5410. if (this.reportTimeType.type == 0) {
  5411. formData.append("timeType", this.workForm.domains[i].timeType);
  5412. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  5413. formData.append("workingTime", workingTime);
  5414. } else if (this.reportTimeType.type == 1){
  5415. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5416. } else if (this.reportTimeType.type == 2) {
  5417. formData.append("endTime", this.workForm.domains[i].endTime);
  5418. formData.append("startTime", this.workForm.domains[i].startTime);
  5419. } else if (this.reportTimeType.type == 3) {
  5420. //按比例分配
  5421. formData.append("progress", this.workForm.domains[i].progress);
  5422. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5423. }
  5424. //处理多个时间事项
  5425. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  5426. if (this.reportTimeType.multiWorktime == 1) {
  5427. //检查时间是否有重叠
  5428. var workList = this.workForm.domains[i].worktimeList;
  5429. for (var j=0;j<workList.length; j++) {
  5430. var curItem = workList[j];
  5431. //检查开始时间是否大于结束时间
  5432. if (curItem.startTime >= curItem.endTime) {
  5433. this.$message({
  5434. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  5435. this.$t('message.Endtimemustbegreaterthanstarttime'),
  5436. type: "error"
  5437. });
  5438. return;
  5439. }
  5440. for (var p = j+1;p<workList.length; p++) {
  5441. var jItem = workList[p];
  5442. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  5443. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  5444. this.$message({
  5445. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  5446. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  5447. type: "error"
  5448. });
  5449. return;
  5450. }
  5451. }
  5452. }
  5453. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  5454. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5455. formData.append("content", m);
  5456. } else {
  5457. if (this.workForm.domains[i].content) {
  5458. formData.append("content", this.workForm.domains[i].content);
  5459. } else {
  5460. formData.append("content", '-');
  5461. }
  5462. }
  5463. if (this.isBatch == 0) {
  5464. formData.append("createDate", this.workForm.createDate);
  5465. } else {
  5466. //批量填报,时间范围
  5467. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  5468. }
  5469. if(this.workForm.domains[i].isOvertime) {
  5470. formData.append("isOvertime", 1);
  5471. } else {
  5472. formData.append("isOvertime", 0);
  5473. }
  5474. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  5475. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  5476. } else {
  5477. formData.append("overtimeHours", 0);
  5478. }
  5479. if(this.workForm.domains[i].basecostId) {
  5480. formData.append("basecostId", this.workForm.domains[i].basecostId);
  5481. } else {
  5482. formData.append("basecostId", 0);
  5483. }
  5484. if (this.workForm.userId != null) {
  5485. var targetUids = '';
  5486. this.workForm.userId.forEach(u=>{
  5487. targetUids += u + '@';
  5488. });
  5489. if (targetUids.length > 0) {
  5490. targetUids = targetUids.substring(0, targetUids.length -1);
  5491. formData.append("targetUids", targetUids);
  5492. }
  5493. }
  5494. //项目专业进度
  5495. if (this.workForm.domains[i].professionProgress) {
  5496. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  5497. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5498. formData.append("professionProgress", m);
  5499. } else {
  5500. formData.append("professionProgress", "[]");
  5501. }
  5502. if (this.workForm.domains[i].stage) {
  5503. formData.append("stage", this.workForm.domains[i].stage);
  5504. } else {
  5505. formData.append("stage", "-");
  5506. }
  5507. console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  5508. if (this.workForm.domains[i].projectAuditorId) {
  5509. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  5510. } else {
  5511. console.log('执行到了这里')
  5512. console.log(this.user.timeType.reportAuditType)
  5513. if (this.user.timeType.reportAuditType == 0) {
  5514. this.$message({
  5515. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  5516. type: "error"
  5517. });
  5518. return;
  5519. } else if(this.user.timeType.reportAuditType != 3){
  5520. //分组负责人先审核, 确定是选择了任务分组
  5521. if (this.workForm.domains[i].taskGroups.length == 0) {
  5522. this.$message({
  5523. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  5524. type: "error"
  5525. });
  5526. } else if (!this.workForm.domains[i].groupId) {
  5527. // console.log(this.workForm.domains[i]);
  5528. this.$message({
  5529. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  5530. type: "error"
  5531. });
  5532. } else {
  5533. this.$message({
  5534. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  5535. type: "error"
  5536. });
  5537. }
  5538. return;
  5539. }
  5540. }
  5541. }
  5542. this.submitingReport = true;
  5543. this.http.uploadFile( this.port.report.editPort, formData,
  5544. res => {
  5545. this.listLoading = false;
  5546. this.submitingReport = false;
  5547. if (res.code == "ok") {
  5548. this.$message({
  5549. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  5550. type: "success"
  5551. });
  5552. this.dialogVisible = false;
  5553. this.jsDay = 0
  5554. this.jsTime = 0
  5555. this.getReportList();
  5556. this.getDepartment();
  5557. } else {
  5558. this.$message({
  5559. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  5560. type: "error"
  5561. });
  5562. }
  5563. },
  5564. error => {
  5565. this.listLoading = false;
  5566. this.submitingReport = false;
  5567. this.$message({
  5568. message: error,
  5569. type: "error"
  5570. });
  5571. });
  5572. }
  5573. });
  5574. },
  5575. cli() {
  5576. },
  5577. // 判断是展示那个工时导入
  5578. imports() {
  5579. if(this.user.timeType.syncCorpwxTime == 0) {
  5580. this.importDialog = true
  5581. } else {
  5582. this.importWxDialog = true
  5583. }
  5584. },
  5585. // 跳转
  5586. junpToDeskTop(id) {
  5587. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5588. this.$router.push("/desktop/" + id + "/" + this.date +day);
  5589. },
  5590. // 通过日报
  5591. approve(id, item) {
  5592. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5593. this.approveinData = {
  5594. id: id,
  5595. date: this.date +day,
  5596. reportIds: item.id
  5597. }
  5598. if(this.user.timeType.needEvaluate == 1){
  5599. this.$set(this.approveinData,'evaluate','')
  5600. this.approveinDialog = true
  5601. }else{
  5602. this.logining = true;
  5603. this.approveinfun()
  5604. }
  5605. },
  5606. approveinfun(){
  5607. this.http.post( this.port.report.approve, this.approveinData,
  5608. res => {
  5609. this.logining = false;
  5610. if (res.code == "ok") {
  5611. this.approveinDialog = false
  5612. this.$message({
  5613. message: this.$t('message.Reviewsucceeded'),
  5614. type: "success"
  5615. });
  5616. this.getReportList();
  5617. this.getDepartment();
  5618. } else {
  5619. this.$message({
  5620. message: res.msg,
  5621. type: "error"
  5622. });
  5623. }
  5624. },
  5625. error => {
  5626. this.logining = false;
  5627. this.$message({
  5628. message: error,
  5629. type: "error"
  5630. });
  5631. });
  5632. },
  5633. //撤回日报
  5634. cancel(item,e) {
  5635. console.log('can can need',item);
  5636. this.logining = true;
  5637. var ids = '';
  5638. var data = e ? item : item.data;
  5639. data.forEach(element => {
  5640. if(element.id){
  5641. ids +=(element.id+',');
  5642. }
  5643. });
  5644. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  5645. res => {
  5646. this.logining = false;
  5647. if (res.code == "ok") {
  5648. this.$message({
  5649. message:this.$t('message.Withdrawalsucceeded'),
  5650. type: "success"
  5651. });
  5652. this.getReportList();
  5653. if(e){this.getReport()}
  5654. this.getDepartment();
  5655. } else {
  5656. this.$message({
  5657. message: res.msg,
  5658. type: "error"
  5659. });
  5660. }
  5661. },
  5662. error => {
  5663. this.logining = false;
  5664. this.$message({
  5665. message: error,
  5666. type: "error"
  5667. });
  5668. });
  5669. },
  5670. showDenyDialog(id,i, item) {
  5671. this.denyReasonDialog = true;
  5672. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5673. var ids = item.id;
  5674. // var data = item.data;
  5675. // data.forEach(element => {
  5676. // ids +=(element.id+',');
  5677. // });
  5678. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  5679. },
  5680. // 未通过日报
  5681. deny() {
  5682. this.logining = true;
  5683. this.http.post( this.port.report.deny, this.denyForm,
  5684. res => {
  5685. this.logining = false;
  5686. if (res.code == "ok") {
  5687. this.$message({
  5688. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  5689. type: "success"
  5690. });
  5691. this.getReportList();
  5692. this.getDepartment();
  5693. this.denyReasonDialog = false;
  5694. } else {
  5695. this.$message({
  5696. message: res.msg,
  5697. type: "error"
  5698. });
  5699. }
  5700. },
  5701. error => {
  5702. this.logining = false;
  5703. this.$message({
  5704. message: error,
  5705. type: "error"
  5706. });
  5707. });
  5708. },
  5709. // 查看工时记录弹窗
  5710. toView() {
  5711. this.toViewDialogVisible = true
  5712. this.toViewloading = true
  5713. this.getToView()
  5714. },
  5715. getToView() {
  5716. this.http.post( '/report-import-log/getList', this.toViewForm,
  5717. res => {
  5718. this.toViewloading = false;
  5719. if (res.code == "ok") {
  5720. // console.log(res.data, '数据数据')
  5721. this.toViewList = res.data.records
  5722. this.toViewForm.total = res.data.total
  5723. } else {
  5724. this.toViewloading = false;
  5725. this.$message({
  5726. message: res.msg,
  5727. type: "error"
  5728. });
  5729. }
  5730. })
  5731. },
  5732. // 触发 selectCat 组件更改他的值
  5733. selectCatCli(obj) {
  5734. console.log(obj, '看看')
  5735. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  5736. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  5737. },
  5738. vueCasader(obj) {
  5739. console.log(obj, '看看值')
  5740. if(obj.distinction == 1) {
  5741. let arr = []
  5742. arr.push(obj.item.id)
  5743. this.exportParam.departmentId = arr
  5744. }
  5745. },
  5746. //分页
  5747. handleCurrentChange(val) {
  5748. this.toViewForm.pageIndex = val;
  5749. this.getToView();
  5750. },
  5751. handleSizeChange(val) {
  5752. this.toViewForm.pageSize = val;
  5753. this.getToView();
  5754. },
  5755. getAllUsersList(){
  5756. this.http.post('/user/getSimpleActiveUserList',{
  5757. },res => {
  5758. if(res.code == 'ok'){
  5759. this.allUsersList = res.data
  5760. }else{
  5761. this.$message({
  5762. message: res.msg,
  5763. type: 'error'
  5764. })
  5765. }
  5766. },err => {
  5767. this.$message({
  5768. message: err,
  5769. type: 'error'
  5770. })
  5771. })
  5772. }
  5773. },
  5774. created() {
  5775. let height = window.innerHeight;
  5776. this.tableHeight = height - 178;
  5777. const that = this;
  5778. window.onresize = function temp() {
  5779. that.tableHeight = window.innerHeight - 178;
  5780. };
  5781. this.toViewForm.companyId = this.user.companyId
  5782. this.initDrag([{
  5783. type: "LR",
  5784. domClass: {
  5785. // 中间分割线的名字
  5786. resize: "line-line",
  5787. // 左侧盒子的名字
  5788. left: "box-left",
  5789. // 右侧盒子的名字
  5790. right: "box-right",
  5791. // 父级的名字
  5792. box: "box-father",
  5793. },
  5794. otherInfo: {
  5795. // 限制左边栏最低宽度
  5796. leftWidth: 120,
  5797. },
  5798. },
  5799. {
  5800. type: "LR",
  5801. domClass: {
  5802. // 中间分割线的名字
  5803. resize: "line-second",
  5804. // 左侧盒子的名字
  5805. left: "left-laowang",
  5806. // 右侧盒子的名字
  5807. right: "box-second-father",
  5808. // 父级的名字
  5809. box: "grand",
  5810. },
  5811. otherInfo: {
  5812. // 限制左边栏最低宽度
  5813. leftWidth: 120,
  5814. },
  5815. },
  5816. ]);
  5817. },
  5818. mounted() {
  5819. var now = new Date();
  5820. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  5821. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  5822. this.exportParam.dateRange = [startStr,t];
  5823. this.getAllDate(1);
  5824. this.getReportList();
  5825. this.getProjectList();
  5826. this.getFillProjectList();
  5827. this.getTimeType();
  5828. this.getDepartment();
  5829. this.scrollFunction()
  5830. this.userssHu();
  5831. if(this.user.timeType.reportAuditType == 3){
  5832. this.getAllUsersList()
  5833. }
  5834. if (this.user.company.packageProject == 1) {
  5835. this.getBasecostItemList();
  5836. }
  5837. if(this.user.timeType.lockWorktime){
  5838. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  5839. }
  5840. }
  5841. };
  5842. </script>
  5843. <style lang="scss" scoped>
  5844. .paginatis {
  5845. padding: 10px 10px;
  5846. background: #f2f2f2;
  5847. }
  5848. .waiting {
  5849. color:orange;
  5850. }
  5851. .filledReportStyle {
  5852. color:#32CD32;
  5853. }
  5854. .RejectStyle {
  5855. color:red;
  5856. }
  5857. .waitSubmitStyle{
  5858. color: #409eff;
  5859. }
  5860. .chooseDate {
  5861. .waiting {
  5862. color: #20a0ff;
  5863. }
  5864. .filledReportStyle {
  5865. color:#20a0ff;
  5866. }
  5867. .RejectStyle {
  5868. color: #20a0ff;
  5869. }
  5870. .waitSubmitStyle{
  5871. color: #20a0ff;
  5872. }
  5873. }
  5874. .allDaily {
  5875. width:100%;
  5876. }
  5877. .report_title {
  5878. padding:10px 0;
  5879. color:#666;
  5880. }
  5881. .clearfix {
  5882. overflow-x: auto;
  5883. white-space: nowrap;
  5884. padding: 15px 0 10px 0;
  5885. // overflow-y: hidden;
  5886. .date_item {
  5887. padding: 0 3px;
  5888. cursor: pointer;
  5889. position: relative;
  5890. }
  5891. .chooseDate {
  5892. position: absolute;
  5893. bottom: -3px;
  5894. width: 37px;
  5895. height: 2px;
  5896. left: 14px;
  5897. background: #20a0ff;
  5898. }
  5899. }
  5900. .one_daily {
  5901. i {
  5902. color: #9ed0ff;
  5903. margin-right: 5px;
  5904. }
  5905. .one_daily_body {
  5906. padding: 10px 0px;
  5907. p {
  5908. margin: 0;
  5909. line-height: 30px;
  5910. }
  5911. }
  5912. ul {
  5913. padding: 0;
  5914. }
  5915. }
  5916. .checkbtn {
  5917. float: right;
  5918. margin-top: -10px;
  5919. }
  5920. .selConStyle{
  5921. margin-top:9rem;
  5922. margin-bottom:11rem;
  5923. .selConStyle_title{
  5924. height: 3rem;
  5925. text-align: center;
  5926. font-size: 17px;
  5927. }
  5928. .el-select{
  5929. margin: 0 15%;
  5930. width: 70%;
  5931. }
  5932. }
  5933. </style>
  5934. <style lang="scss">
  5935. .daily {
  5936. .el-card__body {
  5937. height: 80%;
  5938. overflow-y: auto;
  5939. }
  5940. .el-card__header {
  5941. padding: 0 20px;
  5942. }
  5943. }
  5944. .membListClass{
  5945. .el-dialog__body{
  5946. padding-top: 10px;
  5947. }
  5948. }
  5949. .editReportDialog .el-dialog__footer{
  5950. position: sticky;
  5951. bottom: 0;
  5952. background: #fff;
  5953. height: 70px;
  5954. z-index: 1010;
  5955. }
  5956. .touruxiangmu{
  5957. max-width: 1000px;
  5958. }
  5959. </style>
  5960. <style scoped>
  5961. /* 项目标签的样式 */
  5962. .el-tag + .el-tag {
  5963. margin-left: 10px;
  5964. }
  5965. .button-new-tag {
  5966. margin-left: 10px;
  5967. height: 32px;
  5968. line-height: 30px;
  5969. padding-top: 0;
  5970. padding-bottom: 0;
  5971. }
  5972. .input-new-tag {
  5973. width: 90px;
  5974. margin-left: 10px;
  5975. vertical-align: bottom;
  5976. }
  5977. .selectworktime .el-table__fixed-body-wrapper{
  5978. top: 48px !important;
  5979. }
  5980. .selectworktime_export .selectworktime_export_l{
  5981. width: 65%;
  5982. float: left;
  5983. height: 42px;
  5984. }
  5985. .approvalProcessBox{
  5986. margin-left: 30px;
  5987. font-size: 14px;
  5988. line-height: 16px;
  5989. cursor: pointer;
  5990. }
  5991. .approvalProcessBox i {
  5992. margin-right: 0;
  5993. height: 16px;
  5994. width: 16px;
  5995. display: inline-block;
  5996. transform: scale(1.2);
  5997. position: relative;
  5998. top: 0.5px;
  5999. color: #409eff;
  6000. }
  6001. .approvalProcessBox .approvalProcessClick{
  6002. cursor: pointer;
  6003. color: #409eff;
  6004. font-size: 14px;
  6005. }
  6006. .approvalProcessBox:hover .approvalProcessClick{
  6007. color: #3485fb;
  6008. }
  6009. </style>
  6010. <style lang="scss" scoped>
  6011. // 加班样式
  6012. .overtime {
  6013. display: inline-block;
  6014. margin-left: 20px;
  6015. input {
  6016. display: inline-block;
  6017. margin-top: 5px;
  6018. }
  6019. }
  6020. .plus {
  6021. display: inline-block;
  6022. }
  6023. // .tages {
  6024. // float: right;
  6025. // }
  6026. .overtime {
  6027. display: inline-block;
  6028. margin-left: 30px;
  6029. }
  6030. .bloks {
  6031. display: inline-block;
  6032. width: 380px;
  6033. }
  6034. .zhiss {
  6035. display: flex;
  6036. justify-content: space-around;
  6037. align-items: center;
  6038. }
  6039. .zhoFel {
  6040. display: flex;
  6041. justify-content: space-between;
  6042. align-items: center;
  6043. }
  6044. // 左右滑动样式
  6045. .line {
  6046. width: 30px;
  6047. /* height: 500px; */
  6048. background: #f2f2f2;
  6049. cursor: w-resize;
  6050. }
  6051. .box-father {
  6052. border: 8px solid #000;
  6053. }
  6054. .line-second {
  6055. width: 10px;
  6056. /* background: red; */
  6057. }
  6058. .flex {
  6059. display: flex;
  6060. width: 100%;
  6061. }
  6062. .box-left {
  6063. flex: 0 0 400px;
  6064. /* height: 600px; */
  6065. /* background: blue; */
  6066. }
  6067. .box-right {
  6068. /* height: 600px; */
  6069. /* background: green; */
  6070. flex: 1;
  6071. }
  6072. .box-postion {
  6073. width: 200px;
  6074. /* height: 400px; */
  6075. background: #ccc;
  6076. }
  6077. .custom-tree-node {
  6078. flex: 1;
  6079. display: flex;
  6080. align-items: center;
  6081. justify-content: space-between;
  6082. font-size: 14px;
  6083. padding-right: 8px;
  6084. }
  6085. .daitianrbao {
  6086. width: 100%;
  6087. box-sizing: border-box;
  6088. height: 40px;
  6089. border-radius: 4px;
  6090. border: 1px solid #DCDFE6;
  6091. overflow: hidden;
  6092. text-overflow: ellipsis;
  6093. display: flex;
  6094. // align-items: center;
  6095. }
  6096. .daitianrbao .spnn {
  6097. display: inline-block;
  6098. box-sizing: border-box;
  6099. padding: 0 15px;
  6100. overflow: hidden;
  6101. text-overflow: ellipsis;
  6102. }
  6103. .daitianrbao .hover {
  6104. color: #DCDFE6 !important;
  6105. }
  6106. </style>