daily.vue 366 KB

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