daily.vue 389 KB

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