daily.vue 342 KB

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