daily.vue 391 KB

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