daily.vue 337 KB

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