daily.vue 370 KB

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