daily.vue 447 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  175. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <el-button 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>
  252. <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"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <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"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <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"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <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>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <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>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <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>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <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>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <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>
  327. <!-- 简陋的无报告提示 -->
  328. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </el-card>
  335. </div>
  336. <!-- 工时推送日志弹窗 -->
  337. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  338. <template>
  339. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  340. </template>
  341. <template>
  342. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  343. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  344. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  345. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  346. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  347. <el-table-column prop="result" label="推送结果" width="250">
  348. <template slot-scope="scope">
  349. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  350. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  354. </el-table>
  355. </template>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  358. </span>
  359. </el-dialog>
  360. <!-- 填写日报的dialog -->
  361. <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">
  362. <div style="height: 65vh;overflow: auto;">
  363. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  364. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  365. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  366. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  367. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  368. <span class="spnn" v-if="workForm.userNames">
  369. <span v-for="(item, index) in workForm.userNames" :key="index">
  370. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  371. <span v-if="index < workForm.userNames.length - 1">,</span>
  372. </span>
  373. </span>
  374. <span class="spnn hover" v-else>
  375. {{$t('defaultText.pleaseSelectAsubstitute')}}
  376. </span>
  377. </div>
  378. </el-form-item>
  379. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  380. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  381. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  382. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  383. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  384. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  385. <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>
  386. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  387. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  389. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  390. <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>
  391. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  392. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  393. </span>
  394. <!--批量填报和批量代填不显示考勤记录-->
  395. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  396. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  397. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  400. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  403. @click="refreshAttendance(workForm.createDate)"></el-button>
  404. <!-- AI智能填报 -->
  405. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  406. </el-form-item>
  407. <!-- 000000 -->
  408. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  409. <div v-if="reportTimeType.multiWorktime==0">
  410. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  411. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  412. <el-select v-model="domain.timeType" style="width:200px;"
  413. v-if="reportTimeType.type == 0"
  414. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  416. @change="onTimeTypeChange(domain.timeType)">
  417. <el-option
  418. v-for="item in timeType"
  419. :key="item.value"
  420. :label="item.label"
  421. :value="item.value">
  422. </el-option>
  423. </el-select>
  424. <!-- 数字时长选择 -->
  425. <el-select v-model="domain.workingTime" style="width:200px;"
  426. v-if="reportTimeType.type == 1"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  429. @change="seleChn(0,domain)">
  430. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  431. </el-select>
  432. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  433. <span v-if="reportTimeType.type == 2">
  434. <!--时间范围选择 -->
  435. <el-time-picker
  436. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  437. v-model="domain.startTime"
  438. :placeholder="$t('time.startTime')"
  439. style="width:120px;"
  440. format="HH:mm"
  441. value-format="HH:mm"
  442. :picker-options="{
  443. start: '08:00',
  444. end: '23:30'
  445. }"
  446. @change="iptChang()">
  447. </el-time-picker> - <el-time-picker
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  449. v-model="domain.endTime"
  450. :placeholder="$t('time.endTime')"
  451. style="width:120px;"
  452. format="HH:mm"
  453. value-format="HH:mm"
  454. :picker-options="{
  455. start: '08:00',
  456. end: '23:30',
  457. minTime: domain.startTime
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker>
  461. </span>
  462. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  463. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  464. <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>
  465. </div>
  466. </el-form-item>
  467. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  468. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  469. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  470. @change="selectProject(domain, index)"
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  472. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  473. <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">
  474. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  475. <span style="float: right;">{{ item.projectName }}</span>
  476. </el-option>
  477. </el-option-group>
  478. </el-select>
  479. <!--昱众不显示子项目-->
  480. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  481. <span style="margin-left:45px;">
  482. {{$t('lable.subproject')}}</span>
  483. <!--子项目 -->
  484. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  486. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. <template v-if="user.companyId == yuzhongCompId">
  490. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  491. <!--角色选择 -->
  492. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  493. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  494. <el-option
  495. v-for="item in roleList"
  496. :key="item.value"
  497. :label="item.label"
  498. :value="item.value">
  499. </el-option>
  500. </el-select>
  501. </template>
  502. <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%;"
  503. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  504. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  505. </el-link>
  506. <!-- <el-link type="primary" v-if="canEdit"
  507. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  508. </el-form-item>
  509. <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">
  510. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  511. </el-form-item>
  512. <!--如果设置了工时成本预警的预算成本项-->
  513. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  514. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  515. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  519. <template slot="label">
  520. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  521. <span >{{$t('lable.taskGrouping')}}</span>
  522. </template>
  523. <!-- 任务分组 -->
  524. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  526. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  527. </el-select>
  528. <template v-if="user.companyId == yuzhongCompId">
  529. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  530. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  531. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  532. <el-option
  533. v-for="item in domain.filteredRespList"
  534. :key="item.id"
  535. :label="item.jobRespon"
  536. :value="item.id">
  537. </el-option>
  538. </el-select>
  539. </template>
  540. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  541. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  542. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  543. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  544. @change="changeStages(domain, index)"
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  546. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  547. </el-select>
  548. </template>
  549. </el-form-item>
  550. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  551. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  552. <template slot="label">
  553. <span style="color:#FF0000;">*</span>
  554. <span >{{$t('other.projectAuditor')}}</span>
  555. </template>
  556. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  557. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  558. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  559. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  560. </el-option>
  561. </el-select>
  562. <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>
  563. </el-form-item>
  564. </div>
  565. <el-form-item v-if="user.companyId == yuzhongCompId">
  566. <template slot="label">
  567. <span style="color:#FF0000;">*</span>
  568. <span >工作内容</span>
  569. </template>
  570. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  571. :disabled="(workForm.domains[index].state>=2?false:true)" >
  572. <el-option
  573. v-for="item in domain.workContentList"
  574. :key="item.id"
  575. :label="item.workContext"
  576. :value="item.id">
  577. </el-option>
  578. </el-select>
  579. </el-form-item>
  580. <!-- 111111 -->
  581. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  582. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  583. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  584. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  585. <span v-else>{{item.name}}</span>
  586. </el-option>
  587. </el-select>
  588. <template v-if="user.timeType.auditLevel > 1">
  589. <i class="el-icon-right"></i>
  590. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. </template>
  597. <template v-if="user.timeType.auditLevel > 2">
  598. <i class="el-icon-right"></i>
  599. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. </template>
  606. </el-form-item>
  607. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <!-- 相关维度/自定义维度 -->
  616. <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'">
  617. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  618. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <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'">
  623. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  624. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  625. </el-option>
  626. </el-select>
  627. </el-form-item>
  628. <!-- 相关数值 -->
  629. <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">
  630. <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>
  631. </el-form-item>
  632. <!-- 自定义文本 -->
  633. <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">
  634. <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>
  635. </el-form-item>
  636. <!--按比例填报-->
  637. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  638. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  639. <div style="width:400px;">
  640. <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>
  641. <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>
  642. </div>
  643. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  644. <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>
  645. </div>
  646. </el-form-item>
  647. <!--工程专业版本模式下, 各个专业的进度填报 -->
  648. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  649. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  650. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  651. <el-input size="mini" style="width:60px;" v-model="item.progress"
  652. @keyup.native="onProgressChange"
  653. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  654. </span>
  655. </el-form-item>
  656. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  657. <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))" >
  658. <template slot="label" v-if="user.timeType.taskRequired == 1">
  659. <span style="color:#FF0000;">*</span>
  660. <span >任务</span>
  661. </template>
  662. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  664. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  665. </el-select>
  666. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  667. </el-form-item>
  668. <!--针对依斯贝的SAP服务-->
  669. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  670. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  671. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  673. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  674. </el-select>
  675. </el-form-item>
  676. <!--工作事项-->
  677. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  681. </el-form-item>
  682. <!-- 拍照上传 -->
  683. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  684. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  685. <div class="photos">
  686. <div>
  687. <el-upload
  688. list-type="picture-card"
  689. :http-request="(file) => {return addImg(file, index)}"
  690. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  691. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  692. :file-list="domain.imgListUrl" :limit="9"
  693. :disabled="workForm.domains[index].state>=2?false:true">
  694. <i class="el-icon-plus"></i>
  695. </el-upload>
  696. </div>
  697. </div>
  698. </el-form-item>
  699. </div>
  700. <!--多个工作事项填报的情况 -->
  701. <div v-if="reportTimeType.multiWorktime==1">
  702. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  703. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  704. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  705. @change="selectProject(domain, index)"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  707. <!-- <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">
  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 v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  712. <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">
  713. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  714. <span style="float: right;">{{ item.projectName }}</span>
  715. </el-option>
  716. </el-option-group>
  717. </el-select>
  718. <template v-if="user.timeType.mainProjectState != 1">
  719. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  721. <!--子项目 -->
  722. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  723. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  725. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  726. </el-select>
  727. </template>
  728. <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;"
  729. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  730. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  731. </el-link>
  732. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  733. <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>
  734. </div>
  735. <!-- <el-link type="primary" v-if="canEdit"
  736. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  737. </el-form-item>
  738. <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">
  739. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  740. </el-form-item>
  741. <!--如果设置了工时成本预警的预算成本项-->
  742. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  743. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  744. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  745. </el-select>
  746. </el-form-item>
  747. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  748. <!-- 任务分组 -->
  749. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  751. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. <!-- 项目的阶段 -->
  754. <span v-if="domain.stages != null && domain.stages.length> 0"
  755. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  756. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  757. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  758. @change="changeStages(domain, index)"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectAuditor')" >
  764. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  765. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  766. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  767. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  768. </el-option>
  769. </el-select>
  770. <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>
  771. </el-form-item>
  772. <!--工程专业版本模式下, 各个专业的进度填报 -->
  773. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  774. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  775. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  776. <el-input size="mini" style="width:60px;" v-model="item.progress"
  777. @keyup.native="onProgressChange"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  779. </span>
  780. </el-form-item>
  781. <!-- 相关维度 -->
  782. <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'">
  783. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  788. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  789. </el-option>
  790. </el-select>
  791. </el-form-item>
  792. <!-- 相关数值 -->
  793. <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">
  794. <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>
  795. </el-form-item>
  796. <!-- 自定义文本 -->
  797. <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">
  798. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  799. </el-form-item>
  800. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  801. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  802. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  803. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  804. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  805. </el-select>
  806. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  807. </el-form-item>
  808. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  809. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  810. <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>
  811. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  812. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  813. <span v-if="reportTimeType.type == 2">
  814. <!-- <span> -->
  815. <!--时间范围选择 -->
  816. <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.startTime"
  819. :placeholder="$t('time.startTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. }"
  827. @change="iptChangs()">
  828. </el-time-picker> - <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.endTime"
  831. :placeholder="$t('time.endTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. minTime: timeItem.startTime
  839. }"
  840. @change="iptChangs()">
  841. </el-time-picker>
  842. </span>
  843. </el-form-item>
  844. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  845. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  846. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. ></el-input>
  849. </el-form-item>
  850. </div>
  851. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  852. </div>
  853. <!--照片的显示 -->
  854. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  855. <el-image v-for="(pic, index) in domain.pics" :key="index"
  856. style="width: 100px; height: 100px; margin-right:10px;"
  857. :src="pic"
  858. :preview-src-list="domain.pics">
  859. </el-image>
  860. </p>
  861. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  862. </div>
  863. <span id="workFormsItemBottom"></span>
  864. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  865. </el-form>
  866. </div>
  867. <span slot="footer" class="dialog-footer">
  868. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  869. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  870. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  871. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  872. <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>
  873. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  874. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  875. </span>
  876. </el-dialog>
  877. <!-- 按周填报 -->
  878. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  879. <!-- 按周填报-已填工时-点击 -->
  880. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  881. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  882. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  883. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  884. <el-table-column prop="state" :label="$t('state.states')">
  885. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  886. </el-table-column>
  887. <!-- <el-table-column label="操作">
  888. <template slot-scope="scope">
  889. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  890. </template>
  891. </el-table-column> -->
  892. </el-table>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  895. </span>
  896. </el-dialog>
  897. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  898. <el-form-item style="height:30px;margin-top:-72px;">
  899. <!-- <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> -->
  900. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  901. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  902. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  903. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  904. <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>
  905. <el-option
  906. v-for="item in fillProjectList"
  907. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  908. :key="item.id"
  909. :label="item.projectName + '\u3000' + item.projectCode"
  910. :value="item.id">
  911. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  912. <span style="float: right">{{ item.projectName }}</span>
  913. </el-option>
  914. </el-select>
  915. <span style="float:right;margin-right:10px;">选择项目</span>
  916. </el-form-item>
  917. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  918. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  919. <template slot-scope="scope">
  920. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  921. </template>
  922. </el-table-column>
  923. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  924. <template slot-scope="scope">
  925. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  926. <p v-else></p>
  927. </template>
  928. </el-table-column> -->
  929. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  930. <template slot-scope="scope">
  931. <div v-if="scope.row.canFill == 1">
  932. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  933. <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>
  934. <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>
  935. <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>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  939. <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>
  940. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  941. </div>
  942. </div>
  943. <div v-else >
  944. <span style="color:#999999;">不可超前填报</span>
  945. </div>
  946. </template>
  947. </el-table-column>
  948. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  949. <template slot-scope="scope">
  950. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  951. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  955. <template slot-scope="scope">
  956. <div class="zhiss">
  957. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  958. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. </el-table>
  963. </el-form>
  964. <span slot="footer" class="dialog-footer" >
  965. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  966. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  967. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  968. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  969. </span>
  970. </el-dialog>
  971. <!-- 重庆物奇私人定制的按周填报 -->
  972. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  973. <div class="fillWeekDialogVisiCustom">
  974. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  975. </div>
  976. </el-dialog>
  977. <!-- 选择时间 -->
  978. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  979. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  980. <span slot="footer" class="dialog-footer">
  981. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  982. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 按周填报弹窗 -->
  986. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  987. <div>
  988. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  989. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  990. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  991. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <!--如果设置了工时成本预警的预算成本项-->
  995. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  996. <p>{{$t('lable.budgetSource')}}</p>
  997. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  998. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  999. </el-select>
  1000. </div>
  1001. <!-- 任务分组 -->
  1002. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1003. <p>{{$t('lable.taskGrouping')}}</p>
  1004. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1005. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1006. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1010. <p>{{$t('other.inputStage')}}</p>
  1011. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1012. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1016. <p>{{$t('other.reviewer')}}</p>
  1017. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1018. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <template v-if="user.timeType.reportAuditType == 3">
  1023. <div class="zhoFel">
  1024. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1025. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1026. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1027. </el-select>
  1028. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1029. </div>
  1030. <div class="zhoFel">
  1031. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1032. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1033. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('chao-song-ren') }}</p>
  1046. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. </template>
  1052. <!-- 自定义维度 -->
  1053. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1054. <p>{{user.timeType.customDegreeName}}</p>
  1055. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1056. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1059. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <!-- 自定义数值 -->
  1063. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1064. <p>{{user.timeType.customDataName}}</p>
  1065. <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>
  1066. </div>
  1067. <!-- 自定义文本 -->
  1068. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1069. <p>{{user.timeType.customTextName}}</p>
  1070. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1071. </div>
  1072. <!-- 选择任务 -->
  1073. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1074. <p>任务 / 里程碑</p>
  1075. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1076. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1080. <p>{{$t('other.timeSelection')}}</p>
  1081. <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>
  1082. </div>
  1083. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1084. <p>{{$t('other.chooseDuration')}}</p>
  1085. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1086. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1087. </el-select>
  1088. </div>
  1089. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1090. <p>{{$t('lable.percentageOfTime')}}</p>
  1091. <div style="width:400px;display: flex;align-items: center;">
  1092. <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>
  1093. <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>
  1094. </div>
  1095. </div>
  1096. <div class="zhoFel">
  1097. <p>{{$t('other.workMatters')}}</p>
  1098. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1099. </div>
  1100. </div>
  1101. <span slot="footer" class="dialog-footer">
  1102. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1103. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1104. </span>
  1105. </el-dialog>
  1106. <!--导出报表条件选择 -->
  1107. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1108. <el-form ref="form3" :model="exportParam" >
  1109. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1110. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1111. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1112. </el-select>
  1113. </el-form-item>
  1114. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1115. <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>
  1116. <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>
  1117. </el-form-item>
  1118. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :range-separator="$t('other.to')"
  1123. type="daterange"
  1124. :start-placeholder="$t('time.startDate')"
  1125. :end-placeholder="$t('time.endDate')"
  1126. ></el-date-picker>
  1127. </el-form-item>
  1128. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1129. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1130. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1131. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1132. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1136. <div class="exportReportRadio">
  1137. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1138. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1139. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1140. <i class="el-icon-question"></i>
  1141. </el-tooltip>
  1142. </div>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="range" :label="$t('time.dateRange')">
  1153. <el-date-picker
  1154. v-model="exportParam.dateRange" :editable="false"
  1155. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1156. :clearable="true"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1166. </div>
  1167. </el-dialog>
  1168. <!--人员列表 -->
  1169. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1170. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1171. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1172. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1173. <el-table-column type="selection"></el-table-column>
  1174. <el-table-column prop="label" :label="$t('lable.name')" >
  1175. <template slot-scope="scope">
  1176. <span>
  1177. <!-- {{(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}} -->
  1178. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1179. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1180. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1181. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1182. </span>
  1183. <span v-else>
  1184. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1185. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1186. </span>
  1187. </span>
  1188. </template>
  1189. </el-table-column>
  1190. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1191. <template slot-scope="scope">
  1192. <div>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1195. </div>
  1196. </template>
  1197. </el-table-column>
  1198. </el-table>
  1199. </el-tab-pane>
  1200. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1201. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1202. <el-table-column prop="label" :label="$t('lable.name')" >
  1203. <template slot-scope="scope">
  1204. <!-- <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> -->
  1205. <!-- <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> -->
  1206. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1209. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1210. </span>
  1211. <span v-else>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1214. </span>
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1218. <template slot-scope="scope">
  1219. <div>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1222. </div>
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-tab-pane>
  1227. </el-tabs>
  1228. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1229. <el-table-column type="selection"></el-table-column>
  1230. <el-table-column prop="label" :label="$t('lable.name')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1239. <template slot-scope="scope">
  1240. <div>
  1241. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1243. </div>
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1248. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1249. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1250. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1251. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <!-- 按部门选择人员 -->
  1255. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1256. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1257. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1258. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1259. </el-input>
  1260. <div class="tree" style="height:400px">
  1261. <el-scrollbar style="height:100%">
  1262. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1263. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1264. highlight-current :filter-node-method="filterNode">
  1265. <span class="custom-tree-node" slot-scope="{ node }">
  1266. <span v-if="user.userNameNeedTranslate == '1'">
  1267. <span v-if="node.data.children">
  1268. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1269. </span>
  1270. <span v-else>
  1271. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1272. </span>
  1273. </span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">
  1275. {{ node.label }}
  1276. </span>
  1277. <!-- {{ node.label }} -->
  1278. </span>
  1279. </el-tree>
  1280. </el-scrollbar>
  1281. </div>
  1282. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1283. <div slot="footer" class="dialog-footer">
  1284. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1285. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1286. </div>
  1287. </el-dialog>
  1288. <el-dialog
  1289. v-if="monthWorkTimeDialog"
  1290. :visible.sync="monthWorkTimeDialog"
  1291. :close-on-click-modal="false"
  1292. customClass="customWidth selectworktime"
  1293. width="1200px"
  1294. title=""
  1295. >
  1296. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1297. <el-tabs v-model="activeName" @tab-click="handleClick">
  1298. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1299. <div class="selectworktime_export" style="margin-top:10px;">
  1300. <div class="selectworktime_export_l">
  1301. <el-date-picker
  1302. class="selecteworktime_datapick"
  1303. v-model="WorktimeDatepickValue"
  1304. value-format="yyyy-MM-dd"
  1305. type="daterange"
  1306. align="right"
  1307. unlink-panels
  1308. :range-separator="$t('other.to')"
  1309. :start-placeholder="$t('time.startDate')"
  1310. :end-placeholder="$t('time.endDate')"
  1311. :default-time="['12:00:00', '12:00:00']"
  1312. size="small"
  1313. popper-class="selecteorktime_datapick_popper"
  1314. @change="showMonthWorkTime()"
  1315. >
  1316. </el-date-picker>
  1317. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1318. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1319. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1320. <!-- 222 -->
  1321. </div>
  1322. <div>
  1323. <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">
  1324. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1325. </el-input>
  1326. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1327. </div>
  1328. <div style="float: right; vertical-align: middle;height:32px">
  1329. <el-link
  1330. v-if="user.companyId==5978"
  1331. type="primary"
  1332. @click="changeReminder()"
  1333. >{{'变更提醒'}}</el-link
  1334. >
  1335. <el-link
  1336. type="primary"
  1337. @click="exportMembWorkHours()"
  1338. >{{$t('export.exportData')}}</el-link
  1339. >
  1340. </div>
  1341. </div>
  1342. <el-table ref="hasworkTbl"
  1343. :data="monthWorkDataS"
  1344. v-el-table-infinite-scroll="listScroll"
  1345. border
  1346. :height="500"
  1347. highlight-current-row
  1348. style="width: 100%"
  1349. v-loading="tbload"
  1350. :lazy="true"
  1351. >
  1352. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1353. <template slot-scope="scope">
  1354. {{ scope.$index + 1 }}
  1355. </template>
  1356. </el-table-column>
  1357. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1358. <template slot-scope="scope">
  1359. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1360. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1361. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1362. <!-- {{scope.row.name}} -->
  1363. </span>
  1364. </template>
  1365. </el-table-column>
  1366. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1367. <template slot-scope="scope">
  1368. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1369. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1370. </template>
  1371. </el-table-column>
  1372. <el-table-column
  1373. min-width="105"
  1374. v-for="(item, index) in pickDateArray"
  1375. :key="index"
  1376. :label="item.label"
  1377. align="center"
  1378. >
  1379. <template slot-scope="scope">
  1380. <div
  1381. style="color: red"
  1382. v-if="
  1383. scope.row.worktimeList.filter(
  1384. (w) =>
  1385. w.createDate==item.date
  1386. ).length > 0 &&
  1387. scope.row.worktimeList.filter(
  1388. (w) =>w.createDate==item.date
  1389. )[0].workingTime < reportTimeType.allday
  1390. "
  1391. >
  1392. {{
  1393. scope.row.worktimeList.filter(
  1394. (w) =>w.createDate==item.date
  1395. )[0].workingTime.toFixed(1)
  1396. }}
  1397. </div>
  1398. <div
  1399. style="color: #20a0ff"
  1400. v-if="
  1401. scope.row.worktimeList.filter(
  1402. (w) =>w.createDate==item.date
  1403. ).length > 0 &&
  1404. scope.row.worktimeList.filter(
  1405. (w) =>w.createDate==item.date
  1406. )[0].workingTime > reportTimeType.allday
  1407. "
  1408. >
  1409. {{
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. )[0].workingTime.toFixed(1)
  1413. }}
  1414. </div>
  1415. <div
  1416. v-if="
  1417. scope.row.worktimeList.filter(
  1418. (w) =>w.createDate==item.date
  1419. ).length > 0 &&
  1420. scope.row.worktimeList.filter(
  1421. (w) =>w.createDate==item.date
  1422. )[0].workingTime == reportTimeType.allday
  1423. "
  1424. >
  1425. {{
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. )[0].workingTime
  1429. }}
  1430. </div>
  1431. <div
  1432. v-if="
  1433. scope.row.worktimeList.filter(
  1434. (w) =>w.createDate==item.date
  1435. ).length == 0
  1436. "
  1437. >
  1438. 0
  1439. </div>
  1440. <div
  1441. v-if="
  1442. scope.row.worktimeList.filter(
  1443. (w) =>w.createDate==item.date
  1444. ).length > 0 &&
  1445. typeof scope.row.worktimeList.filter(
  1446. (w) =>w.createDate==item.date
  1447. )[0].workingTime == 'string'
  1448. "
  1449. >
  1450. {{
  1451. scope.row.worktimeList.filter(
  1452. (w) =>w.createDate==item.date
  1453. )[0].workingTime
  1454. }}
  1455. </div>
  1456. </template>
  1457. </el-table-column>
  1458. </el-table>
  1459. <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>
  1460. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1461. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1462. <label style="font-size: 16px">员工每日已填报工时数</label>
  1463. <el-link
  1464. type="primary"
  1465. style="float: right; margin-right: 60px"
  1466. @click="exportMembWorkHours()"
  1467. >导出已填报数据</el-link
  1468. > -->
  1469. <!-- <el-button >导出</el-button> -->
  1470. <!-- </div> -->
  1471. </el-tab-pane>
  1472. <el-tab-pane label="未提交人员列表" name="second" >
  1473. <div class="selectworktime_export" style="margin-top:10px">
  1474. <div class="selectworktime_export_l">
  1475. <el-date-picker
  1476. class="selecteworktime_datapick"
  1477. v-model="WorktimeDatepickValue"
  1478. value-format="yyyy-MM-dd"
  1479. type="daterange"
  1480. align="right"
  1481. unlink-panels
  1482. :range-separator="$t('other.to')"
  1483. :start-placeholder="$t('time.startDate')"
  1484. :end-placeholder="$t('time.endDate')"
  1485. :default-time="['12:00:00', '12:00:00']"
  1486. size="small"
  1487. popper-class="selecteorktime_datapick_popper"
  1488. @change="showMonthNotWorkTime()"
  1489. >
  1490. </el-date-picker>
  1491. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1492. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1493. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1494. </div>
  1495. <div>
  1496. <div style="margin-top:10px;">
  1497. <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>
  1498. <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>
  1499. <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">
  1500. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1501. </el-input>
  1502. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1503. <el-link
  1504. type="primary"
  1505. style="float: right; vertical-align: middle;height:32px"
  1506. @click="exportMembNotWorkHours()"
  1507. >{{$t('export.exportData')}}</el-link
  1508. >
  1509. </div>
  1510. </div>
  1511. </div>
  1512. <el-table
  1513. ref="hasworkTbl2"
  1514. :data="monthNotWorkDateS"
  1515. v-el-table-infinite-scroll="notListScroll"
  1516. border
  1517. :height="500"
  1518. highlight-current-row
  1519. style="width: 100%"
  1520. v-loading="tbload"
  1521. lazy
  1522. >
  1523. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1524. <template slot-scope="scope">
  1525. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1526. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1527. </template>
  1528. </el-table-column>
  1529. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1530. <template slot-scope="scope">
  1531. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1532. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1533. </template>
  1534. </el-table-column>
  1535. <el-table-column
  1536. min-width="200"
  1537. :label="$t('weekDay.date')"
  1538. align="center"
  1539. prop="createDate"
  1540. >
  1541. </el-table-column>
  1542. <el-table-column
  1543. min-width="200"
  1544. :label="$t('state.states')"
  1545. align="center"
  1546. prop="status"
  1547. />
  1548. <el-table-column
  1549. min-width="200"
  1550. :label="$t('other.attendanceData')"
  1551. prop="cardTime"
  1552. align="center"
  1553. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1554. </el-table>
  1555. <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>
  1556. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1557. </el-tab-pane>
  1558. </el-tabs>
  1559. </el-dialog>
  1560. <!--驳回弹出框 -->
  1561. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1562. <div>
  1563. <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')" />
  1564. </div>
  1565. <div slot="footer" class="dialog-footer">
  1566. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1567. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1568. </div>
  1569. </el-dialog>
  1570. <!-- 通过弹出框 -->
  1571. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1572. <div>
  1573. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1574. </div>
  1575. <div slot="footer" class="dialog-footer">
  1576. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1577. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1578. </div>
  1579. </el-dialog>
  1580. <!--批量导入日报 -->
  1581. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1582. <p>1. {{$t('other.download')}}
  1583. <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>
  1584. </p>
  1585. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1586. <p style="display: flex;justify-content: center;">
  1587. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1588. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1589. </el-upload>
  1590. </p>
  1591. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1592. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1593. </div>
  1594. </el-dialog>
  1595. <!-- 工时导入记录弹窗 -->
  1596. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1597. <div style="height: 452px">
  1598. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1599. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1600. <el-table-column prop="userName" :label="$t('other.operator')">
  1601. <template slot-scope="scope">
  1602. <div>
  1603. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1604. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1605. </div>
  1606. </template>
  1607. </el-table-column>
  1608. <el-table-column prop="datel" :label="$t('other.document')">
  1609. <template slot-scope="scope">
  1610. <div>
  1611. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1612. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1613. </div>
  1614. </template>
  1615. </el-table-column>
  1616. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1617. <template slot-scope="scope">
  1618. <div>
  1619. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1620. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1621. </div>
  1622. </template>
  1623. </el-table-column>
  1624. </el-table>
  1625. <el-col :span="24" class="paginatis">
  1626. <el-pagination
  1627. @size-change="handleSizeChange"
  1628. @current-change="handleCurrentChange"
  1629. :page-sizes="[20 , 50 , 80 , 100]"
  1630. :page-size="20"
  1631. layout="total, sizes, prev, pager, next"
  1632. :total="toViewForm.total"
  1633. style="float:right;"
  1634. ></el-pagination>
  1635. </el-col>
  1636. </div>
  1637. </el-dialog>
  1638. <!--基于企业微信考勤数据的工时导入 -->
  1639. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1640. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1641. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1642. </el-step>
  1643. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1644. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1645. </el-steps>
  1646. <div v-if="active==0" style="padding:30px;height:360px;">
  1647. <div style="margin-top:50px;margin-left:280px;">
  1648. <el-date-picker
  1649. v-model="importWxParam.date" :editable="false"
  1650. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1651. :clearable="true"
  1652. :range-separator="$t('other.to')"
  1653. type="daterange"
  1654. :start-placeholder="$t('time.startDate')"
  1655. :end-placeholder="$t('time.endDate')"
  1656. @change="loadCheckInData"
  1657. ></el-date-picker>
  1658. </div>
  1659. </div>
  1660. <div v-if="active==1" style="padding:10px;">
  1661. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1662. style="width: 100%;margin-top:5px;" >
  1663. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1664. <template slot-scope="scope">
  1665. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1666. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1667. </template>
  1668. </el-table-column>
  1669. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1670. </el-table-column>
  1671. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1672. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1673. <template slot-scope="scope">
  1674. <div>
  1675. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1676. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1677. </div>
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column prop="departmentName" label="部门" >
  1681. <template slot-scope="scope">
  1682. <div>
  1683. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1684. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1685. </div>
  1686. </template>
  1687. </el-table-column>
  1688. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1689. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1690. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1691. <template slot-scope="scope">
  1692. {{scope.row.workHours.toFixed(1)}}h
  1693. </template>
  1694. </el-table-column>
  1695. </el-table>
  1696. </div>
  1697. <div v-if="active==2" >
  1698. <p style="display: flex;justify-content: center;height:390px;">
  1699. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1700. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1701. </el-upload>
  1702. </p>
  1703. </div>
  1704. <div slot="title">
  1705. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1706. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1707. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1708. <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>
  1709. <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>
  1710. <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>
  1711. </div>
  1712. <span slot="footer">
  1713. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1714. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1715. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1716. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1717. </span>
  1718. </el-dialog>
  1719. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1720. <p style="display: flex;justify-content: center;height:100px;">
  1721. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1722. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1723. </el-upload>
  1724. </p>
  1725. </el-dialog>
  1726. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1727. <div>
  1728. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1729. v-model="deleteReportParam.date" :editable="false"
  1730. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1731. :clearable="true"
  1732. :range-separator="$t('other.to')"
  1733. type="daterange"
  1734. :start-placeholder="$t('time.startDate')"
  1735. :end-placeholder="$t('time.endDate')"
  1736. ></el-date-picker>
  1737. </div>
  1738. <div style="margin-top:10px;">
  1739. <span>请选择部门:</span>
  1740. <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>
  1741. <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>
  1742. </div>
  1743. <div style="margin-top:10px;">
  1744. <span>请选择员工:</span>
  1745. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1746. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1747. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1748. <span v-else>{{item.name}}</span>
  1749. </el-option>
  1750. </el-select>
  1751. </div>
  1752. <span slot="footer">
  1753. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1754. </span>
  1755. </el-dialog>
  1756. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1757. <div>
  1758. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1759. v-model="deleteReportParam.date" :editable="false"
  1760. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1761. :clearable="true"
  1762. :range-separator="$t('other.to')"
  1763. type="daterange"
  1764. :start-placeholder="$t('time.startDate')"
  1765. :end-placeholder="$t('time.endDate')"
  1766. ></el-date-picker>
  1767. </div>
  1768. <div style="margin-top:15px;">
  1769. <span>选择部门:</span>
  1770. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1771. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1772. size="small" v-if="user.userNameNeedTranslate != 1"
  1773. ></el-cascader>
  1774. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1775. </div>
  1776. <span slot="footer">
  1777. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1778. </span>
  1779. </el-dialog>
  1780. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1781. <div>
  1782. <span>选择时间:</span><el-date-picker
  1783. v-model="modImportTime"
  1784. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1785. :clearable="true"
  1786. type="datetime"
  1787. ></el-date-picker>
  1788. <span>选择导入人员:</span><el-select
  1789. v-model="modImportUserId"
  1790. >
  1791. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1792. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1793. <span v-else>{{item.name}}</span>
  1794. </el-option>
  1795. </el-select>
  1796. </div>
  1797. <span slot="footer">
  1798. <el-button @click="confirmChangeModTime" >确认</el-button>
  1799. </span>
  1800. </el-dialog>
  1801. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1802. <div>
  1803. <span>请选择年月:</span>
  1804. <el-date-picker
  1805. v-model="ratioYmonth" :editable="false"
  1806. format="yyyyMM" value-format="yyyyMM"
  1807. type="month"
  1808. ></el-date-picker>
  1809. </div>
  1810. <span slot="footer">
  1811. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1812. </span>
  1813. </el-dialog>
  1814. <!--工时批量代填 -->
  1815. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1816. <div>
  1817. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1818. v-model="importWxParam.date" :editable="false"
  1819. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1820. :clearable="true"
  1821. :range-separator="$t('other.to')"
  1822. type="daterange"
  1823. :start-placeholder="$t('time.startDate')"
  1824. :end-placeholder="$t('time.endDate')"
  1825. @change="loadCheckInData"
  1826. ></el-date-picker>
  1827. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1828. </div>
  1829. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1830. :key="timeStamp"
  1831. style="width: 100%;margin-top:5px;" ref="tab">
  1832. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1833. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1834. <template slot-scope="scope">
  1835. <div>
  1836. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1837. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1838. </div>
  1839. </template>
  1840. </el-table-column>
  1841. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1842. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1843. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1844. <template slot-scope="scope">
  1845. {{scope.row.workHours.toFixed(1)}}h
  1846. </template>
  1847. </el-table-column>
  1848. <!--项目名称列表 -->
  1849. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1850. <template slot-scope="scope">
  1851. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1852. </template>
  1853. </el-table-column>
  1854. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1855. <template slot-scope="scope">
  1856. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1857. </template>
  1858. </el-table-column>
  1859. </el-table>
  1860. </el-dialog>
  1861. <!--基于企业微信考勤数据的工时导入 -->
  1862. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1863. <div style="padding-bottom:10px;">
  1864. <p>{{importResultMsg}}</p>
  1865. </div>
  1866. <!-- <span slot="footer" class="dialog-footer">
  1867. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1868. </span> -->
  1869. </el-dialog>
  1870. <!-- 审核流程展示 -->
  1871. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1872. <div style="padding:20px 40px 20px 0">
  1873. <el-timeline :reverse="false">
  1874. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1875. <!-- {{item.msg}} -->
  1876. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1877. <span v-if="user.userNameNeedTranslate == 1">
  1878. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1879. <span>{{item.msgCon.two}}</span>
  1880. </span>
  1881. </el-timeline-item>
  1882. </el-timeline>
  1883. </div>
  1884. </el-dialog>
  1885. </section>
  1886. </template>
  1887. <script>
  1888. // 左右滑动
  1889. import dragMixin from "@/common/js/tensile.js";
  1890. import util from "../../common/js/util";
  1891. // 自定义select组件
  1892. import selectCat from "@/components/select.vue"
  1893. // 引入自定义级联组件
  1894. import vueCascader from "@/components/cascader.vue"
  1895. // 重庆物奇定制组件
  1896. import WeeklyCustomization from "./weeklyCustomization.vue"
  1897. import { mapMutations } from 'vuex'
  1898. let _that = this
  1899. export default {
  1900. mixins: [dragMixin],
  1901. components: {
  1902. selectCat,
  1903. vueCascader,
  1904. WeeklyCustomization
  1905. },
  1906. data() {
  1907. return {
  1908. pageIndex: 0,
  1909. hasMore: true,
  1910. exportType: 0,
  1911. exportingData: false,
  1912. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1913. jobResponseList:[],
  1914. yisibeiCompId: 3092,
  1915. yuzhongCompId: 3385,
  1916. mingyiName : '成都明夷电子科技有限公司',
  1917. // mingyiName : '明夷',
  1918. modItemDataId: null,
  1919. modImportTime: null,
  1920. modImportUserId: null,
  1921. showModImportTimeDialog: false,
  1922. showBatchSimpleApproveReport: false,
  1923. startDeleting: false,
  1924. showBatchDeleteReport: false,
  1925. deleteReportParam: {date:null, userIds:[]},
  1926. isDenying: false,
  1927. targetWeekDate: null,//填写周报中的周日期
  1928. importCardTimeVisi: false,
  1929. startRatioExporting: false,
  1930. exportUserRatio: false,
  1931. ratioYmonth:null,
  1932. hasWrittenReport: false,
  1933. today:null,
  1934. syncTimeLoading: false,
  1935. seluserText: '',
  1936. translation: '1', // 1、文字, 2、部门, 3、人员
  1937. exportLoad: false,
  1938. getPickerOptions: {
  1939. disabledDate: (time) => {
  1940. var date = new Date();
  1941. var year = date.getFullYear();
  1942. var month = date.getMonth() + 1;
  1943. if (month >= 1 && month <= 9) {
  1944. month = "0" + month;
  1945. }
  1946. var currentdate = year.toString() + month.toString();
  1947. var timeyear = time.getFullYear();
  1948. var timemonth = time.getMonth() + 1;
  1949. if (timemonth >= 1 && timemonth <= 9) {
  1950. timemonth = "0" + timemonth;
  1951. }
  1952. var timedate = timeyear.toString() + timemonth.toString();
  1953. if(this.user.timeType.fillAhead == 0){
  1954. return currentdate < timedate;
  1955. }else{
  1956. return false
  1957. }
  1958. }
  1959. },
  1960. alalal: '8.0',
  1961. timeBasecostList:null,
  1962. tbload: false,
  1963. exportTimeDialog: false,
  1964. searchKeyword: '',
  1965. monthWorkDataS: [],
  1966. monthNotWorkDateS: [],
  1967. pickDateArray:[],
  1968. WorktimeDatepickValue: [],
  1969. activeName:"first",
  1970. isLeave: 0,
  1971. submitingReport: false,
  1972. importResultMsg:null,
  1973. showImportResult:false,
  1974. importingData: false,
  1975. isDraft: 0,
  1976. timeStamp: 0,
  1977. projectColumns:[],
  1978. checkinLoading:false,
  1979. importWxParam:{date:null,},
  1980. active:0,
  1981. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1982. importWxDialog:false,
  1983. importDialog:false,
  1984. denyForm:null,
  1985. denyReasonDialog:false,
  1986. monthWorkTimeDialog: false,
  1987. isSubstitude:false,
  1988. isFill:false,
  1989. unFillList:[],
  1990. fillList:[],
  1991. fillMembList:[],
  1992. fillMembList_leave: [],
  1993. membListVisible: false,
  1994. isBatch:0,//是否是批量填报
  1995. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1996. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1997. 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')],
  1998. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1999. fillStatusList: [],
  2000. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2001. exportDialog:false,
  2002. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2003. subProjectList:[],
  2004. canEdit: true,
  2005. originCanEdit: true,
  2006. 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],
  2007. selectTime:null,
  2008. reportTimeType:{},
  2009. curDate:'',
  2010. isAllSelect: false,
  2011. approveDialogVisible:false,
  2012. deptId:null,
  2013. targetUid: null,
  2014. membCount:0,
  2015. selectState:"-1",
  2016. user: JSON.parse(sessionStorage.getItem("user")),
  2017. allUsersList: [],
  2018. showAddMore:false,
  2019. allDate: [],
  2020. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2021. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2022. choseDay: 0,
  2023. tableHeight: 0,
  2024. listLoading: false,
  2025. projectList: [], //项目列表
  2026. fillProjectList: [],
  2027. reportList: [], //日报列表
  2028. reportNames:[], //批量审批列表
  2029. selCon:[], //筛选条件
  2030. selProjectList:[], //筛选后项目列表
  2031. selConShow: true,
  2032. usersList: [], // 全部人员列表
  2033. usersListId: '', // 选中的人员id
  2034. dialogVisible: false, //项目弹窗
  2035. report: '',
  2036. workForm: {
  2037. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2038. domains: [{
  2039. id: null,
  2040. projectId: "",
  2041. workingTime: "",
  2042. timeType:0,
  2043. content: "",
  2044. state: 2,
  2045. multiWorktime:0,
  2046. worktimeList:[],
  2047. degreeId: null,
  2048. auditUserList: [],
  2049. }],
  2050. },
  2051. workRules: {
  2052. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2053. },
  2054. chooseParticipVisible: false,
  2055. logining: false,
  2056. isDisable: false,
  2057. timeType:[],
  2058. deptMembData: [
  2059. ],
  2060. //部门人员树状结构
  2061. data: [
  2062. {
  2063. id: -1,
  2064. label: this.$t('lable.allStaff'),
  2065. membCount:0
  2066. },
  2067. {
  2068. id: 0,
  2069. label: this.$t('lable.unassigned'),
  2070. }
  2071. ],
  2072. allData:{},
  2073. batchShowData:{},
  2074. option: [],
  2075. deptOptionList: [],
  2076. depData: {
  2077. id: -1,
  2078. label: this.$t('lable.allStaff'),
  2079. },
  2080. defaultProps: {
  2081. children: 'children',
  2082. label: 'label'
  2083. },
  2084. isNew: false,
  2085. selected: false,
  2086. valuet: new Date(),
  2087. domObj: null,
  2088. participator:[],
  2089. chosenMembCount:0,
  2090. jsDay: 0,
  2091. jsTime: 0,
  2092. falsss: false,
  2093. weidu: [],
  2094. weiduList: [],
  2095. yonghuUser: [],
  2096. dateAr: [],
  2097. batchSubFillDialog: false,
  2098. isSubstiS: false,
  2099. fillWeekDialogVisi: false,
  2100. fillWeekDialogVisiCustom: false,
  2101. zhoData: [],
  2102. weekDateRange: [],
  2103. btnZho: false,
  2104. weekDataLoading: false,
  2105. changdu: 6,
  2106. tianxieDialogVisible: false,
  2107. scopess: {},
  2108. zhoBao: {
  2109. time: '',
  2110. workingTime: '',
  2111. progress: '',
  2112. con: '',
  2113. subProjectId: '',
  2114. stage: '',
  2115. subProjectList: [],
  2116. stages: [],
  2117. },
  2118. zhoBaoIdx: '',
  2119. zhoBaoName: '',
  2120. zhis: {},
  2121. dealList: [],
  2122. toViewDialogVisible: false,
  2123. toViewList: [],
  2124. toViewloading: true,
  2125. toViewForm: {
  2126. pageIndex: '1',
  2127. pageSize: '20',
  2128. total: 0,
  2129. },
  2130. toViewloadings: false,
  2131. tabPositionss: 'top',
  2132. monthTotal: 0,
  2133. monthTotalPage: 0,
  2134. monthTotalLages: 20,
  2135. monthWorkData: [],
  2136. monthNotWorkDate: [],
  2137. monthWorkDataS1: [],
  2138. monthnotTotal: 0,
  2139. monthnotTotalPage: 0,
  2140. monthnotTotalLages: 20,
  2141. monthNotWorkDateS1: [],
  2142. deptMembDataText: '',
  2143. isFlag: false,
  2144. isMore: false,
  2145. stateKey: '0',
  2146. expandDate: [],
  2147. notifySelList:[],
  2148. departmentList: [],
  2149. approvalProcessDialog: false,
  2150. approvalProcessData: [],
  2151. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2152. 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')],
  2153. isWeekend: false,
  2154. canCancelInDialog: false,
  2155. approveinData: {},
  2156. approveinDialog: false,
  2157. reportCanDelete: false,
  2158. weeklyFilledTimeDialog: false,
  2159. weeklyFilledTimeList: [],
  2160. weeklyFilledTimeLoading: false,
  2161. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2162. weeklyFilledTimeCanDelete: false,
  2163. weeklyFilledTimeDate: null,
  2164. leaveAllNum: 0,
  2165. dataLoading: false,
  2166. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2167. vacationTime: {},
  2168. integrationProjectList: [],
  2169. totalReportHours: 0, // 合计的工时
  2170. workTimeForMinYi:0,
  2171. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2172. weekIndex: 1,
  2173. weekParentData: {},
  2174. deptIdForNoReport:[],
  2175. nameAearch: '', // 企业微信姓名搜索
  2176. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2177. deptMembDataLoading: false,
  2178. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2179. {
  2180. id: 4811,
  2181. // id: 10,
  2182. name: '陕西柘中建设工程有限公司'
  2183. }
  2184. ],
  2185. pushWorkTimeLogDig:false,
  2186. pushWorkTimeLogData:[],
  2187. };
  2188. },
  2189. watch: {
  2190. deptMembDataText(val) {
  2191. this.$refs.chooseMembTree.filter(val);
  2192. }
  2193. },
  2194. filters: {
  2195. // 过滤
  2196. amounts(value) {
  2197. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2198. return 0
  2199. }
  2200. var zhi = +value + 0
  2201. return zhi.toFixed(1)
  2202. },
  2203. // zhoData
  2204. zhoData(value, arr) {
  2205. var dateArray = value.split("-");
  2206. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2207. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2208. // console.log(arr[date.getDay()])
  2209. // return "周" + "日一二三四五六".charAt(date.getDay());
  2210. return arr[date.getDay()]
  2211. },
  2212. // 过滤数字
  2213. numbers(value) {
  2214. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2215. return 0
  2216. }
  2217. return value
  2218. },
  2219. },
  2220. computed: {},
  2221. mounted() {
  2222. var now = new Date();
  2223. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2224. this.today = t;
  2225. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2226. this.exportParam.dateRange = [startStr,t];
  2227. this.getAllDate(1);
  2228. this.getReportList();
  2229. this.getProjectList();
  2230. this.getFillProjectList();
  2231. this.getTimeType();
  2232. this.getDepartment();
  2233. this.scrollFunction()
  2234. this.userssHu();
  2235. if(this.user.timeType.reportAuditType == 3){
  2236. this.getAllUsersList()
  2237. }
  2238. if (this.user.company.packageProject == 1) {
  2239. this.getBasecostItemList();
  2240. }
  2241. if(this.user.timeType.lockWorktime){
  2242. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2243. }
  2244. //设置了下限
  2245. if (this.user.timeType.minReportTime) {
  2246. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2247. }
  2248. const that = this
  2249. if(this.user.userNameNeedTranslate == 1) {
  2250. that.dataLoading = that.$store.state.dataLoading
  2251. this.upDataLoading()
  2252. setTimeout(()=>{
  2253. that.dataLoading = that.$store.state.dataLoading
  2254. }, 1000)
  2255. }
  2256. if (this.user.companyId == this.yuzhongCompId) {
  2257. this.getJobResponList();
  2258. }
  2259. },
  2260. methods: {
  2261. ...mapMutations(['upDataLoading']),
  2262. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2263. isCustomization(userInfo, permissionArray) {
  2264. const { companyId } = userInfo
  2265. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2266. return isReportPictureRequired
  2267. },
  2268. //任务被选中
  2269. onTaskSelected(domainItem) {
  2270. //取服务
  2271. if (domainItem.taskId) {
  2272. var that = this;
  2273. var param = {taskId:domainItem.taskId};
  2274. if (this.isSubstitude) {
  2275. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2276. param.userId = this.workForm.userId[0];
  2277. }
  2278. }
  2279. this.http.post('/task/getMyTaskService',param, res => {
  2280. if (res.code == "ok") {
  2281. // domainItem.workContentList = res.data;
  2282. that.$set(domainItem, 'sapServiceId', null);
  2283. that.$set(domainItem, 'serviceList', res.data);
  2284. } else {
  2285. this.$message({
  2286. message: res.msg,
  2287. type: "error"
  2288. });
  2289. }
  2290. },error => {
  2291. this.$message({
  2292. message: error,
  2293. type: "error"
  2294. });
  2295. }
  2296. );
  2297. } else {
  2298. //清空服务
  2299. }
  2300. },
  2301. onBatchTimeChange() {
  2302. //反向计算每日工作时长
  2303. if (this.workForm.createDate) {
  2304. let sdate = new Date(this.workForm.createDate[0]);
  2305. let edate = new Date(this.workForm.createDate[1]);
  2306. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2307. console.log('days===', days)
  2308. if (days < 0) {
  2309. return;
  2310. }
  2311. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2312. //总时长发生改变,自动按比例计算
  2313. this.workForm.domains.forEach(d=>{
  2314. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2315. });
  2316. }
  2317. },
  2318. //更新工作内容列表
  2319. updateJobContent(domainItem) {
  2320. var that = this;
  2321. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2322. if (res.code == "ok") {
  2323. // domainItem.workContentList = res.data;
  2324. that.$set(domainItem, 'extraField3', null);
  2325. that.$set(domainItem, 'workContentList', res.data);
  2326. } else {
  2327. this.$message({
  2328. message: res.msg,
  2329. type: "error"
  2330. });
  2331. }
  2332. },error => {
  2333. this.$message({
  2334. message: error,
  2335. type: "error"
  2336. });
  2337. }
  2338. );
  2339. },
  2340. updateResponse(domainItem) {
  2341. var that = this;
  2342. var selectPid = domainItem.projectId;
  2343. domainItem.extraField2 = null;
  2344. domainItem.extraField3 = null;
  2345. if (selectPid && domainItem.extraField1) {
  2346. //是否非项目
  2347. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2348. console.log('==========','isPublic=='+isPublic);
  2349. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2350. console.log(filteredRespList);
  2351. domainItem.filteredRespList = filteredRespList;
  2352. }
  2353. },
  2354. getJobResponList() {
  2355. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2356. if (res.code == "ok") {
  2357. this.jobResponseList = res.data;
  2358. } else {
  2359. this.$message({
  2360. message: res.msg,
  2361. type: "error"
  2362. });
  2363. }
  2364. },error => {
  2365. this.$message({
  2366. message: error,
  2367. type: "error"
  2368. });
  2369. }
  2370. );
  2371. },
  2372. openModImportTime(row) {
  2373. this.showModImportTimeDialog = true;
  2374. this.modItemDataId = row.id;
  2375. },
  2376. delImportTime(row) {
  2377. let rowId = row.id;
  2378. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2379. confirmButtonText: this.$t('btn.determine'),
  2380. cancelButtonText: this.$t('btn.cancel'),
  2381. type: "warning"
  2382. })
  2383. .then(() => {
  2384. this.http.post('/report-import-log/delete',{
  2385. id: rowId
  2386. },res => {
  2387. if (res.code == "ok") {
  2388. this.$message({
  2389. message: '删除成功',
  2390. type: "success"
  2391. });
  2392. this.getToView();
  2393. } else {
  2394. this.$message({
  2395. message: res.msg,
  2396. type: "error"
  2397. });
  2398. }
  2399. },error => {
  2400. this.$message({
  2401. message: error,
  2402. type: "error"
  2403. });
  2404. }
  2405. );
  2406. }).catch(() => {this.startDeleting = false});
  2407. },
  2408. confirmChangeModTime() {
  2409. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2410. this.$message({
  2411. message: '请选择时间',
  2412. type: "error"
  2413. });
  2414. return;
  2415. }
  2416. this.http.post('/report-import-log/changeTime',{
  2417. modLogDateTime: this.modImportTime,
  2418. modImportUserId: this.modImportUserId,
  2419. id: this.modItemDataId
  2420. },res => {
  2421. if (res.code == "ok") {
  2422. this.$message({
  2423. message: '修改成功',
  2424. type: "success"
  2425. });
  2426. this.getToView();
  2427. this.showModImportTimeDialog = false;
  2428. } else {
  2429. this.$message({
  2430. message: res.msg,
  2431. type: "error"
  2432. });
  2433. }
  2434. },error => {
  2435. this.$message({
  2436. message: error,
  2437. type: "error"
  2438. });
  2439. }
  2440. );
  2441. },
  2442. confirmBatchApproveReport() {
  2443. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2444. this.$message({
  2445. message: '请选择日期范围',
  2446. type: "error"
  2447. });
  2448. return;
  2449. }
  2450. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2451. confirmButtonText: this.$t('btn.determine'),
  2452. cancelButtonText: this.$t('btn.cancel'),
  2453. type: "warning"
  2454. })
  2455. .then(() => {
  2456. this.startDeleting = true;
  2457. let obj = {
  2458. startDate: this.deleteReportParam.date[0],
  2459. endDate: this.deleteReportParam.date[1]
  2460. }
  2461. if(this.deleteReportParam.departmentId) {
  2462. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2463. } else {
  2464. obj.departmentId = null
  2465. }
  2466. this.http.post('/report/batchApproveByDate',obj,res => {
  2467. if (res.code == "ok") {
  2468. this.$message({
  2469. message: '审核通过',
  2470. type: "success"
  2471. });
  2472. this.getReportList();
  2473. this.getDepartment();
  2474. this.startDeleting = false;
  2475. } else {
  2476. this.$message({
  2477. message: res.msg,
  2478. type: "error"
  2479. });
  2480. }
  2481. },error => {
  2482. this.$message({
  2483. message: error,
  2484. type: "error"
  2485. });
  2486. }
  2487. );
  2488. }).catch(() => {this.startDeleting = false});
  2489. },
  2490. confirmBatchDelReport() {
  2491. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2492. this.$message({
  2493. message: '请选择部门或人员',
  2494. type: "error"
  2495. });
  2496. return;
  2497. }
  2498. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2499. this.$message({
  2500. message: '请选择日期范围',
  2501. type: "error"
  2502. });
  2503. return;
  2504. }
  2505. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2506. confirmButtonText: this.$t('btn.determine'),
  2507. cancelButtonText: this.$t('btn.cancel'),
  2508. type: "warning"
  2509. })
  2510. .then(() => {
  2511. this.startDeleting = true;
  2512. this.http.post('/report/batchDelete',{
  2513. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2514. startDate: this.deleteReportParam.date[0],
  2515. endDate: this.deleteReportParam.date[1],
  2516. deptId: this.deleteReportParam.deptId[0]
  2517. },res => {
  2518. if (res.code == "ok") {
  2519. this.$message({
  2520. message: this.$t('message.successfullyDeleted'),
  2521. type: "success"
  2522. });
  2523. this.getReportList();
  2524. this.getDepartment();
  2525. this.startDeleting = false;
  2526. } else {
  2527. this.$message({
  2528. message: res.msg,
  2529. type: "error"
  2530. });
  2531. }
  2532. },error => {
  2533. this.$message({
  2534. message: error,
  2535. type: "error"
  2536. });
  2537. }
  2538. );
  2539. }).catch(() => {this.startDeleting = false});
  2540. },
  2541. getRecentlyProject() {
  2542. this.http.post('/project/nearProject',{},res => {
  2543. if(res.code == 'ok'){
  2544. let topObj = {
  2545. label: '最近选择项目',
  2546. peojectList: res.data
  2547. }
  2548. let botomObj = {
  2549. label: '全部项目',
  2550. peojectList: this.fillProjectList
  2551. }
  2552. //最近项目如果在fillProjectList中不存在,需要移除
  2553. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2554. this.integrationProjectList = [topObj, botomObj]
  2555. }else {
  2556. this.$message({
  2557. message: res.msg,
  2558. type: 'error'
  2559. })
  2560. }
  2561. },err => {
  2562. this.$message({
  2563. message: err,
  2564. type: 'error'
  2565. })
  2566. })
  2567. },
  2568. handlePictureCardPreview(file, index) {
  2569. console.log(file, index)
  2570. let arr = []
  2571. let imgArr = this.workForm.domains[index].imgListUrl
  2572. for(var i in imgArr) {
  2573. arr.push(imgArr[i].url)
  2574. }
  2575. console.log(arr, '图片数据')
  2576. const $viewer = this.$viewerApi({
  2577. images: arr
  2578. });
  2579. },
  2580. // 图片上传
  2581. addImg(e, index) {
  2582. console.log(e, '数据')
  2583. let formData = new FormData()
  2584. formData.append('multipartFile', e.file)
  2585. this.http.uploadFile('/common/uploadFile', formData,
  2586. res => {
  2587. if (res.code == "ok") {
  2588. this.$message({
  2589. message: this.$t('uploadedsuccessfully'),
  2590. type: "success"
  2591. });
  2592. if(!this.workForm.domains[index].imgList) {
  2593. this.workForm.domains[index].imgList = []
  2594. this.workForm.domains[index].imgListUrl = []
  2595. }
  2596. this.workForm.domains[index].imgList.push(res.data)
  2597. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2598. } else {
  2599. this.$message({message: res.msg,type: "error"});
  2600. }
  2601. console.log(this.workForm.domains[index])
  2602. },
  2603. error => {this.$message({message: error,type: "error"});
  2604. });
  2605. },
  2606. // 删除图片
  2607. delImg(file,fileList, index) {
  2608. console.log(file, fileList)
  2609. let idx = 0
  2610. for(let i in fileList) {
  2611. if(fileList[i].uid == file.uid) {
  2612. idx = i
  2613. }
  2614. }
  2615. this.workForm.domains[index].imgList.splice(idx, 1)
  2616. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2617. console.log(this.workForm.domains[index])
  2618. },
  2619. test(){
  2620. console.log('test',this.workForm.domains);
  2621. },
  2622. getHour(s1, s2) {
  2623. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2624. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2625. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2626. var ms = s2.getTime() - s1.getTime();
  2627. if (ms < 0) return 0;
  2628. let ma = ms / 1000 / 60 / 60
  2629. return ma; //小时
  2630. },
  2631. refreshWXCardTime(workdate) {
  2632. if (!workdate) return;
  2633. this.syncTimeLoading = true;
  2634. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2635. date: workdate,
  2636. },res => {
  2637. this.syncTimeLoading = false;
  2638. if(res.code == 'ok'){
  2639. this.workForm.time = res.data.time;
  2640. }else {
  2641. this.$message({
  2642. message: res.msg,
  2643. type: 'error'
  2644. })
  2645. }
  2646. },err => {
  2647. this.syncTimeLoading = false;
  2648. this.$message({
  2649. message: err,
  2650. type: 'error'
  2651. })
  2652. })
  2653. },
  2654. refreshAttendance(workdate) {
  2655. if (!workdate) return;
  2656. this.syncTimeLoading = true;
  2657. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2658. startDate: workdate[0],
  2659. endDate: workdate[1]
  2660. },res => {
  2661. this.syncTimeLoading = false;
  2662. if(res.code == 'ok'){
  2663. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2664. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2665. this.totalReportHours = this.workTimeForMinYi;
  2666. }else {
  2667. this.$message({
  2668. message: res.msg,
  2669. type: 'error'
  2670. })
  2671. }
  2672. },err => {
  2673. this.syncTimeLoading = false;
  2674. this.$message({
  2675. message: err,
  2676. type: 'error'
  2677. })
  2678. })
  2679. },
  2680. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2681. this.weeklyFilledTimeDialog = true
  2682. this.weeklyFilledTimeLoading = true
  2683. this.weeklyFilledTimeDate = parameterDate
  2684. this.http.post('/report/getReportList',{
  2685. date: parameterDate,
  2686. userId: this.user.id
  2687. },res => {
  2688. this.weeklyFilledTimeLoading = false
  2689. if(res.code == 'ok'){
  2690. this.weeklyFilledTimeList = res.data[0].data
  2691. let candelete = true
  2692. for(let i in this.weeklyFilledTimeList){
  2693. if(this.weeklyFilledTimeList[i].state < 2){
  2694. candelete = false
  2695. }
  2696. }
  2697. this.weeklyFilledTimeCanDelete = candelete
  2698. }else {
  2699. this.$message({
  2700. message: res.msg,
  2701. type: 'error'
  2702. })
  2703. }
  2704. },err => {
  2705. this.weeklyFilledTimeLoading = false
  2706. this.$message({
  2707. message: err,
  2708. type: 'error'
  2709. })
  2710. })
  2711. },
  2712. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2713. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2714. confirmButtonText: this.$t('btn.determine'),
  2715. cancelButtonText: this.$t('btn.cancel'),
  2716. type: "warning"
  2717. })
  2718. .then(() => {
  2719. this.http.post('/report/delete',{
  2720. userId: this.user.id,
  2721. date: this.weeklyFilledTimeDate
  2722. },res => {
  2723. if (res.code == "ok") {
  2724. this.$message({
  2725. message: this.$t('message.successfullyDeleted'),
  2726. type: "success"
  2727. });
  2728. this.getWeeklyWorkTime()
  2729. this.getReportList();
  2730. this.getDepartment();
  2731. this.weeklyFilledTimeDialog = false;
  2732. } else {
  2733. this.$message({
  2734. message: res.msg,
  2735. type: "error"
  2736. });
  2737. }
  2738. },error => {
  2739. this.$message({
  2740. message: error,
  2741. type: "error"
  2742. });
  2743. }
  2744. );
  2745. }).catch(() => {});
  2746. },
  2747. getApprovalProcess(item){
  2748. // console.log('this.date',this.choseDate);
  2749. this.http.post('/report-log/get',{
  2750. creatorId: item.id,
  2751. createDate: sessionStorage.msg
  2752. },res => {
  2753. if(res.code == 'ok'){
  2754. this.approvalProcessDialog = true
  2755. if(this.user.userNameNeedTranslate == 1) {
  2756. for(var i in res.data) {
  2757. let obj = {
  2758. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2759. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2760. }
  2761. res.data[i].msgCon = obj
  2762. }
  2763. }
  2764. this.approvalProcessData = res.data
  2765. console.log(this.approvalProcessData, '数据卡看')
  2766. }else{
  2767. this.$message({
  2768. message: res.msg,
  2769. type: 'error'
  2770. })
  2771. }
  2772. },err => {
  2773. this.$message({
  2774. message: err,
  2775. type: 'error'
  2776. })
  2777. })
  2778. },
  2779. filterNode(value, data) {
  2780. if (!value) return true;
  2781. return data.label.indexOf(value) !== -1;
  2782. },
  2783. triggerCalculateOT(index) {
  2784. var str = this.workForm.domains[index].overtimeHours + ''
  2785. if(str.indexOf('.') != '-1') {
  2786. var s = str.split('.')[0]
  2787. var st = str.split('.')[1]
  2788. var sts = st.split('')
  2789. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2790. }
  2791. },
  2792. searchScreen(e){
  2793. if(e){
  2794. this.monthNotWorkDateS1 = []
  2795. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2796. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2797. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2798. }
  2799. }
  2800. if (this.monthNotWorkDateS1.length > 50) {
  2801. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2802. }else{
  2803. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2804. }
  2805. // if (this.monthNotWorkDateS1.length > 0) {
  2806. // setTimeout(() => {
  2807. // this.tableListenernot()
  2808. // }, 1000);
  2809. // }
  2810. }else{
  2811. this.monthWorkDataS1 = []
  2812. for (let i = 0; i < this.monthWorkData.length; i++) {
  2813. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2814. this.monthWorkDataS1.push(this.monthWorkData[i])
  2815. }
  2816. }
  2817. if (this.monthWorkDataS1.length > 50) {
  2818. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2819. }else{
  2820. this.monthWorkDataS = this.monthWorkDataS1
  2821. }
  2822. // if (this.monthWorkDataS1.length > 0) {
  2823. // setTimeout(() => {
  2824. // this.tableListener()
  2825. // }, 1000);
  2826. // }
  2827. }
  2828. },
  2829. addUpload(data) {
  2830. // var zhi = data.fileName.split('.')[0]
  2831. // var sss = zhi + '.xlsx'
  2832. // return
  2833. var filePath = '/upload/' + data.serverName;
  2834. const a = document.createElement('a'); // 创建a标签
  2835. a.setAttribute('download', data.fileName);// download属性
  2836. a.setAttribute('href', filePath);// href链接
  2837. a.click(); //自执行点击事件
  2838. a.remove();
  2839. },
  2840. restrictNumber(targetId) {
  2841. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2842. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2843. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2844. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2845. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2846. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2847. inpu.value = parseFloat(inpu.value);
  2848. }
  2849. },
  2850. //获取项目下的任务分组
  2851. getTaskGroups(domain, index) {
  2852. domain.groupId=null;
  2853. this.http.post('/task-group/listMyJoinGroup',{
  2854. projectId: domain.projectId,
  2855. isSubstitude: this.isSubstitude ? 1 : 0
  2856. },
  2857. res => {
  2858. if (res.code == "ok") {
  2859. this.workForm.domains[index].taskGroups = res.data;
  2860. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2861. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2862. // this.getGroupStages(domain, index);
  2863. // }
  2864. this.$forceUpdate();
  2865. }
  2866. },
  2867. error => {
  2868. this.$message({
  2869. message: error,
  2870. type: "error"
  2871. });
  2872. }
  2873. );
  2874. },
  2875. //下载填报工时占比报表
  2876. downloadProjectRatio() {
  2877. this.exportUserRatio = true;
  2878. // let now = new Date();
  2879. // let month = now.getMonth();//默认看上个月的
  2880. // let monthStr = month<10? ('0'+month): month;
  2881. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2882. const today = new Date();
  2883. const year = today.getFullYear();
  2884. const month = today.getMonth() + 1;
  2885. let lastMonthYear, lastMonth;
  2886. if (month === 1) {
  2887. lastMonthYear = year - 1;
  2888. lastMonth = 12;
  2889. } else {
  2890. lastMonthYear = year;
  2891. lastMonth = month - 1;
  2892. }
  2893. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2894. console.log('赋值 ==>', this.ratioYmonth)
  2895. },
  2896. confirmDownloadRatio() {
  2897. this.startRatioExporting = true;
  2898. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2899. ymonth: this.ratioYmonth
  2900. },
  2901. res => {
  2902. if (res.code == "ok") {
  2903. this.startRatioExporting = false;
  2904. var filePath = res.data;
  2905. const a = document.createElement('a'); // 创建a标签
  2906. var data = filePath.split("/");
  2907. a.setAttribute('download', data[data.length-1]);// download属性
  2908. a.setAttribute('href', filePath);// href链接
  2909. a.click(); //自执行点击事件
  2910. a.remove();
  2911. } else {
  2912. this.startRatioExporting = false;
  2913. this.$message({
  2914. message: res.msg,
  2915. type: "error"
  2916. });
  2917. }
  2918. },
  2919. error => {
  2920. this.checkinLoading = false;
  2921. this.$message({
  2922. message: error,
  2923. type: "error"
  2924. });
  2925. }
  2926. );
  2927. },
  2928. //下载带企业微信考勤数据的工时统计模板
  2929. downloadCheckInExcel() {
  2930. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2931. startDate: this.importWxParam.date[0],
  2932. endDate: this.importWxParam.date[1],
  2933. },
  2934. res => {
  2935. if (res.code == "ok") {
  2936. var filePath = res.data;
  2937. const a = document.createElement('a'); // 创建a标签
  2938. var data = filePath.split("/");
  2939. a.setAttribute('download', data[data.length-1]);// download属性
  2940. a.setAttribute('href', filePath);// href链接
  2941. a.click(); //自执行点击事件
  2942. a.remove();
  2943. } else {
  2944. this.$message({
  2945. message: res.msg,
  2946. type: "error"
  2947. });
  2948. }
  2949. },
  2950. error => {
  2951. this.checkinLoading = false;
  2952. this.$message({
  2953. message: error,
  2954. type: "error"
  2955. });
  2956. }
  2957. );
  2958. },
  2959. pre() {
  2960. if (this.active == 0) return;
  2961. this.active--;
  2962. },
  2963. next() {
  2964. this.active++;
  2965. },
  2966. triggerTotalTime(index) {
  2967. var item = this.checkinList[index];
  2968. var total = 0.0;
  2969. for (var i=0;i<this.projectColumns.length; i++) {
  2970. var key = this.projectColumns[i];
  2971. if (item[key] != null && item[key] != '') {
  2972. total += parseFloat(item[key]);
  2973. }
  2974. }
  2975. item.totalFillTime = total;
  2976. },
  2977. //提交批量代填的数据
  2978. submitBatchSubFillData() {
  2979. var data = JSON.stringify(this.checkinList);
  2980. this.http.post('/user-corpwx-time/submitProjectTime',{
  2981. json: data,
  2982. projectColumns: JSON.stringify(this.projectColumns)
  2983. },
  2984. res => {
  2985. if (res.code == "ok") {
  2986. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2987. this.importWxDialog = false;
  2988. }
  2989. },
  2990. error => {
  2991. this.checkinLoading = false;
  2992. this.$message({
  2993. message: error,
  2994. type: "error"
  2995. });
  2996. }
  2997. );
  2998. },
  2999. loadCheckInData() {
  3000. if (this.importWxParam.date == null) {
  3001. this.checkinList = [];
  3002. return;
  3003. }
  3004. this.checkinLoading = true;
  3005. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3006. startDate: this.importWxParam.date[0],
  3007. endDate: this.importWxParam.date[1],
  3008. },
  3009. res => {
  3010. if (res.code == "ok") {
  3011. this.checkinLoading = false;
  3012. this.checkinList = res.data.list;
  3013. this.projectColumns = res.data.projects;
  3014. // 自定义表格会导致表格错乱,需重新计算表格
  3015. this.$nextTick(()=>{
  3016. this.$refs.tab.doLayout()
  3017. })
  3018. }
  3019. },
  3020. error => {
  3021. this.checkinLoading = false;
  3022. this.$message({
  3023. message: error,
  3024. type: "error"
  3025. });
  3026. }
  3027. );
  3028. },
  3029. importCardTime(item) {
  3030. //首先判断文件类型
  3031. let str = item.file.name.split(".");
  3032. let format = str[str.length - 1];
  3033. if (format != "xls" && format != "xlsx") {
  3034. this.$message({
  3035. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3036. type: "error"
  3037. });
  3038. } else {
  3039. this.importingData = true;
  3040. let formData = new FormData();
  3041. formData.append("multipartFile", item.file);
  3042. formData.append("companyId", this.user.companyId);
  3043. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3044. res => {
  3045. this.$refs.uploadCardTime.clearFiles();
  3046. this.importingData = false;
  3047. if (res.code == "ok") {
  3048. //换成弹出框,以免有人等了半天回来啥也没看到
  3049. this.$message({
  3050. message: '导入考勤时长成功',
  3051. type: "success"
  3052. });
  3053. } else {
  3054. this.$message({
  3055. message: res.msg,
  3056. type: "error"
  3057. });
  3058. }
  3059. },
  3060. error => {
  3061. this.$refs.upload.clearFiles();
  3062. this.listLoading = false;
  3063. this.$message({
  3064. message: error,
  3065. type: "error"
  3066. });
  3067. });
  3068. }
  3069. },
  3070. batchImportWxData(item) {
  3071. //首先判断文件类型
  3072. let str = item.file.name.split(".");
  3073. let format = str[str.length - 1];
  3074. if (format != "xls" && format != "xlsx") {
  3075. this.$message({
  3076. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3077. type: "error"
  3078. });
  3079. } else {
  3080. this.importingData = true;
  3081. let formData = new FormData();
  3082. formData.append("file", item.file);
  3083. formData.append("companyId", this.user.companyId);
  3084. formData.append("withCheckIn", 1);
  3085. this.http.uploadFile('/report/importData', formData,
  3086. res => {
  3087. this.$refs.upload.clearFiles();
  3088. this.showImportResult = true;
  3089. this.importingData = false;
  3090. if (res.code == "ok") {
  3091. //换成弹出框,以免有人等了半天回来啥也没看到
  3092. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3093. this.getReportList();
  3094. this.importWxDialog = false;
  3095. } else {
  3096. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3097. }
  3098. },
  3099. error => {
  3100. this.$refs.upload.clearFiles();
  3101. this.listLoading = false;
  3102. this.$message({
  3103. message: error,
  3104. type: "error"
  3105. });
  3106. });
  3107. }
  3108. },
  3109. batchImportData(item) {
  3110. //首先判断文件类型
  3111. let str = item.file.name.split(".");
  3112. let format = str[str.length - 1];
  3113. if (format != "xls" && format != "xlsx") {
  3114. this.$message({
  3115. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3116. type: "error"
  3117. });
  3118. } else {
  3119. this.importingData = true;
  3120. let formData = new FormData();
  3121. formData.append("file", item.file);
  3122. formData.append("companyId", this.user.companyId);
  3123. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3124. this.http.uploadFile(url, formData,
  3125. res => {
  3126. this.$refs.upload.clearFiles();
  3127. this.importingData = false;
  3128. this.showImportResult = true;
  3129. if (res.code == "ok") {
  3130. //换成弹出框,以免有人等了半天回来啥也没看到
  3131. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3132. this.getReportList();
  3133. this.importWXDialog = false;
  3134. } else {
  3135. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3136. }
  3137. },
  3138. error => {
  3139. this.$refs.upload.clearFiles();
  3140. this.importingData = false;
  3141. this.$message({
  3142. message: error,
  3143. type: "error"
  3144. });
  3145. });
  3146. }
  3147. },
  3148. userssHu() {
  3149. this.http.post('/time-type/getCompanyTimeSetting',{
  3150. companyId: this.user.companyId
  3151. },
  3152. res => {
  3153. if (res.code == "ok") {
  3154. this.yonghuUser = res.data
  3155. }
  3156. },
  3157. error => {
  3158. this.$message({
  3159. message: error,
  3160. type: "error"
  3161. });
  3162. }
  3163. );
  3164. },
  3165. iptBlur(i) {
  3166. if(this.isBatch == 0) {
  3167. return
  3168. }
  3169. var reqParam = {
  3170. startDate: this.workForm.createDate[0],
  3171. endDate: this.workForm.createDate[1]
  3172. };
  3173. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3174. reqParam.userId = this.workForm.userId[0];
  3175. }
  3176. this.http.post('/report/getWorkDays',reqParam,
  3177. res => {
  3178. if (res.code == "ok") {
  3179. this.jsDay = res.data
  3180. this.chuji(i)
  3181. } else {
  3182. this.$message({
  3183. message: res.msg,
  3184. type: "error"
  3185. });
  3186. }
  3187. },
  3188. error => {
  3189. this.$message({
  3190. message: error,
  3191. type: "error"
  3192. });
  3193. }
  3194. );
  3195. //明夷硬编码获取
  3196. if (this.user.company.companyName == this.mingyiName) {
  3197. this.getWorkTimeForMinYi();
  3198. }
  3199. },
  3200. getWorkTimeForMinYi(){
  3201. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3202. startDate: this.workForm.createDate[0],
  3203. endDate: this.workForm.createDate[1]
  3204. },
  3205. res => {
  3206. if (res.code == "ok") {
  3207. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3208. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3209. this.totalReportHours = this.workTimeForMinYi;
  3210. } else {
  3211. this.$message({
  3212. message: res.msg,
  3213. type: "error"
  3214. });
  3215. this.workForm.createDate = [];
  3216. }
  3217. },
  3218. error => {
  3219. this.$message({
  3220. message: error,
  3221. type: "error"
  3222. });
  3223. }
  3224. );
  3225. },
  3226. chuji(i) {
  3227. if(i == 0) {
  3228. this.seleChn(1)
  3229. } else if(i == 1) {
  3230. this.seleChn(0)
  3231. } else if(i == 2) {
  3232. if(this.workForm.domains[0].multiWorktime > 0) {
  3233. this.iptChangs()
  3234. } else {
  3235. this.iptChang()
  3236. }
  3237. } else if(i == 3) {
  3238. this.seleChn(0)
  3239. }
  3240. },
  3241. seleChn(e,domain) {
  3242. if(e == 1) {
  3243. for(var i in this.workForm.domains) {
  3244. if(this.workForm.domains[i].timeType == 0) {
  3245. this.workForm.domains[i].workingTime = 8
  3246. } else {
  3247. this.workForm.domains[i].workingTime = 4
  3248. }
  3249. }
  3250. }
  3251. var quanbu = 0
  3252. var spl = this.workForm.domains
  3253. var zhi = ''
  3254. for(var i in spl) {
  3255. var sp = +spl[i].workingTime + 0
  3256. zhi = this.jsDay * sp
  3257. quanbu = +quanbu + zhi
  3258. }
  3259. this.jsTime = quanbu
  3260. this.totalReportHours = quanbu
  3261. let worktime = this.jsTime
  3262. // 自动计算加班时长
  3263. if(this.isBatch != 0){
  3264. worktime = this.jsTime / this.jsDay
  3265. }
  3266. if(this.user.timeType.fillOvertime && domain){
  3267. let isover = false
  3268. let alltime = 0
  3269. let allover = 0 //此处alltime同上面的worktime
  3270. for(let d in spl){
  3271. if(spl[d].isOvertime){
  3272. isover = true
  3273. allover += spl[d].overtimeHours*1
  3274. }
  3275. alltime += spl[d].workingTime*1
  3276. }
  3277. if(domain.overtimeHours){
  3278. allover = allover - domain.overtimeHours
  3279. }
  3280. if(worktime*1 > this.user.timeType.allday){
  3281. if(isover){
  3282. if(alltime > (allover + this.user.timeType.allday)){
  3283. this.$set(domain,'isOvertime',true)
  3284. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3285. }else{
  3286. this.$set(domain,'isOvertime',false)
  3287. this.$set(domain,'overtimeHours',null)
  3288. if(alltime < (allover + this.user.timeType.allday)){
  3289. let overtime = allover + this.user.timeType.allday - alltime
  3290. for(let pi in spl){
  3291. if(spl[pi].overtimeHours){
  3292. if((overtime - spl[pi].overtimeHours*1) > 0){
  3293. overtime = overtime - spl[pi].overtimeHours*1
  3294. this.$set(spl[pi],'isOvertime',false)
  3295. this.$set(spl[pi],'overtimeHours',null)
  3296. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3297. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3298. break
  3299. }else{
  3300. this.$set(spl[pi],'isOvertime',false)
  3301. this.$set(spl[pi],'overtimeHours',null)
  3302. break
  3303. }
  3304. }
  3305. }
  3306. }
  3307. }
  3308. }else{
  3309. this.$set(domain,'isOvertime',true)
  3310. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3311. }
  3312. }else{
  3313. for(let di in spl){
  3314. this.$set(spl[di],'isOvertime',false)
  3315. this.$set(spl[di],'overtimeHours',null)
  3316. }
  3317. }
  3318. }
  3319. },
  3320. iptChang() {
  3321. var sl = this.workForm.domains
  3322. let timeArr = []
  3323. for(var i in sl) {
  3324. if(sl[i].startTime && sl[i].endTime) {
  3325. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3326. }
  3327. }
  3328. this.getTimeHours(timeArr)
  3329. // for(let j in arrNum) {
  3330. // this.timeJsonStr += arrNum[j]
  3331. // if(flg) {
  3332. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3333. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3334. // }
  3335. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3336. // flg = true
  3337. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3338. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3339. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3340. // }
  3341. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3342. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3343. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3344. // }
  3345. // }
  3346. },
  3347. iptChangs() {
  3348. var sl = this.workForm.domains
  3349. let timeArr = []
  3350. for(var i in sl) {
  3351. for(var j in sl[i].worktimeList){
  3352. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3353. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3354. }
  3355. }
  3356. }
  3357. this.getTimeHours(timeArr)
  3358. },
  3359. // 调用接口或去数据
  3360. getTimeHours(arr) {
  3361. this.http.post('/report/getHoursByTimeRange',{
  3362. timeJsonStr: JSON.stringify(arr)
  3363. },res => {
  3364. if(res.code === 'ok') {
  3365. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3366. } else {
  3367. this.$message({
  3368. message: res.msg,
  3369. type: 'error'
  3370. })
  3371. }
  3372. },err => {
  3373. this.$message({
  3374. message: err,
  3375. type: 'error'
  3376. })
  3377. })
  3378. },
  3379. // 按周填报调用接口计算时间
  3380. async getWeekHoursByTimeRange(timeRange) {
  3381. const url = '/report/getHoursByTimeRange';
  3382. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3383. var that = this;
  3384. return new Promise((resolve, reject) => {
  3385. this.http.post(url, data, function(res) {
  3386. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3387. }, function(err) {
  3388. reject(err);
  3389. });
  3390. });
  3391. },
  3392. removeTimeItem(item, index) {
  3393. item.worktimeList.splice(index, 1);
  3394. this.iptChangs()
  3395. },
  3396. //添加工时
  3397. addNewWorktime(index, item) {
  3398. if(item.worktimeList == null ) {
  3399. item.worktimeList = []
  3400. }
  3401. item.worktimeList.push({});
  3402. },
  3403. //复制项目
  3404. copyProject(index) {
  3405. var leftProgress = 10;
  3406. if (this.reportTimeType.type == 3) {
  3407. //计算已经待分配工时比例
  3408. let array = this.workForm.domains;
  3409. let totalProgress = 0;
  3410. for (var i=0;i<array.length; i++) {
  3411. totalProgress += array[i].progress;
  3412. }
  3413. if (totalProgress < 100) {
  3414. leftProgress = 100 - totalProgress;
  3415. }
  3416. }
  3417. var newIndex = index+1;
  3418. var itemDomain = {
  3419. projectId: this.workForm.domains[index].projectId,
  3420. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3421. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3422. ),
  3423. content: "",
  3424. progress:leftProgress,
  3425. state:2,//2-表示待提交
  3426. };
  3427. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3428. if (this.reportTimeType.type == 0) {
  3429. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3430. var length = this.workForm.domains.length;
  3431. if (length == 2) {
  3432. this.showAddMore = false;
  3433. }
  3434. }
  3435. this.selectProject(itemDomain, newIndex);
  3436. },
  3437. pushWorkTime(reportId){
  3438. let url=''
  3439. if(this.user.timeType.syncSap == 1){
  3440. url='/report/pushProjectReportToSap'
  3441. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3442. var pushDate = this.date + day;
  3443. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3444. confirmButtonText: '确定',
  3445. cancelButtonText: '取消',
  3446. type: 'info'
  3447. }).then(() => {
  3448. const loading = this.$loading({
  3449. lock: true,
  3450. text: '正在推送中,请耐心等待。',
  3451. spinner: 'el-icon-loading',
  3452. background: 'rgba(0, 0, 0, 0.7)'
  3453. });
  3454. this.http.post(url,{
  3455. pushDate: pushDate,
  3456. reportId: reportId
  3457. },res => {
  3458. loading.close();
  3459. if(res.code == 'ok'){
  3460. this.$message({
  3461. type: 'success',
  3462. message: res.data
  3463. });
  3464. }else{
  3465. this.$message({
  3466. type: 'error',
  3467. message: res.msg
  3468. })
  3469. }
  3470. },err => {
  3471. loading.close();
  3472. this.$message({
  3473. type: 'error',
  3474. message: err
  3475. })
  3476. })
  3477. }).catch(() => {
  3478. });
  3479. }else{
  3480. url='/report/pushReportDataToThird'
  3481. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3482. confirmButtonText: '确定',
  3483. cancelButtonText: '取消',
  3484. type: 'info'
  3485. }).then(() => {
  3486. const loading = this.$loading({
  3487. lock: true,
  3488. text: '正在推送中,请耐心等待。',
  3489. spinner: 'el-icon-loading',
  3490. background: 'rgba(0, 0, 0, 0.7)'
  3491. });
  3492. this.http.post(url,{
  3493. yearMonth: this.date
  3494. },res => {
  3495. loading.close();
  3496. if(res.code == 'ok'){
  3497. this.$message({
  3498. type: 'success',
  3499. message: '推送成功!'
  3500. });
  3501. }else{
  3502. this.$message({
  3503. type: 'error',
  3504. message: res.msg
  3505. })
  3506. }
  3507. },err => {
  3508. loading.close();
  3509. this.$message({
  3510. type: 'error',
  3511. message: err
  3512. })
  3513. })
  3514. }).catch(() => {
  3515. });
  3516. }
  3517. },
  3518. showWorkTime(){
  3519. this.monthWorkTimeDialog = true;
  3520. this.searchKeyword = ''
  3521. this.WorktimeDatepickValue = this.istoMonth()
  3522. if(this.WorktimeDatepickValue.length == 0){
  3523. let newdate = new Date();
  3524. let nowdate = newdate.toLocaleDateString();
  3525. let getauto = this.getAutoWeekDate(nowdate)
  3526. let nowwd = [getauto[0],getauto[6]]
  3527. this.WorktimeDatepickValue = nowwd
  3528. }
  3529. this.showMonthWorkTime()
  3530. },
  3531. handleClick(t,e){
  3532. if (t.name == "first") {
  3533. this.showMonthWorkTime()
  3534. }else{
  3535. this.showMonthNotWorkTime()
  3536. }
  3537. },
  3538. //导出员工每日填报工时数
  3539. exportMembWorkHours() {
  3540. this.http.post(
  3541. "/report/exportUserDailyWorkTime",
  3542. {
  3543. // month: this.date,
  3544. startDate: this.WorktimeDatepickValue[0],
  3545. endDate: this.WorktimeDatepickValue[1],
  3546. },
  3547. (res) => {
  3548. if (res.code == "ok") {
  3549. let url = res.data;
  3550. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3551. }
  3552. },
  3553. (error) => {
  3554. this.$message({
  3555. message: error,
  3556. type: "error",
  3557. });
  3558. }
  3559. );
  3560. },
  3561. exportMembNotWorkHours() {
  3562. this.http.post(
  3563. "/report/exportNoReportUserList",
  3564. {
  3565. // month: this.date,
  3566. startDate: this.WorktimeDatepickValue[0],
  3567. endDate: this.WorktimeDatepickValue[1],
  3568. },
  3569. (res) => {
  3570. if (res.code == "ok") {
  3571. let url = res.data;
  3572. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3573. }
  3574. },
  3575. (error) => {
  3576. this.$message({
  3577. message: error,
  3578. type: "error",
  3579. });
  3580. }
  3581. );
  3582. },
  3583. downloadByA(name, url) {
  3584. const a = document.createElement("a"); // 创建a标签
  3585. a.setAttribute("download", name); // download属性
  3586. a.setAttribute("href", url); // href链接
  3587. a.click(); // 自执行点击事件
  3588. a.remove();
  3589. },
  3590. // 是否本月判断
  3591. istoMonth(){
  3592. let todate = new Date()
  3593. let tomonth = todate.getMonth() + 1
  3594. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3595. if(this.date == adate){
  3596. return []
  3597. }else{
  3598. let sedate = new Date(this.date)
  3599. let semonth = sedate.getMonth() + 1
  3600. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3601. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3602. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3603. return [sedates1, sedates2]
  3604. }
  3605. },
  3606. showMonthWorkTime() {
  3607. this.monthTotalPage = 0,
  3608. this.tbload = true
  3609. this.http.post(
  3610. "/report/getUserDailyWorkTime",
  3611. // "/report/getNoReportUserList",
  3612. {
  3613. // month: this.date,
  3614. startDate: this.WorktimeDatepickValue[0],
  3615. endDate: this.WorktimeDatepickValue[1],
  3616. },
  3617. (res) => {
  3618. if (res.code == "ok") {
  3619. this.tbload = false;
  3620. this.pickDateArray = res.data.days;
  3621. // console.log('dataarray',res.data.days);
  3622. this.monthWorkData = res.data.list;
  3623. // this.monthWorkDataS = this.monthWorkData
  3624. // this.monthWorkDataS1 = res.data.list
  3625. this.monthTotal = res.data.list.length
  3626. if (this.monthWorkData.length > 50) {
  3627. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3628. }else{
  3629. this.monthWorkDataS = this.monthWorkData
  3630. }
  3631. this.searchScreen(0)
  3632. // this.monthWorkDataS = infoList
  3633. // 判断
  3634. // if (this.monthWorkDataS1.length > 0) {
  3635. // setTimeout(() => {
  3636. // this.tableListener()
  3637. // }, 1000);
  3638. // }
  3639. this.$nextTick(function(){
  3640. this.$refs.hasworkTbl.doLayout();
  3641. });
  3642. // this.$forceUpdate()
  3643. }
  3644. },
  3645. (error) => {
  3646. this.tbload = false
  3647. this.$message({
  3648. message: error,
  3649. type: "error",
  3650. });
  3651. }
  3652. );
  3653. },
  3654. // tableListener(){
  3655. // let that = this;
  3656. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3657. // // 添加scroll监听事件
  3658. // dom.addEventListener("scroll", function () {
  3659. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3660. // if (scrollDistance < 2) {
  3661. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3662. // that.monthTotalPage++; //当前页数自增
  3663. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3664. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3665. // var infoList = arrList.splice(
  3666. // that.monthTotalPage * that.monthTotalLages,
  3667. // that.monthTotalLages
  3668. // );
  3669. // // 数据添加
  3670. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3671. // }
  3672. // }
  3673. // })
  3674. // },
  3675. showMonthNotWorkTime() {
  3676. this.monthTotalPage = 0,
  3677. this.tbload = true,
  3678. this.http.post(
  3679. "/report/getNoReportUserList",
  3680. {
  3681. startDate: this.WorktimeDatepickValue[0],
  3682. endDate: this.WorktimeDatepickValue[1],
  3683. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3684. },
  3685. (res) => {
  3686. if (res.code == "ok") {
  3687. this.tbload = false
  3688. this.monthNotWorkDate = res.data;
  3689. // this.monthNotWorkDateS1 = res.data
  3690. this.monthnotTotal = res.data.length
  3691. // 2222111
  3692. if (this.monthNotWorkDate.length > 50) {
  3693. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3694. } else {
  3695. this.monthNotWorkDateS = this.monthNotWorkDate
  3696. }
  3697. this.searchScreen(1)
  3698. // 判断
  3699. // if (this.monthnotworkDateS1.length > 0) {
  3700. // setTimeout(() => {
  3701. // this.tableListenernot()
  3702. // }, 1000);
  3703. // }
  3704. this.$nextTick(function(){
  3705. this.$refs.hasworkTbl2.doLayout();
  3706. });
  3707. }
  3708. },
  3709. (error) => {
  3710. this.tbload = false
  3711. this.$message({
  3712. message: error,
  3713. type: "error",
  3714. });
  3715. }
  3716. );
  3717. },
  3718. // tableListenernot(){
  3719. // let that = this;
  3720. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3721. // dom.addEventListener("scroll", function () {
  3722. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3723. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3724. // if (scrollDistance2 < 2) {
  3725. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3726. // that.monthnotTotalPage++; //当前页数自增
  3727. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3728. // var infoList = arrList.splice(
  3729. // that.monthnotTotalPage * that.monthnotTotalLages,
  3730. // that.monthnotTotalLages
  3731. // );
  3732. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3733. // }
  3734. // }
  3735. // })
  3736. // },
  3737. listScroll(){
  3738. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3739. this.isMore = true
  3740. setTimeout(()=>{
  3741. this.isMore = false
  3742. },1000)
  3743. }else {
  3744. this.isFlag = true
  3745. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3746. this.monthWorkDataS = datalist
  3747. setTimeout(()=>{
  3748. this.isFlag = false
  3749. },300)
  3750. }
  3751. },
  3752. notListScroll(){
  3753. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3754. this.isMore = true
  3755. setTimeout(()=>{
  3756. this.isMore = false
  3757. },1000)
  3758. }else {
  3759. this.isFlag = true
  3760. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3761. this.monthNotWorkDateS = datalist
  3762. // console.log('length',this.monthNotWorkDateS.length)
  3763. setTimeout(()=>{
  3764. this.isFlag = false
  3765. },300)
  3766. }
  3767. },
  3768. // 获取默认这zhou日期参数 222
  3769. getLastWeek(e){
  3770. let newdate = new Date()
  3771. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3772. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3773. if(e){
  3774. this.WorktimeDatepickValue = lastwd
  3775. this.showMonthWorkTime()
  3776. }else{
  3777. this.WorktimeDatepickValue = lastwd
  3778. this.showMonthNotWorkTime()
  3779. }
  3780. },
  3781. getThisWeek(e){
  3782. let newdate = new Date();
  3783. let nowdate = newdate.toLocaleDateString();
  3784. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3785. if(e){
  3786. this.WorktimeDatepickValue = nowwd
  3787. this.showMonthWorkTime()
  3788. }else{
  3789. this.WorktimeDatepickValue = nowwd
  3790. this.showMonthNotWorkTime()
  3791. }
  3792. },
  3793. getDoubleLastWeek(e){
  3794. let newdate = new Date()
  3795. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3796. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3797. if(e){
  3798. this.WorktimeDatepickValue = nextwd
  3799. this.showMonthWorkTime()
  3800. }else{
  3801. this.WorktimeDatepickValue = nextwd
  3802. this.showMonthNotWorkTime()
  3803. }
  3804. },
  3805. alreadyAllDate(stime,etime){
  3806. let diffdate = new Array();
  3807. let i=0;
  3808. while(stime<=etime){
  3809. let dateArray = stime.split("-");
  3810. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3811. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3812. let stimewk = this.weekDay[date.getDay()]
  3813. 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')
  3814. 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])
  3815. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3816. let stime_ts = new Date(stime).getTime();
  3817. let next_date = stime_ts + (24*60*60*1000);
  3818. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3819. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3820. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3821. stime = next_dates_y+next_dates_m+next_dates_d;
  3822. i++;
  3823. }
  3824. return diffdate
  3825. },
  3826. getAutoWeekDate(e) {
  3827. let dateString = e;
  3828. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3829. if (dateString.match(dateStringReg)) {
  3830. let presentDate = new Date(dateString),
  3831. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3832. return Array.from(new Array(7), function (val, index) {
  3833. let formatDate = new Date(
  3834. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3835. );
  3836. return (
  3837. formatDate.getFullYear() +
  3838. "-" +
  3839. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3840. "-" +
  3841. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3842. );
  3843. });
  3844. } else {
  3845. throw new Error(
  3846. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3847. );
  3848. }
  3849. },
  3850. onProgressChange() {
  3851. this.$forceUpdate();
  3852. },
  3853. showChooseMembTree() {
  3854. this.chosenMembCount = this.participator.length;
  3855. this.chooseParticipVisible = true;
  3856. },
  3857. onTreeItemChange() {
  3858. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3859. var list = chosenList.filter(item=>item.isUser == 1);
  3860. this.chosenMembCount = list.length;
  3861. },
  3862. findUserInTree() {
  3863. if (this.filterName == '') {
  3864. this.deptMembData = this.allMembData;
  3865. } else {
  3866. var list = this.findRecursively(this.filterName, this.allMembData);
  3867. this.deptMembData = list;
  3868. }
  3869. },
  3870. findRecursively(username, list) {
  3871. var filterList = [];
  3872. for (var i=0;i<list.length; i++) {
  3873. if (list[i].isUser == 1) {
  3874. if (list[i].label.indexOf(username) >= 0) {
  3875. //匹配上了
  3876. filterList.push(list[i]);
  3877. }
  3878. } else if (list[i].children != null && list[i].children.length > 0) {
  3879. var subList = this.findRecursively(username, list[i].children);
  3880. if (subList.length > 0) {
  3881. subList.forEach(s=>filterList.push(s));
  3882. }
  3883. }
  3884. }
  3885. return filterList;
  3886. },
  3887. //确定选择参与人
  3888. chooseParticip() {
  3889. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3890. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3891. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3892. if (this.user.company.packageProject == 1) {
  3893. if (this.chosenMembList.length > 1) {
  3894. this.$message({
  3895. message: '每次仅支持代填一个人',
  3896. type: "error",
  3897. });
  3898. return;
  3899. }
  3900. }
  3901. this.chooseParticipVisible = false;
  3902. this.workForm.userNames = '';
  3903. this.workForm.userId = [];
  3904. this.participator = [];
  3905. for (var i=0;i<this.chosenMembList.length; i++) {
  3906. this.workForm.userId.push(this.chosenMembList[i].id);
  3907. this.workForm.userNames += this.chosenMembList[i].label+',';
  3908. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3909. this.participator.push(item);
  3910. }
  3911. if (this.workForm.userNames.length > 0) {
  3912. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3913. }
  3914. if(this.user.userNameNeedTranslate == 1) {
  3915. if(this.workForm.userNames) {
  3916. this.workForm.userNames = this.workForm.userNames.split(',')
  3917. }
  3918. }
  3919. },
  3920. notifySel(sel){
  3921. // console.log(sel);
  3922. this.notifySelList = sel
  3923. },
  3924. //微信通知人员填写
  3925. Notify(code) {
  3926. if (this.notifySelList.length == 0) return;
  3927. var ids = '';
  3928. this.notifySelList.forEach(f=>{
  3929. ids += f.id+',';
  3930. })
  3931. this.http.post('/user/pushFillReport',{
  3932. ids: ids, date: this.curDate,
  3933. code: code
  3934. },
  3935. res => {
  3936. if (res.code == "ok") {
  3937. this.$message({
  3938. message: this.$t('message.sentSuccessfully'),
  3939. type: "success"
  3940. });
  3941. }
  3942. },
  3943. error => {
  3944. this.$message({
  3945. message: error,
  3946. type: "error"
  3947. });
  3948. }
  3949. );
  3950. },
  3951. //导出人员列表
  3952. exportMemb() {
  3953. if (this.fillMembList.length == 0) return;
  3954. var ids = '';
  3955. this.fillMembList.forEach(f=>{
  3956. ids += f.id+',';
  3957. })
  3958. this.http.post('/user/exportMembList',{
  3959. ids: ids,isFill: this.isFill, date: this.curDate
  3960. },
  3961. res => {
  3962. if (res.code == "ok") {
  3963. var aTag = document.createElement('a');
  3964. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3965. aTag.href = res.data;
  3966. aTag.click();
  3967. }
  3968. },
  3969. error => {
  3970. this.$message({
  3971. message: error,
  3972. type: "error"
  3973. });
  3974. }
  3975. );
  3976. },
  3977. showMembList(fill) {
  3978. this.membListVisible = true;
  3979. if (fill == 0) {
  3980. this.fillMembList = this.unFillList;
  3981. this.isFill = false;
  3982. let leaveList = []
  3983. let unleaveList = []
  3984. for(let i in this.fillMembList){
  3985. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3986. leaveList.push(this.fillMembList[i])
  3987. }else{
  3988. unleaveList.push(this.fillMembList[i])
  3989. }
  3990. }
  3991. this.fillMembList = unleaveList
  3992. this.fillMembList_leave = leaveList
  3993. } else if(fill == 1){
  3994. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3995. this.isFill = true;
  3996. }else{
  3997. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3998. this.isFill = true;
  3999. }
  4000. },
  4001. //获取自己填写的日报状态
  4002. getReportFillStatus() {
  4003. this.http.post('/report/getReportFillStatus',{
  4004. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4005. },
  4006. res => {
  4007. if (res.code == "ok") {
  4008. this.fillStatusList = res.data;
  4009. this.allDate.forEach(d=>{
  4010. var fillInfo = null;
  4011. d.state = null;
  4012. this.fillStatusList.forEach(s=>{
  4013. // console.log(d)
  4014. var d1 = s.createDate.split('-')[2];
  4015. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4016. // console.log(d2, '我被执行了')
  4017. if (d1.indexOf('0') == 0) {
  4018. d1 = d1.substring(1,d1.length);
  4019. }
  4020. if (d1 == d2) {
  4021. d.state = s.state;
  4022. }
  4023. })
  4024. })
  4025. this.$forceUpdate();
  4026. }
  4027. },
  4028. error => {
  4029. this.$message({
  4030. message: error,
  4031. type: "error"
  4032. });
  4033. }
  4034. );
  4035. },
  4036. scrollFunction () {
  4037. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4038. if (this.domObj.attachEvent) { // IE
  4039. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4040. } else if (this.domObj.addEventListener) {
  4041. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4042. }
  4043. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4044. },
  4045. mouseScroll(event) { // google 浏览器下
  4046. let detail = event.wheelDelta || event.detail
  4047. let moveForwardStep = -1
  4048. let moveBackStep = 1
  4049. let step = 0
  4050. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4051. event.preventDefault() // 阻止浏览器默认事件
  4052. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4053. },
  4054. // //左右滚动
  4055. // wheel(e){
  4056. // var a = document.getElementById("dateScroll");
  4057. // var scroll_width = 80; //滚动一下的距离
  4058. // var e = e || window.event, v;
  4059. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4060. // if(v>3||-v>3) v=-v;
  4061. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4062. // e.preventDefault(); //阻止浏览器的默认滚动
  4063. // },
  4064. showExportDialog() {
  4065. this.exportType = 0
  4066. this.exportDialog = true;
  4067. },
  4068. showExportTimeDialog() {
  4069. this.exportTimeDialog = true;
  4070. },
  4071. changeAllTime() {
  4072. //总时长发生改变,自动按比例计算
  4073. this.workForm.domains.forEach(d=>{
  4074. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4075. });
  4076. //计算jsTime
  4077. if (this.workForm.createDate) {
  4078. let sdate = new Date(this.workForm.createDate[0]);
  4079. let edate = new Date(this.workForm.createDate[1]);
  4080. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4081. console.log('days===', days)
  4082. if (days < 0) {
  4083. days = 0;
  4084. }
  4085. this.jsTime = this.reportTimeType.allday * days;
  4086. }
  4087. },
  4088. // 是否加班的单机事件
  4089. check() {
  4090. this.selected = !this.selected
  4091. this.isNew = this.selected
  4092. },
  4093. updateSubProject() {
  4094. this.$forceUpdate();
  4095. },
  4096. selectDegreeId(domain, index) {
  4097. this.http.post('/report/defaultDegree',{
  4098. projectId: domain.projectId
  4099. },
  4100. res => {
  4101. if (res.code == "ok") {
  4102. if(res.data) {
  4103. this.workForm.domains[index].degreeId = res.data.id + ''
  4104. this.$forceUpdate();
  4105. }
  4106. }
  4107. },
  4108. error => {
  4109. this.$message({
  4110. message: error,
  4111. type: "error"
  4112. });
  4113. }
  4114. );
  4115. },
  4116. //项目选中了, 加载子项目
  4117. selectProject(domain, index) {
  4118. if(!domain.projectId){
  4119. return;
  4120. }
  4121. // 默认选中上次填写的自定义维度
  4122. if(this.yonghuUser.customDegreeActive == 1) {
  4123. this.selectDegreeId(domain, index)
  4124. }
  4125. // console.log('projectId===',domain.projectId);
  4126. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4127. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4128. this.http.post('/sub-project/list',{
  4129. projectId: domain.projectId,
  4130. isReport: true
  4131. },
  4132. res => {
  4133. //清空之前选中的子项目
  4134. // this.workForm.domains[index].subProjectId = 0;
  4135. if (res.code == "ok") {
  4136. this.workForm.domains[index].subProjectList = res.data;
  4137. this.workForm.domains[index].subProjectId = null;
  4138. this.$forceUpdate();
  4139. }
  4140. },
  4141. error => {
  4142. this.$message({
  4143. message: error,
  4144. type: "error"
  4145. });
  4146. }
  4147. );
  4148. //项目相关的近期任务
  4149. if (this.user.company.packageProject == 1) {
  4150. this.getRecentTaskList(domain, index);
  4151. //获取项目相关专业
  4152. if (this.user.company.packageEngineering == 1) {
  4153. this.getProjectProfessions(domain, index);
  4154. }
  4155. //获取项目下的任务分组
  4156. this.getTaskGroups(domain, index);
  4157. }
  4158. // 获取项目相关的维度
  4159. // domain.degreeId = null
  4160. this.$set(domain,'degreeId',null)
  4161. this.$set(domain,'multiDegrIdArray',null)
  4162. this.dimension(domain, index);
  4163. //获取项目审核人
  4164. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4165. this.getProjectAuditorList(domain, index);
  4166. } else {
  4167. //按分组的负责人来审核
  4168. domain.projectAuditorId = null;
  4169. domain.projectAuditorName = null;
  4170. domain.auditUserList = null;
  4171. }
  4172. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4173. if (this.reportTimeType.type == 3) {
  4174. //新增项目时,自动计算
  4175. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4176. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4177. }
  4178. //加载昱众的工作职责
  4179. if (this.user.companyId == this.yuzhongCompId) {
  4180. this.updateResponse(domain);
  4181. }
  4182. },
  4183. getRecentTaskList(domain, index) {
  4184. //刷新任务时,清空服务
  4185. this.$set(domain, 'sapServiceId', null);
  4186. this.$set(domain, 'taskId', null);
  4187. var param = {
  4188. projectId: domain.projectId,
  4189. isSubstitude:this.isSubstitude?1:0,
  4190. };
  4191. if (domain.groupId) {
  4192. param.groupId = domain.groupId;
  4193. }
  4194. if (domain.stage) {
  4195. param.stage = domain.stage;
  4196. }
  4197. //专业版代填,获取代填员工的任务
  4198. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4199. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4200. this.$message({
  4201. message: '请选择代填的员工',
  4202. type: "error"
  4203. });
  4204. return;
  4205. } else {
  4206. param.userId = this.workForm.userId[0];
  4207. }
  4208. }
  4209. this.http.post('/task/getRecentTask',param,
  4210. res => {
  4211. if (res.code == "ok") {
  4212. this.workForm.domains[index].allTaskList = res.data;
  4213. this.workForm.domains[index].taskList = res.data;
  4214. this.$forceUpdate();
  4215. }
  4216. },
  4217. error => {
  4218. this.$message({
  4219. message: error,
  4220. type: "error"
  4221. });
  4222. }
  4223. );
  4224. },
  4225. //获取项目审核人
  4226. getProjectAuditorList(domainItem, index) {
  4227. if(domainItem.projectId == '') {
  4228. return
  4229. }
  4230. domainItem.projectAuditorId = null;
  4231. domainItem.projectAuditorName = null;
  4232. this.http.post('/project-auditor/getList',{
  4233. projectId: domainItem.projectId,
  4234. },
  4235. res => {
  4236. if (res.code == "ok") {
  4237. domainItem.auditUserList = res.data;
  4238. if (res.data.length==0) {
  4239. this.$message({
  4240. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4241. type: "error"
  4242. });
  4243. } else if (res.data.length==1) {
  4244. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4245. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4246. }
  4247. this.$forceUpdate();
  4248. }
  4249. },
  4250. error => {
  4251. this.$message({
  4252. message: error,
  4253. type: "error"
  4254. });
  4255. }
  4256. );
  4257. },
  4258. // 获取维度数据
  4259. dimension(domain, index) {
  4260. if(domain.projectId == '') {
  4261. return
  4262. }
  4263. this.http.post('/project/getDegreeList',{
  4264. projectId: domain.projectId,
  4265. },
  4266. res => {
  4267. if (res.code == "ok") {
  4268. // console.log("维度数据",res.data);
  4269. this.workForm.domains[index].wuduList = res.data
  4270. // this.workForm = this.workForm
  4271. this.$forceUpdate()
  4272. }
  4273. },
  4274. error => {
  4275. this.$message({
  4276. message: error,
  4277. type: "error"
  4278. });
  4279. }
  4280. );
  4281. },
  4282. //切换任务阶段
  4283. changeStages(domain, index) {
  4284. if (domain.stage == null || domain.stage == '') {
  4285. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4286. } else {
  4287. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4288. }
  4289. this.getRecentTaskList(domain, index);
  4290. this.$forceUpdate();
  4291. },
  4292. getGroupStages(domain, index, keepStage) {
  4293. // console.log(domain);
  4294. if(!domain.groupId){
  4295. domain.projectAuditorId = ''
  4296. domain.stages = []
  4297. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4298. domain.taskId = ''
  4299. domain.sapServiceId = ''
  4300. }
  4301. if(this.user.timeType.reportAuditType >= 1){
  4302. domain.auditUserList = []
  4303. }
  4304. this.$forceUpdate();
  4305. return
  4306. }
  4307. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4308. res => {
  4309. if (res.code == "ok") {
  4310. if (!keepStage) {
  4311. domain.stage = '';
  4312. }
  4313. domain.stages = res.data;
  4314. this.getRecentTaskList(domain, index);
  4315. this.$forceUpdate();
  4316. }
  4317. },
  4318. error => {
  4319. this.$message({
  4320. message: error,
  4321. type: "error"
  4322. });
  4323. });
  4324. //检查当前的项目是否需要获取分组的负责人
  4325. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4326. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4327. res => {
  4328. if (res.code == "ok") {
  4329. domain.getProjectAuditorList = res.data;
  4330. domain.auditUserList = res.data;
  4331. if (res.data.length==1) {
  4332. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4333. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4334. } else if (res.data.length==0) {
  4335. domain.projectAuditorId = null;
  4336. domain.projectAuditorName = null;
  4337. }
  4338. this.$forceUpdate();
  4339. }
  4340. },
  4341. error => {
  4342. this.$message({
  4343. message: error,
  4344. type: "error"
  4345. });
  4346. });
  4347. }
  4348. },
  4349. getProjectProfessions(domain, index) {
  4350. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4351. res => {
  4352. if (res.code == "ok") {
  4353. this.workForm.domains[index].professionProgress = res.data;
  4354. this.$forceUpdate();
  4355. }
  4356. },
  4357. error => {
  4358. this.$message({
  4359. message: error,
  4360. type: "error"
  4361. });
  4362. });
  4363. },
  4364. //删除自己的日报
  4365. deleteReport() {
  4366. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4367. confirmButtonText: this.$t('btn.determine'),
  4368. cancelButtonText: this.$t('btn.cancel'),
  4369. type: "warning"
  4370. })
  4371. .then(() => {
  4372. this.listLoading = true;
  4373. this.http.post('/report/delete',{
  4374. userId: this.user.id,
  4375. date: this.workForm.createDate
  4376. },
  4377. res => {
  4378. this.listLoading = false;
  4379. if (res.code == "ok") {
  4380. this.$message({
  4381. message: this.$t('message.successfullyDeleted'),
  4382. type: "success"
  4383. });
  4384. this.getReportList();
  4385. this.getDepartment();
  4386. this.dialogVisible = false;
  4387. } else {
  4388. this.$message({
  4389. message: res.msg,
  4390. type: "error"
  4391. });
  4392. }
  4393. },
  4394. error => {
  4395. this.listLoading = false;
  4396. this.$message({
  4397. message: error,
  4398. type: "error"
  4399. });
  4400. }
  4401. );
  4402. })
  4403. .catch(() => {});
  4404. },
  4405. // 管理员删除日报
  4406. guanli(item) {
  4407. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4408. let param = {date: this.date + day, userId: item.id};
  4409. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4410. confirmButtonText: this.$t('btn.determine'),
  4411. cancelButtonText: this.$t('btn.cancel'),
  4412. type: "warning"
  4413. })
  4414. .then(() => {
  4415. this.listLoading = true;
  4416. this.http.post('/report/delete',param,
  4417. res => {
  4418. this.listLoading = false;
  4419. if (res.code == "ok") {
  4420. this.$message({
  4421. message: this.$t('message.successfullyDeleted'),
  4422. type: "success"
  4423. });
  4424. this.getReportList();
  4425. this.getDepartment();
  4426. this.dialogVisible = false;
  4427. } else {
  4428. this.$message({
  4429. message: res.msg,
  4430. type: "error"
  4431. });
  4432. }
  4433. },
  4434. error => {
  4435. this.listLoading = false;
  4436. this.$message({
  4437. message: error,
  4438. type: "error"
  4439. });
  4440. }
  4441. );
  4442. })
  4443. .catch(() => {});
  4444. },
  4445. selectAll() {
  4446. if (this.isAllSelect) {
  4447. var keys = [];
  4448. this.reportNames.forEach(b=>{
  4449. keys.push(b.id);
  4450. })
  4451. this.$refs.approveTree.setCheckedKeys(keys);
  4452. } else {
  4453. this.$refs.approveTree.setCheckedKeys([]);
  4454. }
  4455. },
  4456. removeEmptyNode(list) {
  4457. for (var i=0;i<list.length;i++) {
  4458. var cnt = 0;
  4459. if (list[i].membCount == 0) {
  4460. list.splice(i, 1);
  4461. i--;
  4462. } else if (list[i].children != null) {
  4463. this.removeEmptyNode(list[i].children);
  4464. }
  4465. }
  4466. },
  4467. calculateMembCount(list) {
  4468. for (var i in list) {
  4469. var cnt = 0;
  4470. if (list[i].children != null) {
  4471. this.calculateMembCount(list[i].children);
  4472. for (var m in list[i].children) {
  4473. cnt += list[i].children[m].membCount;
  4474. }
  4475. }
  4476. if (list[i].isUser == 1) {
  4477. cnt++;
  4478. this.membCount++;
  4479. }
  4480. list[i].membCount = cnt;
  4481. }
  4482. },
  4483. stateChange() {
  4484. // console.log(this.allData,'alldate');
  4485. this.membCount = 0;
  4486. if (this.selectState == -1) {
  4487. //全部状态
  4488. this.data = this.allData;
  4489. } else {
  4490. //未填报
  4491. this.seluserText = ''
  4492. var newData = JSON.parse(JSON.stringify(this.allData));
  4493. this.filterState(this.selectState, newData);
  4494. this.data = newData;
  4495. }
  4496. this.calculateMembCount(this.data);
  4497. this.data[0].membCount = this.membCount;//总人数
  4498. },
  4499. //按状态过滤部门人员
  4500. filterState(state, list) {
  4501. for (var i =0;i<list.length; i++) {
  4502. var obj = list[i];
  4503. if (obj.isUser == 1) {
  4504. var match = false;
  4505. if (state == -2) {
  4506. if (obj.state == null) {
  4507. match = true;
  4508. }
  4509. } else {
  4510. if (obj.state == state) {
  4511. match = true;
  4512. }
  4513. }
  4514. if (!match) {
  4515. list.splice(i, 1);
  4516. i--;
  4517. } else {
  4518. }
  4519. } else {
  4520. if (obj.children != null) {
  4521. this.filterState(state, obj.children);
  4522. }
  4523. }
  4524. }
  4525. },
  4526. //a按名称过滤部门人员
  4527. async seluserforText(){
  4528. const { userNameNeedTranslate } = this.user
  4529. this.membCount = 0;
  4530. var newData = JSON.parse(JSON.stringify(this.allData));
  4531. let textList = [this.seluserText]
  4532. if(userNameNeedTranslate == 1) {
  4533. this.dataLoading = true
  4534. let res = await this.postData('/user/getEmployeeList', {
  4535. keyword: this.seluserText,
  4536. cursor: '',
  4537. departmentId: -1,
  4538. pageIndex: 1,
  4539. pageSize: 1000
  4540. })
  4541. textList = res.data.records.map(item => item.name)
  4542. this.dataLoading = false
  4543. }
  4544. // return
  4545. console.log(textList, '<=== textList')
  4546. this.seluserforTextin(this.seluserText, newData, textList)
  4547. console.log(newData, 'Data')
  4548. this.data = newData;
  4549. this.calculateMembCount(this.data);
  4550. this.data[0].membCount = this.membCount;//总人数
  4551. },
  4552. seluserforTextin(text, list, textList = []){
  4553. for (var i =0;i<list.length; i++) {
  4554. var obj = list[i];
  4555. if (obj.isUser == 1) {
  4556. var match = false;
  4557. // if (obj.label.indexOf(text) != -1) {
  4558. // match = true
  4559. // }
  4560. if(textList.some(item => item.includes(obj.label))) {
  4561. match = true
  4562. }
  4563. if (!match) {
  4564. list.splice(i, 1);
  4565. i--;
  4566. } else {
  4567. }
  4568. } else {
  4569. if (obj.children != null) {
  4570. this.seluserforTextin(text, obj.children, textList);
  4571. }
  4572. }
  4573. }
  4574. },
  4575. // 当节点发生变化时
  4576. nodeChangeExpand(data) {
  4577. // 保存当前展开的节点
  4578. let flag = false
  4579. this.nodeModelData.some(item => {
  4580. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4581. flag = true
  4582. return true
  4583. }
  4584. })
  4585. if (!flag) { // 不存在则存到数组里
  4586. this.nodeModelData.push(data.id)
  4587. }
  4588. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4589. },
  4590. nodeChangeCollapse(data) {
  4591. console.log(this.nodeModelData)
  4592. this.nodeModelData.some((item, i) => {
  4593. if (item === data.id) {
  4594. this.nodeModelData.length = i
  4595. }
  4596. })
  4597. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4598. },
  4599. // 部门列表点击
  4600. handleNodeClick(data) {
  4601. // this.dealList = data
  4602. this.theValues(data.id, this.allData)
  4603. // this.depData = data;
  4604. var list = [];
  4605. if (data.id == -1) {
  4606. this.deptId = null;
  4607. this.targetUid = null;
  4608. list = this.data;
  4609. } else if (data.isUser == 1) {
  4610. this.deptId = null;
  4611. this.targetUid = data.id;
  4612. } else {
  4613. this.deptId = data.id;
  4614. this.targetUid = null;
  4615. list.push(data);
  4616. }
  4617. this.getReportList();
  4618. if (list.length > 0) {
  4619. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4620. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4621. }
  4622. },
  4623. exportPushLog(){
  4624. this.http.post('/sap-sync-log/export',{},
  4625. res => {
  4626. if (res.code == "ok") {
  4627. var filePath = res.data;
  4628. var fName = '推送日志.xlsx'
  4629. const a = document.createElement('a'); // 创建a标签
  4630. a.setAttribute('download', fName);// download属性
  4631. a.setAttribute('href', filePath);// href链接
  4632. a.click(); //自执行点击事件
  4633. a.remove();
  4634. } else {
  4635. this.$message({
  4636. message: res.msg,
  4637. type: "error"
  4638. });
  4639. }
  4640. },
  4641. error => {
  4642. this.$message({
  4643. message: error,
  4644. type: "error"
  4645. });
  4646. });
  4647. },
  4648. theValues(id, item) {
  4649. for(var i in item) {
  4650. if(item[i].id == id) {
  4651. this.depData = item[i]
  4652. if(id == '-1') {
  4653. this.translation = '1'
  4654. } else {
  4655. if(item[i].children) {
  4656. this.translation = '2'
  4657. } else {
  4658. this.translation = '3'
  4659. }
  4660. }
  4661. return
  4662. } else {
  4663. if(item[i].children) {
  4664. this.theValues(id, item[i].children)
  4665. }
  4666. }
  4667. }
  4668. },
  4669. //获取可以选择的代填的人员列表
  4670. getSubstitudeUserDeptList() {
  4671. if (this.deptMembData.length == 0) {
  4672. this.http.post("/department/listMyMembs", {},
  4673. res => {
  4674. if (res.code == "ok") {
  4675. let noAllData = JSON.parse(JSON.stringify(res.data));
  4676. if (noAllData.length > 0) {
  4677. // if (noAllData[0].label == '全部人员') {
  4678. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4679. noAllData.splice(0,1);
  4680. }
  4681. }
  4682. this.setUserToDept(noAllData);
  4683. this.deptMembData = noAllData;
  4684. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4685. console.log(this.deptMembData, '代填人员数据')
  4686. } else {
  4687. this.$message({
  4688. message: res.msg,
  4689. type: "error"
  4690. });
  4691. }
  4692. },
  4693. error => {
  4694. this.$message({
  4695. message: error,
  4696. type: "error"
  4697. });
  4698. });
  4699. }
  4700. },
  4701. // 获取部门列表
  4702. getDepartmentForApprove() {
  4703. this.http.post( this.port.manage.depList, {},
  4704. res => {
  4705. if (res.code == "ok") {
  4706. var list1 = JSON.parse(JSON.stringify(res.data));
  4707. this.deptOptionList = this.changeArr(list1);
  4708. console.log(this.deptOptionList, '部门')
  4709. } else {
  4710. this.$message({
  4711. message: res.msg,
  4712. type: "error"
  4713. });
  4714. }
  4715. },
  4716. error => {
  4717. this.$message({
  4718. message: error,
  4719. type: "error"
  4720. });
  4721. });
  4722. },
  4723. // 获取部门列表
  4724. getDepartment() {
  4725. //如果没有权限,就不需要获取
  4726. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4727. return;
  4728. }
  4729. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4730. var param = {date:this.date + day};
  4731. this.http.post("/report/getMembList", param,
  4732. res => {
  4733. if (res.code == "ok") {
  4734. if(res.data.length == 0){
  4735. return
  4736. }
  4737. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4738. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4739. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4740. // if (this.user.role > 0) {
  4741. // }
  4742. list.splice(0,0,{
  4743. id: -1,
  4744. label: this.$t('lable.allStaff'),
  4745. })
  4746. this.membCount = 0;
  4747. //设置员工到部门下面
  4748. this.setUserToDept(list);
  4749. this.data = list;
  4750. // console.log('data',this.data);
  4751. this.expandDate = [this.data[1].id]
  4752. this.allData = list;
  4753. // if (noAllData.length > 0) {
  4754. // if (noAllData[0].label == '全部人员') {
  4755. // noAllData.splice(0,1);
  4756. // }
  4757. // }
  4758. // this.setUserToDept(noAllData);
  4759. // this.deptMembData = noAllData;
  4760. this.option = this.changeArr(list1);
  4761. list[0].membCount = this.membCount;
  4762. if (this.depData.id == -1) {
  4763. this.depData.membCount = this.membCount;
  4764. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4765. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4766. } else {
  4767. if (this.depData.isUser == null) {
  4768. var dep = this.findTargetDept(this.data, this.depData.id);
  4769. var membDeptList = [];
  4770. membDeptList.push(dep);
  4771. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4772. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4773. }
  4774. }
  4775. if (this.depData.isUser == null) {
  4776. if (this.isFill) {
  4777. this.fillMembList = this.fillList;
  4778. } else {
  4779. this.fillMembList = this.unFillList;
  4780. }
  4781. }
  4782. this.leaveAllNum = 0
  4783. for(let i in this.unFillList){
  4784. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4785. this.leaveAllNum += 1
  4786. }
  4787. }
  4788. this.stateChange()
  4789. } else {
  4790. this.$message({
  4791. message: res.msg,
  4792. type: "error"
  4793. });
  4794. }
  4795. },
  4796. error => {
  4797. this.$message({
  4798. message: error,
  4799. type: "error"
  4800. });
  4801. });
  4802. this.getReportFillStatus();
  4803. },
  4804. findTargetDept(list, deptId) {
  4805. var t = null;
  4806. for (var i=0;i<list.length; i++) {
  4807. if (list[i].isUser == null && list[i].id == deptId) {
  4808. t = list[i];
  4809. break;
  4810. }
  4811. }
  4812. if (t == null) {
  4813. for (var i=0;i<list.length; i++) {
  4814. if (list[i].children != null && list[i].children.length > 0) {
  4815. t = this.findTargetDept(list[i].children, deptId);
  4816. if (t != null) {
  4817. break;
  4818. }
  4819. }
  4820. }
  4821. }
  4822. return t;
  4823. },
  4824. getUserMembListFromDeptList(list, isFill) {
  4825. var membList = [];
  4826. for (var i in list) {
  4827. var deptName = list[i].label;
  4828. if (list[i].userList != null) {
  4829. list[i].userList.forEach(element => {
  4830. if (isFill == 0) {
  4831. //获取未填的
  4832. if (element.state == null) {
  4833. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4834. membList.push(obj);
  4835. }
  4836. } else {
  4837. if (element.state != null) {
  4838. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4839. membList.push(obj);
  4840. }
  4841. }
  4842. });
  4843. }
  4844. if (list[i].children != null) {
  4845. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4846. }
  4847. }
  4848. return membList;
  4849. },
  4850. setUserToDept(list) {
  4851. for (var i in list) {
  4852. var cnt = 0;
  4853. if (list[i].children != null) {
  4854. this.setUserToDept(list[i].children);
  4855. for (var m in list[i].children) {
  4856. cnt += list[i].children[m].membCount;
  4857. }
  4858. }
  4859. if (list[i].userList != null) {
  4860. if (list[i].children == null) {
  4861. list[i].children = [];
  4862. }
  4863. list[i].userList.forEach(element => {
  4864. var obj = {
  4865. id: element.id,
  4866. label:element.name,
  4867. state:element.state,
  4868. parentId:element.departmentId,
  4869. isUser:1,
  4870. workingTime: element.workingTime,
  4871. leaveDays: element.leaveDays,
  4872. leaveTimes: element.leaveTimes
  4873. };
  4874. list[i].children.push(obj);
  4875. this.membCount++;
  4876. cnt++;
  4877. });
  4878. }
  4879. list[i].membCount = cnt;
  4880. }
  4881. },
  4882. // 修改数组
  4883. changeArr(arr) {
  4884. for (var i = 0; i < arr.length; i++) {
  4885. if(arr[i].id != -1 && arr[i].id != 0) {
  4886. if (arr[i].children != null && arr[i].children.length>0) {
  4887. arr[i].children = this.changeArr(arr[i].children);
  4888. }
  4889. arr[i].id && (arr[i].value = arr[i].id);
  4890. delete arr[i].id;
  4891. }
  4892. }
  4893. for(var i in arr) {
  4894. if(arr[i].id == -1 || arr[i].id == 0) {
  4895. arr.splice(i,1)
  4896. }
  4897. }
  4898. return arr;
  4899. },
  4900. //时间段范围设置改动,监听
  4901. onTimeTypeChange(timeType) {
  4902. this.seleChn(1)
  4903. this.showAddMore = true;
  4904. for(var i in this.workForm.domains) {
  4905. if (this.workForm.domains[i].timeType == 0) {
  4906. this.showAddMore = false;
  4907. break;
  4908. }
  4909. }
  4910. if (this.showAddMore) {
  4911. //检测数量
  4912. if (this.workForm.domains.length == 2) {
  4913. this.showAddMore = false;
  4914. } else {
  4915. this.showAddMore = true;
  4916. }
  4917. }
  4918. },
  4919. getTimeType() {
  4920. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4921. res => {
  4922. if (res.code == "ok") {
  4923. var t = res.data;
  4924. this.reportTimeType = t;
  4925. if (this.reportTimeType.type > 0) {
  4926. this.showAddMore = true;
  4927. }
  4928. //转化时间格式
  4929. if (t.allday != null) {
  4930. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4931. }
  4932. if (t.am != null) {
  4933. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4934. }
  4935. if (t.pm != null) {
  4936. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4937. }
  4938. let arr = []
  4939. for(var i in res.data.excludeTimeList) {
  4940. let obj = {
  4941. s: res.data.excludeTimeList[i].startTime,
  4942. e: res.data.excludeTimeList[i].endTime,
  4943. }
  4944. arr.push(obj)
  4945. }
  4946. this.vacationTime = arr
  4947. } else {
  4948. this.$message({
  4949. message: res.msg,
  4950. type: "error"
  4951. });
  4952. }
  4953. },
  4954. error => {
  4955. this.listLoading = false;
  4956. this.$message({
  4957. message: error,
  4958. type: "error"
  4959. });
  4960. });
  4961. },
  4962. // 改变月份 -------
  4963. changeMonthOut() {
  4964. this.getAllDate();
  4965. this.getReportList();
  4966. this.getDepartment();
  4967. },
  4968. // 选择日期
  4969. choseDate(i, item) {
  4970. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4971. return
  4972. }
  4973. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4974. this.choseDay = i;
  4975. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4976. sessionStorage.msg = this.date + day,
  4977. this.getReportList();
  4978. this.getDepartment();
  4979. this.curDate = item.date;
  4980. },
  4981. canClick(i, item){
  4982. let nowDate = new Date()
  4983. let nowDateYear = nowDate.getFullYear()
  4984. let itemYear = parseInt(this.date.split('-')[0])
  4985. let nowDateMonth = nowDate.getMonth() + 1
  4986. let itemMonth = parseInt(this.date.split('-')[1])
  4987. let nowDateDay = nowDate.getDate()
  4988. let itemDay = parseInt(item.showDate.split('.')[1])
  4989. if(nowDateYear < itemYear){
  4990. return false
  4991. }else if(nowDateYear == itemYear){
  4992. if(nowDateMonth < itemMonth){
  4993. return false
  4994. }else if(nowDateMonth == itemMonth){
  4995. if(nowDateDay < itemDay){
  4996. return false
  4997. }
  4998. }
  4999. }
  5000. },
  5001. // 获取日期列表
  5002. getAllDate(e) {
  5003. var dayArry = [];
  5004. var day = this.getCountDays();
  5005. let curMonthDay = null;
  5006. for (var k = 1; k <= day; k++) {
  5007. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5008. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5009. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5010. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5011. if(sessionStorage.msg) {
  5012. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5013. this.choseDay = k - 1;
  5014. curMonthDay = str;
  5015. }
  5016. } else {
  5017. if (new Date().getDate() == k) {
  5018. this.choseDay = k - 1;
  5019. }
  5020. }
  5021. } else {
  5022. this.choseDay = 0;
  5023. }
  5024. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5025. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5026. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5027. }
  5028. this.allDate = dayArry;
  5029. //不能超过最大日期
  5030. if (this.choseDay > day-1) {
  5031. this.choseDay = day-1;
  5032. }
  5033. if(sessionStorage.from != 1){
  5034. let nowmonth = new Date().getMonth() + 1
  5035. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5036. let nowdate = new Date().getDate()
  5037. if(nowd == this.date){
  5038. if(e && sessionStorage.msg){
  5039. }else{
  5040. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5041. }
  5042. let nowday = new Date(sessionStorage.msg).getDate()
  5043. this.choseDay = nowday - 1
  5044. let monthdate = new Date(sessionStorage.msg)
  5045. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5046. }else{
  5047. if(e && sessionStorage.msg){
  5048. }else{
  5049. sessionStorage.msg = this.date + '-01'
  5050. }
  5051. let monthdate = new Date(sessionStorage.msg)
  5052. this.choseDay = monthdate.getDate() - 1
  5053. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5054. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5055. }
  5056. }else{
  5057. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5058. }
  5059. //从消息点击跳转过来的,直接加载指定日期
  5060. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5061. this.curDate = sessionStorage.msg;
  5062. sessionStorage.from = 0;
  5063. } else {
  5064. // if (curMonthDay != null) {
  5065. // // this.curDate = curMonthDay;
  5066. // let d = new Date(sessionStorage.msg)
  5067. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5068. // } else {
  5069. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5070. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5071. // }
  5072. }
  5073. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5074. // if(!sessionStorage.msg){
  5075. // let msgday = this.choseDay + 1
  5076. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5077. // }
  5078. this.getReportFillStatus();
  5079. },
  5080. getCountDays() {
  5081. var newstr = this.date.replace(/-/g, "/");
  5082. var curDate = new Date(newstr+'/01');
  5083. var curMonth = curDate.getMonth();
  5084. curDate.setMonth(curMonth + 1);
  5085. curDate.setDate(0);
  5086. return curDate.getDate();
  5087. },
  5088. reqMore() {
  5089. if (this.hasMore) {
  5090. this.pageIndex++;
  5091. this.requestHttpReports();
  5092. }
  5093. },
  5094. //加载日报数据
  5095. requestHttpReports() {
  5096. //请求数据
  5097. this.listLoading = true;
  5098. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5099. let param = {date: this.date + day};
  5100. if (this.deptId) {
  5101. param.deptId = this.deptId;
  5102. }
  5103. if (this.targetUid) {
  5104. param.userId = this.targetUid;
  5105. }
  5106. //传页码
  5107. if (this.hasMore) {
  5108. param.pageIndex = this.pageIndex;
  5109. }
  5110. this.http.post( this.port.report.list, param,
  5111. res => {
  5112. this.listLoading = false;
  5113. if (res.code == "ok") {
  5114. //扩增
  5115. this.reportList = this.reportList.concat(res.data.data);
  5116. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5117. if(document.querySelector("#day"+this.choseDay)){
  5118. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5119. }
  5120. } else {
  5121. this.$message({
  5122. message: res.msg,
  5123. type: "error"
  5124. });
  5125. }
  5126. },
  5127. error => {
  5128. this.listLoading = false;
  5129. this.$message({
  5130. message: error,
  5131. type: "error"
  5132. });
  5133. });
  5134. },
  5135. //获取日报列表
  5136. getReportList() {
  5137. //初始化,重置数据
  5138. this.pageIndex = 0;
  5139. this.hasMore = true;
  5140. this.reportList = [];
  5141. this.requestHttpReports();
  5142. },
  5143. //刷新日报状态,用于审核后更新
  5144. refreshReportData(reportId) {
  5145. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5146. res => {
  5147. if (res.code == "ok") {
  5148. for (var m=0;m<this.reportList.length; m++) {
  5149. var d = this.reportList[m].data;
  5150. var find = d.filter(r=>r.id == reportId);
  5151. if (find.length > 0) {
  5152. find[0].state = res.data.state;
  5153. if (find[0].state == 2) {//被驳回,要可以编辑
  5154. this.reportList[m].state = 2;
  5155. }
  5156. find[0].isDeptAudit = res.data.isDeptAudit;
  5157. find[0].departmentAuditState = res.data.departmentAuditState;
  5158. find[0].projectAuditorName = res.data.projectAuditorName;
  5159. find[0].projectAuditorId = res.data.projectAuditorId;
  5160. find[0].projectAuditState = res.data.projectAuditState;
  5161. find[0].rejectUserid = res.data.rejectUserid;
  5162. find[0].rejectUsername = res.data.rejectUsername;
  5163. find[0].rejectReason = res.data.rejectReason;
  5164. this.$forceUpdate();
  5165. break;
  5166. }
  5167. }
  5168. } else {
  5169. this.$message({
  5170. message: res.msg,
  5171. type: "error"
  5172. });
  5173. }
  5174. },
  5175. error => {
  5176. this.listLoading = false;
  5177. this.$message({
  5178. message: error,
  5179. type: "error"
  5180. });
  5181. });
  5182. },
  5183. //导出员工工时统计
  5184. exportUserTime() {
  5185. this.listLoading = true;
  5186. var param = {};
  5187. if (this.exportParam.dateRange != null) {
  5188. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5189. }
  5190. this.http.post('/department/exportDeptStatistic', param,
  5191. res => {
  5192. this.listLoading = false;
  5193. if (res.code == "ok") {
  5194. location.href = res.data;
  5195. this.exportTimeDialog = false;
  5196. } else {
  5197. this.$message({
  5198. message: res.msg,
  5199. type: "error"
  5200. });
  5201. }
  5202. },
  5203. error => {
  5204. this.listLoading = false;
  5205. this.$message({
  5206. message: error,
  5207. type: "error"
  5208. });
  5209. });
  5210. },
  5211. //导出日报
  5212. exportReport() {
  5213. this.exportingData = true;
  5214. var param = {};
  5215. if (this.exportParam.dateRange != null) {
  5216. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5217. }
  5218. if (this.exportParam.projectId != null) {
  5219. param.projectId = this.exportParam.projectId;
  5220. }
  5221. if (this.exportParam.departmentId != null) {
  5222. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5223. }
  5224. param.stateKey = this.stateKey
  5225. // param.departmentId = this.user.departmentId
  5226. console.log(param, '《=== 导出传的参数');
  5227. console.log('开始调用exportReport接口');
  5228. this.http.post(this.port.report.export, param,
  5229. res => {
  5230. this.exportingData = false;
  5231. if (res.code == "ok") {
  5232. location.href = res.data;
  5233. this.exportDialog = false;
  5234. } else {
  5235. this.$message({
  5236. message: res.msg,
  5237. type: "error"
  5238. });
  5239. }
  5240. },
  5241. error => {
  5242. this.exportingData = false;
  5243. this.$message({
  5244. message: error,
  5245. type: "error"
  5246. });
  5247. });
  5248. },
  5249. //获取项目列表
  5250. getProjectList() {
  5251. this.listLoading = true;
  5252. this.http.post( this.port.project.list, {},
  5253. res => {
  5254. this.listLoading = false;
  5255. if (res.code == "ok") {
  5256. for(var i in res.data) {
  5257. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5258. res.data[i].projectCode = ''
  5259. }
  5260. }
  5261. this.projectList = res.data;
  5262. console.log("项目列表",this.projectList);
  5263. } else {
  5264. this.$message({
  5265. message: res.msg,
  5266. type: "error"
  5267. });
  5268. }
  5269. },
  5270. error => {
  5271. this.listLoading = false;
  5272. this.$message({
  5273. message: error,
  5274. type: "error"
  5275. });
  5276. });
  5277. },
  5278. // 获取填报日报的项目下拉列表
  5279. getFillProjectList() {
  5280. this.http.post( this.port.project.list, {
  5281. forReport: 1
  5282. },res => {
  5283. if (res.code == "ok") {
  5284. for(var i in res.data) {
  5285. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5286. res.data[i].projectCode = ''
  5287. }
  5288. }
  5289. this.fillProjectList = res.data;
  5290. this.getRecentlyProject()
  5291. } else {
  5292. this.$message({
  5293. message: res.msg,
  5294. type: "error"
  5295. });
  5296. }
  5297. },
  5298. error => {
  5299. this.$message({
  5300. message: error,
  5301. type: "error"
  5302. });
  5303. });
  5304. },
  5305. getBasecostItemList() {
  5306. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5307. companyId: this.user.companyId
  5308. },
  5309. res => {
  5310. if (res.code == "ok") {
  5311. this.timeBasecostList = res.data;
  5312. }
  5313. });
  5314. },
  5315. getAIReport(createDate) {
  5316. this.http.post('/report/getAIReport', {},
  5317. res => {
  5318. if (res.code == "ok") {
  5319. var quanbu = 0
  5320. this.jsDay = 1
  5321. var zhi = ''
  5322. var slp = res.data
  5323. for(var i in slp) {
  5324. var sp = +slp[i].workingTime + 0
  5325. zhi = this.jsDay * sp
  5326. quanbu = +quanbu + zhi
  5327. }
  5328. this.jsTime = quanbu
  5329. var aiReportData = res.data;
  5330. this.canCancelInDialog = false
  5331. if(aiReportData.length != 0) {
  5332. var arr = [];
  5333. for(var i in aiReportData) {
  5334. arr.push({
  5335. id: null,
  5336. projectId: aiReportData[i].projectId,
  5337. workingTime: aiReportData[i].workingTime,
  5338. content: '',
  5339. progress:100,
  5340. state: 2,
  5341. timeType: aiReportData[i].timeType,
  5342. subProjectList: aiReportData[i].subProjectList,
  5343. taskList: aiReportData[i].taskList,
  5344. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5345. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5346. taskId: aiReportData[i].taskId,
  5347. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5348. startTime: aiReportData[i].startTime,
  5349. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5350. endTime: aiReportData[i].endTime,
  5351. isOvertime: 0,
  5352. progress:aiReportData[i].progress,
  5353. professionProgress: aiReportData[i].professionProgressList,
  5354. stages:aiReportData[i].stages,
  5355. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5356. pics: null,
  5357. multiWorktime: aiReportData[i].multiWorktime,
  5358. worktimeList: [{}],
  5359. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5360. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5361. wuduList: aiReportData[i].degreeList,
  5362. taskGroups:aiReportData[i].taskGroups,
  5363. customData: aiReportData[i].customData,//自定义的数值
  5364. auditUserList: aiReportData[i].auditUserList,
  5365. projectAuditorId: aiReportData[i].projectAuditorId,
  5366. projectAuditorName: aiReportData[i].projectAuditorName,
  5367. overtimeHours: aiReportData[i].overtimeHours,
  5368. customText: aiReportData[i].customText,
  5369. basecostId: aiReportData[i].basecostId,
  5370. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5371. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5372. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5373. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5374. canEdit: true
  5375. })
  5376. }
  5377. this.workForm.domains = arr;
  5378. } else {
  5379. }
  5380. this.canEdit = true;
  5381. this.originCanEdit = true;
  5382. this.seleChn()
  5383. } else {
  5384. this.$message({
  5385. message: res.msg,
  5386. type: "error"
  5387. });
  5388. }
  5389. },
  5390. error => {
  5391. this.$message({
  5392. message: error,
  5393. type: "error"
  5394. });
  5395. });
  5396. },
  5397. // 获取个人某天的日报 111111
  5398. getReport() {
  5399. this.http.post( this.port.report.getPort, {
  5400. date: this.workForm.createDate
  5401. },
  5402. res => {
  5403. if (res.code == "ok") {
  5404. var quanbu = 0
  5405. this.jsDay = 1
  5406. var zhi = ''
  5407. var slp = res.data.report
  5408. for(var i in slp) {
  5409. var sp = +slp[i].workingTime + 0
  5410. zhi = this.jsDay * sp
  5411. quanbu = +quanbu + zhi
  5412. }
  5413. this.jsTime = quanbu
  5414. var list = res.data;
  5415. this.report = list;
  5416. this.reportTimeType = this.report.timeType;
  5417. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5418. this.isWeekend = !this.report.isWorkDay;
  5419. this.canCancelInDialog = false;
  5420. this.hasWrittenReport = list.report.length != 0;
  5421. if(list.report.length != 0) {
  5422. var arr = [];
  5423. this.canEdit = false;
  5424. let candelete = true
  5425. for(var i in list.report) {
  5426. var flg = null
  5427. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5428. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5429. var filteredRespList = null
  5430. if (targetP.length > 0) {
  5431. var isPublic = targetP[0].isPublic;
  5432. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5433. }
  5434. arr.push({
  5435. id: list.report[i].id,
  5436. projectId: list.report[i].projectId,
  5437. workingTime: list.report[i].workingTime,
  5438. content: list.report[i].content,
  5439. state: list.report[i].state,
  5440. timeType: list.report[i].timeType,
  5441. subProjectList: list.report[i].subProjectList,
  5442. taskList: list.report[i].taskList,
  5443. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5444. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5445. taskId: list.report[i].taskId,
  5446. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5447. startTime: list.report[i].startTime,
  5448. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5449. endTime: list.report[i].endTime,
  5450. isOvertime: flg,
  5451. progress:list.report[i].progress,
  5452. professionProgress: list.report[i].professionProgressList,
  5453. stages:list.report[i].stages,
  5454. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5455. pics: list.report[i].pics,
  5456. multiWorktime: list.report[i].multiWorktime,
  5457. worktimeList: list.report[i].worktimeList,
  5458. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5459. multiDegrIdArray: list.report[i].multiDegrIdList,
  5460. wuduList: list.report[i].degreeList,
  5461. taskGroups:list.report[i].taskGroups,
  5462. customData: list.report[i].customData,//自定义的数值
  5463. auditUserList: list.report[i].auditUserList,
  5464. projectAuditorId: list.report[i].projectAuditorId,
  5465. projectAuditorName: list.report[i].projectAuditorName,
  5466. overtimeHours: list.report[i].overtimeHours,
  5467. customText: list.report[i].customText,
  5468. basecostId: list.report[i].basecostId,
  5469. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5470. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5471. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5472. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5473. canEdit: list.report[i].state >= 2 ? true : false,
  5474. extraField1: list.report[i].extraField1,
  5475. extraField2: list.report[i].extraField2,
  5476. extraField3: list.report[i].extraField3,
  5477. workContentList: list.report[i].workContentList,
  5478. filteredRespList: filteredRespList,
  5479. serviceList: list.report[i].serviceList,
  5480. sapServiceId: list.report[i].sapServiceId,
  5481. })
  5482. if (list.report[i].state >= 2) {
  5483. this.canEdit = true;
  5484. }
  5485. if(list.report[i].state < 2){
  5486. candelete = false
  5487. }
  5488. if (list.report[i].state == 0){
  5489. this.canCancelInDialog = true
  5490. }
  5491. // 加判断
  5492. if(this.user.timeType.choseFromAlbum == 1) {
  5493. let arrList = []
  5494. for(var k in list.report[i].pics) {
  5495. let obj = {
  5496. name: k,
  5497. url: list.report[i].pics[k]
  5498. }
  5499. arrList.push(obj)
  5500. }
  5501. arr[i].imgListUrl = arrList
  5502. arr[i].imgList = list.report[i].pics
  5503. }
  5504. }
  5505. this.reportCanDelete = candelete
  5506. this.workForm = {
  5507. createDate: this.workForm.createDate,
  5508. domains: arr,
  5509. userNames:null,
  5510. userId:null,
  5511. time: list.time
  5512. }
  5513. console.log('workForm', this.workForm)
  5514. } else {
  5515. this.workForm = {
  5516. createDate: this.workForm.createDate,
  5517. domains: [{
  5518. id: null,
  5519. projectId: "",
  5520. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5521. content: "",
  5522. progress:100,
  5523. state: 2,
  5524. timeType:0,
  5525. multiWorktime: this.reportTimeType.multiWorktime,
  5526. worktimeList:[{}],
  5527. canEdit: true,
  5528. auditorFirst: '',
  5529. auditorSec: '',
  5530. auditorThird: '',
  5531. ccUserid: ''
  5532. }],
  5533. userId:null,
  5534. userNames:null,
  5535. time: this.report.time
  5536. }
  5537. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5538. this.$set(this.workForm.domains[0],'isOvertime',true)
  5539. if(this.reportTimeType.type != 2){
  5540. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5541. }
  5542. }
  5543. if(this.user.timeType.type == 1) {
  5544. var shuzhi = this.user.timeType.allday + ''
  5545. // console.log('执行一次', shuzhi.indexOf('.'))
  5546. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5547. }
  5548. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5549. //默认给第一个,必填字段
  5550. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5551. }
  5552. this.canEdit = true;
  5553. }
  5554. this.originCanEdit = this.canEdit;
  5555. this.seleChn()
  5556. } else {
  5557. this.$message({
  5558. message: res.msg,
  5559. type: "error"
  5560. });
  5561. }
  5562. },
  5563. error => {
  5564. this.$message({
  5565. message: error,
  5566. type: "error"
  5567. });
  5568. });
  5569. },
  5570. guanbi() {
  5571. this.falsss = false,
  5572. this.workTimeForMinYi=0
  5573. },
  5574. // 打开日报填写
  5575. fillInReport(i, isBatch) {
  5576. this.isWeekend = false
  5577. this.reportCanDelete = false
  5578. // console.log(this.user.timeType.type, '选择时长')
  5579. if(i != 1) {
  5580. this.falsss = false
  5581. } else {
  5582. this.falsss = true
  5583. }
  5584. if (this.isSubstitude) {
  5585. this.getSubstitudeUserDeptList();
  5586. }
  5587. if(i == -1 || this.isSubstitude) {
  5588. this.isDisable = false;
  5589. } else {
  5590. this.isDisable = true;
  5591. }
  5592. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5593. this.isBatch = isBatch;
  5594. if (this.isBatch == 0 && !this.isSubstitude) {
  5595. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5596. let weekday = new Date(this.workForm.createDate).getDay()
  5597. if(this.user.companyId == 817){
  5598. if(weekday == 0){
  5599. this.isWeekend = true
  5600. }
  5601. }else{
  5602. if(weekday == 0 || weekday == 6){
  5603. this.isWeekend = true
  5604. }
  5605. }
  5606. this.getReport(i);
  5607. } else {
  5608. // console.log('执行到了这里')
  5609. this.jsTime = 0
  5610. this.jsDay = 0
  5611. this.workForm = {
  5612. createDate: null,//批量填报没有日期
  5613. domains: [{
  5614. id: null,
  5615. projectId: "",
  5616. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5617. content: "",
  5618. progress:100,
  5619. state: 2,
  5620. timeType:0,
  5621. multiWorktime: this.reportTimeType.multiWorktime,
  5622. worktimeList:[{}],
  5623. canEdit: true,
  5624. }],
  5625. }
  5626. if(this.user.timeType.type == 1) {
  5627. var shuzhi = this.user.timeType.allday + ''
  5628. // console.log('执行二次')
  5629. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5630. }
  5631. // console.log(this.workForm)
  5632. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5633. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5634. }
  5635. this.canEdit = true;
  5636. }
  5637. this.dialogVisible = true;
  5638. },
  5639. //按周填报的弹窗口中编辑单项目相关数据
  5640. setWeekFormReportItem(reportId, i, names, row,sss) {
  5641. console.log(sss)
  5642. this.http.post('/report/getReportById', {
  5643. reportId: reportId
  5644. },
  5645. res => {
  5646. if (res.code == "ok") {
  5647. var data = res.data.report;
  5648. sss.subProjectId = data.subProjectId
  5649. sss.subProjectList = data.subProjectList;
  5650. sss.stage = data.stage
  5651. sss.subProjectList = data.subProjectList
  5652. sss.stages = data.stages
  5653. sss.taskGroups = data.taskGroups;
  5654. sss.auditUserList = data.auditUserList;
  5655. sss.degreeId = data.degreeId;
  5656. sss.customData = data.customData;
  5657. sss.wuduList = data.degreeList;
  5658. this.zhoBaoIdx = i
  5659. this.zhoBaoName = names
  5660. this.zhoBao = sss
  5661. this.zhis = row
  5662. if (sss.groupId) {
  5663. //最后一个参数表示是否保留stage的值,不要重置为空
  5664. this.getGroupStages(this.zhoBao, 0, true)
  5665. }
  5666. this.$forceUpdate();
  5667. }
  5668. });
  5669. },
  5670. // 按周填报里内容的填写
  5671. tianxies(item, i, names, row) {
  5672. if (item.state == 0) {
  5673. this.$message({
  5674. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5675. type: "error"
  5676. });
  5677. return;
  5678. }
  5679. if (item.state == 1) {
  5680. this.$message({
  5681. message: '已通过状态不可修改',
  5682. type: "error"
  5683. });
  5684. return;
  5685. }
  5686. if(this.user.timeType.notAllowedNoAttendance == 1){
  5687. if(this.zhoData[i].corpTime){
  5688. if(this.zhoData[i].corpTime.workHours == 0){
  5689. this.$message({
  5690. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5691. type: 'error'
  5692. })
  5693. return
  5694. }
  5695. }else{
  5696. this.$message({
  5697. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5698. type: 'error'
  5699. })
  5700. return
  5701. }
  5702. }
  5703. var idd = ''
  5704. var obj = {}
  5705. for(var l in this.projectList) {
  5706. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5707. }
  5708. obj.projectId = idd
  5709. this.tianxieDialogVisible = true
  5710. this.scopess = item
  5711. console.log(item, '《==== 当前的对象')
  5712. var sss = {}
  5713. if (item.id != null) {
  5714. sss.id = item.id;
  5715. sss.state = item.state;
  5716. } else {
  5717. sss.id = -1;
  5718. sss.state = 3;
  5719. }
  5720. sss.projectId = idd;
  5721. sss.progress = item.progress
  5722. sss.time = item.time
  5723. sss.content = item.content;
  5724. console.log('333', sss.content)
  5725. if (sss.time == '' && this.reportTimeType.type == 2) {
  5726. //取已填时间范围中最大的一个作为开始时间
  5727. var startTime = '09:00';
  5728. var fillStartTime = '00:00';
  5729. for (var t in this.selProjectList) {
  5730. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5731. if (fillItem.time) {
  5732. if (fillItem.time[1] > fillStartTime) {
  5733. fillStartTime = fillItem.time[1];
  5734. }
  5735. }
  5736. }
  5737. if (fillStartTime == '00:00') {
  5738. fillStartTime = '09:00';
  5739. }
  5740. var fillEndMax = '18:00';
  5741. if (fillStartTime >= '18:00') {
  5742. fillEndMax = '23:59';
  5743. }
  5744. sss.time = [fillStartTime, fillEndMax];
  5745. }
  5746. sss.groupId = item.groupId
  5747. sss.stage = item.stage;
  5748. sss.workingTime = item.workingTime
  5749. sss.projectAuditorId = item.projectAuditorId;
  5750. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5751. //默认选中第一个
  5752. sss.basecostId = this.timeBasecostList[0].id;
  5753. }
  5754. var hasEdited = this.zhoData[i][names].hasEdited;
  5755. if (hasEdited) {
  5756. sss = { ...item }
  5757. //编辑过了
  5758. sss.subProjectId = item.subProjectId
  5759. sss.stage = item.stage
  5760. sss.subProjectList = item.subProjectList
  5761. sss.stages = item.stages
  5762. sss.taskGroups = item.taskGroups;
  5763. console.log(sss.taskGroups, '33333');
  5764. sss.auditUserList = obj.auditUserList;
  5765. sss.degreeId = item.degreeId;
  5766. sss.customData = item.customData;
  5767. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5768. //只有一个审核人,自动设置上去
  5769. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5770. }
  5771. sss.wuduList = item.wuduList;
  5772. this.zhoBaoIdx = i
  5773. this.zhoBaoName = names
  5774. this.zhoBao = sss
  5775. this.zhis = row
  5776. if (sss.groupId) {
  5777. //最后一个参数表示是否保留stage的值,不要重置为空
  5778. this.getGroupStages(this.zhoBao, 0, true)
  5779. }
  5780. this.$forceUpdate();
  5781. this.getWeeklyTaskList(sss)
  5782. console.log('最后的周报 ===>', this.zhoBao)
  5783. } else {
  5784. //第一次打开,获取数据
  5785. if (sss.id == -1) {
  5786. //新填报的
  5787. this.selectProject(obj, 0);
  5788. var that = this
  5789. setTimeout(() =>{
  5790. sss.subProjectId = that.workForm.domains[0].subProjectId
  5791. sss.subProjectList = item.subProjectList;
  5792. sss.stage = that.workForm.domains[0].stage
  5793. sss.subProjectList = that.workForm.domains[0].subProjectList
  5794. sss.stages = that.workForm.domains[0].stages
  5795. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5796. sss.auditUserList = obj.auditUserList;
  5797. sss.degreeId = item.degreeId;
  5798. sss.customData = item.customData;
  5799. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5800. //只有一个审核人,自动设置上去
  5801. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5802. }
  5803. sss.wuduList = row[0].wuduList
  5804. that.zhoBaoIdx = i
  5805. that.zhoBaoName = names
  5806. that.zhoBao = sss
  5807. that.zhis = row
  5808. if (sss.groupId) {
  5809. //最后一个参数表示是否保留stage的值,不要重置为空
  5810. this.getGroupStages(that.zhoBao, 0, false)
  5811. }
  5812. that.$forceUpdate();
  5813. this.getWeeklyTaskList(sss)
  5814. },600);
  5815. } else {
  5816. //编辑填报过的;数据库已经存在的
  5817. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5818. }
  5819. }
  5820. },
  5821. // 按周填报里内容的填写点击确定
  5822. setWeekProItemData() {
  5823. //专业版模式下,任务分组和阶段必填
  5824. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5825. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5826. this.$message({
  5827. message: '任务分组和阶段必填,请检查',
  5828. type: "error"
  5829. });
  5830. return;
  5831. }
  5832. }
  5833. //检查子项目是否必填
  5834. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5835. this.$message({
  5836. message: '子项目必填,请检查',
  5837. type: "error"
  5838. });
  5839. return;
  5840. }
  5841. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5842. this.$message({
  5843. message: this.$t('message.Pleaseselectareviewer'),
  5844. type: "error"
  5845. });
  5846. return
  5847. }
  5848. if(this.user.timeType.reportAuditType == 3){
  5849. let auditTips = ''
  5850. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5851. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5852. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5853. if(auditTips){
  5854. auditTips = auditTips.substring(0,auditTips.length - 1)
  5855. this.$message({
  5856. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5857. type: 'error'
  5858. })
  5859. return
  5860. }
  5861. }
  5862. let errtips = ''
  5863. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5864. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5865. errtips += this.user.timeType.customDegreeName + '、'
  5866. }
  5867. }
  5868. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5869. errtips += this.user.timeType.customDataName + '、'
  5870. }
  5871. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5872. errtips += this.user.timeType.customTextName + '、'
  5873. }
  5874. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5875. errtips += this.$t('other.workMatters') +'、'
  5876. }
  5877. if(errtips){
  5878. errtips = errtips.substring(0,errtips.length - 1)
  5879. this.$message({
  5880. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5881. type: 'error'
  5882. })
  5883. return
  5884. }
  5885. this.tianxieDialogVisible = false
  5886. var zhong = this.zhoData
  5887. this.zhoBao.hasEdited = true;
  5888. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5889. this.zhoData = zhong
  5890. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5891. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5892. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5893. },
  5894. // 获取本周
  5895. getCurrentWeek() {
  5896. //今天
  5897. this.targetWeekDate = new Date();
  5898. this.initWeekFormData();
  5899. // this.jiazai()
  5900. },
  5901. // 获取上周
  5902. handleGetPrevWeek() {
  5903. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5904. this.initWeekFormData();
  5905. // this.jiazai()
  5906. },
  5907. // 获取下周
  5908. handleGetNextvWeek() {
  5909. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5910. this.initWeekFormData()
  5911. },
  5912. // 加载动画
  5913. jiazai() {
  5914. this.weekDataLoading = true
  5915. var that = this
  5916. setTimeout(() =>{
  5917. that.weekDataLoading = false
  5918. },1000);
  5919. },
  5920. // 转时间格式
  5921. dealdate(date) {
  5922. const dt = new Date(date)
  5923. const y = dt.getFullYear()
  5924. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5925. const d = (dt.getDate() + '').padStart(2, '0')
  5926. return `${y}-${m}-${d}`
  5927. },
  5928. // 按周填报
  5929. fillInReportss() {
  5930. window.addEventListener('scroll', this.handleScroll, true)
  5931. // this.jiazai()
  5932. this.fillWeekDialogVisi = true
  5933. this.getCurrentWeek();
  5934. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5935. //重新获取工时预警类型的预算项
  5936. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5937. companyId: this.user.companyId
  5938. },
  5939. res => {
  5940. if (res.code == "ok") {
  5941. this.timeBasecostList = res.data;
  5942. }
  5943. });
  5944. }
  5945. },
  5946. fillInReportCustom() {
  5947. this.weekIndex++
  5948. this.weekParentData = {
  5949. isSubstitude: this.isSubstitude
  5950. }
  5951. this.fillWeekDialogVisiCustom = true
  5952. },
  5953. // 按周填报的项目筛选
  5954. selListFun(){
  5955. this.selProjectList = []
  5956. if(this.selCon.length){
  5957. for (let i = 0; i < this.selCon.length; i++) {
  5958. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5959. }
  5960. this.selConShow = false ;
  5961. for (let i in this.zhoData) {
  5962. var obj = this.zhoData[i];
  5963. for(var j in this.selProjectList) {
  5964. var xinzhi = this.selProjectList[j].projectName
  5965. obj[xinzhi] = {}
  5966. obj[xinzhi].time = ''
  5967. obj[xinzhi].content = ''
  5968. obj[xinzhi].progress = 0
  5969. obj[xinzhi].workingTime = 0
  5970. }
  5971. }
  5972. this.initWeekFormData();
  5973. }else{
  5974. this.$message({
  5975. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5976. type:'error'
  5977. })
  5978. }
  5979. },
  5980. setWeekCardTimeData(list) {
  5981. for(let i in list){
  5982. let datei = '';
  5983. if (this.user.timeType.showDdCardtime == 1) {
  5984. datei = list[i].workDate;
  5985. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5986. datei = list[i].createDate;
  5987. } else if (this.user.timeType.syncFanwei == 1) {
  5988. datei = list[i].workDate;
  5989. }
  5990. for(let m in this.zhoData) {
  5991. if(datei == this.zhoData[m].zhoDataTime){
  5992. let item = {
  5993. startTime: list[i].startTime,
  5994. endTime: list[i].endTime,
  5995. workHours: list[i].workHours
  5996. }
  5997. this.$set(this.zhoData[m],'corpTime',item)
  5998. }
  5999. }
  6000. }
  6001. },
  6002. getWeeklyCardTime(){ //按周填报获取考勤信息
  6003. let dateStr = []
  6004. for(let i in this.zhoData){
  6005. dateStr.push(this.zhoData[i].zhoDataTime)
  6006. }
  6007. this.http.post('/report/getWeeklyCardTime',{
  6008. dateStr: JSON.stringify(dateStr)
  6009. },res => {
  6010. if(res.code == 'ok'){
  6011. for(let i in res.data){
  6012. let datei = '';
  6013. if (this.user.timeType.showDdCardtime == 1) {
  6014. datei = res.data[i].workDate.split('-');
  6015. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6016. datei = res.data[i].createDate.split('-');
  6017. }
  6018. for(let m in this.zhoData){
  6019. let datem = new Date(this.zhoData[m].zhoDataTime)
  6020. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6021. let item = {
  6022. startTime: res.data[i].startTime,
  6023. endTime: res.data[i].endTime,
  6024. workHours: res.data[i].workHours
  6025. }
  6026. this.$set(this.zhoData[m],'corpTime',item)
  6027. }
  6028. }
  6029. }
  6030. }else{
  6031. this.$message({
  6032. message: res.msg,
  6033. type: 'error'
  6034. })
  6035. }
  6036. },err => {
  6037. this.$message({
  6038. message: err,
  6039. type: 'error'
  6040. })
  6041. })
  6042. },
  6043. selListqx(){
  6044. this.fillWeekDialogVisi = false
  6045. this.selProjectList = []
  6046. this.selCon = []
  6047. },
  6048. handleScroll() {
  6049. this.changdu = this.projectList.length + 1
  6050. },
  6051. // 自动选择时间点的事件
  6052. // async zhoTimes(item, i) {
  6053. // var iss = i
  6054. // if(item.time == null) {
  6055. // return
  6056. // } else {
  6057. // const zhi = this.zhoData[iss];
  6058. // let he = 0;
  6059. // const timeArr = Object.values(zhi)
  6060. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6061. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6062. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6063. // console.log(data, 'data');
  6064. // zhi.he = `${he}h`;
  6065. // }
  6066. // },
  6067. async zhoTimes(item, index) {
  6068. const zho = this.zhoData[index];
  6069. if (!item.time) {
  6070. return;
  6071. }
  6072. const timeArr = Object.values(zho)
  6073. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6074. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6075. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6076. zho.he = `${totalHours[0]}h`;
  6077. },
  6078. // 判断两个时间段是否重叠
  6079. timeOverlap(idx, dateAr) {
  6080. let zhi = 0
  6081. for (let k in dateAr) {
  6082. if (idx !== k) {
  6083. 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))) {
  6084. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6085. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6086. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6087. }
  6088. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6089. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6090. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6091. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6092. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6093. } else {
  6094. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6095. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6096. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6097. }
  6098. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6099. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6100. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6101. }
  6102. }
  6103. }
  6104. }
  6105. }
  6106. return zhi
  6107. },
  6108. // 计算时间
  6109. getHourMinutes(str, end) {
  6110. var he = 0
  6111. var date2 = '2021/12/12 ' + end +':00'
  6112. var date1 = '2021/12/12 ' + str +':00'
  6113. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6114. var leave1=date3%(24*3600*1000)
  6115. var hours=Math.floor(leave1/(3600*1000))
  6116. var leave2=leave1%(3600*1000)
  6117. var minutes=Math.floor(leave2/(60*1000))
  6118. var shi = hours+'.'+ minutes
  6119. return he += +shi
  6120. },
  6121. // 自动选择事件长度的事件
  6122. zhoXuan(item, i) {
  6123. var iss = i
  6124. if(item.time == null) {
  6125. return
  6126. } else {
  6127. var zhi = this.zhoData[iss]
  6128. var he = 0
  6129. for(var i in zhi) {
  6130. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6131. he += +zhi[i].workingTime
  6132. }
  6133. }
  6134. zhi.he = he + 'h'
  6135. }
  6136. },
  6137. getPushWorkLogData(){
  6138. this.http.post('/sap-sync-log/list', {},
  6139. res => {
  6140. if (res.code == "ok") {
  6141. this.pushWorkTimeLogData = res.data;
  6142. } else {
  6143. this.$message({
  6144. message: res.msg,
  6145. type: "error"
  6146. });
  6147. }
  6148. },
  6149. error => {
  6150. this.$message({
  6151. message: error,
  6152. type: "error"
  6153. });
  6154. });
  6155. },
  6156. // 获取全部人员
  6157. getUsers() {
  6158. this.http.post('/user/getSimpleActiveUserList', {},
  6159. res => {
  6160. if (res.code == "ok") {
  6161. this.usersList = res.data;
  6162. } else {
  6163. this.$message({
  6164. message: res.msg,
  6165. type: "error"
  6166. });
  6167. }
  6168. },
  6169. error => {
  6170. this.$message({
  6171. message: error,
  6172. type: "error"
  6173. });
  6174. });
  6175. },
  6176. // 按时间比例
  6177. addBli(item, i) {
  6178. var iss = i
  6179. if(item.time == null) {
  6180. return
  6181. } else {
  6182. var zhi = this.zhoData[iss]
  6183. var he = 0
  6184. for(var i in zhi) {
  6185. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6186. he += +zhi[i].workingTime
  6187. }
  6188. }
  6189. zhi.he = he.toFixed(1) + 'h'
  6190. }
  6191. },
  6192. //按周填报选择的项目发生变化,需要设置列
  6193. onSelProjectChange() {
  6194. for (let i = 0; i < this.selCon.length; i++) {
  6195. var exists = false;
  6196. for (let j = 0; j < this.selProjectList.length; j++) {
  6197. if (this.selProjectList[j].id == this.selCon[i]) {
  6198. exists = true;
  6199. break;
  6200. }
  6201. }
  6202. if (!exists) {
  6203. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6204. this.selProjectList.push(newProject);
  6205. //添加新项目
  6206. for (var w in this.zhoData) {
  6207. var dayItem = this.zhoData[w];
  6208. var pName = newProject.projectName;
  6209. dayItem[pName] = {};
  6210. dayItem[pName].time = ''
  6211. dayItem[pName].content = ''
  6212. dayItem[pName].progress = 0
  6213. dayItem[pName].workingTime = 0
  6214. }
  6215. }
  6216. }
  6217. //去掉
  6218. for (let j = 0; j < this.selProjectList.length; j++) {
  6219. var exists = false;
  6220. for (let i = 0; i < this.selCon.length; i++) {
  6221. if (this.selProjectList[j].id == this.selCon[i]) {
  6222. exists = true;
  6223. break;
  6224. }
  6225. }
  6226. if (!exists) {
  6227. this.selProjectList.splice(j, 1);
  6228. j--;
  6229. }
  6230. }
  6231. this.loadFilledWeekReportItem();
  6232. //刷新表格
  6233. // this.$refs.weekTable.doLayout();
  6234. },
  6235. //根据选中的项目来刷新填写表格
  6236. loadFilledWeekReportItem() {
  6237. for (var w in this.zhoData) {
  6238. var dayItem = this.zhoData[w];
  6239. for (var i = 0; i < this.selProjectList.length; i++) {
  6240. var curColumnProject = this.selProjectList[i];
  6241. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6242. for (var t in dayItem.reportList) {
  6243. //有日报的项目,不能取消选择
  6244. for (var p in this.fillProjectList) {
  6245. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6246. }
  6247. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6248. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6249. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6250. if (this.reportTimeType.type == 2) {
  6251. //时间段模式
  6252. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6253. }
  6254. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6255. break;
  6256. }
  6257. }
  6258. // dayItem[curColumnProject.projectName] = matchReportItem;
  6259. }
  6260. }
  6261. this.$nextTick(()=>{
  6262. this.$refs.weekTable.doLayout();
  6263. });
  6264. },
  6265. initWeekFormData() {
  6266. this.weekDataLoading = true;
  6267. for (var p in this.fillProjectList) {
  6268. this.fillProjectList[p].canCancel = 1;
  6269. }
  6270. this.http.post('/report/getWeeklyReportData',{
  6271. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6272. },res => {
  6273. this.weekDataLoading = false;
  6274. if(res.code == 'ok'){
  6275. let projectList = res.data.projectList;
  6276. if (projectList.length > 0) {
  6277. //有选择过项目进行填报,直接选中
  6278. this.selProjectList = projectList;
  6279. this.selCon = [];
  6280. for (let i = 0; i < projectList.length; i++) {
  6281. this.selCon.push(projectList[i].id);
  6282. }
  6283. }
  6284. //设置日期
  6285. this.weekDateRange = res.data.dateList;
  6286. this.zhoData = [];
  6287. var arrst = []
  6288. for(var i in this.weekDateRange) {
  6289. var obj = {}
  6290. obj.zhoDataTime = this.weekDateRange[i].date
  6291. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6292. obj.he = this.weekDateRange[i].filledTime;
  6293. obj.canFill = this.weekDateRange[i].canFill;
  6294. // obj.filledTime = this.weekDateRange[i].filledTime;
  6295. obj.reportList = this.weekDateRange[i].reportList;
  6296. //初始化,防止渲染报错
  6297. for (var j = 0; j < this.selProjectList.length; j++) {
  6298. var pName = this.selProjectList[j].projectName
  6299. obj[pName] = {}
  6300. obj[pName].time = ''
  6301. obj[pName].content = ''
  6302. obj[pName].progress = 0
  6303. obj[pName].workingTime = 0
  6304. }
  6305. arrst.push(obj)
  6306. }
  6307. this.zhoData = arrst
  6308. this.setWeekCardTimeData(res.data.cardTimeList);
  6309. this.loadFilledWeekReportItem();
  6310. }else{
  6311. this.$message({
  6312. message: res.msg,
  6313. type: 'error'
  6314. })
  6315. }
  6316. },err => {
  6317. this.$message({
  6318. message: err,
  6319. type: 'error'
  6320. })
  6321. })
  6322. },
  6323. zhoZhi(res, i) {
  6324. var zhi = 0
  6325. for(var i in res) {
  6326. if(i != 'zhoDataTime' && i != 'he') {
  6327. zhi += +res[i]
  6328. }
  6329. }
  6330. res.he = zhi
  6331. },
  6332. zhoBtn(i) {
  6333. // this.zhoData.split(i, 1)
  6334. var arr = this.zhoData
  6335. arr.splice(i, 1)
  6336. },
  6337. zhoAddlast(){
  6338. this.selConShow = true
  6339. },
  6340. closeAddWeeklyReport(){
  6341. this.fillWeekDialogVisi = false
  6342. this.selConShow = true
  6343. this.selProjectList = []
  6344. this.selCon = []
  6345. },
  6346. // 提交按周填报
  6347. submitWeekReport(isDraft) {
  6348. var zhi = this.zhoData
  6349. var ll = 0
  6350. if(this.reportTimeType.type == 2) {
  6351. for(var i in zhi) {
  6352. this.dateAr = []
  6353. var alp = []
  6354. var zhis = zhi[i]
  6355. console.log(zhis)
  6356. for(var j in zhis) {
  6357. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6358. let objs = {}
  6359. objs.s = zhis[j].time[0]
  6360. objs.e = zhis[j].time[1]
  6361. objs.p = j
  6362. alp.push(objs)
  6363. }
  6364. }
  6365. console.log(alp)
  6366. this.dateAr = alp
  6367. if (this.reportTimeType.timeCanOverlap == 0) {
  6368. let str = this.$t('message.Filledtimeperiodsoverlap')
  6369. if(this.dateAr.length > 0) {
  6370. const trus = this.fns();
  6371. const overlapDataTime = this.getOverlapData(alp);
  6372. if (overlapDataTime.length > 0) {
  6373. const arrList = overlapDataTime.map((item) => item.p);
  6374. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6375. }
  6376. ll += 1
  6377. if(!trus) {
  6378. this.$message({
  6379. message: str,
  6380. type: 'error'
  6381. })
  6382. return false
  6383. }
  6384. }
  6385. } else {
  6386. if(this.dateAr.length > 0) {
  6387. ll +=1 ;
  6388. }
  6389. }
  6390. }
  6391. if(ll == 0) {
  6392. this.$message({
  6393. message: this.$t('message.Pleasefillinthetime'),
  6394. type: 'error'
  6395. })
  6396. return false
  6397. }
  6398. } else if(this.reportTimeType.type == 1){
  6399. for(var i in zhi) {
  6400. var zhis = zhi[i]
  6401. for(var j in zhis) {
  6402. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6403. ll += 1
  6404. }
  6405. }
  6406. }
  6407. if(ll == 0) {
  6408. this.$message({
  6409. message: this.$t('message.Pleaseselectatime'),
  6410. type: 'error'
  6411. })
  6412. return false
  6413. }
  6414. let overcorp = ''
  6415. for(let n in zhi){
  6416. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6417. overcorp += zhi[n].zhoDataTime + ','
  6418. }
  6419. }
  6420. if(overcorp != ''){
  6421. overcorp = overcorp.substring(0,overcorp.length - 1)
  6422. this.$message({
  6423. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6424. type: 'error'
  6425. })
  6426. return
  6427. }
  6428. }
  6429. var submits = []
  6430. let formData = new FormData();
  6431. formData.append("draft", isDraft);
  6432. if(this.reportTimeType.multiWorktime == 1){
  6433. for (var i in this.zhoData) {
  6434. var zhoD = this.zhoData[i]
  6435. var flgs = false
  6436. for(var j in zhoD) {
  6437. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6438. flgs = true
  6439. // formData.append("degreeId", "-1");
  6440. formData.append("id", '-1');
  6441. for(var s in this.projectList) {
  6442. if(j == this.projectList[s].projectName) {
  6443. formData.append("projectId", this.projectList[s].id);
  6444. }
  6445. }
  6446. if(this.user.timeType.reportAuditType == 3){
  6447. let audItem = {}
  6448. if(this.user.timeType.auditLevel > 0){
  6449. audItem.auditorFirst = zhoD[j].auditorFirst
  6450. }
  6451. if(this.user.timeType.auditLevel > 1){
  6452. audItem.auditorSec = zhoD[j].auditorSec
  6453. }
  6454. if(this.user.timeType.auditLevel > 2){
  6455. audItem.auditorThird = zhoD[j].auditorThird
  6456. }
  6457. if(zhoD[j].ccUserid){
  6458. audItem.ccUserid = zhoD[j].ccUserid
  6459. }
  6460. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6461. }
  6462. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6463. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6464. formData.append("reportTimeType", this.reportTimeType.type);
  6465. formData.append("endTime", '');
  6466. formData.append("startTime", '');
  6467. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6468. var lix = []
  6469. var objjs = {}
  6470. objjs.startTime = zhoD[j].time[0]
  6471. objjs.endTime = zhoD[j].time[1]
  6472. if (zhoD[j].content == null || zhoD[j].content == '') {
  6473. zhoD[j].content == '-'
  6474. }
  6475. objjs.content = zhoD[j].content
  6476. lix.push(objjs)
  6477. var zhiZhi = JSON.stringify(lix)
  6478. zhiZhi = zhiZhi.replace(/,/g,"@");
  6479. formData.append("content", zhiZhi)
  6480. formData.append("isOvertime", 0)
  6481. formData.append("professionProgress", "[]")
  6482. if (zhoD[j].groupId) {
  6483. formData.append("groupId",zhoD[j].groupId)
  6484. } else {
  6485. //解决后台groupId数组越界的问题
  6486. formData.append("groupId",0)
  6487. }
  6488. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6489. formData.append("createDate",zhoD.zhoDataTime)
  6490. if (zhoD[j].projectAuditorId) {
  6491. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6492. }
  6493. if(zhoD[j].basecostId) {
  6494. formData.append("basecostId", zhoD[j].basecostId);
  6495. } else {
  6496. formData.append("basecostId", 0);
  6497. }
  6498. if(this.user.timeType.customDegreeActive){
  6499. if (this.user.timeType.customDegreeMultiple) {
  6500. if (zhoD[j].multiDegrIdArray) {
  6501. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6502. } else {
  6503. formData.append('multiDegrId','[]')
  6504. }
  6505. } else {
  6506. if (zhoD[j].degreeId) {
  6507. formData.append('degreeId',zhoD[j].degreeId)
  6508. } else {
  6509. formData.append('degreeId','-1')
  6510. }
  6511. }
  6512. }else{
  6513. formData.append("degreeId", "-1");
  6514. }
  6515. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6516. formData.append('customData',zhoD[j].customData)
  6517. }else if(this.user.timeType.customDataActive){
  6518. formData.append('customData',0)
  6519. }
  6520. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6521. formData.append('customText',zhoD[j].customText)
  6522. }else if(this.user.timeType.customTextActive){
  6523. formData.append('customText','-')
  6524. }
  6525. }
  6526. }
  6527. }
  6528. } else {
  6529. for (var i in this.zhoData) {
  6530. var zhoD = this.zhoData[i]
  6531. var flgs = false
  6532. if(this.reportTimeType.type == 2) {
  6533. for(var k in this.selProjectList) {
  6534. var pItem = this.selProjectList[k];
  6535. var pName = pItem.projectName;
  6536. var j = pName;
  6537. console.log('j==周报中的项目='+j);
  6538. if(zhoD[j].time && zhoD[j].time != 'null') {
  6539. flgs = true
  6540. // formData.append("degreeId", "-1");
  6541. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6542. for(var s in this.projectList) {
  6543. if(j == this.projectList[s].projectName) {
  6544. formData.append("projectId", this.projectList[s].id);
  6545. }
  6546. }
  6547. if(this.user.timeType.reportAuditType == 3){
  6548. let audItem = {}
  6549. if(this.user.timeType.auditLevel > 0){
  6550. audItem.auditorFirst = zhoD[j].auditorFirst
  6551. }
  6552. if(this.user.timeType.auditLevel > 1){
  6553. audItem.auditorSec = zhoD[j].auditorSec
  6554. }
  6555. if(this.user.timeType.auditLevel > 2){
  6556. audItem.auditorThird = zhoD[j].auditorThird
  6557. }
  6558. if(zhoD[j].ccUserid){
  6559. audItem.ccUserid = zhoD[j].ccUserid
  6560. }
  6561. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6562. }
  6563. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6564. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6565. formData.append("reportTimeType", this.reportTimeType.type);
  6566. formData.append("endTime", zhoD[j].time[1]);
  6567. formData.append("startTime", zhoD[j].time[0]);
  6568. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6569. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6570. formData.append("isOvertime", 0)
  6571. formData.append("professionProgress", "[]")
  6572. if (zhoD[j].groupId) {
  6573. formData.append("groupId",zhoD[j].groupId)
  6574. } else {
  6575. //解决后台groupId数组越界的问题
  6576. formData.append("groupId",0)
  6577. }
  6578. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6579. formData.append("createDate",zhoD.zhoDataTime)
  6580. if (zhoD[j].projectAuditorId) {
  6581. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6582. }
  6583. if(zhoD[j].basecostId) {
  6584. formData.append("basecostId", zhoD[j].basecostId);
  6585. } else {
  6586. formData.append("basecostId", 0);
  6587. }
  6588. if(this.user.timeType.customDegreeActive){
  6589. if (this.user.timeType.customDegreeMultiple) {
  6590. if (zhoD[j].multiDegrIdArray) {
  6591. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6592. } else {
  6593. formData.append("multiDegrId", "[]");
  6594. }
  6595. } else {
  6596. if (zhoD[j].degreeId) {
  6597. formData.append('degreeId',zhoD[j].degreeId)
  6598. } else {
  6599. formData.append("degreeId", "-1");
  6600. }
  6601. }
  6602. }else{
  6603. formData.append("degreeId", "-1");
  6604. }
  6605. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6606. formData.append('customData',zhoD[j].customData)
  6607. }else if(this.user.timeType.customDataActive){
  6608. formData.append('customData',0)
  6609. }
  6610. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6611. formData.append('customText',zhoD[j].customText)
  6612. }else if(this.user.timeType.customTextActive){
  6613. formData.append('customText','-')
  6614. }
  6615. }
  6616. }
  6617. } else {
  6618. for(var k in this.selProjectList) {
  6619. var pItem = this.selProjectList[k];
  6620. var pName = pItem.projectName;
  6621. var j = pName;
  6622. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6623. flgs = true
  6624. // formData.append("degreeId", "-1");
  6625. console.log('进入了workFpppp==='+j);
  6626. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6627. for(var s in this.projectList) {
  6628. if(j == this.projectList[s].projectName) {
  6629. formData.append("projectId", this.projectList[s].id);
  6630. }
  6631. }
  6632. if(this.user.timeType.reportAuditType == 3){
  6633. let audItem = {}
  6634. if(this.user.timeType.auditLevel > 0){
  6635. audItem.auditorFirst = zhoD[j].auditorFirst
  6636. }
  6637. if(this.user.timeType.auditLevel > 1){
  6638. audItem.auditorSec = zhoD[j].auditorSec
  6639. }
  6640. if(this.user.timeType.auditLevel > 2){
  6641. audItem.auditorThird = zhoD[j].auditorThird
  6642. }
  6643. if(zhoD[j].ccUserid){
  6644. audItem.ccUserid = zhoD[j].ccUserid
  6645. }
  6646. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6647. }
  6648. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6649. // formData.append("subProjectId", zhoD[j].subProjectId);
  6650. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6651. formData.append("reportTimeType", this.reportTimeType.type);
  6652. if(this.reportTimeType.type == 1) {
  6653. formData.append("workingTime", zhoD[j].workingTime);
  6654. } else if(this.reportTimeType.type == 2) {
  6655. formData.append("endTime", zhoD[j].time[1]);
  6656. formData.append("startTime", zhoD[j].time[0]);
  6657. } else if(this.reportTimeType.type == 3) {
  6658. formData.append("progress", zhoD[j].progress);
  6659. formData.append("workingTime", zhoD[j].workingTime);
  6660. }
  6661. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6662. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6663. formData.append("isOvertime", 0)
  6664. formData.append("professionProgress", "[]")
  6665. if (zhoD[j].groupId) {
  6666. formData.append("groupId",zhoD[j].groupId)
  6667. } else {
  6668. //解决后台groupId数组越界的问题
  6669. formData.append("groupId",0)
  6670. }
  6671. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6672. formData.append("createDate",zhoD.zhoDataTime)
  6673. if (zhoD[j].projectAuditorId) {
  6674. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6675. }
  6676. if(zhoD[j].basecostId) {
  6677. formData.append("basecostId", zhoD[j].basecostId);
  6678. } else {
  6679. formData.append("basecostId", 0);
  6680. }
  6681. if(this.user.timeType.customDegreeActive){
  6682. if (this.user.timeType.customDegreeMultiple) {
  6683. if (zhoD[j].multiDegrIdArray) {
  6684. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6685. } else {
  6686. formData.append("multiDegrId", "[]");
  6687. }
  6688. } else {
  6689. if (zhoD[j].degreeId) {
  6690. formData.append('degreeId',zhoD[j].degreeId)
  6691. } else {
  6692. formData.append("degreeId", "-1");
  6693. }
  6694. }
  6695. }else{
  6696. formData.append("degreeId", "-1");
  6697. }
  6698. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6699. formData.append('customData',zhoD[j].customData)
  6700. }else if(this.user.timeType.customDataActive){
  6701. formData.append('customData',0)
  6702. }
  6703. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6704. formData.append('customText',zhoD[j].customText)
  6705. }else if(this.user.timeType.customTextActive){
  6706. formData.append('customText','-')
  6707. }
  6708. }
  6709. }
  6710. }
  6711. }
  6712. }
  6713. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6714. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6715. if(!next) {
  6716. this.$message({
  6717. message: `【${error.join('、')}】请填写任务分组`,
  6718. type: 'error'
  6719. })
  6720. return
  6721. }
  6722. // 自定义维度
  6723. this.submitingReport = true;
  6724. this.http.uploadFile( this.port.report.editPort, formData,
  6725. res => {
  6726. // this.listLoading = false;
  6727. this.submitingReport = false;
  6728. if (res.code == "ok") {
  6729. this.$message({
  6730. message: this.$t('message.fillinsuccessfully'),
  6731. type: "success"
  6732. });
  6733. this.fillWeekDialogVisi = false
  6734. this.selConShow = true
  6735. this.zhoData = []
  6736. this.weekDateRange = ''
  6737. this.getReportList();
  6738. this.getDepartment();
  6739. // 关闭弹窗 并 清空
  6740. this.selProjectList = []
  6741. this.selCon = []
  6742. this.getRecentlyProject()
  6743. } else {
  6744. this.$message({
  6745. message: res.msg,
  6746. type: "error"
  6747. });
  6748. }
  6749. },
  6750. error => {
  6751. this.submitingReport = false;
  6752. this.$message({
  6753. message: error,
  6754. type: "error"
  6755. });
  6756. });
  6757. },
  6758. handleGroupAuditorData(data) {
  6759. const { reportAuditType } = this.user.timeType
  6760. if(reportAuditType != 1 && reportAuditType != 2) {
  6761. return {next: true}
  6762. }
  6763. let arrList = [];
  6764. Object.entries(data).forEach(([key, obj]) => {
  6765. Object.entries(obj).forEach(([projectName, projectData]) => {
  6766. if (projectData.workingTime && !projectData.groupId) {
  6767. arrList.push({
  6768. projectName,
  6769. date: obj.zhoDataTime,
  6770. dateText: obj.zhoDataTimeTxt
  6771. });
  6772. }
  6773. });
  6774. });
  6775. if(arrList.length > 0) {
  6776. return {
  6777. next: false,
  6778. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6779. }
  6780. } else {
  6781. return {
  6782. next: true,
  6783. error: [],
  6784. }
  6785. }
  6786. },
  6787. ChangeHourMinutestr (str) {
  6788. if (str !== "0" && str !== "" && str !== null) {
  6789. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6790. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6791. } else {
  6792. return "";
  6793. }
  6794. },
  6795. // 得到两个日期中间的日期
  6796. getdiffdate(stime,etime){
  6797. //初始化日期列表,数组
  6798. var diffdate = new Array();
  6799. var i=0;
  6800. //开始日期小于等于结束日期,并循环
  6801. while(stime<=etime){
  6802. diffdate[i] = stime;
  6803. //获取开始日期时间戳
  6804. var stime_ts = new Date(stime).getTime();
  6805. //增加一天时间戳后的日期
  6806. var next_date = stime_ts + (24*60*60*1000);
  6807. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6808. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6809. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6810. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6811. stime = next_dates_y+next_dates_m+next_dates_d;
  6812. //增加数组key
  6813. i++;
  6814. }
  6815. return diffdate;
  6816. },
  6817. // 添加模块
  6818. addDomain(i) {
  6819. var leftProgress = 10;
  6820. if (this.reportTimeType.type == 3) {
  6821. //计算已经待分配工时比例
  6822. let array = this.workForm.domains;
  6823. let totalProgress = 0;
  6824. for (var i=0;i<array.length; i++) {
  6825. totalProgress += array[i].progress;
  6826. }
  6827. if (totalProgress < 100) {
  6828. leftProgress = 100 - totalProgress;
  6829. }
  6830. }
  6831. var addItem = {
  6832. projectId: "",
  6833. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6834. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6835. ),
  6836. content: "",
  6837. progress:leftProgress,
  6838. state:2,//2-表示待提交
  6839. multiWorktime: this.reportTimeType.multiWorktime,
  6840. worktimeList:[{}],
  6841. canEdit: true,
  6842. auditorFirst: '',
  6843. auditorSec: '',
  6844. auditorThird: '',
  6845. ccUserid: ''
  6846. // degreeId: '',
  6847. };
  6848. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6849. this.$set(addItem,'isOvertime',true)
  6850. if(this.reportTimeType.type == 3){
  6851. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6852. }
  6853. }
  6854. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6855. //默认给第一个,必填字段
  6856. addItem.basecostId = this.timeBasecostList[0].id;
  6857. }
  6858. this.workForm.domains.push(addItem);
  6859. document.getElementById('workFormsItemBottom').scrollIntoView()
  6860. this.canEdit = true
  6861. if (this.reportTimeType.type == 0) {
  6862. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6863. var length = this.workForm.domains.length;
  6864. if (length == 2) {
  6865. this.showAddMore = false;
  6866. }
  6867. }
  6868. this.chuji()
  6869. this.seleChn()
  6870. },
  6871. // 移除模块
  6872. delDomain(i) {
  6873. this.workForm.domains.splice(i,1)
  6874. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6875. if (!this.originCanEdit) {
  6876. let iscan = false
  6877. for(let i in this.workForm.domains){
  6878. if(this.workForm.domains[i].canEdit){
  6879. iscan = true
  6880. }
  6881. }
  6882. this.canEdit = iscan
  6883. }
  6884. //检测当前剩下的一个,时间类型是否是全天
  6885. if (this.reportTimeType.type == 0) {
  6886. if (this.workForm.domains[0].timeType == 0) {
  6887. this.showAddMore = false;
  6888. } else {
  6889. this.showAddMore = true;
  6890. }
  6891. }
  6892. if(this.user.timeType.multiWorktime == 1) {
  6893. this.iptChangs()
  6894. } else {
  6895. this.seleChn(0)
  6896. }
  6897. },
  6898. // 改变月份
  6899. changeMonth() {
  6900. this.isWeekend = false
  6901. let date = new Date()
  6902. let nowmon = date.getMonth() + 1
  6903. let nowday = date.getDate()
  6904. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6905. if (this.isBatch == 0) {
  6906. if(this.user.timeType.fillAhead == 0){
  6907. let date_a = new Date(this.workForm.createDate)
  6908. if(date_a.getTime() > date.getTime()){
  6909. this.workForm.createDate = nowdate
  6910. }
  6911. }
  6912. //只有按天填报才能获取当天的日报
  6913. if(!this.isSubstitude){
  6914. let weekday = new Date(this.workForm.createDate).getDay()
  6915. if(this.user.companyId == 817){
  6916. if(weekday == 0){
  6917. this.isWeekend = true
  6918. }
  6919. }else{
  6920. if(weekday == 0 || weekday == 6){
  6921. this.isWeekend = true
  6922. }
  6923. }
  6924. this.getReport()
  6925. }
  6926. }else {
  6927. if(this.user.timeType.fillAhead == 0){
  6928. let date_a = new Date(this.workForm.createDate[1])
  6929. if(date_a.getTime() > date.getTime()){
  6930. this.workForm.createDate[1] = nowdate
  6931. let sdate = new Date(this.workForm.createDate[0])
  6932. let edate = new Date(this.workForm.createDate[1])
  6933. if(sdate > edate){
  6934. this.workForm.createDate[0] = this.workForm.createDate[1]
  6935. }
  6936. }
  6937. }
  6938. }
  6939. },
  6940. // 判断时间段
  6941. fns() {
  6942. for (let k in this.dateAr) {
  6943. if (!this.judege(k)) {
  6944. return false
  6945. }
  6946. }
  6947. return true
  6948. },
  6949. judege(idx){
  6950. for (let k in this.dateAr) {
  6951. if (idx !== k) {
  6952. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6953. return false
  6954. }
  6955. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6956. return false
  6957. }
  6958. }
  6959. }
  6960. return true
  6961. },
  6962. getOverlapData(data) {
  6963. let overlapData = [];
  6964. for (let i = 0; i < data.length; i++) {
  6965. for (let j = i + 1; j < data.length; j++) {
  6966. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6967. overlapData.push(data[i], data[j]);
  6968. }
  6969. }
  6970. }
  6971. return overlapData;
  6972. },
  6973. // 保存日报111111
  6974. submitReport(isDraft) {
  6975. this.isDraft = isDraft;
  6976. this.$refs.workForm.validate(valid => {
  6977. if (valid) {
  6978. if(this.totalReportHours < this.user.timeType.allday){
  6979. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6980. confirmButtonText: '确定',
  6981. cancelButtonText: '取消',
  6982. type: 'warning'
  6983. }).then(() => {
  6984. this.submitReportSon()
  6985. }).catch(() => {
  6986. });
  6987. }else{
  6988. this.submitReportSon()
  6989. }
  6990. }
  6991. });
  6992. },
  6993. submitReportSon() {
  6994. this.dateAr = []
  6995. //检查重叠
  6996. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6997. let alp = []
  6998. if(this.user.timeType.multiWorktime != 1) {
  6999. for(var p in this.workForm.domains) {
  7000. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7001. let objs = {}
  7002. objs.s = this.workForm.domains[p].startTime
  7003. objs.e = this.workForm.domains[p].endTime
  7004. alp.push(objs)
  7005. }
  7006. }
  7007. this.dateAr = alp
  7008. if(this.dateAr.length > 0) {
  7009. let trus = this.fns()
  7010. if(!trus) {
  7011. this.$message({
  7012. message: this.$t('message.Filledtimeperiodsoverlap'),
  7013. type: "error"
  7014. });
  7015. return
  7016. }
  7017. }
  7018. } else {
  7019. for(var p in this.workForm.domains) {
  7020. var slll = this.workForm.domains[p]
  7021. for(var o in slll.worktimeList) {
  7022. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7023. let objs = {}
  7024. objs.s = slll.worktimeList[o].startTime
  7025. objs.e = slll.worktimeList[o].endTime
  7026. alp.push(objs)
  7027. }
  7028. }
  7029. }
  7030. this.dateAr = alp
  7031. if(this.dateAr.length > 0) {
  7032. let trus = this.fns()
  7033. if(!trus) {
  7034. this.$message({
  7035. message: this.$t('message.Filledtimeperiodsoverlap'),
  7036. type: "error"
  7037. });
  7038. return
  7039. }
  7040. }
  7041. }
  7042. }
  7043. //检查子项目
  7044. if (this.user.timeType.subProMustFill == 1) {
  7045. for(var p in this.workForm.domains) {
  7046. var oneProItem = this.workForm.domains[p]
  7047. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7048. //没有选择子项目
  7049. this.$message({
  7050. message: '子项目必填,请检查',
  7051. type: "error"
  7052. });
  7053. return
  7054. }
  7055. }
  7056. }
  7057. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7058. if (this.user.companyId == this.yuzhongCompId) {
  7059. for(var p in this.workForm.domains) {
  7060. var oneProItem = this.workForm.domains[p]
  7061. if (!oneProItem.extraField1) {
  7062. this.$message({
  7063. message: '角色必填,请检查',
  7064. type: "error"
  7065. });
  7066. return
  7067. }
  7068. if (!oneProItem.extraField2) {
  7069. this.$message({
  7070. message: '工作职责必填,请检查',
  7071. type: "error"
  7072. });
  7073. return
  7074. }
  7075. if (!oneProItem.extraField3) {
  7076. this.$message({
  7077. message: '工作内容必填,请检查',
  7078. type: "error"
  7079. });
  7080. return
  7081. }
  7082. }
  7083. }
  7084. // return
  7085. //代填的情况,检查人员是否已经选择
  7086. if (this.isSubstitude) {
  7087. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7088. this.$message({
  7089. message: this.$t('message.pleaseselectthepersontofillin'),
  7090. type: "error"
  7091. });
  7092. return;
  7093. }
  7094. }
  7095. //检查时间,全天和上下午不能同时存在
  7096. if (this.reportTimeType.type == 0) {
  7097. var alldayNum = 0;
  7098. var amNum = 0;
  7099. var pmNum = 0;
  7100. for(var i in this.workForm.domains) {
  7101. if (this.workForm.domains[i].timeType == 0) {
  7102. alldayNum ++;
  7103. } else if (this.workForm.domains[i].timeType == 1) {
  7104. amNum++;
  7105. } else if (this.workForm.domains[i].timeType == 2) {
  7106. pmNum++;
  7107. }
  7108. }
  7109. if (alldayNum > 1) {
  7110. this.$message({
  7111. // message: "工作时间-全天,只能选择一次",
  7112. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7113. type: "error"
  7114. });
  7115. return;
  7116. }
  7117. if (amNum > 1) {
  7118. this.$message({
  7119. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7120. type: "error"
  7121. });
  7122. return;
  7123. }
  7124. if (pmNum > 1) {
  7125. this.$message({
  7126. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7127. type: "error"
  7128. });
  7129. return;
  7130. }
  7131. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7132. this.$message({
  7133. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7134. type: "error"
  7135. });
  7136. return;
  7137. }
  7138. } else if (this.reportTimeType.type == 3) {
  7139. //总百分比不能超过100%
  7140. let total = 0;
  7141. this.workForm.domains.forEach(w=>{total += w.progress});
  7142. if (total > 100) {
  7143. this.$message({
  7144. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7145. type: "error"
  7146. });
  7147. return;
  7148. } else if (total < 100) {
  7149. this.$message({
  7150. message: this.$t('message.cannotbesubmitted'),
  7151. type: "error"
  7152. });
  7153. return;
  7154. }
  7155. }
  7156. this.listLoading = true;
  7157. let formData = new FormData();
  7158. formData.append("draft", this.isDraft);
  7159. var totalTime = 0;
  7160. for (var t=0;t<this.workForm.domains.length; t++) {
  7161. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7162. }
  7163. //批量填报不校验考勤时长,交给后台校验
  7164. if (!this.isBatch) {
  7165. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7166. if (this.workForm.time){
  7167. if (this.workForm.time.workHours == 0){
  7168. this.$message({
  7169. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7170. type: 'error'
  7171. })
  7172. return
  7173. }
  7174. }else{
  7175. this.$message({
  7176. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7177. type: 'error'
  7178. })
  7179. return
  7180. }
  7181. }
  7182. }
  7183. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7184. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7185. this.$message({
  7186. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7187. type: "error"
  7188. });
  7189. return;
  7190. }
  7191. }
  7192. for(var i in this.workForm.domains) {
  7193. // 检查任务/里程碑是否为必填
  7194. let taskRequired = this.user.timeType.taskRequired
  7195. if(taskRequired == 1) {
  7196. if(!this.workForm.domains[i].taskId) {
  7197. this.$message({
  7198. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7199. type: "error"
  7200. });
  7201. return
  7202. }
  7203. }
  7204. if(this.user.timeType.reportAuditType == 3){
  7205. let audItem = {}
  7206. let auditRule = ''
  7207. if(this.workForm.domains[i].id){
  7208. audItem.reportId = this.workForm.domains[i].id
  7209. }
  7210. if(this.user.timeType.auditLevel > 0){
  7211. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7212. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7213. }
  7214. if(this.user.timeType.auditLevel > 1){
  7215. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7216. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7217. }
  7218. if(this.user.timeType.auditLevel > 2){
  7219. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7220. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7221. }
  7222. if(this.workForm.domains[i].ccUserid){
  7223. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7224. }
  7225. if(auditRule){
  7226. auditRule = auditRule.substring(0,auditRule.length - 1)
  7227. this.$message({
  7228. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7229. type: 'error'
  7230. })
  7231. return
  7232. }
  7233. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7234. }
  7235. if (this.user.timeType.customDegreeActive) {
  7236. if (this.user.timeType.customDegreeMultiple) {
  7237. //多选
  7238. if (this.workForm.domains[i].multiDegrIdArray) {
  7239. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7240. degreeArray = degreeArray.replace(/,/g,"@");
  7241. formData.append("multiDegrId", degreeArray);
  7242. } else {
  7243. formData.append("multiDegrId", '[]');
  7244. }
  7245. } else {
  7246. //单选
  7247. if (this.workForm.domains[i].degreeId) {
  7248. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7249. } else {
  7250. formData.append("degreeId", -1);
  7251. }
  7252. }
  7253. } else {
  7254. formData.append("degreeId", -1);
  7255. }
  7256. if(this.workForm.domains[i].customData) {
  7257. // var sss = this.workForm.domains[i].degreeId.toString()
  7258. formData.append("customData", this.workForm.domains[i].customData);
  7259. } else {
  7260. formData.append("customData", 0);
  7261. }
  7262. if(this.workForm.domains[i].customText) {
  7263. formData.append("customText", this.workForm.domains[i].customText);
  7264. } else {
  7265. formData.append("customText", '-');
  7266. }
  7267. if (this.workForm.domains[i].id) {
  7268. formData.append("id", this.workForm.domains[i].id);
  7269. } else {
  7270. formData.append("id", -1);
  7271. }
  7272. formData.append("projectId", this.workForm.domains[i].projectId);
  7273. if (this.workForm.domains[i].subProjectId) {
  7274. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7275. } else {
  7276. formData.append("subProjectId", 0);
  7277. }
  7278. if (this.workForm.domains[i].groupId) {
  7279. formData.append("groupId", this.workForm.domains[i].groupId);
  7280. } else {
  7281. formData.append("groupId", 0);
  7282. }
  7283. if (this.workForm.domains[i].taskId) {
  7284. formData.append("taskId", this.workForm.domains[i].taskId);
  7285. } else {
  7286. formData.append("taskId", 0);
  7287. }
  7288. if (this.workForm.domains[i].taskFinish == true) {
  7289. formData.append("taskFinish", 1);
  7290. } else {
  7291. formData.append("taskFinish", 0);
  7292. }
  7293. formData.append("reportTimeType", this.reportTimeType.type);
  7294. if (this.reportTimeType.type == 0) {
  7295. formData.append("timeType", this.workForm.domains[i].timeType);
  7296. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7297. formData.append("workingTime", workingTime);
  7298. } else if (this.reportTimeType.type == 1){
  7299. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7300. } else if (this.reportTimeType.type == 2) {
  7301. formData.append("endTime", this.workForm.domains[i].endTime);
  7302. formData.append("startTime", this.workForm.domains[i].startTime);
  7303. } else if (this.reportTimeType.type == 3) {
  7304. //按比例分配
  7305. formData.append("progress", this.workForm.domains[i].progress);
  7306. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7307. }
  7308. if(this.user.timeType.choseFromAlbum == 1 ) {
  7309. console.log(this.workForm.domains[i].imgList)
  7310. if(this.workForm.domains[i].imgList) {
  7311. let imgListFor = this.workForm.domains[i].imgList
  7312. for(var b in imgListFor) {
  7313. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7314. }
  7315. console.log(imgListFor)
  7316. let m = JSON.stringify(imgListFor);
  7317. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7318. formData.append("picStr", m);
  7319. } else {
  7320. formData.append("picStr", '[]');
  7321. }
  7322. }
  7323. //处理多个时间事项
  7324. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7325. if (this.reportTimeType.multiWorktime == 1) {
  7326. //检查时间是否有重叠
  7327. var workList = this.workForm.domains[i].worktimeList;
  7328. for (var j=0;j<workList.length; j++) {
  7329. var curItem = workList[j];
  7330. //检查开始时间是否大于结束时间
  7331. if (curItem.startTime >= curItem.endTime) {
  7332. this.$message({
  7333. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7334. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7335. type: "error"
  7336. });
  7337. return;
  7338. }
  7339. //时间不可重叠
  7340. if (this.reportTimeType.timeCanOverlap == 0) {
  7341. for (var p = j+1;p<workList.length; p++) {
  7342. var jItem = workList[p];
  7343. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7344. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7345. this.$message({
  7346. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7347. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7348. type: "error"
  7349. });
  7350. return;
  7351. }
  7352. }
  7353. }
  7354. }
  7355. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7356. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7357. formData.append("content", m);
  7358. } else {
  7359. if (this.workForm.domains[i].content) {
  7360. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7361. m = m.replace(/,/g,",");
  7362. console.log(m, '需要传值的数据')
  7363. // formData.append("content", this.workForm.domains[i].content);
  7364. formData.append("content", m);
  7365. } else {
  7366. formData.append("content", '-');
  7367. }
  7368. }
  7369. if (this.isBatch == 0) {
  7370. formData.append("createDate", this.workForm.createDate);
  7371. } else {
  7372. //批量填报,时间范围
  7373. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7374. }
  7375. if(this.workForm.domains[i].isOvertime) {
  7376. formData.append("isOvertime", 1);
  7377. } else {
  7378. formData.append("isOvertime", 0);
  7379. }
  7380. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7381. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7382. } else {
  7383. formData.append("overtimeHours", 0);
  7384. }
  7385. if(this.workForm.domains[i].basecostId) {
  7386. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7387. } else {
  7388. formData.append("basecostId", 0);
  7389. }
  7390. if (this.workForm.userId != null) {
  7391. var targetUids = '';
  7392. this.workForm.userId.forEach(u=>{
  7393. targetUids += u + '@';
  7394. });
  7395. if (targetUids.length > 0) {
  7396. targetUids = targetUids.substring(0, targetUids.length -1);
  7397. formData.append("targetUids", targetUids);
  7398. }
  7399. }
  7400. //项目专业进度
  7401. if (this.workForm.domains[i].professionProgress) {
  7402. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7403. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7404. formData.append("professionProgress", m);
  7405. } else {
  7406. formData.append("professionProgress", "[]");
  7407. }
  7408. if (this.workForm.domains[i].stage) {
  7409. formData.append("stage", this.workForm.domains[i].stage);
  7410. } else {
  7411. formData.append("stage", "-");
  7412. }
  7413. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7414. if (this.workForm.domains[i].projectAuditorId) {
  7415. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7416. } else {
  7417. // console.log('执行到了这里')
  7418. // console.log(this.user.timeType.reportAuditType)
  7419. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7420. this.$message({
  7421. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7422. type: "error"
  7423. });
  7424. return;
  7425. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7426. //分组负责人先审核, 确定是选择了任务分组
  7427. if (this.workForm.domains[i].taskGroups.length == 0) {
  7428. this.$message({
  7429. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7430. type: "error"
  7431. });
  7432. } else if (!this.workForm.domains[i].groupId) {
  7433. // console.log(this.workForm.domains[i]);
  7434. this.$message({
  7435. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7436. type: "error"
  7437. });
  7438. } else {
  7439. this.$message({
  7440. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7441. type: "error"
  7442. });
  7443. }
  7444. return;
  7445. }
  7446. }
  7447. if (this.user.companyId == this.yuzhongCompId) {
  7448. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7449. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7450. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7451. }
  7452. //依斯贝的服务Id
  7453. if (this.user.companyId == this.yisibeiCompId) {
  7454. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7455. }
  7456. }
  7457. this.submitingReport = true;
  7458. this.http.uploadFile( this.port.report.editPort, formData,
  7459. res => {
  7460. this.listLoading = false;
  7461. this.submitingReport = false;
  7462. if (res.code == "ok") {
  7463. if(res.msg!=null){
  7464. this.$message({
  7465. dangerouslyUseHTMLString: true,
  7466. message: res.msg,
  7467. type: "warning",
  7468. showClose: true,
  7469. duration: 0
  7470. });
  7471. }else{
  7472. this.$message({
  7473. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7474. type: "success"
  7475. });
  7476. }
  7477. this.dialogVisible = false;
  7478. this.jsDay = 0
  7479. this.jsTime = 0
  7480. this.getReportList();
  7481. this.getDepartment();
  7482. this.getRecentlyProject()
  7483. } else {
  7484. this.$message({
  7485. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7486. type: "error"
  7487. });
  7488. }
  7489. },
  7490. error => {
  7491. this.listLoading = false;
  7492. this.submitingReport = false;
  7493. this.$message({
  7494. message: error,
  7495. type: "error"
  7496. });
  7497. });
  7498. },
  7499. // 判断是展示那个工时导入
  7500. imports() {
  7501. if(this.user.timeType.syncCorpwxTime == 0) {
  7502. this.importDialog = true
  7503. } else {
  7504. this.importWxDialog = true
  7505. }
  7506. },
  7507. // 跳转
  7508. junpToDeskTop(id) {
  7509. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7510. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7511. },
  7512. // 通过日报
  7513. approve(id, item) {
  7514. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7515. this.approveinData = {
  7516. id: id,
  7517. date: this.date +day,
  7518. reportIds: item.id
  7519. }
  7520. if(this.user.timeType.needEvaluate == 1){
  7521. this.$set(this.approveinData,'evaluate','')
  7522. this.approveinDialog = true
  7523. }else{
  7524. this.logining = true;
  7525. this.approveinfun()
  7526. }
  7527. },
  7528. approveinfun(){
  7529. this.http.post( this.port.report.approve, this.approveinData,
  7530. res => {
  7531. this.logining = false;
  7532. if (res.code == "ok") {
  7533. this.approveinDialog = false
  7534. this.$message({
  7535. message: this.$t('message.Reviewsucceeded'),
  7536. type: "success"
  7537. });
  7538. this.refreshReportData(this.approveinData.reportIds);
  7539. this.getDepartment();
  7540. } else {
  7541. this.$message({
  7542. message: res.msg,
  7543. type: "error"
  7544. });
  7545. }
  7546. },
  7547. error => {
  7548. this.logining = false;
  7549. this.$message({
  7550. message: error,
  7551. type: "error"
  7552. });
  7553. });
  7554. },
  7555. //撤回日报
  7556. cancel(item,e) {
  7557. // console.log('can can need',item);
  7558. this.logining = true;
  7559. var ids = '';
  7560. var data = e ? item : item.data;
  7561. data.forEach(element => {
  7562. if(element.id){
  7563. ids +=(element.id+',');
  7564. }
  7565. });
  7566. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7567. res => {
  7568. this.logining = false;
  7569. if (res.code == "ok") {
  7570. this.$message({
  7571. message:this.$t('message.Withdrawalsucceeded'),
  7572. type: "success"
  7573. });
  7574. this.getReportList();
  7575. if(e){this.getReport()}
  7576. this.getDepartment();
  7577. } else {
  7578. this.$message({
  7579. message: res.msg,
  7580. type: "error"
  7581. });
  7582. }
  7583. },
  7584. error => {
  7585. this.logining = false;
  7586. this.$message({
  7587. message: error,
  7588. type: "error"
  7589. });
  7590. });
  7591. },
  7592. showDenyDialog(id,i, item) {
  7593. this.denyReasonDialog = true;
  7594. this.isDenying = false;
  7595. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7596. var ids = item.id;
  7597. // var data = item.data;
  7598. // data.forEach(element => {
  7599. // ids +=(element.id+',');
  7600. // });
  7601. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7602. },
  7603. // 未通过日报
  7604. deny() {
  7605. this.logining = true;
  7606. this.isDenying = true;
  7607. this.http.post( this.port.report.deny, this.denyForm,
  7608. res => {
  7609. this.logining = false;
  7610. this.isDenying = false;
  7611. if (res.code == "ok") {
  7612. this.$message({
  7613. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7614. type: "success"
  7615. });
  7616. this.refreshReportData(this.denyForm.reportIds);
  7617. this.getDepartment();
  7618. this.denyReasonDialog = false;
  7619. } else {
  7620. this.$message({
  7621. message: res.msg,
  7622. type: "error"
  7623. });
  7624. }
  7625. },
  7626. error => {
  7627. this.logining = false;
  7628. this.$message({
  7629. message: error,
  7630. type: "error"
  7631. });
  7632. });
  7633. },
  7634. // 查看工时记录弹窗
  7635. toView() {
  7636. this.toViewDialogVisible = true
  7637. this.toViewloading = true
  7638. this.getToView()
  7639. },
  7640. getToView() {
  7641. this.http.post( '/report-import-log/getList', this.toViewForm,
  7642. res => {
  7643. this.toViewloading = false;
  7644. if (res.code == "ok") {
  7645. // console.log(res.data, '数据数据')
  7646. this.toViewList = res.data.records
  7647. this.toViewForm.total = res.data.total
  7648. } else {
  7649. this.toViewloading = false;
  7650. this.$message({
  7651. message: res.msg,
  7652. type: "error"
  7653. });
  7654. }
  7655. })
  7656. },
  7657. // 触发 selectCat 组件更改他的值
  7658. selectCatCli(obj) {
  7659. // console.log(obj, '看看')
  7660. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7661. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7662. },
  7663. vueCasader(obj) {
  7664. console.log(obj, '看看值')
  7665. if(obj.distinction == 1 && obj.item) {
  7666. let arr = []
  7667. arr.push(obj.item.value)
  7668. this.exportParam.departmentId = arr
  7669. }
  7670. },
  7671. //分页
  7672. handleCurrentChange(val) {
  7673. this.toViewForm.pageIndex = val;
  7674. this.getToView();
  7675. },
  7676. handleSizeChange(val) {
  7677. this.toViewForm.pageSize = val;
  7678. this.getToView();
  7679. },
  7680. getAllUsersList(){
  7681. this.http.post('/user/getSimpleActiveUserList',{
  7682. },res => {
  7683. if(res.code == 'ok'){
  7684. this.allUsersList = res.data
  7685. }else{
  7686. this.$message({
  7687. message: res.msg,
  7688. type: 'error'
  7689. })
  7690. }
  7691. },err => {
  7692. this.$message({
  7693. message: err,
  7694. type: 'error'
  7695. })
  7696. })
  7697. },
  7698. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7699. fillWeekCustomClne() {
  7700. this.fillWeekDialogVisiCustom = false
  7701. },
  7702. fillWeekCustomSubmit() {
  7703. this.getReportList();
  7704. this.getDepartment();
  7705. this.getRecentlyProject()
  7706. },
  7707. // 待填日报姓名搜索
  7708. nameAearchSeek(flg) {
  7709. if(!this.nameAearch) {
  7710. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7711. return
  7712. }
  7713. if(flg) {
  7714. this.enterpriseWechatgetUser()
  7715. }
  7716. },
  7717. handleThreeData(userList) {
  7718. console.log(userList, '人员数据')
  7719. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7720. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7721. },
  7722. // 过滤树节点
  7723. filterTreeNodes(treeData, filterKeywords) {
  7724. return treeData.filter((node) => {
  7725. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7726. if (node.children && node.children.length > 0) {
  7727. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7728. }
  7729. return true;
  7730. }
  7731. if (node.children && node.children.length > 0) {
  7732. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7733. return node.children.length > 0;
  7734. }
  7735. return false;
  7736. });
  7737. },
  7738. // 企业微信获取人员
  7739. enterpriseWechatgetUser() {
  7740. this.deptMembDataLoading = true
  7741. this.http.post('/user/getEmployeeList',{
  7742. departmentId: -1,
  7743. pageIndex: 1,
  7744. pageSize: 100,
  7745. keyword: this.nameAearch,
  7746. status: '',
  7747. roleId: '',
  7748. cursor: '',
  7749. onlyDirect: '',
  7750. matchingType: ''
  7751. },res => {
  7752. if(res.code == 'ok'){
  7753. this.deptMembDataLoading = false
  7754. const userListName = res.data.records.map(item => item.name)
  7755. this.handleThreeData(userListName)
  7756. }else{
  7757. this.deptMembDataLoading = false
  7758. this.$message({
  7759. message: res.msg,
  7760. type: 'error'
  7761. })
  7762. }
  7763. },err => {
  7764. this.deptMembDataLoading = false
  7765. this.$message({
  7766. message: err,
  7767. type: 'error'
  7768. })
  7769. })
  7770. },
  7771. // 按周填报获取相关任务
  7772. async getWeeklyTaskList(item) {
  7773. console.log(item, '<=== 数据')
  7774. const { projectId, groupId, stage, taskId } = item
  7775. console.log(projectId, groupId, stage)
  7776. let parms = { projectId, isSubstitude: 0 }
  7777. groupId ? parms.groupId = groupId : ''
  7778. stage ? parms.stage = stage : ''
  7779. const { data } = await this.postData('/task/getRecentTask', parms)
  7780. this.zhoBao.taskId = taskId
  7781. this.$set(this.zhoBao, 'taskList', data)
  7782. console.log(this.zhoBao)
  7783. },
  7784. // 封装 post 请求
  7785. postData(url, params) {
  7786. return new Promise((resolve, reject) => {
  7787. this.http.post(url, { ...params },
  7788. res => {
  7789. resolve(res)
  7790. },
  7791. error => {
  7792. this.$message({
  7793. message: error,
  7794. type: "error"
  7795. });
  7796. reject(error)
  7797. })
  7798. })
  7799. },
  7800. // 自定义事件
  7801. selectCal(obj) {
  7802. console.log(obj, '传数据来源')
  7803. if(obj.distinction == '1') {
  7804. this.zhoBao.projectAuditorId = obj.id
  7805. } else if(obj.distinction == '2') {
  7806. this.zhoBao.auditorFirst = obj.id
  7807. } else if(obj.distinction == '3') {
  7808. this.zhoBao.auditorSec = obj.id
  7809. } else if(obj.distinction == '4') {
  7810. this.zhoBao.auditorThird = obj.id
  7811. } else if(obj.distinction == '5') {
  7812. this.zhoBao.ccUserid = obj.id
  7813. } else if(obj.distinction == '12') {
  7814. this.usersListId = obj.id
  7815. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7816. this.searchKeyword = obj.name
  7817. } else {
  7818. this.searchKeyword = ''
  7819. }
  7820. this.searchScreen(0)
  7821. } else if(obj.distinction == '13') {
  7822. this.usersListId = obj.id
  7823. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7824. this.searchKeyword = obj.name
  7825. } else {
  7826. this.searchKeyword = ''
  7827. }
  7828. this.searchScreen(1)
  7829. }
  7830. }
  7831. },
  7832. created() {
  7833. this.getUsers()
  7834. let height = window.innerHeight;
  7835. this.tableHeight = height - 178;
  7836. const that = this;
  7837. window.onresize = function temp() {
  7838. that.tableHeight = window.innerHeight - 178;
  7839. };
  7840. this.toViewForm.companyId = this.user.companyId
  7841. this.initDrag([{
  7842. type: "LR",
  7843. domClass: {
  7844. // 中间分割线的名字
  7845. resize: "line-line",
  7846. // 左侧盒子的名字
  7847. left: "box-left",
  7848. // 右侧盒子的名字
  7849. right: "box-right",
  7850. // 父级的名字
  7851. box: "box-father",
  7852. },
  7853. otherInfo: {
  7854. // 限制左边栏最低宽度
  7855. leftWidth: 120,
  7856. },
  7857. },
  7858. {
  7859. type: "LR",
  7860. domClass: {
  7861. // 中间分割线的名字
  7862. resize: "line-second",
  7863. // 左侧盒子的名字
  7864. left: "left-laowang",
  7865. // 右侧盒子的名字
  7866. right: "box-second-father",
  7867. // 父级的名字
  7868. box: "grand",
  7869. },
  7870. otherInfo: {
  7871. // 限制左边栏最低宽度
  7872. leftWidth: 120,
  7873. },
  7874. },
  7875. ]);
  7876. }
  7877. };
  7878. </script>
  7879. <style lang="scss" scoped>
  7880. .fillWeekDialogVisiCustom {
  7881. width: 100%;
  7882. height: 70vh;
  7883. }
  7884. .fillWeekCustom {
  7885. .el-dialog__body {
  7886. padding: 20px 20px !important;
  7887. }
  7888. }
  7889. .photos {
  7890. position: relative;
  7891. display: flex;
  7892. flex-wrap: wrap;
  7893. }
  7894. .photos_img {
  7895. width: 120px;
  7896. height: 120px;
  7897. margin-right: 20px;
  7898. margin-bottom: 20px;
  7899. cursor: pointer;
  7900. img {
  7901. width: 100%;
  7902. height: 100%;
  7903. }
  7904. }
  7905. .paginatis {
  7906. padding: 10px 10px;
  7907. background: #f2f2f2;
  7908. }
  7909. .waiting {
  7910. color:orange;
  7911. }
  7912. .filledReportStyle {
  7913. color:#32CD32;
  7914. }
  7915. .RejectStyle {
  7916. color:red;
  7917. }
  7918. .waitSubmitStyle{
  7919. color: #409eff;
  7920. }
  7921. .chooseDate {
  7922. .waiting {
  7923. color: #20a0ff;
  7924. }
  7925. .filledReportStyle {
  7926. color:#20a0ff;
  7927. }
  7928. .RejectStyle {
  7929. color: #20a0ff;
  7930. }
  7931. .waitSubmitStyle{
  7932. color: #20a0ff;
  7933. }
  7934. }
  7935. .allDaily {
  7936. width:100%;
  7937. }
  7938. .report_title {
  7939. padding:10px 0;
  7940. color:#666;
  7941. }
  7942. .clearfix {
  7943. overflow-x: auto;
  7944. white-space: nowrap;
  7945. padding: 15px 0 10px 0;
  7946. // overflow-y: hidden;
  7947. .date_item {
  7948. padding: 0 3px;
  7949. cursor: pointer;
  7950. position: relative;
  7951. }
  7952. .chooseDate {
  7953. position: absolute;
  7954. bottom: -3px;
  7955. width: 37px;
  7956. height: 2px;
  7957. left: 14px;
  7958. background: #20a0ff;
  7959. }
  7960. }
  7961. .one_daily {
  7962. i {
  7963. color: #9ed0ff;
  7964. margin-right: 5px;
  7965. }
  7966. .one_daily_body {
  7967. padding: 10px 0px;
  7968. p {
  7969. margin: 0;
  7970. line-height: 30px;
  7971. }
  7972. }
  7973. ul {
  7974. padding: 0;
  7975. }
  7976. }
  7977. .checkbtn {
  7978. float: right;
  7979. margin-top: -10px;
  7980. }
  7981. .selConStyle{
  7982. margin-top:9rem;
  7983. margin-bottom:11rem;
  7984. .selConStyle_title{
  7985. height: 3rem;
  7986. text-align: center;
  7987. font-size: 17px;
  7988. }
  7989. .el-select{
  7990. margin: 0 15%;
  7991. width: 70%;
  7992. }
  7993. }
  7994. </style>
  7995. <style lang="scss">
  7996. /*去除upload组件过渡效果*/
  7997. .photos .el-upload-list__item {
  7998. transition: none !important;
  7999. }
  8000. .daily {
  8001. .el-card__body {
  8002. height: 80%;
  8003. overflow-y: auto;
  8004. }
  8005. .el-card__header {
  8006. padding: 0 20px;
  8007. }
  8008. }
  8009. .membListClass{
  8010. .el-dialog__body{
  8011. padding-top: 10px;
  8012. }
  8013. }
  8014. // .editReportDialog .el-dialog__footer{
  8015. // position: sticky;
  8016. // bottom: 0;
  8017. // background: #fff;
  8018. // height: 70px;
  8019. // z-index: 1010;
  8020. // }
  8021. .editReportDialog{
  8022. min-width: 800px;
  8023. }
  8024. .touruxiangmu{
  8025. max-width: 1000px;
  8026. }
  8027. </style>
  8028. <style scoped>
  8029. /* 项目标签的样式 */
  8030. .el-tag + .el-tag {
  8031. margin-left: 10px;
  8032. }
  8033. .button-new-tag {
  8034. margin-left: 10px;
  8035. height: 32px;
  8036. line-height: 30px;
  8037. padding-top: 0;
  8038. padding-bottom: 0;
  8039. }
  8040. .input-new-tag {
  8041. width: 90px;
  8042. margin-left: 10px;
  8043. vertical-align: bottom;
  8044. }
  8045. .selectworktime .el-table__fixed-body-wrapper{
  8046. top: 48px !important;
  8047. }
  8048. .selectworktime_export .selectworktime_export_l{
  8049. width: 650px;
  8050. float: left;
  8051. height: 42px;
  8052. }
  8053. .approvalProcessBox{
  8054. margin-left: 30px;
  8055. font-size: 14px;
  8056. line-height: 16px;
  8057. cursor: pointer;
  8058. }
  8059. .approvalProcessBox i {
  8060. margin-right: 0;
  8061. height: 16px;
  8062. width: 16px;
  8063. display: inline-block;
  8064. transform: scale(1.2);
  8065. position: relative;
  8066. top: 0.5px;
  8067. color: #409eff;
  8068. }
  8069. .approvalProcessBox .approvalProcessClick{
  8070. cursor: pointer;
  8071. color: #409eff;
  8072. font-size: 14px;
  8073. }
  8074. .approvalProcessBox:hover .approvalProcessClick{
  8075. color: #3485fb;
  8076. }
  8077. </style>
  8078. <style lang="scss" scoped>
  8079. // 加班样式
  8080. .overtime {
  8081. display: inline-block;
  8082. margin-left: 20px;
  8083. input {
  8084. display: inline-block;
  8085. margin-top: 5px;
  8086. }
  8087. }
  8088. .plus {
  8089. display: inline-block;
  8090. }
  8091. // .tages {
  8092. // float: right;
  8093. // }
  8094. .overtime {
  8095. display: inline-block;
  8096. margin-left: 30px;
  8097. }
  8098. .bloks {
  8099. display: inline-block;
  8100. width: 380px;
  8101. }
  8102. .zhiss {
  8103. display: flex;
  8104. justify-content: space-around;
  8105. align-items: center;
  8106. }
  8107. .zhoFel {
  8108. display: flex;
  8109. justify-content: space-between;
  8110. align-items: center;
  8111. }
  8112. // 左右滑动样式
  8113. .line {
  8114. width: 30px;
  8115. /* height: 500px; */
  8116. background: #f2f2f2;
  8117. cursor: w-resize;
  8118. }
  8119. .box-father {
  8120. border: 8px solid #000;
  8121. }
  8122. .line-second {
  8123. width: 10px;
  8124. /* background: red; */
  8125. }
  8126. .flex {
  8127. display: flex;
  8128. width: 100%;
  8129. }
  8130. .box-left {
  8131. flex: 0 0 400px;
  8132. /* height: 600px; */
  8133. /* background: blue; */
  8134. }
  8135. .box-right {
  8136. /* height: 600px; */
  8137. /* background: green; */
  8138. flex: 1;
  8139. }
  8140. .box-postion {
  8141. width: 200px;
  8142. /* height: 400px; */
  8143. background: #ccc;
  8144. }
  8145. .custom-tree-node {
  8146. flex: 1;
  8147. display: flex;
  8148. align-items: center;
  8149. justify-content: space-between;
  8150. font-size: 14px;
  8151. padding-right: 8px;
  8152. }
  8153. .daitianrbao {
  8154. width: 100%;
  8155. box-sizing: border-box;
  8156. height: 40px;
  8157. border-radius: 4px;
  8158. border: 1px solid #DCDFE6;
  8159. overflow: hidden;
  8160. text-overflow: ellipsis;
  8161. display: flex;
  8162. // align-items: center;
  8163. }
  8164. .daitianrbao .spnn {
  8165. display: inline-block;
  8166. box-sizing: border-box;
  8167. padding: 0 15px;
  8168. overflow: hidden;
  8169. text-overflow: ellipsis;
  8170. }
  8171. .daitianrbao .hover {
  8172. color: #DCDFE6 !important;
  8173. }
  8174. </style>