daily.vue 344 KB

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