daily.vue 328 KB

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