daily.vue 413 KB

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