daily.vue 464 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834
  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. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <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">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <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'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{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)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <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">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <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')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <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')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <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')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <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>
  128. <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>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <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>
  132. <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>
  133. <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>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  140. </span>
  141. </div>
  142. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  143. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  144. <i class="fa fa-circle"></i>
  145. <!-- {{item1.name}} -->
  146. <span v-if="user.userNameNeedTranslate == '1'">
  147. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  148. </span>
  149. <span v-if="user.userNameNeedTranslate != '1'">
  150. {{item1.name}}
  151. </span>
  152. <span style="margin-left:30px;">
  153. <span style="margin-right:20px;">
  154. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  155. <!-- 工作总时长: -->
  156. {{$t('other.totalWorkingHours')}}
  157. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  158. <span >{{item1.reportTime | amounts}}</span>h
  159. </span>
  160. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  161. <i class="iconfont firerock-iconliucheng1"></i>
  162. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  163. <!-- 审批流程 -->
  164. {{$t('other.approvalProcess')}}
  165. </span>
  166. </span>
  167. </span>
  168. <div class="checkbtn" style="padding-right:20px;">
  169. <!--编辑和删除日报-->
  170. <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>
  171. <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>
  172. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  173. </div>
  174. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  175. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  176. </div>
  177. <div class="one_daily_body">
  178. <el-timeline>
  179. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  180. <el-card shadow="never">
  181. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  182. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  183. <span v-if="user.company.packageEngineering == 0">
  184. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  185. <span v-if="item2.isDeptAudit==0">
  186. <span v-if="item2.projectAuditState==0">
  187. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  188. <span v-if="item2.projectAuditorName != null">(
  189. <!-- {{item2.projectAuditorName}} -->
  190. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  191. )</span>
  192. <!-- 审核 --> {{$t('other.audit')}}
  193. </span>
  194. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  195. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  196. <span v-if="item2.projectAuditorName != null">(
  197. <!-- {{item2.projectAuditorName}} -->
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  199. )</span>
  200. <!-- 审核通过 --> {{$t('state.approved')}}
  201. </span>
  202. </span>
  203. <span v-else-if="item2.isDeptAudit==1">
  204. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  205. ({{$t('other.await')}}
  206. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  207. {{$t('other.audit')}})
  208. </span>
  209. ]</span>
  210. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  211. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  212. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  213. </span>
  214. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  216. </span>
  217. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  218. <span v-if="user.company.packageEngineering == 1">
  219. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  223. (
  224. <!-- <span v-if="user.userNameNeedTranslate != 1">
  225. {{item2.projectAuditorName}}
  226. </span>
  227. <span v-if="user.userNameNeedTranslate == 1">
  228. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  229. </span> -->
  230. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  231. )
  232. </span>{{$t('other.audit')}} ]</span>
  233. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  234. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  235. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  236. </span>
  237. <!--每个项目上单独审核 -->
  238. <span style="float:right;">
  239. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  240. <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"
  241. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  242. <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"
  243. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  244. <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"
  245. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  246. <!--自己可以撤回待审核状态的报告 -->
  247. <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>
  248. </span>
  249. </p>
  250. <p v-if="user.companyId == yuzhongCompId">
  251. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  252. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  253. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  254. <!--任务分组和阶段 -->
  255. <p v-if="item2.groupId != 0">
  256. {{$t('other.taskGroup')}}:{{item2.groupName}}
  257. <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>
  258. </p>
  259. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  260. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  261. <!-- 自定义日报文本 -->
  262. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  263. <p v-if="user.company.packageEngineering == 1">
  264. {{$t('other.professionalProgress')}}:
  265. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  266. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  267. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  268. </el-tooltip>
  269. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  270. <i class="iconfont firerock-iconshenhetongguo"></i>
  271. </el-tooltip>
  272. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  273. <i class="iconfont firerock-iconshenhebohui"></i>
  274. </el-tooltip>
  275. </span>
  276. </p>
  277. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  278. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  279. </p>
  280. <div v-if="item2.multiWorktime==0">
  281. <p style="display: inline-block;">{{$t('time.duration')}}:
  282. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  283. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  284. {{item2.time.toFixed(1)}}h
  285. <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>
  286. </p>
  287. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  288. </div>
  289. <div v-if="item2.multiWorktime==1" >
  290. <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>
  291. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  292. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  295. {{timeItem.time.toFixed(1)}}h
  296. </p>
  297. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  298. </div>
  299. </div>
  300. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  301. <!--照片的显示 -->
  302. <p v-if="item2.pics != null && item2.pics.length > 0">
  303. <el-image v-for="(pic, index) in item2.pics" :key="index"
  304. style="width: 100px; height: 100px; margin-right:10px;"
  305. :src="pic"
  306. :preview-src-list="item2.pics">
  307. </el-image>
  308. </p>
  309. </el-card>
  310. </el-timeline-item>
  311. </el-timeline>
  312. </div>
  313. </div>
  314. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  315. <!-- 简陋的无报告提示 -->
  316. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </el-card>
  323. </div>
  324. <!-- 工时推送日志弹窗 -->
  325. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  326. <template>
  327. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  328. </template>
  329. <template>
  330. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  331. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  332. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  333. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  334. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  335. <el-table-column prop="result" label="推送结果" width="250">
  336. <template slot-scope="scope">
  337. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  338. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  342. </el-table>
  343. </template>
  344. <span slot="footer" class="dialog-footer">
  345. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  346. </span>
  347. </el-dialog>
  348. <!-- 填写日报的dialog -->
  349. <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">
  350. <div style="height: 65vh;overflow: auto;">
  351. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  352. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  353. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  354. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  355. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  356. <span class="spnn" v-if="workForm.userNames">
  357. <span v-for="(item, index) in workForm.userNames" :key="index">
  358. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  359. <span v-if="index < workForm.userNames.length - 1">,</span>
  360. </span>
  361. </span>
  362. <span class="spnn hover" v-else>
  363. {{$t('defaultText.pleaseSelectAsubstitute')}}
  364. </span>
  365. </div>
  366. </el-form-item>
  367. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  368. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  369. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  370. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  371. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  372. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  373. <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>
  374. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  375. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  376. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  377. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  378. <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>
  379. <!-- AI智能填报 -->
  380. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  381. </el-form-item>
  382. <!--考勤时长显示-->
  383. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
  384. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  385. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  386. </span>
  387. <!--批量填报和批量代填不显示考勤记录-->
  388. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  389. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  390. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  391. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  392. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  393. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  394. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  395. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  396. @click="refreshAttendance(workForm.createDate)"></el-button>
  397. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  398. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  399. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  400. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  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="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  463. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  464. <el-select v-model="domain.projectId" :placeholder="$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="$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.taskGroupRequired == 1 || 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-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  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 >{{$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'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></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"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></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"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></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"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></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"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></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 && !yonghuUser.customDegreeMultiple" :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. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :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 + '.multiDegrIdArray'">
  618. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  619. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  620. </el-option>
  621. </el-select>
  622. </el-form-item>
  623. <!-- 相关数值 -->
  624. <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">
  625. <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>
  626. </el-form-item>
  627. <!-- 自定义文本 -->
  628. <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">
  629. <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>
  630. </el-form-item>
  631. <!--按比例填报-->
  632. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  633. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  634. <div style="width:400px;">
  635. <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>
  636. <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>
  637. </div>
  638. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  639. <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>
  640. </div>
  641. </el-form-item>
  642. <!--工程专业版本模式下, 各个专业的进度填报 -->
  643. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  644. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  645. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  646. <el-input size="mini" style="width:60px;" v-model="item.progress"
  647. @keyup.native="onProgressChange"
  648. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  649. </span>
  650. </el-form-item>
  651. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  652. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  653. <template slot="label" v-if="user.timeType.taskRequired == 1">
  654. <span style="color:#FF0000;">*</span>
  655. <span >任务</span>
  656. </template>
  657. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  658. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  659. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  660. </el-select>
  661. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  662. </el-form-item>
  663. <!--针对依斯贝的SAP服务-->
  664. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  665. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  666. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  667. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  668. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  669. </el-select>
  670. </el-form-item>
  671. <!--工作事项-->
  672. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  673. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  674. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  675. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  676. </el-form-item>
  677. <!-- 拍照上传 -->
  678. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  679. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  680. <div class="photos">
  681. <div>
  682. <el-upload
  683. list-type="picture-card"
  684. :http-request="(file) => {return addImg(file, index)}"
  685. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  686. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  687. :file-list="domain.imgListUrl" :limit="9"
  688. :disabled="workForm.domains[index].state>=2?false:true">
  689. <i class="el-icon-plus"></i>
  690. </el-upload>
  691. </div>
  692. </div>
  693. </el-form-item>
  694. </div>
  695. <!--多个工作事项填报的情况 -->
  696. <div v-if="reportTimeType.multiWorktime==1">
  697. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  698. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  699. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  700. @change="selectProject(domain, index)"
  701. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  702. <!-- <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">
  703. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  704. <span style="float: right;">{{ item.projectName }}</span>
  705. </el-option> -->
  706. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  707. <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">
  708. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  709. <span style="float: right;">{{ item.projectName }}</span>
  710. </el-option>
  711. </el-option-group>
  712. </el-select>
  713. <template v-if="user.timeType.mainProjectState != 1">
  714. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  715. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  716. <!--子项目 -->
  717. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  718. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  719. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  720. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  721. </el-select>
  722. </template>
  723. <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;"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  725. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  726. </el-link>
  727. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  728. <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>
  729. </div>
  730. <!-- <el-link type="primary" v-if="canEdit"
  731. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  732. </el-form-item>
  733. <el-form-item :label="$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">
  734. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  735. </el-form-item>
  736. <!--如果设置了工时成本预警的预算成本项-->
  737. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  738. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  739. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  740. </el-select>
  741. </el-form-item>
  742. <el-form-item v-if="user.company.packageProject == 1">
  743. <template slot="label">
  744. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  745. <span >{{$t('lable.taskGrouping')}}</span>
  746. </template>
  747. <!-- 任务分组 -->
  748. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  749. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  750. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  751. </el-select>
  752. <!-- 项目的阶段 -->
  753. <span v-if="domain.stages != null && domain.stages.length> 0"
  754. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  755. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  756. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  757. @change="changeStages(domain, index)"
  758. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  759. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  760. </el-select>
  761. </el-form-item>
  762. <el-form-item :label="$t('other.projectAuditor')" >
  763. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  764. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  765. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  766. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  767. </el-option>
  768. </el-select>
  769. <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>
  770. </el-form-item>
  771. <!--工程专业版本模式下, 各个专业的进度填报 -->
  772. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  773. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  774. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  775. <el-input size="mini" style="width:60px;" v-model="item.progress"
  776. @keyup.native="onProgressChange"
  777. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  778. </span>
  779. </el-form-item>
  780. <!-- 相关维度 -->
  781. <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'">
  782. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  783. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  784. </el-option>
  785. </el-select>
  786. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  787. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  788. </el-option>
  789. </el-select>
  790. </el-form-item>
  791. <!-- 相关数值 -->
  792. <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">
  793. <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>
  794. </el-form-item>
  795. <!-- 自定义文本 -->
  796. <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">
  797. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  798. </el-form-item>
  799. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  800. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  801. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  802. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  803. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  804. </el-select>
  805. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  806. </el-form-item>
  807. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  808. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  809. <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>
  810. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  811. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  812. <span v-if="reportTimeType.type == 2">
  813. <!-- <span> -->
  814. <!--时间范围选择 -->
  815. <el-time-picker
  816. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  817. v-model="timeItem.startTime"
  818. :placeholder="$t('time.startTime')"
  819. style="width:120px;"
  820. format="HH:mm"
  821. value-format="HH:mm"
  822. :picker-options="{
  823. start: '00:00',
  824. end: '23:59',
  825. }"
  826. @change="iptChangs()">
  827. </el-time-picker> - <el-time-picker
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  829. v-model="timeItem.endTime"
  830. :placeholder="$t('time.endTime')"
  831. style="width:120px;"
  832. format="HH:mm"
  833. value-format="HH:mm"
  834. :picker-options="{
  835. start: '00:00',
  836. end: '23:59',
  837. minTime: timeItem.startTime
  838. }"
  839. @change="iptChangs()">
  840. </el-time-picker>
  841. </span>
  842. </el-form-item>
  843. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  844. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  845. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  846. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  847. ></el-input>
  848. </el-form-item>
  849. </div>
  850. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  851. </div>
  852. <!--照片的显示 -->
  853. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  854. <el-image v-for="(pic, index) in domain.pics" :key="index"
  855. style="width: 100px; height: 100px; margin-right:10px;"
  856. :src="pic"
  857. :preview-src-list="domain.pics">
  858. </el-image>
  859. </p>
  860. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  861. </div>
  862. <span id="workFormsItemBottom"></span>
  863. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  864. </el-form>
  865. </div>
  866. <span slot="footer" class="dialog-footer">
  867. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  868. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  869. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  870. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  871. <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>
  872. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  873. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  874. </span>
  875. </el-dialog>
  876. <!-- 按周填报 -->
  877. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  878. <!-- 按周填报-已填工时-点击 -->
  879. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  880. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  881. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  882. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  883. <el-table-column prop="state" :label="$t('state.states')">
  884. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  885. </el-table-column>
  886. <!-- <el-table-column label="操作">
  887. <template slot-scope="scope">
  888. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  889. </template>
  890. </el-table-column> -->
  891. </el-table>
  892. <span slot="footer" class="dialog-footer">
  893. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  894. </span>
  895. </el-dialog>
  896. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  897. <el-form-item style="height:30px;margin-top:-72px;">
  898. <!-- <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> -->
  899. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  900. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  901. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  902. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  903. <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>
  904. <el-option
  905. v-for="item in fillProjectList"
  906. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  907. :key="item.id"
  908. :label="item.projectName + '\u3000' + item.projectCode"
  909. :value="item.id">
  910. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  911. <span style="float: right">{{ item.projectName }}</span>
  912. </el-option>
  913. </el-select>
  914. <span style="float:right;margin-right:10px;">选择项目</span>
  915. </el-form-item>
  916. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  917. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  918. <template slot-scope="scope">
  919. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  920. </template>
  921. </el-table-column>
  922. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  923. <template slot-scope="scope">
  924. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  925. <p v-else></p>
  926. </template>
  927. </el-table-column> -->
  928. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  929. <template slot-scope="scope">
  930. <div v-if="scope.row.canFill == 1">
  931. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  932. <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>
  933. <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>
  934. <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>
  935. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  936. </div>
  937. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  938. <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>
  939. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  940. </div>
  941. </div>
  942. <div v-else >
  943. <span style="color:#999999;">不可超前填报</span>
  944. </div>
  945. </template>
  946. </el-table-column>
  947. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  948. <template slot-scope="scope">
  949. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  950. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  951. </template>
  952. </el-table-column>
  953. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  954. <template slot-scope="scope">
  955. <div class="zhiss">
  956. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  957. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  958. </div>
  959. </template>
  960. </el-table-column>
  961. </el-table>
  962. </el-form>
  963. <span slot="footer" class="dialog-footer" >
  964. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  965. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  966. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  967. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  968. <!--针对景昱,先检查工时是否存在异常-->
  969. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  970. </span>
  971. </el-dialog>
  972. <!-- 重庆物奇私人定制的按周填报 -->
  973. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  974. <div class="fillWeekDialogVisiCustom">
  975. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  976. </div>
  977. </el-dialog>
  978. <!-- 选择时间 -->
  979. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  980. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  981. <span slot="footer" class="dialog-footer">
  982. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  983. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  984. </span>
  985. </el-dialog>
  986. <!-- 按周填报弹窗 -->
  987. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  988. <div>
  989. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  990. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  991. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  992. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  993. </el-select>
  994. </div>
  995. <!--如果设置了工时成本预警的预算成本项-->
  996. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  997. <p>{{$t('lable.budgetSource')}}</p>
  998. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  999. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1000. </el-select>
  1001. </div>
  1002. <!-- 任务分组 -->
  1003. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1004. <p>{{$t('lable.taskGrouping')}}</p>
  1005. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1006. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1007. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1008. </el-select>
  1009. </div>
  1010. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1011. <p>{{$t('other.inputStage')}}</p>
  1012. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1013. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1014. </el-select>
  1015. </div>
  1016. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1017. <p>{{$t('other.reviewer')}}</p>
  1018. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1019. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1020. </el-select>
  1021. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1022. </div>
  1023. <template v-if="user.timeType.reportAuditType == 3">
  1024. <div class="zhoFel">
  1025. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1026. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1027. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1028. </el-select>
  1029. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1030. </div>
  1031. <div class="zhoFel">
  1032. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1033. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1034. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1035. </el-select>
  1036. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1037. </div>
  1038. <div class="zhoFel">
  1039. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1040. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1041. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1044. </div>
  1045. <div class="zhoFel">
  1046. <p>{{ $t('chao-song-ren') }}</p>
  1047. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1048. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1049. </el-select>
  1050. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1051. </div>
  1052. </template>
  1053. <!-- 自定义维度 -->
  1054. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1055. <p>{{user.timeType.customDegreeName}}</p>
  1056. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1057. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1058. </el-select>
  1059. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1060. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. </div>
  1063. <!-- 自定义数值 -->
  1064. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1065. <p>{{user.timeType.customDataName}}</p>
  1066. <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>
  1067. </div>
  1068. <!-- 自定义文本 -->
  1069. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1070. <p>{{user.timeType.customTextName}}</p>
  1071. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1072. </div>
  1073. <!-- 选择任务 -->
  1074. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1075. <p>任务 / 里程碑</p>
  1076. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1077. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1078. </el-select>
  1079. </div>
  1080. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1081. <p>{{$t('other.timeSelection')}}</p>
  1082. <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>
  1083. </div>
  1084. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1085. <p>{{$t('other.chooseDuration')}}</p>
  1086. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1087. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1088. </el-select>
  1089. </div>
  1090. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1091. <p>{{$t('lable.percentageOfTime')}}</p>
  1092. <div style="width:400px;display: flex;align-items: center;">
  1093. <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>
  1094. <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>
  1095. </div>
  1096. </div>
  1097. <div class="zhoFel">
  1098. <p>{{$t('other.workMatters')}}</p>
  1099. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1100. </div>
  1101. </div>
  1102. <span slot="footer" class="dialog-footer">
  1103. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1104. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1105. </span>
  1106. </el-dialog>
  1107. <!--导出报表条件选择 -->
  1108. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1109. <el-form ref="form3" :model="exportParam" >
  1110. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1111. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1112. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1113. </el-select>
  1114. </el-form-item>
  1115. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1116. <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>
  1117. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1118. </el-form-item>
  1119. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1120. <el-date-picker
  1121. v-model="exportParam.dateRange" :editable="false"
  1122. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  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-item prop="stateKey" :label="$t('other.doesItContain')">
  1130. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1131. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1132. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1133. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1134. </el-select>
  1135. </el-form-item>
  1136. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1137. <div class="exportReportRadio">
  1138. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1139. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1140. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1141. <i class="el-icon-question"></i>
  1142. </el-tooltip>
  1143. </div>
  1144. </el-form-item>
  1145. </el-form>
  1146. <div slot="footer" class="dialog-footer">
  1147. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1148. </div>
  1149. </el-dialog>
  1150. <!--导出报表条件选择 -->
  1151. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1152. <el-form ref="form3" :model="exportParam" >
  1153. <el-form-item prop="range" :label="$t('time.dateRange')">
  1154. <el-date-picker
  1155. v-model="exportParam.dateRange" :editable="false"
  1156. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1157. :clearable="true"
  1158. :range-separator="$t('other.to')"
  1159. type="daterange"
  1160. :start-placeholder="$t('time.startDate')"
  1161. :end-placeholder="$t('time.endDate')"
  1162. ></el-date-picker>
  1163. </el-form-item>
  1164. </el-form>
  1165. <div slot="footer" class="dialog-footer">
  1166. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1167. </div>
  1168. </el-dialog>
  1169. <!--人员列表 -->
  1170. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1171. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1172. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1173. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1174. <el-table-column type="selection"></el-table-column>
  1175. <el-table-column prop="label" :label="$t('lable.name')" >
  1176. <template slot-scope="scope">
  1177. <span>
  1178. <!-- {{(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}} -->
  1179. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1180. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1181. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1182. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1183. </span>
  1184. <span v-else>
  1185. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1186. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1187. </span>
  1188. </span>
  1189. </template>
  1190. </el-table-column>
  1191. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1192. <template slot-scope="scope">
  1193. <div>
  1194. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1195. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1196. </div>
  1197. </template>
  1198. </el-table-column>
  1199. </el-table>
  1200. </el-tab-pane>
  1201. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1202. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1203. <el-table-column prop="label" :label="$t('lable.name')" >
  1204. <template slot-scope="scope">
  1205. <!-- <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> -->
  1206. <!-- <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> -->
  1207. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1208. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1209. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1210. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1211. </span>
  1212. <span v-else>
  1213. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1214. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1215. </span>
  1216. </template>
  1217. </el-table-column>
  1218. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1219. <template slot-scope="scope">
  1220. <div>
  1221. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1222. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1223. </div>
  1224. </template>
  1225. </el-table-column>
  1226. </el-table>
  1227. </el-tab-pane>
  1228. </el-tabs>
  1229. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1230. <el-table-column type="selection"></el-table-column>
  1231. <el-table-column prop="label" :label="$t('lable.name')" >
  1232. <template slot-scope="scope">
  1233. <div>
  1234. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1236. </div>
  1237. </template>
  1238. </el-table-column>
  1239. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1240. <template slot-scope="scope">
  1241. <div>
  1242. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1243. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1244. </div>
  1245. </template>
  1246. </el-table-column>
  1247. </el-table>
  1248. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1249. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1250. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1251. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1252. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1253. </div>
  1254. </el-dialog>
  1255. <!-- 按部门选择人员 -->
  1256. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1257. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1258. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1259. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1260. </el-input>
  1261. <div class="tree" style="height:400px">
  1262. <el-scrollbar style="height:100%">
  1263. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1264. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1265. highlight-current :filter-node-method="filterNode">
  1266. <span class="custom-tree-node" slot-scope="{ node }">
  1267. <span v-if="user.userNameNeedTranslate == '1'">
  1268. <span v-if="node.data.children">
  1269. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1270. </span>
  1271. <span v-else>
  1272. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1273. </span>
  1274. </span>
  1275. <span v-if="user.userNameNeedTranslate != '1'">
  1276. {{ node.label }}
  1277. </span>
  1278. <!-- {{ node.label }} -->
  1279. </span>
  1280. </el-tree>
  1281. </el-scrollbar>
  1282. </div>
  1283. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1284. <div slot="footer" class="dialog-footer">
  1285. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1286. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1287. </div>
  1288. </el-dialog>
  1289. <el-dialog
  1290. v-if="monthWorkTimeDialog"
  1291. :visible.sync="monthWorkTimeDialog"
  1292. :close-on-click-modal="false"
  1293. customClass="customWidth selectworktime"
  1294. width="1200px"
  1295. title=""
  1296. >
  1297. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1298. <el-tabs v-model="activeName" @tab-click="handleClick">
  1299. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1300. <div class="selectworktime_export" style="margin-top:10px;">
  1301. <div class="selectworktime_export_l">
  1302. <el-date-picker
  1303. class="selecteworktime_datapick"
  1304. v-model="WorktimeDatepickValue"
  1305. value-format="yyyy-MM-dd"
  1306. type="daterange"
  1307. align="right"
  1308. unlink-panels
  1309. :range-separator="$t('other.to')"
  1310. :start-placeholder="$t('time.startDate')"
  1311. :end-placeholder="$t('time.endDate')"
  1312. :default-time="['12:00:00', '12:00:00']"
  1313. size="small"
  1314. popper-class="selecteorktime_datapick_popper"
  1315. @change="showMonthWorkTime('first')"
  1316. >
  1317. </el-date-picker>
  1318. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1319. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1320. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1321. <!-- 222 -->
  1322. </div>
  1323. <div>
  1324. <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">
  1325. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1326. </el-input>
  1327. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1328. </div>
  1329. <div style="float: right; vertical-align: middle;height:32px">
  1330. <el-link
  1331. type="primary"
  1332. @click="exportMembWorkHours()"
  1333. >{{$t('export.exportData')}}</el-link
  1334. >
  1335. </div>
  1336. </div>
  1337. <el-table ref="hasworkTbl"
  1338. :data="monthWorkDataS"
  1339. v-el-table-infinite-scroll="listScroll"
  1340. border
  1341. :height="500"
  1342. highlight-current-row
  1343. style="width: 100%"
  1344. v-loading="tbload"
  1345. :lazy="true"
  1346. >
  1347. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1348. <template slot-scope="scope">
  1349. {{ scope.$index + 1 }}
  1350. </template>
  1351. </el-table-column>
  1352. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1353. <template slot-scope="scope">
  1354. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1355. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1356. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1357. <!-- {{scope.row.name}} -->
  1358. </span>
  1359. </template>
  1360. </el-table-column>
  1361. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1362. <template slot-scope="scope">
  1363. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1364. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1365. </template>
  1366. </el-table-column>
  1367. <el-table-column
  1368. min-width="105"
  1369. v-for="(item, index) in pickDateArray"
  1370. :key="index"
  1371. :label="item.label"
  1372. align="center"
  1373. >
  1374. <template slot-scope="scope">
  1375. <div
  1376. style="color: red"
  1377. v-if="
  1378. scope.row.worktimeList.filter(
  1379. (w) =>
  1380. w.createDate==item.date
  1381. ).length > 0 &&
  1382. scope.row.worktimeList.filter(
  1383. (w) =>w.createDate==item.date
  1384. )[0].workingTime < reportTimeType.allday
  1385. "
  1386. >
  1387. {{
  1388. scope.row.worktimeList.filter(
  1389. (w) =>w.createDate==item.date
  1390. )[0].workingTime.toFixed(1)
  1391. }}
  1392. </div>
  1393. <div
  1394. style="color: #20a0ff"
  1395. v-if="
  1396. scope.row.worktimeList.filter(
  1397. (w) =>w.createDate==item.date
  1398. ).length > 0 &&
  1399. scope.row.worktimeList.filter(
  1400. (w) =>w.createDate==item.date
  1401. )[0].workingTime > reportTimeType.allday
  1402. "
  1403. >
  1404. {{
  1405. scope.row.worktimeList.filter(
  1406. (w) =>w.createDate==item.date
  1407. )[0].workingTime.toFixed(1)
  1408. }}
  1409. </div>
  1410. <div
  1411. v-if="
  1412. scope.row.worktimeList.filter(
  1413. (w) =>w.createDate==item.date
  1414. ).length > 0 &&
  1415. scope.row.worktimeList.filter(
  1416. (w) =>w.createDate==item.date
  1417. )[0].workingTime == reportTimeType.allday
  1418. "
  1419. >
  1420. {{
  1421. scope.row.worktimeList.filter(
  1422. (w) =>w.createDate==item.date
  1423. )[0].workingTime
  1424. }}
  1425. </div>
  1426. <div
  1427. v-if="
  1428. scope.row.worktimeList.filter(
  1429. (w) =>w.createDate==item.date
  1430. ).length == 0
  1431. "
  1432. >
  1433. 0
  1434. </div>
  1435. <div
  1436. v-if="
  1437. scope.row.worktimeList.filter(
  1438. (w) =>w.createDate==item.date
  1439. ).length > 0 &&
  1440. typeof scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. )[0].workingTime == 'string'
  1443. "
  1444. >
  1445. {{
  1446. scope.row.worktimeList.filter(
  1447. (w) =>w.createDate==item.date
  1448. )[0].workingTime
  1449. }}
  1450. </div>
  1451. </template>
  1452. </el-table-column>
  1453. </el-table>
  1454. <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>
  1455. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1456. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1457. <label style="font-size: 16px">员工每日已填报工时数</label>
  1458. <el-link
  1459. type="primary"
  1460. style="float: right; margin-right: 60px"
  1461. @click="exportMembWorkHours()"
  1462. >导出已填报数据</el-link
  1463. > -->
  1464. <!-- <el-button >导出</el-button> -->
  1465. <!-- </div> -->
  1466. </el-tab-pane>
  1467. <el-tab-pane label="未提交人员列表" name="second" >
  1468. <div class="selectworktime_export" style="margin-top:10px">
  1469. <div class="selectworktime_export_l">
  1470. <el-date-picker
  1471. class="selecteworktime_datapick"
  1472. v-model="WorktimeDatepickValue"
  1473. value-format="yyyy-MM-dd"
  1474. type="daterange"
  1475. align="right"
  1476. unlink-panels
  1477. :range-separator="$t('other.to')"
  1478. :start-placeholder="$t('time.startDate')"
  1479. :end-placeholder="$t('time.endDate')"
  1480. :default-time="['12:00:00', '12:00:00']"
  1481. size="small"
  1482. popper-class="selecteorktime_datapick_popper"
  1483. @change="showMonthNotWorkTime()"
  1484. >
  1485. </el-date-picker>
  1486. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1487. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1488. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1489. </div>
  1490. <div>
  1491. <div style="margin-top:10px;">
  1492. <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>
  1493. <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>
  1494. <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">
  1495. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1496. </el-input>
  1497. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1498. <el-link
  1499. type="primary"
  1500. style="float: right; vertical-align: middle;height:32px"
  1501. @click="exportMembNotWorkHours()"
  1502. >{{$t('export.exportData')}}</el-link
  1503. >
  1504. </div>
  1505. </div>
  1506. </div>
  1507. <el-table
  1508. ref="hasworkTbl2"
  1509. :data="monthNotWorkDateS"
  1510. v-el-table-infinite-scroll="notListScroll"
  1511. border
  1512. :height="500"
  1513. highlight-current-row
  1514. style="width: 100%"
  1515. v-loading="tbload"
  1516. lazy
  1517. >
  1518. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1519. <template slot-scope="scope">
  1520. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1521. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1522. </template>
  1523. </el-table-column>
  1524. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1525. <template slot-scope="scope">
  1526. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1527. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1528. </template>
  1529. </el-table-column>
  1530. <el-table-column
  1531. min-width="200"
  1532. :label="$t('weekDay.date')"
  1533. align="center"
  1534. prop="createDate"
  1535. >
  1536. </el-table-column>
  1537. <el-table-column
  1538. min-width="200"
  1539. :label="$t('state.states')"
  1540. align="center"
  1541. prop="status"
  1542. />
  1543. <el-table-column
  1544. min-width="200"
  1545. :label="$t('other.attendanceData')"
  1546. prop="cardTime"
  1547. align="center"
  1548. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1549. </el-table>
  1550. <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>
  1551. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1552. </el-tab-pane>
  1553. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1554. <div class="selectworktime_export" style="margin-top:10px;">
  1555. <!-- <div class="selectworktime_export_l">
  1556. <el-date-picker
  1557. class="selecteworktime_datapick"
  1558. v-model="WorktimeDatepickValue"
  1559. value-format="yyyy-MM-dd"
  1560. type="daterange"
  1561. align="right"
  1562. unlink-panels
  1563. :range-separator="$t('other.to')"
  1564. :start-placeholder="$t('time.startDate')"
  1565. :end-placeholder="$t('time.endDate')"
  1566. :default-time="['12:00:00', '12:00:00']"
  1567. size="small"
  1568. popper-class="selecteorktime_datapick_popper"
  1569. @change="showMonthWorkTime()"
  1570. >
  1571. </el-date-picker>
  1572. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1573. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1574. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1575. </div> -->
  1576. <div>
  1577. <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">
  1578. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1579. </el-input>
  1580. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1581. </div>
  1582. <div style="float: right; vertical-align: middle;height:32px">
  1583. <el-link
  1584. type="primary"
  1585. @click="changeReminder()"
  1586. >{{'变更提醒'}}</el-link
  1587. >
  1588. <el-link
  1589. type="primary"
  1590. @click="exportMembWorkHoursReminder()"
  1591. >{{$t('export.exportData')}}</el-link
  1592. >
  1593. </div>
  1594. </div>
  1595. <el-table ref="hasworkTbl"
  1596. :data="monthWorkDataS"
  1597. v-el-table-infinite-scroll="listScroll"
  1598. border
  1599. :height="500"
  1600. highlight-current-row
  1601. style="width: 100%"
  1602. v-loading="tbload"
  1603. :lazy="true"
  1604. >
  1605. <el-table-column width="180" type="index" fixed="left" :label="'日期'">
  1606. <template slot-scope="scope">
  1607. {{ scope.row.createDate}}
  1608. </template>
  1609. </el-table-column>
  1610. <el-table-column width="160" prop="name" fixed="left" :label="$t('lable.name')">
  1611. <template slot-scope="scope">
  1612. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1613. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1614. <!-- {{scope.row.name}} -->
  1615. </template>
  1616. </el-table-column>
  1617. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1618. <template slot-scope="scope">
  1619. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1620. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1621. </template>
  1622. </el-table-column>
  1623. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1624. <template slot-scope="scope">
  1625. {{ scope.row.workingTime}}
  1626. </template>
  1627. </el-table-column>
  1628. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1629. <template slot-scope="scope">
  1630. {{ scope.row.cardTime}}
  1631. </template>
  1632. </el-table-column>
  1633. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1634. <template slot-scope="scope">
  1635. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1636. </template>
  1637. </el-table-column>
  1638. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1639. <template slot-scope="scope">
  1640. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1641. </template>
  1642. </el-table-column>
  1643. </el-table>
  1644. <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>
  1645. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1646. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1647. <label style="font-size: 16px">员工每日已填报工时数</label>
  1648. <el-link
  1649. type="primary"
  1650. style="float: right; margin-right: 60px"
  1651. @click="exportMembWorkHours()"
  1652. >导出已填报数据</el-link
  1653. > -->
  1654. <!-- <el-button >导出</el-button> -->
  1655. <!-- </div> -->
  1656. </el-tab-pane>
  1657. </el-tabs>
  1658. </el-dialog>
  1659. <!--驳回弹出框 -->
  1660. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1661. <div>
  1662. <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')" />
  1663. </div>
  1664. <div slot="footer" class="dialog-footer">
  1665. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1666. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1667. </div>
  1668. </el-dialog>
  1669. <!-- 通过弹出框 -->
  1670. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1671. <div>
  1672. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1673. </div>
  1674. <div slot="footer" class="dialog-footer">
  1675. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1676. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1677. </div>
  1678. </el-dialog>
  1679. <!--批量导入日报 -->
  1680. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1681. <p>1. {{$t('other.download')}}
  1682. <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>
  1683. </p>
  1684. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1685. <p style="display: flex;justify-content: center;">
  1686. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1687. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1688. </el-upload>
  1689. </p>
  1690. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1691. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1692. </div>
  1693. </el-dialog>
  1694. <!-- 工时导入记录弹窗 -->
  1695. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1696. <div style="height: 452px">
  1697. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1698. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1699. <el-table-column prop="userName" :label="$t('other.operator')">
  1700. <template slot-scope="scope">
  1701. <div>
  1702. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1703. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1704. </div>
  1705. </template>
  1706. </el-table-column>
  1707. <el-table-column prop="datel" :label="$t('other.document')">
  1708. <template slot-scope="scope">
  1709. <div>
  1710. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1711. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1712. </div>
  1713. </template>
  1714. </el-table-column>
  1715. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1716. <template slot-scope="scope">
  1717. <div>
  1718. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1719. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1720. </div>
  1721. </template>
  1722. </el-table-column>
  1723. </el-table>
  1724. <el-col :span="24" class="paginatis">
  1725. <el-pagination
  1726. @size-change="handleSizeChange"
  1727. @current-change="handleCurrentChange"
  1728. :page-sizes="[20 , 50 , 80 , 100]"
  1729. :page-size="20"
  1730. layout="total, sizes, prev, pager, next"
  1731. :total="toViewForm.total"
  1732. style="float:right;"
  1733. ></el-pagination>
  1734. </el-col>
  1735. </div>
  1736. </el-dialog>
  1737. <!--基于企业微信考勤数据的工时导入 -->
  1738. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1739. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1740. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1741. </el-step>
  1742. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1743. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1744. </el-steps>
  1745. <div v-if="active==0" style="padding:30px;height:360px;">
  1746. <div style="margin-top:50px;margin-left:280px;">
  1747. <el-date-picker
  1748. v-model="importWxParam.date" :editable="false"
  1749. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1750. :clearable="true"
  1751. :range-separator="$t('other.to')"
  1752. type="daterange"
  1753. :start-placeholder="$t('time.startDate')"
  1754. :end-placeholder="$t('time.endDate')"
  1755. @change="loadCheckInData"
  1756. ></el-date-picker>
  1757. </div>
  1758. </div>
  1759. <div v-if="active==1" style="padding:10px;">
  1760. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1761. style="width: 100%;margin-top:5px;" >
  1762. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1763. <template slot-scope="scope">
  1764. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1765. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1766. </template>
  1767. </el-table-column>
  1768. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1769. </el-table-column>
  1770. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1771. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1772. <template slot-scope="scope">
  1773. <div>
  1774. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1775. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1776. </div>
  1777. </template>
  1778. </el-table-column>
  1779. <el-table-column prop="departmentName" label="部门" >
  1780. <template slot-scope="scope">
  1781. <div>
  1782. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1783. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1784. </div>
  1785. </template>
  1786. </el-table-column>
  1787. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1788. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1789. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1790. <template slot-scope="scope">
  1791. {{scope.row.workHours.toFixed(1)}}h
  1792. </template>
  1793. </el-table-column>
  1794. </el-table>
  1795. </div>
  1796. <div v-if="active==2" >
  1797. <p style="display: flex;justify-content: center;height:390px;">
  1798. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1799. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1800. </el-upload>
  1801. </p>
  1802. </div>
  1803. <div slot="title">
  1804. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1805. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1806. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1807. <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>
  1808. <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>
  1809. <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>
  1810. </div>
  1811. <span slot="footer">
  1812. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1813. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1814. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1815. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1816. </span>
  1817. </el-dialog>
  1818. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1819. <p style="display: flex;justify-content: center;height:100px;">
  1820. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1821. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1822. </el-upload>
  1823. </p>
  1824. </el-dialog>
  1825. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1826. <div>
  1827. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1828. v-model="deleteReportParam.date" :editable="false"
  1829. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1830. :clearable="true"
  1831. :range-separator="$t('other.to')"
  1832. type="daterange"
  1833. :start-placeholder="$t('time.startDate')"
  1834. :end-placeholder="$t('time.endDate')"
  1835. ></el-date-picker>
  1836. </div>
  1837. <div style="margin-top:10px;">
  1838. <span>请选择部门:</span>
  1839. <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>
  1840. <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>
  1841. </div>
  1842. <div style="margin-top:10px;">
  1843. <span>请选择员工:</span>
  1844. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1845. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1846. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1847. <span v-else>{{item.name}}</span>
  1848. </el-option>
  1849. </el-select>
  1850. </div>
  1851. <span slot="footer">
  1852. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1853. </span>
  1854. </el-dialog>
  1855. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1856. <div>
  1857. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1858. v-model="deleteReportParam.date" :editable="false"
  1859. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1860. :clearable="true"
  1861. :range-separator="$t('other.to')"
  1862. type="daterange"
  1863. :start-placeholder="$t('time.startDate')"
  1864. :end-placeholder="$t('time.endDate')"
  1865. ></el-date-picker>
  1866. </div>
  1867. <div style="margin-top:15px;">
  1868. <span>选择部门:</span>
  1869. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1870. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1871. size="small" v-if="user.userNameNeedTranslate != 1"
  1872. ></el-cascader>
  1873. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1874. </div>
  1875. <span slot="footer">
  1876. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1877. </span>
  1878. </el-dialog>
  1879. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1880. <div>
  1881. <span>选择时间:</span><el-date-picker
  1882. v-model="modImportTime"
  1883. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1884. :clearable="true"
  1885. type="datetime"
  1886. ></el-date-picker>
  1887. <span>选择导入人员:</span><el-select
  1888. v-model="modImportUserId"
  1889. >
  1890. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1891. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1892. <span v-else>{{item.name}}</span>
  1893. </el-option>
  1894. </el-select>
  1895. </div>
  1896. <span slot="footer">
  1897. <el-button @click="confirmChangeModTime" >确认</el-button>
  1898. </span>
  1899. </el-dialog>
  1900. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1901. <div>
  1902. <span>请选择年月:</span>
  1903. <el-date-picker
  1904. v-model="ratioYmonth" :editable="false"
  1905. format="yyyyMM" value-format="yyyyMM"
  1906. type="month"
  1907. ></el-date-picker>
  1908. </div>
  1909. <span slot="footer">
  1910. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1911. </span>
  1912. </el-dialog>
  1913. <!--工时批量代填 -->
  1914. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1915. <div>
  1916. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1917. v-model="importWxParam.date" :editable="false"
  1918. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1919. :clearable="true"
  1920. :range-separator="$t('other.to')"
  1921. type="daterange"
  1922. :start-placeholder="$t('time.startDate')"
  1923. :end-placeholder="$t('time.endDate')"
  1924. @change="loadCheckInData"
  1925. ></el-date-picker>
  1926. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1927. </div>
  1928. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1929. :key="timeStamp"
  1930. style="width: 100%;margin-top:5px;" ref="tab">
  1931. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1932. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1933. <template slot-scope="scope">
  1934. <div>
  1935. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1936. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1937. </div>
  1938. </template>
  1939. </el-table-column>
  1940. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1941. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1942. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1943. <template slot-scope="scope">
  1944. {{scope.row.workHours.toFixed(1)}}h
  1945. </template>
  1946. </el-table-column>
  1947. <!--项目名称列表 -->
  1948. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1949. <template slot-scope="scope">
  1950. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1951. </template>
  1952. </el-table-column>
  1953. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1954. <template slot-scope="scope">
  1955. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1956. </template>
  1957. </el-table-column>
  1958. </el-table>
  1959. </el-dialog>
  1960. <!--基于企业微信考勤数据的工时导入 -->
  1961. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1962. <div style="padding-bottom:10px;">
  1963. <p>{{importResultMsg}}</p>
  1964. </div>
  1965. <!-- <span slot="footer" class="dialog-footer">
  1966. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1967. </span> -->
  1968. </el-dialog>
  1969. <!-- 审核流程展示 -->
  1970. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1971. <div style="padding:20px 40px 20px 0">
  1972. <el-timeline :reverse="false">
  1973. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1974. <!-- {{item.msg}} -->
  1975. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1976. <span v-if="user.userNameNeedTranslate == 1">
  1977. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  1978. <span>{{item.msgCon.two}}</span>
  1979. </span>
  1980. </el-timeline-item>
  1981. </el-timeline>
  1982. </div>
  1983. </el-dialog>
  1984. </section>
  1985. </template>
  1986. <script>
  1987. // 左右滑动
  1988. import dragMixin from "@/common/js/tensile.js";
  1989. import util from "../../common/js/util";
  1990. // 自定义select组件
  1991. import selectCat from "@/components/select.vue"
  1992. // 引入自定义级联组件
  1993. import vueCascader from "@/components/cascader.vue"
  1994. // 重庆物奇定制组件
  1995. import WeeklyCustomization from "./weeklyCustomization.vue"
  1996. import { mapMutations } from 'vuex'
  1997. let _that = this
  1998. export default {
  1999. mixins: [dragMixin],
  2000. components: {
  2001. selectCat,
  2002. vueCascader,
  2003. WeeklyCustomization
  2004. },
  2005. data() {
  2006. return {
  2007. pageIndex: 0,
  2008. hasMore: true,
  2009. exportType: 0,
  2010. exportingData: false,
  2011. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2012. jobResponseList:[],
  2013. yisibeiCompId: 3092,
  2014. yuzhongCompId: 3385,
  2015. mingyiName : '成都明夷电子科技有限公司',
  2016. // mingyiName : '明夷',
  2017. modItemDataId: null,
  2018. modImportTime: null,
  2019. modImportUserId: null,
  2020. showModImportTimeDialog: false,
  2021. showBatchSimpleApproveReport: false,
  2022. startDeleting: false,
  2023. showBatchDeleteReport: false,
  2024. deleteReportParam: {date:null, userIds:[]},
  2025. isDenying: false,
  2026. targetWeekDate: null,//填写周报中的周日期
  2027. importCardTimeVisi: false,
  2028. startRatioExporting: false,
  2029. exportUserRatio: false,
  2030. ratioYmonth:null,
  2031. hasWrittenReport: false,
  2032. today:null,
  2033. syncTimeLoading: false,
  2034. seluserText: '',
  2035. translation: '1', // 1、文字, 2、部门, 3、人员
  2036. exportLoad: false,
  2037. getPickerOptions: {
  2038. disabledDate: (time) => {
  2039. var date = new Date();
  2040. var year = date.getFullYear();
  2041. var month = date.getMonth() + 1;
  2042. if (month >= 1 && month <= 9) {
  2043. month = "0" + month;
  2044. }
  2045. var currentdate = year.toString() + month.toString();
  2046. var timeyear = time.getFullYear();
  2047. var timemonth = time.getMonth() + 1;
  2048. if (timemonth >= 1 && timemonth <= 9) {
  2049. timemonth = "0" + timemonth;
  2050. }
  2051. var timedate = timeyear.toString() + timemonth.toString();
  2052. if(this.user.timeType.fillAhead == 0){
  2053. return currentdate < timedate;
  2054. }else{
  2055. return false
  2056. }
  2057. }
  2058. },
  2059. alalal: '8.0',
  2060. timeBasecostList:null,
  2061. tbload: false,
  2062. exportTimeDialog: false,
  2063. searchKeyword: '',
  2064. monthWorkDataS: [],
  2065. monthNotWorkDateS: [],
  2066. pickDateArray:[],
  2067. WorktimeDatepickValue: [],
  2068. activeName:"first",
  2069. isLeave: 0,
  2070. submitingReport: false,
  2071. importResultMsg:null,
  2072. showImportResult:false,
  2073. importingData: false,
  2074. isDraft: 0,
  2075. timeStamp: 0,
  2076. projectColumns:[],
  2077. checkinLoading:false,
  2078. importWxParam:{date:null,},
  2079. active:0,
  2080. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2081. importWxDialog:false,
  2082. importDialog:false,
  2083. denyForm:null,
  2084. denyReasonDialog:false,
  2085. monthWorkTimeDialog: false,
  2086. isSubstitude:false,
  2087. isFill:false,
  2088. unFillList:[],
  2089. fillList:[],
  2090. fillMembList:[],
  2091. fillMembList_leave: [],
  2092. membListVisible: false,
  2093. isBatch:0,//是否是批量填报
  2094. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2095. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2096. 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')],
  2097. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2098. fillStatusList: [],
  2099. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2100. exportDialog:false,
  2101. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2102. subProjectList:[],
  2103. canEdit: true,
  2104. originCanEdit: true,
  2105. timeRange:[0.0,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],
  2106. selectTime:null,
  2107. reportTimeType:{},
  2108. curDate:'',
  2109. isAllSelect: false,
  2110. approveDialogVisible:false,
  2111. deptId:null,
  2112. targetUid: null,
  2113. membCount:0,
  2114. selectState:"-1",
  2115. user: JSON.parse(sessionStorage.getItem("user")),
  2116. allUsersList: [],
  2117. showAddMore:false,
  2118. allDate: [],
  2119. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2120. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2121. choseDay: 0,
  2122. tableHeight: 0,
  2123. listLoading: false,
  2124. projectList: [], //项目列表
  2125. fillProjectList: [],
  2126. reportList: [], //日报列表
  2127. reportNames:[], //批量审批列表
  2128. selCon:[], //筛选条件
  2129. selProjectList:[], //筛选后项目列表
  2130. selConShow: true,
  2131. usersList: [], // 全部人员列表
  2132. usersListId: '', // 选中的人员id
  2133. dialogVisible: false, //项目弹窗
  2134. report: '',
  2135. workForm: {
  2136. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2137. domains: [{
  2138. id: null,
  2139. projectId: "",
  2140. workingTime: "",
  2141. timeType:0,
  2142. content: "",
  2143. state: 2,
  2144. multiWorktime:0,
  2145. worktimeList:[],
  2146. degreeId: null,
  2147. auditUserList: [],
  2148. }],
  2149. },
  2150. workRules: {
  2151. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2152. },
  2153. chooseParticipVisible: false,
  2154. logining: false,
  2155. isDisable: false,
  2156. timeType:[],
  2157. deptMembData: [
  2158. ],
  2159. //部门人员树状结构
  2160. data: [
  2161. {
  2162. id: -1,
  2163. label: this.$t('lable.allStaff'),
  2164. membCount:0
  2165. },
  2166. {
  2167. id: 0,
  2168. label: this.$t('lable.unassigned'),
  2169. }
  2170. ],
  2171. allData:{},
  2172. batchShowData:{},
  2173. option: [],
  2174. deptOptionList: [],
  2175. depData: {
  2176. id: -1,
  2177. label: this.$t('lable.allStaff'),
  2178. },
  2179. defaultProps: {
  2180. children: 'children',
  2181. label: 'label'
  2182. },
  2183. isNew: false,
  2184. selected: false,
  2185. valuet: new Date(),
  2186. domObj: null,
  2187. participator:[],
  2188. chosenMembCount:0,
  2189. jsDay: 0,
  2190. jsTime: 0,
  2191. falsss: false,
  2192. weidu: [],
  2193. weiduList: [],
  2194. yonghuUser: [],
  2195. dateAr: [],
  2196. batchSubFillDialog: false,
  2197. isSubstiS: false,
  2198. fillWeekDialogVisi: false,
  2199. fillWeekDialogVisiCustom: false,
  2200. zhoData: [],
  2201. weekDateRange: [],
  2202. btnZho: false,
  2203. weekDataLoading: false,
  2204. changdu: 6,
  2205. tianxieDialogVisible: false,
  2206. scopess: {},
  2207. zhoBao: {
  2208. time: '',
  2209. workingTime: '',
  2210. progress: '',
  2211. con: '',
  2212. subProjectId: '',
  2213. stage: '',
  2214. subProjectList: [],
  2215. stages: [],
  2216. },
  2217. zhoBaoIdx: '',
  2218. zhoBaoName: '',
  2219. zhis: {},
  2220. dealList: [],
  2221. toViewDialogVisible: false,
  2222. toViewList: [],
  2223. toViewloading: true,
  2224. toViewForm: {
  2225. pageIndex: '1',
  2226. pageSize: '20',
  2227. total: 0,
  2228. },
  2229. toViewloadings: false,
  2230. tabPositionss: 'top',
  2231. monthTotal: 0,
  2232. monthTotalPage: 0,
  2233. monthTotalLages: 20,
  2234. monthWorkData: [],
  2235. monthNotWorkDate: [],
  2236. monthWorkDataS1: [],
  2237. monthnotTotal: 0,
  2238. monthnotTotalPage: 0,
  2239. monthnotTotalLages: 20,
  2240. monthNotWorkDateS1: [],
  2241. deptMembDataText: '',
  2242. isFlag: false,
  2243. isMore: false,
  2244. stateKey: '0',
  2245. expandDate: [],
  2246. notifySelList:[],
  2247. departmentList: [],
  2248. approvalProcessDialog: false,
  2249. approvalProcessData: [],
  2250. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2251. 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')],
  2252. isWeekend: false,
  2253. canCancelInDialog: false,
  2254. approveinData: {},
  2255. approveinDialog: false,
  2256. reportCanDelete: false,
  2257. weeklyFilledTimeDialog: false,
  2258. weeklyFilledTimeList: [],
  2259. weeklyFilledTimeLoading: false,
  2260. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2261. weeklyFilledTimeCanDelete: false,
  2262. weeklyFilledTimeDate: null,
  2263. leaveAllNum: 0,
  2264. dataLoading: false,
  2265. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2266. vacationTime: {},
  2267. integrationProjectList: [],
  2268. totalReportHours: 0, // 合计的工时
  2269. workTimeForMinYi:0,
  2270. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2271. weekIndex: 1,
  2272. weekParentData: {},
  2273. deptIdForNoReport:[],
  2274. nameAearch: '', // 企业微信姓名搜索
  2275. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2276. deptMembDataLoading: false,
  2277. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2278. {
  2279. id: 4811,
  2280. // id: 10,
  2281. name: '陕西柘中建设工程有限公司'
  2282. }
  2283. ],
  2284. pushWorkTimeLogDig:false,
  2285. pushWorkTimeLogData:[],
  2286. WorktimeDatepickValueForMonth:[],
  2287. };
  2288. },
  2289. watch: {
  2290. deptMembDataText(val) {
  2291. this.$refs.chooseMembTree.filter(val);
  2292. }
  2293. },
  2294. filters: {
  2295. // 过滤
  2296. amounts(value) {
  2297. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2298. return 0
  2299. }
  2300. var zhi = +value + 0
  2301. return zhi.toFixed(1)
  2302. },
  2303. // zhoData
  2304. zhoData(value, arr) {
  2305. var dateArray = value.split("-");
  2306. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2307. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2308. // console.log(arr[date.getDay()])
  2309. // return "周" + "日一二三四五六".charAt(date.getDay());
  2310. return arr[date.getDay()]
  2311. },
  2312. // 过滤数字
  2313. numbers(value) {
  2314. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2315. return 0
  2316. }
  2317. return value
  2318. },
  2319. },
  2320. computed: {},
  2321. mounted() {
  2322. var now = new Date();
  2323. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2324. this.today = t;
  2325. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2326. this.exportParam.dateRange = [startStr,t];
  2327. this.getAllDate(1);
  2328. this.getReportList();
  2329. this.getProjectList();
  2330. this.getFillProjectList();
  2331. this.getTimeType();
  2332. this.getDepartment();
  2333. this.scrollFunction()
  2334. this.userssHu();
  2335. this.getFirstAndLastDay()
  2336. if(this.user.timeType.reportAuditType == 3){
  2337. this.getAllUsersList()
  2338. }
  2339. if (this.user.company.packageProject == 1) {
  2340. this.getBasecostItemList();
  2341. }
  2342. if(this.user.timeType.lockWorktime){
  2343. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2344. }
  2345. //设置了下限
  2346. if (this.user.timeType.minReportTime) {
  2347. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2348. }
  2349. const that = this
  2350. if(this.user.userNameNeedTranslate == 1) {
  2351. that.dataLoading = that.$store.state.dataLoading
  2352. this.upDataLoading()
  2353. setTimeout(()=>{
  2354. that.dataLoading = that.$store.state.dataLoading
  2355. }, 1000)
  2356. }
  2357. if (this.user.companyId == this.yuzhongCompId) {
  2358. this.getJobResponList();
  2359. }
  2360. },
  2361. methods: {
  2362. ...mapMutations(['upDataLoading']),
  2363. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2364. isCustomization(userInfo, permissionArray) {
  2365. const { companyId } = userInfo
  2366. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2367. return isReportPictureRequired
  2368. },
  2369. //任务被选中
  2370. onTaskSelected(domainItem) {
  2371. //取服务
  2372. if (domainItem.taskId) {
  2373. var that = this;
  2374. var param = {taskId:domainItem.taskId};
  2375. if (this.isSubstitude) {
  2376. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2377. param.userId = this.workForm.userId[0];
  2378. }
  2379. }
  2380. this.http.post('/task/getMyTaskService',param, res => {
  2381. if (res.code == "ok") {
  2382. // domainItem.workContentList = res.data;
  2383. that.$set(domainItem, 'sapServiceId', null);
  2384. that.$set(domainItem, 'serviceList', res.data);
  2385. } else {
  2386. this.$message({
  2387. message: res.msg,
  2388. type: "error"
  2389. });
  2390. }
  2391. },error => {
  2392. this.$message({
  2393. message: error,
  2394. type: "error"
  2395. });
  2396. }
  2397. );
  2398. } else {
  2399. //清空服务
  2400. }
  2401. },
  2402. onBatchTimeChange() {
  2403. //反向计算每日工作时长
  2404. if (this.workForm.createDate) {
  2405. let sdate = new Date(this.workForm.createDate[0]);
  2406. let edate = new Date(this.workForm.createDate[1]);
  2407. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2408. console.log('days===', days)
  2409. if (days < 0) {
  2410. return;
  2411. }
  2412. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2413. //总时长发生改变,自动按比例计算
  2414. this.workForm.domains.forEach(d=>{
  2415. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2416. });
  2417. }
  2418. },
  2419. //更新工作内容列表
  2420. updateJobContent(domainItem) {
  2421. var that = this;
  2422. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2423. if (res.code == "ok") {
  2424. // domainItem.workContentList = res.data;
  2425. that.$set(domainItem, 'extraField3', null);
  2426. that.$set(domainItem, 'workContentList', res.data);
  2427. } else {
  2428. this.$message({
  2429. message: res.msg,
  2430. type: "error"
  2431. });
  2432. }
  2433. },error => {
  2434. this.$message({
  2435. message: error,
  2436. type: "error"
  2437. });
  2438. }
  2439. );
  2440. },
  2441. updateResponse(domainItem) {
  2442. var that = this;
  2443. var selectPid = domainItem.projectId;
  2444. domainItem.extraField2 = null;
  2445. domainItem.extraField3 = null;
  2446. if (selectPid && domainItem.extraField1) {
  2447. //是否非项目
  2448. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2449. console.log('==========','isPublic=='+isPublic);
  2450. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2451. console.log(filteredRespList);
  2452. domainItem.filteredRespList = filteredRespList;
  2453. }
  2454. },
  2455. getJobResponList() {
  2456. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2457. if (res.code == "ok") {
  2458. this.jobResponseList = res.data;
  2459. } else {
  2460. this.$message({
  2461. message: res.msg,
  2462. type: "error"
  2463. });
  2464. }
  2465. },error => {
  2466. this.$message({
  2467. message: error,
  2468. type: "error"
  2469. });
  2470. }
  2471. );
  2472. },
  2473. openModImportTime(row) {
  2474. this.showModImportTimeDialog = true;
  2475. this.modItemDataId = row.id;
  2476. },
  2477. delImportTime(row) {
  2478. let rowId = row.id;
  2479. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2480. confirmButtonText: this.$t('btn.determine'),
  2481. cancelButtonText: this.$t('btn.cancel'),
  2482. type: "warning"
  2483. })
  2484. .then(() => {
  2485. this.http.post('/report-import-log/delete',{
  2486. id: rowId
  2487. },res => {
  2488. if (res.code == "ok") {
  2489. this.$message({
  2490. message: '删除成功',
  2491. type: "success"
  2492. });
  2493. this.getToView();
  2494. } else {
  2495. this.$message({
  2496. message: res.msg,
  2497. type: "error"
  2498. });
  2499. }
  2500. },error => {
  2501. this.$message({
  2502. message: error,
  2503. type: "error"
  2504. });
  2505. }
  2506. );
  2507. }).catch(() => {this.startDeleting = false});
  2508. },
  2509. confirmChangeModTime() {
  2510. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2511. this.$message({
  2512. message: '请选择时间',
  2513. type: "error"
  2514. });
  2515. return;
  2516. }
  2517. this.http.post('/report-import-log/changeTime',{
  2518. modLogDateTime: this.modImportTime,
  2519. modImportUserId: this.modImportUserId,
  2520. id: this.modItemDataId
  2521. },res => {
  2522. if (res.code == "ok") {
  2523. this.$message({
  2524. message: '修改成功',
  2525. type: "success"
  2526. });
  2527. this.getToView();
  2528. this.showModImportTimeDialog = false;
  2529. } else {
  2530. this.$message({
  2531. message: res.msg,
  2532. type: "error"
  2533. });
  2534. }
  2535. },error => {
  2536. this.$message({
  2537. message: error,
  2538. type: "error"
  2539. });
  2540. }
  2541. );
  2542. },
  2543. confirmBatchApproveReport() {
  2544. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2545. this.$message({
  2546. message: '请选择日期范围',
  2547. type: "error"
  2548. });
  2549. return;
  2550. }
  2551. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2552. confirmButtonText: this.$t('btn.determine'),
  2553. cancelButtonText: this.$t('btn.cancel'),
  2554. type: "warning"
  2555. })
  2556. .then(() => {
  2557. this.startDeleting = true;
  2558. let obj = {
  2559. startDate: this.deleteReportParam.date[0],
  2560. endDate: this.deleteReportParam.date[1]
  2561. }
  2562. if(this.deleteReportParam.departmentId) {
  2563. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2564. } else {
  2565. obj.departmentId = null
  2566. }
  2567. this.http.post('/report/batchApproveByDate',obj,res => {
  2568. if (res.code == "ok") {
  2569. this.$message({
  2570. message: '审核通过',
  2571. type: "success"
  2572. });
  2573. this.getReportList();
  2574. this.getDepartment();
  2575. this.startDeleting = false;
  2576. } else {
  2577. this.$message({
  2578. message: res.msg,
  2579. type: "error"
  2580. });
  2581. }
  2582. },error => {
  2583. this.$message({
  2584. message: error,
  2585. type: "error"
  2586. });
  2587. }
  2588. );
  2589. }).catch(() => {this.startDeleting = false});
  2590. },
  2591. confirmBatchDelReport() {
  2592. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2593. this.$message({
  2594. message: '请选择部门或人员',
  2595. type: "error"
  2596. });
  2597. return;
  2598. }
  2599. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2600. this.$message({
  2601. message: '请选择日期范围',
  2602. type: "error"
  2603. });
  2604. return;
  2605. }
  2606. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2607. confirmButtonText: this.$t('btn.determine'),
  2608. cancelButtonText: this.$t('btn.cancel'),
  2609. type: "warning"
  2610. })
  2611. .then(() => {
  2612. this.startDeleting = true;
  2613. this.http.post('/report/batchDelete',{
  2614. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2615. startDate: this.deleteReportParam.date[0],
  2616. endDate: this.deleteReportParam.date[1],
  2617. deptId: this.deleteReportParam.deptId[0]
  2618. },res => {
  2619. if (res.code == "ok") {
  2620. this.$message({
  2621. message: this.$t('message.successfullyDeleted'),
  2622. type: "success"
  2623. });
  2624. this.getReportList();
  2625. this.getDepartment();
  2626. this.startDeleting = false;
  2627. } else {
  2628. this.$message({
  2629. message: res.msg,
  2630. type: "error"
  2631. });
  2632. }
  2633. },error => {
  2634. this.$message({
  2635. message: error,
  2636. type: "error"
  2637. });
  2638. }
  2639. );
  2640. }).catch(() => {this.startDeleting = false});
  2641. },
  2642. getRecentlyProject() {
  2643. this.http.post('/project/nearProject',{},res => {
  2644. if(res.code == 'ok'){
  2645. let topObj = {
  2646. label: '最近选择项目',
  2647. peojectList: res.data
  2648. }
  2649. let botomObj = {
  2650. label: '全部项目',
  2651. peojectList: this.fillProjectList
  2652. }
  2653. //最近项目如果在fillProjectList中不存在,需要移除
  2654. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2655. this.integrationProjectList = [topObj, botomObj]
  2656. }else {
  2657. this.$message({
  2658. message: res.msg,
  2659. type: 'error'
  2660. })
  2661. }
  2662. },err => {
  2663. this.$message({
  2664. message: err,
  2665. type: 'error'
  2666. })
  2667. })
  2668. },
  2669. handlePictureCardPreview(file, index) {
  2670. console.log(file, index)
  2671. let arr = []
  2672. let imgArr = this.workForm.domains[index].imgListUrl
  2673. for(var i in imgArr) {
  2674. arr.push(imgArr[i].url)
  2675. }
  2676. console.log(arr, '图片数据')
  2677. const $viewer = this.$viewerApi({
  2678. images: arr
  2679. });
  2680. },
  2681. // 图片上传
  2682. addImg(e, index) {
  2683. console.log(e, '数据')
  2684. let formData = new FormData()
  2685. formData.append('multipartFile', e.file)
  2686. this.http.uploadFile('/common/uploadFile', formData,
  2687. res => {
  2688. if (res.code == "ok") {
  2689. this.$message({
  2690. message: this.$t('uploadedsuccessfully'),
  2691. type: "success"
  2692. });
  2693. if(!this.workForm.domains[index].imgList) {
  2694. this.workForm.domains[index].imgList = []
  2695. this.workForm.domains[index].imgListUrl = []
  2696. }
  2697. this.workForm.domains[index].imgList.push(res.data)
  2698. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2699. } else {
  2700. this.$message({message: res.msg,type: "error"});
  2701. }
  2702. console.log(this.workForm.domains[index])
  2703. },
  2704. error => {this.$message({message: error,type: "error"});
  2705. });
  2706. },
  2707. // 删除图片
  2708. delImg(file,fileList, index) {
  2709. console.log(file, fileList)
  2710. let idx = 0
  2711. for(let i in fileList) {
  2712. if(fileList[i].uid == file.uid) {
  2713. idx = i
  2714. }
  2715. }
  2716. this.workForm.domains[index].imgList.splice(idx, 1)
  2717. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2718. console.log(this.workForm.domains[index])
  2719. },
  2720. test(){
  2721. console.log('test',this.workForm.domains);
  2722. },
  2723. getHour(s1, s2) {
  2724. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2725. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2726. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2727. var ms = s2.getTime() - s1.getTime();
  2728. if (ms < 0) return 0;
  2729. let ma = ms / 1000 / 60 / 60
  2730. return ma; //小时
  2731. },
  2732. refreshWXCardTime(workdate) {
  2733. if (!workdate) return;
  2734. this.syncTimeLoading = true;
  2735. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2736. date: workdate,
  2737. },res => {
  2738. this.syncTimeLoading = false;
  2739. if(res.code == 'ok'){
  2740. this.workForm.time = res.data.time;
  2741. }else {
  2742. this.$message({
  2743. message: res.msg,
  2744. type: 'error'
  2745. })
  2746. }
  2747. },err => {
  2748. this.syncTimeLoading = false;
  2749. this.$message({
  2750. message: err,
  2751. type: 'error'
  2752. })
  2753. })
  2754. },
  2755. refreshAttendance(workdate) {
  2756. if (!workdate) return;
  2757. this.syncTimeLoading = true;
  2758. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2759. startDate: workdate[0],
  2760. endDate: workdate[1]
  2761. },res => {
  2762. this.syncTimeLoading = false;
  2763. if(res.code == 'ok'){
  2764. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2765. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2766. this.totalReportHours = this.workTimeForMinYi;
  2767. }else {
  2768. this.$message({
  2769. message: res.msg,
  2770. type: 'error'
  2771. })
  2772. }
  2773. },err => {
  2774. this.syncTimeLoading = false;
  2775. this.$message({
  2776. message: err,
  2777. type: 'error'
  2778. })
  2779. })
  2780. },
  2781. refreshBeiSengAttendance(workdate) {
  2782. if (!workdate) return;
  2783. this.syncTimeLoading = true;
  2784. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2785. createDate: workdate
  2786. },res => {
  2787. this.syncTimeLoading = false;
  2788. if(res.code == 'ok'){
  2789. this.workForm.time = res.data;
  2790. }else {
  2791. this.$message({
  2792. message: res.msg,
  2793. type: 'error'
  2794. })
  2795. }
  2796. },err => {
  2797. this.syncTimeLoading = false;
  2798. this.$message({
  2799. message: err,
  2800. type: 'error'
  2801. })
  2802. })
  2803. },
  2804. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2805. this.weeklyFilledTimeDialog = true
  2806. this.weeklyFilledTimeLoading = true
  2807. this.weeklyFilledTimeDate = parameterDate
  2808. this.http.post('/report/getReportList',{
  2809. date: parameterDate,
  2810. userId: this.user.id
  2811. },res => {
  2812. this.weeklyFilledTimeLoading = false
  2813. if(res.code == 'ok'){
  2814. this.weeklyFilledTimeList = res.data[0].data
  2815. let candelete = true
  2816. for(let i in this.weeklyFilledTimeList){
  2817. if(this.weeklyFilledTimeList[i].state < 2){
  2818. candelete = false
  2819. }
  2820. }
  2821. this.weeklyFilledTimeCanDelete = candelete
  2822. }else {
  2823. this.$message({
  2824. message: res.msg,
  2825. type: 'error'
  2826. })
  2827. }
  2828. },err => {
  2829. this.weeklyFilledTimeLoading = false
  2830. this.$message({
  2831. message: err,
  2832. type: 'error'
  2833. })
  2834. })
  2835. },
  2836. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2837. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2838. confirmButtonText: this.$t('btn.determine'),
  2839. cancelButtonText: this.$t('btn.cancel'),
  2840. type: "warning"
  2841. })
  2842. .then(() => {
  2843. this.http.post('/report/delete',{
  2844. userId: this.user.id,
  2845. date: this.weeklyFilledTimeDate
  2846. },res => {
  2847. if (res.code == "ok") {
  2848. this.$message({
  2849. message: this.$t('message.successfullyDeleted'),
  2850. type: "success"
  2851. });
  2852. this.getWeeklyWorkTime()
  2853. this.getReportList();
  2854. this.getDepartment();
  2855. this.weeklyFilledTimeDialog = false;
  2856. } else {
  2857. this.$message({
  2858. message: res.msg,
  2859. type: "error"
  2860. });
  2861. }
  2862. },error => {
  2863. this.$message({
  2864. message: error,
  2865. type: "error"
  2866. });
  2867. }
  2868. );
  2869. }).catch(() => {});
  2870. },
  2871. getApprovalProcess(item){
  2872. // console.log('this.date',this.choseDate);
  2873. this.http.post('/report-log/get',{
  2874. creatorId: item.id,
  2875. createDate: sessionStorage.msg
  2876. },res => {
  2877. if(res.code == 'ok'){
  2878. this.approvalProcessDialog = true
  2879. if(this.user.userNameNeedTranslate == 1) {
  2880. for(var i in res.data) {
  2881. let obj = {
  2882. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2883. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2884. }
  2885. res.data[i].msgCon = obj
  2886. }
  2887. }
  2888. this.approvalProcessData = res.data
  2889. console.log(this.approvalProcessData, '数据卡看')
  2890. }else{
  2891. this.$message({
  2892. message: res.msg,
  2893. type: 'error'
  2894. })
  2895. }
  2896. },err => {
  2897. this.$message({
  2898. message: err,
  2899. type: 'error'
  2900. })
  2901. })
  2902. },
  2903. filterNode(value, data) {
  2904. if (!value) return true;
  2905. return data.label.indexOf(value) !== -1;
  2906. },
  2907. triggerCalculateOT(index) {
  2908. var str = this.workForm.domains[index].overtimeHours + ''
  2909. if(str.indexOf('.') != '-1') {
  2910. var s = str.split('.')[0]
  2911. var st = str.split('.')[1]
  2912. var sts = st.split('')
  2913. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2914. }
  2915. },
  2916. searchScreen(e){
  2917. if(e){
  2918. this.monthNotWorkDateS1 = []
  2919. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2920. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2921. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2922. }
  2923. }
  2924. if (this.monthNotWorkDateS1.length > 50) {
  2925. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2926. }else{
  2927. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2928. }
  2929. // if (this.monthNotWorkDateS1.length > 0) {
  2930. // setTimeout(() => {
  2931. // this.tableListenernot()
  2932. // }, 1000);
  2933. // }
  2934. }else{
  2935. this.monthWorkDataS1 = []
  2936. for (let i = 0; i < this.monthWorkData.length; i++) {
  2937. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2938. this.monthWorkDataS1.push(this.monthWorkData[i])
  2939. }
  2940. }
  2941. if (this.monthWorkDataS1.length > 50) {
  2942. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2943. }else{
  2944. this.monthWorkDataS = this.monthWorkDataS1
  2945. }
  2946. // if (this.monthWorkDataS1.length > 0) {
  2947. // setTimeout(() => {
  2948. // this.tableListener()
  2949. // }, 1000);
  2950. // }
  2951. }
  2952. },
  2953. addUpload(data) {
  2954. // var zhi = data.fileName.split('.')[0]
  2955. // var sss = zhi + '.xlsx'
  2956. // return
  2957. var filePath = '/upload/' + data.serverName;
  2958. const a = document.createElement('a'); // 创建a标签
  2959. a.setAttribute('download', data.fileName);// download属性
  2960. a.setAttribute('href', filePath);// href链接
  2961. a.click(); //自执行点击事件
  2962. a.remove();
  2963. },
  2964. restrictNumber(targetId) {
  2965. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2966. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2967. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2968. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2969. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2970. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2971. inpu.value = parseFloat(inpu.value);
  2972. }
  2973. },
  2974. //获取项目下的任务分组
  2975. getTaskGroups(domain, index) {
  2976. domain.groupId=null;
  2977. this.http.post('/task-group/listMyJoinGroup',{
  2978. projectId: domain.projectId,
  2979. isSubstitude: this.isSubstitude ? 1 : 0
  2980. },
  2981. res => {
  2982. if (res.code == "ok") {
  2983. this.workForm.domains[index].taskGroups = res.data;
  2984. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2985. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2986. // this.getGroupStages(domain, index);
  2987. // }
  2988. this.$forceUpdate();
  2989. }
  2990. },
  2991. error => {
  2992. this.$message({
  2993. message: error,
  2994. type: "error"
  2995. });
  2996. }
  2997. );
  2998. },
  2999. //下载填报工时占比报表
  3000. downloadProjectRatio() {
  3001. this.exportUserRatio = true;
  3002. // let now = new Date();
  3003. // let month = now.getMonth();//默认看上个月的
  3004. // let monthStr = month<10? ('0'+month): month;
  3005. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3006. const today = new Date();
  3007. const year = today.getFullYear();
  3008. const month = today.getMonth() + 1;
  3009. let lastMonthYear, lastMonth;
  3010. if (month === 1) {
  3011. lastMonthYear = year - 1;
  3012. lastMonth = 12;
  3013. } else {
  3014. lastMonthYear = year;
  3015. lastMonth = month - 1;
  3016. }
  3017. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3018. console.log('赋值 ==>', this.ratioYmonth)
  3019. },
  3020. confirmDownloadRatio() {
  3021. this.startRatioExporting = true;
  3022. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3023. ymonth: this.ratioYmonth
  3024. },
  3025. res => {
  3026. if (res.code == "ok") {
  3027. this.startRatioExporting = false;
  3028. var filePath = res.data;
  3029. const a = document.createElement('a'); // 创建a标签
  3030. var data = filePath.split("/");
  3031. a.setAttribute('download', data[data.length-1]);// download属性
  3032. a.setAttribute('href', filePath);// href链接
  3033. a.click(); //自执行点击事件
  3034. a.remove();
  3035. } else {
  3036. this.startRatioExporting = false;
  3037. this.$message({
  3038. message: res.msg,
  3039. type: "error"
  3040. });
  3041. }
  3042. },
  3043. error => {
  3044. this.checkinLoading = false;
  3045. this.$message({
  3046. message: error,
  3047. type: "error"
  3048. });
  3049. }
  3050. );
  3051. },
  3052. //下载带企业微信考勤数据的工时统计模板
  3053. downloadCheckInExcel() {
  3054. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3055. startDate: this.importWxParam.date[0],
  3056. endDate: this.importWxParam.date[1],
  3057. },
  3058. res => {
  3059. if (res.code == "ok") {
  3060. var filePath = res.data;
  3061. const a = document.createElement('a'); // 创建a标签
  3062. var data = filePath.split("/");
  3063. a.setAttribute('download', data[data.length-1]);// download属性
  3064. a.setAttribute('href', filePath);// href链接
  3065. a.click(); //自执行点击事件
  3066. a.remove();
  3067. } else {
  3068. this.$message({
  3069. message: res.msg,
  3070. type: "error"
  3071. });
  3072. }
  3073. },
  3074. error => {
  3075. this.checkinLoading = false;
  3076. this.$message({
  3077. message: error,
  3078. type: "error"
  3079. });
  3080. }
  3081. );
  3082. },
  3083. pre() {
  3084. if (this.active == 0) return;
  3085. this.active--;
  3086. },
  3087. next() {
  3088. this.active++;
  3089. },
  3090. triggerTotalTime(index) {
  3091. var item = this.checkinList[index];
  3092. var total = 0.0;
  3093. for (var i=0;i<this.projectColumns.length; i++) {
  3094. var key = this.projectColumns[i];
  3095. if (item[key] != null && item[key] != '') {
  3096. total += parseFloat(item[key]);
  3097. }
  3098. }
  3099. item.totalFillTime = total;
  3100. },
  3101. //提交批量代填的数据
  3102. submitBatchSubFillData() {
  3103. var data = JSON.stringify(this.checkinList);
  3104. this.http.post('/user-corpwx-time/submitProjectTime',{
  3105. json: data,
  3106. projectColumns: JSON.stringify(this.projectColumns)
  3107. },
  3108. res => {
  3109. if (res.code == "ok") {
  3110. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3111. this.importWxDialog = false;
  3112. }
  3113. },
  3114. error => {
  3115. this.checkinLoading = false;
  3116. this.$message({
  3117. message: error,
  3118. type: "error"
  3119. });
  3120. }
  3121. );
  3122. },
  3123. loadCheckInData() {
  3124. if (this.importWxParam.date == null) {
  3125. this.checkinList = [];
  3126. return;
  3127. }
  3128. this.checkinLoading = true;
  3129. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3130. startDate: this.importWxParam.date[0],
  3131. endDate: this.importWxParam.date[1],
  3132. },
  3133. res => {
  3134. if (res.code == "ok") {
  3135. this.checkinLoading = false;
  3136. this.checkinList = res.data.list;
  3137. this.projectColumns = res.data.projects;
  3138. // 自定义表格会导致表格错乱,需重新计算表格
  3139. this.$nextTick(()=>{
  3140. this.$refs.tab.doLayout()
  3141. })
  3142. }
  3143. },
  3144. error => {
  3145. this.checkinLoading = false;
  3146. this.$message({
  3147. message: error,
  3148. type: "error"
  3149. });
  3150. }
  3151. );
  3152. },
  3153. importCardTime(item) {
  3154. //首先判断文件类型
  3155. let str = item.file.name.split(".");
  3156. let format = str[str.length - 1];
  3157. if (format != "xls" && format != "xlsx") {
  3158. this.$message({
  3159. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3160. type: "error"
  3161. });
  3162. } else {
  3163. this.importingData = true;
  3164. let formData = new FormData();
  3165. formData.append("multipartFile", item.file);
  3166. formData.append("companyId", this.user.companyId);
  3167. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3168. res => {
  3169. this.$refs.uploadCardTime.clearFiles();
  3170. this.importingData = false;
  3171. if (res.code == "ok") {
  3172. //换成弹出框,以免有人等了半天回来啥也没看到
  3173. this.$message({
  3174. message: '导入考勤时长成功',
  3175. type: "success"
  3176. });
  3177. } else {
  3178. this.$message({
  3179. message: res.msg,
  3180. type: "error"
  3181. });
  3182. }
  3183. },
  3184. error => {
  3185. this.$refs.upload.clearFiles();
  3186. this.listLoading = false;
  3187. this.$message({
  3188. message: error,
  3189. type: "error"
  3190. });
  3191. });
  3192. }
  3193. },
  3194. batchImportWxData(item) {
  3195. //首先判断文件类型
  3196. let str = item.file.name.split(".");
  3197. let format = str[str.length - 1];
  3198. if (format != "xls" && format != "xlsx") {
  3199. this.$message({
  3200. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3201. type: "error"
  3202. });
  3203. } else {
  3204. this.importingData = true;
  3205. let formData = new FormData();
  3206. formData.append("file", item.file);
  3207. formData.append("companyId", this.user.companyId);
  3208. formData.append("withCheckIn", 1);
  3209. this.http.uploadFile('/report/importData', formData,
  3210. res => {
  3211. this.$refs.upload.clearFiles();
  3212. this.showImportResult = true;
  3213. this.importingData = false;
  3214. if (res.code == "ok") {
  3215. //换成弹出框,以免有人等了半天回来啥也没看到
  3216. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3217. this.getReportList();
  3218. this.importWxDialog = false;
  3219. } else {
  3220. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3221. }
  3222. },
  3223. error => {
  3224. this.$refs.upload.clearFiles();
  3225. this.listLoading = false;
  3226. this.$message({
  3227. message: error,
  3228. type: "error"
  3229. });
  3230. });
  3231. }
  3232. },
  3233. batchImportData(item) {
  3234. //首先判断文件类型
  3235. let str = item.file.name.split(".");
  3236. let format = str[str.length - 1];
  3237. if (format != "xls" && format != "xlsx") {
  3238. this.$message({
  3239. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3240. type: "error"
  3241. });
  3242. } else {
  3243. this.importingData = true;
  3244. let formData = new FormData();
  3245. formData.append("file", item.file);
  3246. formData.append("companyId", this.user.companyId);
  3247. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3248. this.http.uploadFile(url, formData,
  3249. res => {
  3250. this.$refs.upload.clearFiles();
  3251. this.importingData = false;
  3252. this.showImportResult = true;
  3253. if (res.code == "ok") {
  3254. //换成弹出框,以免有人等了半天回来啥也没看到
  3255. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3256. this.getReportList();
  3257. this.importWXDialog = false;
  3258. } else {
  3259. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3260. }
  3261. },
  3262. error => {
  3263. this.$refs.upload.clearFiles();
  3264. this.importingData = false;
  3265. this.$message({
  3266. message: error,
  3267. type: "error"
  3268. });
  3269. });
  3270. }
  3271. },
  3272. userssHu() {
  3273. this.http.post('/time-type/getCompanyTimeSetting',{
  3274. companyId: this.user.companyId
  3275. },
  3276. res => {
  3277. if (res.code == "ok") {
  3278. this.yonghuUser = res.data
  3279. }
  3280. },
  3281. error => {
  3282. this.$message({
  3283. message: error,
  3284. type: "error"
  3285. });
  3286. }
  3287. );
  3288. },
  3289. iptBlur(i) {
  3290. if(this.isBatch == 0) {
  3291. return
  3292. }
  3293. var reqParam = {
  3294. startDate: this.workForm.createDate[0],
  3295. endDate: this.workForm.createDate[1]
  3296. };
  3297. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3298. reqParam.userId = this.workForm.userId[0];
  3299. }
  3300. this.http.post('/report/getWorkDays',reqParam,
  3301. res => {
  3302. if (res.code == "ok") {
  3303. this.jsDay = res.data
  3304. this.chuji(i)
  3305. } else {
  3306. this.$message({
  3307. message: res.msg,
  3308. type: "error"
  3309. });
  3310. }
  3311. },
  3312. error => {
  3313. this.$message({
  3314. message: error,
  3315. type: "error"
  3316. });
  3317. }
  3318. );
  3319. //明夷硬编码获取
  3320. if (this.user.company.companyName == this.mingyiName) {
  3321. this.getWorkTimeForMinYi();
  3322. }
  3323. },
  3324. getWorkTimeForMinYi(){
  3325. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3326. startDate: this.workForm.createDate[0],
  3327. endDate: this.workForm.createDate[1]
  3328. },
  3329. res => {
  3330. if (res.code == "ok") {
  3331. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3332. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3333. this.totalReportHours = this.workTimeForMinYi;
  3334. } else {
  3335. this.$message({
  3336. message: res.msg,
  3337. type: "error"
  3338. });
  3339. this.workForm.createDate = [];
  3340. }
  3341. },
  3342. error => {
  3343. this.$message({
  3344. message: error,
  3345. type: "error"
  3346. });
  3347. }
  3348. );
  3349. },
  3350. chuji(i) {
  3351. if(i == 0) {
  3352. this.seleChn(1)
  3353. } else if(i == 1) {
  3354. this.seleChn(0)
  3355. } else if(i == 2) {
  3356. if(this.workForm.domains[0].multiWorktime > 0) {
  3357. this.iptChangs()
  3358. } else {
  3359. this.iptChang()
  3360. }
  3361. } else if(i == 3) {
  3362. this.seleChn(0)
  3363. }
  3364. },
  3365. seleChn(e,domain) {
  3366. if(e == 1) {
  3367. for(var i in this.workForm.domains) {
  3368. if(this.workForm.domains[i].timeType == 0) {
  3369. this.workForm.domains[i].workingTime = 8
  3370. } else {
  3371. this.workForm.domains[i].workingTime = 4
  3372. }
  3373. }
  3374. }
  3375. var quanbu = 0
  3376. var spl = this.workForm.domains
  3377. var zhi = ''
  3378. for(var i in spl) {
  3379. var sp = +spl[i].workingTime + 0
  3380. zhi = this.jsDay * sp
  3381. quanbu = +quanbu + zhi
  3382. }
  3383. this.jsTime = quanbu
  3384. this.totalReportHours = quanbu
  3385. let worktime = this.jsTime
  3386. // 自动计算加班时长
  3387. if(this.isBatch != 0){
  3388. worktime = this.jsTime / this.jsDay
  3389. }
  3390. if(this.user.timeType.fillOvertime && domain){
  3391. let isover = false
  3392. let alltime = 0
  3393. let allover = 0 //此处alltime同上面的worktime
  3394. for(let d in spl){
  3395. if(spl[d].isOvertime){
  3396. isover = true
  3397. allover += spl[d].overtimeHours*1
  3398. }
  3399. alltime += spl[d].workingTime*1
  3400. }
  3401. if(domain.overtimeHours){
  3402. allover = allover - domain.overtimeHours
  3403. }
  3404. if(worktime*1 > this.user.timeType.allday){
  3405. if(isover){
  3406. if(alltime > (allover + this.user.timeType.allday)){
  3407. this.$set(domain,'isOvertime',true)
  3408. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3409. }else{
  3410. this.$set(domain,'isOvertime',false)
  3411. this.$set(domain,'overtimeHours',null)
  3412. if(alltime < (allover + this.user.timeType.allday)){
  3413. let overtime = allover + this.user.timeType.allday - alltime
  3414. for(let pi in spl){
  3415. if(spl[pi].overtimeHours){
  3416. if((overtime - spl[pi].overtimeHours*1) > 0){
  3417. overtime = overtime - spl[pi].overtimeHours*1
  3418. this.$set(spl[pi],'isOvertime',false)
  3419. this.$set(spl[pi],'overtimeHours',null)
  3420. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3421. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3422. break
  3423. }else{
  3424. this.$set(spl[pi],'isOvertime',false)
  3425. this.$set(spl[pi],'overtimeHours',null)
  3426. break
  3427. }
  3428. }
  3429. }
  3430. }
  3431. }
  3432. }else{
  3433. this.$set(domain,'isOvertime',true)
  3434. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3435. }
  3436. }else{
  3437. for(let di in spl){
  3438. this.$set(spl[di],'isOvertime',false)
  3439. this.$set(spl[di],'overtimeHours',null)
  3440. }
  3441. }
  3442. }
  3443. },
  3444. iptChang() {
  3445. var sl = this.workForm.domains
  3446. let timeArr = []
  3447. for(var i in sl) {
  3448. if(sl[i].startTime && sl[i].endTime) {
  3449. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3450. }
  3451. }
  3452. this.getTimeHours(timeArr)
  3453. // for(let j in arrNum) {
  3454. // this.timeJsonStr += arrNum[j]
  3455. // if(flg) {
  3456. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3457. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3458. // }
  3459. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3460. // flg = true
  3461. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3462. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3463. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3464. // }
  3465. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3466. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3467. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3468. // }
  3469. // }
  3470. },
  3471. iptChangs() {
  3472. var sl = this.workForm.domains
  3473. let timeArr = []
  3474. for(var i in sl) {
  3475. for(var j in sl[i].worktimeList){
  3476. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3477. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3478. }
  3479. }
  3480. }
  3481. this.getTimeHours(timeArr)
  3482. },
  3483. // 调用接口或去数据
  3484. getTimeHours(arr) {
  3485. this.http.post('/report/getHoursByTimeRange',{
  3486. timeJsonStr: JSON.stringify(arr)
  3487. },res => {
  3488. if(res.code === 'ok') {
  3489. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3490. } else {
  3491. this.$message({
  3492. message: res.msg,
  3493. type: 'error'
  3494. })
  3495. }
  3496. },err => {
  3497. this.$message({
  3498. message: err,
  3499. type: 'error'
  3500. })
  3501. })
  3502. },
  3503. // 按周填报调用接口计算时间
  3504. async getWeekHoursByTimeRange(timeRange) {
  3505. const url = '/report/getHoursByTimeRange';
  3506. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3507. var that = this;
  3508. return new Promise((resolve, reject) => {
  3509. this.http.post(url, data, function(res) {
  3510. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3511. }, function(err) {
  3512. reject(err);
  3513. });
  3514. });
  3515. },
  3516. removeTimeItem(item, index) {
  3517. item.worktimeList.splice(index, 1);
  3518. this.iptChangs()
  3519. },
  3520. //添加工时
  3521. addNewWorktime(index, item) {
  3522. if(item.worktimeList == null ) {
  3523. item.worktimeList = []
  3524. }
  3525. item.worktimeList.push({});
  3526. },
  3527. //复制项目
  3528. copyProject(index) {
  3529. var leftProgress = 10;
  3530. if (this.reportTimeType.type == 3) {
  3531. //计算已经待分配工时比例
  3532. let array = this.workForm.domains;
  3533. let totalProgress = 0;
  3534. for (var i=0;i<array.length; i++) {
  3535. totalProgress += array[i].progress;
  3536. }
  3537. if (totalProgress < 100) {
  3538. leftProgress = 100 - totalProgress;
  3539. }
  3540. }
  3541. var newIndex = index+1;
  3542. var itemDomain = {
  3543. projectId: this.workForm.domains[index].projectId,
  3544. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3545. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3546. ),
  3547. content: "",
  3548. progress:leftProgress,
  3549. state:2,//2-表示待提交
  3550. };
  3551. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3552. if (this.reportTimeType.type == 0) {
  3553. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3554. var length = this.workForm.domains.length;
  3555. if (length == 2) {
  3556. this.showAddMore = false;
  3557. }
  3558. }
  3559. this.selectProject(itemDomain, newIndex);
  3560. },
  3561. pushWorkTime(reportId){
  3562. let url=''
  3563. if(this.user.timeType.syncSap == 1){
  3564. url='/report/pushProjectReportToSap'
  3565. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3566. var pushDate = this.date + day;
  3567. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3568. confirmButtonText: '确定',
  3569. cancelButtonText: '取消',
  3570. type: 'info'
  3571. }).then(() => {
  3572. const loading = this.$loading({
  3573. lock: true,
  3574. text: '正在推送中,请耐心等待。',
  3575. spinner: 'el-icon-loading',
  3576. background: 'rgba(0, 0, 0, 0.7)'
  3577. });
  3578. this.http.post(url,{
  3579. pushDate: pushDate,
  3580. reportId: reportId
  3581. },res => {
  3582. loading.close();
  3583. if(res.code == 'ok'){
  3584. this.$message({
  3585. type: 'success',
  3586. message: res.data
  3587. });
  3588. }else{
  3589. this.$message({
  3590. type: 'error',
  3591. message: res.msg
  3592. })
  3593. }
  3594. },err => {
  3595. loading.close();
  3596. this.$message({
  3597. type: 'error',
  3598. message: err
  3599. })
  3600. })
  3601. }).catch(() => {
  3602. });
  3603. }else{
  3604. url='/report/pushReportDataToThird'
  3605. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3606. confirmButtonText: '确定',
  3607. cancelButtonText: '取消',
  3608. type: 'info'
  3609. }).then(() => {
  3610. const loading = this.$loading({
  3611. lock: true,
  3612. text: '正在推送中,请耐心等待。',
  3613. spinner: 'el-icon-loading',
  3614. background: 'rgba(0, 0, 0, 0.7)'
  3615. });
  3616. this.http.post(url,{
  3617. yearMonth: this.date
  3618. },res => {
  3619. loading.close();
  3620. if(res.code == 'ok'){
  3621. this.$message({
  3622. type: 'success',
  3623. message: '推送成功!'
  3624. });
  3625. }else{
  3626. this.$message({
  3627. type: 'error',
  3628. message: res.msg
  3629. })
  3630. }
  3631. },err => {
  3632. loading.close();
  3633. this.$message({
  3634. type: 'error',
  3635. message: err
  3636. })
  3637. })
  3638. }).catch(() => {
  3639. });
  3640. }
  3641. },
  3642. showWorkTime(){
  3643. this.monthWorkTimeDialog = true;
  3644. this.searchKeyword = ''
  3645. this.WorktimeDatepickValue = this.istoMonth()
  3646. if(this.WorktimeDatepickValue.length == 0){
  3647. let newdate = new Date();
  3648. let nowdate = newdate.toLocaleDateString();
  3649. let getauto = this.getAutoWeekDate(nowdate)
  3650. let nowwd = [getauto[0],getauto[6]]
  3651. this.WorktimeDatepickValue = nowwd
  3652. }
  3653. this.showMonthWorkTime('first')
  3654. },
  3655. handleClick(t,e){
  3656. if (t.name == "second") {
  3657. this.showMonthNotWorkTime()
  3658. }else if(t.name == "first"){
  3659. this.showMonthWorkTime(t.name)
  3660. }else if(t.name == "third"){
  3661. this.showMonthWorkTimeReminder()
  3662. }
  3663. },
  3664. //导出员工每日填报工时数
  3665. exportMembWorkHours() {
  3666. this.http.post(
  3667. "/report/exportUserDailyWorkTime",
  3668. {
  3669. // month: this.date,
  3670. startDate: this.WorktimeDatepickValue[0],
  3671. endDate: this.WorktimeDatepickValue[1],
  3672. },
  3673. (res) => {
  3674. if (res.code == "ok") {
  3675. let url = res.data;
  3676. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3677. }
  3678. },
  3679. (error) => {
  3680. this.$message({
  3681. message: error,
  3682. type: "error",
  3683. });
  3684. }
  3685. );
  3686. },
  3687. exportMembWorkHoursReminder() {
  3688. this.http.post(
  3689. "/report/exportUserDailyWorkTimeReminder",
  3690. {
  3691. // month: this.date,
  3692. startDate: this.WorktimeDatepickValueForMonth[0],
  3693. endDate: this.WorktimeDatepickValueForMonth[1],
  3694. },
  3695. (res) => {
  3696. if (res.code == "ok") {
  3697. let url = res.data;
  3698. this.downloadByA('工时异常表.xlsx', url);
  3699. }
  3700. },
  3701. (error) => {
  3702. this.$message({
  3703. message: error,
  3704. type: "error",
  3705. });
  3706. }
  3707. );
  3708. },
  3709. exportMembNotWorkHours() {
  3710. this.http.post(
  3711. "/report/exportNoReportUserList",
  3712. {
  3713. // month: this.date,
  3714. startDate: this.WorktimeDatepickValue[0],
  3715. endDate: this.WorktimeDatepickValue[1],
  3716. },
  3717. (res) => {
  3718. if (res.code == "ok") {
  3719. let url = res.data;
  3720. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3721. }
  3722. },
  3723. (error) => {
  3724. this.$message({
  3725. message: error,
  3726. type: "error",
  3727. });
  3728. }
  3729. );
  3730. },
  3731. downloadByA(name, url) {
  3732. const a = document.createElement("a"); // 创建a标签
  3733. a.setAttribute("download", name); // download属性
  3734. a.setAttribute("href", url); // href链接
  3735. a.click(); // 自执行点击事件
  3736. a.remove();
  3737. },
  3738. // 是否本月判断
  3739. istoMonth(){
  3740. let todate = new Date()
  3741. let tomonth = todate.getMonth() + 1
  3742. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3743. if(this.date == adate){
  3744. return []
  3745. }else{
  3746. let sedate = new Date(this.date)
  3747. let semonth = sedate.getMonth() + 1
  3748. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3749. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3750. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3751. return [sedates1, sedates2]
  3752. }
  3753. },
  3754. showMonthWorkTime(t) {
  3755. this.monthTotalPage = 0,
  3756. this.tbload = true
  3757. let parameter={}
  3758. if(t == "first"){
  3759. parameter={
  3760. startDate: this.WorktimeDatepickValue[0],
  3761. endDate: this.WorktimeDatepickValue[1],
  3762. }
  3763. }else{
  3764. parameter={
  3765. startDate: this.WorktimeDatepickValueForMonth[0],
  3766. endDate: this.WorktimeDatepickValueForMonth[1],
  3767. }
  3768. }
  3769. this.http.post(
  3770. "/report/getUserDailyWorkTime",
  3771. // "/report/getNoReportUserList",
  3772. parameter,
  3773. (res) => {
  3774. if (res.code == "ok") {
  3775. this.tbload = false;
  3776. this.pickDateArray = res.data.days;
  3777. // console.log('dataarray',res.data.days);
  3778. this.monthWorkData = res.data.list;
  3779. // this.monthWorkDataS = this.monthWorkData
  3780. // this.monthWorkDataS1 = res.data.list
  3781. this.monthTotal = res.data.list.length
  3782. if (this.monthWorkData.length > 50) {
  3783. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3784. }else{
  3785. this.monthWorkDataS = this.monthWorkData
  3786. }
  3787. this.searchScreen(0)
  3788. // this.monthWorkDataS = infoList
  3789. // 判断
  3790. // if (this.monthWorkDataS1.length > 0) {
  3791. // setTimeout(() => {
  3792. // this.tableListener()
  3793. // }, 1000);
  3794. // }
  3795. this.$nextTick(function(){
  3796. this.$refs.hasworkTbl.doLayout();
  3797. });
  3798. // this.$forceUpdate()
  3799. }
  3800. },
  3801. (error) => {
  3802. this.tbload = false
  3803. this.$message({
  3804. message: error,
  3805. type: "error",
  3806. });
  3807. }
  3808. );
  3809. },
  3810. showMonthWorkTimeReminder() {
  3811. this.monthTotalPage = 0,
  3812. this.tbload = true
  3813. let parameter={}
  3814. parameter={
  3815. startDate: this.WorktimeDatepickValueForMonth[0],
  3816. endDate: this.WorktimeDatepickValueForMonth[1],
  3817. }
  3818. this.http.post(
  3819. "/report/getUserDailyWorkTimeReminder",
  3820. parameter,
  3821. (res) => {
  3822. if (res.code == "ok") {
  3823. this.tbload = false;
  3824. this.monthWorkData = res.data.list;
  3825. this.monthTotal = res.data.list.length
  3826. if (this.monthWorkData.length > 50) {
  3827. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3828. }else{
  3829. this.monthWorkDataS = this.monthWorkData
  3830. }
  3831. this.searchScreen(0)
  3832. this.$nextTick(function(){
  3833. this.$refs.hasworkTbl.doLayout();
  3834. });
  3835. }
  3836. },
  3837. (error) => {
  3838. this.tbload = false
  3839. this.$message({
  3840. message: error,
  3841. type: "error",
  3842. });
  3843. }
  3844. );
  3845. },
  3846. // tableListener(){
  3847. // let that = this;
  3848. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3849. // // 添加scroll监听事件
  3850. // dom.addEventListener("scroll", function () {
  3851. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3852. // if (scrollDistance < 2) {
  3853. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3854. // that.monthTotalPage++; //当前页数自增
  3855. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3856. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3857. // var infoList = arrList.splice(
  3858. // that.monthTotalPage * that.monthTotalLages,
  3859. // that.monthTotalLages
  3860. // );
  3861. // // 数据添加
  3862. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3863. // }
  3864. // }
  3865. // })
  3866. // },
  3867. showMonthNotWorkTime() {
  3868. this.monthTotalPage = 0,
  3869. this.tbload = true,
  3870. this.http.post(
  3871. "/report/getNoReportUserList",
  3872. {
  3873. startDate: this.WorktimeDatepickValue[0],
  3874. endDate: this.WorktimeDatepickValue[1],
  3875. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3876. },
  3877. (res) => {
  3878. if (res.code == "ok") {
  3879. this.tbload = false
  3880. this.monthNotWorkDate = res.data;
  3881. // this.monthNotWorkDateS1 = res.data
  3882. this.monthnotTotal = res.data.length
  3883. // 2222111
  3884. if (this.monthNotWorkDate.length > 50) {
  3885. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3886. } else {
  3887. this.monthNotWorkDateS = this.monthNotWorkDate
  3888. }
  3889. this.searchScreen(1)
  3890. // 判断
  3891. // if (this.monthnotworkDateS1.length > 0) {
  3892. // setTimeout(() => {
  3893. // this.tableListenernot()
  3894. // }, 1000);
  3895. // }
  3896. this.$nextTick(function(){
  3897. this.$refs.hasworkTbl2.doLayout();
  3898. });
  3899. }
  3900. },
  3901. (error) => {
  3902. this.tbload = false
  3903. this.$message({
  3904. message: error,
  3905. type: "error",
  3906. });
  3907. }
  3908. );
  3909. },
  3910. // tableListenernot(){
  3911. // let that = this;
  3912. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3913. // dom.addEventListener("scroll", function () {
  3914. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3915. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3916. // if (scrollDistance2 < 2) {
  3917. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3918. // that.monthnotTotalPage++; //当前页数自增
  3919. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3920. // var infoList = arrList.splice(
  3921. // that.monthnotTotalPage * that.monthnotTotalLages,
  3922. // that.monthnotTotalLages
  3923. // );
  3924. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3925. // }
  3926. // }
  3927. // })
  3928. // },
  3929. listScroll(){
  3930. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3931. this.isMore = true
  3932. setTimeout(()=>{
  3933. this.isMore = false
  3934. },1000)
  3935. }else {
  3936. this.isFlag = true
  3937. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3938. this.monthWorkDataS = datalist
  3939. setTimeout(()=>{
  3940. this.isFlag = false
  3941. },300)
  3942. }
  3943. },
  3944. notListScroll(){
  3945. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3946. this.isMore = true
  3947. setTimeout(()=>{
  3948. this.isMore = false
  3949. },1000)
  3950. }else {
  3951. this.isFlag = true
  3952. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3953. this.monthNotWorkDateS = datalist
  3954. // console.log('length',this.monthNotWorkDateS.length)
  3955. setTimeout(()=>{
  3956. this.isFlag = false
  3957. },300)
  3958. }
  3959. },
  3960. getFirstAndLastDay() {
  3961. // 将选定的月份转换为Date对象
  3962. var monthDate = new Date();
  3963. var year = monthDate.getFullYear();
  3964. var month = monthDate.getMonth();
  3965. // 计算起始日和结束日
  3966. var startDay = new Date(year, month, 1);
  3967. var endDay = new Date(year, month + 1, 0);
  3968. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  3969. this.WorktimeDatepickValueForMonth=lastmd
  3970. },
  3971. formatDate(date) {
  3972. var year = date.getFullYear();
  3973. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  3974. var day = ("0" + date.getDate()).slice(-2);
  3975. return year + "-" + month + "-" + day;
  3976. },
  3977. // 获取默认这zhou日期参数 222
  3978. getLastWeek(e){
  3979. let newdate = new Date()
  3980. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3981. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3982. if(e){
  3983. this.WorktimeDatepickValue = lastwd
  3984. this.showMonthWorkTime('first')
  3985. }else{
  3986. this.WorktimeDatepickValue = lastwd
  3987. this.showMonthNotWorkTime()
  3988. }
  3989. },
  3990. getThisWeek(e){
  3991. let newdate = new Date();
  3992. let nowdate = newdate.toLocaleDateString();
  3993. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3994. if(e){
  3995. this.WorktimeDatepickValue = nowwd
  3996. this.showMonthWorkTime('first')
  3997. }else{
  3998. this.WorktimeDatepickValue = nowwd
  3999. this.showMonthNotWorkTime()
  4000. }
  4001. },
  4002. getDoubleLastWeek(e){
  4003. let newdate = new Date()
  4004. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4005. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4006. if(e){
  4007. this.WorktimeDatepickValue = nextwd
  4008. this.showMonthWorkTime('first')
  4009. }else{
  4010. this.WorktimeDatepickValue = nextwd
  4011. this.showMonthNotWorkTime()
  4012. }
  4013. },
  4014. alreadyAllDate(stime,etime){
  4015. let diffdate = new Array();
  4016. let i=0;
  4017. while(stime<=etime){
  4018. let dateArray = stime.split("-");
  4019. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4020. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4021. let stimewk = this.weekDay[date.getDay()]
  4022. 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')
  4023. 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])
  4024. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4025. let stime_ts = new Date(stime).getTime();
  4026. let next_date = stime_ts + (24*60*60*1000);
  4027. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4028. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4029. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4030. stime = next_dates_y+next_dates_m+next_dates_d;
  4031. i++;
  4032. }
  4033. return diffdate
  4034. },
  4035. getAutoWeekDate(e) {
  4036. let dateString = e;
  4037. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4038. if (dateString.match(dateStringReg)) {
  4039. let presentDate = new Date(dateString),
  4040. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4041. return Array.from(new Array(7), function (val, index) {
  4042. let formatDate = new Date(
  4043. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4044. );
  4045. return (
  4046. formatDate.getFullYear() +
  4047. "-" +
  4048. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4049. "-" +
  4050. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4051. );
  4052. });
  4053. } else {
  4054. throw new Error(
  4055. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4056. );
  4057. }
  4058. },
  4059. onProgressChange() {
  4060. this.$forceUpdate();
  4061. },
  4062. showChooseMembTree() {
  4063. this.chosenMembCount = this.participator.length;
  4064. this.chooseParticipVisible = true;
  4065. },
  4066. onTreeItemChange() {
  4067. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4068. var list = chosenList.filter(item=>item.isUser == 1);
  4069. this.chosenMembCount = list.length;
  4070. },
  4071. findUserInTree() {
  4072. if (this.filterName == '') {
  4073. this.deptMembData = this.allMembData;
  4074. } else {
  4075. var list = this.findRecursively(this.filterName, this.allMembData);
  4076. this.deptMembData = list;
  4077. }
  4078. },
  4079. findRecursively(username, list) {
  4080. var filterList = [];
  4081. for (var i=0;i<list.length; i++) {
  4082. if (list[i].isUser == 1) {
  4083. if (list[i].label.indexOf(username) >= 0) {
  4084. //匹配上了
  4085. filterList.push(list[i]);
  4086. }
  4087. } else if (list[i].children != null && list[i].children.length > 0) {
  4088. var subList = this.findRecursively(username, list[i].children);
  4089. if (subList.length > 0) {
  4090. subList.forEach(s=>filterList.push(s));
  4091. }
  4092. }
  4093. }
  4094. return filterList;
  4095. },
  4096. //确定选择参与人
  4097. chooseParticip() {
  4098. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4099. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4100. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4101. if (this.user.company.packageProject == 1) {
  4102. if (this.chosenMembList.length > 1) {
  4103. this.$message({
  4104. message: '每次仅支持代填一个人',
  4105. type: "error",
  4106. });
  4107. return;
  4108. }
  4109. }
  4110. this.chooseParticipVisible = false;
  4111. this.workForm.userNames = '';
  4112. this.workForm.userId = [];
  4113. this.participator = [];
  4114. for (var i=0;i<this.chosenMembList.length; i++) {
  4115. this.workForm.userId.push(this.chosenMembList[i].id);
  4116. this.workForm.userNames += this.chosenMembList[i].label+',';
  4117. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4118. this.participator.push(item);
  4119. }
  4120. if (this.workForm.userNames.length > 0) {
  4121. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4122. }
  4123. if(this.user.userNameNeedTranslate == 1) {
  4124. if(this.workForm.userNames) {
  4125. this.workForm.userNames = this.workForm.userNames.split(',')
  4126. }
  4127. }
  4128. },
  4129. notifySel(sel){
  4130. // console.log(sel);
  4131. this.notifySelList = sel
  4132. },
  4133. //微信通知人员填写
  4134. Notify(code) {
  4135. if (this.notifySelList.length == 0) return;
  4136. var ids = '';
  4137. this.notifySelList.forEach(f=>{
  4138. ids += f.id+',';
  4139. })
  4140. this.http.post('/user/pushFillReport',{
  4141. ids: ids, date: this.curDate,
  4142. code: code
  4143. },
  4144. res => {
  4145. if (res.code == "ok") {
  4146. this.$message({
  4147. message: this.$t('message.sentSuccessfully'),
  4148. type: "success"
  4149. });
  4150. }
  4151. },
  4152. error => {
  4153. this.$message({
  4154. message: error,
  4155. type: "error"
  4156. });
  4157. }
  4158. );
  4159. },
  4160. //导出人员列表
  4161. exportMemb() {
  4162. if (this.fillMembList.length == 0) return;
  4163. var ids = '';
  4164. this.fillMembList.forEach(f=>{
  4165. ids += f.id+',';
  4166. })
  4167. this.http.post('/user/exportMembList',{
  4168. ids: ids,isFill: this.isFill, date: this.curDate
  4169. },
  4170. res => {
  4171. if (res.code == "ok") {
  4172. var aTag = document.createElement('a');
  4173. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4174. aTag.href = res.data;
  4175. aTag.click();
  4176. }
  4177. },
  4178. error => {
  4179. this.$message({
  4180. message: error,
  4181. type: "error"
  4182. });
  4183. }
  4184. );
  4185. },
  4186. showMembList(fill) {
  4187. this.membListVisible = true;
  4188. if (fill == 0) {
  4189. this.fillMembList = this.unFillList;
  4190. this.isFill = false;
  4191. let leaveList = []
  4192. let unleaveList = []
  4193. for(let i in this.fillMembList){
  4194. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4195. leaveList.push(this.fillMembList[i])
  4196. }else{
  4197. unleaveList.push(this.fillMembList[i])
  4198. }
  4199. }
  4200. this.fillMembList = unleaveList
  4201. this.fillMembList_leave = leaveList
  4202. } else if(fill == 1){
  4203. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4204. this.isFill = true;
  4205. }else{
  4206. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4207. this.isFill = true;
  4208. }
  4209. },
  4210. //获取自己填写的日报状态
  4211. getReportFillStatus() {
  4212. this.http.post('/report/getReportFillStatus',{
  4213. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4214. },
  4215. res => {
  4216. if (res.code == "ok") {
  4217. this.fillStatusList = res.data;
  4218. this.allDate.forEach(d=>{
  4219. var fillInfo = null;
  4220. d.state = null;
  4221. this.fillStatusList.forEach(s=>{
  4222. var d1 = s.createDate.split('-')[2];
  4223. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4224. if (d1.indexOf('0') == 0) {
  4225. d1 = d1.substring(1,d1.length);
  4226. }
  4227. if (d1 == d2) {
  4228. d.state = s.state;
  4229. d.exceedCardTime = s.exceedCardTime
  4230. }
  4231. })
  4232. })
  4233. this.$forceUpdate();
  4234. }
  4235. },
  4236. error => {
  4237. this.$message({
  4238. message: error,
  4239. type: "error"
  4240. });
  4241. }
  4242. );
  4243. },
  4244. scrollFunction () {
  4245. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4246. if (this.domObj.attachEvent) { // IE
  4247. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4248. } else if (this.domObj.addEventListener) {
  4249. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4250. }
  4251. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4252. },
  4253. mouseScroll(event) { // google 浏览器下
  4254. let detail = event.wheelDelta || event.detail
  4255. let moveForwardStep = -1
  4256. let moveBackStep = 1
  4257. let step = 0
  4258. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4259. event.preventDefault() // 阻止浏览器默认事件
  4260. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4261. },
  4262. // //左右滚动
  4263. // wheel(e){
  4264. // var a = document.getElementById("dateScroll");
  4265. // var scroll_width = 80; //滚动一下的距离
  4266. // var e = e || window.event, v;
  4267. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4268. // if(v>3||-v>3) v=-v;
  4269. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4270. // e.preventDefault(); //阻止浏览器的默认滚动
  4271. // },
  4272. showExportDialog() {
  4273. this.exportType = 0
  4274. this.exportDialog = true;
  4275. },
  4276. showExportTimeDialog() {
  4277. this.exportTimeDialog = true;
  4278. },
  4279. changeAllTime() {
  4280. //总时长发生改变,自动按比例计算
  4281. this.workForm.domains.forEach(d=>{
  4282. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4283. });
  4284. //计算jsTime
  4285. if (this.workForm.createDate) {
  4286. let sdate = new Date(this.workForm.createDate[0]);
  4287. let edate = new Date(this.workForm.createDate[1]);
  4288. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4289. console.log('days===', days)
  4290. if (days < 0) {
  4291. days = 0;
  4292. }
  4293. this.jsTime = this.reportTimeType.allday * days;
  4294. }
  4295. },
  4296. // 是否加班的单机事件
  4297. check() {
  4298. this.selected = !this.selected
  4299. this.isNew = this.selected
  4300. },
  4301. updateSubProject() {
  4302. this.$forceUpdate();
  4303. },
  4304. selectDegreeId(domain, index) {
  4305. this.http.post('/report/defaultDegree',{
  4306. projectId: domain.projectId
  4307. },
  4308. res => {
  4309. if (res.code == "ok") {
  4310. if(res.data) {
  4311. this.workForm.domains[index].degreeId = res.data.id + ''
  4312. this.$forceUpdate();
  4313. }
  4314. }
  4315. },
  4316. error => {
  4317. this.$message({
  4318. message: error,
  4319. type: "error"
  4320. });
  4321. }
  4322. );
  4323. },
  4324. //项目选中了, 加载子项目
  4325. selectProject(domain, index) {
  4326. if(!domain.projectId){
  4327. return;
  4328. }
  4329. // 默认选中上次填写的自定义维度
  4330. if(this.yonghuUser.customDegreeActive == 1) {
  4331. this.selectDegreeId(domain, index)
  4332. }
  4333. // console.log('projectId===',domain.projectId);
  4334. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4335. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4336. this.http.post('/sub-project/list',{
  4337. projectId: domain.projectId,
  4338. isReport: true
  4339. },
  4340. res => {
  4341. //清空之前选中的子项目
  4342. // this.workForm.domains[index].subProjectId = 0;
  4343. if (res.code == "ok") {
  4344. this.workForm.domains[index].subProjectList = res.data;
  4345. this.workForm.domains[index].subProjectId = null;
  4346. this.$forceUpdate();
  4347. }
  4348. },
  4349. error => {
  4350. this.$message({
  4351. message: error,
  4352. type: "error"
  4353. });
  4354. }
  4355. );
  4356. //项目相关的近期任务
  4357. if (this.user.company.packageProject == 1) {
  4358. this.getRecentTaskList(domain, index);
  4359. //获取项目相关专业
  4360. if (this.user.company.packageEngineering == 1) {
  4361. this.getProjectProfessions(domain, index);
  4362. }
  4363. //获取项目下的任务分组
  4364. this.getTaskGroups(domain, index);
  4365. }
  4366. // 获取项目相关的维度
  4367. // domain.degreeId = null
  4368. this.$set(domain,'degreeId',null)
  4369. this.$set(domain,'multiDegrIdArray',null)
  4370. this.dimension(domain, index);
  4371. //获取项目审核人
  4372. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4373. this.getProjectAuditorList(domain, index);
  4374. } else {
  4375. //按分组的负责人来审核
  4376. domain.projectAuditorId = null;
  4377. domain.projectAuditorName = null;
  4378. domain.auditUserList = null;
  4379. }
  4380. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4381. if (this.reportTimeType.type == 3) {
  4382. //新增项目时,自动计算
  4383. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4384. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4385. }
  4386. //加载昱众的工作职责
  4387. if (this.user.companyId == this.yuzhongCompId) {
  4388. this.updateResponse(domain);
  4389. }
  4390. },
  4391. getRecentTaskList(domain, index) {
  4392. //刷新任务时,清空服务
  4393. this.$set(domain, 'sapServiceId', null);
  4394. this.$set(domain, 'taskId', null);
  4395. var param = {
  4396. projectId: domain.projectId,
  4397. isSubstitude:this.isSubstitude?1:0,
  4398. };
  4399. if (domain.groupId) {
  4400. param.groupId = domain.groupId;
  4401. }
  4402. if (domain.stage) {
  4403. param.stage = domain.stage;
  4404. }
  4405. //专业版代填,获取代填员工的任务
  4406. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4407. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4408. this.$message({
  4409. message: '请选择代填的员工',
  4410. type: "error"
  4411. });
  4412. return;
  4413. } else {
  4414. param.userId = this.workForm.userId[0];
  4415. }
  4416. }
  4417. this.http.post('/task/getRecentTask',param,
  4418. res => {
  4419. if (res.code == "ok") {
  4420. this.workForm.domains[index].allTaskList = res.data;
  4421. this.workForm.domains[index].taskList = res.data;
  4422. this.$forceUpdate();
  4423. }
  4424. },
  4425. error => {
  4426. this.$message({
  4427. message: error,
  4428. type: "error"
  4429. });
  4430. }
  4431. );
  4432. },
  4433. //获取项目审核人
  4434. getProjectAuditorList(domainItem, index) {
  4435. if(domainItem.projectId == '') {
  4436. return
  4437. }
  4438. domainItem.projectAuditorId = null;
  4439. domainItem.projectAuditorName = null;
  4440. this.http.post('/project-auditor/getList',{
  4441. projectId: domainItem.projectId,
  4442. },
  4443. res => {
  4444. if (res.code == "ok") {
  4445. domainItem.auditUserList = res.data;
  4446. if (res.data.length==0) {
  4447. this.$message({
  4448. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4449. type: "error"
  4450. });
  4451. } else if (res.data.length==1) {
  4452. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4453. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4454. }
  4455. this.$forceUpdate();
  4456. }
  4457. },
  4458. error => {
  4459. this.$message({
  4460. message: error,
  4461. type: "error"
  4462. });
  4463. }
  4464. );
  4465. },
  4466. // 获取维度数据
  4467. dimension(domain, index) {
  4468. if(domain.projectId == '') {
  4469. return
  4470. }
  4471. this.http.post('/project/getDegreeList',{
  4472. projectId: domain.projectId,
  4473. },
  4474. res => {
  4475. if (res.code == "ok") {
  4476. // console.log("维度数据",res.data);
  4477. this.workForm.domains[index].wuduList = res.data
  4478. // this.workForm = this.workForm
  4479. this.$forceUpdate()
  4480. }
  4481. },
  4482. error => {
  4483. this.$message({
  4484. message: error,
  4485. type: "error"
  4486. });
  4487. }
  4488. );
  4489. },
  4490. //切换任务阶段
  4491. changeStages(domain, index) {
  4492. if (domain.stage == null || domain.stage == '') {
  4493. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4494. } else {
  4495. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4496. }
  4497. this.getRecentTaskList(domain, index);
  4498. this.$forceUpdate();
  4499. },
  4500. getGroupStages(domain, index, keepStage) {
  4501. // console.log(domain);
  4502. if(!domain.groupId){
  4503. domain.projectAuditorId = ''
  4504. domain.stages = []
  4505. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4506. domain.taskId = ''
  4507. domain.sapServiceId = ''
  4508. }
  4509. if(this.user.timeType.reportAuditType >= 1){
  4510. domain.auditUserList = []
  4511. }
  4512. this.$forceUpdate();
  4513. return
  4514. }
  4515. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4516. res => {
  4517. if (res.code == "ok") {
  4518. if (!keepStage) {
  4519. domain.stage = '';
  4520. }
  4521. domain.stages = res.data;
  4522. this.getRecentTaskList(domain, index);
  4523. this.$forceUpdate();
  4524. }
  4525. },
  4526. error => {
  4527. this.$message({
  4528. message: error,
  4529. type: "error"
  4530. });
  4531. });
  4532. //检查当前的项目是否需要获取分组的负责人
  4533. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4534. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4535. res => {
  4536. if (res.code == "ok") {
  4537. domain.getProjectAuditorList = res.data;
  4538. domain.auditUserList = res.data;
  4539. if (res.data.length==1) {
  4540. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4541. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4542. } else if (res.data.length==0) {
  4543. domain.projectAuditorId = null;
  4544. domain.projectAuditorName = null;
  4545. }
  4546. this.$forceUpdate();
  4547. }
  4548. },
  4549. error => {
  4550. this.$message({
  4551. message: error,
  4552. type: "error"
  4553. });
  4554. });
  4555. }
  4556. },
  4557. getProjectProfessions(domain, index) {
  4558. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4559. res => {
  4560. if (res.code == "ok") {
  4561. this.workForm.domains[index].professionProgress = res.data;
  4562. this.$forceUpdate();
  4563. }
  4564. },
  4565. error => {
  4566. this.$message({
  4567. message: error,
  4568. type: "error"
  4569. });
  4570. });
  4571. },
  4572. //删除自己的日报
  4573. deleteReport() {
  4574. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4575. confirmButtonText: this.$t('btn.determine'),
  4576. cancelButtonText: this.$t('btn.cancel'),
  4577. type: "warning"
  4578. })
  4579. .then(() => {
  4580. this.listLoading = true;
  4581. this.http.post('/report/delete',{
  4582. userId: this.user.id,
  4583. date: this.workForm.createDate
  4584. },
  4585. res => {
  4586. this.listLoading = false;
  4587. if (res.code == "ok") {
  4588. this.$message({
  4589. message: this.$t('message.successfullyDeleted'),
  4590. type: "success"
  4591. });
  4592. this.getReportList();
  4593. this.getDepartment();
  4594. this.dialogVisible = false;
  4595. } else {
  4596. this.$message({
  4597. message: res.msg,
  4598. type: "error"
  4599. });
  4600. }
  4601. },
  4602. error => {
  4603. this.listLoading = false;
  4604. this.$message({
  4605. message: error,
  4606. type: "error"
  4607. });
  4608. }
  4609. );
  4610. })
  4611. .catch(() => {});
  4612. },
  4613. // 管理员删除日报
  4614. guanli(item) {
  4615. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4616. let param = {date: this.date + day, userId: item.id};
  4617. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4618. confirmButtonText: this.$t('btn.determine'),
  4619. cancelButtonText: this.$t('btn.cancel'),
  4620. type: "warning"
  4621. })
  4622. .then(() => {
  4623. this.listLoading = true;
  4624. this.http.post('/report/delete',param,
  4625. res => {
  4626. this.listLoading = false;
  4627. if (res.code == "ok") {
  4628. this.$message({
  4629. message: this.$t('message.successfullyDeleted'),
  4630. type: "success"
  4631. });
  4632. this.getReportList();
  4633. this.getDepartment();
  4634. this.dialogVisible = false;
  4635. } else {
  4636. this.$message({
  4637. message: res.msg,
  4638. type: "error"
  4639. });
  4640. }
  4641. },
  4642. error => {
  4643. this.listLoading = false;
  4644. this.$message({
  4645. message: error,
  4646. type: "error"
  4647. });
  4648. }
  4649. );
  4650. })
  4651. .catch(() => {});
  4652. },
  4653. selectAll() {
  4654. if (this.isAllSelect) {
  4655. var keys = [];
  4656. this.reportNames.forEach(b=>{
  4657. keys.push(b.id);
  4658. })
  4659. this.$refs.approveTree.setCheckedKeys(keys);
  4660. } else {
  4661. this.$refs.approveTree.setCheckedKeys([]);
  4662. }
  4663. },
  4664. removeEmptyNode(list) {
  4665. for (var i=0;i<list.length;i++) {
  4666. var cnt = 0;
  4667. if (list[i].membCount == 0) {
  4668. list.splice(i, 1);
  4669. i--;
  4670. } else if (list[i].children != null) {
  4671. this.removeEmptyNode(list[i].children);
  4672. }
  4673. }
  4674. },
  4675. calculateMembCount(list) {
  4676. for (var i in list) {
  4677. var cnt = 0;
  4678. if (list[i].children != null) {
  4679. this.calculateMembCount(list[i].children);
  4680. for (var m in list[i].children) {
  4681. cnt += list[i].children[m].membCount;
  4682. }
  4683. }
  4684. if (list[i].isUser == 1) {
  4685. cnt++;
  4686. this.membCount++;
  4687. }
  4688. list[i].membCount = cnt;
  4689. }
  4690. },
  4691. stateChange() {
  4692. // console.log(this.allData,'alldate');
  4693. this.membCount = 0;
  4694. if (this.selectState == -1) {
  4695. //全部状态
  4696. this.data = this.allData;
  4697. } else {
  4698. //未填报
  4699. this.seluserText = ''
  4700. var newData = JSON.parse(JSON.stringify(this.allData));
  4701. this.filterState(this.selectState, newData);
  4702. this.data = newData;
  4703. }
  4704. this.calculateMembCount(this.data);
  4705. this.data[0].membCount = this.membCount;//总人数
  4706. },
  4707. //按状态过滤部门人员
  4708. filterState(state, list) {
  4709. for (var i =0;i<list.length; i++) {
  4710. var obj = list[i];
  4711. if (obj.isUser == 1) {
  4712. var match = false;
  4713. if (state == -2) {
  4714. if (obj.state == null) {
  4715. match = true;
  4716. }
  4717. } else {
  4718. if (obj.state == state) {
  4719. match = true;
  4720. }
  4721. }
  4722. if (!match) {
  4723. list.splice(i, 1);
  4724. i--;
  4725. } else {
  4726. }
  4727. } else {
  4728. if (obj.children != null) {
  4729. this.filterState(state, obj.children);
  4730. }
  4731. }
  4732. }
  4733. },
  4734. //a按名称过滤部门人员
  4735. async seluserforText(){
  4736. const { userNameNeedTranslate } = this.user
  4737. this.membCount = 0;
  4738. var newData = JSON.parse(JSON.stringify(this.allData));
  4739. let textList = [this.seluserText]
  4740. if(userNameNeedTranslate == 1) {
  4741. this.dataLoading = true
  4742. let res = await this.postData('/user/getEmployeeList', {
  4743. keyword: this.seluserText,
  4744. cursor: '',
  4745. departmentId: -1,
  4746. pageIndex: 1,
  4747. pageSize: 1000
  4748. })
  4749. textList = res.data.records.map(item => item.name)
  4750. this.dataLoading = false
  4751. }
  4752. // return
  4753. console.log(textList, '<=== textList')
  4754. this.seluserforTextin(this.seluserText, newData, textList)
  4755. console.log(newData, 'Data')
  4756. this.data = newData;
  4757. this.calculateMembCount(this.data);
  4758. this.data[0].membCount = this.membCount;//总人数
  4759. },
  4760. seluserforTextin(text, list, textList = []){
  4761. for (var i =0;i<list.length; i++) {
  4762. var obj = list[i];
  4763. if (obj.isUser == 1) {
  4764. var match = false;
  4765. // if (obj.label.indexOf(text) != -1) {
  4766. // match = true
  4767. // }
  4768. if(textList.some(item => item.includes(obj.label))) {
  4769. match = true
  4770. }
  4771. if (!match) {
  4772. list.splice(i, 1);
  4773. i--;
  4774. } else {
  4775. }
  4776. } else {
  4777. if (obj.children != null) {
  4778. this.seluserforTextin(text, obj.children, textList);
  4779. }
  4780. }
  4781. }
  4782. },
  4783. // 当节点发生变化时
  4784. nodeChangeExpand(data) {
  4785. // 保存当前展开的节点
  4786. let flag = false
  4787. this.nodeModelData.some(item => {
  4788. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4789. flag = true
  4790. return true
  4791. }
  4792. })
  4793. if (!flag) { // 不存在则存到数组里
  4794. this.nodeModelData.push(data.id)
  4795. }
  4796. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4797. },
  4798. nodeChangeCollapse(data) {
  4799. console.log(this.nodeModelData)
  4800. this.nodeModelData.some((item, i) => {
  4801. if (item === data.id) {
  4802. this.nodeModelData.length = i
  4803. }
  4804. })
  4805. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4806. },
  4807. // 部门列表点击
  4808. handleNodeClick(data) {
  4809. // this.dealList = data
  4810. this.theValues(data.id, this.allData)
  4811. // this.depData = data;
  4812. var list = [];
  4813. if (data.id == -1) {
  4814. this.deptId = null;
  4815. this.targetUid = null;
  4816. list = this.data;
  4817. } else if (data.isUser == 1) {
  4818. this.deptId = null;
  4819. this.targetUid = data.id;
  4820. } else {
  4821. this.deptId = data.id;
  4822. this.targetUid = null;
  4823. list.push(data);
  4824. }
  4825. this.getReportList();
  4826. if (list.length > 0) {
  4827. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4828. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4829. }
  4830. },
  4831. exportPushLog(){
  4832. this.http.post('/sap-sync-log/export',{},
  4833. res => {
  4834. if (res.code == "ok") {
  4835. var filePath = res.data;
  4836. var fName = '推送日志.xlsx'
  4837. const a = document.createElement('a'); // 创建a标签
  4838. a.setAttribute('download', fName);// download属性
  4839. a.setAttribute('href', filePath);// href链接
  4840. a.click(); //自执行点击事件
  4841. a.remove();
  4842. } else {
  4843. this.$message({
  4844. message: res.msg,
  4845. type: "error"
  4846. });
  4847. }
  4848. },
  4849. error => {
  4850. this.$message({
  4851. message: error,
  4852. type: "error"
  4853. });
  4854. });
  4855. },
  4856. theValues(id, item) {
  4857. for(var i in item) {
  4858. if(item[i].id == id) {
  4859. this.depData = item[i]
  4860. if(id == '-1') {
  4861. this.translation = '1'
  4862. } else {
  4863. if(item[i].children) {
  4864. this.translation = '2'
  4865. } else {
  4866. this.translation = '3'
  4867. }
  4868. }
  4869. return
  4870. } else {
  4871. if(item[i].children) {
  4872. this.theValues(id, item[i].children)
  4873. }
  4874. }
  4875. }
  4876. },
  4877. //获取可以选择的代填的人员列表
  4878. getSubstitudeUserDeptList() {
  4879. if (this.deptMembData.length == 0) {
  4880. this.http.post("/department/listMyMembs", {},
  4881. res => {
  4882. if (res.code == "ok") {
  4883. let noAllData = JSON.parse(JSON.stringify(res.data));
  4884. if (noAllData.length > 0) {
  4885. // if (noAllData[0].label == '全部人员') {
  4886. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4887. noAllData.splice(0,1);
  4888. }
  4889. }
  4890. this.setUserToDept(noAllData);
  4891. this.deptMembData = noAllData;
  4892. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4893. console.log(this.deptMembData, '代填人员数据')
  4894. } else {
  4895. this.$message({
  4896. message: res.msg,
  4897. type: "error"
  4898. });
  4899. }
  4900. },
  4901. error => {
  4902. this.$message({
  4903. message: error,
  4904. type: "error"
  4905. });
  4906. });
  4907. }
  4908. },
  4909. // 获取部门列表
  4910. getDepartmentForApprove() {
  4911. this.http.post( this.port.manage.depList, {},
  4912. res => {
  4913. if (res.code == "ok") {
  4914. var list1 = JSON.parse(JSON.stringify(res.data));
  4915. this.deptOptionList = this.changeArr(list1);
  4916. console.log(this.deptOptionList, '部门')
  4917. } else {
  4918. this.$message({
  4919. message: res.msg,
  4920. type: "error"
  4921. });
  4922. }
  4923. },
  4924. error => {
  4925. this.$message({
  4926. message: error,
  4927. type: "error"
  4928. });
  4929. });
  4930. },
  4931. // 获取部门列表
  4932. getDepartment() {
  4933. //如果没有权限,就不需要获取
  4934. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4935. return;
  4936. }
  4937. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4938. var param = {date:this.date + day};
  4939. this.http.post("/report/getMembList", param,
  4940. res => {
  4941. if (res.code == "ok") {
  4942. if(res.data.length == 0){
  4943. return
  4944. }
  4945. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4946. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4947. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4948. // if (this.user.role > 0) {
  4949. // }
  4950. list.splice(0,0,{
  4951. id: -1,
  4952. label: this.$t('lable.allStaff'),
  4953. })
  4954. this.membCount = 0;
  4955. //设置员工到部门下面
  4956. this.setUserToDept(list);
  4957. this.data = list;
  4958. // console.log('data',this.data);
  4959. this.expandDate = [this.data[1].id]
  4960. this.allData = list;
  4961. // if (noAllData.length > 0) {
  4962. // if (noAllData[0].label == '全部人员') {
  4963. // noAllData.splice(0,1);
  4964. // }
  4965. // }
  4966. // this.setUserToDept(noAllData);
  4967. // this.deptMembData = noAllData;
  4968. this.option = this.changeArr(list1);
  4969. list[0].membCount = this.membCount;
  4970. if (this.depData.id == -1) {
  4971. this.depData.membCount = this.membCount;
  4972. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4973. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4974. } else {
  4975. if (this.depData.isUser == null) {
  4976. var dep = this.findTargetDept(this.data, this.depData.id);
  4977. var membDeptList = [];
  4978. membDeptList.push(dep);
  4979. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4980. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4981. }
  4982. }
  4983. if (this.depData.isUser == null) {
  4984. if (this.isFill) {
  4985. this.fillMembList = this.fillList;
  4986. } else {
  4987. this.fillMembList = this.unFillList;
  4988. }
  4989. }
  4990. this.leaveAllNum = 0
  4991. for(let i in this.unFillList){
  4992. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4993. this.leaveAllNum += 1
  4994. }
  4995. }
  4996. this.stateChange()
  4997. } else {
  4998. this.$message({
  4999. message: res.msg,
  5000. type: "error"
  5001. });
  5002. }
  5003. },
  5004. error => {
  5005. this.$message({
  5006. message: error,
  5007. type: "error"
  5008. });
  5009. });
  5010. this.getReportFillStatus();
  5011. },
  5012. findTargetDept(list, deptId) {
  5013. var t = null;
  5014. for (var i=0;i<list.length; i++) {
  5015. if (list[i].isUser == null && list[i].id == deptId) {
  5016. t = list[i];
  5017. break;
  5018. }
  5019. }
  5020. if (t == null) {
  5021. for (var i=0;i<list.length; i++) {
  5022. if (list[i].children != null && list[i].children.length > 0) {
  5023. t = this.findTargetDept(list[i].children, deptId);
  5024. if (t != null) {
  5025. break;
  5026. }
  5027. }
  5028. }
  5029. }
  5030. return t;
  5031. },
  5032. getUserMembListFromDeptList(list, isFill) {
  5033. var membList = [];
  5034. for (var i in list) {
  5035. var deptName = list[i].label;
  5036. if (list[i].userList != null) {
  5037. list[i].userList.forEach(element => {
  5038. if (isFill == 0) {
  5039. //获取未填的
  5040. if (element.state == null) {
  5041. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5042. membList.push(obj);
  5043. }
  5044. } else {
  5045. if (element.state != null) {
  5046. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5047. membList.push(obj);
  5048. }
  5049. }
  5050. });
  5051. }
  5052. if (list[i].children != null) {
  5053. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5054. }
  5055. }
  5056. return membList;
  5057. },
  5058. setUserToDept(list) {
  5059. for (var i in list) {
  5060. var cnt = 0;
  5061. if (list[i].children != null) {
  5062. this.setUserToDept(list[i].children);
  5063. for (var m in list[i].children) {
  5064. cnt += list[i].children[m].membCount;
  5065. }
  5066. }
  5067. if (list[i].userList != null) {
  5068. if (list[i].children == null) {
  5069. list[i].children = [];
  5070. }
  5071. list[i].userList.forEach(element => {
  5072. var obj = {
  5073. id: element.id,
  5074. label:element.name,
  5075. state:element.state,
  5076. parentId:element.departmentId,
  5077. isUser:1,
  5078. workingTime: element.workingTime,
  5079. leaveDays: element.leaveDays,
  5080. leaveTimes: element.leaveTimes
  5081. };
  5082. list[i].children.push(obj);
  5083. this.membCount++;
  5084. cnt++;
  5085. });
  5086. }
  5087. list[i].membCount = cnt;
  5088. }
  5089. },
  5090. // 修改数组
  5091. changeArr(arr) {
  5092. for (var i = 0; i < arr.length; i++) {
  5093. if(arr[i].id != -1 && arr[i].id != 0) {
  5094. if (arr[i].children != null && arr[i].children.length>0) {
  5095. arr[i].children = this.changeArr(arr[i].children);
  5096. }
  5097. arr[i].id && (arr[i].value = arr[i].id);
  5098. delete arr[i].id;
  5099. }
  5100. }
  5101. for(var i in arr) {
  5102. if(arr[i].id == -1 || arr[i].id == 0) {
  5103. arr.splice(i,1)
  5104. }
  5105. }
  5106. return arr;
  5107. },
  5108. //时间段范围设置改动,监听
  5109. onTimeTypeChange(timeType) {
  5110. this.seleChn(1)
  5111. this.showAddMore = true;
  5112. for(var i in this.workForm.domains) {
  5113. if (this.workForm.domains[i].timeType == 0) {
  5114. this.showAddMore = false;
  5115. break;
  5116. }
  5117. }
  5118. if (this.showAddMore) {
  5119. //检测数量
  5120. if (this.workForm.domains.length == 2) {
  5121. this.showAddMore = false;
  5122. } else {
  5123. this.showAddMore = true;
  5124. }
  5125. }
  5126. },
  5127. getTimeType() {
  5128. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5129. res => {
  5130. if (res.code == "ok") {
  5131. var t = res.data;
  5132. this.reportTimeType = t;
  5133. if (this.reportTimeType.type > 0) {
  5134. this.showAddMore = true;
  5135. }
  5136. //转化时间格式
  5137. if (t.allday != null) {
  5138. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5139. }
  5140. if (t.am != null) {
  5141. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5142. }
  5143. if (t.pm != null) {
  5144. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5145. }
  5146. let arr = []
  5147. for(var i in res.data.excludeTimeList) {
  5148. let obj = {
  5149. s: res.data.excludeTimeList[i].startTime,
  5150. e: res.data.excludeTimeList[i].endTime,
  5151. }
  5152. arr.push(obj)
  5153. }
  5154. this.vacationTime = arr
  5155. } else {
  5156. this.$message({
  5157. message: res.msg,
  5158. type: "error"
  5159. });
  5160. }
  5161. },
  5162. error => {
  5163. this.listLoading = false;
  5164. this.$message({
  5165. message: error,
  5166. type: "error"
  5167. });
  5168. });
  5169. },
  5170. // 改变月份 -------
  5171. changeMonthOut() {
  5172. this.getAllDate();
  5173. this.getReportList();
  5174. this.getDepartment();
  5175. },
  5176. // 选择日期
  5177. choseDate(i, item) {
  5178. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5179. return
  5180. }
  5181. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5182. this.choseDay = i;
  5183. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5184. sessionStorage.msg = this.date + day,
  5185. this.getReportList();
  5186. this.getDepartment();
  5187. this.curDate = item.date;
  5188. },
  5189. canClick(i, item){
  5190. let nowDate = new Date()
  5191. let nowDateYear = nowDate.getFullYear()
  5192. let itemYear = parseInt(this.date.split('-')[0])
  5193. let nowDateMonth = nowDate.getMonth() + 1
  5194. let itemMonth = parseInt(this.date.split('-')[1])
  5195. let nowDateDay = nowDate.getDate()
  5196. let itemDay = parseInt(item.showDate.split('.')[1])
  5197. if(nowDateYear < itemYear){
  5198. return false
  5199. }else if(nowDateYear == itemYear){
  5200. if(nowDateMonth < itemMonth){
  5201. return false
  5202. }else if(nowDateMonth == itemMonth){
  5203. if(nowDateDay < itemDay){
  5204. return false
  5205. }
  5206. }
  5207. }
  5208. },
  5209. // 获取日期列表
  5210. getAllDate(e) {
  5211. var dayArry = [];
  5212. var day = this.getCountDays();
  5213. let curMonthDay = null;
  5214. for (var k = 1; k <= day; k++) {
  5215. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5216. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5217. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5218. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5219. if(sessionStorage.msg) {
  5220. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5221. this.choseDay = k - 1;
  5222. curMonthDay = str;
  5223. }
  5224. } else {
  5225. if (new Date().getDate() == k) {
  5226. this.choseDay = k - 1;
  5227. }
  5228. }
  5229. } else {
  5230. this.choseDay = 0;
  5231. }
  5232. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5233. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5234. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5235. }
  5236. this.allDate = dayArry;
  5237. //不能超过最大日期
  5238. if (this.choseDay > day-1) {
  5239. this.choseDay = day-1;
  5240. }
  5241. if(sessionStorage.from != 1){
  5242. let nowmonth = new Date().getMonth() + 1
  5243. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5244. let nowdate = new Date().getDate()
  5245. if(nowd == this.date){
  5246. if(e && sessionStorage.msg){
  5247. }else{
  5248. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5249. }
  5250. let nowday = new Date(sessionStorage.msg).getDate()
  5251. this.choseDay = nowday - 1
  5252. let monthdate = new Date(sessionStorage.msg)
  5253. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5254. }else{
  5255. if(e && sessionStorage.msg){
  5256. }else{
  5257. sessionStorage.msg = this.date + '-01'
  5258. }
  5259. let monthdate = new Date(sessionStorage.msg)
  5260. this.choseDay = monthdate.getDate() - 1
  5261. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5262. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5263. }
  5264. }else{
  5265. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5266. }
  5267. //从消息点击跳转过来的,直接加载指定日期
  5268. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5269. this.curDate = sessionStorage.msg;
  5270. sessionStorage.from = 0;
  5271. } else {
  5272. // if (curMonthDay != null) {
  5273. // // this.curDate = curMonthDay;
  5274. // let d = new Date(sessionStorage.msg)
  5275. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5276. // } else {
  5277. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5278. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5279. // }
  5280. }
  5281. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5282. // if(!sessionStorage.msg){
  5283. // let msgday = this.choseDay + 1
  5284. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5285. // }
  5286. this.getReportFillStatus();
  5287. },
  5288. getCountDays() {
  5289. var newstr = this.date.replace(/-/g, "/");
  5290. var curDate = new Date(newstr+'/01');
  5291. var curMonth = curDate.getMonth();
  5292. curDate.setMonth(curMonth + 1);
  5293. curDate.setDate(0);
  5294. return curDate.getDate();
  5295. },
  5296. reqMore() {
  5297. if (this.hasMore) {
  5298. this.pageIndex++;
  5299. this.requestHttpReports();
  5300. }
  5301. },
  5302. //加载日报数据
  5303. requestHttpReports() {
  5304. //请求数据
  5305. this.listLoading = true;
  5306. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5307. let param = {date: this.date + day};
  5308. if (this.deptId) {
  5309. param.deptId = this.deptId;
  5310. }
  5311. if (this.targetUid) {
  5312. param.userId = this.targetUid;
  5313. }
  5314. //传页码
  5315. if (this.hasMore) {
  5316. param.pageIndex = this.pageIndex;
  5317. }
  5318. this.http.post( this.port.report.list, param,
  5319. res => {
  5320. this.listLoading = false;
  5321. if (res.code == "ok") {
  5322. //扩增
  5323. this.reportList = this.reportList.concat(res.data.data);
  5324. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5325. if(document.querySelector("#day"+this.choseDay)){
  5326. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5327. }
  5328. } else {
  5329. this.$message({
  5330. message: res.msg,
  5331. type: "error"
  5332. });
  5333. }
  5334. },
  5335. error => {
  5336. this.listLoading = false;
  5337. this.$message({
  5338. message: error,
  5339. type: "error"
  5340. });
  5341. });
  5342. },
  5343. //获取日报列表
  5344. getReportList() {
  5345. //初始化,重置数据
  5346. this.pageIndex = 0;
  5347. this.hasMore = true;
  5348. this.reportList = [];
  5349. this.requestHttpReports();
  5350. },
  5351. //刷新日报状态,用于审核后更新
  5352. refreshReportData(reportId) {
  5353. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5354. res => {
  5355. if (res.code == "ok") {
  5356. for (var m=0;m<this.reportList.length; m++) {
  5357. var d = this.reportList[m].data;
  5358. var find = d.filter(r=>r.id == reportId);
  5359. if (find.length > 0) {
  5360. find[0].state = res.data.state;
  5361. if (find[0].state == 2) {//被驳回,要可以编辑
  5362. this.reportList[m].state = 2;
  5363. }
  5364. find[0].isDeptAudit = res.data.isDeptAudit;
  5365. find[0].departmentAuditState = res.data.departmentAuditState;
  5366. find[0].projectAuditorName = res.data.projectAuditorName;
  5367. find[0].projectAuditorId = res.data.projectAuditorId;
  5368. find[0].projectAuditState = res.data.projectAuditState;
  5369. find[0].rejectUserid = res.data.rejectUserid;
  5370. find[0].rejectUsername = res.data.rejectUsername;
  5371. find[0].rejectReason = res.data.rejectReason;
  5372. this.$forceUpdate();
  5373. break;
  5374. }
  5375. }
  5376. } else {
  5377. this.$message({
  5378. message: res.msg,
  5379. type: "error"
  5380. });
  5381. }
  5382. },
  5383. error => {
  5384. this.listLoading = false;
  5385. this.$message({
  5386. message: error,
  5387. type: "error"
  5388. });
  5389. });
  5390. },
  5391. //导出员工工时统计
  5392. exportUserTime() {
  5393. this.listLoading = true;
  5394. var param = {};
  5395. if (this.exportParam.dateRange != null) {
  5396. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5397. }
  5398. this.http.post('/department/exportDeptStatistic', param,
  5399. res => {
  5400. this.listLoading = false;
  5401. if (res.code == "ok") {
  5402. location.href = res.data;
  5403. this.exportTimeDialog = false;
  5404. } else {
  5405. this.$message({
  5406. message: res.msg,
  5407. type: "error"
  5408. });
  5409. }
  5410. },
  5411. error => {
  5412. this.listLoading = false;
  5413. this.$message({
  5414. message: error,
  5415. type: "error"
  5416. });
  5417. });
  5418. },
  5419. //导出日报
  5420. exportReport() {
  5421. this.exportingData = true;
  5422. var param = {};
  5423. if (this.exportParam.dateRange != null) {
  5424. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5425. }
  5426. if (this.exportParam.projectId != null) {
  5427. param.projectId = this.exportParam.projectId;
  5428. }
  5429. if (this.exportParam.departmentId != null) {
  5430. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5431. }
  5432. param.stateKey = this.stateKey
  5433. // param.departmentId = this.user.departmentId
  5434. console.log(param, '《=== 导出传的参数');
  5435. console.log('开始调用exportReport接口');
  5436. this.http.post(this.port.report.export, param,
  5437. res => {
  5438. this.exportingData = false;
  5439. if (res.code == "ok") {
  5440. location.href = res.data;
  5441. this.exportDialog = false;
  5442. } else {
  5443. this.$message({
  5444. message: res.msg,
  5445. type: "error"
  5446. });
  5447. }
  5448. },
  5449. error => {
  5450. this.exportingData = false;
  5451. this.$message({
  5452. message: error,
  5453. type: "error"
  5454. });
  5455. });
  5456. },
  5457. //获取项目列表
  5458. getProjectList() {
  5459. this.listLoading = true;
  5460. this.http.post( this.port.project.list, {},
  5461. res => {
  5462. this.listLoading = false;
  5463. if (res.code == "ok") {
  5464. for(var i in res.data) {
  5465. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5466. res.data[i].projectCode = ''
  5467. }
  5468. }
  5469. this.projectList = res.data;
  5470. console.log("项目列表",this.projectList);
  5471. } else {
  5472. this.$message({
  5473. message: res.msg,
  5474. type: "error"
  5475. });
  5476. }
  5477. },
  5478. error => {
  5479. this.listLoading = false;
  5480. this.$message({
  5481. message: error,
  5482. type: "error"
  5483. });
  5484. });
  5485. },
  5486. // 获取填报日报的项目下拉列表
  5487. getFillProjectList() {
  5488. this.http.post( this.port.project.list, {
  5489. forReport: 1
  5490. },res => {
  5491. if (res.code == "ok") {
  5492. for(var i in res.data) {
  5493. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5494. res.data[i].projectCode = ''
  5495. }
  5496. }
  5497. this.fillProjectList = res.data;
  5498. this.getRecentlyProject()
  5499. } else {
  5500. this.$message({
  5501. message: res.msg,
  5502. type: "error"
  5503. });
  5504. }
  5505. },
  5506. error => {
  5507. this.$message({
  5508. message: error,
  5509. type: "error"
  5510. });
  5511. });
  5512. },
  5513. getBasecostItemList() {
  5514. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5515. companyId: this.user.companyId
  5516. },
  5517. res => {
  5518. if (res.code == "ok") {
  5519. this.timeBasecostList = res.data;
  5520. }
  5521. });
  5522. },
  5523. getAIReport(createDate) {
  5524. this.http.post('/report/getAIReport', {},
  5525. res => {
  5526. if (res.code == "ok") {
  5527. var quanbu = 0
  5528. this.jsDay = 1
  5529. var zhi = ''
  5530. var slp = res.data
  5531. for(var i in slp) {
  5532. var sp = +slp[i].workingTime + 0
  5533. zhi = this.jsDay * sp
  5534. quanbu = +quanbu + zhi
  5535. }
  5536. this.jsTime = quanbu
  5537. var aiReportData = res.data;
  5538. this.canCancelInDialog = false
  5539. if(aiReportData.length != 0) {
  5540. var arr = [];
  5541. for(var i in aiReportData) {
  5542. arr.push({
  5543. id: null,
  5544. projectId: aiReportData[i].projectId,
  5545. workingTime: aiReportData[i].workingTime,
  5546. content: '',
  5547. progress:100,
  5548. state: 2,
  5549. timeType: aiReportData[i].timeType,
  5550. subProjectList: aiReportData[i].subProjectList,
  5551. taskList: aiReportData[i].taskList,
  5552. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5553. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5554. taskId: aiReportData[i].taskId,
  5555. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5556. startTime: aiReportData[i].startTime,
  5557. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5558. endTime: aiReportData[i].endTime,
  5559. isOvertime: 0,
  5560. progress:aiReportData[i].progress,
  5561. professionProgress: aiReportData[i].professionProgressList,
  5562. stages:aiReportData[i].stages,
  5563. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5564. pics: null,
  5565. multiWorktime: aiReportData[i].multiWorktime,
  5566. worktimeList: [{}],
  5567. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5568. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5569. wuduList: aiReportData[i].degreeList,
  5570. taskGroups:aiReportData[i].taskGroups,
  5571. customData: aiReportData[i].customData,//自定义的数值
  5572. auditUserList: aiReportData[i].auditUserList,
  5573. projectAuditorId: aiReportData[i].projectAuditorId,
  5574. projectAuditorName: aiReportData[i].projectAuditorName,
  5575. overtimeHours: aiReportData[i].overtimeHours,
  5576. customText: aiReportData[i].customText,
  5577. basecostId: aiReportData[i].basecostId,
  5578. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5579. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5580. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5581. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5582. canEdit: true
  5583. })
  5584. }
  5585. this.workForm.domains = arr;
  5586. } else {
  5587. }
  5588. this.canEdit = true;
  5589. this.originCanEdit = true;
  5590. this.seleChn()
  5591. } else {
  5592. this.$message({
  5593. message: res.msg,
  5594. type: "error"
  5595. });
  5596. }
  5597. },
  5598. error => {
  5599. this.$message({
  5600. message: error,
  5601. type: "error"
  5602. });
  5603. });
  5604. },
  5605. // 获取个人某天的日报 111111
  5606. getReport() {
  5607. this.http.post( this.port.report.getPort, {
  5608. date: this.workForm.createDate
  5609. },
  5610. res => {
  5611. if (res.code == "ok") {
  5612. var quanbu = 0
  5613. this.jsDay = 1
  5614. var zhi = ''
  5615. var slp = res.data.report
  5616. for(var i in slp) {
  5617. var sp = +slp[i].workingTime + 0
  5618. zhi = this.jsDay * sp
  5619. quanbu = +quanbu + zhi
  5620. }
  5621. this.jsTime = quanbu
  5622. var list = res.data;
  5623. this.report = list;
  5624. this.reportTimeType = this.report.timeType;
  5625. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5626. this.isWeekend = !this.report.isWorkDay;
  5627. this.canCancelInDialog = false;
  5628. this.hasWrittenReport = list.report.length != 0;
  5629. if(list.report.length != 0) {
  5630. var arr = [];
  5631. this.canEdit = false;
  5632. let candelete = true
  5633. for(var i in list.report) {
  5634. var flg = null
  5635. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5636. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5637. var filteredRespList = null
  5638. if (targetP.length > 0) {
  5639. var isPublic = targetP[0].isPublic;
  5640. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5641. }
  5642. arr.push({
  5643. id: list.report[i].id,
  5644. projectId: list.report[i].projectId,
  5645. workingTime: list.report[i].workingTime,
  5646. content: list.report[i].content,
  5647. state: list.report[i].state,
  5648. timeType: list.report[i].timeType,
  5649. subProjectList: list.report[i].subProjectList,
  5650. taskList: list.report[i].taskList,
  5651. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5652. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5653. taskId: list.report[i].taskId,
  5654. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5655. startTime: list.report[i].startTime,
  5656. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5657. endTime: list.report[i].endTime,
  5658. isOvertime: flg,
  5659. progress:list.report[i].progress,
  5660. professionProgress: list.report[i].professionProgressList,
  5661. stages:list.report[i].stages,
  5662. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5663. pics: list.report[i].pics,
  5664. multiWorktime: list.report[i].multiWorktime,
  5665. worktimeList: list.report[i].worktimeList,
  5666. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5667. multiDegrIdArray: list.report[i].multiDegrIdList,
  5668. wuduList: list.report[i].degreeList,
  5669. taskGroups:list.report[i].taskGroups,
  5670. customData: list.report[i].customData,//自定义的数值
  5671. auditUserList: list.report[i].auditUserList,
  5672. projectAuditorId: list.report[i].projectAuditorId,
  5673. projectAuditorName: list.report[i].projectAuditorName,
  5674. overtimeHours: list.report[i].overtimeHours,
  5675. customText: list.report[i].customText,
  5676. basecostId: list.report[i].basecostId,
  5677. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5678. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5679. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5680. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5681. canEdit: list.report[i].state >= 2 ? true : false,
  5682. extraField1: list.report[i].extraField1,
  5683. extraField2: list.report[i].extraField2,
  5684. extraField3: list.report[i].extraField3,
  5685. workContentList: list.report[i].workContentList,
  5686. filteredRespList: filteredRespList,
  5687. serviceList: list.report[i].serviceList,
  5688. sapServiceId: list.report[i].sapServiceId,
  5689. })
  5690. if (list.report[i].state >= 2) {
  5691. this.canEdit = true;
  5692. }
  5693. if(list.report[i].state < 2){
  5694. candelete = false
  5695. }
  5696. if (list.report[i].state == 0){
  5697. this.canCancelInDialog = true
  5698. }
  5699. // 加判断
  5700. if(this.user.timeType.choseFromAlbum == 1) {
  5701. let arrList = []
  5702. for(var k in list.report[i].pics) {
  5703. let obj = {
  5704. name: k,
  5705. url: list.report[i].pics[k]
  5706. }
  5707. arrList.push(obj)
  5708. }
  5709. arr[i].imgListUrl = arrList
  5710. arr[i].imgList = list.report[i].pics
  5711. }
  5712. }
  5713. this.reportCanDelete = candelete
  5714. this.workForm = {
  5715. createDate: this.workForm.createDate,
  5716. domains: arr,
  5717. userNames:null,
  5718. userId:null,
  5719. time: list.time
  5720. }
  5721. console.log('workForm', this.workForm)
  5722. } else {
  5723. this.workForm = {
  5724. createDate: this.workForm.createDate,
  5725. domains: [{
  5726. id: null,
  5727. projectId: "",
  5728. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5729. content: "",
  5730. progress:100,
  5731. state: 2,
  5732. timeType:0,
  5733. multiWorktime: this.reportTimeType.multiWorktime,
  5734. worktimeList:[{}],
  5735. canEdit: true,
  5736. auditorFirst: '',
  5737. auditorSec: '',
  5738. auditorThird: '',
  5739. ccUserid: ''
  5740. }],
  5741. userId:null,
  5742. userNames:null,
  5743. time: this.report.time
  5744. }
  5745. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5746. this.$set(this.workForm.domains[0],'isOvertime',true)
  5747. if(this.reportTimeType.type != 2){
  5748. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5749. }
  5750. }
  5751. if(this.user.timeType.type == 1) {
  5752. var shuzhi = this.user.timeType.allday + ''
  5753. // console.log('执行一次', shuzhi.indexOf('.'))
  5754. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5755. }
  5756. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5757. //默认给第一个,必填字段
  5758. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5759. }
  5760. this.canEdit = true;
  5761. }
  5762. this.originCanEdit = this.canEdit;
  5763. this.seleChn()
  5764. } else {
  5765. this.$message({
  5766. message: res.msg,
  5767. type: "error"
  5768. });
  5769. }
  5770. },
  5771. error => {
  5772. this.$message({
  5773. message: error,
  5774. type: "error"
  5775. });
  5776. });
  5777. },
  5778. guanbi() {
  5779. this.falsss = false,
  5780. this.workTimeForMinYi=0
  5781. },
  5782. // 打开日报填写
  5783. fillInReport(i, isBatch) {
  5784. this.isWeekend = false
  5785. this.reportCanDelete = false
  5786. // console.log(this.user.timeType.type, '选择时长')
  5787. if(i != 1) {
  5788. this.falsss = false
  5789. } else {
  5790. this.falsss = true
  5791. }
  5792. if (this.isSubstitude) {
  5793. this.getSubstitudeUserDeptList();
  5794. }
  5795. if(i == -1 || this.isSubstitude) {
  5796. this.isDisable = false;
  5797. } else {
  5798. this.isDisable = true;
  5799. }
  5800. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5801. this.isBatch = isBatch;
  5802. if (this.isBatch == 0 && !this.isSubstitude) {
  5803. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5804. let weekday = new Date(this.workForm.createDate).getDay()
  5805. if(this.user.companyId == 817){
  5806. if(weekday == 0){
  5807. this.isWeekend = true
  5808. }
  5809. }else{
  5810. if(weekday == 0 || weekday == 6){
  5811. this.isWeekend = true
  5812. }
  5813. }
  5814. this.getReport(i);
  5815. } else {
  5816. // console.log('执行到了这里')
  5817. this.jsTime = 0
  5818. this.jsDay = 0
  5819. this.workForm = {
  5820. createDate: null,//批量填报没有日期
  5821. domains: [{
  5822. id: null,
  5823. projectId: "",
  5824. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5825. content: "",
  5826. progress:100,
  5827. state: 2,
  5828. timeType:0,
  5829. multiWorktime: this.reportTimeType.multiWorktime,
  5830. worktimeList:[{}],
  5831. canEdit: true,
  5832. }],
  5833. }
  5834. if(this.user.timeType.type == 1) {
  5835. var shuzhi = this.user.timeType.allday + ''
  5836. // console.log('执行二次')
  5837. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5838. }
  5839. // console.log(this.workForm)
  5840. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5841. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5842. }
  5843. this.canEdit = true;
  5844. }
  5845. this.dialogVisible = true;
  5846. },
  5847. //按周填报的弹窗口中编辑单项目相关数据
  5848. setWeekFormReportItem(reportId, i, names, row,sss) {
  5849. console.log(sss)
  5850. this.http.post('/report/getReportById', {
  5851. reportId: reportId
  5852. },
  5853. res => {
  5854. if (res.code == "ok") {
  5855. var data = res.data.report;
  5856. sss.subProjectId = data.subProjectId
  5857. sss.subProjectList = data.subProjectList;
  5858. sss.stage = data.stage
  5859. sss.subProjectList = data.subProjectList
  5860. sss.stages = data.stages
  5861. sss.taskGroups = data.taskGroups;
  5862. sss.auditUserList = data.auditUserList;
  5863. sss.degreeId = data.degreeId;
  5864. sss.customData = data.customData;
  5865. sss.wuduList = data.degreeList;
  5866. this.zhoBaoIdx = i
  5867. this.zhoBaoName = names
  5868. this.zhoBao = sss
  5869. this.zhis = row
  5870. if (sss.groupId) {
  5871. //最后一个参数表示是否保留stage的值,不要重置为空
  5872. this.getGroupStages(this.zhoBao, 0, true)
  5873. }
  5874. this.$forceUpdate();
  5875. }
  5876. });
  5877. },
  5878. // 按周填报里内容的填写
  5879. tianxies(item, i, names, row) {
  5880. if (item.state == 0) {
  5881. this.$message({
  5882. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5883. type: "error"
  5884. });
  5885. return;
  5886. }
  5887. if (item.state == 1) {
  5888. this.$message({
  5889. message: '已通过状态不可修改',
  5890. type: "error"
  5891. });
  5892. return;
  5893. }
  5894. if(this.user.timeType.notAllowedNoAttendance == 1){
  5895. if(this.zhoData[i].corpTime){
  5896. if(this.zhoData[i].corpTime.workHours == 0){
  5897. this.$message({
  5898. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5899. type: 'error'
  5900. })
  5901. return
  5902. }
  5903. }else{
  5904. this.$message({
  5905. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5906. type: 'error'
  5907. })
  5908. return
  5909. }
  5910. }
  5911. var idd = ''
  5912. var obj = {}
  5913. for(var l in this.projectList) {
  5914. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5915. }
  5916. obj.projectId = idd
  5917. this.tianxieDialogVisible = true
  5918. this.scopess = item
  5919. console.log(item, '《==== 当前的对象')
  5920. var sss = {}
  5921. if (item.id != null) {
  5922. sss.id = item.id;
  5923. sss.state = item.state;
  5924. } else {
  5925. sss.id = -1;
  5926. sss.state = 3;
  5927. }
  5928. sss.projectId = idd;
  5929. sss.progress = item.progress
  5930. sss.time = item.time
  5931. sss.content = item.content;
  5932. console.log('333', sss.content)
  5933. if (sss.time == '' && this.reportTimeType.type == 2) {
  5934. //取已填时间范围中最大的一个作为开始时间
  5935. var startTime = '09:00';
  5936. var fillStartTime = '00:00';
  5937. for (var t in this.selProjectList) {
  5938. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5939. if (fillItem.time) {
  5940. if (fillItem.time[1] > fillStartTime) {
  5941. fillStartTime = fillItem.time[1];
  5942. }
  5943. }
  5944. }
  5945. if (fillStartTime == '00:00') {
  5946. fillStartTime = '09:00';
  5947. }
  5948. var fillEndMax = '18:00';
  5949. if (fillStartTime >= '18:00') {
  5950. fillEndMax = '23:59';
  5951. }
  5952. sss.time = [fillStartTime, fillEndMax];
  5953. }
  5954. sss.groupId = item.groupId
  5955. sss.stage = item.stage;
  5956. sss.workingTime = item.workingTime
  5957. sss.projectAuditorId = item.projectAuditorId;
  5958. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5959. //默认选中第一个
  5960. sss.basecostId = this.timeBasecostList[0].id;
  5961. }
  5962. var hasEdited = this.zhoData[i][names].hasEdited;
  5963. if (hasEdited) {
  5964. sss = { ...item }
  5965. //编辑过了
  5966. sss.subProjectId = item.subProjectId
  5967. sss.stage = item.stage
  5968. sss.subProjectList = item.subProjectList
  5969. sss.stages = item.stages
  5970. sss.taskGroups = item.taskGroups;
  5971. console.log(sss.taskGroups, '33333');
  5972. sss.auditUserList = obj.auditUserList;
  5973. sss.degreeId = item.degreeId;
  5974. sss.customData = item.customData;
  5975. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5976. //只有一个审核人,自动设置上去
  5977. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5978. }
  5979. sss.wuduList = item.wuduList;
  5980. this.zhoBaoIdx = i
  5981. this.zhoBaoName = names
  5982. this.zhoBao = sss
  5983. this.zhis = row
  5984. if (sss.groupId) {
  5985. //最后一个参数表示是否保留stage的值,不要重置为空
  5986. this.getGroupStages(this.zhoBao, 0, true)
  5987. }
  5988. this.$forceUpdate();
  5989. this.getWeeklyTaskList(sss)
  5990. console.log('最后的周报 ===>', this.zhoBao)
  5991. } else {
  5992. //第一次打开,获取数据
  5993. if (sss.id == -1) {
  5994. //新填报的
  5995. this.selectProject(obj, 0);
  5996. var that = this
  5997. setTimeout(() =>{
  5998. sss.subProjectId = that.workForm.domains[0].subProjectId
  5999. sss.subProjectList = item.subProjectList;
  6000. sss.stage = that.workForm.domains[0].stage
  6001. sss.subProjectList = that.workForm.domains[0].subProjectList
  6002. sss.stages = that.workForm.domains[0].stages
  6003. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6004. sss.auditUserList = obj.auditUserList;
  6005. sss.degreeId = item.degreeId;
  6006. sss.customData = item.customData;
  6007. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6008. //只有一个审核人,自动设置上去
  6009. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6010. }
  6011. sss.wuduList = row[0].wuduList
  6012. that.zhoBaoIdx = i
  6013. that.zhoBaoName = names
  6014. that.zhoBao = sss
  6015. that.zhis = row
  6016. if (sss.groupId) {
  6017. //最后一个参数表示是否保留stage的值,不要重置为空
  6018. this.getGroupStages(that.zhoBao, 0, false)
  6019. }
  6020. that.$forceUpdate();
  6021. this.getWeeklyTaskList(sss)
  6022. },600);
  6023. } else {
  6024. //编辑填报过的;数据库已经存在的
  6025. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6026. }
  6027. }
  6028. },
  6029. // 按周填报里内容的填写点击确定
  6030. setWeekProItemData() {
  6031. //专业版模式下,任务分组和阶段必填
  6032. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6033. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6034. this.$message({
  6035. message: '任务分组和阶段必填,请检查',
  6036. type: "error"
  6037. });
  6038. return;
  6039. }
  6040. }
  6041. // 检查任务分组
  6042. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6043. this.$message({
  6044. message: '任务分组必填,请检查',
  6045. type: "error"
  6046. });
  6047. return
  6048. }
  6049. //检查子项目是否必填
  6050. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6051. this.$message({
  6052. message: '子项目必填,请检查',
  6053. type: "error"
  6054. });
  6055. return;
  6056. }
  6057. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6058. this.$message({
  6059. message: this.$t('message.Pleaseselectareviewer'),
  6060. type: "error"
  6061. });
  6062. return
  6063. }
  6064. if(this.user.timeType.reportAuditType == 3){
  6065. let auditTips = ''
  6066. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6067. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6068. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6069. if(auditTips){
  6070. auditTips = auditTips.substring(0,auditTips.length - 1)
  6071. this.$message({
  6072. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6073. type: 'error'
  6074. })
  6075. return
  6076. }
  6077. }
  6078. let errtips = ''
  6079. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6080. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6081. errtips += this.user.timeType.customDegreeName + '、'
  6082. }
  6083. }
  6084. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6085. errtips += this.user.timeType.customDataName + '、'
  6086. }
  6087. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6088. errtips += this.user.timeType.customTextName + '、'
  6089. }
  6090. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6091. errtips += this.$t('other.workMatters') +'、'
  6092. }
  6093. if(errtips){
  6094. errtips = errtips.substring(0,errtips.length - 1)
  6095. this.$message({
  6096. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6097. type: 'error'
  6098. })
  6099. return
  6100. }
  6101. this.tianxieDialogVisible = false
  6102. var zhong = this.zhoData
  6103. this.zhoBao.hasEdited = true;
  6104. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6105. this.zhoData = zhong
  6106. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6107. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6108. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6109. },
  6110. // 获取本周
  6111. getCurrentWeek() {
  6112. //今天
  6113. this.targetWeekDate = new Date();
  6114. this.initWeekFormData();
  6115. // this.jiazai()
  6116. },
  6117. // 获取上周
  6118. handleGetPrevWeek() {
  6119. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6120. this.initWeekFormData();
  6121. // this.jiazai()
  6122. },
  6123. // 获取下周
  6124. handleGetNextvWeek() {
  6125. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6126. this.initWeekFormData()
  6127. },
  6128. // 加载动画
  6129. jiazai() {
  6130. this.weekDataLoading = true
  6131. var that = this
  6132. setTimeout(() =>{
  6133. that.weekDataLoading = false
  6134. },1000);
  6135. },
  6136. // 转时间格式
  6137. dealdate(date) {
  6138. const dt = new Date(date)
  6139. const y = dt.getFullYear()
  6140. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6141. const d = (dt.getDate() + '').padStart(2, '0')
  6142. return `${y}-${m}-${d}`
  6143. },
  6144. // 按周填报
  6145. fillInReportss() {
  6146. window.addEventListener('scroll', this.handleScroll, true)
  6147. // this.jiazai()
  6148. this.fillWeekDialogVisi = true
  6149. this.getCurrentWeek();
  6150. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6151. //重新获取工时预警类型的预算项
  6152. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6153. companyId: this.user.companyId
  6154. },
  6155. res => {
  6156. if (res.code == "ok") {
  6157. this.timeBasecostList = res.data;
  6158. }
  6159. });
  6160. }
  6161. },
  6162. fillInReportCustom() {
  6163. this.weekIndex++
  6164. this.weekParentData = {
  6165. isSubstitude: this.isSubstitude
  6166. }
  6167. this.fillWeekDialogVisiCustom = true
  6168. },
  6169. // 按周填报的项目筛选
  6170. selListFun(){
  6171. this.selProjectList = []
  6172. if(this.selCon.length){
  6173. for (let i = 0; i < this.selCon.length; i++) {
  6174. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6175. }
  6176. this.selConShow = false ;
  6177. for (let i in this.zhoData) {
  6178. var obj = this.zhoData[i];
  6179. for(var j in this.selProjectList) {
  6180. var xinzhi = this.selProjectList[j].projectName
  6181. obj[xinzhi] = {}
  6182. obj[xinzhi].time = ''
  6183. obj[xinzhi].content = ''
  6184. obj[xinzhi].progress = 0
  6185. obj[xinzhi].workingTime = 0
  6186. }
  6187. }
  6188. this.initWeekFormData();
  6189. }else{
  6190. this.$message({
  6191. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6192. type:'error'
  6193. })
  6194. }
  6195. },
  6196. setWeekCardTimeData(list) {
  6197. for(let i in list){
  6198. let datei = '';
  6199. if (this.user.timeType.showDdCardtime == 1) {
  6200. datei = list[i].workDate;
  6201. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6202. datei = list[i].createDate;
  6203. } else if (this.user.timeType.syncFanwei == 1) {
  6204. datei = list[i].workDate;
  6205. }
  6206. for(let m in this.zhoData) {
  6207. if(datei == this.zhoData[m].zhoDataTime){
  6208. let item = {
  6209. startTime: list[i].startTime,
  6210. endTime: list[i].endTime,
  6211. workHours: list[i].workHours
  6212. }
  6213. this.$set(this.zhoData[m],'corpTime',item)
  6214. }
  6215. }
  6216. }
  6217. },
  6218. getWeeklyCardTime(){ //按周填报获取考勤信息
  6219. let dateStr = []
  6220. for(let i in this.zhoData){
  6221. dateStr.push(this.zhoData[i].zhoDataTime)
  6222. }
  6223. this.http.post('/report/getWeeklyCardTime',{
  6224. dateStr: JSON.stringify(dateStr)
  6225. },res => {
  6226. if(res.code == 'ok'){
  6227. for(let i in res.data){
  6228. let datei = '';
  6229. if (this.user.timeType.showDdCardtime == 1) {
  6230. datei = res.data[i].workDate.split('-');
  6231. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6232. datei = res.data[i].createDate.split('-');
  6233. }
  6234. for(let m in this.zhoData){
  6235. let datem = new Date(this.zhoData[m].zhoDataTime)
  6236. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6237. let item = {
  6238. startTime: res.data[i].startTime,
  6239. endTime: res.data[i].endTime,
  6240. workHours: res.data[i].workHours
  6241. }
  6242. this.$set(this.zhoData[m],'corpTime',item)
  6243. }
  6244. }
  6245. }
  6246. }else{
  6247. this.$message({
  6248. message: res.msg,
  6249. type: 'error'
  6250. })
  6251. }
  6252. },err => {
  6253. this.$message({
  6254. message: err,
  6255. type: 'error'
  6256. })
  6257. })
  6258. },
  6259. selListqx(){
  6260. this.fillWeekDialogVisi = false
  6261. this.selProjectList = []
  6262. this.selCon = []
  6263. },
  6264. handleScroll() {
  6265. this.changdu = this.projectList.length + 1
  6266. },
  6267. // 自动选择时间点的事件
  6268. // async zhoTimes(item, i) {
  6269. // var iss = i
  6270. // if(item.time == null) {
  6271. // return
  6272. // } else {
  6273. // const zhi = this.zhoData[iss];
  6274. // let he = 0;
  6275. // const timeArr = Object.values(zhi)
  6276. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6277. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6278. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6279. // console.log(data, 'data');
  6280. // zhi.he = `${he}h`;
  6281. // }
  6282. // },
  6283. async zhoTimes(item, index) {
  6284. const zho = this.zhoData[index];
  6285. if (!item.time) {
  6286. return;
  6287. }
  6288. const timeArr = Object.values(zho)
  6289. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6290. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6291. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6292. zho.he = `${totalHours[0]}h`;
  6293. },
  6294. // 判断两个时间段是否重叠
  6295. timeOverlap(idx, dateAr) {
  6296. let zhi = 0
  6297. for (let k in dateAr) {
  6298. if (idx !== k) {
  6299. 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))) {
  6300. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6301. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6302. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6303. }
  6304. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6305. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6306. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6307. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6308. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6309. } else {
  6310. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6311. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6312. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6313. }
  6314. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6315. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6316. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6317. }
  6318. }
  6319. }
  6320. }
  6321. }
  6322. return zhi
  6323. },
  6324. // 计算时间
  6325. getHourMinutes(str, end) {
  6326. var he = 0
  6327. var date2 = '2021/12/12 ' + end +':00'
  6328. var date1 = '2021/12/12 ' + str +':00'
  6329. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6330. var leave1=date3%(24*3600*1000)
  6331. var hours=Math.floor(leave1/(3600*1000))
  6332. var leave2=leave1%(3600*1000)
  6333. var minutes=Math.floor(leave2/(60*1000))
  6334. var shi = hours+'.'+ minutes
  6335. return he += +shi
  6336. },
  6337. // 自动选择事件长度的事件
  6338. zhoXuan(item, i) {
  6339. var iss = i
  6340. if(item.time == null) {
  6341. return
  6342. } else {
  6343. var zhi = this.zhoData[iss]
  6344. var he = 0
  6345. for(var i in zhi) {
  6346. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6347. he += +zhi[i].workingTime
  6348. }
  6349. }
  6350. zhi.he = he + 'h'
  6351. }
  6352. },
  6353. getPushWorkLogData(){
  6354. this.http.post('/sap-sync-log/list', {},
  6355. res => {
  6356. if (res.code == "ok") {
  6357. this.pushWorkTimeLogData = res.data;
  6358. } else {
  6359. this.$message({
  6360. message: res.msg,
  6361. type: "error"
  6362. });
  6363. }
  6364. },
  6365. error => {
  6366. this.$message({
  6367. message: error,
  6368. type: "error"
  6369. });
  6370. });
  6371. },
  6372. // 获取全部人员
  6373. getUsers() {
  6374. this.http.post('/user/getSimpleActiveUserList', {},
  6375. res => {
  6376. if (res.code == "ok") {
  6377. this.usersList = res.data;
  6378. } else {
  6379. this.$message({
  6380. message: res.msg,
  6381. type: "error"
  6382. });
  6383. }
  6384. },
  6385. error => {
  6386. this.$message({
  6387. message: error,
  6388. type: "error"
  6389. });
  6390. });
  6391. },
  6392. // 按时间比例
  6393. addBli(item, i) {
  6394. var iss = i
  6395. if(item.time == null) {
  6396. return
  6397. } else {
  6398. var zhi = this.zhoData[iss]
  6399. var he = 0
  6400. for(var i in zhi) {
  6401. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6402. he += +zhi[i].workingTime
  6403. }
  6404. }
  6405. zhi.he = he.toFixed(1) + 'h'
  6406. }
  6407. },
  6408. //按周填报选择的项目发生变化,需要设置列
  6409. onSelProjectChange() {
  6410. for (let i = 0; i < this.selCon.length; i++) {
  6411. var exists = false;
  6412. for (let j = 0; j < this.selProjectList.length; j++) {
  6413. if (this.selProjectList[j].id == this.selCon[i]) {
  6414. exists = true;
  6415. break;
  6416. }
  6417. }
  6418. if (!exists) {
  6419. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6420. this.selProjectList.push(newProject);
  6421. //添加新项目
  6422. for (var w in this.zhoData) {
  6423. var dayItem = this.zhoData[w];
  6424. var pName = newProject.projectName;
  6425. dayItem[pName] = {};
  6426. dayItem[pName].time = ''
  6427. dayItem[pName].content = ''
  6428. dayItem[pName].progress = 0
  6429. dayItem[pName].workingTime = 0
  6430. }
  6431. }
  6432. }
  6433. //去掉
  6434. for (let j = 0; j < this.selProjectList.length; j++) {
  6435. var exists = false;
  6436. for (let i = 0; i < this.selCon.length; i++) {
  6437. if (this.selProjectList[j].id == this.selCon[i]) {
  6438. exists = true;
  6439. break;
  6440. }
  6441. }
  6442. if (!exists) {
  6443. this.selProjectList.splice(j, 1);
  6444. j--;
  6445. }
  6446. }
  6447. this.loadFilledWeekReportItem();
  6448. //刷新表格
  6449. // this.$refs.weekTable.doLayout();
  6450. },
  6451. //根据选中的项目来刷新填写表格
  6452. loadFilledWeekReportItem() {
  6453. for (var w in this.zhoData) {
  6454. var dayItem = this.zhoData[w];
  6455. for (var i = 0; i < this.selProjectList.length; i++) {
  6456. var curColumnProject = this.selProjectList[i];
  6457. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6458. for (var t in dayItem.reportList) {
  6459. //有日报的项目,不能取消选择
  6460. for (var p in this.fillProjectList) {
  6461. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6462. }
  6463. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6464. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6465. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6466. if (this.reportTimeType.type == 2) {
  6467. //时间段模式
  6468. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6469. }
  6470. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6471. break;
  6472. }
  6473. }
  6474. // dayItem[curColumnProject.projectName] = matchReportItem;
  6475. }
  6476. }
  6477. this.$nextTick(()=>{
  6478. this.$refs.weekTable.doLayout();
  6479. });
  6480. },
  6481. initWeekFormData() {
  6482. this.weekDataLoading = true;
  6483. for (var p in this.fillProjectList) {
  6484. this.fillProjectList[p].canCancel = 1;
  6485. }
  6486. this.http.post('/report/getWeeklyReportData',{
  6487. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6488. },res => {
  6489. this.weekDataLoading = false;
  6490. if(res.code == 'ok'){
  6491. let projectList = res.data.projectList;
  6492. if (projectList.length > 0) {
  6493. //有选择过项目进行填报,直接选中
  6494. this.selProjectList = projectList;
  6495. this.selCon = [];
  6496. for (let i = 0; i < projectList.length; i++) {
  6497. this.selCon.push(projectList[i].id);
  6498. }
  6499. }
  6500. //设置日期
  6501. this.weekDateRange = res.data.dateList;
  6502. this.zhoData = [];
  6503. var arrst = []
  6504. for(var i in this.weekDateRange) {
  6505. var obj = {}
  6506. obj.zhoDataTime = this.weekDateRange[i].date
  6507. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6508. obj.he = this.weekDateRange[i].filledTime;
  6509. obj.canFill = this.weekDateRange[i].canFill;
  6510. // obj.filledTime = this.weekDateRange[i].filledTime;
  6511. obj.reportList = this.weekDateRange[i].reportList;
  6512. //初始化,防止渲染报错
  6513. for (var j = 0; j < this.selProjectList.length; j++) {
  6514. var pName = this.selProjectList[j].projectName
  6515. obj[pName] = {}
  6516. obj[pName].time = ''
  6517. obj[pName].content = ''
  6518. obj[pName].progress = 0
  6519. obj[pName].workingTime = 0
  6520. }
  6521. arrst.push(obj)
  6522. }
  6523. this.zhoData = arrst
  6524. this.setWeekCardTimeData(res.data.cardTimeList);
  6525. this.loadFilledWeekReportItem();
  6526. }else{
  6527. this.$message({
  6528. message: res.msg,
  6529. type: 'error'
  6530. })
  6531. }
  6532. },err => {
  6533. this.$message({
  6534. message: err,
  6535. type: 'error'
  6536. })
  6537. })
  6538. },
  6539. zhoZhi(res, i) {
  6540. var zhi = 0
  6541. for(var i in res) {
  6542. if(i != 'zhoDataTime' && i != 'he') {
  6543. zhi += +res[i]
  6544. }
  6545. }
  6546. res.he = zhi
  6547. },
  6548. zhoBtn(i) {
  6549. // this.zhoData.split(i, 1)
  6550. var arr = this.zhoData
  6551. arr.splice(i, 1)
  6552. },
  6553. zhoAddlast(){
  6554. this.selConShow = true
  6555. },
  6556. closeAddWeeklyReport(){
  6557. this.fillWeekDialogVisi = false
  6558. this.selConShow = true
  6559. this.selProjectList = []
  6560. this.selCon = []
  6561. },
  6562. checkDateWorkTime() {
  6563. //针对苏州景昱,单独的检查逻辑
  6564. if (this.user.companyId == 5978) {
  6565. //调接口,先检查工时是否存在异常
  6566. var zhi = this.zhoData;
  6567. var array = [];
  6568. for(let n in zhi){
  6569. if(zhi[n].he){
  6570. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6571. array.push(workData)
  6572. }
  6573. }
  6574. this.submitingReport = true;
  6575. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6576. res => {
  6577. this.submitingReport = false;
  6578. if (res.code == "ok") {
  6579. this.submitWeekReport(0)
  6580. } else {
  6581. this.$confirm(res.msg, '提示', {
  6582. confirmButtonText: '忽略并提交',
  6583. cancelButtonText: '取消',
  6584. type: 'error'
  6585. }).then(() => {
  6586. this.submitWeekReport(0)
  6587. }).catch(() => {
  6588. });
  6589. }
  6590. },
  6591. error => {
  6592. this.$message({
  6593. message: error,
  6594. type: "error"
  6595. });
  6596. });
  6597. }
  6598. },
  6599. // 提交按周填报
  6600. submitWeekReport(isDraft) {
  6601. var zhi = this.zhoData
  6602. var ll = 0
  6603. if(this.reportTimeType.type == 2) {
  6604. for(var i in zhi) {
  6605. this.dateAr = []
  6606. var alp = []
  6607. var zhis = zhi[i]
  6608. console.log(zhis)
  6609. for(var j in zhis) {
  6610. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6611. let objs = {}
  6612. objs.s = zhis[j].time[0]
  6613. objs.e = zhis[j].time[1]
  6614. objs.p = j
  6615. alp.push(objs)
  6616. }
  6617. }
  6618. console.log(alp)
  6619. this.dateAr = alp
  6620. if (this.reportTimeType.timeCanOverlap == 0) {
  6621. let str = this.$t('message.Filledtimeperiodsoverlap')
  6622. if(this.dateAr.length > 0) {
  6623. const trus = this.fns();
  6624. const overlapDataTime = this.getOverlapData(alp);
  6625. if (overlapDataTime.length > 0) {
  6626. const arrList = overlapDataTime.map((item) => item.p);
  6627. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6628. }
  6629. ll += 1
  6630. if(!trus) {
  6631. this.$message({
  6632. message: str,
  6633. type: 'error'
  6634. })
  6635. return false
  6636. }
  6637. }
  6638. } else {
  6639. if(this.dateAr.length > 0) {
  6640. ll +=1 ;
  6641. }
  6642. }
  6643. }
  6644. if(ll == 0) {
  6645. this.$message({
  6646. message: this.$t('message.Pleasefillinthetime'),
  6647. type: 'error'
  6648. })
  6649. return false
  6650. }
  6651. } else if(this.reportTimeType.type == 1){
  6652. for(var i in zhi) {
  6653. var zhis = zhi[i]
  6654. for(var j in zhis) {
  6655. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6656. ll += 1
  6657. }
  6658. }
  6659. }
  6660. if(ll == 0) {
  6661. this.$message({
  6662. message: this.$t('message.Pleaseselectatime'),
  6663. type: 'error'
  6664. })
  6665. return false
  6666. }
  6667. let overcorp = ''
  6668. for(let n in zhi){
  6669. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6670. overcorp += zhi[n].zhoDataTime + ','
  6671. }
  6672. }
  6673. if(this.user.companyId != 5978 && overcorp != ''){
  6674. overcorp = overcorp.substring(0,overcorp.length - 1)
  6675. this.$message({
  6676. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6677. type: 'error'
  6678. })
  6679. return
  6680. }
  6681. }
  6682. var submits = []
  6683. let formData = new FormData();
  6684. formData.append("draft", isDraft);
  6685. if(this.reportTimeType.multiWorktime == 1){
  6686. for (var i in this.zhoData) {
  6687. var zhoD = this.zhoData[i]
  6688. var flgs = false
  6689. for(var j in zhoD) {
  6690. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6691. flgs = true
  6692. // formData.append("degreeId", "-1");
  6693. formData.append("id", '-1');
  6694. for(var s in this.projectList) {
  6695. if(j == this.projectList[s].projectName) {
  6696. formData.append("projectId", this.projectList[s].id);
  6697. }
  6698. }
  6699. if(this.user.timeType.reportAuditType == 3){
  6700. let audItem = {}
  6701. if(this.user.timeType.auditLevel > 0){
  6702. audItem.auditorFirst = zhoD[j].auditorFirst
  6703. }
  6704. if(this.user.timeType.auditLevel > 1){
  6705. audItem.auditorSec = zhoD[j].auditorSec
  6706. }
  6707. if(this.user.timeType.auditLevel > 2){
  6708. audItem.auditorThird = zhoD[j].auditorThird
  6709. }
  6710. if(zhoD[j].ccUserid){
  6711. audItem.ccUserid = zhoD[j].ccUserid
  6712. }
  6713. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6714. }
  6715. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6716. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6717. formData.append("reportTimeType", this.reportTimeType.type);
  6718. formData.append("endTime", '');
  6719. formData.append("startTime", '');
  6720. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6721. var lix = []
  6722. var objjs = {}
  6723. objjs.startTime = zhoD[j].time[0]
  6724. objjs.endTime = zhoD[j].time[1]
  6725. if (zhoD[j].content == null || zhoD[j].content == '') {
  6726. zhoD[j].content == '-'
  6727. }
  6728. objjs.content = zhoD[j].content
  6729. lix.push(objjs)
  6730. var zhiZhi = JSON.stringify(lix)
  6731. zhiZhi = zhiZhi.replace(/,/g,"@");
  6732. formData.append("content", zhiZhi)
  6733. formData.append("isOvertime", 0)
  6734. formData.append("professionProgress", "[]")
  6735. if (zhoD[j].groupId) {
  6736. formData.append("groupId",zhoD[j].groupId)
  6737. } else {
  6738. //解决后台groupId数组越界的问题
  6739. formData.append("groupId",0)
  6740. }
  6741. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6742. formData.append("createDate",zhoD.zhoDataTime)
  6743. if (zhoD[j].projectAuditorId) {
  6744. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6745. }
  6746. if(zhoD[j].basecostId) {
  6747. formData.append("basecostId", zhoD[j].basecostId);
  6748. } else {
  6749. formData.append("basecostId", 0);
  6750. }
  6751. if(this.user.timeType.customDegreeActive){
  6752. if (this.user.timeType.customDegreeMultiple) {
  6753. if (zhoD[j].multiDegrIdArray) {
  6754. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6755. } else {
  6756. formData.append('multiDegrId','[]')
  6757. }
  6758. } else {
  6759. if (zhoD[j].degreeId) {
  6760. formData.append('degreeId',zhoD[j].degreeId)
  6761. } else {
  6762. formData.append('degreeId','-1')
  6763. }
  6764. }
  6765. }else{
  6766. formData.append("degreeId", "-1");
  6767. }
  6768. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6769. formData.append('customData',zhoD[j].customData)
  6770. }else if(this.user.timeType.customDataActive){
  6771. formData.append('customData',0)
  6772. }
  6773. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6774. formData.append('customText',zhoD[j].customText)
  6775. }else if(this.user.timeType.customTextActive){
  6776. formData.append('customText','-')
  6777. }
  6778. }
  6779. }
  6780. }
  6781. } else {
  6782. for (var i in this.zhoData) {
  6783. var zhoD = this.zhoData[i]
  6784. var flgs = false
  6785. if(this.reportTimeType.type == 2) {
  6786. for(var k in this.selProjectList) {
  6787. var pItem = this.selProjectList[k];
  6788. var pName = pItem.projectName;
  6789. var j = pName;
  6790. console.log('j==周报中的项目='+j);
  6791. if(zhoD[j].time && zhoD[j].time != 'null') {
  6792. flgs = true
  6793. // formData.append("degreeId", "-1");
  6794. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6795. for(var s in this.projectList) {
  6796. if(j == this.projectList[s].projectName) {
  6797. formData.append("projectId", this.projectList[s].id);
  6798. }
  6799. }
  6800. if(this.user.timeType.reportAuditType == 3){
  6801. let audItem = {}
  6802. if(this.user.timeType.auditLevel > 0){
  6803. audItem.auditorFirst = zhoD[j].auditorFirst
  6804. }
  6805. if(this.user.timeType.auditLevel > 1){
  6806. audItem.auditorSec = zhoD[j].auditorSec
  6807. }
  6808. if(this.user.timeType.auditLevel > 2){
  6809. audItem.auditorThird = zhoD[j].auditorThird
  6810. }
  6811. if(zhoD[j].ccUserid){
  6812. audItem.ccUserid = zhoD[j].ccUserid
  6813. }
  6814. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6815. }
  6816. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6817. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6818. formData.append("reportTimeType", this.reportTimeType.type);
  6819. formData.append("endTime", zhoD[j].time[1]);
  6820. formData.append("startTime", zhoD[j].time[0]);
  6821. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6822. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6823. formData.append("isOvertime", 0)
  6824. formData.append("professionProgress", "[]")
  6825. if (zhoD[j].groupId) {
  6826. formData.append("groupId",zhoD[j].groupId)
  6827. } else {
  6828. //解决后台groupId数组越界的问题
  6829. formData.append("groupId",0)
  6830. }
  6831. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6832. formData.append("createDate",zhoD.zhoDataTime)
  6833. if (zhoD[j].projectAuditorId) {
  6834. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6835. }
  6836. if(zhoD[j].basecostId) {
  6837. formData.append("basecostId", zhoD[j].basecostId);
  6838. } else {
  6839. formData.append("basecostId", 0);
  6840. }
  6841. if(this.user.timeType.customDegreeActive){
  6842. if (this.user.timeType.customDegreeMultiple) {
  6843. if (zhoD[j].multiDegrIdArray) {
  6844. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6845. } else {
  6846. formData.append("multiDegrId", "[]");
  6847. }
  6848. } else {
  6849. if (zhoD[j].degreeId) {
  6850. formData.append('degreeId',zhoD[j].degreeId)
  6851. } else {
  6852. formData.append("degreeId", "-1");
  6853. }
  6854. }
  6855. }else{
  6856. formData.append("degreeId", "-1");
  6857. }
  6858. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6859. formData.append('customData',zhoD[j].customData)
  6860. }else if(this.user.timeType.customDataActive){
  6861. formData.append('customData',0)
  6862. }
  6863. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6864. formData.append('customText',zhoD[j].customText)
  6865. }else if(this.user.timeType.customTextActive){
  6866. formData.append('customText','-')
  6867. }
  6868. }
  6869. }
  6870. } else {
  6871. for(var k in this.selProjectList) {
  6872. var pItem = this.selProjectList[k];
  6873. var pName = pItem.projectName;
  6874. var j = pName;
  6875. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6876. flgs = true
  6877. // formData.append("degreeId", "-1");
  6878. console.log('进入了workFpppp==='+j);
  6879. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6880. for(var s in this.projectList) {
  6881. if(j == this.projectList[s].projectName) {
  6882. formData.append("projectId", this.projectList[s].id);
  6883. }
  6884. }
  6885. if(this.user.timeType.reportAuditType == 3){
  6886. let audItem = {}
  6887. if(this.user.timeType.auditLevel > 0){
  6888. audItem.auditorFirst = zhoD[j].auditorFirst
  6889. }
  6890. if(this.user.timeType.auditLevel > 1){
  6891. audItem.auditorSec = zhoD[j].auditorSec
  6892. }
  6893. if(this.user.timeType.auditLevel > 2){
  6894. audItem.auditorThird = zhoD[j].auditorThird
  6895. }
  6896. if(zhoD[j].ccUserid){
  6897. audItem.ccUserid = zhoD[j].ccUserid
  6898. }
  6899. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6900. }
  6901. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6902. // formData.append("subProjectId", zhoD[j].subProjectId);
  6903. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6904. formData.append("reportTimeType", this.reportTimeType.type);
  6905. if(this.reportTimeType.type == 1) {
  6906. formData.append("workingTime", zhoD[j].workingTime);
  6907. } else if(this.reportTimeType.type == 2) {
  6908. formData.append("endTime", zhoD[j].time[1]);
  6909. formData.append("startTime", zhoD[j].time[0]);
  6910. } else if(this.reportTimeType.type == 3) {
  6911. formData.append("progress", zhoD[j].progress);
  6912. formData.append("workingTime", zhoD[j].workingTime);
  6913. }
  6914. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6915. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6916. formData.append("isOvertime", 0)
  6917. formData.append("professionProgress", "[]")
  6918. if (zhoD[j].groupId) {
  6919. formData.append("groupId",zhoD[j].groupId)
  6920. } else {
  6921. //解决后台groupId数组越界的问题
  6922. formData.append("groupId",0)
  6923. }
  6924. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6925. formData.append("createDate",zhoD.zhoDataTime)
  6926. if (zhoD[j].projectAuditorId) {
  6927. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6928. }
  6929. if(zhoD[j].basecostId) {
  6930. formData.append("basecostId", zhoD[j].basecostId);
  6931. } else {
  6932. formData.append("basecostId", 0);
  6933. }
  6934. if(this.user.timeType.customDegreeActive){
  6935. if (this.user.timeType.customDegreeMultiple) {
  6936. if (zhoD[j].multiDegrIdArray) {
  6937. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6938. } else {
  6939. formData.append("multiDegrId", "[]");
  6940. }
  6941. } else {
  6942. if (zhoD[j].degreeId) {
  6943. formData.append('degreeId',zhoD[j].degreeId)
  6944. } else {
  6945. formData.append("degreeId", "-1");
  6946. }
  6947. }
  6948. }else{
  6949. formData.append("degreeId", "-1");
  6950. }
  6951. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6952. formData.append('customData',zhoD[j].customData)
  6953. }else if(this.user.timeType.customDataActive){
  6954. formData.append('customData',0)
  6955. }
  6956. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6957. formData.append('customText',zhoD[j].customText)
  6958. }else if(this.user.timeType.customTextActive){
  6959. formData.append('customText','-')
  6960. }
  6961. }
  6962. }
  6963. }
  6964. }
  6965. }
  6966. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6967. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6968. if(!next) {
  6969. this.$message({
  6970. message: `【${error.join('、')}】请填写任务分组`,
  6971. type: 'error'
  6972. })
  6973. return
  6974. }
  6975. // 自定义维度
  6976. this.submitingReport = true;
  6977. this.http.uploadFile( this.port.report.editPort, formData,
  6978. res => {
  6979. // this.listLoading = false;
  6980. this.submitingReport = false;
  6981. if (res.code == "ok") {
  6982. this.$message({
  6983. message: this.$t('message.fillinsuccessfully'),
  6984. type: "success"
  6985. });
  6986. this.fillWeekDialogVisi = false
  6987. this.selConShow = true
  6988. this.zhoData = []
  6989. this.weekDateRange = ''
  6990. this.getReportList();
  6991. this.getDepartment();
  6992. // 关闭弹窗 并 清空
  6993. this.selProjectList = []
  6994. this.selCon = []
  6995. this.getRecentlyProject()
  6996. } else {
  6997. this.$message({
  6998. message: res.msg,
  6999. type: "error"
  7000. });
  7001. }
  7002. },
  7003. error => {
  7004. this.submitingReport = false;
  7005. this.$message({
  7006. message: error,
  7007. type: "error"
  7008. });
  7009. });
  7010. },
  7011. handleGroupAuditorData(data) {
  7012. const { reportAuditType } = this.user.timeType
  7013. if(reportAuditType != 1 && reportAuditType != 2) {
  7014. return {next: true}
  7015. }
  7016. let arrList = [];
  7017. Object.entries(data).forEach(([key, obj]) => {
  7018. Object.entries(obj).forEach(([projectName, projectData]) => {
  7019. if (projectData.workingTime && !projectData.groupId) {
  7020. arrList.push({
  7021. projectName,
  7022. date: obj.zhoDataTime,
  7023. dateText: obj.zhoDataTimeTxt
  7024. });
  7025. }
  7026. });
  7027. });
  7028. if(arrList.length > 0) {
  7029. return {
  7030. next: false,
  7031. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7032. }
  7033. } else {
  7034. return {
  7035. next: true,
  7036. error: [],
  7037. }
  7038. }
  7039. },
  7040. ChangeHourMinutestr (str) {
  7041. if (str !== "0" && str !== "" && str !== null) {
  7042. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7043. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7044. } else {
  7045. return "";
  7046. }
  7047. },
  7048. // 得到两个日期中间的日期
  7049. getdiffdate(stime,etime){
  7050. //初始化日期列表,数组
  7051. var diffdate = new Array();
  7052. var i=0;
  7053. //开始日期小于等于结束日期,并循环
  7054. while(stime<=etime){
  7055. diffdate[i] = stime;
  7056. //获取开始日期时间戳
  7057. var stime_ts = new Date(stime).getTime();
  7058. //增加一天时间戳后的日期
  7059. var next_date = stime_ts + (24*60*60*1000);
  7060. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7061. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7062. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7063. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7064. stime = next_dates_y+next_dates_m+next_dates_d;
  7065. //增加数组key
  7066. i++;
  7067. }
  7068. return diffdate;
  7069. },
  7070. // 添加模块
  7071. addDomain(i) {
  7072. var leftProgress = 10;
  7073. if (this.reportTimeType.type == 3) {
  7074. //计算已经待分配工时比例
  7075. let array = this.workForm.domains;
  7076. let totalProgress = 0;
  7077. for (var i=0;i<array.length; i++) {
  7078. totalProgress += array[i].progress;
  7079. }
  7080. if (totalProgress < 100) {
  7081. leftProgress = 100 - totalProgress;
  7082. }
  7083. }
  7084. var addItem = {
  7085. projectId: "",
  7086. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7087. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7088. ),
  7089. content: "",
  7090. progress:leftProgress,
  7091. state:2,//2-表示待提交
  7092. multiWorktime: this.reportTimeType.multiWorktime,
  7093. worktimeList:[{}],
  7094. canEdit: true,
  7095. auditorFirst: '',
  7096. auditorSec: '',
  7097. auditorThird: '',
  7098. ccUserid: ''
  7099. // degreeId: '',
  7100. };
  7101. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7102. this.$set(addItem,'isOvertime',true)
  7103. if(this.reportTimeType.type == 3){
  7104. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7105. }
  7106. }
  7107. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7108. //默认给第一个,必填字段
  7109. addItem.basecostId = this.timeBasecostList[0].id;
  7110. }
  7111. this.workForm.domains.push(addItem);
  7112. document.getElementById('workFormsItemBottom').scrollIntoView()
  7113. this.canEdit = true
  7114. if (this.reportTimeType.type == 0) {
  7115. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7116. var length = this.workForm.domains.length;
  7117. if (length == 2) {
  7118. this.showAddMore = false;
  7119. }
  7120. }
  7121. this.chuji()
  7122. this.seleChn()
  7123. },
  7124. // 移除模块
  7125. delDomain(i) {
  7126. this.workForm.domains.splice(i,1)
  7127. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7128. if (!this.originCanEdit) {
  7129. let iscan = false
  7130. for(let i in this.workForm.domains){
  7131. if(this.workForm.domains[i].canEdit){
  7132. iscan = true
  7133. }
  7134. }
  7135. this.canEdit = iscan
  7136. }
  7137. //检测当前剩下的一个,时间类型是否是全天
  7138. if (this.reportTimeType.type == 0) {
  7139. if (this.workForm.domains[0].timeType == 0) {
  7140. this.showAddMore = false;
  7141. } else {
  7142. this.showAddMore = true;
  7143. }
  7144. }
  7145. if(this.user.timeType.multiWorktime == 1) {
  7146. this.iptChangs()
  7147. } else {
  7148. this.seleChn(0)
  7149. }
  7150. },
  7151. // 改变月份
  7152. changeMonth() {
  7153. this.isWeekend = false
  7154. let date = new Date()
  7155. let nowmon = date.getMonth() + 1
  7156. let nowday = date.getDate()
  7157. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7158. if (this.isBatch == 0) {
  7159. if(this.user.timeType.fillAhead == 0){
  7160. let date_a = new Date(this.workForm.createDate)
  7161. if(date_a.getTime() > date.getTime()){
  7162. this.workForm.createDate = nowdate
  7163. }
  7164. }
  7165. //只有按天填报才能获取当天的日报
  7166. if(!this.isSubstitude){
  7167. let weekday = new Date(this.workForm.createDate).getDay()
  7168. if(this.user.companyId == 817){
  7169. if(weekday == 0){
  7170. this.isWeekend = true
  7171. }
  7172. }else{
  7173. if(weekday == 0 || weekday == 6){
  7174. this.isWeekend = true
  7175. }
  7176. }
  7177. this.getReport()
  7178. }
  7179. }else {
  7180. if(this.user.timeType.fillAhead == 0){
  7181. let date_a = new Date(this.workForm.createDate[1])
  7182. if(date_a.getTime() > date.getTime()){
  7183. this.workForm.createDate[1] = nowdate
  7184. let sdate = new Date(this.workForm.createDate[0])
  7185. let edate = new Date(this.workForm.createDate[1])
  7186. if(sdate > edate){
  7187. this.workForm.createDate[0] = this.workForm.createDate[1]
  7188. }
  7189. }
  7190. }
  7191. }
  7192. },
  7193. // 判断时间段
  7194. fns() {
  7195. for (let k in this.dateAr) {
  7196. if (!this.judege(k)) {
  7197. return false
  7198. }
  7199. }
  7200. return true
  7201. },
  7202. judege(idx){
  7203. for (let k in this.dateAr) {
  7204. if (idx !== k) {
  7205. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7206. return false
  7207. }
  7208. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7209. return false
  7210. }
  7211. }
  7212. }
  7213. return true
  7214. },
  7215. getOverlapData(data) {
  7216. let overlapData = [];
  7217. for (let i = 0; i < data.length; i++) {
  7218. for (let j = i + 1; j < data.length; j++) {
  7219. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7220. overlapData.push(data[i], data[j]);
  7221. }
  7222. }
  7223. }
  7224. return overlapData;
  7225. },
  7226. // 保存日报111111
  7227. submitReport(isDraft) {
  7228. this.isDraft = isDraft;
  7229. this.$refs.workForm.validate(valid => {
  7230. if (valid) {
  7231. if (!isDraft) {
  7232. //针对苏州景昱,单独的检查逻辑
  7233. if (this.user.companyId == 5978) {
  7234. //调接口,先检查工时是否存在异常
  7235. var totalTime = 0;
  7236. for (var t=0;t<this.workForm.domains.length; t++) {
  7237. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7238. }
  7239. var array = [];
  7240. if (this.isBatch) {
  7241. var startDate = new Date(this.workForm.createDate[0]);
  7242. var endDate = new Date(this.workForm.createDate[1]);
  7243. if (startDate > endDate) {
  7244. this.$message({
  7245. message: '开始日期不能大于结束日期',
  7246. type: "error"
  7247. });
  7248. return
  7249. } else {
  7250. while(true){
  7251. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7252. array.push(workData);
  7253. startDate.setDate(startDate.getDate() + 1);
  7254. if (startDate > endDate) {
  7255. break;
  7256. }
  7257. }
  7258. }
  7259. } else {
  7260. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7261. array.push(workData)
  7262. }
  7263. this.submitingReport = true;
  7264. var passUserId = this.user.id;
  7265. if (this.isSubstitude) {
  7266. passUserId = this.targetUids;
  7267. }
  7268. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7269. res => {
  7270. this.submitingReport = false;
  7271. if (res.code == "ok") {
  7272. this.submitReportSon()
  7273. } else {
  7274. this.$confirm(res.msg, '提示', {
  7275. confirmButtonText: '忽略并提交',
  7276. cancelButtonText: '取消',
  7277. type: 'error'
  7278. }).then(() => {
  7279. this.submitReportSon()
  7280. }).catch(() => {
  7281. });
  7282. }
  7283. },
  7284. error => {
  7285. this.$message({
  7286. message: error,
  7287. type: "error"
  7288. });
  7289. });
  7290. } else {
  7291. if(this.totalReportHours < this.user.timeType.allday){
  7292. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7293. confirmButtonText: '确定',
  7294. cancelButtonText: '取消',
  7295. type: 'warning'
  7296. }).then(() => {
  7297. this.submitReportSon()
  7298. }).catch(() => {
  7299. });
  7300. }else{
  7301. this.submitReportSon()
  7302. }
  7303. }
  7304. } else {
  7305. //暂存,不需要检查工时是否超过考勤
  7306. this.submitReportSon()
  7307. }
  7308. }
  7309. });
  7310. },
  7311. submitReportSon() {
  7312. this.dateAr = []
  7313. //检查重叠
  7314. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7315. let alp = []
  7316. if(this.user.timeType.multiWorktime != 1) {
  7317. for(var p in this.workForm.domains) {
  7318. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7319. let objs = {}
  7320. objs.s = this.workForm.domains[p].startTime
  7321. objs.e = this.workForm.domains[p].endTime
  7322. alp.push(objs)
  7323. }
  7324. }
  7325. this.dateAr = alp
  7326. if(this.dateAr.length > 0) {
  7327. let trus = this.fns()
  7328. if(!trus) {
  7329. this.$message({
  7330. message: this.$t('message.Filledtimeperiodsoverlap'),
  7331. type: "error"
  7332. });
  7333. return
  7334. }
  7335. }
  7336. } else {
  7337. for(var p in this.workForm.domains) {
  7338. var slll = this.workForm.domains[p]
  7339. for(var o in slll.worktimeList) {
  7340. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7341. let objs = {}
  7342. objs.s = slll.worktimeList[o].startTime
  7343. objs.e = slll.worktimeList[o].endTime
  7344. alp.push(objs)
  7345. }
  7346. }
  7347. }
  7348. this.dateAr = alp
  7349. if(this.dateAr.length > 0) {
  7350. let trus = this.fns()
  7351. if(!trus) {
  7352. this.$message({
  7353. message: this.$t('message.Filledtimeperiodsoverlap'),
  7354. type: "error"
  7355. });
  7356. return
  7357. }
  7358. }
  7359. }
  7360. }
  7361. //检查子项目
  7362. if (this.user.timeType.subProMustFill == 1) {
  7363. for(var p in this.workForm.domains) {
  7364. var oneProItem = this.workForm.domains[p]
  7365. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7366. //没有选择子项目
  7367. this.$message({
  7368. message: '子项目必填,请检查',
  7369. type: "error"
  7370. });
  7371. return
  7372. }
  7373. }
  7374. }
  7375. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7376. if (this.user.companyId == this.yuzhongCompId) {
  7377. for(var p in this.workForm.domains) {
  7378. var oneProItem = this.workForm.domains[p]
  7379. if (!oneProItem.extraField1) {
  7380. this.$message({
  7381. message: '角色必填,请检查',
  7382. type: "error"
  7383. });
  7384. return
  7385. }
  7386. if (!oneProItem.extraField2) {
  7387. this.$message({
  7388. message: '工作职责必填,请检查',
  7389. type: "error"
  7390. });
  7391. return
  7392. }
  7393. if (!oneProItem.extraField3) {
  7394. this.$message({
  7395. message: '工作内容必填,请检查',
  7396. type: "error"
  7397. });
  7398. return
  7399. }
  7400. }
  7401. }
  7402. // return
  7403. //代填的情况,检查人员是否已经选择
  7404. if (this.isSubstitude) {
  7405. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7406. this.$message({
  7407. message: this.$t('message.pleaseselectthepersontofillin'),
  7408. type: "error"
  7409. });
  7410. return;
  7411. }
  7412. }
  7413. //检查时间,全天和上下午不能同时存在
  7414. if (this.reportTimeType.type == 0) {
  7415. var alldayNum = 0;
  7416. var amNum = 0;
  7417. var pmNum = 0;
  7418. for(var i in this.workForm.domains) {
  7419. if (this.workForm.domains[i].timeType == 0) {
  7420. alldayNum ++;
  7421. } else if (this.workForm.domains[i].timeType == 1) {
  7422. amNum++;
  7423. } else if (this.workForm.domains[i].timeType == 2) {
  7424. pmNum++;
  7425. }
  7426. }
  7427. if (alldayNum > 1) {
  7428. this.$message({
  7429. // message: "工作时间-全天,只能选择一次",
  7430. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7431. type: "error"
  7432. });
  7433. return;
  7434. }
  7435. if (amNum > 1) {
  7436. this.$message({
  7437. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7438. type: "error"
  7439. });
  7440. return;
  7441. }
  7442. if (pmNum > 1) {
  7443. this.$message({
  7444. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7445. type: "error"
  7446. });
  7447. return;
  7448. }
  7449. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7450. this.$message({
  7451. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7452. type: "error"
  7453. });
  7454. return;
  7455. }
  7456. } else if (this.reportTimeType.type == 3) {
  7457. //总百分比不能超过100%
  7458. let total = 0;
  7459. this.workForm.domains.forEach(w=>{total += w.progress});
  7460. if (total > 100) {
  7461. this.$message({
  7462. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7463. type: "error"
  7464. });
  7465. return;
  7466. } else if (total < 100) {
  7467. this.$message({
  7468. message: this.$t('message.cannotbesubmitted'),
  7469. type: "error"
  7470. });
  7471. return;
  7472. }
  7473. }
  7474. this.listLoading = true;
  7475. let formData = new FormData();
  7476. formData.append("draft", this.isDraft);
  7477. var totalTime = 0;
  7478. for (var t=0;t<this.workForm.domains.length; t++) {
  7479. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7480. }
  7481. //批量填报不校验考勤时长,交给后台校验
  7482. if (!this.isBatch) {
  7483. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7484. if (this.workForm.time){
  7485. if (this.workForm.time.workHours == 0){
  7486. this.$message({
  7487. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7488. type: 'error'
  7489. })
  7490. return
  7491. }
  7492. }else{
  7493. this.$message({
  7494. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7495. type: 'error'
  7496. })
  7497. return
  7498. }
  7499. }
  7500. }
  7501. //针对凡己和景昱,此处不校验考勤时长
  7502. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7503. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7504. this.$message({
  7505. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7506. type: "error"
  7507. });
  7508. return;
  7509. }
  7510. }
  7511. for(var i in this.workForm.domains) {
  7512. // 检查任务/里程碑是否为必填
  7513. let taskRequired = this.user.timeType.taskRequired
  7514. if(taskRequired == 1) {
  7515. if(!this.workForm.domains[i].taskId) {
  7516. this.$message({
  7517. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7518. type: "error"
  7519. });
  7520. return
  7521. }
  7522. }
  7523. if(this.user.timeType.reportAuditType == 3){
  7524. let audItem = {}
  7525. let auditRule = ''
  7526. if(this.workForm.domains[i].id){
  7527. audItem.reportId = this.workForm.domains[i].id
  7528. }
  7529. if(this.user.timeType.auditLevel > 0){
  7530. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7531. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7532. }
  7533. if(this.user.timeType.auditLevel > 1){
  7534. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7535. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7536. }
  7537. if(this.user.timeType.auditLevel > 2){
  7538. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7539. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7540. }
  7541. if(this.workForm.domains[i].ccUserid){
  7542. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7543. }
  7544. if(auditRule){
  7545. auditRule = auditRule.substring(0,auditRule.length - 1)
  7546. this.$message({
  7547. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7548. type: 'error'
  7549. })
  7550. return
  7551. }
  7552. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7553. }
  7554. if (this.user.timeType.customDegreeActive) {
  7555. if (this.user.timeType.customDegreeMultiple) {
  7556. //多选
  7557. if (this.workForm.domains[i].multiDegrIdArray) {
  7558. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7559. degreeArray = degreeArray.replace(/,/g,"@");
  7560. formData.append("multiDegrId", degreeArray);
  7561. } else {
  7562. formData.append("multiDegrId", '[]');
  7563. }
  7564. } else {
  7565. //单选
  7566. if (this.workForm.domains[i].degreeId) {
  7567. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7568. } else {
  7569. formData.append("degreeId", -1);
  7570. }
  7571. }
  7572. } else {
  7573. formData.append("degreeId", -1);
  7574. }
  7575. if(this.workForm.domains[i].customData) {
  7576. // var sss = this.workForm.domains[i].degreeId.toString()
  7577. formData.append("customData", this.workForm.domains[i].customData);
  7578. } else {
  7579. formData.append("customData", 0);
  7580. }
  7581. if(this.workForm.domains[i].customText) {
  7582. formData.append("customText", this.workForm.domains[i].customText);
  7583. } else {
  7584. formData.append("customText", '-');
  7585. }
  7586. if (this.workForm.domains[i].id) {
  7587. formData.append("id", this.workForm.domains[i].id);
  7588. } else {
  7589. formData.append("id", -1);
  7590. }
  7591. formData.append("projectId", this.workForm.domains[i].projectId);
  7592. if (this.workForm.domains[i].subProjectId) {
  7593. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7594. } else {
  7595. formData.append("subProjectId", 0);
  7596. }
  7597. if (this.workForm.domains[i].groupId) {
  7598. formData.append("groupId", this.workForm.domains[i].groupId);
  7599. } else {
  7600. formData.append("groupId", 0);
  7601. }
  7602. if (this.workForm.domains[i].taskId) {
  7603. formData.append("taskId", this.workForm.domains[i].taskId);
  7604. } else {
  7605. formData.append("taskId", 0);
  7606. }
  7607. if (this.workForm.domains[i].taskFinish == true) {
  7608. formData.append("taskFinish", 1);
  7609. } else {
  7610. formData.append("taskFinish", 0);
  7611. }
  7612. formData.append("reportTimeType", this.reportTimeType.type);
  7613. if (this.reportTimeType.type == 0) {
  7614. formData.append("timeType", this.workForm.domains[i].timeType);
  7615. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7616. formData.append("workingTime", workingTime);
  7617. } else if (this.reportTimeType.type == 1){
  7618. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7619. } else if (this.reportTimeType.type == 2) {
  7620. formData.append("endTime", this.workForm.domains[i].endTime);
  7621. formData.append("startTime", this.workForm.domains[i].startTime);
  7622. } else if (this.reportTimeType.type == 3) {
  7623. //按比例分配
  7624. formData.append("progress", this.workForm.domains[i].progress);
  7625. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7626. }
  7627. if(this.user.timeType.choseFromAlbum == 1 ) {
  7628. console.log(this.workForm.domains[i].imgList)
  7629. if(this.workForm.domains[i].imgList) {
  7630. let imgListFor = this.workForm.domains[i].imgList
  7631. for(var b in imgListFor) {
  7632. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7633. }
  7634. console.log(imgListFor)
  7635. let m = JSON.stringify(imgListFor);
  7636. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7637. formData.append("picStr", m);
  7638. } else {
  7639. formData.append("picStr", '[]');
  7640. }
  7641. }
  7642. //处理多个时间事项
  7643. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7644. if (this.reportTimeType.multiWorktime == 1) {
  7645. //检查时间是否有重叠
  7646. var workList = this.workForm.domains[i].worktimeList;
  7647. for (var j=0;j<workList.length; j++) {
  7648. var curItem = workList[j];
  7649. //检查开始时间是否大于结束时间
  7650. if (curItem.startTime >= curItem.endTime) {
  7651. this.$message({
  7652. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7653. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7654. type: "error"
  7655. });
  7656. return;
  7657. }
  7658. //时间不可重叠
  7659. if (this.reportTimeType.timeCanOverlap == 0) {
  7660. for (var p = j+1;p<workList.length; p++) {
  7661. var jItem = workList[p];
  7662. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7663. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7664. this.$message({
  7665. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7666. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7667. type: "error"
  7668. });
  7669. return;
  7670. }
  7671. }
  7672. }
  7673. }
  7674. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7675. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7676. formData.append("content", m);
  7677. } else {
  7678. if (this.workForm.domains[i].content) {
  7679. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7680. m = m.replace(/,/g,",");
  7681. console.log(m, '需要传值的数据')
  7682. // formData.append("content", this.workForm.domains[i].content);
  7683. formData.append("content", m);
  7684. } else {
  7685. formData.append("content", '-');
  7686. }
  7687. }
  7688. if (this.isBatch == 0) {
  7689. formData.append("createDate", this.workForm.createDate);
  7690. } else {
  7691. //批量填报,时间范围
  7692. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7693. }
  7694. if(this.workForm.domains[i].isOvertime) {
  7695. formData.append("isOvertime", 1);
  7696. } else {
  7697. formData.append("isOvertime", 0);
  7698. }
  7699. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7700. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7701. } else {
  7702. formData.append("overtimeHours", 0);
  7703. }
  7704. if(this.workForm.domains[i].basecostId) {
  7705. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7706. } else {
  7707. formData.append("basecostId", 0);
  7708. }
  7709. if (this.workForm.userId != null) {
  7710. var targetUids = '';
  7711. this.workForm.userId.forEach(u=>{
  7712. targetUids += u + '@';
  7713. });
  7714. if (targetUids.length > 0) {
  7715. targetUids = targetUids.substring(0, targetUids.length -1);
  7716. formData.append("targetUids", targetUids);
  7717. }
  7718. }
  7719. //项目专业进度
  7720. if (this.workForm.domains[i].professionProgress) {
  7721. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7722. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7723. formData.append("professionProgress", m);
  7724. } else {
  7725. formData.append("professionProgress", "[]");
  7726. }
  7727. if (this.workForm.domains[i].stage) {
  7728. formData.append("stage", this.workForm.domains[i].stage);
  7729. } else {
  7730. formData.append("stage", "-");
  7731. }
  7732. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7733. if (this.workForm.domains[i].projectAuditorId) {
  7734. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7735. } else {
  7736. // console.log('执行到了这里')
  7737. // console.log(this.user.timeType.reportAuditType)
  7738. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7739. this.$message({
  7740. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7741. type: "error"
  7742. });
  7743. return;
  7744. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7745. //分组负责人先审核, 确定是选择了任务分组
  7746. if (this.workForm.domains[i].taskGroups.length == 0) {
  7747. this.$message({
  7748. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7749. type: "error"
  7750. });
  7751. } else if (!this.workForm.domains[i].groupId) {
  7752. // console.log(this.workForm.domains[i]);
  7753. this.$message({
  7754. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7755. type: "error"
  7756. });
  7757. } else {
  7758. this.$message({
  7759. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7760. type: "error"
  7761. });
  7762. }
  7763. return;
  7764. }
  7765. }
  7766. if (this.user.companyId == this.yuzhongCompId) {
  7767. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7768. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7769. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7770. }
  7771. //依斯贝的服务Id
  7772. if (this.user.companyId == this.yisibeiCompId) {
  7773. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7774. }
  7775. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7776. this.$message({
  7777. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7778. type: "error"
  7779. });
  7780. return
  7781. }
  7782. }
  7783. this.submitingReport = true;
  7784. this.http.uploadFile( this.port.report.editPort, formData,
  7785. res => {
  7786. this.listLoading = false;
  7787. this.submitingReport = false;
  7788. if (res.code == "ok") {
  7789. if(res.msg!=null){
  7790. this.$message({
  7791. dangerouslyUseHTMLString: true,
  7792. message: res.msg,
  7793. type: "warning",
  7794. showClose: true,
  7795. duration: 0
  7796. });
  7797. }else{
  7798. this.$message({
  7799. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7800. type: "success"
  7801. });
  7802. }
  7803. this.dialogVisible = false;
  7804. this.jsDay = 0
  7805. this.jsTime = 0
  7806. this.getReportList();
  7807. this.getDepartment();
  7808. this.getRecentlyProject()
  7809. } else {
  7810. this.$message({
  7811. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7812. type: "error"
  7813. });
  7814. }
  7815. },
  7816. error => {
  7817. this.listLoading = false;
  7818. this.submitingReport = false;
  7819. this.$message({
  7820. message: error,
  7821. type: "error"
  7822. });
  7823. });
  7824. },
  7825. // 判断是展示那个工时导入
  7826. imports() {
  7827. if(this.user.timeType.syncCorpwxTime == 0) {
  7828. this.importDialog = true
  7829. } else {
  7830. this.importWxDialog = true
  7831. }
  7832. },
  7833. // 跳转
  7834. junpToDeskTop(id) {
  7835. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7836. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7837. },
  7838. // 通过日报
  7839. approve(id, item) {
  7840. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7841. this.approveinData = {
  7842. id: id,
  7843. date: this.date +day,
  7844. reportIds: item.id
  7845. }
  7846. if(this.user.timeType.needEvaluate == 1){
  7847. this.$set(this.approveinData,'evaluate','')
  7848. this.approveinDialog = true
  7849. }else{
  7850. this.logining = true;
  7851. this.approveinfun()
  7852. }
  7853. },
  7854. approveinfun(){
  7855. this.http.post( this.port.report.approve, this.approveinData,
  7856. res => {
  7857. this.logining = false;
  7858. if (res.code == "ok") {
  7859. this.approveinDialog = false
  7860. this.$message({
  7861. message: this.$t('message.Reviewsucceeded'),
  7862. type: "success"
  7863. });
  7864. this.refreshReportData(this.approveinData.reportIds);
  7865. this.getDepartment();
  7866. } else {
  7867. this.$message({
  7868. message: res.msg,
  7869. type: "error"
  7870. });
  7871. }
  7872. },
  7873. error => {
  7874. this.logining = false;
  7875. this.$message({
  7876. message: error,
  7877. type: "error"
  7878. });
  7879. });
  7880. },
  7881. //撤回日报
  7882. cancel(item,e) {
  7883. // console.log('can can need',item);
  7884. this.logining = true;
  7885. var ids = '';
  7886. var data = e ? item : item.data;
  7887. data.forEach(element => {
  7888. if(element.id){
  7889. ids +=(element.id+',');
  7890. }
  7891. });
  7892. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7893. res => {
  7894. this.logining = false;
  7895. if (res.code == "ok") {
  7896. this.$message({
  7897. message:this.$t('message.Withdrawalsucceeded'),
  7898. type: "success"
  7899. });
  7900. this.getReportList();
  7901. if(e){this.getReport()}
  7902. this.getDepartment();
  7903. } else {
  7904. this.$message({
  7905. message: res.msg,
  7906. type: "error"
  7907. });
  7908. }
  7909. },
  7910. error => {
  7911. this.logining = false;
  7912. this.$message({
  7913. message: error,
  7914. type: "error"
  7915. });
  7916. });
  7917. },
  7918. showDenyDialog(id,i, item) {
  7919. this.denyReasonDialog = true;
  7920. this.isDenying = false;
  7921. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7922. var ids = item.id;
  7923. // var data = item.data;
  7924. // data.forEach(element => {
  7925. // ids +=(element.id+',');
  7926. // });
  7927. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7928. },
  7929. // 未通过日报
  7930. deny() {
  7931. this.logining = true;
  7932. this.isDenying = true;
  7933. this.http.post( this.port.report.deny, this.denyForm,
  7934. res => {
  7935. this.logining = false;
  7936. this.isDenying = false;
  7937. if (res.code == "ok") {
  7938. this.$message({
  7939. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7940. type: "success"
  7941. });
  7942. this.refreshReportData(this.denyForm.reportIds);
  7943. this.getDepartment();
  7944. this.denyReasonDialog = false;
  7945. } else {
  7946. this.$message({
  7947. message: res.msg,
  7948. type: "error"
  7949. });
  7950. }
  7951. },
  7952. error => {
  7953. this.logining = false;
  7954. this.$message({
  7955. message: error,
  7956. type: "error"
  7957. });
  7958. });
  7959. },
  7960. // 查看工时记录弹窗
  7961. toView() {
  7962. this.toViewDialogVisible = true
  7963. this.toViewloading = true
  7964. this.getToView()
  7965. },
  7966. getToView() {
  7967. this.http.post( '/report-import-log/getList', this.toViewForm,
  7968. res => {
  7969. this.toViewloading = false;
  7970. if (res.code == "ok") {
  7971. // console.log(res.data, '数据数据')
  7972. this.toViewList = res.data.records
  7973. this.toViewForm.total = res.data.total
  7974. } else {
  7975. this.toViewloading = false;
  7976. this.$message({
  7977. message: res.msg,
  7978. type: "error"
  7979. });
  7980. }
  7981. })
  7982. },
  7983. // 触发 selectCat 组件更改他的值
  7984. selectCatCli(obj) {
  7985. // console.log(obj, '看看')
  7986. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7987. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7988. },
  7989. vueCasader(obj) {
  7990. console.log(obj, '看看值')
  7991. if(obj.distinction == 1 && obj.item) {
  7992. let arr = []
  7993. arr.push(obj.item.value)
  7994. this.exportParam.departmentId = arr
  7995. }
  7996. },
  7997. //分页
  7998. handleCurrentChange(val) {
  7999. this.toViewForm.pageIndex = val;
  8000. this.getToView();
  8001. },
  8002. handleSizeChange(val) {
  8003. this.toViewForm.pageSize = val;
  8004. this.getToView();
  8005. },
  8006. getAllUsersList(){
  8007. this.http.post('/user/getSimpleActiveUserList',{
  8008. },res => {
  8009. if(res.code == 'ok'){
  8010. this.allUsersList = res.data
  8011. }else{
  8012. this.$message({
  8013. message: res.msg,
  8014. type: 'error'
  8015. })
  8016. }
  8017. },err => {
  8018. this.$message({
  8019. message: err,
  8020. type: 'error'
  8021. })
  8022. })
  8023. },
  8024. //景昱变更提醒
  8025. changeReminder(item){
  8026. console.log("============",item)
  8027. let parameter={}
  8028. if(item){
  8029. parameter={
  8030. createDate:item.createDate,
  8031. userId:item.userId,
  8032. }
  8033. }
  8034. this.http.post('/report/changeReminder',parameter,res => {
  8035. if(res.code == 'ok'){
  8036. this.$message({
  8037. message: res.msg,
  8038. type: 'success'
  8039. })
  8040. }else{
  8041. this.$message({
  8042. message: res.msg,
  8043. type: 'error'
  8044. })
  8045. }
  8046. },err => {
  8047. this.$message({
  8048. message: err,
  8049. type: 'error'
  8050. })
  8051. })
  8052. },
  8053. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8054. fillWeekCustomClne() {
  8055. this.fillWeekDialogVisiCustom = false
  8056. },
  8057. fillWeekCustomSubmit() {
  8058. this.getReportList();
  8059. this.getDepartment();
  8060. this.getRecentlyProject()
  8061. },
  8062. // 待填日报姓名搜索
  8063. nameAearchSeek(flg) {
  8064. if(!this.nameAearch) {
  8065. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8066. return
  8067. }
  8068. if(flg) {
  8069. this.enterpriseWechatgetUser()
  8070. }
  8071. },
  8072. handleThreeData(userList) {
  8073. console.log(userList, '人员数据')
  8074. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8075. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8076. },
  8077. // 过滤树节点
  8078. filterTreeNodes(treeData, filterKeywords) {
  8079. return treeData.filter((node) => {
  8080. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8081. if (node.children && node.children.length > 0) {
  8082. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8083. }
  8084. return true;
  8085. }
  8086. if (node.children && node.children.length > 0) {
  8087. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8088. return node.children.length > 0;
  8089. }
  8090. return false;
  8091. });
  8092. },
  8093. // 企业微信获取人员
  8094. enterpriseWechatgetUser() {
  8095. this.deptMembDataLoading = true
  8096. this.http.post('/user/getEmployeeList',{
  8097. departmentId: -1,
  8098. pageIndex: 1,
  8099. pageSize: 100,
  8100. keyword: this.nameAearch,
  8101. status: '',
  8102. roleId: '',
  8103. cursor: '',
  8104. onlyDirect: '',
  8105. matchingType: ''
  8106. },res => {
  8107. if(res.code == 'ok'){
  8108. this.deptMembDataLoading = false
  8109. const userListName = res.data.records.map(item => item.name)
  8110. this.handleThreeData(userListName)
  8111. }else{
  8112. this.deptMembDataLoading = false
  8113. this.$message({
  8114. message: res.msg,
  8115. type: 'error'
  8116. })
  8117. }
  8118. },err => {
  8119. this.deptMembDataLoading = false
  8120. this.$message({
  8121. message: err,
  8122. type: 'error'
  8123. })
  8124. })
  8125. },
  8126. // 按周填报获取相关任务
  8127. async getWeeklyTaskList(item) {
  8128. console.log(item, '<=== 数据')
  8129. const { projectId, groupId, stage, taskId } = item
  8130. console.log(projectId, groupId, stage)
  8131. let parms = { projectId, isSubstitude: 0 }
  8132. groupId ? parms.groupId = groupId : ''
  8133. stage ? parms.stage = stage : ''
  8134. const { data } = await this.postData('/task/getRecentTask', parms)
  8135. this.zhoBao.taskId = taskId
  8136. this.$set(this.zhoBao, 'taskList', data)
  8137. console.log(this.zhoBao)
  8138. },
  8139. // 封装 post 请求
  8140. postData(url, params) {
  8141. return new Promise((resolve, reject) => {
  8142. this.http.post(url, { ...params },
  8143. res => {
  8144. resolve(res)
  8145. },
  8146. error => {
  8147. this.$message({
  8148. message: error,
  8149. type: "error"
  8150. });
  8151. reject(error)
  8152. })
  8153. })
  8154. },
  8155. // 自定义事件
  8156. selectCal(obj) {
  8157. console.log(obj, '传数据来源')
  8158. if(obj.distinction == '1') {
  8159. this.zhoBao.projectAuditorId = obj.id
  8160. } else if(obj.distinction == '2') {
  8161. this.zhoBao.auditorFirst = obj.id
  8162. } else if(obj.distinction == '3') {
  8163. this.zhoBao.auditorSec = obj.id
  8164. } else if(obj.distinction == '4') {
  8165. this.zhoBao.auditorThird = obj.id
  8166. } else if(obj.distinction == '5') {
  8167. this.zhoBao.ccUserid = obj.id
  8168. } else if(obj.distinction == '12') {
  8169. this.usersListId = obj.id
  8170. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8171. this.searchKeyword = obj.name
  8172. } else {
  8173. this.searchKeyword = ''
  8174. }
  8175. this.searchScreen(0)
  8176. } else if(obj.distinction == '13') {
  8177. this.usersListId = obj.id
  8178. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8179. this.searchKeyword = obj.name
  8180. } else {
  8181. this.searchKeyword = ''
  8182. }
  8183. this.searchScreen(1)
  8184. }
  8185. }
  8186. },
  8187. created() {
  8188. this.getUsers()
  8189. let height = window.innerHeight;
  8190. this.tableHeight = height - 178;
  8191. const that = this;
  8192. window.onresize = function temp() {
  8193. that.tableHeight = window.innerHeight - 178;
  8194. };
  8195. this.toViewForm.companyId = this.user.companyId
  8196. this.initDrag([{
  8197. type: "LR",
  8198. domClass: {
  8199. // 中间分割线的名字
  8200. resize: "line-line",
  8201. // 左侧盒子的名字
  8202. left: "box-left",
  8203. // 右侧盒子的名字
  8204. right: "box-right",
  8205. // 父级的名字
  8206. box: "box-father",
  8207. },
  8208. otherInfo: {
  8209. // 限制左边栏最低宽度
  8210. leftWidth: 120,
  8211. },
  8212. },
  8213. {
  8214. type: "LR",
  8215. domClass: {
  8216. // 中间分割线的名字
  8217. resize: "line-second",
  8218. // 左侧盒子的名字
  8219. left: "left-laowang",
  8220. // 右侧盒子的名字
  8221. right: "box-second-father",
  8222. // 父级的名字
  8223. box: "grand",
  8224. },
  8225. otherInfo: {
  8226. // 限制左边栏最低宽度
  8227. leftWidth: 120,
  8228. },
  8229. },
  8230. ]);
  8231. }
  8232. };
  8233. </script>
  8234. <style lang="scss" scoped>
  8235. .fillWeekDialogVisiCustom {
  8236. width: 100%;
  8237. height: 70vh;
  8238. }
  8239. .fillWeekCustom {
  8240. .el-dialog__body {
  8241. padding: 20px 20px !important;
  8242. }
  8243. }
  8244. .photos {
  8245. position: relative;
  8246. display: flex;
  8247. flex-wrap: wrap;
  8248. }
  8249. .photos_img {
  8250. width: 120px;
  8251. height: 120px;
  8252. margin-right: 20px;
  8253. margin-bottom: 20px;
  8254. cursor: pointer;
  8255. img {
  8256. width: 100%;
  8257. height: 100%;
  8258. }
  8259. }
  8260. .paginatis {
  8261. padding: 10px 10px;
  8262. background: #f2f2f2;
  8263. }
  8264. .waiting {
  8265. color:orange;
  8266. }
  8267. .filledReportStyle {
  8268. color:#32CD32;
  8269. }
  8270. .RejectStyle {
  8271. color:red;
  8272. }
  8273. .waitSubmitStyle{
  8274. color: #409eff;
  8275. }
  8276. .chooseDate {
  8277. .waiting {
  8278. color: #20a0ff;
  8279. }
  8280. .filledReportStyle {
  8281. color:#20a0ff;
  8282. }
  8283. .RejectStyle {
  8284. color: #20a0ff;
  8285. }
  8286. .waitSubmitStyle{
  8287. color: #20a0ff;
  8288. }
  8289. }
  8290. .allDaily {
  8291. width:100%;
  8292. }
  8293. .report_title {
  8294. padding:10px 0;
  8295. color:#666;
  8296. }
  8297. .clearfix {
  8298. overflow-x: auto;
  8299. white-space: nowrap;
  8300. padding: 15px 0 10px 0;
  8301. // overflow-y: hidden;
  8302. .date_item {
  8303. padding: 0 3px;
  8304. cursor: pointer;
  8305. position: relative;
  8306. }
  8307. .chooseDate {
  8308. position: absolute;
  8309. bottom: -3px;
  8310. width: 37px;
  8311. height: 2px;
  8312. left: 14px;
  8313. background: #20a0ff;
  8314. }
  8315. }
  8316. .one_daily {
  8317. i {
  8318. color: #9ed0ff;
  8319. margin-right: 5px;
  8320. }
  8321. .one_daily_body {
  8322. padding: 10px 0px;
  8323. p {
  8324. margin: 0;
  8325. line-height: 30px;
  8326. }
  8327. }
  8328. ul {
  8329. padding: 0;
  8330. }
  8331. }
  8332. .checkbtn {
  8333. float: right;
  8334. margin-top: -10px;
  8335. }
  8336. .selConStyle{
  8337. margin-top:9rem;
  8338. margin-bottom:11rem;
  8339. .selConStyle_title{
  8340. height: 3rem;
  8341. text-align: center;
  8342. font-size: 17px;
  8343. }
  8344. .el-select{
  8345. margin: 0 15%;
  8346. width: 70%;
  8347. }
  8348. }
  8349. </style>
  8350. <style lang="scss">
  8351. /*去除upload组件过渡效果*/
  8352. .photos .el-upload-list__item {
  8353. transition: none !important;
  8354. }
  8355. .daily {
  8356. .el-card__body {
  8357. height: 80%;
  8358. overflow-y: auto;
  8359. }
  8360. .el-card__header {
  8361. padding: 0 20px;
  8362. }
  8363. }
  8364. .membListClass{
  8365. .el-dialog__body{
  8366. padding-top: 10px;
  8367. }
  8368. }
  8369. // .editReportDialog .el-dialog__footer{
  8370. // position: sticky;
  8371. // bottom: 0;
  8372. // background: #fff;
  8373. // height: 70px;
  8374. // z-index: 1010;
  8375. // }
  8376. .editReportDialog{
  8377. min-width: 800px;
  8378. }
  8379. .touruxiangmu{
  8380. max-width: 1000px;
  8381. }
  8382. </style>
  8383. <style scoped>
  8384. /* 项目标签的样式 */
  8385. .el-tag + .el-tag {
  8386. margin-left: 10px;
  8387. }
  8388. .button-new-tag {
  8389. margin-left: 10px;
  8390. height: 32px;
  8391. line-height: 30px;
  8392. padding-top: 0;
  8393. padding-bottom: 0;
  8394. }
  8395. .input-new-tag {
  8396. width: 90px;
  8397. margin-left: 10px;
  8398. vertical-align: bottom;
  8399. }
  8400. .selectworktime .el-table__fixed-body-wrapper{
  8401. top: 48px !important;
  8402. }
  8403. .selectworktime_export .selectworktime_export_l{
  8404. width: 650px;
  8405. float: left;
  8406. height: 42px;
  8407. }
  8408. .approvalProcessBox{
  8409. margin-left: 30px;
  8410. font-size: 14px;
  8411. line-height: 16px;
  8412. cursor: pointer;
  8413. }
  8414. .approvalProcessBox i {
  8415. margin-right: 0;
  8416. height: 16px;
  8417. width: 16px;
  8418. display: inline-block;
  8419. transform: scale(1.2);
  8420. position: relative;
  8421. top: 0.5px;
  8422. color: #409eff;
  8423. }
  8424. .approvalProcessBox .approvalProcessClick{
  8425. cursor: pointer;
  8426. color: #409eff;
  8427. font-size: 14px;
  8428. }
  8429. .approvalProcessBox:hover .approvalProcessClick{
  8430. color: #3485fb;
  8431. }
  8432. </style>
  8433. <style lang="scss" scoped>
  8434. // 加班样式
  8435. .overtime {
  8436. display: inline-block;
  8437. margin-left: 20px;
  8438. input {
  8439. display: inline-block;
  8440. margin-top: 5px;
  8441. }
  8442. }
  8443. .plus {
  8444. display: inline-block;
  8445. }
  8446. // .tages {
  8447. // float: right;
  8448. // }
  8449. .overtime {
  8450. display: inline-block;
  8451. margin-left: 30px;
  8452. }
  8453. .bloks {
  8454. display: inline-block;
  8455. width: 380px;
  8456. }
  8457. .zhiss {
  8458. display: flex;
  8459. justify-content: space-around;
  8460. align-items: center;
  8461. }
  8462. .zhoFel {
  8463. display: flex;
  8464. justify-content: space-between;
  8465. align-items: center;
  8466. }
  8467. // 左右滑动样式
  8468. .line {
  8469. width: 30px;
  8470. /* height: 500px; */
  8471. background: #f2f2f2;
  8472. cursor: w-resize;
  8473. }
  8474. .box-father {
  8475. border: 8px solid #000;
  8476. }
  8477. .line-second {
  8478. width: 10px;
  8479. /* background: red; */
  8480. }
  8481. .flex {
  8482. display: flex;
  8483. width: 100%;
  8484. }
  8485. .box-left {
  8486. flex: 0 0 400px;
  8487. /* height: 600px; */
  8488. /* background: blue; */
  8489. }
  8490. .box-right {
  8491. /* height: 600px; */
  8492. /* background: green; */
  8493. flex: 1;
  8494. }
  8495. .box-postion {
  8496. width: 200px;
  8497. /* height: 400px; */
  8498. background: #ccc;
  8499. }
  8500. .custom-tree-node {
  8501. flex: 1;
  8502. display: flex;
  8503. align-items: center;
  8504. justify-content: space-between;
  8505. font-size: 14px;
  8506. padding-right: 8px;
  8507. }
  8508. .daitianrbao {
  8509. width: 100%;
  8510. box-sizing: border-box;
  8511. height: 40px;
  8512. border-radius: 4px;
  8513. border: 1px solid #DCDFE6;
  8514. overflow: hidden;
  8515. text-overflow: ellipsis;
  8516. display: flex;
  8517. // align-items: center;
  8518. }
  8519. .daitianrbao .spnn {
  8520. display: inline-block;
  8521. box-sizing: border-box;
  8522. padding: 0 15px;
  8523. overflow: hidden;
  8524. text-overflow: ellipsis;
  8525. }
  8526. .daitianrbao .hover {
  8527. color: #DCDFE6 !important;
  8528. }
  8529. </style>