daily.vue 434 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264
  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')" 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-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <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'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <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">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <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')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <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')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <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')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  252. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  253. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  254. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  255. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  256. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  257. <!--自己可以撤回待审核状态的报告 -->
  258. <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>
  259. </span>
  260. </p>
  261. <p v-if="user.companyId == yuzhongCompId">
  262. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  263. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  264. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  265. <!--任务分组和阶段 -->
  266. <p v-if="item2.groupId != 0">
  267. {{$t('other.taskGroup')}}:{{item2.groupName}}
  268. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  269. </p>
  270. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  271. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  272. <!-- 自定义日报文本 -->
  273. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  274. <p v-if="user.company.packageEngineering == 1">
  275. {{$t('other.professionalProgress')}}:
  276. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  277. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  278. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhetongguo"></i>
  282. </el-tooltip>
  283. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  284. <i class="iconfont firerock-iconshenhebohui"></i>
  285. </el-tooltip>
  286. </span>
  287. </p>
  288. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  289. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  290. </p>
  291. <div v-if="item2.multiWorktime==0">
  292. <p style="display: inline-block;">{{$t('time.duration')}}:
  293. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  295. {{item2.time.toFixed(1)}}h
  296. <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>
  297. </p>
  298. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  299. </div>
  300. <div v-if="item2.multiWorktime==1" >
  301. <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>
  302. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  303. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  304. <p style="display: inline-block;">{{$t('time.duration')}}:
  305. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  306. {{timeItem.time.toFixed(1)}}h
  307. </p>
  308. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  309. </div>
  310. </div>
  311. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  312. <!--照片的显示 -->
  313. <p v-if="item2.pics != null && item2.pics.length > 0">
  314. <el-image v-for="(pic, index) in item2.pics" :key="index"
  315. style="width: 100px; height: 100px; margin-right:10px;"
  316. :src="pic"
  317. :preview-src-list="item2.pics">
  318. </el-image>
  319. </p>
  320. </el-card>
  321. </el-timeline-item>
  322. </el-timeline>
  323. </div>
  324. </div>
  325. <!-- 简陋的无报告提示 -->
  326. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </el-card>
  333. </div>
  334. <!-- 工时推送日志弹窗 -->
  335. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  336. <template>
  337. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  338. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  339. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  340. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  341. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  342. <el-table-column prop="result" label="推送结果" width="250">
  343. <template slot-scope="scope">
  344. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  345. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  349. </el-table>
  350. </template>
  351. <span slot="footer" class="dialog-footer">
  352. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  353. </span>
  354. </el-dialog>
  355. <!-- 填写日报的dialog -->
  356. <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">
  357. <div style="height: 65vh;overflow: auto;">
  358. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  359. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  360. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  361. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  362. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  363. <span class="spnn" v-if="workForm.userNames">
  364. <span v-for="(item, index) in workForm.userNames" :key="index">
  365. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  366. <span v-if="index < workForm.userNames.length - 1">,</span>
  367. </span>
  368. </span>
  369. <span class="spnn hover" v-else>
  370. {{$t('defaultText.pleaseSelectAsubstitute')}}
  371. </span>
  372. </div>
  373. </el-form-item>
  374. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  375. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  376. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  377. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  378. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  379. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  380. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  381. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  382. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  383. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  384. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  385. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  386. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  387. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  388. </span>
  389. <!--批量填报和批量代填不显示考勤记录-->
  390. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  391. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  392. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  393. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  394. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  395. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  396. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  397. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  398. @click="refreshAttendance(workForm.createDate)"></el-button>
  399. <!-- AI智能填报 -->
  400. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  401. </el-form-item>
  402. <!-- 000000 -->
  403. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  404. <div v-if="reportTimeType.multiWorktime==0">
  405. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  406. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  407. <el-select v-model="domain.timeType" style="width:200px;"
  408. v-if="reportTimeType.type == 0"
  409. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  410. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  411. @change="onTimeTypeChange(domain.timeType)">
  412. <el-option
  413. v-for="item in timeType"
  414. :key="item.value"
  415. :label="item.label"
  416. :value="item.value">
  417. </el-option>
  418. </el-select>
  419. <!-- 数字时长选择 -->
  420. <el-select v-model="domain.workingTime" style="width:200px;"
  421. v-if="reportTimeType.type == 1"
  422. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  423. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  424. @change="seleChn(0,domain)">
  425. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  426. </el-select>
  427. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  428. <span v-if="reportTimeType.type == 2">
  429. <!--时间范围选择 -->
  430. <el-time-picker
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  432. v-model="domain.startTime"
  433. :placeholder="$t('time.startTime')"
  434. style="width:120px;"
  435. format="HH:mm"
  436. value-format="HH:mm"
  437. :picker-options="{
  438. start: '08:00',
  439. end: '23:30'
  440. }"
  441. @change="iptChang()">
  442. </el-time-picker> - <el-time-picker
  443. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  444. v-model="domain.endTime"
  445. :placeholder="$t('time.endTime')"
  446. style="width:120px;"
  447. format="HH:mm"
  448. value-format="HH:mm"
  449. :picker-options="{
  450. start: '08:00',
  451. end: '23:30',
  452. minTime: domain.startTime
  453. }"
  454. @change="iptChang()">
  455. </el-time-picker>
  456. </span>
  457. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  458. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  459. <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>
  460. </div>
  461. </el-form-item>
  462. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  463. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  464. <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"
  465. @change="selectProject(domain, index)"
  466. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  467. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  468. <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">
  469. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  470. <span style="float: right;">{{ item.projectName }}</span>
  471. </el-option>
  472. </el-option-group>
  473. </el-select>
  474. <!--昱众不显示子项目-->
  475. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  476. <span style="margin-left:45px;">
  477. {{$t('lable.subproject')}}</span>
  478. <!--子项目 -->
  479. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  480. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  481. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  482. </el-select>
  483. </template>
  484. <template v-if="user.companyId == yuzhongCompId">
  485. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  486. <!--角色选择 -->
  487. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  488. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  489. <el-option
  490. v-for="item in roleList"
  491. :key="item.value"
  492. :label="item.label"
  493. :value="item.value">
  494. </el-option>
  495. </el-select>
  496. </template>
  497. <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%;"
  498. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  499. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  500. </el-link>
  501. <!-- <el-link type="primary" v-if="canEdit"
  502. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  503. </el-form-item>
  504. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  505. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  506. </el-form-item>
  507. <!--如果设置了工时成本预警的预算成本项-->
  508. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  509. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  510. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  511. </el-select>
  512. </el-form-item>
  513. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  514. <template slot="label">
  515. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  516. <span >{{$t('lable.taskGrouping')}}</span>
  517. </template>
  518. <!-- 任务分组 -->
  519. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  521. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  522. </el-select>
  523. <template v-if="user.companyId == yuzhongCompId">
  524. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  525. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  526. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  527. <el-option
  528. v-for="item in domain.filteredRespList"
  529. :key="item.id"
  530. :label="item.jobRespon"
  531. :value="item.id">
  532. </el-option>
  533. </el-select>
  534. </template>
  535. <template v-else><!-- 项目的阶段 -->
  536. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  537. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  538. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  539. @change="changeStages(domain, index)"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  541. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  542. </el-select>
  543. </template>
  544. </el-form-item>
  545. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  546. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  547. <template slot="label">
  548. <span style="color:#FF0000;">*</span>
  549. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  550. </template>
  551. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  552. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  553. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  554. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  555. </el-option>
  556. </el-select>
  557. <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>
  558. </el-form-item>
  559. </div>
  560. <el-form-item v-if="user.companyId == yuzhongCompId">
  561. <template slot="label">
  562. <span style="color:#FF0000;">*</span>
  563. <span >工作内容</span>
  564. </template>
  565. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  566. :disabled="(workForm.domains[index].state>=2?false:true)" >
  567. <el-option
  568. v-for="item in domain.workContentList"
  569. :key="item.id"
  570. :label="item.workContext"
  571. :value="item.id">
  572. </el-option>
  573. </el-select>
  574. </el-form-item>
  575. <!-- 111111 -->
  576. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  577. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  578. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  579. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  580. <span v-else>{{item.name}}</span>
  581. </el-option>
  582. </el-select>
  583. <template v-if="user.timeType.auditLevel > 1">
  584. <i class="el-icon-right"></i>
  585. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  586. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  587. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  588. <span v-else>{{item.name}}</span>
  589. </el-option>
  590. </el-select>
  591. </template>
  592. <template v-if="user.timeType.auditLevel > 2">
  593. <i class="el-icon-right"></i>
  594. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  595. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  597. <span v-else>{{item.name}}</span>
  598. </el-option>
  599. </el-select>
  600. </template>
  601. </el-form-item>
  602. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  603. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  604. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  605. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  606. <span v-else>{{item.name}}</span>
  607. </el-option>
  608. </el-select>
  609. </el-form-item>
  610. <!-- 相关维度/自定义维度 -->
  611. <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'">
  612. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  613. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  614. </el-option>
  615. </el-select>
  616. </el-form-item>
  617. <!-- 相关数值 -->
  618. <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">
  619. <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>
  620. </el-form-item>
  621. <!-- 自定义文本 -->
  622. <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">
  623. <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>
  624. </el-form-item>
  625. <!--按比例填报-->
  626. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  627. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  628. <div style="width:400px;">
  629. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="0" :show-tooltip="false" :step="5" style="width:280px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)" show-input="true" input-size="small"></el-slider></el-col>
  630. <el-col :span="isBatch?6:10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span><span v-if="isBatch == 0">{{domain.workingTime}}{{$t('time.hour')}}</span></span></el-col>
  631. </div>
  632. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  633. <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>
  634. </div>
  635. </el-form-item>
  636. <!--工程专业版本模式下, 各个专业的进度填报 -->
  637. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  638. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  639. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  640. <el-input size="mini" style="width:60px;" v-model="item.progress"
  641. @keyup.native="onProgressChange"
  642. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  643. </span>
  644. </el-form-item>
  645. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  646. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  647. <template slot="label" v-if="user.companyId == 3092">
  648. <span style="color:#FF0000;">*</span>
  649. <span >任务</span>
  650. </template>
  651. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  652. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  653. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  654. </el-select>
  655. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  656. </el-form-item>
  657. <!--针对依斯贝的SAP服务-->
  658. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  659. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  660. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  661. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  662. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  663. </el-select>
  664. </el-form-item>
  665. <!--工作事项-->
  666. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  667. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  668. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  669. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  670. </el-form-item>
  671. <!-- 拍照上传 -->
  672. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  673. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  674. <div class="photos">
  675. <div>
  676. <el-upload
  677. list-type="picture-card"
  678. :http-request="(file) => {return addImg(file, index)}"
  679. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  680. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  681. :file-list="domain.imgListUrl" :limit="9"
  682. :disabled="workForm.domains[index].state>=2?false:true">
  683. <i class="el-icon-plus"></i>
  684. </el-upload>
  685. </div>
  686. </div>
  687. </el-form-item>
  688. </div>
  689. <!--多个工作事项填报的情况 -->
  690. <div v-if="reportTimeType.multiWorktime==1">
  691. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  692. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  693. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  694. @change="selectProject(domain, index)"
  695. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  696. <!-- <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">
  697. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  698. <span style="float: right;">{{ item.projectName }}</span>
  699. </el-option> -->
  700. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  701. <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">
  702. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  703. <span style="float: right;">{{ item.projectName }}</span>
  704. </el-option>
  705. </el-option-group>
  706. </el-select>
  707. <template v-if="user.timeType.mainProjectState != 1">
  708. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  709. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  710. <!--子项目 -->
  711. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  712. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  714. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  715. </el-select>
  716. </template>
  717. <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;"
  718. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  719. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  720. </el-link>
  721. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  722. <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>
  723. </div>
  724. <!-- <el-link type="primary" v-if="canEdit"
  725. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  726. </el-form-item>
  727. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  728. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  729. </el-form-item>
  730. <!--如果设置了工时成本预警的预算成本项-->
  731. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  732. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  733. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  734. </el-select>
  735. </el-form-item>
  736. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  737. <!-- 任务分组 -->
  738. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  740. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  741. </el-select>
  742. <!-- 项目的阶段 -->
  743. <span v-if="domain.stages != null && domain.stages.length> 0"
  744. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  745. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  746. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  747. @change="changeStages(domain, index)"
  748. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  749. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  750. </el-select>
  751. </el-form-item>
  752. <el-form-item :label="$t('other.projectAuditor')" >
  753. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  754. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  755. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  756. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  757. </el-option>
  758. </el-select>
  759. <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>
  760. </el-form-item>
  761. <!--工程专业版本模式下, 各个专业的进度填报 -->
  762. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  763. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  764. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  765. <el-input size="mini" style="width:60px;" v-model="item.progress"
  766. @keyup.native="onProgressChange"
  767. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  768. </span>
  769. </el-form-item>
  770. <!-- 相关维度 -->
  771. <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'">
  772. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  773. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  774. </el-option>
  775. </el-select>
  776. </el-form-item>
  777. <!-- 相关数值 -->
  778. <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">
  779. <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>
  780. </el-form-item>
  781. <!-- 自定义文本 -->
  782. <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">
  783. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  784. </el-form-item>
  785. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  786. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  787. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  788. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  789. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  790. </el-select>
  791. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  792. </el-form-item>
  793. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  794. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  795. <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>
  796. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  797. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  798. <span v-if="reportTimeType.type == 2">
  799. <!-- <span> -->
  800. <!--时间范围选择 -->
  801. <el-time-picker
  802. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  803. v-model="timeItem.startTime"
  804. :placeholder="$t('time.startTime')"
  805. style="width:120px;"
  806. format="HH:mm"
  807. value-format="HH:mm"
  808. :picker-options="{
  809. start: '00:00',
  810. end: '23:59',
  811. }"
  812. @change="iptChangs()">
  813. </el-time-picker> - <el-time-picker
  814. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  815. v-model="timeItem.endTime"
  816. :placeholder="$t('time.endTime')"
  817. style="width:120px;"
  818. format="HH:mm"
  819. value-format="HH:mm"
  820. :picker-options="{
  821. start: '00:00',
  822. end: '23:59',
  823. minTime: timeItem.startTime
  824. }"
  825. @change="iptChangs()">
  826. </el-time-picker>
  827. </span>
  828. </el-form-item>
  829. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  830. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  831. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  832. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  833. ></el-input>
  834. </el-form-item>
  835. </div>
  836. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  837. </div>
  838. <!--照片的显示 -->
  839. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  840. <el-image v-for="(pic, index) in domain.pics" :key="index"
  841. style="width: 100px; height: 100px; margin-right:10px;"
  842. :src="pic"
  843. :preview-src-list="domain.pics">
  844. </el-image>
  845. </p>
  846. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  847. </div>
  848. <span id="workFormsItemBottom"></span>
  849. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  850. </el-form>
  851. </div>
  852. <span slot="footer" class="dialog-footer">
  853. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  854. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  855. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  856. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  857. <el-button v-if="!isSubstitude && !isBatch" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  858. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  859. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  860. </span>
  861. </el-dialog>
  862. <!-- 按周填报 -->
  863. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  864. <!-- 按周填报-已填工时-点击 -->
  865. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  866. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  867. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  868. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  869. <el-table-column prop="state" :label="$t('state.states')">
  870. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  871. </el-table-column>
  872. <!-- <el-table-column label="操作">
  873. <template slot-scope="scope">
  874. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  875. </template>
  876. </el-table-column> -->
  877. </el-table>
  878. <span slot="footer" class="dialog-footer">
  879. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  880. </span>
  881. </el-dialog>
  882. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  883. <el-form-item style="height:30px;margin-top:-72px;">
  884. <!-- <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> -->
  885. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  886. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  887. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  888. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  889. <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>
  890. <el-option
  891. v-for="item in fillProjectList"
  892. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  893. :key="item.id"
  894. :label="item.projectName + '\u3000' + item.projectCode"
  895. :value="item.id">
  896. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  897. <span style="float: right">{{ item.projectName }}</span>
  898. </el-option>
  899. </el-select>
  900. <span style="float:right;margin-right:10px;">选择项目</span>
  901. </el-form-item>
  902. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  903. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  904. <template slot-scope="scope">
  905. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  906. </template>
  907. </el-table-column>
  908. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  909. <template slot-scope="scope">
  910. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  911. <p v-else></p>
  912. </template>
  913. </el-table-column> -->
  914. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  915. <template slot-scope="scope">
  916. <div v-if="scope.row.canFill == 1">
  917. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  918. <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>
  919. <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>
  920. <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>
  921. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  922. </div>
  923. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  924. <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>
  925. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  926. </div>
  927. </div>
  928. <div v-else >
  929. <span style="color:#999999;">不可超前填报</span>
  930. </div>
  931. </template>
  932. </el-table-column>
  933. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  934. <template slot-scope="scope">
  935. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  936. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  937. </template>
  938. </el-table-column>
  939. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  940. <template slot-scope="scope">
  941. <div class="zhiss">
  942. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  943. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  944. </div>
  945. </template>
  946. </el-table-column>
  947. </el-table>
  948. </el-form>
  949. <span slot="footer" class="dialog-footer" >
  950. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  951. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  952. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  953. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  954. </span>
  955. </el-dialog>
  956. <!-- 重庆物奇私人定制的按周填报 -->
  957. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  958. <div class="fillWeekDialogVisiCustom">
  959. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  960. </div>
  961. </el-dialog>
  962. <!-- 选择时间 -->
  963. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  964. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  965. <span slot="footer" class="dialog-footer">
  966. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  967. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  968. </span>
  969. </el-dialog>
  970. <!-- 按周填报弹窗 -->
  971. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  972. <div>
  973. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  974. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  975. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  976. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  977. </el-select>
  978. </div>
  979. <!--如果设置了工时成本预警的预算成本项-->
  980. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  981. <p>{{$t('lable.budgetSource')}}</p>
  982. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  983. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  984. </el-select>
  985. </div>
  986. <!-- 任务分组 -->
  987. <div class="zhoFel" v-if="user.company.packageProject == 1">
  988. <p>{{$t('lable.taskGrouping')}}</p>
  989. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  990. @change="getGroupStages(zhoBao, 0)">
  991. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  995. <p>{{$t('other.inputStage')}}</p>
  996. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  997. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  998. </el-select>
  999. </div>
  1000. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1001. <p>{{$t('other.reviewer')}}</p>
  1002. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1003. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1004. </el-select>
  1005. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1006. </div>
  1007. <template v-if="user.timeType.reportAuditType == 3">
  1008. <div class="zhoFel">
  1009. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1010. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1011. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1012. </el-select>
  1013. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1014. </div>
  1015. <div class="zhoFel">
  1016. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1017. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1018. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <div class="zhoFel">
  1023. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1024. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1025. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1026. </el-select>
  1027. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1028. </div>
  1029. <div class="zhoFel">
  1030. <p>{{ $t('chao-song-ren') }}</p>
  1031. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1032. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1033. </el-select>
  1034. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1035. </div>
  1036. </template>
  1037. <!-- 自定义维度 -->
  1038. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1039. <p>{{user.timeType.customDegreeName}}</p>
  1040. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1041. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. </div>
  1044. <!-- 自定义数值 -->
  1045. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1046. <p>{{user.timeType.customDataName}}</p>
  1047. <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>
  1048. </div>
  1049. <!-- 自定义文本 -->
  1050. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1051. <p>{{user.timeType.customTextName}}</p>
  1052. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1053. </div>
  1054. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1055. <p>{{$t('other.timeSelection')}}</p>
  1056. <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>
  1057. </div>
  1058. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1059. <p>{{$t('other.chooseDuration')}}</p>
  1060. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1061. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1062. </el-select>
  1063. </div>
  1064. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1065. <p>{{$t('lable.percentageOfTime')}}</p>
  1066. <div style="width:400px;display: flex;align-items: center;">
  1067. <el-col span="23"><el-slider style="margin-left: 5px;width:299px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)" show-input="true" input-size="small"></el-slider></el-col>
  1068. <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>
  1069. </div>
  1070. </div>
  1071. <div class="zhoFel">
  1072. <p>{{$t('other.workMatters')}}</p>
  1073. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1074. </div>
  1075. </div>
  1076. <span slot="footer" class="dialog-footer">
  1077. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1078. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1079. </span>
  1080. </el-dialog>
  1081. <!--导出报表条件选择 -->
  1082. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1083. <el-form ref="form3" :model="exportParam" >
  1084. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1085. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1086. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1087. </el-select>
  1088. </el-form-item>
  1089. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1090. <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>
  1091. <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>
  1092. </el-form-item>
  1093. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1094. <el-date-picker
  1095. v-model="exportParam.dateRange" :editable="false"
  1096. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1097. :range-separator="$t('other.to')"
  1098. type="daterange"
  1099. :start-placeholder="$t('time.startDate')"
  1100. :end-placeholder="$t('time.endDate')"
  1101. ></el-date-picker>
  1102. </el-form-item>
  1103. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1104. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1105. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1106. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1107. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1108. </el-select>
  1109. </el-form-item>
  1110. </el-form>
  1111. <div slot="footer" class="dialog-footer">
  1112. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  1113. </div>
  1114. </el-dialog>
  1115. <!--导出报表条件选择 -->
  1116. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1117. <el-form ref="form3" :model="exportParam" >
  1118. <el-form-item prop="range" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :clearable="true"
  1123. :range-separator="$t('other.to')"
  1124. type="daterange"
  1125. :start-placeholder="$t('time.startDate')"
  1126. :end-placeholder="$t('time.endDate')"
  1127. ></el-date-picker>
  1128. </el-form-item>
  1129. </el-form>
  1130. <div slot="footer" class="dialog-footer">
  1131. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1132. </div>
  1133. </el-dialog>
  1134. <!--人员列表 -->
  1135. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1136. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1137. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1138. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1139. <el-table-column type="selection"></el-table-column>
  1140. <el-table-column prop="label" :label="$t('lable.name')" >
  1141. <template slot-scope="scope">
  1142. <span>
  1143. <!-- {{(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}} -->
  1144. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1145. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1146. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1147. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1148. </span>
  1149. <span v-else>
  1150. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1151. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1152. </span>
  1153. </span>
  1154. </template>
  1155. </el-table-column>
  1156. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1157. <template slot-scope="scope">
  1158. <div>
  1159. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1160. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1161. </div>
  1162. </template>
  1163. </el-table-column>
  1164. </el-table>
  1165. </el-tab-pane>
  1166. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1167. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1168. <el-table-column prop="label" :label="$t('lable.name')" >
  1169. <template slot-scope="scope">
  1170. <!-- <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> -->
  1171. <!-- <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> -->
  1172. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1173. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1174. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1175. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1176. </span>
  1177. <span v-else>
  1178. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1179. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1180. </span>
  1181. </template>
  1182. </el-table-column>
  1183. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1184. <template slot-scope="scope">
  1185. <div>
  1186. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1187. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1188. </div>
  1189. </template>
  1190. </el-table-column>
  1191. </el-table>
  1192. </el-tab-pane>
  1193. </el-tabs>
  1194. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1195. <el-table-column type="selection"></el-table-column>
  1196. <el-table-column prop="label" :label="$t('lable.name')" >
  1197. <template slot-scope="scope">
  1198. <div>
  1199. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1200. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1201. </div>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1205. <template slot-scope="scope">
  1206. <div>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1209. </div>
  1210. </template>
  1211. </el-table-column>
  1212. </el-table>
  1213. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1214. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1215. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1216. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1217. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1218. </div>
  1219. </el-dialog>
  1220. <!-- 按部门选择人员 -->
  1221. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1222. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1223. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1224. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1225. </el-input>
  1226. <div class="tree" style="height:400px">
  1227. <el-scrollbar style="height:100%">
  1228. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1229. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1230. highlight-current :filter-node-method="filterNode">
  1231. <span class="custom-tree-node" slot-scope="{ node }">
  1232. <span v-if="user.userNameNeedTranslate == '1'">
  1233. <span v-if="node.data.children">
  1234. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1235. </span>
  1236. <span v-else>
  1237. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1238. </span>
  1239. </span>
  1240. <span v-if="user.userNameNeedTranslate != '1'">
  1241. {{ node.label }}
  1242. </span>
  1243. <!-- {{ node.label }} -->
  1244. </span>
  1245. </el-tree>
  1246. </el-scrollbar>
  1247. </div>
  1248. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1249. <div slot="footer" class="dialog-footer">
  1250. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1251. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <el-dialog
  1255. v-if="monthWorkTimeDialog"
  1256. :visible.sync="monthWorkTimeDialog"
  1257. :close-on-click-modal="false"
  1258. customClass="customWidth selectworktime"
  1259. width="1200px"
  1260. title=""
  1261. >
  1262. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1263. <el-tabs v-model="activeName" @tab-click="handleClick">
  1264. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1265. <div class="selectworktime_export" style="margin-top:10px;">
  1266. <div class="selectworktime_export_l">
  1267. <el-date-picker
  1268. class="selecteworktime_datapick"
  1269. v-model="WorktimeDatepickValue"
  1270. value-format="yyyy-MM-dd"
  1271. type="daterange"
  1272. align="right"
  1273. unlink-panels
  1274. :range-separator="$t('other.to')"
  1275. :start-placeholder="$t('time.startDate')"
  1276. :end-placeholder="$t('time.endDate')"
  1277. :default-time="['12:00:00', '12:00:00']"
  1278. size="small"
  1279. popper-class="selecteorktime_datapick_popper"
  1280. @change="showMonthWorkTime()"
  1281. >
  1282. </el-date-picker>
  1283. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1284. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1285. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1286. <!-- 222 -->
  1287. </div>
  1288. <div>
  1289. <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">
  1290. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1291. </el-input>
  1292. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1293. </div>
  1294. <el-link
  1295. type="primary"
  1296. style="float: right; vertical-align: middle;height:32px"
  1297. @click="exportMembWorkHours()"
  1298. >{{$t('export.exportData')}}</el-link
  1299. >
  1300. </div>
  1301. <el-table ref="hasworkTbl"
  1302. :data="monthWorkDataS"
  1303. v-el-table-infinite-scroll="listScroll"
  1304. border
  1305. :height="500"
  1306. highlight-current-row
  1307. style="width: 100%"
  1308. v-loading="tbload"
  1309. :lazy="true"
  1310. >
  1311. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1312. <template slot-scope="scope">
  1313. {{ scope.$index + 1 }}
  1314. </template>
  1315. </el-table-column>
  1316. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1317. <template slot-scope="scope">
  1318. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1319. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1320. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1321. <!-- {{scope.row.name}} -->
  1322. </span>
  1323. </template>
  1324. </el-table-column>
  1325. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1326. <template slot-scope="scope">
  1327. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1328. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1329. </template>
  1330. </el-table-column>
  1331. <el-table-column
  1332. min-width="105"
  1333. v-for="(item, index) in pickDateArray"
  1334. :key="index"
  1335. :label="item.label"
  1336. align="center"
  1337. >
  1338. <template slot-scope="scope">
  1339. <div
  1340. style="color: red"
  1341. v-if="
  1342. scope.row.worktimeList.filter(
  1343. (w) =>
  1344. w.createDate==item.date
  1345. ).length > 0 &&
  1346. scope.row.worktimeList.filter(
  1347. (w) =>w.createDate==item.date
  1348. )[0].workingTime < reportTimeType.allday
  1349. "
  1350. >
  1351. {{
  1352. scope.row.worktimeList.filter(
  1353. (w) =>w.createDate==item.date
  1354. )[0].workingTime.toFixed(1)
  1355. }}
  1356. </div>
  1357. <div
  1358. style="color: #20a0ff"
  1359. v-if="
  1360. scope.row.worktimeList.filter(
  1361. (w) =>w.createDate==item.date
  1362. ).length > 0 &&
  1363. scope.row.worktimeList.filter(
  1364. (w) =>w.createDate==item.date
  1365. )[0].workingTime > reportTimeType.allday
  1366. "
  1367. >
  1368. {{
  1369. scope.row.worktimeList.filter(
  1370. (w) =>w.createDate==item.date
  1371. )[0].workingTime.toFixed(1)
  1372. }}
  1373. </div>
  1374. <div
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>w.createDate==item.date
  1378. ).length > 0 &&
  1379. scope.row.worktimeList.filter(
  1380. (w) =>w.createDate==item.date
  1381. )[0].workingTime == reportTimeType.allday
  1382. "
  1383. >
  1384. {{
  1385. scope.row.worktimeList.filter(
  1386. (w) =>w.createDate==item.date
  1387. )[0].workingTime
  1388. }}
  1389. </div>
  1390. <div
  1391. v-if="
  1392. scope.row.worktimeList.filter(
  1393. (w) =>w.createDate==item.date
  1394. ).length == 0
  1395. "
  1396. >
  1397. 0
  1398. </div>
  1399. <div
  1400. v-if="
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. ).length > 0 &&
  1404. typeof scope.row.worktimeList.filter(
  1405. (w) =>w.createDate==item.date
  1406. )[0].workingTime == 'string'
  1407. "
  1408. >
  1409. {{
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. )[0].workingTime
  1413. }}
  1414. </div>
  1415. </template>
  1416. </el-table-column>
  1417. </el-table>
  1418. <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>
  1419. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1420. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1421. <label style="font-size: 16px">员工每日已填报工时数</label>
  1422. <el-link
  1423. type="primary"
  1424. style="float: right; margin-right: 60px"
  1425. @click="exportMembWorkHours()"
  1426. >导出已填报数据</el-link
  1427. > -->
  1428. <!-- <el-button >导出</el-button> -->
  1429. <!-- </div> -->
  1430. </el-tab-pane>
  1431. <el-tab-pane label="未提交人员列表" name="second" >
  1432. <div class="selectworktime_export" style="margin-top:10px">
  1433. <div class="selectworktime_export_l">
  1434. <el-date-picker
  1435. class="selecteworktime_datapick"
  1436. v-model="WorktimeDatepickValue"
  1437. value-format="yyyy-MM-dd"
  1438. type="daterange"
  1439. align="right"
  1440. unlink-panels
  1441. :range-separator="$t('other.to')"
  1442. :start-placeholder="$t('time.startDate')"
  1443. :end-placeholder="$t('time.endDate')"
  1444. :default-time="['12:00:00', '12:00:00']"
  1445. size="small"
  1446. popper-class="selecteorktime_datapick_popper"
  1447. @change="showMonthNotWorkTime()"
  1448. >
  1449. </el-date-picker>
  1450. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1451. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1452. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1453. </div>
  1454. <div>
  1455. <div style="margin-top:10px;">
  1456. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1457. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1458. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1459. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1460. </el-input>
  1461. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1462. <el-link
  1463. type="primary"
  1464. style="float: right; vertical-align: middle;height:32px"
  1465. @click="exportMembNotWorkHours()"
  1466. >{{$t('export.exportData')}}</el-link
  1467. >
  1468. </div>
  1469. </div>
  1470. </div>
  1471. <el-table
  1472. ref="hasworkTbl2"
  1473. :data="monthNotWorkDateS"
  1474. v-el-table-infinite-scroll="notListScroll"
  1475. border
  1476. :height="500"
  1477. highlight-current-row
  1478. style="width: 100%"
  1479. v-loading="tbload"
  1480. lazy
  1481. >
  1482. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1483. <template slot-scope="scope">
  1484. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1485. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1486. </template>
  1487. </el-table-column>
  1488. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1489. <template slot-scope="scope">
  1490. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1491. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1492. </template>
  1493. </el-table-column>
  1494. <el-table-column
  1495. min-width="200"
  1496. :label="$t('weekDay.date')"
  1497. align="center"
  1498. prop="createDate"
  1499. >
  1500. </el-table-column>
  1501. <el-table-column
  1502. min-width="200"
  1503. :label="$t('state.states')"
  1504. align="center"
  1505. prop="status"
  1506. />
  1507. <el-table-column
  1508. min-width="200"
  1509. :label="$t('other.attendanceData')"
  1510. prop="cardTime"
  1511. align="center"
  1512. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1513. </el-table>
  1514. <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>
  1515. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1516. </el-tab-pane>
  1517. </el-tabs>
  1518. </el-dialog>
  1519. <!--驳回弹出框 -->
  1520. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1521. <div>
  1522. <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')" />
  1523. </div>
  1524. <div slot="footer" class="dialog-footer">
  1525. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1526. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1527. </div>
  1528. </el-dialog>
  1529. <!-- 通过弹出框 -->
  1530. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1531. <div>
  1532. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1533. </div>
  1534. <div slot="footer" class="dialog-footer">
  1535. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1536. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1537. </div>
  1538. </el-dialog>
  1539. <!--批量导入日报 -->
  1540. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1541. <p>1. {{$t('other.download')}}
  1542. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1543. </p>
  1544. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1545. <p style="display: flex;justify-content: center;">
  1546. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1547. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1548. </el-upload>
  1549. </p>
  1550. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1551. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1552. </div>
  1553. </el-dialog>
  1554. <!-- 工时导入记录弹窗 -->
  1555. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1556. <div style="height: 452px">
  1557. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1558. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1559. <el-table-column prop="userName" :label="$t('other.operator')">
  1560. <template slot-scope="scope">
  1561. <div>
  1562. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1563. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1564. </div>
  1565. </template>
  1566. </el-table-column>
  1567. <el-table-column prop="datel" :label="$t('other.document')">
  1568. <template slot-scope="scope">
  1569. <div>
  1570. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1571. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1572. </div>
  1573. </template>
  1574. </el-table-column>
  1575. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1576. <template slot-scope="scope">
  1577. <div>
  1578. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1579. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1580. </div>
  1581. </template>
  1582. </el-table-column>
  1583. </el-table>
  1584. <el-col :span="24" class="paginatis">
  1585. <el-pagination
  1586. @size-change="handleSizeChange"
  1587. @current-change="handleCurrentChange"
  1588. :page-sizes="[20 , 50 , 80 , 100]"
  1589. :page-size="20"
  1590. layout="total, sizes, prev, pager, next"
  1591. :total="toViewForm.total"
  1592. style="float:right;"
  1593. ></el-pagination>
  1594. </el-col>
  1595. </div>
  1596. </el-dialog>
  1597. <!--基于企业微信考勤数据的工时导入 -->
  1598. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1599. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1600. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1601. </el-step>
  1602. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1603. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1604. </el-steps>
  1605. <div v-if="active==0" style="padding:30px;height:360px;">
  1606. <div style="margin-top:50px;margin-left:280px;">
  1607. <el-date-picker
  1608. v-model="importWxParam.date" :editable="false"
  1609. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1610. :clearable="true"
  1611. :range-separator="$t('other.to')"
  1612. type="daterange"
  1613. :start-placeholder="$t('time.startDate')"
  1614. :end-placeholder="$t('time.endDate')"
  1615. @change="loadCheckInData"
  1616. ></el-date-picker>
  1617. </div>
  1618. </div>
  1619. <div v-if="active==1" style="padding:10px;">
  1620. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1621. style="width: 100%;margin-top:5px;" >
  1622. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1623. <template slot-scope="scope">
  1624. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1625. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1626. </template>
  1627. </el-table-column>
  1628. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1629. </el-table-column>
  1630. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1631. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1632. <template slot-scope="scope">
  1633. <div>
  1634. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1635. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1636. </div>
  1637. </template>
  1638. </el-table-column>
  1639. <el-table-column prop="departmentName" label="部门" >
  1640. <template slot-scope="scope">
  1641. <div>
  1642. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1643. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1644. </div>
  1645. </template>
  1646. </el-table-column>
  1647. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1648. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1649. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1650. <template slot-scope="scope">
  1651. {{scope.row.workHours.toFixed(1)}}h
  1652. </template>
  1653. </el-table-column>
  1654. </el-table>
  1655. </div>
  1656. <div v-if="active==2" >
  1657. <p style="display: flex;justify-content: center;height:390px;">
  1658. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1659. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1660. </el-upload>
  1661. </p>
  1662. </div>
  1663. <div slot="title">
  1664. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1665. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1666. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1667. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1668. <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>
  1669. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1670. </div>
  1671. <span slot="footer">
  1672. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1673. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1674. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1675. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1676. </span>
  1677. </el-dialog>
  1678. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1679. <p style="display: flex;justify-content: center;height:100px;">
  1680. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1681. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1682. </el-upload>
  1683. </p>
  1684. </el-dialog>
  1685. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1686. <div>
  1687. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1688. v-model="deleteReportParam.date" :editable="false"
  1689. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1690. :clearable="true"
  1691. :range-separator="$t('other.to')"
  1692. type="daterange"
  1693. :start-placeholder="$t('time.startDate')"
  1694. :end-placeholder="$t('time.endDate')"
  1695. ></el-date-picker>
  1696. </div>
  1697. <div style="margin-top:10px;">
  1698. <span>请选择部门:</span>
  1699. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1700. <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>
  1701. </div>
  1702. <div style="margin-top:10px;">
  1703. <span>请选择员工:</span>
  1704. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1705. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1706. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1707. <span v-else>{{item.name}}</span>
  1708. </el-option>
  1709. </el-select>
  1710. </div>
  1711. <span slot="footer">
  1712. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1713. </span>
  1714. </el-dialog>
  1715. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1716. <div>
  1717. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1718. v-model="deleteReportParam.date" :editable="false"
  1719. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1720. :clearable="true"
  1721. :range-separator="$t('other.to')"
  1722. type="daterange"
  1723. :start-placeholder="$t('time.startDate')"
  1724. :end-placeholder="$t('time.endDate')"
  1725. ></el-date-picker>
  1726. </div>
  1727. <div style="margin-top:15px;">
  1728. <span>选择部门:</span>
  1729. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1730. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1731. size="small" v-if="user.userNameNeedTranslate != 1"
  1732. ></el-cascader>
  1733. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1734. </div>
  1735. <span slot="footer">
  1736. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1737. </span>
  1738. </el-dialog>
  1739. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1740. <div>
  1741. <span>选择时间:</span><el-date-picker
  1742. v-model="modImportTime"
  1743. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1744. :clearable="true"
  1745. type="datetime"
  1746. ></el-date-picker>
  1747. <span>选择导入人员:</span><el-select
  1748. v-model="modImportUserId"
  1749. >
  1750. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1751. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1752. <span v-else>{{item.name}}</span>
  1753. </el-option>
  1754. </el-select>
  1755. </div>
  1756. <span slot="footer">
  1757. <el-button @click="confirmChangeModTime" >确认</el-button>
  1758. </span>
  1759. </el-dialog>
  1760. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1761. <div>
  1762. <span>请选择年月:</span>
  1763. <el-date-picker
  1764. v-model="ratioYmonth" :editable="false"
  1765. format="yyyyMM" value-format="yyyyMM"
  1766. type="month"
  1767. ></el-date-picker>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <!--工时批量代填 -->
  1774. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1775. <div>
  1776. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1777. v-model="importWxParam.date" :editable="false"
  1778. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1779. :clearable="true"
  1780. :range-separator="$t('other.to')"
  1781. type="daterange"
  1782. :start-placeholder="$t('time.startDate')"
  1783. :end-placeholder="$t('time.endDate')"
  1784. @change="loadCheckInData"
  1785. ></el-date-picker>
  1786. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1787. </div>
  1788. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1789. :key="timeStamp"
  1790. style="width: 100%;margin-top:5px;" ref="tab">
  1791. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1792. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1793. <template slot-scope="scope">
  1794. <div>
  1795. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1796. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1797. </div>
  1798. </template>
  1799. </el-table-column>
  1800. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1801. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1802. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1803. <template slot-scope="scope">
  1804. {{scope.row.workHours.toFixed(1)}}h
  1805. </template>
  1806. </el-table-column>
  1807. <!--项目名称列表 -->
  1808. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1809. <template slot-scope="scope">
  1810. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1811. </template>
  1812. </el-table-column>
  1813. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1814. <template slot-scope="scope">
  1815. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1816. </template>
  1817. </el-table-column>
  1818. </el-table>
  1819. </el-dialog>
  1820. <!--基于企业微信考勤数据的工时导入 -->
  1821. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1822. <div style="padding-bottom:10px;">
  1823. <p>{{importResultMsg}}</p>
  1824. </div>
  1825. <!-- <span slot="footer" class="dialog-footer">
  1826. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1827. </span> -->
  1828. </el-dialog>
  1829. <!-- 审核流程展示 -->
  1830. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1831. <div style="padding:20px 40px 20px 0">
  1832. <el-timeline :reverse="false">
  1833. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1834. <!-- {{item.msg}} -->
  1835. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1836. <span v-if="user.userNameNeedTranslate == 1">
  1837. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1838. <span>{{item.msgCon.two}}</span>
  1839. </span>
  1840. </el-timeline-item>
  1841. </el-timeline>
  1842. </div>
  1843. </el-dialog>
  1844. </section>
  1845. </template>
  1846. <script>
  1847. // 左右滑动
  1848. import dragMixin from "@/common/js/tensile.js";
  1849. import util from "../../common/js/util";
  1850. // 自定义select组件
  1851. import selectCat from "@/components/select.vue"
  1852. // 引入自定义级联组件
  1853. import vueCascader from "@/components/cascader.vue"
  1854. // 重庆物奇定制组件
  1855. import WeeklyCustomization from "./weeklyCustomization.vue"
  1856. import { mapMutations } from 'vuex'
  1857. let _that = this
  1858. export default {
  1859. mixins: [dragMixin],
  1860. components: {
  1861. selectCat,
  1862. vueCascader,
  1863. WeeklyCustomization
  1864. },
  1865. data() {
  1866. return {
  1867. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1868. jobResponseList:[],
  1869. yisibeiCompId: 3092,
  1870. yuzhongCompId: 3385,
  1871. mingyiName : '成都明夷电子科技有限公司',
  1872. // mingyiName : '明夷',
  1873. modItemDataId: null,
  1874. modImportTime: null,
  1875. modImportUserId: null,
  1876. showModImportTimeDialog: false,
  1877. showBatchSimpleApproveReport: false,
  1878. startDeleting: false,
  1879. showBatchDeleteReport: false,
  1880. deleteReportParam: {date:null, userIds:[]},
  1881. isDenying: false,
  1882. targetWeekDate: null,//填写周报中的周日期
  1883. importCardTimeVisi: false,
  1884. startRatioExporting: false,
  1885. exportUserRatio: false,
  1886. ratioYmonth:null,
  1887. hasWrittenReport: false,
  1888. today:null,
  1889. syncTimeLoading: false,
  1890. seluserText: '',
  1891. translation: '1', // 1、文字, 2、部门, 3、人员
  1892. exportLoad: false,
  1893. getPickerOptions: {
  1894. disabledDate: (time) => {
  1895. var date = new Date();
  1896. var year = date.getFullYear();
  1897. var month = date.getMonth() + 1;
  1898. if (month >= 1 && month <= 9) {
  1899. month = "0" + month;
  1900. }
  1901. var currentdate = year.toString() + month.toString();
  1902. var timeyear = time.getFullYear();
  1903. var timemonth = time.getMonth() + 1;
  1904. if (timemonth >= 1 && timemonth <= 9) {
  1905. timemonth = "0" + timemonth;
  1906. }
  1907. var timedate = timeyear.toString() + timemonth.toString();
  1908. if(this.user.timeType.fillAhead == 0){
  1909. return currentdate < timedate;
  1910. }else{
  1911. return false
  1912. }
  1913. }
  1914. },
  1915. alalal: '8.0',
  1916. timeBasecostList:null,
  1917. tbload: false,
  1918. exportTimeDialog: false,
  1919. searchKeyword: '',
  1920. monthWorkDataS: [],
  1921. monthNotWorkDateS: [],
  1922. pickDateArray:[],
  1923. WorktimeDatepickValue: [],
  1924. activeName:"first",
  1925. isLeave: 0,
  1926. submitingReport: false,
  1927. importResultMsg:null,
  1928. showImportResult:false,
  1929. importingData: false,
  1930. isDraft: 0,
  1931. timeStamp: 0,
  1932. projectColumns:[],
  1933. checkinLoading:false,
  1934. importWxParam:{date:null,},
  1935. active:0,
  1936. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1937. importWxDialog:false,
  1938. importDialog:false,
  1939. denyForm:null,
  1940. denyReasonDialog:false,
  1941. monthWorkTimeDialog: false,
  1942. isSubstitude:false,
  1943. isFill:false,
  1944. unFillList:[],
  1945. fillList:[],
  1946. fillMembList:[],
  1947. fillMembList_leave: [],
  1948. membListVisible: false,
  1949. isBatch:0,//是否是批量填报
  1950. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1951. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1952. 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')],
  1953. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1954. fillStatusList: [],
  1955. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1956. exportDialog:false,
  1957. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1958. subProjectList:[],
  1959. canEdit: true,
  1960. originCanEdit: true,
  1961. 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],
  1962. selectTime:null,
  1963. reportTimeType:{},
  1964. curDate:'',
  1965. isAllSelect: false,
  1966. approveDialogVisible:false,
  1967. deptId:null,
  1968. targetUid: null,
  1969. membCount:0,
  1970. selectState:"-1",
  1971. user: JSON.parse(sessionStorage.getItem("user")),
  1972. allUsersList: [],
  1973. showAddMore:false,
  1974. allDate: [],
  1975. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1976. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1977. choseDay: 0,
  1978. tableHeight: 0,
  1979. listLoading: false,
  1980. projectList: [], //项目列表
  1981. fillProjectList: [],
  1982. reportList: [], //日报列表
  1983. reportNames:[], //批量审批列表
  1984. selCon:[], //筛选条件
  1985. selProjectList:[], //筛选后项目列表
  1986. selConShow: true,
  1987. usersList: [], // 全部人员列表
  1988. usersListId: '', // 选中的人员id
  1989. dialogVisible: false, //项目弹窗
  1990. report: '',
  1991. workForm: {
  1992. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1993. domains: [{
  1994. id: null,
  1995. projectId: "",
  1996. workingTime: "",
  1997. timeType:0,
  1998. content: "",
  1999. state: 2,
  2000. multiWorktime:0,
  2001. worktimeList:[],
  2002. degreeId: null,
  2003. auditUserList: [],
  2004. }],
  2005. },
  2006. workRules: {
  2007. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2008. },
  2009. chooseParticipVisible: false,
  2010. logining: false,
  2011. isDisable: false,
  2012. timeType:[],
  2013. deptMembData: [
  2014. ],
  2015. //部门人员树状结构
  2016. data: [
  2017. {
  2018. id: -1,
  2019. label: this.$t('lable.allStaff'),
  2020. membCount:0
  2021. },
  2022. {
  2023. id: 0,
  2024. label: this.$t('lable.unassigned'),
  2025. }
  2026. ],
  2027. allData:{},
  2028. batchShowData:{},
  2029. option: [],
  2030. deptOptionList: [],
  2031. depData: {
  2032. id: -1,
  2033. label: this.$t('lable.allStaff'),
  2034. },
  2035. defaultProps: {
  2036. children: 'children',
  2037. label: 'label'
  2038. },
  2039. isNew: false,
  2040. selected: false,
  2041. valuet: new Date(),
  2042. domObj: null,
  2043. participator:[],
  2044. chosenMembCount:0,
  2045. jsDay: 0,
  2046. jsTime: 0,
  2047. falsss: false,
  2048. weidu: [],
  2049. weiduList: [],
  2050. yonghuUser: [],
  2051. dateAr: [],
  2052. batchSubFillDialog: false,
  2053. isSubstiS: false,
  2054. fillWeekDialogVisi: false,
  2055. fillWeekDialogVisiCustom: false,
  2056. zhoData: [],
  2057. weekDateRange: [],
  2058. btnZho: false,
  2059. weekDataLoading: false,
  2060. changdu: 6,
  2061. tianxieDialogVisible: false,
  2062. scopess: {},
  2063. zhoBao: {
  2064. time: '',
  2065. workingTime: '',
  2066. progress: '',
  2067. con: '',
  2068. subProjectId: '',
  2069. stage: '',
  2070. subProjectList: [],
  2071. stages: [],
  2072. },
  2073. zhoBaoIdx: '',
  2074. zhoBaoName: '',
  2075. zhis: {},
  2076. dealList: [],
  2077. toViewDialogVisible: false,
  2078. toViewList: [],
  2079. toViewloading: true,
  2080. toViewForm: {
  2081. pageIndex: '1',
  2082. pageSize: '20',
  2083. total: 0,
  2084. },
  2085. toViewloadings: false,
  2086. tabPositionss: 'top',
  2087. monthTotal: 0,
  2088. monthTotalPage: 0,
  2089. monthTotalLages: 20,
  2090. monthWorkData: [],
  2091. monthNotWorkDate: [],
  2092. monthWorkDataS1: [],
  2093. monthnotTotal: 0,
  2094. monthnotTotalPage: 0,
  2095. monthnotTotalLages: 20,
  2096. monthNotWorkDateS1: [],
  2097. deptMembDataText: '',
  2098. isFlag: false,
  2099. isMore: false,
  2100. stateKey: '0',
  2101. expandDate: [],
  2102. notifySelList:[],
  2103. departmentList: [],
  2104. approvalProcessDialog: false,
  2105. approvalProcessData: [],
  2106. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2107. 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')],
  2108. isWeekend: false,
  2109. canCancelInDialog: false,
  2110. approveinData: {},
  2111. approveinDialog: false,
  2112. reportCanDelete: false,
  2113. weeklyFilledTimeDialog: false,
  2114. weeklyFilledTimeList: [],
  2115. weeklyFilledTimeLoading: false,
  2116. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2117. weeklyFilledTimeCanDelete: false,
  2118. weeklyFilledTimeDate: null,
  2119. leaveAllNum: 0,
  2120. dataLoading: false,
  2121. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2122. vacationTime: {},
  2123. integrationProjectList: [],
  2124. totalReportHours: 0, // 合计的工时
  2125. workTimeForMinYi:0,
  2126. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2127. weekIndex: 1,
  2128. weekParentData: {},
  2129. deptIdForNoReport:[],
  2130. nameAearch: '', // 企业微信姓名搜索
  2131. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2132. deptMembDataLoading: false,
  2133. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2134. {
  2135. id: 4811,
  2136. // id: 10,
  2137. name: '陕西柘中建设工程有限公司'
  2138. }
  2139. ],
  2140. pushWorkTimeLogDig:false,
  2141. pushWorkTimeLogData:[],
  2142. };
  2143. },
  2144. watch: {
  2145. deptMembDataText(val) {
  2146. this.$refs.chooseMembTree.filter(val);
  2147. }
  2148. },
  2149. filters: {
  2150. // 过滤
  2151. amounts(value) {
  2152. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2153. return 0
  2154. }
  2155. var zhi = +value + 0
  2156. return zhi.toFixed(1)
  2157. },
  2158. // zhoData
  2159. zhoData(value, arr) {
  2160. var dateArray = value.split("-");
  2161. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2162. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2163. // console.log(arr[date.getDay()])
  2164. // return "周" + "日一二三四五六".charAt(date.getDay());
  2165. return arr[date.getDay()]
  2166. },
  2167. // 过滤数字
  2168. numbers(value) {
  2169. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2170. return 0
  2171. }
  2172. return value
  2173. },
  2174. },
  2175. computed: {},
  2176. mounted() {
  2177. var now = new Date();
  2178. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2179. this.today = t;
  2180. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2181. this.exportParam.dateRange = [startStr,t];
  2182. this.getAllDate(1);
  2183. this.getReportList();
  2184. this.getProjectList();
  2185. this.getFillProjectList();
  2186. this.getTimeType();
  2187. this.getDepartment();
  2188. this.scrollFunction()
  2189. this.userssHu();
  2190. if(this.user.timeType.reportAuditType == 3){
  2191. this.getAllUsersList()
  2192. }
  2193. if (this.user.company.packageProject == 1) {
  2194. this.getBasecostItemList();
  2195. }
  2196. if(this.user.timeType.lockWorktime){
  2197. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2198. }
  2199. const that = this
  2200. if(this.user.userNameNeedTranslate == 1) {
  2201. that.dataLoading = that.$store.state.dataLoading
  2202. this.upDataLoading()
  2203. setTimeout(()=>{
  2204. that.dataLoading = that.$store.state.dataLoading
  2205. }, 1000)
  2206. }
  2207. if (this.user.companyId == this.yuzhongCompId) {
  2208. this.getJobResponList();
  2209. }
  2210. },
  2211. methods: {
  2212. ...mapMutations(['upDataLoading']),
  2213. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2214. isCustomization(userInfo, permissionArray) {
  2215. const { companyId } = userInfo
  2216. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2217. return isReportPictureRequired
  2218. },
  2219. //任务被选中
  2220. onTaskSelected(domainItem) {
  2221. //取服务
  2222. if (domainItem.taskId) {
  2223. var that = this;
  2224. var param = {taskId:domainItem.taskId};
  2225. if (this.isSubstitude) {
  2226. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2227. param.userId = this.workForm.userId[0];
  2228. }
  2229. }
  2230. this.http.post('/task/getMyTaskService',param, res => {
  2231. if (res.code == "ok") {
  2232. // domainItem.workContentList = res.data;
  2233. that.$set(domainItem, 'sapServiceId', null);
  2234. that.$set(domainItem, 'serviceList', res.data);
  2235. } else {
  2236. this.$message({
  2237. message: res.msg,
  2238. type: "error"
  2239. });
  2240. }
  2241. },error => {
  2242. this.$message({
  2243. message: error,
  2244. type: "error"
  2245. });
  2246. }
  2247. );
  2248. } else {
  2249. //清空服务
  2250. }
  2251. },
  2252. onBatchTimeChange() {
  2253. //反向计算每日工作时长
  2254. if (this.workForm.createDate) {
  2255. let sdate = new Date(this.workForm.createDate[0]);
  2256. let edate = new Date(this.workForm.createDate[1]);
  2257. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2258. console.log('days===', days)
  2259. if (days < 0) {
  2260. return;
  2261. }
  2262. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2263. //总时长发生改变,自动按比例计算
  2264. this.workForm.domains.forEach(d=>{
  2265. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2266. });
  2267. }
  2268. },
  2269. //更新工作内容列表
  2270. updateJobContent(domainItem) {
  2271. var that = this;
  2272. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'extraField3', null);
  2276. that.$set(domainItem, 'workContentList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. },
  2291. updateResponse(domainItem) {
  2292. var that = this;
  2293. var selectPid = domainItem.projectId;
  2294. domainItem.extraField2 = null;
  2295. domainItem.extraField3 = null;
  2296. if (selectPid && domainItem.extraField1) {
  2297. //是否非项目
  2298. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2299. console.log('==========','isPublic=='+isPublic);
  2300. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2301. console.log(filteredRespList);
  2302. domainItem.filteredRespList = filteredRespList;
  2303. }
  2304. },
  2305. getJobResponList() {
  2306. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2307. if (res.code == "ok") {
  2308. this.jobResponseList = res.data;
  2309. } else {
  2310. this.$message({
  2311. message: res.msg,
  2312. type: "error"
  2313. });
  2314. }
  2315. },error => {
  2316. this.$message({
  2317. message: error,
  2318. type: "error"
  2319. });
  2320. }
  2321. );
  2322. },
  2323. openModImportTime(row) {
  2324. this.showModImportTimeDialog = true;
  2325. this.modItemDataId = row.id;
  2326. },
  2327. delImportTime(row) {
  2328. let rowId = row.id;
  2329. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2330. confirmButtonText: this.$t('btn.determine'),
  2331. cancelButtonText: this.$t('btn.cancel'),
  2332. type: "warning"
  2333. })
  2334. .then(() => {
  2335. this.http.post('/report-import-log/delete',{
  2336. id: rowId
  2337. },res => {
  2338. if (res.code == "ok") {
  2339. this.$message({
  2340. message: '删除成功',
  2341. type: "success"
  2342. });
  2343. this.getToView();
  2344. } else {
  2345. this.$message({
  2346. message: res.msg,
  2347. type: "error"
  2348. });
  2349. }
  2350. },error => {
  2351. this.$message({
  2352. message: error,
  2353. type: "error"
  2354. });
  2355. }
  2356. );
  2357. }).catch(() => {this.startDeleting = false});
  2358. },
  2359. confirmChangeModTime() {
  2360. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2361. this.$message({
  2362. message: '请选择时间',
  2363. type: "error"
  2364. });
  2365. return;
  2366. }
  2367. this.http.post('/report-import-log/changeTime',{
  2368. modLogDateTime: this.modImportTime,
  2369. modImportUserId: this.modImportUserId,
  2370. id: this.modItemDataId
  2371. },res => {
  2372. if (res.code == "ok") {
  2373. this.$message({
  2374. message: '修改成功',
  2375. type: "success"
  2376. });
  2377. this.getToView();
  2378. this.showModImportTimeDialog = false;
  2379. } else {
  2380. this.$message({
  2381. message: res.msg,
  2382. type: "error"
  2383. });
  2384. }
  2385. },error => {
  2386. this.$message({
  2387. message: error,
  2388. type: "error"
  2389. });
  2390. }
  2391. );
  2392. },
  2393. confirmBatchApproveReport() {
  2394. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2395. this.$message({
  2396. message: '请选择日期范围',
  2397. type: "error"
  2398. });
  2399. return;
  2400. }
  2401. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2402. confirmButtonText: this.$t('btn.determine'),
  2403. cancelButtonText: this.$t('btn.cancel'),
  2404. type: "warning"
  2405. })
  2406. .then(() => {
  2407. this.startDeleting = true;
  2408. let obj = {
  2409. startDate: this.deleteReportParam.date[0],
  2410. endDate: this.deleteReportParam.date[1]
  2411. }
  2412. if(this.deleteReportParam.departmentId) {
  2413. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2414. } else {
  2415. obj.departmentId = null
  2416. }
  2417. this.http.post('/report/batchApproveByDate',obj,res => {
  2418. if (res.code == "ok") {
  2419. this.$message({
  2420. message: '审核通过',
  2421. type: "success"
  2422. });
  2423. this.getReportList();
  2424. this.getDepartment();
  2425. this.startDeleting = false;
  2426. } else {
  2427. this.$message({
  2428. message: res.msg,
  2429. type: "error"
  2430. });
  2431. }
  2432. },error => {
  2433. this.$message({
  2434. message: error,
  2435. type: "error"
  2436. });
  2437. }
  2438. );
  2439. }).catch(() => {this.startDeleting = false});
  2440. },
  2441. confirmBatchDelReport() {
  2442. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2443. this.$message({
  2444. message: '请选择部门或人员',
  2445. type: "error"
  2446. });
  2447. return;
  2448. }
  2449. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2450. this.$message({
  2451. message: '请选择日期范围',
  2452. type: "error"
  2453. });
  2454. return;
  2455. }
  2456. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2457. confirmButtonText: this.$t('btn.determine'),
  2458. cancelButtonText: this.$t('btn.cancel'),
  2459. type: "warning"
  2460. })
  2461. .then(() => {
  2462. this.startDeleting = true;
  2463. this.http.post('/report/batchDelete',{
  2464. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2465. startDate: this.deleteReportParam.date[0],
  2466. endDate: this.deleteReportParam.date[1],
  2467. deptId: this.deleteReportParam.deptId[0]
  2468. },res => {
  2469. if (res.code == "ok") {
  2470. this.$message({
  2471. message: this.$t('message.successfullyDeleted'),
  2472. type: "success"
  2473. });
  2474. this.getReportList();
  2475. this.getDepartment();
  2476. this.startDeleting = false;
  2477. } else {
  2478. this.$message({
  2479. message: res.msg,
  2480. type: "error"
  2481. });
  2482. }
  2483. },error => {
  2484. this.$message({
  2485. message: error,
  2486. type: "error"
  2487. });
  2488. }
  2489. );
  2490. }).catch(() => {this.startDeleting = false});
  2491. },
  2492. getRecentlyProject() {
  2493. this.http.post('/project/nearProject',{},res => {
  2494. if(res.code == 'ok'){
  2495. let topObj = {
  2496. label: '最近选择项目',
  2497. peojectList: res.data
  2498. }
  2499. let botomObj = {
  2500. label: '全部项目',
  2501. peojectList: this.fillProjectList
  2502. }
  2503. //最近项目如果在fillProjectList中不存在,需要移除
  2504. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2505. this.integrationProjectList = [topObj, botomObj]
  2506. }else {
  2507. this.$message({
  2508. message: res.msg,
  2509. type: 'error'
  2510. })
  2511. }
  2512. },err => {
  2513. this.$message({
  2514. message: err,
  2515. type: 'error'
  2516. })
  2517. })
  2518. },
  2519. handlePictureCardPreview(file, index) {
  2520. console.log(file, index)
  2521. let arr = []
  2522. let imgArr = this.workForm.domains[index].imgListUrl
  2523. for(var i in imgArr) {
  2524. arr.push(imgArr[i].url)
  2525. }
  2526. console.log(arr, '图片数据')
  2527. const $viewer = this.$viewerApi({
  2528. images: arr
  2529. });
  2530. },
  2531. // 图片上传
  2532. addImg(e, index) {
  2533. console.log(e, '数据')
  2534. let formData = new FormData()
  2535. formData.append('multipartFile', e.file)
  2536. this.http.uploadFile('/common/uploadFile', formData,
  2537. res => {
  2538. if (res.code == "ok") {
  2539. this.$message({
  2540. message: this.$t('uploadedsuccessfully'),
  2541. type: "success"
  2542. });
  2543. if(!this.workForm.domains[index].imgList) {
  2544. this.workForm.domains[index].imgList = []
  2545. this.workForm.domains[index].imgListUrl = []
  2546. }
  2547. this.workForm.domains[index].imgList.push(res.data)
  2548. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2549. } else {
  2550. this.$message({message: res.msg,type: "error"});
  2551. }
  2552. console.log(this.workForm.domains[index])
  2553. },
  2554. error => {this.$message({message: error,type: "error"});
  2555. });
  2556. },
  2557. // 删除图片
  2558. delImg(file,fileList, index) {
  2559. console.log(file, fileList)
  2560. let idx = 0
  2561. for(let i in fileList) {
  2562. if(fileList[i].uid == file.uid) {
  2563. idx = i
  2564. }
  2565. }
  2566. this.workForm.domains[index].imgList.splice(idx, 1)
  2567. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2568. console.log(this.workForm.domains[index])
  2569. },
  2570. test(){
  2571. console.log('test',this.workForm.domains);
  2572. },
  2573. getHour(s1, s2) {
  2574. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2575. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2576. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2577. var ms = s2.getTime() - s1.getTime();
  2578. if (ms < 0) return 0;
  2579. let ma = ms / 1000 / 60 / 60
  2580. return ma; //小时
  2581. },
  2582. refreshWXCardTime(workdate) {
  2583. if (!workdate) return;
  2584. this.syncTimeLoading = true;
  2585. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2586. date: workdate,
  2587. },res => {
  2588. this.syncTimeLoading = false;
  2589. if(res.code == 'ok'){
  2590. this.workForm.time = res.data.time;
  2591. }else {
  2592. this.$message({
  2593. message: res.msg,
  2594. type: 'error'
  2595. })
  2596. }
  2597. },err => {
  2598. this.syncTimeLoading = false;
  2599. this.$message({
  2600. message: err,
  2601. type: 'error'
  2602. })
  2603. })
  2604. },
  2605. refreshAttendance(workdate) {
  2606. if (!workdate) return;
  2607. this.syncTimeLoading = true;
  2608. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2609. startDate: workdate[0],
  2610. endDate: workdate[1]
  2611. },res => {
  2612. this.syncTimeLoading = false;
  2613. if(res.code == 'ok'){
  2614. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2615. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2616. this.totalReportHours = this.workTimeForMinYi;
  2617. }else {
  2618. this.$message({
  2619. message: res.msg,
  2620. type: 'error'
  2621. })
  2622. }
  2623. },err => {
  2624. this.syncTimeLoading = false;
  2625. this.$message({
  2626. message: err,
  2627. type: 'error'
  2628. })
  2629. })
  2630. },
  2631. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2632. this.weeklyFilledTimeDialog = true
  2633. this.weeklyFilledTimeLoading = true
  2634. this.weeklyFilledTimeDate = parameterDate
  2635. this.http.post('/report/getReportList',{
  2636. date: parameterDate,
  2637. userId: this.user.id
  2638. },res => {
  2639. this.weeklyFilledTimeLoading = false
  2640. if(res.code == 'ok'){
  2641. this.weeklyFilledTimeList = res.data[0].data
  2642. let candelete = true
  2643. for(let i in this.weeklyFilledTimeList){
  2644. if(this.weeklyFilledTimeList[i].state < 2){
  2645. candelete = false
  2646. }
  2647. }
  2648. this.weeklyFilledTimeCanDelete = candelete
  2649. }else {
  2650. this.$message({
  2651. message: res.msg,
  2652. type: 'error'
  2653. })
  2654. }
  2655. },err => {
  2656. this.weeklyFilledTimeLoading = false
  2657. this.$message({
  2658. message: err,
  2659. type: 'error'
  2660. })
  2661. })
  2662. },
  2663. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2664. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2665. confirmButtonText: this.$t('btn.determine'),
  2666. cancelButtonText: this.$t('btn.cancel'),
  2667. type: "warning"
  2668. })
  2669. .then(() => {
  2670. this.http.post('/report/delete',{
  2671. userId: this.user.id,
  2672. date: this.weeklyFilledTimeDate
  2673. },res => {
  2674. if (res.code == "ok") {
  2675. this.$message({
  2676. message: this.$t('message.successfullyDeleted'),
  2677. type: "success"
  2678. });
  2679. this.getWeeklyWorkTime()
  2680. this.getReportList();
  2681. this.getDepartment();
  2682. this.weeklyFilledTimeDialog = false;
  2683. } else {
  2684. this.$message({
  2685. message: res.msg,
  2686. type: "error"
  2687. });
  2688. }
  2689. },error => {
  2690. this.$message({
  2691. message: error,
  2692. type: "error"
  2693. });
  2694. }
  2695. );
  2696. }).catch(() => {});
  2697. },
  2698. getApprovalProcess(item){
  2699. // console.log('this.date',this.choseDate);
  2700. this.http.post('/report-log/get',{
  2701. creatorId: item.id,
  2702. createDate: sessionStorage.msg
  2703. },res => {
  2704. if(res.code == 'ok'){
  2705. this.approvalProcessDialog = true
  2706. if(this.user.userNameNeedTranslate == 1) {
  2707. for(var i in res.data) {
  2708. let obj = {
  2709. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2710. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2711. }
  2712. res.data[i].msgCon = obj
  2713. }
  2714. }
  2715. this.approvalProcessData = res.data
  2716. console.log(this.approvalProcessData, '数据卡看')
  2717. }else{
  2718. this.$message({
  2719. message: res.msg,
  2720. type: 'error'
  2721. })
  2722. }
  2723. },err => {
  2724. this.$message({
  2725. message: err,
  2726. type: 'error'
  2727. })
  2728. })
  2729. },
  2730. filterNode(value, data) {
  2731. if (!value) return true;
  2732. return data.label.indexOf(value) !== -1;
  2733. },
  2734. triggerCalculateOT(index) {
  2735. var str = this.workForm.domains[index].overtimeHours + ''
  2736. if(str.indexOf('.') != '-1') {
  2737. var s = str.split('.')[0]
  2738. var st = str.split('.')[1]
  2739. var sts = st.split('')
  2740. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2741. }
  2742. },
  2743. searchScreen(e){
  2744. if(e){
  2745. this.monthNotWorkDateS1 = []
  2746. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2747. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2748. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2749. }
  2750. }
  2751. if (this.monthNotWorkDateS1.length > 50) {
  2752. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2753. }else{
  2754. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2755. }
  2756. // if (this.monthNotWorkDateS1.length > 0) {
  2757. // setTimeout(() => {
  2758. // this.tableListenernot()
  2759. // }, 1000);
  2760. // }
  2761. }else{
  2762. this.monthWorkDataS1 = []
  2763. for (let i = 0; i < this.monthWorkData.length; i++) {
  2764. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2765. this.monthWorkDataS1.push(this.monthWorkData[i])
  2766. }
  2767. }
  2768. if (this.monthWorkDataS1.length > 50) {
  2769. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2770. }else{
  2771. this.monthWorkDataS = this.monthWorkDataS1
  2772. }
  2773. // if (this.monthWorkDataS1.length > 0) {
  2774. // setTimeout(() => {
  2775. // this.tableListener()
  2776. // }, 1000);
  2777. // }
  2778. }
  2779. },
  2780. addUpload(data) {
  2781. // var zhi = data.fileName.split('.')[0]
  2782. // var sss = zhi + '.xlsx'
  2783. // return
  2784. var filePath = '/upload/' + data.serverName;
  2785. const a = document.createElement('a'); // 创建a标签
  2786. a.setAttribute('download', data.fileName);// download属性
  2787. a.setAttribute('href', filePath);// href链接
  2788. a.click(); //自执行点击事件
  2789. a.remove();
  2790. },
  2791. restrictNumber(targetId) {
  2792. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2793. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2794. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2795. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2796. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2797. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2798. inpu.value = parseFloat(inpu.value);
  2799. }
  2800. },
  2801. //获取项目下的任务分组
  2802. getTaskGroups(domain, index) {
  2803. domain.groupId=null;
  2804. this.http.post('/task-group/listMyJoinGroup',{
  2805. projectId: domain.projectId,
  2806. isSubstitude: this.isSubstitude ? 1 : 0
  2807. },
  2808. res => {
  2809. if (res.code == "ok") {
  2810. this.workForm.domains[index].taskGroups = res.data;
  2811. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2812. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2813. // this.getGroupStages(domain, index);
  2814. // }
  2815. this.$forceUpdate();
  2816. }
  2817. },
  2818. error => {
  2819. this.$message({
  2820. message: error,
  2821. type: "error"
  2822. });
  2823. }
  2824. );
  2825. },
  2826. //下载填报工时占比报表
  2827. downloadProjectRatio() {
  2828. this.exportUserRatio = true;
  2829. // let now = new Date();
  2830. // let month = now.getMonth();//默认看上个月的
  2831. // let monthStr = month<10? ('0'+month): month;
  2832. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2833. const today = new Date();
  2834. const year = today.getFullYear();
  2835. const month = today.getMonth() + 1;
  2836. let lastMonthYear, lastMonth;
  2837. if (month === 1) {
  2838. lastMonthYear = year - 1;
  2839. lastMonth = 12;
  2840. } else {
  2841. lastMonthYear = year;
  2842. lastMonth = month - 1;
  2843. }
  2844. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2845. console.log('赋值 ==>', this.ratioYmonth)
  2846. },
  2847. confirmDownloadRatio() {
  2848. this.startRatioExporting = true;
  2849. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2850. ymonth: this.ratioYmonth
  2851. },
  2852. res => {
  2853. if (res.code == "ok") {
  2854. this.startRatioExporting = false;
  2855. var filePath = res.data;
  2856. const a = document.createElement('a'); // 创建a标签
  2857. var data = filePath.split("/");
  2858. a.setAttribute('download', data[data.length-1]);// download属性
  2859. a.setAttribute('href', filePath);// href链接
  2860. a.click(); //自执行点击事件
  2861. a.remove();
  2862. } else {
  2863. this.startRatioExporting = false;
  2864. this.$message({
  2865. message: res.msg,
  2866. type: "error"
  2867. });
  2868. }
  2869. },
  2870. error => {
  2871. this.checkinLoading = false;
  2872. this.$message({
  2873. message: error,
  2874. type: "error"
  2875. });
  2876. }
  2877. );
  2878. },
  2879. //下载带企业微信考勤数据的工时统计模板
  2880. downloadCheckInExcel() {
  2881. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2882. startDate: this.importWxParam.date[0],
  2883. endDate: this.importWxParam.date[1],
  2884. },
  2885. res => {
  2886. if (res.code == "ok") {
  2887. var filePath = res.data;
  2888. const a = document.createElement('a'); // 创建a标签
  2889. var data = filePath.split("/");
  2890. a.setAttribute('download', data[data.length-1]);// download属性
  2891. a.setAttribute('href', filePath);// href链接
  2892. a.click(); //自执行点击事件
  2893. a.remove();
  2894. } else {
  2895. this.$message({
  2896. message: res.msg,
  2897. type: "error"
  2898. });
  2899. }
  2900. },
  2901. error => {
  2902. this.checkinLoading = false;
  2903. this.$message({
  2904. message: error,
  2905. type: "error"
  2906. });
  2907. }
  2908. );
  2909. },
  2910. pre() {
  2911. if (this.active == 0) return;
  2912. this.active--;
  2913. },
  2914. next() {
  2915. this.active++;
  2916. },
  2917. triggerTotalTime(index) {
  2918. var item = this.checkinList[index];
  2919. var total = 0.0;
  2920. for (var i=0;i<this.projectColumns.length; i++) {
  2921. var key = this.projectColumns[i];
  2922. if (item[key] != null && item[key] != '') {
  2923. total += parseFloat(item[key]);
  2924. }
  2925. }
  2926. item.totalFillTime = total;
  2927. },
  2928. //提交批量代填的数据
  2929. submitBatchSubFillData() {
  2930. var data = JSON.stringify(this.checkinList);
  2931. this.http.post('/user-corpwx-time/submitProjectTime',{
  2932. json: data,
  2933. projectColumns: JSON.stringify(this.projectColumns)
  2934. },
  2935. res => {
  2936. if (res.code == "ok") {
  2937. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2938. this.importWxDialog = false;
  2939. }
  2940. },
  2941. error => {
  2942. this.checkinLoading = false;
  2943. this.$message({
  2944. message: error,
  2945. type: "error"
  2946. });
  2947. }
  2948. );
  2949. },
  2950. loadCheckInData() {
  2951. if (this.importWxParam.date == null) {
  2952. this.checkinList = [];
  2953. return;
  2954. }
  2955. this.checkinLoading = true;
  2956. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2957. startDate: this.importWxParam.date[0],
  2958. endDate: this.importWxParam.date[1],
  2959. },
  2960. res => {
  2961. if (res.code == "ok") {
  2962. this.checkinLoading = false;
  2963. this.checkinList = res.data.list;
  2964. this.projectColumns = res.data.projects;
  2965. // 自定义表格会导致表格错乱,需重新计算表格
  2966. this.$nextTick(()=>{
  2967. this.$refs.tab.doLayout()
  2968. })
  2969. }
  2970. },
  2971. error => {
  2972. this.checkinLoading = false;
  2973. this.$message({
  2974. message: error,
  2975. type: "error"
  2976. });
  2977. }
  2978. );
  2979. },
  2980. importCardTime(item) {
  2981. //首先判断文件类型
  2982. let str = item.file.name.split(".");
  2983. let format = str[str.length - 1];
  2984. if (format != "xls" && format != "xlsx") {
  2985. this.$message({
  2986. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2987. type: "error"
  2988. });
  2989. } else {
  2990. this.importingData = true;
  2991. let formData = new FormData();
  2992. formData.append("multipartFile", item.file);
  2993. formData.append("companyId", this.user.companyId);
  2994. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  2995. res => {
  2996. this.$refs.uploadCardTime.clearFiles();
  2997. this.importingData = false;
  2998. if (res.code == "ok") {
  2999. //换成弹出框,以免有人等了半天回来啥也没看到
  3000. this.$message({
  3001. message: '导入考勤时长成功',
  3002. type: "success"
  3003. });
  3004. } else {
  3005. this.$message({
  3006. message: res.msg,
  3007. type: "error"
  3008. });
  3009. }
  3010. },
  3011. error => {
  3012. this.$refs.upload.clearFiles();
  3013. this.listLoading = false;
  3014. this.$message({
  3015. message: error,
  3016. type: "error"
  3017. });
  3018. });
  3019. }
  3020. },
  3021. batchImportWxData(item) {
  3022. //首先判断文件类型
  3023. let str = item.file.name.split(".");
  3024. let format = str[str.length - 1];
  3025. if (format != "xls" && format != "xlsx") {
  3026. this.$message({
  3027. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3028. type: "error"
  3029. });
  3030. } else {
  3031. this.importingData = true;
  3032. let formData = new FormData();
  3033. formData.append("file", item.file);
  3034. formData.append("companyId", this.user.companyId);
  3035. formData.append("withCheckIn", 1);
  3036. this.http.uploadFile('/report/importData', formData,
  3037. res => {
  3038. this.$refs.upload.clearFiles();
  3039. this.showImportResult = true;
  3040. this.importingData = false;
  3041. if (res.code == "ok") {
  3042. //换成弹出框,以免有人等了半天回来啥也没看到
  3043. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3044. this.getReportList();
  3045. this.importWxDialog = false;
  3046. } else {
  3047. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3048. }
  3049. },
  3050. error => {
  3051. this.$refs.upload.clearFiles();
  3052. this.listLoading = false;
  3053. this.$message({
  3054. message: error,
  3055. type: "error"
  3056. });
  3057. });
  3058. }
  3059. },
  3060. batchImportData(item) {
  3061. //首先判断文件类型
  3062. let str = item.file.name.split(".");
  3063. let format = str[str.length - 1];
  3064. if (format != "xls" && format != "xlsx") {
  3065. this.$message({
  3066. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3067. type: "error"
  3068. });
  3069. } else {
  3070. this.importingData = true;
  3071. let formData = new FormData();
  3072. formData.append("file", item.file);
  3073. formData.append("companyId", this.user.companyId);
  3074. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3075. this.http.uploadFile(url, formData,
  3076. res => {
  3077. this.$refs.upload.clearFiles();
  3078. this.importingData = false;
  3079. this.showImportResult = true;
  3080. if (res.code == "ok") {
  3081. //换成弹出框,以免有人等了半天回来啥也没看到
  3082. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3083. this.getReportList();
  3084. this.importWXDialog = false;
  3085. } else {
  3086. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3087. }
  3088. },
  3089. error => {
  3090. this.$refs.upload.clearFiles();
  3091. this.importingData = false;
  3092. this.$message({
  3093. message: error,
  3094. type: "error"
  3095. });
  3096. });
  3097. }
  3098. },
  3099. userssHu() {
  3100. this.http.post('/time-type/getCompanyTimeSetting',{
  3101. companyId: this.user.companyId
  3102. },
  3103. res => {
  3104. if (res.code == "ok") {
  3105. this.yonghuUser = res.data
  3106. }
  3107. },
  3108. error => {
  3109. this.$message({
  3110. message: error,
  3111. type: "error"
  3112. });
  3113. }
  3114. );
  3115. },
  3116. iptBlur(i) {
  3117. if(this.isBatch == 0) {
  3118. return
  3119. }
  3120. this.http.post('/report/getWorkDays',{
  3121. startDate: this.workForm.createDate[0],
  3122. endDate: this.workForm.createDate[1]
  3123. },
  3124. res => {
  3125. if (res.code == "ok") {
  3126. this.jsDay = res.data
  3127. this.chuji(i)
  3128. } else {
  3129. this.$message({
  3130. message: res.msg,
  3131. type: "error"
  3132. });
  3133. }
  3134. },
  3135. error => {
  3136. this.$message({
  3137. message: error,
  3138. type: "error"
  3139. });
  3140. }
  3141. );
  3142. //明夷硬编码获取
  3143. if (this.user.company.companyName == this.mingyiName) {
  3144. this.getWorkTimeForMinYi();
  3145. }
  3146. },
  3147. getWorkTimeForMinYi(){
  3148. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3149. startDate: this.workForm.createDate[0],
  3150. endDate: this.workForm.createDate[1]
  3151. },
  3152. res => {
  3153. if (res.code == "ok") {
  3154. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3155. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3156. this.totalReportHours = this.workTimeForMinYi;
  3157. } else {
  3158. this.$message({
  3159. message: res.msg,
  3160. type: "error"
  3161. });
  3162. this.workForm.createDate = [];
  3163. }
  3164. },
  3165. error => {
  3166. this.$message({
  3167. message: error,
  3168. type: "error"
  3169. });
  3170. }
  3171. );
  3172. },
  3173. chuji(i) {
  3174. if(i == 0) {
  3175. this.seleChn(1)
  3176. } else if(i == 1) {
  3177. this.seleChn(0)
  3178. } else if(i == 2) {
  3179. if(this.workForm.domains[0].multiWorktime > 0) {
  3180. this.iptChangs()
  3181. } else {
  3182. this.iptChang()
  3183. }
  3184. } else if(i == 3) {
  3185. this.seleChn(0)
  3186. }
  3187. },
  3188. seleChn(e,domain) {
  3189. if(e == 1) {
  3190. for(var i in this.workForm.domains) {
  3191. if(this.workForm.domains[i].timeType == 0) {
  3192. this.workForm.domains[i].workingTime = 8
  3193. } else {
  3194. this.workForm.domains[i].workingTime = 4
  3195. }
  3196. }
  3197. }
  3198. var quanbu = 0
  3199. var spl = this.workForm.domains
  3200. var zhi = ''
  3201. for(var i in spl) {
  3202. var sp = +spl[i].workingTime + 0
  3203. zhi = this.jsDay * sp
  3204. quanbu = +quanbu + zhi
  3205. }
  3206. this.jsTime = quanbu
  3207. this.totalReportHours = quanbu
  3208. let worktime = this.jsTime
  3209. // 自动计算加班时长
  3210. if(this.isBatch != 0){
  3211. worktime = this.jsTime / this.jsDay
  3212. }
  3213. if(this.user.timeType.fillOvertime && domain){
  3214. let isover = false
  3215. let alltime = 0
  3216. let allover = 0 //此处alltime同上面的worktime
  3217. for(let d in spl){
  3218. if(spl[d].isOvertime){
  3219. isover = true
  3220. allover += spl[d].overtimeHours*1
  3221. }
  3222. alltime += spl[d].workingTime*1
  3223. }
  3224. if(domain.overtimeHours){
  3225. allover = allover - domain.overtimeHours
  3226. }
  3227. if(worktime*1 > this.user.timeType.allday){
  3228. if(isover){
  3229. if(alltime > (allover + this.user.timeType.allday)){
  3230. this.$set(domain,'isOvertime',true)
  3231. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3232. }else{
  3233. this.$set(domain,'isOvertime',false)
  3234. this.$set(domain,'overtimeHours',null)
  3235. if(alltime < (allover + this.user.timeType.allday)){
  3236. let overtime = allover + this.user.timeType.allday - alltime
  3237. for(let pi in spl){
  3238. if(spl[pi].overtimeHours){
  3239. if((overtime - spl[pi].overtimeHours*1) > 0){
  3240. overtime = overtime - spl[pi].overtimeHours*1
  3241. this.$set(spl[pi],'isOvertime',false)
  3242. this.$set(spl[pi],'overtimeHours',null)
  3243. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3244. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3245. break
  3246. }else{
  3247. this.$set(spl[pi],'isOvertime',false)
  3248. this.$set(spl[pi],'overtimeHours',null)
  3249. break
  3250. }
  3251. }
  3252. }
  3253. }
  3254. }
  3255. }else{
  3256. this.$set(domain,'isOvertime',true)
  3257. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3258. }
  3259. }else{
  3260. for(let di in spl){
  3261. this.$set(spl[di],'isOvertime',false)
  3262. this.$set(spl[di],'overtimeHours',null)
  3263. }
  3264. }
  3265. }
  3266. },
  3267. iptChang() {
  3268. var sl = this.workForm.domains
  3269. let timeArr = []
  3270. for(var i in sl) {
  3271. if(sl[i].startTime && sl[i].endTime) {
  3272. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3273. }
  3274. }
  3275. this.getTimeHours(timeArr)
  3276. // for(let j in arrNum) {
  3277. // this.timeJsonStr += arrNum[j]
  3278. // if(flg) {
  3279. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3280. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3281. // }
  3282. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3283. // flg = true
  3284. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3285. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3286. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3287. // }
  3288. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3289. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3290. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3291. // }
  3292. // }
  3293. },
  3294. iptChangs() {
  3295. var sl = this.workForm.domains
  3296. let timeArr = []
  3297. for(var i in sl) {
  3298. for(var j in sl[i].worktimeList){
  3299. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3300. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3301. }
  3302. }
  3303. }
  3304. this.getTimeHours(timeArr)
  3305. },
  3306. // 调用接口或去数据
  3307. getTimeHours(arr) {
  3308. this.http.post('/report/getHoursByTimeRange',{
  3309. timeJsonStr: JSON.stringify(arr)
  3310. },res => {
  3311. if(res.code === 'ok') {
  3312. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3313. } else {
  3314. this.$message({
  3315. message: res.msg,
  3316. type: 'error'
  3317. })
  3318. }
  3319. },err => {
  3320. this.$message({
  3321. message: err,
  3322. type: 'error'
  3323. })
  3324. })
  3325. },
  3326. // 按周填报调用接口计算时间
  3327. async getWeekHoursByTimeRange(timeRange) {
  3328. const url = '/report/getHoursByTimeRange';
  3329. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3330. var that = this;
  3331. return new Promise((resolve, reject) => {
  3332. this.http.post(url, data, function(res) {
  3333. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3334. }, function(err) {
  3335. reject(err);
  3336. });
  3337. });
  3338. },
  3339. removeTimeItem(item, index) {
  3340. item.worktimeList.splice(index, 1);
  3341. this.iptChangs()
  3342. },
  3343. //添加工时
  3344. addNewWorktime(index, item) {
  3345. if(item.worktimeList == null ) {
  3346. item.worktimeList = []
  3347. }
  3348. item.worktimeList.push({});
  3349. },
  3350. //复制项目
  3351. copyProject(index) {
  3352. var leftProgress = 10;
  3353. if (this.reportTimeType.type == 3) {
  3354. //计算已经待分配工时比例
  3355. let array = this.workForm.domains;
  3356. let totalProgress = 0;
  3357. for (var i=0;i<array.length; i++) {
  3358. totalProgress += array[i].progress;
  3359. }
  3360. if (totalProgress < 100) {
  3361. leftProgress = 100 - totalProgress;
  3362. }
  3363. }
  3364. var newIndex = index+1;
  3365. var itemDomain = {
  3366. projectId: this.workForm.domains[index].projectId,
  3367. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3368. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3369. ),
  3370. content: "",
  3371. progress:leftProgress,
  3372. state:2,//2-表示待提交
  3373. };
  3374. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3375. if (this.reportTimeType.type == 0) {
  3376. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3377. var length = this.workForm.domains.length;
  3378. if (length == 2) {
  3379. this.showAddMore = false;
  3380. }
  3381. }
  3382. this.selectProject(itemDomain, newIndex);
  3383. },
  3384. pushWorkTime(){
  3385. let url=''
  3386. if(this.user.timeType.syncSap == 1){
  3387. url='/report/pushProjectReportToSap'
  3388. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3389. var pushDate = this.date + day;
  3390. this.$confirm('确认推送'+pushDate+'的工时?', '提示', {
  3391. confirmButtonText: '确定',
  3392. cancelButtonText: '取消',
  3393. type: 'info'
  3394. }).then(() => {
  3395. const loading = this.$loading({
  3396. lock: true,
  3397. text: '正在推送中,请耐心等待。',
  3398. spinner: 'el-icon-loading',
  3399. background: 'rgba(0, 0, 0, 0.7)'
  3400. });
  3401. this.http.post(url,{
  3402. pushDate: pushDate
  3403. },res => {
  3404. loading.close();
  3405. if(res.code == 'ok'){
  3406. this.$message({
  3407. type: 'success',
  3408. message: res.data
  3409. });
  3410. }else{
  3411. this.$message({
  3412. type: 'error',
  3413. message: res.msg
  3414. })
  3415. }
  3416. },err => {
  3417. loading.close();
  3418. this.$message({
  3419. type: 'error',
  3420. message: err
  3421. })
  3422. })
  3423. }).catch(() => {
  3424. });
  3425. }else{
  3426. url='/report/pushReportDataToThird'
  3427. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3428. confirmButtonText: '确定',
  3429. cancelButtonText: '取消',
  3430. type: 'info'
  3431. }).then(() => {
  3432. const loading = this.$loading({
  3433. lock: true,
  3434. text: '正在推送中,请耐心等待。',
  3435. spinner: 'el-icon-loading',
  3436. background: 'rgba(0, 0, 0, 0.7)'
  3437. });
  3438. this.http.post(url,{
  3439. yearMonth: this.date
  3440. },res => {
  3441. loading.close();
  3442. if(res.code == 'ok'){
  3443. this.$message({
  3444. type: 'success',
  3445. message: '推送成功!'
  3446. });
  3447. }else{
  3448. this.$message({
  3449. type: 'error',
  3450. message: res.msg
  3451. })
  3452. }
  3453. },err => {
  3454. loading.close();
  3455. this.$message({
  3456. type: 'error',
  3457. message: err
  3458. })
  3459. })
  3460. }).catch(() => {
  3461. });
  3462. }
  3463. },
  3464. showWorkTime(){
  3465. this.monthWorkTimeDialog = true;
  3466. this.searchKeyword = ''
  3467. this.WorktimeDatepickValue = this.istoMonth()
  3468. if(this.WorktimeDatepickValue.length == 0){
  3469. let newdate = new Date();
  3470. let nowdate = newdate.toLocaleDateString();
  3471. let getauto = this.getAutoWeekDate(nowdate)
  3472. let nowwd = [getauto[0],getauto[6]]
  3473. this.WorktimeDatepickValue = nowwd
  3474. }
  3475. this.showMonthWorkTime()
  3476. },
  3477. handleClick(t,e){
  3478. if (t.name == "first") {
  3479. this.showMonthWorkTime()
  3480. }else{
  3481. this.showMonthNotWorkTime()
  3482. }
  3483. },
  3484. //导出员工每日填报工时数
  3485. exportMembWorkHours() {
  3486. this.http.post(
  3487. "/report/exportUserDailyWorkTime",
  3488. {
  3489. // month: this.date,
  3490. startDate: this.WorktimeDatepickValue[0],
  3491. endDate: this.WorktimeDatepickValue[1],
  3492. },
  3493. (res) => {
  3494. if (res.code == "ok") {
  3495. let url = res.data;
  3496. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3497. }
  3498. },
  3499. (error) => {
  3500. this.$message({
  3501. message: error,
  3502. type: "error",
  3503. });
  3504. }
  3505. );
  3506. },
  3507. exportMembNotWorkHours() {
  3508. this.http.post(
  3509. "/report/exportNoReportUserList",
  3510. {
  3511. // month: this.date,
  3512. startDate: this.WorktimeDatepickValue[0],
  3513. endDate: this.WorktimeDatepickValue[1],
  3514. },
  3515. (res) => {
  3516. if (res.code == "ok") {
  3517. let url = res.data;
  3518. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3519. }
  3520. },
  3521. (error) => {
  3522. this.$message({
  3523. message: error,
  3524. type: "error",
  3525. });
  3526. }
  3527. );
  3528. },
  3529. downloadByA(name, url) {
  3530. const a = document.createElement("a"); // 创建a标签
  3531. a.setAttribute("download", name); // download属性
  3532. a.setAttribute("href", url); // href链接
  3533. a.click(); // 自执行点击事件
  3534. a.remove();
  3535. },
  3536. // 是否本月判断
  3537. istoMonth(){
  3538. let todate = new Date()
  3539. let tomonth = todate.getMonth() + 1
  3540. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3541. if(this.date == adate){
  3542. return []
  3543. }else{
  3544. let sedate = new Date(this.date)
  3545. let semonth = sedate.getMonth() + 1
  3546. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3547. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3548. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3549. return [sedates1, sedates2]
  3550. }
  3551. },
  3552. showMonthWorkTime() {
  3553. this.monthTotalPage = 0,
  3554. this.tbload = true
  3555. this.http.post(
  3556. "/report/getUserDailyWorkTime",
  3557. // "/report/getNoReportUserList",
  3558. {
  3559. // month: this.date,
  3560. startDate: this.WorktimeDatepickValue[0],
  3561. endDate: this.WorktimeDatepickValue[1],
  3562. },
  3563. (res) => {
  3564. if (res.code == "ok") {
  3565. this.tbload = false;
  3566. this.pickDateArray = res.data.days;
  3567. // console.log('dataarray',res.data.days);
  3568. this.monthWorkData = res.data.list;
  3569. // this.monthWorkDataS = this.monthWorkData
  3570. // this.monthWorkDataS1 = res.data.list
  3571. this.monthTotal = res.data.list.length
  3572. if (this.monthWorkData.length > 50) {
  3573. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3574. }else{
  3575. this.monthWorkDataS = this.monthWorkData
  3576. }
  3577. this.searchScreen(0)
  3578. // this.monthWorkDataS = infoList
  3579. // 判断
  3580. // if (this.monthWorkDataS1.length > 0) {
  3581. // setTimeout(() => {
  3582. // this.tableListener()
  3583. // }, 1000);
  3584. // }
  3585. this.$nextTick(function(){
  3586. this.$refs.hasworkTbl.doLayout();
  3587. });
  3588. // this.$forceUpdate()
  3589. }
  3590. },
  3591. (error) => {
  3592. this.tbload = false
  3593. this.$message({
  3594. message: error,
  3595. type: "error",
  3596. });
  3597. }
  3598. );
  3599. },
  3600. // tableListener(){
  3601. // let that = this;
  3602. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3603. // // 添加scroll监听事件
  3604. // dom.addEventListener("scroll", function () {
  3605. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3606. // if (scrollDistance < 2) {
  3607. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3608. // that.monthTotalPage++; //当前页数自增
  3609. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3610. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3611. // var infoList = arrList.splice(
  3612. // that.monthTotalPage * that.monthTotalLages,
  3613. // that.monthTotalLages
  3614. // );
  3615. // // 数据添加
  3616. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3617. // }
  3618. // }
  3619. // })
  3620. // },
  3621. showMonthNotWorkTime() {
  3622. this.monthTotalPage = 0,
  3623. this.tbload = true,
  3624. this.http.post(
  3625. "/report/getNoReportUserList",
  3626. {
  3627. startDate: this.WorktimeDatepickValue[0],
  3628. endDate: this.WorktimeDatepickValue[1],
  3629. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3630. },
  3631. (res) => {
  3632. if (res.code == "ok") {
  3633. this.tbload = false
  3634. this.monthNotWorkDate = res.data;
  3635. // this.monthNotWorkDateS1 = res.data
  3636. this.monthnotTotal = res.data.length
  3637. // 2222111
  3638. if (this.monthNotWorkDate.length > 50) {
  3639. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3640. } else {
  3641. this.monthNotWorkDateS = this.monthNotWorkDate
  3642. }
  3643. this.searchScreen(1)
  3644. // 判断
  3645. // if (this.monthnotworkDateS1.length > 0) {
  3646. // setTimeout(() => {
  3647. // this.tableListenernot()
  3648. // }, 1000);
  3649. // }
  3650. this.$nextTick(function(){
  3651. this.$refs.hasworkTbl2.doLayout();
  3652. });
  3653. }
  3654. },
  3655. (error) => {
  3656. this.tbload = false
  3657. this.$message({
  3658. message: error,
  3659. type: "error",
  3660. });
  3661. }
  3662. );
  3663. },
  3664. // tableListenernot(){
  3665. // let that = this;
  3666. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3667. // dom.addEventListener("scroll", function () {
  3668. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3669. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3670. // if (scrollDistance2 < 2) {
  3671. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3672. // that.monthnotTotalPage++; //当前页数自增
  3673. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3674. // var infoList = arrList.splice(
  3675. // that.monthnotTotalPage * that.monthnotTotalLages,
  3676. // that.monthnotTotalLages
  3677. // );
  3678. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3679. // }
  3680. // }
  3681. // })
  3682. // },
  3683. listScroll(){
  3684. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3685. this.isMore = true
  3686. setTimeout(()=>{
  3687. this.isMore = false
  3688. },1000)
  3689. }else {
  3690. this.isFlag = true
  3691. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3692. this.monthWorkDataS = datalist
  3693. setTimeout(()=>{
  3694. this.isFlag = false
  3695. },300)
  3696. }
  3697. },
  3698. notListScroll(){
  3699. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3700. this.isMore = true
  3701. setTimeout(()=>{
  3702. this.isMore = false
  3703. },1000)
  3704. }else {
  3705. this.isFlag = true
  3706. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3707. this.monthNotWorkDateS = datalist
  3708. // console.log('length',this.monthNotWorkDateS.length)
  3709. setTimeout(()=>{
  3710. this.isFlag = false
  3711. },300)
  3712. }
  3713. },
  3714. // 获取默认这zhou日期参数 222
  3715. getLastWeek(e){
  3716. let newdate = new Date()
  3717. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3718. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3719. if(e){
  3720. this.WorktimeDatepickValue = lastwd
  3721. this.showMonthWorkTime()
  3722. }else{
  3723. this.WorktimeDatepickValue = lastwd
  3724. this.showMonthNotWorkTime()
  3725. }
  3726. },
  3727. getThisWeek(e){
  3728. let newdate = new Date();
  3729. let nowdate = newdate.toLocaleDateString();
  3730. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3731. if(e){
  3732. this.WorktimeDatepickValue = nowwd
  3733. this.showMonthWorkTime()
  3734. }else{
  3735. this.WorktimeDatepickValue = nowwd
  3736. this.showMonthNotWorkTime()
  3737. }
  3738. },
  3739. getDoubleLastWeek(e){
  3740. let newdate = new Date()
  3741. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3742. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3743. if(e){
  3744. this.WorktimeDatepickValue = nextwd
  3745. this.showMonthWorkTime()
  3746. }else{
  3747. this.WorktimeDatepickValue = nextwd
  3748. this.showMonthNotWorkTime()
  3749. }
  3750. },
  3751. alreadyAllDate(stime,etime){
  3752. let diffdate = new Array();
  3753. let i=0;
  3754. while(stime<=etime){
  3755. let dateArray = stime.split("-");
  3756. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3757. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3758. let stimewk = this.weekDay[date.getDay()]
  3759. 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')
  3760. 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])
  3761. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3762. let stime_ts = new Date(stime).getTime();
  3763. let next_date = stime_ts + (24*60*60*1000);
  3764. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3765. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3766. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3767. stime = next_dates_y+next_dates_m+next_dates_d;
  3768. i++;
  3769. }
  3770. return diffdate
  3771. },
  3772. getAutoWeekDate(e) {
  3773. let dateString = e;
  3774. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3775. if (dateString.match(dateStringReg)) {
  3776. let presentDate = new Date(dateString),
  3777. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3778. return Array.from(new Array(7), function (val, index) {
  3779. let formatDate = new Date(
  3780. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3781. );
  3782. return (
  3783. formatDate.getFullYear() +
  3784. "-" +
  3785. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3786. "-" +
  3787. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3788. );
  3789. });
  3790. } else {
  3791. throw new Error(
  3792. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3793. );
  3794. }
  3795. },
  3796. onProgressChange() {
  3797. this.$forceUpdate();
  3798. },
  3799. showChooseMembTree() {
  3800. this.chosenMembCount = this.participator.length;
  3801. this.chooseParticipVisible = true;
  3802. },
  3803. onTreeItemChange() {
  3804. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3805. var list = chosenList.filter(item=>item.isUser == 1);
  3806. this.chosenMembCount = list.length;
  3807. },
  3808. findUserInTree() {
  3809. if (this.filterName == '') {
  3810. this.deptMembData = this.allMembData;
  3811. } else {
  3812. var list = this.findRecursively(this.filterName, this.allMembData);
  3813. this.deptMembData = list;
  3814. }
  3815. },
  3816. findRecursively(username, list) {
  3817. var filterList = [];
  3818. for (var i=0;i<list.length; i++) {
  3819. if (list[i].isUser == 1) {
  3820. if (list[i].label.indexOf(username) >= 0) {
  3821. //匹配上了
  3822. filterList.push(list[i]);
  3823. }
  3824. } else if (list[i].children != null && list[i].children.length > 0) {
  3825. var subList = this.findRecursively(username, list[i].children);
  3826. if (subList.length > 0) {
  3827. subList.forEach(s=>filterList.push(s));
  3828. }
  3829. }
  3830. }
  3831. return filterList;
  3832. },
  3833. //确定选择参与人
  3834. chooseParticip() {
  3835. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3836. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3837. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3838. if (this.user.company.packageProject == 1) {
  3839. if (this.chosenMembList.length > 1) {
  3840. this.$message({
  3841. message: '每次仅支持代填一个人',
  3842. type: "error",
  3843. });
  3844. return;
  3845. }
  3846. }
  3847. this.chooseParticipVisible = false;
  3848. this.workForm.userNames = '';
  3849. this.workForm.userId = [];
  3850. this.participator = [];
  3851. for (var i=0;i<this.chosenMembList.length; i++) {
  3852. this.workForm.userId.push(this.chosenMembList[i].id);
  3853. this.workForm.userNames += this.chosenMembList[i].label+',';
  3854. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3855. this.participator.push(item);
  3856. }
  3857. if (this.workForm.userNames.length > 0) {
  3858. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3859. }
  3860. if(this.user.userNameNeedTranslate == 1) {
  3861. if(this.workForm.userNames) {
  3862. this.workForm.userNames = this.workForm.userNames.split(',')
  3863. }
  3864. }
  3865. },
  3866. notifySel(sel){
  3867. // console.log(sel);
  3868. this.notifySelList = sel
  3869. },
  3870. //微信通知人员填写
  3871. Notify(code) {
  3872. if (this.notifySelList.length == 0) return;
  3873. var ids = '';
  3874. this.notifySelList.forEach(f=>{
  3875. ids += f.id+',';
  3876. })
  3877. this.http.post('/user/pushFillReport',{
  3878. ids: ids, date: this.curDate,
  3879. code: code
  3880. },
  3881. res => {
  3882. if (res.code == "ok") {
  3883. this.$message({
  3884. message: this.$t('message.sentSuccessfully'),
  3885. type: "success"
  3886. });
  3887. }
  3888. },
  3889. error => {
  3890. this.$message({
  3891. message: error,
  3892. type: "error"
  3893. });
  3894. }
  3895. );
  3896. },
  3897. //导出人员列表
  3898. exportMemb() {
  3899. if (this.fillMembList.length == 0) return;
  3900. var ids = '';
  3901. this.fillMembList.forEach(f=>{
  3902. ids += f.id+',';
  3903. })
  3904. this.http.post('/user/exportMembList',{
  3905. ids: ids,isFill: this.isFill, date: this.curDate
  3906. },
  3907. res => {
  3908. if (res.code == "ok") {
  3909. var aTag = document.createElement('a');
  3910. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3911. aTag.href = res.data;
  3912. aTag.click();
  3913. }
  3914. },
  3915. error => {
  3916. this.$message({
  3917. message: error,
  3918. type: "error"
  3919. });
  3920. }
  3921. );
  3922. },
  3923. showMembList(fill) {
  3924. this.membListVisible = true;
  3925. if (fill == 0) {
  3926. this.fillMembList = this.unFillList;
  3927. this.isFill = false;
  3928. let leaveList = []
  3929. let unleaveList = []
  3930. for(let i in this.fillMembList){
  3931. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3932. leaveList.push(this.fillMembList[i])
  3933. }else{
  3934. unleaveList.push(this.fillMembList[i])
  3935. }
  3936. }
  3937. this.fillMembList = unleaveList
  3938. this.fillMembList_leave = leaveList
  3939. } else if(fill == 1){
  3940. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3941. this.isFill = true;
  3942. }else{
  3943. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3944. this.isFill = true;
  3945. }
  3946. },
  3947. //获取自己填写的日报状态
  3948. getReportFillStatus() {
  3949. this.http.post('/report/getReportFillStatus',{
  3950. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3951. },
  3952. res => {
  3953. if (res.code == "ok") {
  3954. this.fillStatusList = res.data;
  3955. this.allDate.forEach(d=>{
  3956. var fillInfo = null;
  3957. d.state = null;
  3958. this.fillStatusList.forEach(s=>{
  3959. // console.log(d)
  3960. var d1 = s.createDate.split('-')[2];
  3961. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  3962. // console.log(d2, '我被执行了')
  3963. if (d1.indexOf('0') == 0) {
  3964. d1 = d1.substring(1,d1.length);
  3965. }
  3966. if (d1 == d2) {
  3967. d.state = s.state;
  3968. }
  3969. })
  3970. })
  3971. this.$forceUpdate();
  3972. }
  3973. },
  3974. error => {
  3975. this.$message({
  3976. message: error,
  3977. type: "error"
  3978. });
  3979. }
  3980. );
  3981. },
  3982. scrollFunction () {
  3983. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  3984. if (this.domObj.attachEvent) { // IE
  3985. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  3986. } else if (this.domObj.addEventListener) {
  3987. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  3988. }
  3989. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  3990. },
  3991. mouseScroll(event) { // google 浏览器下
  3992. let detail = event.wheelDelta || event.detail
  3993. let moveForwardStep = -1
  3994. let moveBackStep = 1
  3995. let step = 0
  3996. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  3997. event.preventDefault() // 阻止浏览器默认事件
  3998. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  3999. },
  4000. // //左右滚动
  4001. // wheel(e){
  4002. // var a = document.getElementById("dateScroll");
  4003. // var scroll_width = 80; //滚动一下的距离
  4004. // var e = e || window.event, v;
  4005. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4006. // if(v>3||-v>3) v=-v;
  4007. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4008. // e.preventDefault(); //阻止浏览器的默认滚动
  4009. // },
  4010. showExportDialog() {
  4011. this.exportDialog = true;
  4012. },
  4013. showExportTimeDialog() {
  4014. this.exportTimeDialog = true;
  4015. },
  4016. changeAllTime() {
  4017. //总时长发生改变,自动按比例计算
  4018. this.workForm.domains.forEach(d=>{
  4019. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4020. });
  4021. //计算jsTime
  4022. if (this.workForm.createDate) {
  4023. let sdate = new Date(this.workForm.createDate[0]);
  4024. let edate = new Date(this.workForm.createDate[1]);
  4025. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4026. console.log('days===', days)
  4027. if (days < 0) {
  4028. days = 0;
  4029. }
  4030. this.jsTime = this.reportTimeType.allday * days;
  4031. }
  4032. },
  4033. // 是否加班的单机事件
  4034. check() {
  4035. this.selected = !this.selected
  4036. this.isNew = this.selected
  4037. },
  4038. updateSubProject() {
  4039. this.$forceUpdate();
  4040. },
  4041. selectDegreeId(domain, index) {
  4042. this.http.post('/report/defaultDegree',{
  4043. projectId: domain.projectId
  4044. },
  4045. res => {
  4046. if (res.code == "ok") {
  4047. if(res.data) {
  4048. this.workForm.domains[index].degreeId = res.data.id + ''
  4049. this.$forceUpdate();
  4050. }
  4051. }
  4052. },
  4053. error => {
  4054. this.$message({
  4055. message: error,
  4056. type: "error"
  4057. });
  4058. }
  4059. );
  4060. },
  4061. //项目选中了, 加载子项目
  4062. selectProject(domain, index) {
  4063. if(!domain.projectId){
  4064. return;
  4065. }
  4066. // 默认选中上次填写的自定义维度
  4067. if(this.yonghuUser.customDegreeActive == 1) {
  4068. this.selectDegreeId(domain, index)
  4069. }
  4070. // console.log('projectId===',domain.projectId);
  4071. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4072. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4073. this.http.post('/sub-project/list',{
  4074. projectId: domain.projectId,
  4075. isReport: true
  4076. },
  4077. res => {
  4078. //清空之前选中的子项目
  4079. // this.workForm.domains[index].subProjectId = 0;
  4080. if (res.code == "ok") {
  4081. this.workForm.domains[index].subProjectList = res.data;
  4082. this.workForm.domains[index].subProjectId = null;
  4083. this.$forceUpdate();
  4084. }
  4085. },
  4086. error => {
  4087. this.$message({
  4088. message: error,
  4089. type: "error"
  4090. });
  4091. }
  4092. );
  4093. //项目相关的近期任务
  4094. if (this.user.company.packageProject == 1) {
  4095. this.getRecentTaskList(domain, index);
  4096. //获取项目相关专业
  4097. if (this.user.company.packageEngineering == 1) {
  4098. this.getProjectProfessions(domain, index);
  4099. }
  4100. //获取项目下的任务分组
  4101. this.getTaskGroups(domain, index);
  4102. }
  4103. // 获取项目相关的维度
  4104. // domain.degreeId = null
  4105. this.$set(domain,'degreeId',null)
  4106. this.dimension(domain, index);
  4107. //获取项目审核人
  4108. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4109. this.getProjectAuditorList(domain, index);
  4110. } else {
  4111. //按分组的负责人来审核
  4112. domain.projectAuditorId = null;
  4113. domain.projectAuditorName = null;
  4114. domain.auditUserList = null;
  4115. }
  4116. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4117. if (this.reportTimeType.type == 3) {
  4118. //新增项目时,自动计算
  4119. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4120. domain.workingTime = (this.reportTimeType.allday * domain.progress/100);
  4121. }
  4122. //加载昱众的工作职责
  4123. if (this.user.companyId == this.yuzhongCompId) {
  4124. this.updateResponse(domain);
  4125. }
  4126. },
  4127. getRecentTaskList(domain, index) {
  4128. //刷新任务时,清空服务
  4129. this.$set(domain, 'sapServiceId', null);
  4130. this.$set(domain, 'taskId', null);
  4131. var param = {
  4132. projectId: domain.projectId,
  4133. isSubstitude:this.isSubstitude?1:0,
  4134. };
  4135. if (domain.groupId) {
  4136. param.groupId = domain.groupId;
  4137. }
  4138. if (domain.stage) {
  4139. param.stage = domain.stage;
  4140. }
  4141. //专业版代填,获取代填员工的任务
  4142. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4143. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4144. this.$message({
  4145. message: '请选择代填的员工',
  4146. type: "error"
  4147. });
  4148. return;
  4149. } else {
  4150. param.userId = this.workForm.userId[0];
  4151. }
  4152. }
  4153. this.http.post('/task/getRecentTask',param,
  4154. res => {
  4155. if (res.code == "ok") {
  4156. this.workForm.domains[index].allTaskList = res.data;
  4157. this.workForm.domains[index].taskList = res.data;
  4158. this.$forceUpdate();
  4159. }
  4160. },
  4161. error => {
  4162. this.$message({
  4163. message: error,
  4164. type: "error"
  4165. });
  4166. }
  4167. );
  4168. },
  4169. //获取项目审核人
  4170. getProjectAuditorList(domainItem, index) {
  4171. if(domainItem.projectId == '') {
  4172. return
  4173. }
  4174. domainItem.projectAuditorId = null;
  4175. domainItem.projectAuditorName = null;
  4176. this.http.post('/project-auditor/getList',{
  4177. projectId: domainItem.projectId,
  4178. },
  4179. res => {
  4180. if (res.code == "ok") {
  4181. domainItem.auditUserList = res.data;
  4182. if (res.data.length==0) {
  4183. this.$message({
  4184. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4185. type: "error"
  4186. });
  4187. } else if (res.data.length==1) {
  4188. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4189. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4190. }
  4191. this.$forceUpdate();
  4192. }
  4193. },
  4194. error => {
  4195. this.$message({
  4196. message: error,
  4197. type: "error"
  4198. });
  4199. }
  4200. );
  4201. },
  4202. // 获取维度数据
  4203. dimension(domain, index) {
  4204. if(domain.projectId == '') {
  4205. return
  4206. }
  4207. this.http.post('/project/getDegreeList',{
  4208. projectId: domain.projectId,
  4209. },
  4210. res => {
  4211. if (res.code == "ok") {
  4212. // console.log("维度数据",res.data);
  4213. this.workForm.domains[index].wuduList = res.data
  4214. // this.workForm = this.workForm
  4215. this.$forceUpdate()
  4216. }
  4217. },
  4218. error => {
  4219. this.$message({
  4220. message: error,
  4221. type: "error"
  4222. });
  4223. }
  4224. );
  4225. },
  4226. //切换任务阶段
  4227. changeStages(domain, index) {
  4228. if (domain.stage == null || domain.stage == '') {
  4229. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4230. } else {
  4231. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4232. }
  4233. this.getRecentTaskList(domain, index);
  4234. this.$forceUpdate();
  4235. },
  4236. getGroupStages(domain, index, keepStage) {
  4237. // console.log(domain);
  4238. if(!domain.groupId){
  4239. domain.projectAuditorId = ''
  4240. domain.stages = []
  4241. if(this.user.timeType.reportAuditType >= 1){
  4242. domain.auditUserList = []
  4243. }
  4244. this.$forceUpdate();
  4245. return
  4246. }
  4247. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4248. res => {
  4249. if (res.code == "ok") {
  4250. if (!keepStage) {
  4251. domain.stage = '';
  4252. }
  4253. domain.stages = res.data;
  4254. domain.taskId = null;
  4255. this.getRecentTaskList(domain, index);
  4256. this.$forceUpdate();
  4257. }
  4258. },
  4259. error => {
  4260. this.$message({
  4261. message: error,
  4262. type: "error"
  4263. });
  4264. });
  4265. //检查当前的项目是否需要获取分组的负责人
  4266. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4267. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4268. res => {
  4269. if (res.code == "ok") {
  4270. domain.getProjectAuditorList = res.data;
  4271. domain.auditUserList = res.data;
  4272. if (res.data.length==1) {
  4273. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4274. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4275. } else if (res.data.length==0) {
  4276. domain.projectAuditorId = null;
  4277. domain.projectAuditorName = null;
  4278. }
  4279. this.$forceUpdate();
  4280. }
  4281. },
  4282. error => {
  4283. this.$message({
  4284. message: error,
  4285. type: "error"
  4286. });
  4287. });
  4288. }
  4289. },
  4290. getProjectProfessions(domain, index) {
  4291. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4292. res => {
  4293. if (res.code == "ok") {
  4294. this.workForm.domains[index].professionProgress = res.data;
  4295. this.$forceUpdate();
  4296. }
  4297. },
  4298. error => {
  4299. this.$message({
  4300. message: error,
  4301. type: "error"
  4302. });
  4303. });
  4304. },
  4305. //删除自己的日报
  4306. deleteReport() {
  4307. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4308. confirmButtonText: this.$t('btn.determine'),
  4309. cancelButtonText: this.$t('btn.cancel'),
  4310. type: "warning"
  4311. })
  4312. .then(() => {
  4313. this.listLoading = true;
  4314. this.http.post('/report/delete',{
  4315. userId: this.user.id,
  4316. date: this.workForm.createDate
  4317. },
  4318. res => {
  4319. this.listLoading = false;
  4320. if (res.code == "ok") {
  4321. this.$message({
  4322. message: this.$t('message.successfullyDeleted'),
  4323. type: "success"
  4324. });
  4325. this.getReportList();
  4326. this.getDepartment();
  4327. this.dialogVisible = false;
  4328. } else {
  4329. this.$message({
  4330. message: res.msg,
  4331. type: "error"
  4332. });
  4333. }
  4334. },
  4335. error => {
  4336. this.listLoading = false;
  4337. this.$message({
  4338. message: error,
  4339. type: "error"
  4340. });
  4341. }
  4342. );
  4343. })
  4344. .catch(() => {});
  4345. },
  4346. // 管理员删除日报
  4347. guanli(item) {
  4348. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4349. let param = {date: this.date + day, userId: item.id};
  4350. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4351. confirmButtonText: this.$t('btn.determine'),
  4352. cancelButtonText: this.$t('btn.cancel'),
  4353. type: "warning"
  4354. })
  4355. .then(() => {
  4356. this.listLoading = true;
  4357. this.http.post('/report/delete',param,
  4358. res => {
  4359. this.listLoading = false;
  4360. if (res.code == "ok") {
  4361. this.$message({
  4362. message: this.$t('message.successfullyDeleted'),
  4363. type: "success"
  4364. });
  4365. this.getReportList();
  4366. this.getDepartment();
  4367. this.dialogVisible = false;
  4368. } else {
  4369. this.$message({
  4370. message: res.msg,
  4371. type: "error"
  4372. });
  4373. }
  4374. },
  4375. error => {
  4376. this.listLoading = false;
  4377. this.$message({
  4378. message: error,
  4379. type: "error"
  4380. });
  4381. }
  4382. );
  4383. })
  4384. .catch(() => {});
  4385. },
  4386. selectAll() {
  4387. if (this.isAllSelect) {
  4388. var keys = [];
  4389. this.reportNames.forEach(b=>{
  4390. keys.push(b.id);
  4391. })
  4392. this.$refs.approveTree.setCheckedKeys(keys);
  4393. } else {
  4394. this.$refs.approveTree.setCheckedKeys([]);
  4395. }
  4396. },
  4397. removeEmptyNode(list) {
  4398. for (var i=0;i<list.length;i++) {
  4399. var cnt = 0;
  4400. if (list[i].membCount == 0) {
  4401. list.splice(i, 1);
  4402. i--;
  4403. } else if (list[i].children != null) {
  4404. this.removeEmptyNode(list[i].children);
  4405. }
  4406. }
  4407. },
  4408. calculateMembCount(list) {
  4409. for (var i in list) {
  4410. var cnt = 0;
  4411. if (list[i].children != null) {
  4412. this.calculateMembCount(list[i].children);
  4413. for (var m in list[i].children) {
  4414. cnt += list[i].children[m].membCount;
  4415. }
  4416. }
  4417. if (list[i].isUser == 1) {
  4418. cnt++;
  4419. this.membCount++;
  4420. }
  4421. list[i].membCount = cnt;
  4422. }
  4423. },
  4424. stateChange() {
  4425. // console.log(this.allData,'alldate');
  4426. this.membCount = 0;
  4427. if (this.selectState == -1) {
  4428. //全部状态
  4429. this.data = this.allData;
  4430. } else {
  4431. //未填报
  4432. this.seluserText = ''
  4433. var newData = JSON.parse(JSON.stringify(this.allData));
  4434. this.filterState(this.selectState, newData);
  4435. this.data = newData;
  4436. }
  4437. this.calculateMembCount(this.data);
  4438. this.data[0].membCount = this.membCount;//总人数
  4439. },
  4440. //按状态过滤部门人员
  4441. filterState(state, list) {
  4442. for (var i =0;i<list.length; i++) {
  4443. var obj = list[i];
  4444. if (obj.isUser == 1) {
  4445. var match = false;
  4446. if (state == -2) {
  4447. if (obj.state == null) {
  4448. match = true;
  4449. }
  4450. } else {
  4451. if (obj.state == state) {
  4452. match = true;
  4453. }
  4454. }
  4455. if (!match) {
  4456. list.splice(i, 1);
  4457. i--;
  4458. } else {
  4459. }
  4460. } else {
  4461. if (obj.children != null) {
  4462. this.filterState(state, obj.children);
  4463. }
  4464. }
  4465. }
  4466. },
  4467. //a按名称过滤部门人员
  4468. async seluserforText(){
  4469. const { userNameNeedTranslate } = this.user
  4470. this.membCount = 0;
  4471. var newData = JSON.parse(JSON.stringify(this.allData));
  4472. let textList = [this.seluserText]
  4473. if(userNameNeedTranslate == 1) {
  4474. this.dataLoading = true
  4475. let res = await this.postData('/user/getEmployeeList', {
  4476. keyword: this.seluserText,
  4477. cursor: '',
  4478. departmentId: -1,
  4479. pageIndex: 1,
  4480. pageSize: 1000
  4481. })
  4482. textList = res.data.records.map(item => item.name)
  4483. this.dataLoading = false
  4484. }
  4485. // return
  4486. console.log(textList, '<=== textList')
  4487. this.seluserforTextin(this.seluserText, newData, textList)
  4488. console.log(newData, 'Data')
  4489. this.data = newData;
  4490. this.calculateMembCount(this.data);
  4491. this.data[0].membCount = this.membCount;//总人数
  4492. },
  4493. seluserforTextin(text, list, textList = []){
  4494. for (var i =0;i<list.length; i++) {
  4495. var obj = list[i];
  4496. if (obj.isUser == 1) {
  4497. var match = false;
  4498. // if (obj.label.indexOf(text) != -1) {
  4499. // match = true
  4500. // }
  4501. if(textList.some(item => item.includes(obj.label))) {
  4502. match = true
  4503. }
  4504. if (!match) {
  4505. list.splice(i, 1);
  4506. i--;
  4507. } else {
  4508. }
  4509. } else {
  4510. if (obj.children != null) {
  4511. this.seluserforTextin(text, obj.children, textList);
  4512. }
  4513. }
  4514. }
  4515. },
  4516. // 当节点发生变化时
  4517. nodeChangeExpand(data) {
  4518. // 保存当前展开的节点
  4519. let flag = false
  4520. this.nodeModelData.some(item => {
  4521. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4522. flag = true
  4523. return true
  4524. }
  4525. })
  4526. if (!flag) { // 不存在则存到数组里
  4527. this.nodeModelData.push(data.id)
  4528. }
  4529. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4530. },
  4531. nodeChangeCollapse(data) {
  4532. console.log(this.nodeModelData)
  4533. this.nodeModelData.some((item, i) => {
  4534. if (item === data.id) {
  4535. this.nodeModelData.length = i
  4536. }
  4537. })
  4538. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4539. },
  4540. // 部门列表点击
  4541. handleNodeClick(data) {
  4542. // this.dealList = data
  4543. this.theValues(data.id, this.allData)
  4544. // this.depData = data;
  4545. var list = [];
  4546. if (data.id == -1) {
  4547. this.deptId = null;
  4548. this.targetUid = null;
  4549. list = this.data;
  4550. } else if (data.isUser == 1) {
  4551. this.deptId = null;
  4552. this.targetUid = data.id;
  4553. } else {
  4554. this.deptId = data.id;
  4555. this.targetUid = null;
  4556. list.push(data);
  4557. }
  4558. this.getReportList();
  4559. if (list.length > 0) {
  4560. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4561. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4562. }
  4563. },
  4564. theValues(id, item) {
  4565. for(var i in item) {
  4566. if(item[i].id == id) {
  4567. this.depData = item[i]
  4568. if(id == '-1') {
  4569. this.translation = '1'
  4570. } else {
  4571. if(item[i].children) {
  4572. this.translation = '2'
  4573. } else {
  4574. this.translation = '3'
  4575. }
  4576. }
  4577. return
  4578. } else {
  4579. if(item[i].children) {
  4580. this.theValues(id, item[i].children)
  4581. }
  4582. }
  4583. }
  4584. },
  4585. //获取可以选择的代填的人员列表
  4586. getSubstitudeUserDeptList() {
  4587. if (this.deptMembData.length == 0) {
  4588. this.http.post("/department/listMyMembs", {},
  4589. res => {
  4590. if (res.code == "ok") {
  4591. let noAllData = JSON.parse(JSON.stringify(res.data));
  4592. if (noAllData.length > 0) {
  4593. // if (noAllData[0].label == '全部人员') {
  4594. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4595. noAllData.splice(0,1);
  4596. }
  4597. }
  4598. this.setUserToDept(noAllData);
  4599. this.deptMembData = noAllData;
  4600. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4601. console.log(this.deptMembData, '代填人员数据')
  4602. } else {
  4603. this.$message({
  4604. message: res.msg,
  4605. type: "error"
  4606. });
  4607. }
  4608. },
  4609. error => {
  4610. this.$message({
  4611. message: error,
  4612. type: "error"
  4613. });
  4614. });
  4615. }
  4616. },
  4617. // 获取部门列表
  4618. getDepartmentForApprove() {
  4619. this.http.post( this.port.manage.depList, {},
  4620. res => {
  4621. if (res.code == "ok") {
  4622. var list1 = JSON.parse(JSON.stringify(res.data));
  4623. this.deptOptionList = this.changeArr(list1);
  4624. console.log(this.deptOptionList, '部门')
  4625. } else {
  4626. this.$message({
  4627. message: res.msg,
  4628. type: "error"
  4629. });
  4630. }
  4631. },
  4632. error => {
  4633. this.$message({
  4634. message: error,
  4635. type: "error"
  4636. });
  4637. });
  4638. },
  4639. // 获取部门列表
  4640. getDepartment() {
  4641. //如果没有权限,就不需要获取
  4642. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4643. return;
  4644. }
  4645. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4646. var param = {date:this.date + day};
  4647. this.http.post("/report/getMembList", param,
  4648. res => {
  4649. if (res.code == "ok") {
  4650. if(res.data.length == 0){
  4651. return
  4652. }
  4653. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4654. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4655. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4656. // if (this.user.role > 0) {
  4657. // }
  4658. list.splice(0,0,{
  4659. id: -1,
  4660. label: this.$t('lable.allStaff'),
  4661. })
  4662. this.membCount = 0;
  4663. //设置员工到部门下面
  4664. this.setUserToDept(list);
  4665. this.data = list;
  4666. // console.log('data',this.data);
  4667. this.expandDate = [this.data[1].id]
  4668. this.allData = list;
  4669. // if (noAllData.length > 0) {
  4670. // if (noAllData[0].label == '全部人员') {
  4671. // noAllData.splice(0,1);
  4672. // }
  4673. // }
  4674. // this.setUserToDept(noAllData);
  4675. // this.deptMembData = noAllData;
  4676. this.option = this.changeArr(list1);
  4677. list[0].membCount = this.membCount;
  4678. if (this.depData.id == -1) {
  4679. this.depData.membCount = this.membCount;
  4680. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4681. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4682. } else {
  4683. if (this.depData.isUser == null) {
  4684. var dep = this.findTargetDept(this.data, this.depData.id);
  4685. var membDeptList = [];
  4686. membDeptList.push(dep);
  4687. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4688. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4689. }
  4690. }
  4691. if (this.depData.isUser == null) {
  4692. if (this.isFill) {
  4693. this.fillMembList = this.fillList;
  4694. } else {
  4695. this.fillMembList = this.unFillList;
  4696. }
  4697. }
  4698. this.leaveAllNum = 0
  4699. for(let i in this.unFillList){
  4700. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4701. this.leaveAllNum += 1
  4702. }
  4703. }
  4704. this.stateChange()
  4705. } else {
  4706. this.$message({
  4707. message: res.msg,
  4708. type: "error"
  4709. });
  4710. }
  4711. },
  4712. error => {
  4713. this.$message({
  4714. message: error,
  4715. type: "error"
  4716. });
  4717. });
  4718. this.getReportFillStatus();
  4719. },
  4720. findTargetDept(list, deptId) {
  4721. var t = null;
  4722. for (var i=0;i<list.length; i++) {
  4723. if (list[i].isUser == null && list[i].id == deptId) {
  4724. t = list[i];
  4725. break;
  4726. }
  4727. }
  4728. if (t == null) {
  4729. for (var i=0;i<list.length; i++) {
  4730. if (list[i].children != null && list[i].children.length > 0) {
  4731. t = this.findTargetDept(list[i].children, deptId);
  4732. if (t != null) {
  4733. break;
  4734. }
  4735. }
  4736. }
  4737. }
  4738. return t;
  4739. },
  4740. getUserMembListFromDeptList(list, isFill) {
  4741. var membList = [];
  4742. for (var i in list) {
  4743. var deptName = list[i].label;
  4744. if (list[i].userList != null) {
  4745. list[i].userList.forEach(element => {
  4746. if (isFill == 0) {
  4747. //获取未填的
  4748. if (element.state == null) {
  4749. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4750. membList.push(obj);
  4751. }
  4752. } else {
  4753. if (element.state != null) {
  4754. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4755. membList.push(obj);
  4756. }
  4757. }
  4758. });
  4759. }
  4760. if (list[i].children != null) {
  4761. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4762. }
  4763. }
  4764. return membList;
  4765. },
  4766. setUserToDept(list) {
  4767. for (var i in list) {
  4768. var cnt = 0;
  4769. if (list[i].children != null) {
  4770. this.setUserToDept(list[i].children);
  4771. for (var m in list[i].children) {
  4772. cnt += list[i].children[m].membCount;
  4773. }
  4774. }
  4775. if (list[i].userList != null) {
  4776. if (list[i].children == null) {
  4777. list[i].children = [];
  4778. }
  4779. list[i].userList.forEach(element => {
  4780. var obj = {
  4781. id: element.id,
  4782. label:element.name,
  4783. state:element.state,
  4784. parentId:element.departmentId,
  4785. isUser:1,
  4786. workingTime: element.workingTime,
  4787. leaveDays: element.leaveDays,
  4788. leaveTimes: element.leaveTimes
  4789. };
  4790. list[i].children.push(obj);
  4791. this.membCount++;
  4792. cnt++;
  4793. });
  4794. }
  4795. list[i].membCount = cnt;
  4796. }
  4797. },
  4798. // 修改数组
  4799. changeArr(arr) {
  4800. for (var i = 0; i < arr.length; i++) {
  4801. if(arr[i].id != -1 && arr[i].id != 0) {
  4802. if (arr[i].children != null && arr[i].children.length>0) {
  4803. arr[i].children = this.changeArr(arr[i].children);
  4804. }
  4805. arr[i].id && (arr[i].value = arr[i].id);
  4806. delete arr[i].id;
  4807. }
  4808. }
  4809. for(var i in arr) {
  4810. if(arr[i].id == -1 || arr[i].id == 0) {
  4811. arr.splice(i,1)
  4812. }
  4813. }
  4814. return arr;
  4815. },
  4816. //时间段范围设置改动,监听
  4817. onTimeTypeChange(timeType) {
  4818. this.seleChn(1)
  4819. this.showAddMore = true;
  4820. for(var i in this.workForm.domains) {
  4821. if (this.workForm.domains[i].timeType == 0) {
  4822. this.showAddMore = false;
  4823. break;
  4824. }
  4825. }
  4826. if (this.showAddMore) {
  4827. //检测数量
  4828. if (this.workForm.domains.length == 2) {
  4829. this.showAddMore = false;
  4830. } else {
  4831. this.showAddMore = true;
  4832. }
  4833. }
  4834. },
  4835. getTimeType() {
  4836. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4837. res => {
  4838. if (res.code == "ok") {
  4839. var t = res.data;
  4840. this.reportTimeType = t;
  4841. if (this.reportTimeType.type > 0) {
  4842. this.showAddMore = true;
  4843. }
  4844. //转化时间格式
  4845. if (t.allday != null) {
  4846. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4847. }
  4848. if (t.am != null) {
  4849. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4850. }
  4851. if (t.pm != null) {
  4852. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4853. }
  4854. let arr = []
  4855. for(var i in res.data.excludeTimeList) {
  4856. let obj = {
  4857. s: res.data.excludeTimeList[i].startTime,
  4858. e: res.data.excludeTimeList[i].endTime,
  4859. }
  4860. arr.push(obj)
  4861. }
  4862. this.vacationTime = arr
  4863. } else {
  4864. this.$message({
  4865. message: res.msg,
  4866. type: "error"
  4867. });
  4868. }
  4869. },
  4870. error => {
  4871. this.listLoading = false;
  4872. this.$message({
  4873. message: error,
  4874. type: "error"
  4875. });
  4876. });
  4877. },
  4878. // 改变月份 -------
  4879. changeMonthOut() {
  4880. this.getAllDate();
  4881. this.getReportList();
  4882. this.getDepartment();
  4883. },
  4884. // 选择日期
  4885. choseDate(i, item) {
  4886. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4887. return
  4888. }
  4889. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4890. this.choseDay = i;
  4891. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4892. sessionStorage.msg = this.date + day,
  4893. this.getReportList();
  4894. this.getDepartment();
  4895. this.curDate = item.date;
  4896. },
  4897. canClick(i, item){
  4898. let nowDate = new Date()
  4899. let nowDateYear = nowDate.getFullYear()
  4900. let itemYear = parseInt(this.date.split('-')[0])
  4901. let nowDateMonth = nowDate.getMonth() + 1
  4902. let itemMonth = parseInt(this.date.split('-')[1])
  4903. let nowDateDay = nowDate.getDate()
  4904. let itemDay = parseInt(item.showDate.split('.')[1])
  4905. if(nowDateYear < itemYear){
  4906. return false
  4907. }else if(nowDateYear == itemYear){
  4908. if(nowDateMonth < itemMonth){
  4909. return false
  4910. }else if(nowDateMonth == itemMonth){
  4911. if(nowDateDay < itemDay){
  4912. return false
  4913. }
  4914. }
  4915. }
  4916. },
  4917. // 获取日期列表
  4918. getAllDate(e) {
  4919. var dayArry = [];
  4920. var day = this.getCountDays();
  4921. let curMonthDay = null;
  4922. for (var k = 1; k <= day; k++) {
  4923. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4924. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4925. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4926. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  4927. if(sessionStorage.msg) {
  4928. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  4929. this.choseDay = k - 1;
  4930. curMonthDay = str;
  4931. }
  4932. } else {
  4933. if (new Date().getDate() == k) {
  4934. this.choseDay = k - 1;
  4935. }
  4936. }
  4937. } else {
  4938. this.choseDay = 0;
  4939. }
  4940. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  4941. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  4942. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  4943. }
  4944. this.allDate = dayArry;
  4945. //不能超过最大日期
  4946. if (this.choseDay > day-1) {
  4947. this.choseDay = day-1;
  4948. }
  4949. if(sessionStorage.from != 1){
  4950. let nowmonth = new Date().getMonth() + 1
  4951. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  4952. let nowdate = new Date().getDate()
  4953. if(nowd == this.date){
  4954. if(e && sessionStorage.msg){
  4955. }else{
  4956. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  4957. }
  4958. let nowday = new Date(sessionStorage.msg).getDate()
  4959. this.choseDay = nowday - 1
  4960. let monthdate = new Date(sessionStorage.msg)
  4961. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4962. }else{
  4963. if(e && sessionStorage.msg){
  4964. }else{
  4965. sessionStorage.msg = this.date + '-01'
  4966. }
  4967. let monthdate = new Date(sessionStorage.msg)
  4968. this.choseDay = monthdate.getDate() - 1
  4969. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  4970. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  4971. }
  4972. }else{
  4973. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  4974. }
  4975. //从消息点击跳转过来的,直接加载指定日期
  4976. if (sessionStorage.from == 1 && sessionStorage.msg) {
  4977. this.curDate = sessionStorage.msg;
  4978. sessionStorage.from = 0;
  4979. } else {
  4980. // if (curMonthDay != null) {
  4981. // // this.curDate = curMonthDay;
  4982. // let d = new Date(sessionStorage.msg)
  4983. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4984. // } else {
  4985. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  4986. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  4987. // }
  4988. }
  4989. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  4990. // if(!sessionStorage.msg){
  4991. // let msgday = this.choseDay + 1
  4992. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  4993. // }
  4994. this.getReportFillStatus();
  4995. },
  4996. getCountDays() {
  4997. var newstr = this.date.replace(/-/g, "/");
  4998. var curDate = new Date(newstr+'/01');
  4999. var curMonth = curDate.getMonth();
  5000. curDate.setMonth(curMonth + 1);
  5001. curDate.setDate(0);
  5002. return curDate.getDate();
  5003. },
  5004. //获取日报列表
  5005. getReportList() {
  5006. this.listLoading = true;
  5007. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5008. let param = {date: this.date + day};
  5009. if (this.deptId) {
  5010. param.deptId = this.deptId;
  5011. }
  5012. if (this.targetUid) {
  5013. param.userId = this.targetUid;
  5014. }
  5015. this.http.post( this.port.report.list, param,
  5016. res => {
  5017. this.listLoading = false;
  5018. if (res.code == "ok") {
  5019. this.reportList = res.data;
  5020. if(document.querySelector("#day"+this.choseDay)){
  5021. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5022. }
  5023. } else {
  5024. this.$message({
  5025. message: res.msg,
  5026. type: "error"
  5027. });
  5028. }
  5029. },
  5030. error => {
  5031. this.listLoading = false;
  5032. this.$message({
  5033. message: error,
  5034. type: "error"
  5035. });
  5036. });
  5037. },
  5038. // 处理数据
  5039. // dealWith() {
  5040. // var tianxie = 0
  5041. // var weixtianxie = 0
  5042. // if(this.selectState == -1) {
  5043. // } else {
  5044. // var arr = []
  5045. // for (var i in this.reportList) {
  5046. // arr.push(this.reportList[i].id)
  5047. // }
  5048. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  5049. // }
  5050. // },
  5051. // getDealWith(item, tx, wtx, arr) {
  5052. // for(var i in item) {
  5053. // if(item[i].children) {
  5054. // this.getDealWith(item[i].children, tx, wtx, arr)
  5055. // } else {
  5056. // if(arr.indexOf(item[i].id) != '-1') {
  5057. // tx = +tx + 1
  5058. // }
  5059. // }
  5060. // }
  5061. // },
  5062. //导出员工工时统计
  5063. exportUserTime() {
  5064. this.listLoading = true;
  5065. var param = {};
  5066. if (this.exportParam.dateRange != null) {
  5067. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5068. }
  5069. this.http.post('/department/exportDeptStatistic', param,
  5070. res => {
  5071. this.listLoading = false;
  5072. if (res.code == "ok") {
  5073. location.href = res.data;
  5074. this.exportTimeDialog = false;
  5075. } else {
  5076. this.$message({
  5077. message: res.msg,
  5078. type: "error"
  5079. });
  5080. }
  5081. },
  5082. error => {
  5083. this.listLoading = false;
  5084. this.$message({
  5085. message: error,
  5086. type: "error"
  5087. });
  5088. });
  5089. },
  5090. //导出日报
  5091. exportReport() {
  5092. this.listLoading = true;
  5093. var param = {};
  5094. if (this.exportParam.dateRange != null) {
  5095. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5096. }
  5097. if (this.exportParam.projectId != null) {
  5098. param.projectId = this.exportParam.projectId;
  5099. }
  5100. if (this.exportParam.departmentId != null) {
  5101. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5102. }
  5103. param.stateKey = this.stateKey
  5104. // param.departmentId = this.user.departmentId
  5105. this.http.post( this.port.report.export, param,
  5106. res => {
  5107. this.listLoading = false;
  5108. if (res.code == "ok") {
  5109. location.href = res.data;
  5110. this.exportDialog = false;
  5111. } else {
  5112. this.$message({
  5113. message: res.msg,
  5114. type: "error"
  5115. });
  5116. }
  5117. },
  5118. error => {
  5119. this.listLoading = false;
  5120. this.$message({
  5121. message: error,
  5122. type: "error"
  5123. });
  5124. });
  5125. },
  5126. //获取项目列表
  5127. getProjectList() {
  5128. this.listLoading = true;
  5129. this.http.post( this.port.project.list, {},
  5130. res => {
  5131. this.listLoading = false;
  5132. if (res.code == "ok") {
  5133. for(var i in res.data) {
  5134. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5135. res.data[i].projectCode = ''
  5136. }
  5137. }
  5138. this.projectList = res.data;
  5139. console.log("项目列表",this.projectList);
  5140. } else {
  5141. this.$message({
  5142. message: res.msg,
  5143. type: "error"
  5144. });
  5145. }
  5146. },
  5147. error => {
  5148. this.listLoading = false;
  5149. this.$message({
  5150. message: error,
  5151. type: "error"
  5152. });
  5153. });
  5154. },
  5155. // 获取填报日报的项目下拉列表
  5156. getFillProjectList() {
  5157. this.http.post( this.port.project.list, {
  5158. forReport: 1
  5159. },res => {
  5160. if (res.code == "ok") {
  5161. for(var i in res.data) {
  5162. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5163. res.data[i].projectCode = ''
  5164. }
  5165. }
  5166. this.fillProjectList = res.data;
  5167. this.getRecentlyProject()
  5168. } else {
  5169. this.$message({
  5170. message: res.msg,
  5171. type: "error"
  5172. });
  5173. }
  5174. },
  5175. error => {
  5176. this.$message({
  5177. message: error,
  5178. type: "error"
  5179. });
  5180. });
  5181. },
  5182. getBasecostItemList() {
  5183. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5184. companyId: this.user.companyId
  5185. },
  5186. res => {
  5187. if (res.code == "ok") {
  5188. this.timeBasecostList = res.data;
  5189. }
  5190. });
  5191. },
  5192. getAIReport(createDate) {
  5193. this.http.post('/report/getAIReport', {},
  5194. res => {
  5195. if (res.code == "ok") {
  5196. var quanbu = 0
  5197. this.jsDay = 1
  5198. var zhi = ''
  5199. var slp = res.data
  5200. for(var i in slp) {
  5201. var sp = +slp[i].workingTime + 0
  5202. zhi = this.jsDay * sp
  5203. quanbu = +quanbu + zhi
  5204. }
  5205. this.jsTime = quanbu
  5206. var aiReportData = res.data;
  5207. this.canCancelInDialog = false
  5208. if(aiReportData.length != 0) {
  5209. var arr = [];
  5210. for(var i in aiReportData) {
  5211. arr.push({
  5212. id: null,
  5213. projectId: aiReportData[i].projectId,
  5214. workingTime: aiReportData[i].workingTime,
  5215. content: '',
  5216. progress:100,
  5217. state: 2,
  5218. timeType: aiReportData[i].timeType,
  5219. subProjectList: aiReportData[i].subProjectList,
  5220. taskList: aiReportData[i].taskList,
  5221. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5222. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5223. taskId: aiReportData[i].taskId,
  5224. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5225. startTime: aiReportData[i].startTime,
  5226. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5227. endTime: aiReportData[i].endTime,
  5228. isOvertime: 0,
  5229. progress:aiReportData[i].progress,
  5230. professionProgress: aiReportData[i].professionProgressList,
  5231. stages:aiReportData[i].stages,
  5232. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5233. pics: null,
  5234. multiWorktime: aiReportData[i].multiWorktime,
  5235. worktimeList: [{}],
  5236. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5237. wuduList: aiReportData[i].degreeList,
  5238. taskGroups:aiReportData[i].taskGroups,
  5239. customData: aiReportData[i].customData,//自定义的数值
  5240. auditUserList: aiReportData[i].auditUserList,
  5241. projectAuditorId: aiReportData[i].projectAuditorId,
  5242. projectAuditorName: aiReportData[i].projectAuditorName,
  5243. overtimeHours: aiReportData[i].overtimeHours,
  5244. customText: aiReportData[i].customText,
  5245. basecostId: aiReportData[i].basecostId,
  5246. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5247. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5248. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5249. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5250. canEdit: true
  5251. })
  5252. }
  5253. this.workForm.domains = arr;
  5254. } else {
  5255. }
  5256. this.canEdit = true;
  5257. this.originCanEdit = true;
  5258. this.seleChn()
  5259. } else {
  5260. this.$message({
  5261. message: res.msg,
  5262. type: "error"
  5263. });
  5264. }
  5265. },
  5266. error => {
  5267. this.$message({
  5268. message: error,
  5269. type: "error"
  5270. });
  5271. });
  5272. },
  5273. // 获取个人某天的日报 111111
  5274. getReport() {
  5275. this.http.post( this.port.report.getPort, {
  5276. date: this.workForm.createDate
  5277. },
  5278. res => {
  5279. if (res.code == "ok") {
  5280. var quanbu = 0
  5281. this.jsDay = 1
  5282. var zhi = ''
  5283. var slp = res.data.report
  5284. for(var i in slp) {
  5285. var sp = +slp[i].workingTime + 0
  5286. zhi = this.jsDay * sp
  5287. quanbu = +quanbu + zhi
  5288. }
  5289. this.jsTime = quanbu
  5290. var list = res.data;
  5291. this.report = list;
  5292. this.reportTimeType = this.report.timeType;
  5293. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5294. this.isWeekend = !this.report.isWorkDay;
  5295. this.canCancelInDialog = false;
  5296. this.hasWrittenReport = list.report.length != 0;
  5297. if(list.report.length != 0) {
  5298. var arr = [];
  5299. this.canEdit = false;
  5300. let candelete = true
  5301. for(var i in list.report) {
  5302. var flg = null
  5303. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5304. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5305. var filteredRespList = null
  5306. if (targetP.length > 0) {
  5307. var isPublic = targetP[0].isPublic;
  5308. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5309. }
  5310. arr.push({
  5311. id: list.report[i].id,
  5312. projectId: list.report[i].projectId,
  5313. workingTime: list.report[i].workingTime,
  5314. content: list.report[i].content,
  5315. state: list.report[i].state,
  5316. timeType: list.report[i].timeType,
  5317. subProjectList: list.report[i].subProjectList,
  5318. taskList: list.report[i].taskList,
  5319. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5320. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5321. taskId: list.report[i].taskId,
  5322. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5323. startTime: list.report[i].startTime,
  5324. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5325. endTime: list.report[i].endTime,
  5326. isOvertime: flg,
  5327. progress:list.report[i].progress,
  5328. professionProgress: list.report[i].professionProgressList,
  5329. stages:list.report[i].stages,
  5330. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5331. pics: list.report[i].pics,
  5332. multiWorktime: list.report[i].multiWorktime,
  5333. worktimeList: list.report[i].worktimeList,
  5334. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5335. wuduList: list.report[i].degreeList,
  5336. taskGroups:list.report[i].taskGroups,
  5337. customData: list.report[i].customData,//自定义的数值
  5338. auditUserList: list.report[i].auditUserList,
  5339. projectAuditorId: list.report[i].projectAuditorId,
  5340. projectAuditorName: list.report[i].projectAuditorName,
  5341. overtimeHours: list.report[i].overtimeHours,
  5342. customText: list.report[i].customText,
  5343. basecostId: list.report[i].basecostId,
  5344. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5345. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5346. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5347. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5348. canEdit: list.report[i].state >= 2 ? true : false,
  5349. extraField1: list.report[i].extraField1,
  5350. extraField2: list.report[i].extraField2,
  5351. extraField3: list.report[i].extraField3,
  5352. workContentList: list.report[i].workContentList,
  5353. filteredRespList: filteredRespList,
  5354. serviceList: list.report[i].serviceList,
  5355. sapServiceId: list.report[i].sapServiceId,
  5356. })
  5357. if (list.report[i].state >= 2) {
  5358. this.canEdit = true;
  5359. }
  5360. if(list.report[i].state < 2){
  5361. candelete = false
  5362. }
  5363. if (list.report[i].state == 0){
  5364. this.canCancelInDialog = true
  5365. }
  5366. // 加判断
  5367. if(this.user.timeType.choseFromAlbum == 1) {
  5368. let arrList = []
  5369. for(var k in list.report[i].pics) {
  5370. let obj = {
  5371. name: k,
  5372. url: list.report[i].pics[k]
  5373. }
  5374. arrList.push(obj)
  5375. }
  5376. arr[i].imgListUrl = arrList
  5377. arr[i].imgList = list.report[i].pics
  5378. }
  5379. }
  5380. this.reportCanDelete = candelete
  5381. this.workForm = {
  5382. createDate: this.workForm.createDate,
  5383. domains: arr,
  5384. userNames:null,
  5385. userId:null,
  5386. time: list.time
  5387. }
  5388. console.log('workForm', this.workForm)
  5389. } else {
  5390. this.workForm = {
  5391. createDate: this.workForm.createDate,
  5392. domains: [{
  5393. id: null,
  5394. projectId: "",
  5395. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5396. content: "",
  5397. progress:100,
  5398. state: 2,
  5399. timeType:0,
  5400. multiWorktime: this.reportTimeType.multiWorktime,
  5401. worktimeList:[{}],
  5402. canEdit: true,
  5403. auditorFirst: '',
  5404. auditorSec: '',
  5405. auditorThird: '',
  5406. ccUserid: ''
  5407. }],
  5408. userId:null,
  5409. userNames:null,
  5410. time: this.report.time
  5411. }
  5412. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5413. this.$set(this.workForm.domains[0],'isOvertime',true)
  5414. if(this.reportTimeType.type != 2){
  5415. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5416. }
  5417. }
  5418. if(this.user.timeType.type == 1) {
  5419. var shuzhi = this.user.timeType.allday + ''
  5420. // console.log('执行一次', shuzhi.indexOf('.'))
  5421. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5422. }
  5423. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5424. //默认给第一个,必填字段
  5425. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5426. }
  5427. this.canEdit = true;
  5428. }
  5429. this.originCanEdit = this.canEdit;
  5430. this.seleChn()
  5431. } else {
  5432. this.$message({
  5433. message: res.msg,
  5434. type: "error"
  5435. });
  5436. }
  5437. },
  5438. error => {
  5439. this.$message({
  5440. message: error,
  5441. type: "error"
  5442. });
  5443. });
  5444. },
  5445. guanbi() {
  5446. this.falsss = false,
  5447. this.workTimeForMinYi=0
  5448. },
  5449. // 打开日报填写
  5450. fillInReport(i, isBatch) {
  5451. this.isWeekend = false
  5452. this.reportCanDelete = false
  5453. // console.log(this.user.timeType.type, '选择时长')
  5454. if(i != 1) {
  5455. this.falsss = false
  5456. } else {
  5457. this.falsss = true
  5458. }
  5459. if (this.isSubstitude) {
  5460. this.getSubstitudeUserDeptList();
  5461. }
  5462. if(i == -1 || this.isSubstitude) {
  5463. this.isDisable = false;
  5464. } else {
  5465. this.isDisable = true;
  5466. }
  5467. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5468. this.isBatch = isBatch;
  5469. if (this.isBatch == 0 && !this.isSubstitude) {
  5470. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5471. let weekday = new Date(this.workForm.createDate).getDay()
  5472. if(this.user.companyId == 817){
  5473. if(weekday == 0){
  5474. this.isWeekend = true
  5475. }
  5476. }else{
  5477. if(weekday == 0 || weekday == 6){
  5478. this.isWeekend = true
  5479. }
  5480. }
  5481. this.getReport(i);
  5482. } else {
  5483. // console.log('执行到了这里')
  5484. this.jsTime = 0
  5485. this.jsDay = 0
  5486. this.workForm = {
  5487. createDate: null,//批量填报没有日期
  5488. domains: [{
  5489. id: null,
  5490. projectId: "",
  5491. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5492. content: "",
  5493. progress:100,
  5494. state: 2,
  5495. timeType:0,
  5496. multiWorktime: this.reportTimeType.multiWorktime,
  5497. worktimeList:[{}],
  5498. canEdit: true,
  5499. }],
  5500. }
  5501. if(this.user.timeType.type == 1) {
  5502. var shuzhi = this.user.timeType.allday + ''
  5503. // console.log('执行二次')
  5504. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5505. }
  5506. // console.log(this.workForm)
  5507. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5508. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5509. }
  5510. this.canEdit = true;
  5511. }
  5512. this.dialogVisible = true;
  5513. },
  5514. //按周填报的弹窗口中编辑单项目相关数据
  5515. setWeekFormReportItem(reportId, i, names, row,sss) {
  5516. console.log(sss)
  5517. this.http.post('/report/getReportById', {
  5518. reportId: reportId
  5519. },
  5520. res => {
  5521. if (res.code == "ok") {
  5522. var data = res.data.report;
  5523. sss.subProjectId = data.subProjectId
  5524. sss.subProjectList = data.subProjectList;
  5525. sss.stage = data.stage
  5526. sss.subProjectList = data.subProjectList
  5527. sss.stages = data.stages
  5528. sss.taskGroups = data.taskGroups;
  5529. sss.auditUserList = data.auditUserList;
  5530. sss.degreeId = data.degreeId;
  5531. sss.customData = data.customData;
  5532. sss.wuduList = data.degreeList;
  5533. this.zhoBaoIdx = i
  5534. this.zhoBaoName = names
  5535. this.zhoBao = sss
  5536. this.zhis = row
  5537. if (sss.groupId) {
  5538. //最后一个参数表示是否保留stage的值,不要重置为空
  5539. this.getGroupStages(this.zhoBao, 0, true)
  5540. }
  5541. this.$forceUpdate();
  5542. }
  5543. });
  5544. },
  5545. // 按周填报里内容的填写
  5546. tianxies(item, i, names, row) {
  5547. if (item.state == 0) {
  5548. this.$message({
  5549. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5550. type: "error"
  5551. });
  5552. return;
  5553. }
  5554. if (item.state == 1) {
  5555. this.$message({
  5556. message: '已通过状态不可修改',
  5557. type: "error"
  5558. });
  5559. return;
  5560. }
  5561. if(this.user.timeType.notAllowedNoAttendance == 1){
  5562. if(this.zhoData[i].corpTime){
  5563. if(this.zhoData[i].corpTime.workHours == 0){
  5564. this.$message({
  5565. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5566. type: 'error'
  5567. })
  5568. return
  5569. }
  5570. }else{
  5571. this.$message({
  5572. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5573. type: 'error'
  5574. })
  5575. return
  5576. }
  5577. }
  5578. var idd = ''
  5579. var obj = {}
  5580. for(var l in this.projectList) {
  5581. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5582. }
  5583. obj.projectId = idd
  5584. this.tianxieDialogVisible = true
  5585. this.scopess = item
  5586. var sss = {}
  5587. if (item.id != null) {
  5588. sss.id = item.id;
  5589. sss.state = item.state;
  5590. } else {
  5591. sss.id = -1;
  5592. sss.state = 3;
  5593. }
  5594. sss.projectId = idd;
  5595. sss.progress = item.progress
  5596. sss.time = item.time
  5597. sss.content = item.content;
  5598. console.log('333', sss.content)
  5599. if (sss.time == '' && this.reportTimeType.type == 2) {
  5600. //取已填时间范围中最大的一个作为开始时间
  5601. var startTime = '09:00';
  5602. var fillStartTime = '00:00';
  5603. for (var t in this.selProjectList) {
  5604. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5605. if (fillItem.time) {
  5606. if (fillItem.time[1] > fillStartTime) {
  5607. fillStartTime = fillItem.time[1];
  5608. }
  5609. }
  5610. }
  5611. if (fillStartTime == '00:00') {
  5612. fillStartTime = '09:00';
  5613. }
  5614. var fillEndMax = '18:00';
  5615. if (fillStartTime >= '18:00') {
  5616. fillEndMax = '23:59';
  5617. }
  5618. sss.time = [fillStartTime, fillEndMax];
  5619. }
  5620. sss.groupId = item.groupId
  5621. sss.stage = item.stage;
  5622. sss.workingTime = item.workingTime
  5623. sss.projectAuditorId = item.projectAuditorId;
  5624. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5625. //默认选中第一个
  5626. sss.basecostId = this.timeBasecostList[0].id;
  5627. }
  5628. var hasEdited = this.zhoData[i][names].hasEdited;
  5629. if (hasEdited) {
  5630. //编辑过了
  5631. sss.subProjectId = item.subProjectId
  5632. sss.stage = item.stage
  5633. sss.subProjectList = item.subProjectList
  5634. sss.stages = item.stages
  5635. sss.taskGroups = item.taskGroups;
  5636. console.log(sss.taskGroups, '33333');
  5637. sss.auditUserList = obj.auditUserList;
  5638. sss.degreeId = item.degreeId;
  5639. sss.customData = item.customData;
  5640. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5641. //只有一个审核人,自动设置上去
  5642. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5643. }
  5644. sss.wuduList = item.wuduList;
  5645. this.zhoBaoIdx = i
  5646. this.zhoBaoName = names
  5647. this.zhoBao = sss
  5648. this.zhis = row
  5649. if (sss.groupId) {
  5650. //最后一个参数表示是否保留stage的值,不要重置为空
  5651. this.getGroupStages(this.zhoBao, 0, true)
  5652. }
  5653. this.$forceUpdate();
  5654. } else {
  5655. //第一次打开,获取数据
  5656. if (sss.id == -1) {
  5657. //新填报的
  5658. this.selectProject(obj, 0);
  5659. var that = this
  5660. setTimeout(() =>{
  5661. sss.subProjectId = that.workForm.domains[0].subProjectId
  5662. sss.subProjectList = item.subProjectList;
  5663. sss.stage = that.workForm.domains[0].stage
  5664. sss.subProjectList = that.workForm.domains[0].subProjectList
  5665. sss.stages = that.workForm.domains[0].stages
  5666. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5667. sss.auditUserList = obj.auditUserList;
  5668. sss.degreeId = item.degreeId;
  5669. sss.customData = item.customData;
  5670. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5671. //只有一个审核人,自动设置上去
  5672. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5673. }
  5674. sss.wuduList = row[0].wuduList
  5675. that.zhoBaoIdx = i
  5676. that.zhoBaoName = names
  5677. that.zhoBao = sss
  5678. that.zhis = row
  5679. if (sss.groupId) {
  5680. //最后一个参数表示是否保留stage的值,不要重置为空
  5681. this.getGroupStages(that.zhoBao, 0, false)
  5682. }
  5683. that.$forceUpdate();
  5684. },600);
  5685. } else {
  5686. //编辑填报过的;数据库已经存在的
  5687. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5688. }
  5689. }
  5690. },
  5691. // 按周填报里内容的填写点击确定
  5692. setWeekProItemData() {
  5693. //专业版模式下,任务分组和阶段必填
  5694. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5695. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5696. this.$message({
  5697. message: '任务分组和阶段必填,请检查',
  5698. type: "error"
  5699. });
  5700. return;
  5701. }
  5702. }
  5703. //检查子项目是否必填
  5704. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5705. this.$message({
  5706. message: '子项目必填,请检查',
  5707. type: "error"
  5708. });
  5709. return;
  5710. }
  5711. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5712. this.$message({
  5713. message: this.$t('message.Pleaseselectareviewer'),
  5714. type: "error"
  5715. });
  5716. return
  5717. }
  5718. if(this.user.timeType.reportAuditType == 3){
  5719. let auditTips = ''
  5720. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5721. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5722. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5723. if(auditTips){
  5724. auditTips = auditTips.substring(0,auditTips.length - 1)
  5725. this.$message({
  5726. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5727. type: 'error'
  5728. })
  5729. return
  5730. }
  5731. }
  5732. let errtips = ''
  5733. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  5734. errtips += this.user.timeType.customDegreeName + '、'
  5735. }
  5736. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5737. errtips += this.user.timeType.customDataName + '、'
  5738. }
  5739. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5740. errtips += this.user.timeType.customTextName + '、'
  5741. }
  5742. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5743. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5744. }
  5745. if(errtips){
  5746. errtips = errtips.substring(0,errtips.length - 1)
  5747. this.$message({
  5748. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5749. type: 'error'
  5750. })
  5751. return
  5752. }
  5753. this.tianxieDialogVisible = false
  5754. var zhong = this.zhoData
  5755. this.zhoBao.hasEdited = true;
  5756. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5757. this.zhoData = zhong
  5758. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5759. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5760. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5761. },
  5762. // 获取本周
  5763. getCurrentWeek() {
  5764. //今天
  5765. this.targetWeekDate = new Date();
  5766. this.initWeekFormData();
  5767. // this.jiazai()
  5768. },
  5769. // 获取上周
  5770. handleGetPrevWeek() {
  5771. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5772. this.initWeekFormData();
  5773. // this.jiazai()
  5774. },
  5775. // 获取下周
  5776. handleGetNextvWeek() {
  5777. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5778. this.initWeekFormData()
  5779. },
  5780. // 加载动画
  5781. jiazai() {
  5782. this.weekDataLoading = true
  5783. var that = this
  5784. setTimeout(() =>{
  5785. that.weekDataLoading = false
  5786. },1000);
  5787. },
  5788. // 转时间格式
  5789. dealdate(date) {
  5790. const dt = new Date(date)
  5791. const y = dt.getFullYear()
  5792. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5793. const d = (dt.getDate() + '').padStart(2, '0')
  5794. return `${y}-${m}-${d}`
  5795. },
  5796. // 按周填报
  5797. fillInReportss() {
  5798. window.addEventListener('scroll', this.handleScroll, true)
  5799. // this.jiazai()
  5800. this.fillWeekDialogVisi = true
  5801. this.getCurrentWeek();
  5802. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5803. //重新获取工时预警类型的预算项
  5804. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5805. companyId: this.user.companyId
  5806. },
  5807. res => {
  5808. if (res.code == "ok") {
  5809. this.timeBasecostList = res.data;
  5810. }
  5811. });
  5812. }
  5813. },
  5814. fillInReportCustom() {
  5815. this.weekIndex++
  5816. this.weekParentData = {
  5817. isSubstitude: this.isSubstitude
  5818. }
  5819. this.fillWeekDialogVisiCustom = true
  5820. },
  5821. // 按周填报的项目筛选
  5822. selListFun(){
  5823. this.selProjectList = []
  5824. if(this.selCon.length){
  5825. for (let i = 0; i < this.selCon.length; i++) {
  5826. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5827. }
  5828. this.selConShow = false ;
  5829. for (let i in this.zhoData) {
  5830. var obj = this.zhoData[i];
  5831. for(var j in this.selProjectList) {
  5832. var xinzhi = this.selProjectList[j].projectName
  5833. obj[xinzhi] = {}
  5834. obj[xinzhi].time = ''
  5835. obj[xinzhi].content = ''
  5836. obj[xinzhi].progress = 0
  5837. obj[xinzhi].workingTime = 0
  5838. }
  5839. }
  5840. this.initWeekFormData();
  5841. }else{
  5842. this.$message({
  5843. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5844. type:'error'
  5845. })
  5846. }
  5847. },
  5848. setWeekCardTimeData(list) {
  5849. for(let i in list){
  5850. let datei = '';
  5851. if (this.user.timeType.showDdCardtime == 1) {
  5852. datei = list[i].workDate;
  5853. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5854. datei = list[i].createDate;
  5855. } else if (this.user.timeType.syncFanwei == 1) {
  5856. datei = list[i].workDate;
  5857. }
  5858. for(let m in this.zhoData) {
  5859. if(datei == this.zhoData[m].zhoDataTime){
  5860. let item = {
  5861. startTime: list[i].startTime,
  5862. endTime: list[i].endTime,
  5863. workHours: list[i].workHours
  5864. }
  5865. this.$set(this.zhoData[m],'corpTime',item)
  5866. }
  5867. }
  5868. }
  5869. },
  5870. getWeeklyCardTime(){ //按周填报获取考勤信息
  5871. let dateStr = []
  5872. for(let i in this.zhoData){
  5873. dateStr.push(this.zhoData[i].zhoDataTime)
  5874. }
  5875. this.http.post('/report/getWeeklyCardTime',{
  5876. dateStr: JSON.stringify(dateStr)
  5877. },res => {
  5878. if(res.code == 'ok'){
  5879. for(let i in res.data){
  5880. let datei = '';
  5881. if (this.user.timeType.showDdCardtime == 1) {
  5882. datei = res.data[i].workDate.split('-');
  5883. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5884. datei = res.data[i].createDate.split('-');
  5885. }
  5886. for(let m in this.zhoData){
  5887. let datem = new Date(this.zhoData[m].zhoDataTime)
  5888. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  5889. let item = {
  5890. startTime: res.data[i].startTime,
  5891. endTime: res.data[i].endTime,
  5892. workHours: res.data[i].workHours
  5893. }
  5894. this.$set(this.zhoData[m],'corpTime',item)
  5895. }
  5896. }
  5897. }
  5898. }else{
  5899. this.$message({
  5900. message: res.msg,
  5901. type: 'error'
  5902. })
  5903. }
  5904. },err => {
  5905. this.$message({
  5906. message: err,
  5907. type: 'error'
  5908. })
  5909. })
  5910. },
  5911. selListqx(){
  5912. this.fillWeekDialogVisi = false
  5913. this.selProjectList = []
  5914. this.selCon = []
  5915. },
  5916. handleScroll() {
  5917. this.changdu = this.projectList.length + 1
  5918. },
  5919. // 自动选择时间点的事件
  5920. // async zhoTimes(item, i) {
  5921. // var iss = i
  5922. // if(item.time == null) {
  5923. // return
  5924. // } else {
  5925. // const zhi = this.zhoData[iss];
  5926. // let he = 0;
  5927. // const timeArr = Object.values(zhi)
  5928. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  5929. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  5930. // const data = await this.getWeekHoursByTimeRange(timeArr);
  5931. // console.log(data, 'data');
  5932. // zhi.he = `${he}h`;
  5933. // }
  5934. // },
  5935. async zhoTimes(item, index) {
  5936. const zho = this.zhoData[index];
  5937. if (!item.time) {
  5938. return;
  5939. }
  5940. const timeArr = Object.values(zho)
  5941. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  5942. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  5943. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  5944. zho.he = `${totalHours[0]}h`;
  5945. },
  5946. // 判断两个时间段是否重叠
  5947. timeOverlap(idx, dateAr) {
  5948. let zhi = 0
  5949. for (let k in dateAr) {
  5950. if (idx !== k) {
  5951. 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))) {
  5952. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  5953. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  5954. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  5955. }
  5956. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  5957. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5958. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  5959. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  5960. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5961. } else {
  5962. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  5963. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  5964. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  5965. }
  5966. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  5967. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  5968. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  5969. }
  5970. }
  5971. }
  5972. }
  5973. }
  5974. return zhi
  5975. },
  5976. // 计算时间
  5977. getHourMinutes(str, end) {
  5978. var he = 0
  5979. var date2 = '2021/12/12 ' + end +':00'
  5980. var date1 = '2021/12/12 ' + str +':00'
  5981. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  5982. var leave1=date3%(24*3600*1000)
  5983. var hours=Math.floor(leave1/(3600*1000))
  5984. var leave2=leave1%(3600*1000)
  5985. var minutes=Math.floor(leave2/(60*1000))
  5986. var shi = hours+'.'+ minutes
  5987. return he += +shi
  5988. },
  5989. // 自动选择事件长度的事件
  5990. zhoXuan(item, i) {
  5991. var iss = i
  5992. if(item.time == null) {
  5993. return
  5994. } else {
  5995. var zhi = this.zhoData[iss]
  5996. var he = 0
  5997. for(var i in zhi) {
  5998. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  5999. he += +zhi[i].workingTime
  6000. }
  6001. }
  6002. zhi.he = he + 'h'
  6003. }
  6004. },
  6005. getPushWorkLogData(){
  6006. this.http.post('/sap-sync-log/list', {},
  6007. res => {
  6008. if (res.code == "ok") {
  6009. this.pushWorkTimeLogData = res.data;
  6010. } else {
  6011. this.$message({
  6012. message: res.msg,
  6013. type: "error"
  6014. });
  6015. }
  6016. },
  6017. error => {
  6018. this.$message({
  6019. message: error,
  6020. type: "error"
  6021. });
  6022. });
  6023. },
  6024. // 获取全部人员
  6025. getUsers() {
  6026. this.http.post('/user/getSimpleActiveUserList', {},
  6027. res => {
  6028. if (res.code == "ok") {
  6029. this.usersList = res.data;
  6030. } else {
  6031. this.$message({
  6032. message: res.msg,
  6033. type: "error"
  6034. });
  6035. }
  6036. },
  6037. error => {
  6038. this.$message({
  6039. message: error,
  6040. type: "error"
  6041. });
  6042. });
  6043. },
  6044. // 按时间比例
  6045. addBli(item, i) {
  6046. var iss = i
  6047. if(item.time == null) {
  6048. return
  6049. } else {
  6050. var zhi = this.zhoData[iss]
  6051. var he = 0
  6052. for(var i in zhi) {
  6053. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6054. he += +zhi[i].workingTime
  6055. }
  6056. }
  6057. zhi.he = he.toFixed(1) + 'h'
  6058. }
  6059. },
  6060. //按周填报选择的项目发生变化,需要设置列
  6061. onSelProjectChange() {
  6062. for (let i = 0; i < this.selCon.length; i++) {
  6063. var exists = false;
  6064. for (let j = 0; j < this.selProjectList.length; j++) {
  6065. if (this.selProjectList[j].id == this.selCon[i]) {
  6066. exists = true;
  6067. break;
  6068. }
  6069. }
  6070. if (!exists) {
  6071. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6072. this.selProjectList.push(newProject);
  6073. //添加新项目
  6074. for (var w in this.zhoData) {
  6075. var dayItem = this.zhoData[w];
  6076. var pName = newProject.projectName;
  6077. dayItem[pName] = {};
  6078. dayItem[pName].time = ''
  6079. dayItem[pName].content = ''
  6080. dayItem[pName].progress = 0
  6081. dayItem[pName].workingTime = 0
  6082. }
  6083. }
  6084. }
  6085. //去掉
  6086. for (let j = 0; j < this.selProjectList.length; j++) {
  6087. var exists = false;
  6088. for (let i = 0; i < this.selCon.length; i++) {
  6089. if (this.selProjectList[j].id == this.selCon[i]) {
  6090. exists = true;
  6091. break;
  6092. }
  6093. }
  6094. if (!exists) {
  6095. this.selProjectList.splice(j, 1);
  6096. j--;
  6097. }
  6098. }
  6099. this.loadFilledWeekReportItem();
  6100. //刷新表格
  6101. // this.$refs.weekTable.doLayout();
  6102. },
  6103. //根据选中的项目来刷新填写表格
  6104. loadFilledWeekReportItem() {
  6105. for (var w in this.zhoData) {
  6106. var dayItem = this.zhoData[w];
  6107. for (var i = 0; i < this.selProjectList.length; i++) {
  6108. var curColumnProject = this.selProjectList[i];
  6109. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6110. for (var t in dayItem.reportList) {
  6111. //有日报的项目,不能取消选择
  6112. for (var p in this.fillProjectList) {
  6113. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6114. }
  6115. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6116. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6117. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6118. if (this.reportTimeType.type == 2) {
  6119. //时间段模式
  6120. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6121. }
  6122. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6123. break;
  6124. }
  6125. }
  6126. // dayItem[curColumnProject.projectName] = matchReportItem;
  6127. }
  6128. }
  6129. this.$nextTick(()=>{
  6130. this.$refs.weekTable.doLayout();
  6131. });
  6132. },
  6133. initWeekFormData() {
  6134. this.weekDataLoading = true;
  6135. for (var p in this.fillProjectList) {
  6136. this.fillProjectList[p].canCancel = 1;
  6137. }
  6138. this.http.post('/report/getWeeklyReportData',{
  6139. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6140. },res => {
  6141. this.weekDataLoading = false;
  6142. if(res.code == 'ok'){
  6143. let projectList = res.data.projectList;
  6144. if (projectList.length > 0) {
  6145. //有选择过项目进行填报,直接选中
  6146. this.selProjectList = projectList;
  6147. this.selCon = [];
  6148. for (let i = 0; i < projectList.length; i++) {
  6149. this.selCon.push(projectList[i].id);
  6150. }
  6151. }
  6152. //设置日期
  6153. this.weekDateRange = res.data.dateList;
  6154. this.zhoData = [];
  6155. var arrst = []
  6156. for(var i in this.weekDateRange) {
  6157. var obj = {}
  6158. obj.zhoDataTime = this.weekDateRange[i].date
  6159. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6160. obj.he = this.weekDateRange[i].filledTime;
  6161. obj.canFill = this.weekDateRange[i].canFill;
  6162. // obj.filledTime = this.weekDateRange[i].filledTime;
  6163. obj.reportList = this.weekDateRange[i].reportList;
  6164. //初始化,防止渲染报错
  6165. for (var j = 0; j < this.selProjectList.length; j++) {
  6166. var pName = this.selProjectList[j].projectName
  6167. obj[pName] = {}
  6168. obj[pName].time = ''
  6169. obj[pName].content = ''
  6170. obj[pName].progress = 0
  6171. obj[pName].workingTime = 0
  6172. }
  6173. arrst.push(obj)
  6174. }
  6175. this.zhoData = arrst
  6176. this.setWeekCardTimeData(res.data.cardTimeList);
  6177. this.loadFilledWeekReportItem();
  6178. }else{
  6179. this.$message({
  6180. message: res.msg,
  6181. type: 'error'
  6182. })
  6183. }
  6184. },err => {
  6185. this.$message({
  6186. message: err,
  6187. type: 'error'
  6188. })
  6189. })
  6190. },
  6191. zhoZhi(res, i) {
  6192. var zhi = 0
  6193. for(var i in res) {
  6194. if(i != 'zhoDataTime' && i != 'he') {
  6195. zhi += +res[i]
  6196. }
  6197. }
  6198. res.he = zhi
  6199. },
  6200. zhoBtn(i) {
  6201. // this.zhoData.split(i, 1)
  6202. var arr = this.zhoData
  6203. arr.splice(i, 1)
  6204. },
  6205. zhoAddlast(){
  6206. this.selConShow = true
  6207. },
  6208. closeAddWeeklyReport(){
  6209. this.fillWeekDialogVisi = false
  6210. this.selConShow = true
  6211. this.selProjectList = []
  6212. this.selCon = []
  6213. },
  6214. // 提交按周填报
  6215. submitWeekReport(isDraft) {
  6216. var zhi = this.zhoData
  6217. var ll = 0
  6218. if(this.reportTimeType.type == 2) {
  6219. for(var i in zhi) {
  6220. this.dateAr = []
  6221. var alp = []
  6222. var zhis = zhi[i]
  6223. console.log(zhis)
  6224. for(var j in zhis) {
  6225. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6226. let objs = {}
  6227. objs.s = zhis[j].time[0]
  6228. objs.e = zhis[j].time[1]
  6229. objs.p = j
  6230. alp.push(objs)
  6231. }
  6232. }
  6233. console.log(alp)
  6234. this.dateAr = alp
  6235. if (this.reportTimeType.timeCanOverlap == 0) {
  6236. let str = this.$t('message.Filledtimeperiodsoverlap')
  6237. if(this.dateAr.length > 0) {
  6238. const trus = this.fns();
  6239. const overlapDataTime = this.getOverlapData(alp);
  6240. if (overlapDataTime.length > 0) {
  6241. const arrList = overlapDataTime.map((item) => item.p);
  6242. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6243. }
  6244. ll += 1
  6245. if(!trus) {
  6246. this.$message({
  6247. message: str,
  6248. type: 'error'
  6249. })
  6250. return false
  6251. }
  6252. }
  6253. } else {
  6254. if(this.dateAr.length > 0) {
  6255. ll +=1 ;
  6256. }
  6257. }
  6258. }
  6259. if(ll == 0) {
  6260. this.$message({
  6261. message: this.$t('message.Pleasefillinthetime'),
  6262. type: 'error'
  6263. })
  6264. return false
  6265. }
  6266. } else if(this.reportTimeType.type == 1){
  6267. for(var i in zhi) {
  6268. var zhis = zhi[i]
  6269. for(var j in zhis) {
  6270. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6271. ll += 1
  6272. }
  6273. }
  6274. }
  6275. if(ll == 0) {
  6276. this.$message({
  6277. message: this.$t('message.Pleaseselectatime'),
  6278. type: 'error'
  6279. })
  6280. return false
  6281. }
  6282. let overcorp = ''
  6283. for(let n in zhi){
  6284. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6285. overcorp += zhi[n].zhoDataTime + ','
  6286. }
  6287. }
  6288. if(overcorp != ''){
  6289. overcorp = overcorp.substring(0,overcorp.length - 1)
  6290. this.$message({
  6291. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6292. type: 'error'
  6293. })
  6294. return
  6295. }
  6296. }
  6297. var submits = []
  6298. let formData = new FormData();
  6299. formData.append("draft", isDraft);
  6300. if(this.reportTimeType.multiWorktime == 1){
  6301. for (var i in this.zhoData) {
  6302. var zhoD = this.zhoData[i]
  6303. var flgs = false
  6304. for(var j in zhoD) {
  6305. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6306. flgs = true
  6307. // formData.append("degreeId", "-1");
  6308. formData.append("id", '-1');
  6309. for(var s in this.projectList) {
  6310. if(j == this.projectList[s].projectName) {
  6311. formData.append("projectId", this.projectList[s].id);
  6312. }
  6313. }
  6314. if(this.user.timeType.reportAuditType == 3){
  6315. let audItem = {}
  6316. if(this.user.timeType.auditLevel > 0){
  6317. audItem.auditorFirst = zhoD[j].auditorFirst
  6318. }
  6319. if(this.user.timeType.auditLevel > 1){
  6320. audItem.auditorSec = zhoD[j].auditorSec
  6321. }
  6322. if(this.user.timeType.auditLevel > 2){
  6323. audItem.auditorThird = zhoD[j].auditorThird
  6324. }
  6325. if(zhoD[j].ccUserid){
  6326. audItem.ccUserid = zhoD[j].ccUserid
  6327. }
  6328. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6329. }
  6330. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6331. formData.append("taskId", 0);
  6332. formData.append("reportTimeType", this.reportTimeType.type);
  6333. formData.append("endTime", '');
  6334. formData.append("startTime", '');
  6335. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6336. var lix = []
  6337. var objjs = {}
  6338. objjs.startTime = zhoD[j].time[0]
  6339. objjs.endTime = zhoD[j].time[1]
  6340. if (zhoD[j].content == null || zhoD[j].content == '') {
  6341. zhoD[j].content == '-'
  6342. }
  6343. objjs.content = zhoD[j].content
  6344. lix.push(objjs)
  6345. var zhiZhi = JSON.stringify(lix)
  6346. zhiZhi = zhiZhi.replace(/,/g,"@");
  6347. formData.append("content", zhiZhi)
  6348. formData.append("isOvertime", 0)
  6349. formData.append("professionProgress", "[]")
  6350. if (zhoD[j].groupId) {
  6351. formData.append("groupId",zhoD[j].groupId)
  6352. } else {
  6353. //解决后台groupId数组越界的问题
  6354. formData.append("groupId",0)
  6355. }
  6356. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6357. formData.append("createDate",zhoD.zhoDataTime)
  6358. if (zhoD[j].projectAuditorId) {
  6359. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6360. }
  6361. if(zhoD[j].basecostId) {
  6362. formData.append("basecostId", zhoD[j].basecostId);
  6363. } else {
  6364. formData.append("basecostId", 0);
  6365. }
  6366. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6367. formData.append('degreeId',zhoD[j].degreeId)
  6368. }else{
  6369. formData.append("degreeId", "-1");
  6370. }
  6371. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6372. formData.append('customData',zhoD[j].customData)
  6373. }else if(this.user.timeType.customDataActive){
  6374. formData.append('customData',0)
  6375. }
  6376. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6377. formData.append('customText',zhoD[j].customText)
  6378. }else if(this.user.timeType.customTextActive){
  6379. formData.append('customText','-')
  6380. }
  6381. }
  6382. }
  6383. }
  6384. } else {
  6385. for (var i in this.zhoData) {
  6386. var zhoD = this.zhoData[i]
  6387. var flgs = false
  6388. if(this.reportTimeType.type == 2) {
  6389. for(var k in this.selProjectList) {
  6390. var pItem = this.selProjectList[k];
  6391. var pName = pItem.projectName;
  6392. var j = pName;
  6393. console.log('j==周报中的项目='+j);
  6394. if(zhoD[j].time && zhoD[j].time != 'null') {
  6395. flgs = true
  6396. // formData.append("degreeId", "-1");
  6397. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6398. for(var s in this.projectList) {
  6399. if(j == this.projectList[s].projectName) {
  6400. formData.append("projectId", this.projectList[s].id);
  6401. }
  6402. }
  6403. if(this.user.timeType.reportAuditType == 3){
  6404. let audItem = {}
  6405. if(this.user.timeType.auditLevel > 0){
  6406. audItem.auditorFirst = zhoD[j].auditorFirst
  6407. }
  6408. if(this.user.timeType.auditLevel > 1){
  6409. audItem.auditorSec = zhoD[j].auditorSec
  6410. }
  6411. if(this.user.timeType.auditLevel > 2){
  6412. audItem.auditorThird = zhoD[j].auditorThird
  6413. }
  6414. if(zhoD[j].ccUserid){
  6415. audItem.ccUserid = zhoD[j].ccUserid
  6416. }
  6417. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6418. }
  6419. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6420. formData.append("taskId", 0);
  6421. formData.append("reportTimeType", this.reportTimeType.type);
  6422. formData.append("endTime", zhoD[j].time[1]);
  6423. formData.append("startTime", zhoD[j].time[0]);
  6424. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6425. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6426. formData.append("isOvertime", 0)
  6427. formData.append("professionProgress", "[]")
  6428. if (zhoD[j].groupId) {
  6429. formData.append("groupId",zhoD[j].groupId)
  6430. } else {
  6431. //解决后台groupId数组越界的问题
  6432. formData.append("groupId",0)
  6433. }
  6434. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6435. formData.append("createDate",zhoD.zhoDataTime)
  6436. if (zhoD[j].projectAuditorId) {
  6437. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6438. }
  6439. if(zhoD[j].basecostId) {
  6440. formData.append("basecostId", zhoD[j].basecostId);
  6441. } else {
  6442. formData.append("basecostId", 0);
  6443. }
  6444. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6445. formData.append('degreeId',zhoD[j].degreeId)
  6446. }else{
  6447. formData.append("degreeId", "-1");
  6448. }
  6449. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6450. formData.append('customData',zhoD[j].customData)
  6451. }else if(this.user.timeType.customDataActive){
  6452. formData.append('customData',0)
  6453. }
  6454. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6455. formData.append('customText',zhoD[j].customText)
  6456. }else if(this.user.timeType.customTextActive){
  6457. formData.append('customText','-')
  6458. }
  6459. }
  6460. }
  6461. } else {
  6462. for(var k in this.selProjectList) {
  6463. var pItem = this.selProjectList[k];
  6464. var pName = pItem.projectName;
  6465. var j = pName;
  6466. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6467. flgs = true
  6468. // formData.append("degreeId", "-1");
  6469. console.log('进入了workFpppp==='+j);
  6470. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6471. for(var s in this.projectList) {
  6472. if(j == this.projectList[s].projectName) {
  6473. formData.append("projectId", this.projectList[s].id);
  6474. }
  6475. }
  6476. if(this.user.timeType.reportAuditType == 3){
  6477. let audItem = {}
  6478. if(this.user.timeType.auditLevel > 0){
  6479. audItem.auditorFirst = zhoD[j].auditorFirst
  6480. }
  6481. if(this.user.timeType.auditLevel > 1){
  6482. audItem.auditorSec = zhoD[j].auditorSec
  6483. }
  6484. if(this.user.timeType.auditLevel > 2){
  6485. audItem.auditorThird = zhoD[j].auditorThird
  6486. }
  6487. if(zhoD[j].ccUserid){
  6488. audItem.ccUserid = zhoD[j].ccUserid
  6489. }
  6490. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6491. }
  6492. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6493. // formData.append("subProjectId", zhoD[j].subProjectId);
  6494. formData.append("taskId", 0);
  6495. formData.append("reportTimeType", this.reportTimeType.type);
  6496. if(this.reportTimeType.type == 1) {
  6497. formData.append("workingTime", zhoD[j].workingTime);
  6498. } else if(this.reportTimeType.type == 2) {
  6499. formData.append("endTime", zhoD[j].time[1]);
  6500. formData.append("startTime", zhoD[j].time[0]);
  6501. } else if(this.reportTimeType.type == 3) {
  6502. formData.append("progress", zhoD[j].progress);
  6503. formData.append("workingTime", zhoD[j].workingTime);
  6504. }
  6505. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6506. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6507. formData.append("isOvertime", 0)
  6508. formData.append("professionProgress", "[]")
  6509. if (zhoD[j].groupId) {
  6510. formData.append("groupId",zhoD[j].groupId)
  6511. } else {
  6512. //解决后台groupId数组越界的问题
  6513. formData.append("groupId",0)
  6514. }
  6515. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6516. formData.append("createDate",zhoD.zhoDataTime)
  6517. if (zhoD[j].projectAuditorId) {
  6518. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6519. }
  6520. if(zhoD[j].basecostId) {
  6521. formData.append("basecostId", zhoD[j].basecostId);
  6522. } else {
  6523. formData.append("basecostId", 0);
  6524. }
  6525. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  6526. formData.append('degreeId',zhoD[j].degreeId)
  6527. }else{
  6528. formData.append("degreeId", "-1");
  6529. }
  6530. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6531. formData.append('customData',zhoD[j].customData)
  6532. }else if(this.user.timeType.customDataActive){
  6533. formData.append('customData',0)
  6534. }
  6535. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6536. formData.append('customText',zhoD[j].customText)
  6537. }else if(this.user.timeType.customTextActive){
  6538. formData.append('customText','-')
  6539. }
  6540. }
  6541. }
  6542. }
  6543. }
  6544. }
  6545. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6546. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6547. if(!next) {
  6548. this.$message({
  6549. message: `【${error.join('、')}】请填写任务分组`,
  6550. type: 'error'
  6551. })
  6552. return
  6553. }
  6554. // 自定义维度
  6555. this.submitingReport = true;
  6556. this.http.uploadFile( this.port.report.editPort, formData,
  6557. res => {
  6558. // this.listLoading = false;
  6559. this.submitingReport = false;
  6560. if (res.code == "ok") {
  6561. this.$message({
  6562. message: this.$t('message.fillinsuccessfully'),
  6563. type: "success"
  6564. });
  6565. this.fillWeekDialogVisi = false
  6566. this.selConShow = true
  6567. this.zhoData = []
  6568. this.weekDateRange = ''
  6569. this.getReportList();
  6570. this.getDepartment();
  6571. // 关闭弹窗 并 清空
  6572. this.selProjectList = []
  6573. this.selCon = []
  6574. this.getRecentlyProject()
  6575. } else {
  6576. this.$message({
  6577. message: res.msg,
  6578. type: "error"
  6579. });
  6580. }
  6581. },
  6582. error => {
  6583. this.submitingReport = false;
  6584. this.$message({
  6585. message: error,
  6586. type: "error"
  6587. });
  6588. });
  6589. },
  6590. handleGroupAuditorData(data) {
  6591. const { reportAuditType } = this.user.timeType
  6592. if(reportAuditType != 1 && reportAuditType != 2) {
  6593. return {next: true}
  6594. }
  6595. let arrList = [];
  6596. Object.entries(data).forEach(([key, obj]) => {
  6597. Object.entries(obj).forEach(([projectName, projectData]) => {
  6598. if (projectData.workingTime && !projectData.groupId) {
  6599. arrList.push({
  6600. projectName,
  6601. date: obj.zhoDataTime,
  6602. dateText: obj.zhoDataTimeTxt
  6603. });
  6604. }
  6605. });
  6606. });
  6607. if(arrList.length > 0) {
  6608. return {
  6609. next: false,
  6610. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6611. }
  6612. } else {
  6613. return {
  6614. next: true,
  6615. error: [],
  6616. }
  6617. }
  6618. },
  6619. ChangeHourMinutestr (str) {
  6620. if (str !== "0" && str !== "" && str !== null) {
  6621. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6622. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6623. } else {
  6624. return "";
  6625. }
  6626. },
  6627. // 得到两个日期中间的日期
  6628. getdiffdate(stime,etime){
  6629. //初始化日期列表,数组
  6630. var diffdate = new Array();
  6631. var i=0;
  6632. //开始日期小于等于结束日期,并循环
  6633. while(stime<=etime){
  6634. diffdate[i] = stime;
  6635. //获取开始日期时间戳
  6636. var stime_ts = new Date(stime).getTime();
  6637. //增加一天时间戳后的日期
  6638. var next_date = stime_ts + (24*60*60*1000);
  6639. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6640. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6641. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6642. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6643. stime = next_dates_y+next_dates_m+next_dates_d;
  6644. //增加数组key
  6645. i++;
  6646. }
  6647. return diffdate;
  6648. },
  6649. // 添加模块
  6650. addDomain(i) {
  6651. var leftProgress = 10;
  6652. if (this.reportTimeType.type == 3) {
  6653. //计算已经待分配工时比例
  6654. let array = this.workForm.domains;
  6655. let totalProgress = 0;
  6656. for (var i=0;i<array.length; i++) {
  6657. totalProgress += array[i].progress;
  6658. }
  6659. if (totalProgress < 100) {
  6660. leftProgress = 100 - totalProgress;
  6661. }
  6662. }
  6663. var addItem = {
  6664. projectId: "",
  6665. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6666. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6667. ),
  6668. content: "",
  6669. progress:leftProgress,
  6670. state:2,//2-表示待提交
  6671. multiWorktime: this.reportTimeType.multiWorktime,
  6672. worktimeList:[{}],
  6673. canEdit: true,
  6674. auditorFirst: '',
  6675. auditorSec: '',
  6676. auditorThird: '',
  6677. ccUserid: ''
  6678. // degreeId: '',
  6679. };
  6680. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6681. this.$set(addItem,'isOvertime',true)
  6682. if(this.reportTimeType.type == 3){
  6683. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6684. }
  6685. }
  6686. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6687. //默认给第一个,必填字段
  6688. addItem.basecostId = this.timeBasecostList[0].id;
  6689. }
  6690. this.workForm.domains.push(addItem);
  6691. document.getElementById('workFormsItemBottom').scrollIntoView()
  6692. this.canEdit = true
  6693. if (this.reportTimeType.type == 0) {
  6694. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6695. var length = this.workForm.domains.length;
  6696. if (length == 2) {
  6697. this.showAddMore = false;
  6698. }
  6699. }
  6700. this.chuji()
  6701. this.seleChn()
  6702. },
  6703. // 移除模块
  6704. delDomain(i) {
  6705. this.workForm.domains.splice(i,1)
  6706. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6707. if (!this.originCanEdit) {
  6708. let iscan = false
  6709. for(let i in this.workForm.domains){
  6710. if(this.workForm.domains[i].canEdit){
  6711. iscan = true
  6712. }
  6713. }
  6714. this.canEdit = iscan
  6715. }
  6716. //检测当前剩下的一个,时间类型是否是全天
  6717. if (this.reportTimeType.type == 0) {
  6718. if (this.workForm.domains[0].timeType == 0) {
  6719. this.showAddMore = false;
  6720. } else {
  6721. this.showAddMore = true;
  6722. }
  6723. }
  6724. if(this.user.timeType.multiWorktime == 1) {
  6725. this.iptChangs()
  6726. } else {
  6727. this.seleChn(0)
  6728. }
  6729. },
  6730. // 改变月份
  6731. changeMonth() {
  6732. this.isWeekend = false
  6733. let date = new Date()
  6734. let nowmon = date.getMonth() + 1
  6735. let nowday = date.getDate()
  6736. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6737. if (this.isBatch == 0) {
  6738. if(this.user.timeType.fillAhead == 0){
  6739. let date_a = new Date(this.workForm.createDate)
  6740. if(date_a.getTime() > date.getTime()){
  6741. this.workForm.createDate = nowdate
  6742. }
  6743. }
  6744. //只有按天填报才能获取当天的日报
  6745. if(!this.isSubstitude){
  6746. let weekday = new Date(this.workForm.createDate).getDay()
  6747. if(this.user.companyId == 817){
  6748. if(weekday == 0){
  6749. this.isWeekend = true
  6750. }
  6751. }else{
  6752. if(weekday == 0 || weekday == 6){
  6753. this.isWeekend = true
  6754. }
  6755. }
  6756. this.getReport()
  6757. }
  6758. }else {
  6759. if(this.user.timeType.fillAhead == 0){
  6760. let date_a = new Date(this.workForm.createDate[1])
  6761. if(date_a.getTime() > date.getTime()){
  6762. this.workForm.createDate[1] = nowdate
  6763. let sdate = new Date(this.workForm.createDate[0])
  6764. let edate = new Date(this.workForm.createDate[1])
  6765. if(sdate > edate){
  6766. this.workForm.createDate[0] = this.workForm.createDate[1]
  6767. }
  6768. }
  6769. }
  6770. }
  6771. },
  6772. // 判断时间段
  6773. fns() {
  6774. for (let k in this.dateAr) {
  6775. if (!this.judege(k)) {
  6776. return false
  6777. }
  6778. }
  6779. return true
  6780. },
  6781. judege(idx){
  6782. for (let k in this.dateAr) {
  6783. if (idx !== k) {
  6784. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6785. return false
  6786. }
  6787. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6788. return false
  6789. }
  6790. }
  6791. }
  6792. return true
  6793. },
  6794. getOverlapData(data) {
  6795. let overlapData = [];
  6796. for (let i = 0; i < data.length; i++) {
  6797. for (let j = i + 1; j < data.length; j++) {
  6798. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6799. overlapData.push(data[i], data[j]);
  6800. }
  6801. }
  6802. }
  6803. return overlapData;
  6804. },
  6805. // 保存日报111111
  6806. submitReport(isDraft) {
  6807. this.isDraft = isDraft;
  6808. this.$refs.workForm.validate(valid => {
  6809. if (valid) {
  6810. if(this.totalReportHours < this.user.timeType.allday){
  6811. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6812. confirmButtonText: '确定',
  6813. cancelButtonText: '取消',
  6814. type: 'warning'
  6815. }).then(() => {
  6816. this.submitReportSon()
  6817. }).catch(() => {
  6818. });
  6819. }else{
  6820. this.submitReportSon()
  6821. }
  6822. }
  6823. });
  6824. },
  6825. submitReportSon() {
  6826. this.dateAr = []
  6827. //检查重叠
  6828. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6829. let alp = []
  6830. if(this.user.timeType.multiWorktime != 1) {
  6831. for(var p in this.workForm.domains) {
  6832. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6833. let objs = {}
  6834. objs.s = this.workForm.domains[p].startTime
  6835. objs.e = this.workForm.domains[p].endTime
  6836. alp.push(objs)
  6837. }
  6838. }
  6839. this.dateAr = alp
  6840. if(this.dateAr.length > 0) {
  6841. let trus = this.fns()
  6842. if(!trus) {
  6843. this.$message({
  6844. message: this.$t('message.Filledtimeperiodsoverlap'),
  6845. type: "error"
  6846. });
  6847. return
  6848. }
  6849. }
  6850. } else {
  6851. for(var p in this.workForm.domains) {
  6852. var slll = this.workForm.domains[p]
  6853. for(var o in slll.worktimeList) {
  6854. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  6855. let objs = {}
  6856. objs.s = slll.worktimeList[o].startTime
  6857. objs.e = slll.worktimeList[o].endTime
  6858. alp.push(objs)
  6859. }
  6860. }
  6861. }
  6862. this.dateAr = alp
  6863. if(this.dateAr.length > 0) {
  6864. let trus = this.fns()
  6865. if(!trus) {
  6866. this.$message({
  6867. message: this.$t('message.Filledtimeperiodsoverlap'),
  6868. type: "error"
  6869. });
  6870. return
  6871. }
  6872. }
  6873. }
  6874. }
  6875. //检查子项目
  6876. if (this.user.timeType.subProMustFill == 1) {
  6877. for(var p in this.workForm.domains) {
  6878. var oneProItem = this.workForm.domains[p]
  6879. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  6880. //没有选择子项目
  6881. this.$message({
  6882. message: '子项目必填,请检查',
  6883. type: "error"
  6884. });
  6885. return
  6886. }
  6887. }
  6888. }
  6889. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  6890. if (this.user.companyId == this.yuzhongCompId) {
  6891. for(var p in this.workForm.domains) {
  6892. var oneProItem = this.workForm.domains[p]
  6893. if (!oneProItem.extraField1) {
  6894. this.$message({
  6895. message: '角色必填,请检查',
  6896. type: "error"
  6897. });
  6898. return
  6899. }
  6900. if (!oneProItem.extraField2) {
  6901. this.$message({
  6902. message: '工作职责必填,请检查',
  6903. type: "error"
  6904. });
  6905. return
  6906. }
  6907. if (!oneProItem.extraField3) {
  6908. this.$message({
  6909. message: '工作内容必填,请检查',
  6910. type: "error"
  6911. });
  6912. return
  6913. }
  6914. }
  6915. }
  6916. // return
  6917. //代填的情况,检查人员是否已经选择
  6918. if (this.isSubstitude) {
  6919. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  6920. this.$message({
  6921. message: this.$t('message.pleaseselectthepersontofillin'),
  6922. type: "error"
  6923. });
  6924. return;
  6925. }
  6926. }
  6927. //检查时间,全天和上下午不能同时存在
  6928. if (this.reportTimeType.type == 0) {
  6929. var alldayNum = 0;
  6930. var amNum = 0;
  6931. var pmNum = 0;
  6932. for(var i in this.workForm.domains) {
  6933. if (this.workForm.domains[i].timeType == 0) {
  6934. alldayNum ++;
  6935. } else if (this.workForm.domains[i].timeType == 1) {
  6936. amNum++;
  6937. } else if (this.workForm.domains[i].timeType == 2) {
  6938. pmNum++;
  6939. }
  6940. }
  6941. if (alldayNum > 1) {
  6942. this.$message({
  6943. // message: "工作时间-全天,只能选择一次",
  6944. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  6945. type: "error"
  6946. });
  6947. return;
  6948. }
  6949. if (amNum > 1) {
  6950. this.$message({
  6951. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  6952. type: "error"
  6953. });
  6954. return;
  6955. }
  6956. if (pmNum > 1) {
  6957. this.$message({
  6958. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  6959. type: "error"
  6960. });
  6961. return;
  6962. }
  6963. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  6964. this.$message({
  6965. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  6966. type: "error"
  6967. });
  6968. return;
  6969. }
  6970. } else if (this.reportTimeType.type == 3) {
  6971. //总百分比不能超过100%
  6972. let total = 0;
  6973. this.workForm.domains.forEach(w=>{total += w.progress});
  6974. if (total > 100) {
  6975. this.$message({
  6976. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  6977. type: "error"
  6978. });
  6979. return;
  6980. } else if (total < 100) {
  6981. this.$message({
  6982. message: this.$t('message.cannotbesubmitted'),
  6983. type: "error"
  6984. });
  6985. return;
  6986. }
  6987. }
  6988. this.listLoading = true;
  6989. let formData = new FormData();
  6990. formData.append("draft", this.isDraft);
  6991. var totalTime = 0;
  6992. for (var t=0;t<this.workForm.domains.length; t++) {
  6993. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  6994. }
  6995. //批量填报不校验考勤时长,交给后台校验
  6996. if (!this.isBatch) {
  6997. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  6998. if (this.workForm.time){
  6999. if (this.workForm.time.workHours == 0){
  7000. this.$message({
  7001. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7002. type: 'error'
  7003. })
  7004. return
  7005. }
  7006. }else{
  7007. this.$message({
  7008. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7009. type: 'error'
  7010. })
  7011. return
  7012. }
  7013. }
  7014. }
  7015. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7016. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7017. this.$message({
  7018. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7019. type: "error"
  7020. });
  7021. return;
  7022. }
  7023. }
  7024. for(var i in this.workForm.domains) {
  7025. if(this.user.timeType.reportAuditType == 3){
  7026. let audItem = {}
  7027. let auditRule = ''
  7028. if(this.workForm.domains[i].id){
  7029. audItem.reportId = this.workForm.domains[i].id
  7030. }
  7031. if(this.user.timeType.auditLevel > 0){
  7032. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7033. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7034. }
  7035. if(this.user.timeType.auditLevel > 1){
  7036. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7037. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7038. }
  7039. if(this.user.timeType.auditLevel > 2){
  7040. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7041. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7042. }
  7043. if(this.workForm.domains[i].ccUserid){
  7044. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7045. }
  7046. if(auditRule){
  7047. auditRule = auditRule.substring(0,auditRule.length - 1)
  7048. this.$message({
  7049. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7050. type: 'error'
  7051. })
  7052. return
  7053. }
  7054. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7055. }
  7056. if(this.workForm.domains[i].degreeId) {
  7057. // var sss = this.workForm.domains[i].degreeId.toString()
  7058. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7059. } else {
  7060. formData.append("degreeId", -1);
  7061. }
  7062. if(this.workForm.domains[i].customData) {
  7063. // var sss = this.workForm.domains[i].degreeId.toString()
  7064. formData.append("customData", this.workForm.domains[i].customData);
  7065. } else {
  7066. formData.append("customData", 0);
  7067. }
  7068. if(this.workForm.domains[i].customText) {
  7069. formData.append("customText", this.workForm.domains[i].customText);
  7070. } else {
  7071. formData.append("customText", '-');
  7072. }
  7073. if (this.workForm.domains[i].id) {
  7074. formData.append("id", this.workForm.domains[i].id);
  7075. } else {
  7076. formData.append("id", -1);
  7077. }
  7078. formData.append("projectId", this.workForm.domains[i].projectId);
  7079. if (this.workForm.domains[i].subProjectId) {
  7080. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7081. } else {
  7082. formData.append("subProjectId", 0);
  7083. }
  7084. if (this.workForm.domains[i].groupId) {
  7085. formData.append("groupId", this.workForm.domains[i].groupId);
  7086. } else {
  7087. formData.append("groupId", 0);
  7088. }
  7089. if (this.workForm.domains[i].taskId) {
  7090. formData.append("taskId", this.workForm.domains[i].taskId);
  7091. } else {
  7092. formData.append("taskId", 0);
  7093. }
  7094. if (this.workForm.domains[i].taskFinish == true) {
  7095. formData.append("taskFinish", 1);
  7096. } else {
  7097. formData.append("taskFinish", 0);
  7098. }
  7099. formData.append("reportTimeType", this.reportTimeType.type);
  7100. if (this.reportTimeType.type == 0) {
  7101. formData.append("timeType", this.workForm.domains[i].timeType);
  7102. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7103. formData.append("workingTime", workingTime);
  7104. } else if (this.reportTimeType.type == 1){
  7105. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7106. } else if (this.reportTimeType.type == 2) {
  7107. formData.append("endTime", this.workForm.domains[i].endTime);
  7108. formData.append("startTime", this.workForm.domains[i].startTime);
  7109. } else if (this.reportTimeType.type == 3) {
  7110. //按比例分配
  7111. formData.append("progress", this.workForm.domains[i].progress);
  7112. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7113. }
  7114. if(this.user.timeType.choseFromAlbum == 1 ) {
  7115. console.log(this.workForm.domains[i].imgList)
  7116. if(this.workForm.domains[i].imgList) {
  7117. let imgListFor = this.workForm.domains[i].imgList
  7118. for(var b in imgListFor) {
  7119. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7120. }
  7121. console.log(imgListFor)
  7122. let m = JSON.stringify(imgListFor);
  7123. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7124. formData.append("picStr", m);
  7125. } else {
  7126. formData.append("picStr", '[]');
  7127. }
  7128. }
  7129. //处理多个时间事项
  7130. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7131. if (this.reportTimeType.multiWorktime == 1) {
  7132. //检查时间是否有重叠
  7133. var workList = this.workForm.domains[i].worktimeList;
  7134. for (var j=0;j<workList.length; j++) {
  7135. var curItem = workList[j];
  7136. //检查开始时间是否大于结束时间
  7137. if (curItem.startTime >= curItem.endTime) {
  7138. this.$message({
  7139. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7140. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7141. type: "error"
  7142. });
  7143. return;
  7144. }
  7145. //时间不可重叠
  7146. if (this.reportTimeType.timeCanOverlap == 0) {
  7147. for (var p = j+1;p<workList.length; p++) {
  7148. var jItem = workList[p];
  7149. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7150. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7151. this.$message({
  7152. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7153. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7154. type: "error"
  7155. });
  7156. return;
  7157. }
  7158. }
  7159. }
  7160. }
  7161. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7162. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7163. formData.append("content", m);
  7164. } else {
  7165. if (this.workForm.domains[i].content) {
  7166. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7167. m = m.replace(/,/g,",");
  7168. console.log(m, '需要传值的数据')
  7169. // formData.append("content", this.workForm.domains[i].content);
  7170. formData.append("content", m);
  7171. } else {
  7172. formData.append("content", '-');
  7173. }
  7174. }
  7175. if (this.isBatch == 0) {
  7176. formData.append("createDate", this.workForm.createDate);
  7177. } else {
  7178. //批量填报,时间范围
  7179. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7180. }
  7181. if(this.workForm.domains[i].isOvertime) {
  7182. formData.append("isOvertime", 1);
  7183. } else {
  7184. formData.append("isOvertime", 0);
  7185. }
  7186. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7187. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7188. } else {
  7189. formData.append("overtimeHours", 0);
  7190. }
  7191. if(this.workForm.domains[i].basecostId) {
  7192. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7193. } else {
  7194. formData.append("basecostId", 0);
  7195. }
  7196. if (this.workForm.userId != null) {
  7197. var targetUids = '';
  7198. this.workForm.userId.forEach(u=>{
  7199. targetUids += u + '@';
  7200. });
  7201. if (targetUids.length > 0) {
  7202. targetUids = targetUids.substring(0, targetUids.length -1);
  7203. formData.append("targetUids", targetUids);
  7204. }
  7205. }
  7206. //项目专业进度
  7207. if (this.workForm.domains[i].professionProgress) {
  7208. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7209. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7210. formData.append("professionProgress", m);
  7211. } else {
  7212. formData.append("professionProgress", "[]");
  7213. }
  7214. if (this.workForm.domains[i].stage) {
  7215. formData.append("stage", this.workForm.domains[i].stage);
  7216. } else {
  7217. formData.append("stage", "-");
  7218. }
  7219. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7220. if (this.workForm.domains[i].projectAuditorId) {
  7221. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7222. } else {
  7223. // console.log('执行到了这里')
  7224. // console.log(this.user.timeType.reportAuditType)
  7225. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7226. this.$message({
  7227. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7228. type: "error"
  7229. });
  7230. return;
  7231. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7232. //分组负责人先审核, 确定是选择了任务分组
  7233. if (this.workForm.domains[i].taskGroups.length == 0) {
  7234. this.$message({
  7235. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7236. type: "error"
  7237. });
  7238. } else if (!this.workForm.domains[i].groupId) {
  7239. // console.log(this.workForm.domains[i]);
  7240. this.$message({
  7241. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7242. type: "error"
  7243. });
  7244. } else {
  7245. this.$message({
  7246. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7247. type: "error"
  7248. });
  7249. }
  7250. return;
  7251. }
  7252. }
  7253. if (this.user.companyId == this.yuzhongCompId) {
  7254. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7255. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7256. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7257. }
  7258. //依斯贝的服务Id
  7259. if (this.user.companyId == this.yisibeiCompId) {
  7260. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7261. }
  7262. }
  7263. this.submitingReport = true;
  7264. this.http.uploadFile( this.port.report.editPort, formData,
  7265. res => {
  7266. this.listLoading = false;
  7267. this.submitingReport = false;
  7268. if (res.code == "ok") {
  7269. if(res.msg!=null){
  7270. this.$message({
  7271. dangerouslyUseHTMLString: true,
  7272. message: res.msg,
  7273. type: "warning",
  7274. showClose: true,
  7275. duration: 0
  7276. });
  7277. }else{
  7278. this.$message({
  7279. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7280. type: "success"
  7281. });
  7282. }
  7283. this.dialogVisible = false;
  7284. this.jsDay = 0
  7285. this.jsTime = 0
  7286. this.getReportList();
  7287. this.getDepartment();
  7288. this.getRecentlyProject()
  7289. } else {
  7290. this.$message({
  7291. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7292. type: "error"
  7293. });
  7294. }
  7295. },
  7296. error => {
  7297. this.listLoading = false;
  7298. this.submitingReport = false;
  7299. this.$message({
  7300. message: error,
  7301. type: "error"
  7302. });
  7303. });
  7304. },
  7305. // 判断是展示那个工时导入
  7306. imports() {
  7307. if(this.user.timeType.syncCorpwxTime == 0) {
  7308. this.importDialog = true
  7309. } else {
  7310. this.importWxDialog = true
  7311. }
  7312. },
  7313. // 跳转
  7314. junpToDeskTop(id) {
  7315. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7316. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7317. },
  7318. // 通过日报
  7319. approve(id, item) {
  7320. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7321. this.approveinData = {
  7322. id: id,
  7323. date: this.date +day,
  7324. reportIds: item.id
  7325. }
  7326. if(this.user.timeType.needEvaluate == 1){
  7327. this.$set(this.approveinData,'evaluate','')
  7328. this.approveinDialog = true
  7329. }else{
  7330. this.logining = true;
  7331. this.approveinfun()
  7332. }
  7333. },
  7334. approveinfun(){
  7335. this.http.post( this.port.report.approve, this.approveinData,
  7336. res => {
  7337. this.logining = false;
  7338. if (res.code == "ok") {
  7339. this.approveinDialog = false
  7340. this.$message({
  7341. message: this.$t('message.Reviewsucceeded'),
  7342. type: "success"
  7343. });
  7344. this.getReportList();
  7345. this.getDepartment();
  7346. } else {
  7347. this.$message({
  7348. message: res.msg,
  7349. type: "error"
  7350. });
  7351. }
  7352. },
  7353. error => {
  7354. this.logining = false;
  7355. this.$message({
  7356. message: error,
  7357. type: "error"
  7358. });
  7359. });
  7360. },
  7361. //撤回日报
  7362. cancel(item,e) {
  7363. // console.log('can can need',item);
  7364. this.logining = true;
  7365. var ids = '';
  7366. var data = e ? item : item.data;
  7367. data.forEach(element => {
  7368. if(element.id){
  7369. ids +=(element.id+',');
  7370. }
  7371. });
  7372. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7373. res => {
  7374. this.logining = false;
  7375. if (res.code == "ok") {
  7376. this.$message({
  7377. message:this.$t('message.Withdrawalsucceeded'),
  7378. type: "success"
  7379. });
  7380. this.getReportList();
  7381. if(e){this.getReport()}
  7382. this.getDepartment();
  7383. } else {
  7384. this.$message({
  7385. message: res.msg,
  7386. type: "error"
  7387. });
  7388. }
  7389. },
  7390. error => {
  7391. this.logining = false;
  7392. this.$message({
  7393. message: error,
  7394. type: "error"
  7395. });
  7396. });
  7397. },
  7398. showDenyDialog(id,i, item) {
  7399. this.denyReasonDialog = true;
  7400. this.isDenying = false;
  7401. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7402. var ids = item.id;
  7403. // var data = item.data;
  7404. // data.forEach(element => {
  7405. // ids +=(element.id+',');
  7406. // });
  7407. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7408. },
  7409. // 未通过日报
  7410. deny() {
  7411. this.logining = true;
  7412. this.isDenying = true;
  7413. this.http.post( this.port.report.deny, this.denyForm,
  7414. res => {
  7415. this.logining = false;
  7416. this.isDenying = false;
  7417. if (res.code == "ok") {
  7418. this.$message({
  7419. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7420. type: "success"
  7421. });
  7422. this.getReportList();
  7423. this.getDepartment();
  7424. this.denyReasonDialog = false;
  7425. } else {
  7426. this.$message({
  7427. message: res.msg,
  7428. type: "error"
  7429. });
  7430. }
  7431. },
  7432. error => {
  7433. this.logining = false;
  7434. this.$message({
  7435. message: error,
  7436. type: "error"
  7437. });
  7438. });
  7439. },
  7440. // 查看工时记录弹窗
  7441. toView() {
  7442. this.toViewDialogVisible = true
  7443. this.toViewloading = true
  7444. this.getToView()
  7445. },
  7446. getToView() {
  7447. this.http.post( '/report-import-log/getList', this.toViewForm,
  7448. res => {
  7449. this.toViewloading = false;
  7450. if (res.code == "ok") {
  7451. // console.log(res.data, '数据数据')
  7452. this.toViewList = res.data.records
  7453. this.toViewForm.total = res.data.total
  7454. } else {
  7455. this.toViewloading = false;
  7456. this.$message({
  7457. message: res.msg,
  7458. type: "error"
  7459. });
  7460. }
  7461. })
  7462. },
  7463. // 触发 selectCat 组件更改他的值
  7464. selectCatCli(obj) {
  7465. // console.log(obj, '看看')
  7466. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7467. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7468. },
  7469. vueCasader(obj) {
  7470. // console.log(obj, '看看值')
  7471. if(obj.distinction == 1) {
  7472. let arr = []
  7473. arr.push(obj.item.id)
  7474. this.exportParam.departmentId = arr
  7475. }
  7476. },
  7477. //分页
  7478. handleCurrentChange(val) {
  7479. this.toViewForm.pageIndex = val;
  7480. this.getToView();
  7481. },
  7482. handleSizeChange(val) {
  7483. this.toViewForm.pageSize = val;
  7484. this.getToView();
  7485. },
  7486. getAllUsersList(){
  7487. this.http.post('/user/getSimpleActiveUserList',{
  7488. },res => {
  7489. if(res.code == 'ok'){
  7490. this.allUsersList = res.data
  7491. }else{
  7492. this.$message({
  7493. message: res.msg,
  7494. type: 'error'
  7495. })
  7496. }
  7497. },err => {
  7498. this.$message({
  7499. message: err,
  7500. type: 'error'
  7501. })
  7502. })
  7503. },
  7504. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7505. fillWeekCustomClne() {
  7506. this.fillWeekDialogVisiCustom = false
  7507. },
  7508. fillWeekCustomSubmit() {
  7509. this.getReportList();
  7510. this.getDepartment();
  7511. this.getRecentlyProject()
  7512. },
  7513. // 待填日报姓名搜索
  7514. nameAearchSeek(flg) {
  7515. if(!this.nameAearch) {
  7516. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7517. return
  7518. }
  7519. if(flg) {
  7520. this.enterpriseWechatgetUser()
  7521. }
  7522. },
  7523. handleThreeData(userList) {
  7524. console.log(userList, '人员数据')
  7525. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7526. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7527. },
  7528. // 过滤树节点
  7529. filterTreeNodes(treeData, filterKeywords) {
  7530. return treeData.filter((node) => {
  7531. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7532. if (node.children && node.children.length > 0) {
  7533. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7534. }
  7535. return true;
  7536. }
  7537. if (node.children && node.children.length > 0) {
  7538. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7539. return node.children.length > 0;
  7540. }
  7541. return false;
  7542. });
  7543. },
  7544. // 企业微信获取人员
  7545. enterpriseWechatgetUser() {
  7546. this.deptMembDataLoading = true
  7547. this.http.post('/user/getEmployeeList',{
  7548. departmentId: -1,
  7549. pageIndex: 1,
  7550. pageSize: 100,
  7551. keyword: this.nameAearch,
  7552. status: '',
  7553. roleId: '',
  7554. cursor: '',
  7555. onlyDirect: '',
  7556. matchingType: ''
  7557. },res => {
  7558. if(res.code == 'ok'){
  7559. this.deptMembDataLoading = false
  7560. const userListName = res.data.records.map(item => item.name)
  7561. this.handleThreeData(userListName)
  7562. }else{
  7563. this.deptMembDataLoading = false
  7564. this.$message({
  7565. message: res.msg,
  7566. type: 'error'
  7567. })
  7568. }
  7569. },err => {
  7570. this.deptMembDataLoading = false
  7571. this.$message({
  7572. message: err,
  7573. type: 'error'
  7574. })
  7575. })
  7576. },
  7577. // 封装 post 请求
  7578. postData(url, params) {
  7579. return new Promise((resolve, reject) => {
  7580. this.http.post(url, { ...params },
  7581. res => {
  7582. resolve(res)
  7583. },
  7584. error => {
  7585. this.$message({
  7586. message: error,
  7587. type: "error"
  7588. });
  7589. reject(error)
  7590. })
  7591. })
  7592. },
  7593. // 自定义事件
  7594. selectCal(obj) {
  7595. console.log(obj, '传数据来源')
  7596. if(obj.distinction == '1') {
  7597. this.zhoBao.projectAuditorId = obj.id
  7598. } else if(obj.distinction == '2') {
  7599. this.zhoBao.auditorFirst = obj.id
  7600. } else if(obj.distinction == '3') {
  7601. this.zhoBao.auditorSec = obj.id
  7602. } else if(obj.distinction == '4') {
  7603. this.zhoBao.auditorThird = obj.id
  7604. } else if(obj.distinction == '5') {
  7605. this.zhoBao.ccUserid = obj.id
  7606. } else if(obj.distinction == '12') {
  7607. this.usersListId = obj.id
  7608. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7609. this.searchKeyword = obj.name
  7610. } else {
  7611. this.searchKeyword = ''
  7612. }
  7613. this.searchScreen(0)
  7614. } else if(obj.distinction == '13') {
  7615. this.usersListId = obj.id
  7616. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7617. this.searchKeyword = obj.name
  7618. } else {
  7619. this.searchKeyword = ''
  7620. }
  7621. this.searchScreen(1)
  7622. }
  7623. }
  7624. },
  7625. created() {
  7626. this.getUsers()
  7627. let height = window.innerHeight;
  7628. this.tableHeight = height - 178;
  7629. const that = this;
  7630. window.onresize = function temp() {
  7631. that.tableHeight = window.innerHeight - 178;
  7632. };
  7633. this.toViewForm.companyId = this.user.companyId
  7634. this.initDrag([{
  7635. type: "LR",
  7636. domClass: {
  7637. // 中间分割线的名字
  7638. resize: "line-line",
  7639. // 左侧盒子的名字
  7640. left: "box-left",
  7641. // 右侧盒子的名字
  7642. right: "box-right",
  7643. // 父级的名字
  7644. box: "box-father",
  7645. },
  7646. otherInfo: {
  7647. // 限制左边栏最低宽度
  7648. leftWidth: 120,
  7649. },
  7650. },
  7651. {
  7652. type: "LR",
  7653. domClass: {
  7654. // 中间分割线的名字
  7655. resize: "line-second",
  7656. // 左侧盒子的名字
  7657. left: "left-laowang",
  7658. // 右侧盒子的名字
  7659. right: "box-second-father",
  7660. // 父级的名字
  7661. box: "grand",
  7662. },
  7663. otherInfo: {
  7664. // 限制左边栏最低宽度
  7665. leftWidth: 120,
  7666. },
  7667. },
  7668. ]);
  7669. }
  7670. };
  7671. </script>
  7672. <style lang="scss" scoped>
  7673. .fillWeekDialogVisiCustom {
  7674. width: 100%;
  7675. height: 70vh;
  7676. }
  7677. .fillWeekCustom {
  7678. .el-dialog__body {
  7679. padding: 20px 20px !important;
  7680. }
  7681. }
  7682. .photos {
  7683. position: relative;
  7684. display: flex;
  7685. flex-wrap: wrap;
  7686. }
  7687. .photos_img {
  7688. width: 120px;
  7689. height: 120px;
  7690. margin-right: 20px;
  7691. margin-bottom: 20px;
  7692. cursor: pointer;
  7693. img {
  7694. width: 100%;
  7695. height: 100%;
  7696. }
  7697. }
  7698. .paginatis {
  7699. padding: 10px 10px;
  7700. background: #f2f2f2;
  7701. }
  7702. .waiting {
  7703. color:orange;
  7704. }
  7705. .filledReportStyle {
  7706. color:#32CD32;
  7707. }
  7708. .RejectStyle {
  7709. color:red;
  7710. }
  7711. .waitSubmitStyle{
  7712. color: #409eff;
  7713. }
  7714. .chooseDate {
  7715. .waiting {
  7716. color: #20a0ff;
  7717. }
  7718. .filledReportStyle {
  7719. color:#20a0ff;
  7720. }
  7721. .RejectStyle {
  7722. color: #20a0ff;
  7723. }
  7724. .waitSubmitStyle{
  7725. color: #20a0ff;
  7726. }
  7727. }
  7728. .allDaily {
  7729. width:100%;
  7730. }
  7731. .report_title {
  7732. padding:10px 0;
  7733. color:#666;
  7734. }
  7735. .clearfix {
  7736. overflow-x: auto;
  7737. white-space: nowrap;
  7738. padding: 15px 0 10px 0;
  7739. // overflow-y: hidden;
  7740. .date_item {
  7741. padding: 0 3px;
  7742. cursor: pointer;
  7743. position: relative;
  7744. }
  7745. .chooseDate {
  7746. position: absolute;
  7747. bottom: -3px;
  7748. width: 37px;
  7749. height: 2px;
  7750. left: 14px;
  7751. background: #20a0ff;
  7752. }
  7753. }
  7754. .one_daily {
  7755. i {
  7756. color: #9ed0ff;
  7757. margin-right: 5px;
  7758. }
  7759. .one_daily_body {
  7760. padding: 10px 0px;
  7761. p {
  7762. margin: 0;
  7763. line-height: 30px;
  7764. }
  7765. }
  7766. ul {
  7767. padding: 0;
  7768. }
  7769. }
  7770. .checkbtn {
  7771. float: right;
  7772. margin-top: -10px;
  7773. }
  7774. .selConStyle{
  7775. margin-top:9rem;
  7776. margin-bottom:11rem;
  7777. .selConStyle_title{
  7778. height: 3rem;
  7779. text-align: center;
  7780. font-size: 17px;
  7781. }
  7782. .el-select{
  7783. margin: 0 15%;
  7784. width: 70%;
  7785. }
  7786. }
  7787. </style>
  7788. <style lang="scss">
  7789. /*去除upload组件过渡效果*/
  7790. .photos .el-upload-list__item {
  7791. transition: none !important;
  7792. }
  7793. .daily {
  7794. .el-card__body {
  7795. height: 80%;
  7796. overflow-y: auto;
  7797. }
  7798. .el-card__header {
  7799. padding: 0 20px;
  7800. }
  7801. }
  7802. .membListClass{
  7803. .el-dialog__body{
  7804. padding-top: 10px;
  7805. }
  7806. }
  7807. // .editReportDialog .el-dialog__footer{
  7808. // position: sticky;
  7809. // bottom: 0;
  7810. // background: #fff;
  7811. // height: 70px;
  7812. // z-index: 1010;
  7813. // }
  7814. .editReportDialog{
  7815. min-width: 800px;
  7816. }
  7817. .touruxiangmu{
  7818. max-width: 1000px;
  7819. }
  7820. </style>
  7821. <style scoped>
  7822. /* 项目标签的样式 */
  7823. .el-tag + .el-tag {
  7824. margin-left: 10px;
  7825. }
  7826. .button-new-tag {
  7827. margin-left: 10px;
  7828. height: 32px;
  7829. line-height: 30px;
  7830. padding-top: 0;
  7831. padding-bottom: 0;
  7832. }
  7833. .input-new-tag {
  7834. width: 90px;
  7835. margin-left: 10px;
  7836. vertical-align: bottom;
  7837. }
  7838. .selectworktime .el-table__fixed-body-wrapper{
  7839. top: 48px !important;
  7840. }
  7841. .selectworktime_export .selectworktime_export_l{
  7842. width: 650px;
  7843. float: left;
  7844. height: 42px;
  7845. }
  7846. .approvalProcessBox{
  7847. margin-left: 30px;
  7848. font-size: 14px;
  7849. line-height: 16px;
  7850. cursor: pointer;
  7851. }
  7852. .approvalProcessBox i {
  7853. margin-right: 0;
  7854. height: 16px;
  7855. width: 16px;
  7856. display: inline-block;
  7857. transform: scale(1.2);
  7858. position: relative;
  7859. top: 0.5px;
  7860. color: #409eff;
  7861. }
  7862. .approvalProcessBox .approvalProcessClick{
  7863. cursor: pointer;
  7864. color: #409eff;
  7865. font-size: 14px;
  7866. }
  7867. .approvalProcessBox:hover .approvalProcessClick{
  7868. color: #3485fb;
  7869. }
  7870. </style>
  7871. <style lang="scss" scoped>
  7872. // 加班样式
  7873. .overtime {
  7874. display: inline-block;
  7875. margin-left: 20px;
  7876. input {
  7877. display: inline-block;
  7878. margin-top: 5px;
  7879. }
  7880. }
  7881. .plus {
  7882. display: inline-block;
  7883. }
  7884. // .tages {
  7885. // float: right;
  7886. // }
  7887. .overtime {
  7888. display: inline-block;
  7889. margin-left: 30px;
  7890. }
  7891. .bloks {
  7892. display: inline-block;
  7893. width: 380px;
  7894. }
  7895. .zhiss {
  7896. display: flex;
  7897. justify-content: space-around;
  7898. align-items: center;
  7899. }
  7900. .zhoFel {
  7901. display: flex;
  7902. justify-content: space-between;
  7903. align-items: center;
  7904. }
  7905. // 左右滑动样式
  7906. .line {
  7907. width: 30px;
  7908. /* height: 500px; */
  7909. background: #f2f2f2;
  7910. cursor: w-resize;
  7911. }
  7912. .box-father {
  7913. border: 8px solid #000;
  7914. }
  7915. .line-second {
  7916. width: 10px;
  7917. /* background: red; */
  7918. }
  7919. .flex {
  7920. display: flex;
  7921. width: 100%;
  7922. }
  7923. .box-left {
  7924. flex: 0 0 400px;
  7925. /* height: 600px; */
  7926. /* background: blue; */
  7927. }
  7928. .box-right {
  7929. /* height: 600px; */
  7930. /* background: green; */
  7931. flex: 1;
  7932. }
  7933. .box-postion {
  7934. width: 200px;
  7935. /* height: 400px; */
  7936. background: #ccc;
  7937. }
  7938. .custom-tree-node {
  7939. flex: 1;
  7940. display: flex;
  7941. align-items: center;
  7942. justify-content: space-between;
  7943. font-size: 14px;
  7944. padding-right: 8px;
  7945. }
  7946. .daitianrbao {
  7947. width: 100%;
  7948. box-sizing: border-box;
  7949. height: 40px;
  7950. border-radius: 4px;
  7951. border: 1px solid #DCDFE6;
  7952. overflow: hidden;
  7953. text-overflow: ellipsis;
  7954. display: flex;
  7955. // align-items: center;
  7956. }
  7957. .daitianrbao .spnn {
  7958. display: inline-block;
  7959. box-sizing: border-box;
  7960. padding: 0 15px;
  7961. overflow: hidden;
  7962. text-overflow: ellipsis;
  7963. }
  7964. .daitianrbao .hover {
  7965. color: #DCDFE6 !important;
  7966. }
  7967. </style>