daily.vue 342 KB

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