daily.vue 411 KB

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