daily.vue 470 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  128. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  133. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  140. </span>
  141. </div>
  142. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  143. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  144. <i class="fa fa-circle"></i>
  145. <!-- {{item1.name}} -->
  146. <span v-if="user.userNameNeedTranslate == '1'">
  147. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  148. </span>
  149. <span v-if="user.userNameNeedTranslate != '1'">
  150. {{item1.name}}
  151. </span>
  152. <span style="margin-left:30px;">
  153. <span style="margin-right:20px;">
  154. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  155. <!-- 工作总时长: -->
  156. {{$t('other.totalWorkingHours')}}
  157. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  158. <span >{{item1.reportTime | amounts}}</span>h
  159. </span>
  160. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  161. <i class="iconfont firerock-iconliucheng1"></i>
  162. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  163. <!-- 审批流程 -->
  164. {{$t('other.approvalProcess')}}
  165. </span>
  166. </span>
  167. </span>
  168. <div class="checkbtn" style="padding-right:20px;">
  169. <!--编辑和删除日报-->
  170. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  171. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  172. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  173. </div>
  174. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  175. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  176. </div>
  177. <div class="one_daily_body">
  178. <el-timeline>
  179. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  180. <el-card shadow="never">
  181. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  182. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  183. <span v-if="user.company.packageEngineering == 0">
  184. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  185. <span v-if="item2.isDeptAudit==0">
  186. <span v-if="item2.projectAuditState==0">
  187. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  188. <span v-if="item2.projectAuditorName != null">(
  189. <!-- {{item2.projectAuditorName}} -->
  190. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  191. )</span>
  192. <!-- 审核 --> {{$t('other.audit')}}
  193. </span>
  194. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  195. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  196. <span v-if="item2.projectAuditorName != null">(
  197. <!-- {{item2.projectAuditorName}} -->
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  199. )</span>
  200. <!-- 审核通过 --> {{$t('state.approved')}}
  201. </span>
  202. </span>
  203. <span v-else-if="item2.isDeptAudit==1">
  204. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  205. ({{$t('other.await')}}
  206. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  207. {{$t('other.audit')}})
  208. </span>
  209. ]</span>
  210. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  211. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  212. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  213. </span>
  214. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  216. </span>
  217. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  218. <span v-if="user.company.packageEngineering == 1">
  219. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  223. (
  224. <!-- <span v-if="user.userNameNeedTranslate != 1">
  225. {{item2.projectAuditorName}}
  226. </span>
  227. <span v-if="user.userNameNeedTranslate == 1">
  228. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  229. </span> -->
  230. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  231. )
  232. </span>{{$t('other.audit')}} ]</span>
  233. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  234. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  235. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  236. </span>
  237. <!--每个项目上单独审核 -->
  238. <span style="float:right;">
  239. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  240. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  241. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  242. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  243. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  244. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  245. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  246. <!--自己可以撤回待审核状态的报告 -->
  247. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  248. </span>
  249. </p>
  250. <p v-if="user.companyId == yuzhongCompId">
  251. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  252. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  253. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  254. <!--任务分组和阶段 -->
  255. <p v-if="item2.groupId != 0">
  256. {{$t('other.taskGroup')}}:{{item2.groupName}}
  257. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  258. </p>
  259. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  260. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  261. <!-- 自定义日报文本 -->
  262. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  263. <p v-if="user.company.packageEngineering == 1">
  264. {{$t('other.professionalProgress')}}:
  265. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  266. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  267. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  268. </el-tooltip>
  269. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  270. <i class="iconfont firerock-iconshenhetongguo"></i>
  271. </el-tooltip>
  272. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  273. <i class="iconfont firerock-iconshenhebohui"></i>
  274. </el-tooltip>
  275. </span>
  276. </p>
  277. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  278. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  279. </p>
  280. <div v-if="item2.multiWorktime==0">
  281. <p style="display: inline-block;">{{$t('time.duration')}}:
  282. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  283. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  284. {{item2.time.toFixed(1)}}h
  285. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  286. </p>
  287. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  288. </div>
  289. <div v-if="item2.multiWorktime==1" >
  290. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  291. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  292. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  295. {{timeItem.time.toFixed(1)}}h
  296. </p>
  297. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  298. </div>
  299. </div>
  300. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  301. <!--照片的显示 -->
  302. <p v-if="item2.pics != null && item2.pics.length > 0">
  303. <el-image v-for="(pic, index) in item2.pics" :key="index"
  304. style="width: 100px; height: 100px; margin-right:10px;"
  305. :src="pic"
  306. :preview-src-list="item2.pics">
  307. </el-image>
  308. </p>
  309. </el-card>
  310. </el-timeline-item>
  311. </el-timeline>
  312. </div>
  313. </div>
  314. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  315. <!-- 简陋的无报告提示 -->
  316. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </el-card>
  323. </div>
  324. <!-- 工时推送日志弹窗 -->
  325. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  326. <template>
  327. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  328. </template>
  329. <template>
  330. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  331. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  332. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  333. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  334. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  335. <el-table-column prop="result" label="推送结果" width="250">
  336. <template slot-scope="scope">
  337. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  338. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  342. </el-table>
  343. </template>
  344. <span slot="footer" class="dialog-footer">
  345. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  346. </span>
  347. </el-dialog>
  348. <!-- 填写日报的dialog -->
  349. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  350. <div style="height: 65vh;overflow: auto;">
  351. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  352. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  353. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  354. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  355. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  356. <span class="spnn" v-if="workForm.userNames">
  357. <span v-for="(item, index) in workForm.userNames" :key="index">
  358. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  359. <span v-if="index < workForm.userNames.length - 1">,</span>
  360. </span>
  361. </span>
  362. <span class="spnn hover" v-else>
  363. {{$t('defaultText.pleaseSelectAsubstitute')}}
  364. </span>
  365. </div>
  366. </el-form-item>
  367. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  368. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  369. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  370. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  371. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  372. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  373. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName" style="margin-left:10px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  374. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  375. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  376. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  377. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  378. <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
  379. <!-- AI智能填报 -->
  380. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  381. </el-form-item>
  382. <!--考勤时长显示-->
  383. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  384. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  385. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  386. </span>
  387. <!--批量填报和批量代填不显示考勤记录-->
  388. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  389. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  390. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  391. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  392. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  393. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  394. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  395. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  396. @click="refreshAttendance(workForm.createDate)"></el-button>
  397. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  398. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  399. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  400. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  401. </el-form-item>
  402. <!-- 000000 -->
  403. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  404. <div v-if="reportTimeType.multiWorktime==0">
  405. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  406. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  407. <el-select v-model="domain.timeType" style="width:200px;"
  408. v-if="reportTimeType.type == 0"
  409. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  410. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  411. @change="onTimeTypeChange(domain.timeType)">
  412. <el-option
  413. v-for="item in timeType"
  414. :key="item.value"
  415. :label="item.label"
  416. :value="item.value">
  417. </el-option>
  418. </el-select>
  419. <!-- 数字时长选择 -->
  420. <el-select v-model="domain.workingTime" style="width:200px;"
  421. v-if="reportTimeType.type == 1"
  422. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  423. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  424. @change="seleChn(0,domain)">
  425. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  426. </el-select>
  427. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  428. <span v-if="reportTimeType.type == 2">
  429. <!--时间范围选择 -->
  430. <el-time-picker
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  432. v-model="domain.startTime"
  433. :placeholder="$t('time.startTime')"
  434. style="width:120px;"
  435. format="HH:mm"
  436. value-format="HH:mm"
  437. :picker-options="{
  438. start: '08:00',
  439. end: '23:30'
  440. }"
  441. @change="iptChang()">
  442. </el-time-picker> - <el-time-picker
  443. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  444. v-model="domain.endTime"
  445. :placeholder="$t('time.endTime')"
  446. style="width:120px;"
  447. format="HH:mm"
  448. value-format="HH:mm"
  449. :picker-options="{
  450. start: '08:00',
  451. end: '23:30',
  452. minTime: domain.startTime
  453. }"
  454. @change="iptChang()">
  455. </el-time-picker>
  456. </span>
  457. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  458. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  459. <el-input :disabled="!domain.canEdit || domain.isOvertime==null || domain.isOvertime==0 || !domain.isOvertime" v-model="domain.overtimeHours" @blur="triggerCalculateOT(index)" @input="domain.overtimeHours=domain.overtimeHours.replace(/[^\d.]/g,'')" style="width: 100px;"></el-input><span style="margin-left:5px">{{$t('time.hour')}}</span>
  460. </div>
  461. </el-form-item>
  462. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  463. :prop="'domains.' + index + '.reportTargetDeptId'"
  464. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  465. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  466. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  467. <span style="float: left">
  468. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  469. </span>
  470. </el-option>
  471. </el-select>
  472. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  473. </el-form-item>
  474. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  475. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  476. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  477. @change="selectProject(domain, index)"
  478. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  479. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  480. <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">
  481. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  482. <span style="float: right;">{{ item.projectName }}</span>
  483. </el-option>
  484. </el-option-group>
  485. </el-select>
  486. <!--昱众不显示子项目-->
  487. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  488. <span style="margin-left:45px;">
  489. {{$t('lable.subproject')}}</span>
  490. <!--子项目 -->
  491. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  492. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  493. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  494. </el-select>
  495. </template>
  496. <template v-if="user.companyId == yuzhongCompId">
  497. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  498. <!--角色选择 -->
  499. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  500. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  501. <el-option
  502. v-for="item in roleList"
  503. :key="item.value"
  504. :label="item.label"
  505. :value="item.value">
  506. </el-option>
  507. </el-select>
  508. </template>
  509. <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%;"
  510. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  511. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  512. </el-link>
  513. <!-- <el-link type="primary" v-if="canEdit"
  514. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  515. </el-form-item>
  516. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  517. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  518. </el-form-item>
  519. <!--如果设置了工时成本预警的预算成本项-->
  520. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  521. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  522. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  523. </el-select>
  524. </el-form-item>
  525. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  526. <template slot="label">
  527. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  528. <span >{{$t('lable.taskGrouping')}}</span>
  529. </template>
  530. <!-- 任务分组 -->
  531. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  533. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  534. </el-select>
  535. <template v-if="user.companyId == yuzhongCompId">
  536. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  537. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  538. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  539. <el-option
  540. v-for="item in domain.filteredRespList"
  541. :key="item.id"
  542. :label="item.jobRespon"
  543. :value="item.id">
  544. </el-option>
  545. </el-select>
  546. </template>
  547. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  548. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  549. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  550. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  551. @change="changeStages(domain, index)"
  552. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  553. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  554. </el-select>
  555. </template>
  556. </el-form-item>
  557. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  558. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  559. <template slot="label">
  560. <span style="color:#FF0000;">*</span>
  561. <span >{{$t('other.projectAuditor')}}</span>
  562. </template>
  563. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  564. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  565. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  566. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  567. </el-option>
  568. </el-select>
  569. <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>
  570. </el-form-item>
  571. </div>
  572. <el-form-item v-if="user.companyId == yuzhongCompId">
  573. <template slot="label">
  574. <span style="color:#FF0000;">*</span>
  575. <span >工作内容</span>
  576. </template>
  577. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  578. :disabled="(workForm.domains[index].state>=2?false:true)" >
  579. <el-option
  580. v-for="item in domain.workContentList"
  581. :key="item.id"
  582. :label="item.workContext"
  583. :value="item.id">
  584. </el-option>
  585. </el-select>
  586. </el-form-item>
  587. <!-- 111111 -->
  588. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  589. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  590. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  591. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  592. <span v-else>{{item.name}}</span>
  593. </el-option>
  594. </el-select>
  595. <template v-if="user.timeType.auditLevel > 1">
  596. <i class="el-icon-right"></i>
  597. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. </template>
  604. <template v-if="user.timeType.auditLevel > 2">
  605. <i class="el-icon-right"></i>
  606. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  607. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  608. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  609. <span v-else>{{item.name}}</span>
  610. </el-option>
  611. </el-select>
  612. </template>
  613. </el-form-item>
  614. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  615. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  616. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  617. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  618. <span v-else>{{item.name}}</span>
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <!-- 相关维度/自定义维度 -->
  623. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  624. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  625. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  626. </el-option>
  627. </el-select>
  628. </el-form-item>
  629. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  630. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  631. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  632. </el-option>
  633. </el-select>
  634. </el-form-item>
  635. <!-- 相关数值 -->
  636. <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">
  637. <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>
  638. </el-form-item>
  639. <!-- 自定义文本 -->
  640. <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">
  641. <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>
  642. </el-form-item>
  643. <!--按比例填报-->
  644. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  645. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  646. <div style="width:400px;">
  647. <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>
  648. <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>
  649. </div>
  650. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  651. <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>
  652. </div>
  653. </el-form-item>
  654. <!--工程专业版本模式下, 各个专业的进度填报 -->
  655. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  656. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  657. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  658. <el-input size="mini" style="width:60px;" v-model="item.progress"
  659. @keyup.native="onProgressChange"
  660. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  661. </span>
  662. </el-form-item>
  663. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  664. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  665. <template slot="label" v-if="user.timeType.taskRequired == 1">
  666. <span style="color:#FF0000;">*</span>
  667. <span >任务</span>
  668. </template>
  669. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  670. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  671. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  672. </el-select>
  673. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  674. </el-form-item>
  675. <!--针对依斯贝的SAP服务-->
  676. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  677. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  678. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  679. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  680. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  681. </el-select>
  682. </el-form-item>
  683. <!--工作事项-->
  684. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  685. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  686. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  687. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  688. </el-form-item>
  689. <!-- 拍照上传 -->
  690. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  691. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  692. <div class="photos">
  693. <div>
  694. <el-upload
  695. list-type="picture-card"
  696. :http-request="(file) => {return addImg(file, index)}"
  697. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  698. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  699. :file-list="domain.imgListUrl" :limit="9"
  700. :disabled="workForm.domains[index].state>=2?false:true">
  701. <i class="el-icon-plus"></i>
  702. </el-upload>
  703. </div>
  704. </div>
  705. </el-form-item>
  706. </div>
  707. <!--多个工作事项填报的情况 -->
  708. <div v-if="reportTimeType.multiWorktime==1">
  709. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  710. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  711. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  712. @change="selectProject(domain, index)"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  714. <!-- <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">
  715. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  716. <span style="float: right;">{{ item.projectName }}</span>
  717. </el-option> -->
  718. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  719. <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">
  720. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  721. <span style="float: right;">{{ item.projectName }}</span>
  722. </el-option>
  723. </el-option-group>
  724. </el-select>
  725. <template v-if="user.timeType.mainProjectState != 1">
  726. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  727. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  728. <!--子项目 -->
  729. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  730. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  731. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  732. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  733. </el-select>
  734. </template>
  735. <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;"
  736. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  737. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  738. </el-link>
  739. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  740. <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>
  741. </div>
  742. <!-- <el-link type="primary" v-if="canEdit"
  743. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  744. </el-form-item>
  745. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  746. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  747. </el-form-item>
  748. <!--如果设置了工时成本预警的预算成本项-->
  749. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  750. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  751. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  752. </el-select>
  753. </el-form-item>
  754. <el-form-item v-if="user.company.packageProject == 1">
  755. <template slot="label">
  756. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  757. <span >{{$t('lable.taskGrouping')}}</span>
  758. </template>
  759. <!-- 任务分组 -->
  760. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  761. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  762. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  763. </el-select>
  764. <!-- 项目的阶段 -->
  765. <span v-if="domain.stages != null && domain.stages.length> 0"
  766. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  767. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  768. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  769. @change="changeStages(domain, index)"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  771. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  772. </el-select>
  773. </el-form-item>
  774. <el-form-item :label="$t('other.projectAuditor')" >
  775. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  776. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  777. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  778. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  779. </el-option>
  780. </el-select>
  781. <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>
  782. </el-form-item>
  783. <!--工程专业版本模式下, 各个专业的进度填报 -->
  784. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  785. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  786. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  787. <el-input size="mini" style="width:60px;" v-model="item.progress"
  788. @keyup.native="onProgressChange"
  789. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  790. </span>
  791. </el-form-item>
  792. <!-- 相关维度 -->
  793. <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'">
  794. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  795. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  796. </el-option>
  797. </el-select>
  798. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  799. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  800. </el-option>
  801. </el-select>
  802. </el-form-item>
  803. <!-- 相关数值 -->
  804. <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">
  805. <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>
  806. </el-form-item>
  807. <!-- 自定义文本 -->
  808. <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">
  809. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  810. </el-form-item>
  811. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  812. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  813. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  814. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  815. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  816. </el-select>
  817. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  818. </el-form-item>
  819. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  820. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  821. <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>
  822. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  823. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  824. <span v-if="reportTimeType.type == 2">
  825. <!-- <span> -->
  826. <!--时间范围选择 -->
  827. <el-time-picker
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  829. v-model="timeItem.startTime"
  830. :placeholder="$t('time.startTime')"
  831. style="width:120px;"
  832. format="HH:mm"
  833. value-format="HH:mm"
  834. :picker-options="{
  835. start: '00:00',
  836. end: '23:59',
  837. }"
  838. @change="iptChangs()">
  839. </el-time-picker> - <el-time-picker
  840. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  841. v-model="timeItem.endTime"
  842. :placeholder="$t('time.endTime')"
  843. style="width:120px;"
  844. format="HH:mm"
  845. value-format="HH:mm"
  846. :picker-options="{
  847. start: '00:00',
  848. end: '23:59',
  849. minTime: timeItem.startTime
  850. }"
  851. @change="iptChangs()">
  852. </el-time-picker>
  853. </span>
  854. </el-form-item>
  855. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  856. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  857. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  858. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  859. ></el-input>
  860. </el-form-item>
  861. </div>
  862. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  863. </div>
  864. <!--照片的显示 -->
  865. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  866. <el-image v-for="(pic, index) in domain.pics" :key="index"
  867. style="width: 100px; height: 100px; margin-right:10px;"
  868. :src="pic"
  869. :preview-src-list="domain.pics">
  870. </el-image>
  871. </p>
  872. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  873. </div>
  874. <span id="workFormsItemBottom"></span>
  875. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  876. </el-form>
  877. </div>
  878. <span slot="footer" class="dialog-footer">
  879. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  880. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  881. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  882. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  883. <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>
  884. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  885. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  886. </span>
  887. </el-dialog>
  888. <!-- 按周填报 -->
  889. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  890. <!-- 按周填报-已填工时-点击 -->
  891. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  892. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  893. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  894. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  895. <el-table-column prop="state" :label="$t('state.states')">
  896. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  897. </el-table-column>
  898. <!-- <el-table-column label="操作">
  899. <template slot-scope="scope">
  900. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  901. </template>
  902. </el-table-column> -->
  903. </el-table>
  904. <span slot="footer" class="dialog-footer">
  905. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  906. </span>
  907. </el-dialog>
  908. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  909. <el-form-item style="height:30px;margin-top:-72px;">
  910. <!-- <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> -->
  911. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  912. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  913. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  914. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  915. <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>
  916. <el-option
  917. v-for="item in fillProjectList"
  918. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  919. :key="item.id"
  920. :label="item.projectName + '\u3000' + item.projectCode"
  921. :value="item.id">
  922. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  923. <span style="float: right">{{ item.projectName }}</span>
  924. </el-option>
  925. </el-select>
  926. <span style="float:right;margin-right:10px;">选择项目</span>
  927. </el-form-item>
  928. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  929. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  930. <template slot-scope="scope">
  931. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  932. </template>
  933. </el-table-column>
  934. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  935. <template slot-scope="scope">
  936. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  937. <p v-else></p>
  938. </template>
  939. </el-table-column> -->
  940. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  941. <template slot-scope="scope">
  942. <div v-if="scope.row.canFill == 1">
  943. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  944. <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>
  945. <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>
  946. <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>
  947. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  948. </div>
  949. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  950. <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>
  951. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  952. </div>
  953. </div>
  954. <div v-else >
  955. <span style="color:#999999;">不可超前填报</span>
  956. </div>
  957. </template>
  958. </el-table-column>
  959. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  960. <template slot-scope="scope">
  961. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  962. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  963. </template>
  964. </el-table-column>
  965. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  966. <template slot-scope="scope">
  967. <div class="zhiss">
  968. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  969. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  970. </div>
  971. </template>
  972. </el-table-column>
  973. </el-table>
  974. </el-form>
  975. <span slot="footer" class="dialog-footer" >
  976. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  977. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  978. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  979. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  980. <!--针对景昱,先检查工时是否存在异常-->
  981. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  982. </span>
  983. </el-dialog>
  984. <!-- 重庆物奇私人定制的按周填报 -->
  985. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  986. <div class="fillWeekDialogVisiCustom">
  987. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  988. </div>
  989. </el-dialog>
  990. <!-- 选择时间 -->
  991. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  992. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  993. <span slot="footer" class="dialog-footer">
  994. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  995. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  996. </span>
  997. </el-dialog>
  998. <!-- 按周填报弹窗 -->
  999. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1000. <div>
  1001. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1002. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1003. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1004. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1005. </el-select>
  1006. </div>
  1007. <!--如果设置了工时成本预警的预算成本项-->
  1008. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1009. <p>{{$t('lable.budgetSource')}}</p>
  1010. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1011. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1012. </el-select>
  1013. </div>
  1014. <!-- 任务分组 -->
  1015. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1016. <p>{{$t('lable.taskGrouping')}}</p>
  1017. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1018. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1019. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1020. </el-select>
  1021. </div>
  1022. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1023. <p>{{$t('other.inputStage')}}</p>
  1024. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1025. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1026. </el-select>
  1027. </div>
  1028. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1029. <p>{{$t('other.reviewer')}}</p>
  1030. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1031. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1032. </el-select>
  1033. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1034. </div>
  1035. <template v-if="user.timeType.reportAuditType == 3">
  1036. <div class="zhoFel">
  1037. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1038. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1039. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <div class="zhoFel">
  1044. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1045. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1046. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1047. </el-select>
  1048. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1049. </div>
  1050. <div class="zhoFel">
  1051. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1052. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1053. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1054. </el-select>
  1055. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1056. </div>
  1057. <div class="zhoFel">
  1058. <p>{{ $t('chao-song-ren') }}</p>
  1059. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1060. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1063. </div>
  1064. </template>
  1065. <!-- 自定义维度 -->
  1066. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1067. <p>{{user.timeType.customDegreeName}}</p>
  1068. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1069. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1070. </el-select>
  1071. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1072. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1073. </el-select>
  1074. </div>
  1075. <!-- 自定义数值 -->
  1076. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1077. <p>{{user.timeType.customDataName}}</p>
  1078. <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>
  1079. </div>
  1080. <!-- 自定义文本 -->
  1081. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1082. <p>{{user.timeType.customTextName}}</p>
  1083. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1084. </div>
  1085. <!-- 选择任务 -->
  1086. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1087. <p>任务 / 里程碑</p>
  1088. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1089. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1090. </el-select>
  1091. </div>
  1092. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1093. <p>{{$t('other.timeSelection')}}</p>
  1094. <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>
  1095. </div>
  1096. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1097. <p>{{$t('other.chooseDuration')}}</p>
  1098. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1099. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1100. </el-select>
  1101. </div>
  1102. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1103. <p>{{$t('lable.percentageOfTime')}}</p>
  1104. <div style="width:400px;display: flex;align-items: center;">
  1105. <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>
  1106. <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>
  1107. </div>
  1108. </div>
  1109. <div class="zhoFel">
  1110. <p>{{$t('other.workMatters')}}</p>
  1111. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1112. </div>
  1113. </div>
  1114. <span slot="footer" class="dialog-footer">
  1115. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1116. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1117. </span>
  1118. </el-dialog>
  1119. <!--导出报表条件选择 -->
  1120. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1121. <el-form ref="form3" :model="exportParam" >
  1122. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1123. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1124. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1125. </el-select>
  1126. </el-form-item>
  1127. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1128. <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>
  1129. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1130. </el-form-item>
  1131. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1132. <el-date-picker
  1133. v-model="exportParam.dateRange" :editable="false"
  1134. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1135. :range-separator="$t('other.to')"
  1136. type="daterange"
  1137. :start-placeholder="$t('time.startDate')"
  1138. :end-placeholder="$t('time.endDate')"
  1139. ></el-date-picker>
  1140. </el-form-item>
  1141. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1142. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1143. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1144. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1145. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1146. </el-select>
  1147. </el-form-item>
  1148. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1149. <div class="exportReportRadio">
  1150. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1151. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1152. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1153. <i class="el-icon-question"></i>
  1154. </el-tooltip>
  1155. </div>
  1156. </el-form-item>
  1157. </el-form>
  1158. <div slot="footer" class="dialog-footer">
  1159. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1160. </div>
  1161. </el-dialog>
  1162. <!--导出报表条件选择 -->
  1163. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1164. <el-form ref="form3" :model="exportParam" >
  1165. <el-form-item prop="range" :label="$t('time.dateRange')">
  1166. <el-date-picker
  1167. v-model="exportParam.dateRange" :editable="false"
  1168. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1169. :clearable="true"
  1170. :range-separator="$t('other.to')"
  1171. type="daterange"
  1172. :start-placeholder="$t('time.startDate')"
  1173. :end-placeholder="$t('time.endDate')"
  1174. ></el-date-picker>
  1175. </el-form-item>
  1176. </el-form>
  1177. <div slot="footer" class="dialog-footer">
  1178. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1179. </div>
  1180. </el-dialog>
  1181. <!--人员列表 -->
  1182. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1183. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1184. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1185. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1186. <el-table-column type="selection"></el-table-column>
  1187. <el-table-column prop="label" :label="$t('lable.name')" >
  1188. <template slot-scope="scope">
  1189. <span>
  1190. <!-- {{(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}} -->
  1191. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1192. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1194. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1195. </span>
  1196. <span v-else>
  1197. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1198. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1199. </span>
  1200. </span>
  1201. </template>
  1202. </el-table-column>
  1203. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1204. <template slot-scope="scope">
  1205. <div>
  1206. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1208. </div>
  1209. </template>
  1210. </el-table-column>
  1211. </el-table>
  1212. </el-tab-pane>
  1213. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1214. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1215. <el-table-column prop="label" :label="$t('lable.name')" >
  1216. <template slot-scope="scope">
  1217. <!-- <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> -->
  1218. <!-- <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> -->
  1219. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1220. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1221. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1222. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1223. </span>
  1224. <span v-else>
  1225. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1226. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1227. </span>
  1228. </template>
  1229. </el-table-column>
  1230. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. </el-table>
  1239. </el-tab-pane>
  1240. </el-tabs>
  1241. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1242. <el-table-column type="selection"></el-table-column>
  1243. <el-table-column prop="label" :label="$t('lable.name')" >
  1244. <template slot-scope="scope">
  1245. <div>
  1246. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1247. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1248. </div>
  1249. </template>
  1250. </el-table-column>
  1251. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1252. <template slot-scope="scope">
  1253. <div>
  1254. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1255. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1256. </div>
  1257. </template>
  1258. </el-table-column>
  1259. </el-table>
  1260. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1261. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1262. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1263. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1264. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1265. </div>
  1266. </el-dialog>
  1267. <!-- 按部门选择人员 -->
  1268. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1269. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1270. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1271. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1272. </el-input>
  1273. <div class="tree" style="height:400px">
  1274. <el-scrollbar style="height:100%">
  1275. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1276. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1277. highlight-current :filter-node-method="filterNode">
  1278. <span class="custom-tree-node" slot-scope="{ node }">
  1279. <span v-if="user.userNameNeedTranslate == '1'">
  1280. <span v-if="node.data.children">
  1281. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1282. </span>
  1283. <span v-else>
  1284. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1285. </span>
  1286. </span>
  1287. <span v-if="user.userNameNeedTranslate != '1'">
  1288. {{ node.label }}
  1289. </span>
  1290. <!-- {{ node.label }} -->
  1291. </span>
  1292. </el-tree>
  1293. </el-scrollbar>
  1294. </div>
  1295. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1296. <div slot="footer" class="dialog-footer">
  1297. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1298. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1299. </div>
  1300. </el-dialog>
  1301. <el-dialog
  1302. v-if="monthWorkTimeDialog"
  1303. :visible.sync="monthWorkTimeDialog"
  1304. :close-on-click-modal="false"
  1305. customClass="customWidth selectworktime"
  1306. width="1200px"
  1307. title=""
  1308. >
  1309. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1310. <el-tabs v-model="activeName" @tab-click="handleClick">
  1311. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1312. <div class="selectworktime_export" style="margin-top:10px;">
  1313. <div class="selectworktime_export_l">
  1314. <el-date-picker
  1315. class="selecteworktime_datapick"
  1316. v-model="WorktimeDatepickValue"
  1317. value-format="yyyy-MM-dd"
  1318. type="daterange"
  1319. align="right"
  1320. unlink-panels
  1321. :range-separator="$t('other.to')"
  1322. :start-placeholder="$t('time.startDate')"
  1323. :end-placeholder="$t('time.endDate')"
  1324. :default-time="['12:00:00', '12:00:00']"
  1325. size="small"
  1326. popper-class="selecteorktime_datapick_popper"
  1327. @change="showMonthWorkTime()"
  1328. >
  1329. </el-date-picker>
  1330. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1331. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1332. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1333. <!-- 222 -->
  1334. </div>
  1335. <div>
  1336. <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">
  1337. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1338. </el-input>
  1339. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1340. </div>
  1341. <div style="float: right; vertical-align: middle;height:32px">
  1342. <el-link
  1343. type="primary"
  1344. @click="exportMembWorkHours()"
  1345. >{{$t('export.exportData')}}</el-link
  1346. >
  1347. </div>
  1348. </div>
  1349. <el-table ref="hasworkTbl"
  1350. :data="monthWorkDataS"
  1351. v-el-table-infinite-scroll="listScroll"
  1352. border
  1353. :height="500"
  1354. highlight-current-row
  1355. style="width: 100%"
  1356. v-loading="tbload"
  1357. :lazy="true"
  1358. >
  1359. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1360. <template slot-scope="scope">
  1361. {{ scope.$index + 1 }}
  1362. </template>
  1363. </el-table-column>
  1364. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1365. <template slot-scope="scope">
  1366. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1367. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1368. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1369. <!-- {{scope.row.name}} -->
  1370. </span>
  1371. </template>
  1372. </el-table-column>
  1373. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1374. <template slot-scope="scope">
  1375. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1376. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1377. </template>
  1378. </el-table-column>
  1379. <el-table-column
  1380. min-width="105"
  1381. v-for="(item, index) in pickDateArray"
  1382. :key="index"
  1383. :label="item.label"
  1384. align="center"
  1385. >
  1386. <template slot-scope="scope">
  1387. <div
  1388. style="color: red"
  1389. v-if="
  1390. scope.row.worktimeList.filter(
  1391. (w) =>
  1392. w.createDate==item.date
  1393. ).length > 0 &&
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. )[0].workingTime < reportTimeType.allday
  1397. "
  1398. >
  1399. {{
  1400. scope.row.worktimeList.filter(
  1401. (w) =>w.createDate==item.date
  1402. )[0].workingTime.toFixed(1)
  1403. }}
  1404. </div>
  1405. <div
  1406. style="color: #20a0ff"
  1407. v-if="
  1408. scope.row.worktimeList.filter(
  1409. (w) =>w.createDate==item.date
  1410. ).length > 0 &&
  1411. scope.row.worktimeList.filter(
  1412. (w) =>w.createDate==item.date
  1413. )[0].workingTime > reportTimeType.allday
  1414. "
  1415. >
  1416. {{
  1417. scope.row.worktimeList.filter(
  1418. (w) =>w.createDate==item.date
  1419. )[0].workingTime.toFixed(1)
  1420. }}
  1421. </div>
  1422. <div
  1423. v-if="
  1424. scope.row.worktimeList.filter(
  1425. (w) =>w.createDate==item.date
  1426. ).length > 0 &&
  1427. scope.row.worktimeList.filter(
  1428. (w) =>w.createDate==item.date
  1429. )[0].workingTime == reportTimeType.allday
  1430. "
  1431. >
  1432. {{
  1433. scope.row.worktimeList.filter(
  1434. (w) =>w.createDate==item.date
  1435. )[0].workingTime
  1436. }}
  1437. </div>
  1438. <div
  1439. v-if="
  1440. scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. ).length == 0
  1443. "
  1444. >
  1445. 0
  1446. </div>
  1447. <div
  1448. v-if="
  1449. scope.row.worktimeList.filter(
  1450. (w) =>w.createDate==item.date
  1451. ).length > 0 &&
  1452. typeof scope.row.worktimeList.filter(
  1453. (w) =>w.createDate==item.date
  1454. )[0].workingTime == 'string'
  1455. "
  1456. >
  1457. {{
  1458. scope.row.worktimeList.filter(
  1459. (w) =>w.createDate==item.date
  1460. )[0].workingTime
  1461. }}
  1462. </div>
  1463. </template>
  1464. </el-table-column>
  1465. </el-table>
  1466. <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>
  1467. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1468. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1469. <label style="font-size: 16px">员工每日已填报工时数</label>
  1470. <el-link
  1471. type="primary"
  1472. style="float: right; margin-right: 60px"
  1473. @click="exportMembWorkHours()"
  1474. >导出已填报数据</el-link
  1475. > -->
  1476. <!-- <el-button >导出</el-button> -->
  1477. <!-- </div> -->
  1478. </el-tab-pane>
  1479. <el-tab-pane label="未提交人员列表" name="second" >
  1480. <div class="selectworktime_export" style="margin-top:10px">
  1481. <div class="selectworktime_export_l">
  1482. <el-date-picker
  1483. class="selecteworktime_datapick"
  1484. v-model="WorktimeDatepickValue"
  1485. value-format="yyyy-MM-dd"
  1486. type="daterange"
  1487. align="right"
  1488. unlink-panels
  1489. :range-separator="$t('other.to')"
  1490. :start-placeholder="$t('time.startDate')"
  1491. :end-placeholder="$t('time.endDate')"
  1492. :default-time="['12:00:00', '12:00:00']"
  1493. size="small"
  1494. popper-class="selecteorktime_datapick_popper"
  1495. @change="showMonthNotWorkTime()"
  1496. >
  1497. </el-date-picker>
  1498. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1499. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1500. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1501. </div>
  1502. <div>
  1503. <div style="margin-top:10px;">
  1504. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1505. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1506. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1507. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1508. </el-input>
  1509. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1510. <el-link
  1511. type="primary"
  1512. style="float: right; vertical-align: middle;height:32px"
  1513. @click="exportMembNotWorkHours()"
  1514. >{{$t('export.exportData')}}</el-link
  1515. >
  1516. </div>
  1517. </div>
  1518. </div>
  1519. <el-table
  1520. ref="hasworkTbl2"
  1521. :data="monthNotWorkDateS"
  1522. v-el-table-infinite-scroll="notListScroll"
  1523. border
  1524. :height="500"
  1525. highlight-current-row
  1526. style="width: 100%"
  1527. v-loading="tbload"
  1528. lazy
  1529. >
  1530. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1531. <template slot-scope="scope">
  1532. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1533. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1534. </template>
  1535. </el-table-column>
  1536. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1537. <template slot-scope="scope">
  1538. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1539. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1540. </template>
  1541. </el-table-column>
  1542. <el-table-column
  1543. min-width="200"
  1544. :label="$t('weekDay.date')"
  1545. align="center"
  1546. prop="createDate"
  1547. >
  1548. </el-table-column>
  1549. <el-table-column
  1550. min-width="200"
  1551. :label="$t('state.states')"
  1552. align="center"
  1553. prop="status"
  1554. />
  1555. <el-table-column
  1556. min-width="200"
  1557. :label="$t('other.attendanceData')"
  1558. prop="cardTime"
  1559. align="center"
  1560. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1561. </el-table>
  1562. <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>
  1563. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1564. </el-tab-pane>
  1565. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1566. <div class="selectworktime_export" style="margin-top:10px;">
  1567. <div class="selectworktime_export_l">
  1568. <el-date-picker
  1569. class="selecteworktime_datapick"
  1570. v-model="WorktimeDatepickValue"
  1571. value-format="yyyy-MM-dd"
  1572. type="daterange"
  1573. align="right"
  1574. unlink-panels
  1575. :range-separator="$t('other.to')"
  1576. :start-placeholder="$t('time.startDate')"
  1577. :end-placeholder="$t('time.endDate')"
  1578. :default-time="['12:00:00', '12:00:00']"
  1579. size="small"
  1580. popper-class="selecteorktime_datapick_popper"
  1581. @change="showMonthWorkTimeReminder()"
  1582. >
  1583. </el-date-picker>
  1584. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1585. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1586. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1587. </div>
  1588. <div>
  1589. <div style="margin-top:10px;">
  1590. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1591. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1592. </el-input>
  1593. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1594. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1595. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthWorkTimeReminder()"></vueCascader>
  1596. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1597. </div>
  1598. </div>
  1599. <div style="float: right; vertical-align: middle;height:32px">
  1600. <el-link
  1601. type="primary"
  1602. @click="changeReminder()"
  1603. >{{'变更提醒'}}</el-link
  1604. >
  1605. <el-link
  1606. type="primary"
  1607. @click="exportMembWorkHoursReminder()"
  1608. >{{$t('export.exportData')}}</el-link
  1609. >
  1610. </div>
  1611. </div>
  1612. <el-table ref="hasworkTbl"
  1613. :data="monthWorkDataS"
  1614. v-el-table-infinite-scroll="listScroll"
  1615. border
  1616. :height="500"
  1617. highlight-current-row
  1618. style="width: 100%"
  1619. v-loading="tbload"
  1620. :lazy="true"
  1621. >
  1622. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1623. <template slot-scope="scope">
  1624. {{ scope.row.createDate}}
  1625. </template>
  1626. </el-table-column>
  1627. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1628. <template slot-scope="scope">
  1629. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1630. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1631. <!-- {{scope.row.name}} -->
  1632. </template>
  1633. </el-table-column>
  1634. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1635. <template slot-scope="scope">
  1636. {{scope.row.invokeValue}}
  1637. </template>
  1638. </el-table-column>
  1639. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1640. <template slot-scope="scope">
  1641. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1642. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1643. </template>
  1644. </el-table-column>
  1645. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1646. <template slot-scope="scope">
  1647. {{ scope.row.workingTime}}
  1648. </template>
  1649. </el-table-column>
  1650. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1651. <template slot-scope="scope">
  1652. {{ scope.row.cardTime}}
  1653. </template>
  1654. </el-table-column>
  1655. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1656. <template slot-scope="scope">
  1657. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1658. </template>
  1659. </el-table-column>
  1660. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1661. <template slot-scope="scope">
  1662. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1663. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1664. </template>
  1665. </el-table-column>
  1666. </el-table>
  1667. <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>
  1668. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1669. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1670. <label style="font-size: 16px">员工每日已填报工时数</label>
  1671. <el-link
  1672. type="primary"
  1673. style="float: right; margin-right: 60px"
  1674. @click="exportMembWorkHours()"
  1675. >导出已填报数据</el-link
  1676. > -->
  1677. <!-- <el-button >导出</el-button> -->
  1678. <!-- </div> -->
  1679. </el-tab-pane>
  1680. </el-tabs>
  1681. </el-dialog>
  1682. <!--驳回弹出框 -->
  1683. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1684. <div>
  1685. <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')" />
  1686. </div>
  1687. <div slot="footer" class="dialog-footer">
  1688. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1689. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1690. </div>
  1691. </el-dialog>
  1692. <!-- 通过弹出框 -->
  1693. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1694. <div>
  1695. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1696. </div>
  1697. <div slot="footer" class="dialog-footer">
  1698. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1699. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1700. </div>
  1701. </el-dialog>
  1702. <!--批量导入日报 -->
  1703. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1704. <p>1. {{$t('other.download')}}
  1705. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1706. </p>
  1707. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1708. <p style="display: flex;justify-content: center;">
  1709. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1710. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1711. </el-upload>
  1712. </p>
  1713. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1714. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1715. </div>
  1716. </el-dialog>
  1717. <!-- 工时导入记录弹窗 -->
  1718. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1719. <div style="height: 452px">
  1720. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1721. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1722. <el-table-column prop="userName" :label="$t('other.operator')">
  1723. <template slot-scope="scope">
  1724. <div>
  1725. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1726. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1727. </div>
  1728. </template>
  1729. </el-table-column>
  1730. <el-table-column prop="datel" :label="$t('other.document')">
  1731. <template slot-scope="scope">
  1732. <div>
  1733. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1734. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1735. </div>
  1736. </template>
  1737. </el-table-column>
  1738. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1739. <template slot-scope="scope">
  1740. <div>
  1741. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1742. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1743. </div>
  1744. </template>
  1745. </el-table-column>
  1746. </el-table>
  1747. <el-col :span="24" class="paginatis">
  1748. <el-pagination
  1749. @size-change="handleSizeChange"
  1750. @current-change="handleCurrentChange"
  1751. :page-sizes="[20 , 50 , 80 , 100]"
  1752. :page-size="20"
  1753. layout="total, sizes, prev, pager, next"
  1754. :total="toViewForm.total"
  1755. style="float:right;"
  1756. ></el-pagination>
  1757. </el-col>
  1758. </div>
  1759. </el-dialog>
  1760. <!--基于企业微信考勤数据的工时导入 -->
  1761. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1762. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1763. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1764. </el-step>
  1765. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1766. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1767. </el-steps>
  1768. <div v-if="active==0" style="padding:30px;height:360px;">
  1769. <div style="margin-top:50px;margin-left:280px;">
  1770. <el-date-picker
  1771. v-model="importWxParam.date" :editable="false"
  1772. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1773. :clearable="true"
  1774. :range-separator="$t('other.to')"
  1775. type="daterange"
  1776. :start-placeholder="$t('time.startDate')"
  1777. :end-placeholder="$t('time.endDate')"
  1778. @change="loadCheckInData"
  1779. ></el-date-picker>
  1780. </div>
  1781. </div>
  1782. <div v-if="active==1" style="padding:10px;">
  1783. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1784. style="width: 100%;margin-top:5px;" >
  1785. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1786. <template slot-scope="scope">
  1787. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1788. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1789. </template>
  1790. </el-table-column>
  1791. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1792. </el-table-column>
  1793. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1794. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1795. <template slot-scope="scope">
  1796. <div>
  1797. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1798. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1799. </div>
  1800. </template>
  1801. </el-table-column>
  1802. <el-table-column prop="departmentName" label="部门" >
  1803. <template slot-scope="scope">
  1804. <div>
  1805. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1806. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1807. </div>
  1808. </template>
  1809. </el-table-column>
  1810. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1811. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1812. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1813. <template slot-scope="scope">
  1814. {{scope.row.workHours.toFixed(1)}}h
  1815. </template>
  1816. </el-table-column>
  1817. </el-table>
  1818. </div>
  1819. <div v-if="active==2" >
  1820. <p style="display: flex;justify-content: center;height:390px;">
  1821. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1822. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1823. </el-upload>
  1824. </p>
  1825. </div>
  1826. <div slot="title">
  1827. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1828. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1829. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1830. <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>
  1831. <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>
  1832. <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>
  1833. </div>
  1834. <span slot="footer">
  1835. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1836. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1837. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1838. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1839. </span>
  1840. </el-dialog>
  1841. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1842. <p style="display: flex;justify-content: center;height:100px;">
  1843. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1844. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1845. </el-upload>
  1846. </p>
  1847. </el-dialog>
  1848. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1849. <div>
  1850. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1851. v-model="deleteReportParam.date" :editable="false"
  1852. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1853. :clearable="true"
  1854. :range-separator="$t('other.to')"
  1855. type="daterange"
  1856. :start-placeholder="$t('time.startDate')"
  1857. :end-placeholder="$t('time.endDate')"
  1858. ></el-date-picker>
  1859. </div>
  1860. <div style="margin-top:10px;">
  1861. <span>请选择部门:</span>
  1862. <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>
  1863. <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>
  1864. </div>
  1865. <div style="margin-top:10px;">
  1866. <span>请选择员工:</span>
  1867. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1868. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1869. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1870. <span v-else>{{item.name}}</span>
  1871. </el-option>
  1872. </el-select>
  1873. </div>
  1874. <span slot="footer">
  1875. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1876. </span>
  1877. </el-dialog>
  1878. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1879. <div>
  1880. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1881. v-model="deleteReportParam.date" :editable="false"
  1882. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1883. :clearable="true"
  1884. :range-separator="$t('other.to')"
  1885. type="daterange"
  1886. :start-placeholder="$t('time.startDate')"
  1887. :end-placeholder="$t('time.endDate')"
  1888. ></el-date-picker>
  1889. </div>
  1890. <div style="margin-top:15px;">
  1891. <span>选择部门:</span>
  1892. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1893. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1894. size="small" v-if="user.userNameNeedTranslate != 1"
  1895. ></el-cascader>
  1896. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1897. </div>
  1898. <span slot="footer">
  1899. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1900. </span>
  1901. </el-dialog>
  1902. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1903. <div>
  1904. <span>选择时间:</span><el-date-picker
  1905. v-model="modImportTime"
  1906. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1907. :clearable="true"
  1908. type="datetime"
  1909. ></el-date-picker>
  1910. <span>选择导入人员:</span><el-select
  1911. v-model="modImportUserId"
  1912. >
  1913. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1914. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1915. <span v-else>{{item.name}}</span>
  1916. </el-option>
  1917. </el-select>
  1918. </div>
  1919. <span slot="footer">
  1920. <el-button @click="confirmChangeModTime" >确认</el-button>
  1921. </span>
  1922. </el-dialog>
  1923. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1924. <div>
  1925. <span>请选择年月:</span>
  1926. <el-date-picker
  1927. v-model="ratioYmonth" :editable="false"
  1928. format="yyyyMM" value-format="yyyyMM"
  1929. type="month"
  1930. ></el-date-picker>
  1931. </div>
  1932. <span slot="footer">
  1933. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1934. </span>
  1935. </el-dialog>
  1936. <!--工时批量代填 -->
  1937. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1938. <div>
  1939. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1940. v-model="importWxParam.date" :editable="false"
  1941. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1942. :clearable="true"
  1943. :range-separator="$t('other.to')"
  1944. type="daterange"
  1945. :start-placeholder="$t('time.startDate')"
  1946. :end-placeholder="$t('time.endDate')"
  1947. @change="loadCheckInData"
  1948. ></el-date-picker>
  1949. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1950. </div>
  1951. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1952. :key="timeStamp"
  1953. style="width: 100%;margin-top:5px;" ref="tab">
  1954. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1955. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1956. <template slot-scope="scope">
  1957. <div>
  1958. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1959. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1960. </div>
  1961. </template>
  1962. </el-table-column>
  1963. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1964. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1965. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1966. <template slot-scope="scope">
  1967. {{scope.row.workHours.toFixed(1)}}h
  1968. </template>
  1969. </el-table-column>
  1970. <!--项目名称列表 -->
  1971. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1972. <template slot-scope="scope">
  1973. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1974. </template>
  1975. </el-table-column>
  1976. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1977. <template slot-scope="scope">
  1978. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1979. </template>
  1980. </el-table-column>
  1981. </el-table>
  1982. </el-dialog>
  1983. <!--基于企业微信考勤数据的工时导入 -->
  1984. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1985. <div style="padding-bottom:10px;">
  1986. <p>{{importResultMsg}}</p>
  1987. </div>
  1988. <!-- <span slot="footer" class="dialog-footer">
  1989. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1990. </span> -->
  1991. </el-dialog>
  1992. <!-- 审核流程展示 -->
  1993. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1994. <div style="padding:20px 40px 20px 0">
  1995. <el-timeline :reverse="false">
  1996. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1997. <!-- {{item.msg}} -->
  1998. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1999. <span v-if="user.userNameNeedTranslate == 1">
  2000. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2001. <span>{{item.msgCon.two}}</span>
  2002. </span>
  2003. </el-timeline-item>
  2004. </el-timeline>
  2005. </div>
  2006. </el-dialog>
  2007. </section>
  2008. </template>
  2009. <script>
  2010. // 左右滑动
  2011. import dragMixin from "@/common/js/tensile.js";
  2012. import util from "../../common/js/util";
  2013. // 自定义select组件
  2014. import selectCat from "@/components/select.vue"
  2015. // 引入自定义级联组件
  2016. import vueCascader from "@/components/cascader.vue"
  2017. // 重庆物奇定制组件
  2018. import WeeklyCustomization from "./weeklyCustomization.vue"
  2019. import { mapMutations } from 'vuex'
  2020. let _that = this
  2021. export default {
  2022. mixins: [dragMixin],
  2023. components: {
  2024. selectCat,
  2025. vueCascader,
  2026. WeeklyCustomization
  2027. },
  2028. data() {
  2029. return {
  2030. pageIndex: 0,
  2031. hasMore: true,
  2032. exportType: 0,
  2033. exportingData: false,
  2034. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2035. jobResponseList:[],
  2036. yisibeiCompId: 3092,
  2037. yuzhongCompId: 3385,
  2038. mingyiName : '成都明夷电子科技有限公司',
  2039. // mingyiName : '明夷',
  2040. modItemDataId: null,
  2041. modImportTime: null,
  2042. modImportUserId: null,
  2043. showModImportTimeDialog: false,
  2044. showBatchSimpleApproveReport: false,
  2045. startDeleting: false,
  2046. showBatchDeleteReport: false,
  2047. deleteReportParam: {date:null, userIds:[]},
  2048. isDenying: false,
  2049. targetWeekDate: null,//填写周报中的周日期
  2050. importCardTimeVisi: false,
  2051. startRatioExporting: false,
  2052. exportUserRatio: false,
  2053. ratioYmonth:null,
  2054. hasWrittenReport: false,
  2055. today:null,
  2056. syncTimeLoading: false,
  2057. seluserText: '',
  2058. translation: '1', // 1、文字, 2、部门, 3、人员
  2059. exportLoad: false,
  2060. getPickerOptions: {
  2061. disabledDate: (time) => {
  2062. var date = new Date();
  2063. var year = date.getFullYear();
  2064. var month = date.getMonth() + 1;
  2065. if (month >= 1 && month <= 9) {
  2066. month = "0" + month;
  2067. }
  2068. var currentdate = year.toString() + month.toString();
  2069. var timeyear = time.getFullYear();
  2070. var timemonth = time.getMonth() + 1;
  2071. if (timemonth >= 1 && timemonth <= 9) {
  2072. timemonth = "0" + timemonth;
  2073. }
  2074. var timedate = timeyear.toString() + timemonth.toString();
  2075. if(this.user.timeType.fillAhead == 0){
  2076. return currentdate < timedate;
  2077. }else{
  2078. return false
  2079. }
  2080. }
  2081. },
  2082. alalal: '8.0',
  2083. timeBasecostList:null,
  2084. tbload: false,
  2085. exportTimeDialog: false,
  2086. searchKeyword: '',
  2087. monthWorkDataS: [],
  2088. monthNotWorkDateS: [],
  2089. pickDateArray:[],
  2090. WorktimeDatepickValue: [],
  2091. activeName:"first",
  2092. isLeave: 0,
  2093. submitingReport: false,
  2094. importResultMsg:null,
  2095. showImportResult:false,
  2096. importingData: false,
  2097. isDraft: 0,
  2098. timeStamp: 0,
  2099. projectColumns:[],
  2100. checkinLoading:false,
  2101. importWxParam:{date:null,},
  2102. active:0,
  2103. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2104. importWxDialog:false,
  2105. importDialog:false,
  2106. denyForm:null,
  2107. denyReasonDialog:false,
  2108. monthWorkTimeDialog: false,
  2109. isSubstitude:false,
  2110. isFill:false,
  2111. unFillList:[],
  2112. fillList:[],
  2113. fillMembList:[],
  2114. fillMembList_leave: [],
  2115. membListVisible: false,
  2116. isBatch:0,//是否是批量填报
  2117. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2118. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2119. 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')],
  2120. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2121. fillStatusList: [],
  2122. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2123. exportDialog:false,
  2124. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2125. subProjectList:[],
  2126. canEdit: true,
  2127. originCanEdit: true,
  2128. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2129. selectTime:null,
  2130. reportTimeType:{},
  2131. curDate:'',
  2132. isAllSelect: false,
  2133. approveDialogVisible:false,
  2134. deptId:null,
  2135. targetUid: null,
  2136. membCount:0,
  2137. selectState:"-1",
  2138. user: JSON.parse(sessionStorage.getItem("user")),
  2139. allUsersList: [],
  2140. showAddMore:false,
  2141. allDate: [],
  2142. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2143. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2144. choseDay: 0,
  2145. tableHeight: 0,
  2146. listLoading: false,
  2147. projectList: [], //项目列表
  2148. fillProjectList: [],
  2149. reportList: [], //日报列表
  2150. reportNames:[], //批量审批列表
  2151. selCon:[], //筛选条件
  2152. selProjectList:[], //筛选后项目列表
  2153. selConShow: true,
  2154. usersList: [], // 全部人员列表
  2155. usersListId: '', // 选中的人员id
  2156. dialogVisible: false, //项目弹窗
  2157. report: '',
  2158. workForm: {
  2159. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2160. domains: [{
  2161. id: null,
  2162. projectId: "",
  2163. workingTime: "",
  2164. timeType:0,
  2165. content: "",
  2166. state: 2,
  2167. multiWorktime:0,
  2168. worktimeList:[],
  2169. degreeId: null,
  2170. auditUserList: [],
  2171. }],
  2172. showRefresh: false,
  2173. },
  2174. workRules: {
  2175. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2176. },
  2177. chooseParticipVisible: false,
  2178. logining: false,
  2179. isDisable: false,
  2180. timeType:[],
  2181. deptMembData: [
  2182. ],
  2183. //部门人员树状结构
  2184. data: [
  2185. {
  2186. id: -1,
  2187. label: this.$t('lable.allStaff'),
  2188. membCount:0
  2189. },
  2190. {
  2191. id: 0,
  2192. label: this.$t('lable.unassigned'),
  2193. }
  2194. ],
  2195. allData:{},
  2196. batchShowData:{},
  2197. option: [],
  2198. deptOptionList: [],
  2199. depData: {
  2200. id: -1,
  2201. label: this.$t('lable.allStaff'),
  2202. },
  2203. defaultProps: {
  2204. children: 'children',
  2205. label: 'label'
  2206. },
  2207. isNew: false,
  2208. selected: false,
  2209. valuet: new Date(),
  2210. domObj: null,
  2211. participator:[],
  2212. chosenMembCount:0,
  2213. jsDay: 0,
  2214. jsTime: 0,
  2215. falsss: false,
  2216. weidu: [],
  2217. weiduList: [],
  2218. yonghuUser: [],
  2219. dateAr: [],
  2220. batchSubFillDialog: false,
  2221. isSubstiS: false,
  2222. fillWeekDialogVisi: false,
  2223. fillWeekDialogVisiCustom: false,
  2224. zhoData: [],
  2225. weekDateRange: [],
  2226. btnZho: false,
  2227. weekDataLoading: false,
  2228. changdu: 6,
  2229. tianxieDialogVisible: false,
  2230. scopess: {},
  2231. zhoBao: {
  2232. time: '',
  2233. workingTime: '',
  2234. progress: '',
  2235. con: '',
  2236. subProjectId: '',
  2237. stage: '',
  2238. subProjectList: [],
  2239. stages: [],
  2240. },
  2241. zhoBaoIdx: '',
  2242. zhoBaoName: '',
  2243. zhis: {},
  2244. dealList: [],
  2245. toViewDialogVisible: false,
  2246. toViewList: [],
  2247. toViewloading: true,
  2248. toViewForm: {
  2249. pageIndex: '1',
  2250. pageSize: '20',
  2251. total: 0,
  2252. },
  2253. toViewloadings: false,
  2254. tabPositionss: 'top',
  2255. monthTotal: 0,
  2256. monthTotalPage: 0,
  2257. monthTotalLages: 20,
  2258. monthWorkData: [],
  2259. monthNotWorkDate: [],
  2260. monthWorkDataS1: [],
  2261. monthnotTotal: 0,
  2262. monthnotTotalPage: 0,
  2263. monthnotTotalLages: 20,
  2264. monthNotWorkDateS1: [],
  2265. deptMembDataText: '',
  2266. isFlag: false,
  2267. isMore: false,
  2268. stateKey: '0',
  2269. expandDate: [],
  2270. notifySelList:[],
  2271. departmentList: [],
  2272. approvalProcessDialog: false,
  2273. approvalProcessData: [],
  2274. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2275. 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')],
  2276. isWeekend: false,
  2277. canCancelInDialog: false,
  2278. approveinData: {},
  2279. approveinDialog: false,
  2280. reportCanDelete: false,
  2281. weeklyFilledTimeDialog: false,
  2282. weeklyFilledTimeList: [],
  2283. weeklyFilledTimeLoading: false,
  2284. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2285. weeklyFilledTimeCanDelete: false,
  2286. weeklyFilledTimeDate: null,
  2287. leaveAllNum: 0,
  2288. dataLoading: false,
  2289. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2290. vacationTime: {},
  2291. integrationProjectList: [],
  2292. totalReportHours: 0, // 合计的工时
  2293. workTimeForMinYi:0,
  2294. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2295. weekIndex: 1,
  2296. weekParentData: {},
  2297. deptIdForNoReport:[],
  2298. deptIdForReminder:[],
  2299. nameAearch: '', // 企业微信姓名搜索
  2300. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2301. deptMembDataLoading: false,
  2302. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2303. {
  2304. id: 4811,
  2305. // id: 10,
  2306. name: '陕西柘中建设工程有限公司'
  2307. }
  2308. ],
  2309. pushWorkTimeLogDig:false,
  2310. pushWorkTimeLogData:[],
  2311. userReportDeptList: [],
  2312. isReminder:true
  2313. };
  2314. },
  2315. watch: {
  2316. deptMembDataText(val) {
  2317. this.$refs.chooseMembTree.filter(val);
  2318. }
  2319. },
  2320. filters: {
  2321. // 过滤
  2322. amounts(value) {
  2323. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2324. return 0
  2325. }
  2326. var zhi = +value + 0
  2327. return zhi.toFixed(1)
  2328. },
  2329. // zhoData
  2330. zhoData(value, arr) {
  2331. var dateArray = value.split("-");
  2332. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2333. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2334. // console.log(arr[date.getDay()])
  2335. // return "周" + "日一二三四五六".charAt(date.getDay());
  2336. return arr[date.getDay()]
  2337. },
  2338. // 过滤数字
  2339. numbers(value) {
  2340. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2341. return 0
  2342. }
  2343. return value
  2344. },
  2345. },
  2346. computed: {},
  2347. mounted() {
  2348. var now = new Date();
  2349. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2350. this.today = t;
  2351. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2352. this.exportParam.dateRange = [startStr,t];
  2353. this.getAllDate(1);
  2354. this.getReportList();
  2355. this.getProjectList();
  2356. this.getFillProjectList();
  2357. this.getTimeType();
  2358. this.getDepartment();
  2359. this.scrollFunction()
  2360. this.userssHu();
  2361. this.getFirstAndLastDay()
  2362. if(this.user.timeType.reportAuditType == 3){
  2363. this.getAllUsersList()
  2364. }
  2365. if (this.user.company.packageProject == 1) {
  2366. this.getBasecostItemList();
  2367. }
  2368. if(this.user.timeType.userWithMultiDept == 1) {
  2369. this.getDeptMembData();
  2370. }
  2371. if(this.user.timeType.lockWorktime){
  2372. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2373. }
  2374. //设置了下限
  2375. if (this.user.timeType.minReportTime) {
  2376. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2377. }
  2378. const that = this
  2379. if(this.user.userNameNeedTranslate == 1) {
  2380. that.dataLoading = that.$store.state.dataLoading
  2381. this.upDataLoading()
  2382. setTimeout(()=>{
  2383. that.dataLoading = that.$store.state.dataLoading
  2384. }, 1000)
  2385. }
  2386. if (this.user.companyId == this.yuzhongCompId) {
  2387. this.getJobResponList();
  2388. }
  2389. },
  2390. methods: {
  2391. ...mapMutations(['upDataLoading']),
  2392. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2393. isCustomization(userInfo, permissionArray) {
  2394. const { companyId } = userInfo
  2395. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2396. return isReportPictureRequired
  2397. },
  2398. // 获取如何信息选的可填写部门
  2399. getDeptMembData() {
  2400. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2401. if (res.code == "ok") {
  2402. let lists = res.data.userReportDeptList || []
  2403. const optimizedList = lists.map(item => ({
  2404. ...item,
  2405. label: item.departmentName,
  2406. value: item.departmentId,
  2407. }));
  2408. this.$set(this, 'userReportDeptList', optimizedList || []);
  2409. } else {
  2410. this.$message({
  2411. message: res.msg,
  2412. type: "error"
  2413. });
  2414. }
  2415. },error => { });
  2416. },
  2417. //任务被选中
  2418. onTaskSelected(domainItem) {
  2419. //取服务
  2420. if (domainItem.taskId) {
  2421. var that = this;
  2422. var param = {taskId:domainItem.taskId};
  2423. if (this.isSubstitude) {
  2424. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2425. param.userId = this.workForm.userId[0];
  2426. }
  2427. }
  2428. this.http.post('/task/getMyTaskService',param, res => {
  2429. if (res.code == "ok") {
  2430. // domainItem.workContentList = res.data;
  2431. that.$set(domainItem, 'sapServiceId', null);
  2432. that.$set(domainItem, 'serviceList', res.data);
  2433. } else {
  2434. this.$message({
  2435. message: res.msg,
  2436. type: "error"
  2437. });
  2438. }
  2439. },error => {
  2440. this.$message({
  2441. message: error,
  2442. type: "error"
  2443. });
  2444. }
  2445. );
  2446. } else {
  2447. //清空服务
  2448. }
  2449. },
  2450. onBatchTimeChange() {
  2451. //反向计算每日工作时长
  2452. if (this.workForm.createDate) {
  2453. let sdate = new Date(this.workForm.createDate[0]);
  2454. let edate = new Date(this.workForm.createDate[1]);
  2455. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2456. console.log('days===', days)
  2457. if (days < 0) {
  2458. return;
  2459. }
  2460. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2461. //总时长发生改变,自动按比例计算
  2462. this.workForm.domains.forEach(d=>{
  2463. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2464. });
  2465. }
  2466. },
  2467. //更新工作内容列表
  2468. updateJobContent(domainItem) {
  2469. var that = this;
  2470. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2471. if (res.code == "ok") {
  2472. // domainItem.workContentList = res.data;
  2473. that.$set(domainItem, 'extraField3', null);
  2474. that.$set(domainItem, 'workContentList', res.data);
  2475. } else {
  2476. this.$message({
  2477. message: res.msg,
  2478. type: "error"
  2479. });
  2480. }
  2481. },error => {
  2482. this.$message({
  2483. message: error,
  2484. type: "error"
  2485. });
  2486. }
  2487. );
  2488. },
  2489. updateResponse(domainItem) {
  2490. var that = this;
  2491. var selectPid = domainItem.projectId;
  2492. domainItem.extraField2 = null;
  2493. domainItem.extraField3 = null;
  2494. if (selectPid && domainItem.extraField1) {
  2495. //是否非项目
  2496. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2497. console.log('==========','isPublic=='+isPublic);
  2498. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2499. console.log(filteredRespList);
  2500. domainItem.filteredRespList = filteredRespList;
  2501. }
  2502. },
  2503. getJobResponList() {
  2504. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2505. if (res.code == "ok") {
  2506. this.jobResponseList = res.data;
  2507. } else {
  2508. this.$message({
  2509. message: res.msg,
  2510. type: "error"
  2511. });
  2512. }
  2513. },error => {
  2514. this.$message({
  2515. message: error,
  2516. type: "error"
  2517. });
  2518. }
  2519. );
  2520. },
  2521. openModImportTime(row) {
  2522. this.showModImportTimeDialog = true;
  2523. this.modItemDataId = row.id;
  2524. },
  2525. delImportTime(row) {
  2526. let rowId = row.id;
  2527. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2528. confirmButtonText: this.$t('btn.determine'),
  2529. cancelButtonText: this.$t('btn.cancel'),
  2530. type: "warning"
  2531. })
  2532. .then(() => {
  2533. this.http.post('/report-import-log/delete',{
  2534. id: rowId
  2535. },res => {
  2536. if (res.code == "ok") {
  2537. this.$message({
  2538. message: '删除成功',
  2539. type: "success"
  2540. });
  2541. this.getToView();
  2542. } else {
  2543. this.$message({
  2544. message: res.msg,
  2545. type: "error"
  2546. });
  2547. }
  2548. },error => {
  2549. this.$message({
  2550. message: error,
  2551. type: "error"
  2552. });
  2553. }
  2554. );
  2555. }).catch(() => {this.startDeleting = false});
  2556. },
  2557. confirmChangeModTime() {
  2558. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2559. this.$message({
  2560. message: '请选择时间',
  2561. type: "error"
  2562. });
  2563. return;
  2564. }
  2565. this.http.post('/report-import-log/changeTime',{
  2566. modLogDateTime: this.modImportTime,
  2567. modImportUserId: this.modImportUserId,
  2568. id: this.modItemDataId
  2569. },res => {
  2570. if (res.code == "ok") {
  2571. this.$message({
  2572. message: '修改成功',
  2573. type: "success"
  2574. });
  2575. this.getToView();
  2576. this.showModImportTimeDialog = false;
  2577. } else {
  2578. this.$message({
  2579. message: res.msg,
  2580. type: "error"
  2581. });
  2582. }
  2583. },error => {
  2584. this.$message({
  2585. message: error,
  2586. type: "error"
  2587. });
  2588. }
  2589. );
  2590. },
  2591. confirmBatchApproveReport() {
  2592. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2593. this.$message({
  2594. message: '请选择日期范围',
  2595. type: "error"
  2596. });
  2597. return;
  2598. }
  2599. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2600. confirmButtonText: this.$t('btn.determine'),
  2601. cancelButtonText: this.$t('btn.cancel'),
  2602. type: "warning"
  2603. })
  2604. .then(() => {
  2605. this.startDeleting = true;
  2606. let obj = {
  2607. startDate: this.deleteReportParam.date[0],
  2608. endDate: this.deleteReportParam.date[1]
  2609. }
  2610. if(this.deleteReportParam.departmentId) {
  2611. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2612. } else {
  2613. obj.departmentId = null
  2614. }
  2615. this.http.post('/report/batchApproveByDate',obj,res => {
  2616. if (res.code == "ok") {
  2617. this.$message({
  2618. message: '审核通过',
  2619. type: "success"
  2620. });
  2621. this.getReportList();
  2622. this.getDepartment();
  2623. this.startDeleting = false;
  2624. } else {
  2625. this.$message({
  2626. message: res.msg,
  2627. type: "error"
  2628. });
  2629. }
  2630. },error => {
  2631. this.$message({
  2632. message: error,
  2633. type: "error"
  2634. });
  2635. }
  2636. );
  2637. }).catch(() => {this.startDeleting = false});
  2638. },
  2639. confirmBatchDelReport() {
  2640. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2641. this.$message({
  2642. message: '请选择部门或人员',
  2643. type: "error"
  2644. });
  2645. return;
  2646. }
  2647. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2648. this.$message({
  2649. message: '请选择日期范围',
  2650. type: "error"
  2651. });
  2652. return;
  2653. }
  2654. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2655. confirmButtonText: this.$t('btn.determine'),
  2656. cancelButtonText: this.$t('btn.cancel'),
  2657. type: "warning"
  2658. })
  2659. .then(() => {
  2660. this.startDeleting = true;
  2661. this.http.post('/report/batchDelete',{
  2662. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2663. startDate: this.deleteReportParam.date[0],
  2664. endDate: this.deleteReportParam.date[1],
  2665. deptId: this.deleteReportParam.deptId[0]
  2666. },res => {
  2667. if (res.code == "ok") {
  2668. this.$message({
  2669. message: this.$t('message.successfullyDeleted'),
  2670. type: "success"
  2671. });
  2672. this.getReportList();
  2673. this.getDepartment();
  2674. this.startDeleting = false;
  2675. } else {
  2676. this.$message({
  2677. message: res.msg,
  2678. type: "error"
  2679. });
  2680. }
  2681. },error => {
  2682. this.$message({
  2683. message: error,
  2684. type: "error"
  2685. });
  2686. }
  2687. );
  2688. }).catch(() => {this.startDeleting = false});
  2689. },
  2690. getRecentlyProject() {
  2691. this.http.post('/project/nearProject',{},res => {
  2692. if(res.code == 'ok'){
  2693. let topObj = {
  2694. label: '最近选择项目',
  2695. peojectList: res.data
  2696. }
  2697. let botomObj = {
  2698. label: '全部项目',
  2699. peojectList: this.fillProjectList
  2700. }
  2701. //最近项目如果在fillProjectList中不存在,需要移除
  2702. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2703. this.integrationProjectList = [topObj, botomObj]
  2704. }else {
  2705. this.$message({
  2706. message: res.msg,
  2707. type: 'error'
  2708. })
  2709. }
  2710. },err => {
  2711. this.$message({
  2712. message: err,
  2713. type: 'error'
  2714. })
  2715. })
  2716. },
  2717. handlePictureCardPreview(file, index) {
  2718. console.log(file, index)
  2719. let arr = []
  2720. let imgArr = this.workForm.domains[index].imgListUrl
  2721. for(var i in imgArr) {
  2722. arr.push(imgArr[i].url)
  2723. }
  2724. console.log(arr, '图片数据')
  2725. const $viewer = this.$viewerApi({
  2726. images: arr
  2727. });
  2728. },
  2729. // 图片上传
  2730. addImg(e, index) {
  2731. console.log(e, '数据')
  2732. let formData = new FormData()
  2733. formData.append('multipartFile', e.file)
  2734. this.http.uploadFile('/common/uploadFile', formData,
  2735. res => {
  2736. if (res.code == "ok") {
  2737. this.$message({
  2738. message: this.$t('uploadedsuccessfully'),
  2739. type: "success"
  2740. });
  2741. if(!this.workForm.domains[index].imgList) {
  2742. this.workForm.domains[index].imgList = []
  2743. this.workForm.domains[index].imgListUrl = []
  2744. }
  2745. this.workForm.domains[index].imgList.push(res.data)
  2746. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2747. } else {
  2748. this.$message({message: res.msg,type: "error"});
  2749. }
  2750. console.log(this.workForm.domains[index])
  2751. },
  2752. error => {this.$message({message: error,type: "error"});
  2753. });
  2754. },
  2755. // 删除图片
  2756. delImg(file,fileList, index) {
  2757. console.log(file, fileList)
  2758. let idx = 0
  2759. for(let i in fileList) {
  2760. if(fileList[i].uid == file.uid) {
  2761. idx = i
  2762. }
  2763. }
  2764. this.workForm.domains[index].imgList.splice(idx, 1)
  2765. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2766. console.log(this.workForm.domains[index])
  2767. },
  2768. test(){
  2769. console.log('test',this.workForm.domains);
  2770. },
  2771. getHour(s1, s2) {
  2772. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2773. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2774. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2775. var ms = s2.getTime() - s1.getTime();
  2776. if (ms < 0) return 0;
  2777. let ma = ms / 1000 / 60 / 60
  2778. return ma; //小时
  2779. },
  2780. refreshWXCardTime(workdate) {
  2781. if (!workdate) return;
  2782. this.syncTimeLoading = true;
  2783. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2784. date: workdate,
  2785. },res => {
  2786. this.syncTimeLoading = false;
  2787. if(res.code == 'ok'){
  2788. this.workForm.time = res.data.time;
  2789. }else {
  2790. this.$message({
  2791. message: res.msg,
  2792. type: 'error'
  2793. })
  2794. }
  2795. },err => {
  2796. this.syncTimeLoading = false;
  2797. this.$message({
  2798. message: err,
  2799. type: 'error'
  2800. })
  2801. })
  2802. },
  2803. refreshAttendance(workdate) {
  2804. if (!workdate) return;
  2805. this.syncTimeLoading = true;
  2806. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2807. startDate: workdate[0],
  2808. endDate: workdate[1]
  2809. },res => {
  2810. this.syncTimeLoading = false;
  2811. if(res.code == 'ok'){
  2812. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2813. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2814. this.totalReportHours = this.workTimeForMinYi;
  2815. }else {
  2816. this.$message({
  2817. message: res.msg,
  2818. type: 'error'
  2819. })
  2820. }
  2821. },err => {
  2822. this.syncTimeLoading = false;
  2823. this.$message({
  2824. message: err,
  2825. type: 'error'
  2826. })
  2827. })
  2828. },
  2829. refreshBeiSengAttendance(workdate) {
  2830. if (!workdate) return;
  2831. this.syncTimeLoading = true;
  2832. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2833. createDate: workdate
  2834. },res => {
  2835. this.syncTimeLoading = false;
  2836. if(res.code == 'ok'){
  2837. this.workForm.time = res.data;
  2838. }else {
  2839. this.$message({
  2840. message: res.msg,
  2841. type: 'error'
  2842. })
  2843. }
  2844. },err => {
  2845. this.syncTimeLoading = false;
  2846. this.$message({
  2847. message: err,
  2848. type: 'error'
  2849. })
  2850. })
  2851. },
  2852. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2853. this.weeklyFilledTimeDialog = true
  2854. this.weeklyFilledTimeLoading = true
  2855. this.weeklyFilledTimeDate = parameterDate
  2856. this.http.post('/report/getReportList',{
  2857. date: parameterDate,
  2858. userId: this.user.id
  2859. },res => {
  2860. this.weeklyFilledTimeLoading = false
  2861. if(res.code == 'ok'){
  2862. this.weeklyFilledTimeList = res.data[0].data
  2863. let candelete = true
  2864. for(let i in this.weeklyFilledTimeList){
  2865. if(this.weeklyFilledTimeList[i].state < 2){
  2866. candelete = false
  2867. }
  2868. }
  2869. this.weeklyFilledTimeCanDelete = candelete
  2870. }else {
  2871. this.$message({
  2872. message: res.msg,
  2873. type: 'error'
  2874. })
  2875. }
  2876. },err => {
  2877. this.weeklyFilledTimeLoading = false
  2878. this.$message({
  2879. message: err,
  2880. type: 'error'
  2881. })
  2882. })
  2883. },
  2884. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2885. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2886. confirmButtonText: this.$t('btn.determine'),
  2887. cancelButtonText: this.$t('btn.cancel'),
  2888. type: "warning"
  2889. })
  2890. .then(() => {
  2891. this.http.post('/report/delete',{
  2892. userId: this.user.id,
  2893. date: this.weeklyFilledTimeDate
  2894. },res => {
  2895. if (res.code == "ok") {
  2896. this.$message({
  2897. message: this.$t('message.successfullyDeleted'),
  2898. type: "success"
  2899. });
  2900. this.getWeeklyWorkTime()
  2901. this.getReportList();
  2902. this.getDepartment();
  2903. this.weeklyFilledTimeDialog = false;
  2904. } else {
  2905. this.$message({
  2906. message: res.msg,
  2907. type: "error"
  2908. });
  2909. }
  2910. },error => {
  2911. this.$message({
  2912. message: error,
  2913. type: "error"
  2914. });
  2915. }
  2916. );
  2917. }).catch(() => {});
  2918. },
  2919. getApprovalProcess(item){
  2920. // console.log('this.date',this.choseDate);
  2921. this.http.post('/report-log/get',{
  2922. creatorId: item.id,
  2923. createDate: sessionStorage.msg
  2924. },res => {
  2925. if(res.code == 'ok'){
  2926. this.approvalProcessDialog = true
  2927. if(this.user.userNameNeedTranslate == 1) {
  2928. for(var i in res.data) {
  2929. let obj = {
  2930. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2931. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2932. }
  2933. res.data[i].msgCon = obj
  2934. }
  2935. }
  2936. this.approvalProcessData = res.data
  2937. console.log(this.approvalProcessData, '数据卡看')
  2938. }else{
  2939. this.$message({
  2940. message: res.msg,
  2941. type: 'error'
  2942. })
  2943. }
  2944. },err => {
  2945. this.$message({
  2946. message: err,
  2947. type: 'error'
  2948. })
  2949. })
  2950. },
  2951. filterNode(value, data) {
  2952. if (!value) return true;
  2953. return data.label.indexOf(value) !== -1;
  2954. },
  2955. triggerCalculateOT(index) {
  2956. var str = this.workForm.domains[index].overtimeHours + ''
  2957. if(str.indexOf('.') != '-1') {
  2958. var s = str.split('.')[0]
  2959. var st = str.split('.')[1]
  2960. var sts = st.split('')
  2961. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2962. }
  2963. },
  2964. searchScreen(e){
  2965. if(e){
  2966. this.monthNotWorkDateS1 = []
  2967. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2968. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2969. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2970. }
  2971. }
  2972. if (this.monthNotWorkDateS1.length > 50) {
  2973. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2974. }else{
  2975. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2976. }
  2977. // if (this.monthNotWorkDateS1.length > 0) {
  2978. // setTimeout(() => {
  2979. // this.tableListenernot()
  2980. // }, 1000);
  2981. // }
  2982. }else{
  2983. this.monthWorkDataS1 = []
  2984. for (let i = 0; i < this.monthWorkData.length; i++) {
  2985. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2986. this.monthWorkDataS1.push(this.monthWorkData[i])
  2987. }
  2988. }
  2989. if (this.monthWorkDataS1.length > 50) {
  2990. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2991. }else{
  2992. this.monthWorkDataS = this.monthWorkDataS1
  2993. }
  2994. // if (this.monthWorkDataS1.length > 0) {
  2995. // setTimeout(() => {
  2996. // this.tableListener()
  2997. // }, 1000);
  2998. // }
  2999. }
  3000. },
  3001. addUpload(data) {
  3002. // var zhi = data.fileName.split('.')[0]
  3003. // var sss = zhi + '.xlsx'
  3004. // return
  3005. var filePath = '/upload/' + data.serverName;
  3006. const a = document.createElement('a'); // 创建a标签
  3007. a.setAttribute('download', data.fileName);// download属性
  3008. a.setAttribute('href', filePath);// href链接
  3009. a.click(); //自执行点击事件
  3010. a.remove();
  3011. },
  3012. restrictNumber(targetId) {
  3013. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3014. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3015. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3016. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3017. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3018. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3019. inpu.value = parseFloat(inpu.value);
  3020. }
  3021. },
  3022. //获取项目下的任务分组
  3023. getTaskGroups(domain, index) {
  3024. domain.groupId=null;
  3025. this.http.post('/task-group/listMyJoinGroup',{
  3026. projectId: domain.projectId,
  3027. isSubstitude: this.isSubstitude ? 1 : 0
  3028. },
  3029. res => {
  3030. if (res.code == "ok") {
  3031. this.workForm.domains[index].taskGroups = res.data;
  3032. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3033. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3034. // this.getGroupStages(domain, index);
  3035. // }
  3036. this.$forceUpdate();
  3037. }
  3038. },
  3039. error => {
  3040. this.$message({
  3041. message: error,
  3042. type: "error"
  3043. });
  3044. }
  3045. );
  3046. },
  3047. //下载填报工时占比报表
  3048. downloadProjectRatio() {
  3049. this.exportUserRatio = true;
  3050. // let now = new Date();
  3051. // let month = now.getMonth();//默认看上个月的
  3052. // let monthStr = month<10? ('0'+month): month;
  3053. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3054. const today = new Date();
  3055. const year = today.getFullYear();
  3056. const month = today.getMonth() + 1;
  3057. let lastMonthYear, lastMonth;
  3058. if (month === 1) {
  3059. lastMonthYear = year - 1;
  3060. lastMonth = 12;
  3061. } else {
  3062. lastMonthYear = year;
  3063. lastMonth = month - 1;
  3064. }
  3065. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3066. console.log('赋值 ==>', this.ratioYmonth)
  3067. },
  3068. confirmDownloadRatio() {
  3069. this.startRatioExporting = true;
  3070. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3071. ymonth: this.ratioYmonth
  3072. },
  3073. res => {
  3074. if (res.code == "ok") {
  3075. this.startRatioExporting = false;
  3076. var filePath = res.data;
  3077. const a = document.createElement('a'); // 创建a标签
  3078. var data = filePath.split("/");
  3079. a.setAttribute('download', data[data.length-1]);// download属性
  3080. a.setAttribute('href', filePath);// href链接
  3081. a.click(); //自执行点击事件
  3082. a.remove();
  3083. } else {
  3084. this.startRatioExporting = false;
  3085. this.$message({
  3086. message: res.msg,
  3087. type: "error"
  3088. });
  3089. }
  3090. },
  3091. error => {
  3092. this.checkinLoading = false;
  3093. this.$message({
  3094. message: error,
  3095. type: "error"
  3096. });
  3097. }
  3098. );
  3099. },
  3100. //下载带企业微信考勤数据的工时统计模板
  3101. downloadCheckInExcel() {
  3102. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3103. startDate: this.importWxParam.date[0],
  3104. endDate: this.importWxParam.date[1],
  3105. },
  3106. res => {
  3107. if (res.code == "ok") {
  3108. var filePath = res.data;
  3109. const a = document.createElement('a'); // 创建a标签
  3110. var data = filePath.split("/");
  3111. a.setAttribute('download', data[data.length-1]);// download属性
  3112. a.setAttribute('href', filePath);// href链接
  3113. a.click(); //自执行点击事件
  3114. a.remove();
  3115. } else {
  3116. this.$message({
  3117. message: res.msg,
  3118. type: "error"
  3119. });
  3120. }
  3121. },
  3122. error => {
  3123. this.checkinLoading = false;
  3124. this.$message({
  3125. message: error,
  3126. type: "error"
  3127. });
  3128. }
  3129. );
  3130. },
  3131. pre() {
  3132. if (this.active == 0) return;
  3133. this.active--;
  3134. },
  3135. next() {
  3136. this.active++;
  3137. },
  3138. triggerTotalTime(index) {
  3139. var item = this.checkinList[index];
  3140. var total = 0.0;
  3141. for (var i=0;i<this.projectColumns.length; i++) {
  3142. var key = this.projectColumns[i];
  3143. if (item[key] != null && item[key] != '') {
  3144. total += parseFloat(item[key]);
  3145. }
  3146. }
  3147. item.totalFillTime = total;
  3148. },
  3149. //提交批量代填的数据
  3150. submitBatchSubFillData() {
  3151. var data = JSON.stringify(this.checkinList);
  3152. this.http.post('/user-corpwx-time/submitProjectTime',{
  3153. json: data,
  3154. projectColumns: JSON.stringify(this.projectColumns)
  3155. },
  3156. res => {
  3157. if (res.code == "ok") {
  3158. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3159. this.importWxDialog = false;
  3160. }
  3161. },
  3162. error => {
  3163. this.checkinLoading = false;
  3164. this.$message({
  3165. message: error,
  3166. type: "error"
  3167. });
  3168. }
  3169. );
  3170. },
  3171. loadCheckInData() {
  3172. if (this.importWxParam.date == null) {
  3173. this.checkinList = [];
  3174. return;
  3175. }
  3176. this.checkinLoading = true;
  3177. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3178. startDate: this.importWxParam.date[0],
  3179. endDate: this.importWxParam.date[1],
  3180. },
  3181. res => {
  3182. if (res.code == "ok") {
  3183. this.checkinLoading = false;
  3184. this.checkinList = res.data.list;
  3185. this.projectColumns = res.data.projects;
  3186. // 自定义表格会导致表格错乱,需重新计算表格
  3187. this.$nextTick(()=>{
  3188. this.$refs.tab.doLayout()
  3189. })
  3190. }
  3191. },
  3192. error => {
  3193. this.checkinLoading = false;
  3194. this.$message({
  3195. message: error,
  3196. type: "error"
  3197. });
  3198. }
  3199. );
  3200. },
  3201. importCardTime(item) {
  3202. //首先判断文件类型
  3203. let str = item.file.name.split(".");
  3204. let format = str[str.length - 1];
  3205. if (format != "xls" && format != "xlsx") {
  3206. this.$message({
  3207. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3208. type: "error"
  3209. });
  3210. } else {
  3211. this.importingData = true;
  3212. let formData = new FormData();
  3213. formData.append("multipartFile", item.file);
  3214. formData.append("companyId", this.user.companyId);
  3215. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3216. res => {
  3217. this.$refs.uploadCardTime.clearFiles();
  3218. this.importingData = false;
  3219. if (res.code == "ok") {
  3220. //换成弹出框,以免有人等了半天回来啥也没看到
  3221. this.$message({
  3222. message: '导入考勤时长成功',
  3223. type: "success"
  3224. });
  3225. } else {
  3226. this.$message({
  3227. message: res.msg,
  3228. type: "error"
  3229. });
  3230. }
  3231. },
  3232. error => {
  3233. this.$refs.upload.clearFiles();
  3234. this.listLoading = false;
  3235. this.$message({
  3236. message: error,
  3237. type: "error"
  3238. });
  3239. });
  3240. }
  3241. },
  3242. batchImportWxData(item) {
  3243. //首先判断文件类型
  3244. let str = item.file.name.split(".");
  3245. let format = str[str.length - 1];
  3246. if (format != "xls" && format != "xlsx") {
  3247. this.$message({
  3248. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3249. type: "error"
  3250. });
  3251. } else {
  3252. this.importingData = true;
  3253. let formData = new FormData();
  3254. formData.append("file", item.file);
  3255. formData.append("companyId", this.user.companyId);
  3256. formData.append("withCheckIn", 1);
  3257. this.http.uploadFile('/report/importData', formData,
  3258. res => {
  3259. this.$refs.upload.clearFiles();
  3260. this.showImportResult = true;
  3261. this.importingData = false;
  3262. if (res.code == "ok") {
  3263. //换成弹出框,以免有人等了半天回来啥也没看到
  3264. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3265. this.getReportList();
  3266. this.importWxDialog = false;
  3267. } else {
  3268. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3269. }
  3270. },
  3271. error => {
  3272. this.$refs.upload.clearFiles();
  3273. this.listLoading = false;
  3274. this.$message({
  3275. message: error,
  3276. type: "error"
  3277. });
  3278. });
  3279. }
  3280. },
  3281. batchImportData(item) {
  3282. //首先判断文件类型
  3283. let str = item.file.name.split(".");
  3284. let format = str[str.length - 1];
  3285. if (format != "xls" && format != "xlsx") {
  3286. this.$message({
  3287. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3288. type: "error"
  3289. });
  3290. } else {
  3291. this.importingData = true;
  3292. let formData = new FormData();
  3293. formData.append("file", item.file);
  3294. formData.append("companyId", this.user.companyId);
  3295. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3296. this.http.uploadFile(url, formData,
  3297. res => {
  3298. this.$refs.upload.clearFiles();
  3299. this.importingData = false;
  3300. this.showImportResult = true;
  3301. if (res.code == "ok") {
  3302. //换成弹出框,以免有人等了半天回来啥也没看到
  3303. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3304. this.getReportList();
  3305. this.importWXDialog = false;
  3306. } else {
  3307. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3308. }
  3309. },
  3310. error => {
  3311. this.$refs.upload.clearFiles();
  3312. this.importingData = false;
  3313. this.$message({
  3314. message: error,
  3315. type: "error"
  3316. });
  3317. });
  3318. }
  3319. },
  3320. userssHu() {
  3321. this.http.post('/time-type/getCompanyTimeSetting',{
  3322. companyId: this.user.companyId
  3323. },
  3324. res => {
  3325. if (res.code == "ok") {
  3326. this.yonghuUser = res.data
  3327. }
  3328. },
  3329. error => {
  3330. this.$message({
  3331. message: error,
  3332. type: "error"
  3333. });
  3334. }
  3335. );
  3336. },
  3337. iptBlur(i) {
  3338. if(this.isBatch == 0) {
  3339. return
  3340. }
  3341. var reqParam = {
  3342. startDate: this.workForm.createDate[0],
  3343. endDate: this.workForm.createDate[1]
  3344. };
  3345. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3346. reqParam.userId = this.workForm.userId[0];
  3347. }
  3348. this.http.post('/report/getWorkDays',reqParam,
  3349. res => {
  3350. if (res.code == "ok") {
  3351. this.jsDay = res.data
  3352. this.chuji(i)
  3353. } else {
  3354. this.$message({
  3355. message: res.msg,
  3356. type: "error"
  3357. });
  3358. }
  3359. },
  3360. error => {
  3361. this.$message({
  3362. message: error,
  3363. type: "error"
  3364. });
  3365. }
  3366. );
  3367. //明夷硬编码获取
  3368. if (this.user.company.companyName == this.mingyiName) {
  3369. this.getWorkTimeForMinYi();
  3370. }
  3371. },
  3372. getWorkTimeForMinYi(){
  3373. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3374. startDate: this.workForm.createDate[0],
  3375. endDate: this.workForm.createDate[1]
  3376. },
  3377. res => {
  3378. if (res.code == "ok") {
  3379. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3380. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3381. this.totalReportHours = this.workTimeForMinYi;
  3382. } else {
  3383. this.$message({
  3384. message: res.msg,
  3385. type: "error"
  3386. });
  3387. this.workForm.createDate = [];
  3388. }
  3389. },
  3390. error => {
  3391. this.$message({
  3392. message: error,
  3393. type: "error"
  3394. });
  3395. }
  3396. );
  3397. },
  3398. chuji(i) {
  3399. if(i == 0) {
  3400. this.seleChn(1)
  3401. } else if(i == 1) {
  3402. this.seleChn(0)
  3403. } else if(i == 2) {
  3404. if(this.workForm.domains[0].multiWorktime > 0) {
  3405. this.iptChangs()
  3406. } else {
  3407. this.iptChang()
  3408. }
  3409. } else if(i == 3) {
  3410. this.seleChn(0)
  3411. }
  3412. },
  3413. seleChn(e,domain) {
  3414. if(e == 1) {
  3415. for(var i in this.workForm.domains) {
  3416. if(this.workForm.domains[i].timeType == 0) {
  3417. this.workForm.domains[i].workingTime = 8
  3418. } else {
  3419. this.workForm.domains[i].workingTime = 4
  3420. }
  3421. }
  3422. }
  3423. var quanbu = 0
  3424. var spl = this.workForm.domains
  3425. var zhi = ''
  3426. for(var i in spl) {
  3427. var sp = +spl[i].workingTime + 0
  3428. zhi = this.jsDay * sp
  3429. quanbu = +quanbu + zhi
  3430. }
  3431. this.jsTime = quanbu
  3432. this.totalReportHours = quanbu
  3433. let worktime = this.jsTime
  3434. // 自动计算加班时长
  3435. if(this.isBatch != 0){
  3436. worktime = this.jsTime / this.jsDay
  3437. }
  3438. if(this.user.timeType.fillOvertime && domain){
  3439. let isover = false
  3440. let alltime = 0
  3441. let allover = 0 //此处alltime同上面的worktime
  3442. for(let d in spl){
  3443. if(spl[d].isOvertime){
  3444. isover = true
  3445. allover += spl[d].overtimeHours*1
  3446. }
  3447. alltime += spl[d].workingTime*1
  3448. }
  3449. if(domain.overtimeHours){
  3450. allover = allover - domain.overtimeHours
  3451. }
  3452. if(worktime*1 > this.user.timeType.allday){
  3453. if(isover){
  3454. if(alltime > (allover + this.user.timeType.allday)){
  3455. this.$set(domain,'isOvertime',true)
  3456. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3457. }else{
  3458. this.$set(domain,'isOvertime',false)
  3459. this.$set(domain,'overtimeHours',null)
  3460. if(alltime < (allover + this.user.timeType.allday)){
  3461. let overtime = allover + this.user.timeType.allday - alltime
  3462. for(let pi in spl){
  3463. if(spl[pi].overtimeHours){
  3464. if((overtime - spl[pi].overtimeHours*1) > 0){
  3465. overtime = overtime - spl[pi].overtimeHours*1
  3466. this.$set(spl[pi],'isOvertime',false)
  3467. this.$set(spl[pi],'overtimeHours',null)
  3468. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3469. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3470. break
  3471. }else{
  3472. this.$set(spl[pi],'isOvertime',false)
  3473. this.$set(spl[pi],'overtimeHours',null)
  3474. break
  3475. }
  3476. }
  3477. }
  3478. }
  3479. }
  3480. }else{
  3481. this.$set(domain,'isOvertime',true)
  3482. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3483. }
  3484. }else{
  3485. for(let di in spl){
  3486. this.$set(spl[di],'isOvertime',false)
  3487. this.$set(spl[di],'overtimeHours',null)
  3488. }
  3489. }
  3490. }
  3491. },
  3492. iptChang() {
  3493. var sl = this.workForm.domains
  3494. let timeArr = []
  3495. for(var i in sl) {
  3496. if(sl[i].startTime && sl[i].endTime) {
  3497. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3498. }
  3499. }
  3500. this.getTimeHours(timeArr)
  3501. // for(let j in arrNum) {
  3502. // this.timeJsonStr += arrNum[j]
  3503. // if(flg) {
  3504. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3505. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3506. // }
  3507. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3508. // flg = true
  3509. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3510. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3511. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3512. // }
  3513. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3514. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3515. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3516. // }
  3517. // }
  3518. },
  3519. iptChangs() {
  3520. var sl = this.workForm.domains
  3521. let timeArr = []
  3522. for(var i in sl) {
  3523. for(var j in sl[i].worktimeList){
  3524. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3525. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3526. }
  3527. }
  3528. }
  3529. this.getTimeHours(timeArr)
  3530. },
  3531. // 调用接口或去数据
  3532. getTimeHours(arr) {
  3533. this.http.post('/report/getHoursByTimeRange',{
  3534. timeJsonStr: JSON.stringify(arr)
  3535. },res => {
  3536. if(res.code === 'ok') {
  3537. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3538. } else {
  3539. this.$message({
  3540. message: res.msg,
  3541. type: 'error'
  3542. })
  3543. }
  3544. },err => {
  3545. this.$message({
  3546. message: err,
  3547. type: 'error'
  3548. })
  3549. })
  3550. },
  3551. // 按周填报调用接口计算时间
  3552. async getWeekHoursByTimeRange(timeRange) {
  3553. const url = '/report/getHoursByTimeRange';
  3554. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3555. var that = this;
  3556. return new Promise((resolve, reject) => {
  3557. this.http.post(url, data, function(res) {
  3558. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3559. }, function(err) {
  3560. reject(err);
  3561. });
  3562. });
  3563. },
  3564. removeTimeItem(item, index) {
  3565. item.worktimeList.splice(index, 1);
  3566. this.iptChangs()
  3567. },
  3568. //添加工时
  3569. addNewWorktime(index, item) {
  3570. if(item.worktimeList == null ) {
  3571. item.worktimeList = []
  3572. }
  3573. item.worktimeList.push({});
  3574. },
  3575. //复制项目
  3576. copyProject(index) {
  3577. var leftProgress = 10;
  3578. if (this.reportTimeType.type == 3) {
  3579. //计算已经待分配工时比例
  3580. let array = this.workForm.domains;
  3581. let totalProgress = 0;
  3582. for (var i=0;i<array.length; i++) {
  3583. totalProgress += array[i].progress;
  3584. }
  3585. if (totalProgress < 100) {
  3586. leftProgress = 100 - totalProgress;
  3587. }
  3588. }
  3589. var newIndex = index+1;
  3590. var itemDomain = {
  3591. projectId: this.workForm.domains[index].projectId,
  3592. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3593. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3594. ),
  3595. content: "",
  3596. progress:leftProgress,
  3597. state:2,//2-表示待提交
  3598. };
  3599. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3600. if (this.reportTimeType.type == 0) {
  3601. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3602. var length = this.workForm.domains.length;
  3603. if (length == 2) {
  3604. this.showAddMore = false;
  3605. }
  3606. }
  3607. this.selectProject(itemDomain, newIndex);
  3608. },
  3609. pushWorkTime(reportId){
  3610. let url=''
  3611. if(this.user.timeType.syncSap == 1){
  3612. url='/report/pushProjectReportToSap'
  3613. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3614. var pushDate = this.date + day;
  3615. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3616. confirmButtonText: '确定',
  3617. cancelButtonText: '取消',
  3618. type: 'info'
  3619. }).then(() => {
  3620. const loading = this.$loading({
  3621. lock: true,
  3622. text: '正在推送中,请耐心等待。',
  3623. spinner: 'el-icon-loading',
  3624. background: 'rgba(0, 0, 0, 0.7)'
  3625. });
  3626. this.http.post(url,{
  3627. pushDate: pushDate,
  3628. reportId: reportId
  3629. },res => {
  3630. loading.close();
  3631. if(res.code == 'ok'){
  3632. this.$message({
  3633. type: 'success',
  3634. message: res.data
  3635. });
  3636. }else{
  3637. this.$message({
  3638. type: 'error',
  3639. message: res.msg
  3640. })
  3641. }
  3642. },err => {
  3643. loading.close();
  3644. this.$message({
  3645. type: 'error',
  3646. message: err
  3647. })
  3648. })
  3649. }).catch(() => {
  3650. });
  3651. }else{
  3652. url='/report/pushReportDataToThird'
  3653. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3654. confirmButtonText: '确定',
  3655. cancelButtonText: '取消',
  3656. type: 'info'
  3657. }).then(() => {
  3658. const loading = this.$loading({
  3659. lock: true,
  3660. text: '正在推送中,请耐心等待。',
  3661. spinner: 'el-icon-loading',
  3662. background: 'rgba(0, 0, 0, 0.7)'
  3663. });
  3664. this.http.post(url,{
  3665. yearMonth: this.date
  3666. },res => {
  3667. loading.close();
  3668. if(res.code == 'ok'){
  3669. this.$message({
  3670. type: 'success',
  3671. message: '推送成功!'
  3672. });
  3673. }else{
  3674. this.$message({
  3675. type: 'error',
  3676. message: res.msg
  3677. })
  3678. }
  3679. },err => {
  3680. loading.close();
  3681. this.$message({
  3682. type: 'error',
  3683. message: err
  3684. })
  3685. })
  3686. }).catch(() => {
  3687. });
  3688. }
  3689. },
  3690. showWorkTime(){
  3691. this.monthWorkTimeDialog = true;
  3692. this.searchKeyword = ''
  3693. this.WorktimeDatepickValue = this.istoMonth()
  3694. if(this.WorktimeDatepickValue.length == 0){
  3695. let newdate = new Date();
  3696. let nowdate = newdate.toLocaleDateString();
  3697. let getauto = this.getAutoWeekDate(nowdate)
  3698. let nowwd = [getauto[0],getauto[6]]
  3699. this.WorktimeDatepickValue = nowwd
  3700. }
  3701. this.showMonthWorkTime()
  3702. },
  3703. handleClick(t,e){
  3704. if (t.name == "second") {
  3705. this.showMonthNotWorkTime()
  3706. }else if(t.name == "first"){
  3707. this.showMonthWorkTime()
  3708. }else if(t.name == "third"){
  3709. this.showMonthWorkTimeReminder()
  3710. }
  3711. },
  3712. //导出员工每日填报工时数
  3713. exportMembWorkHours() {
  3714. this.http.post(
  3715. "/report/exportUserDailyWorkTime",
  3716. {
  3717. // month: this.date,
  3718. startDate: this.WorktimeDatepickValue[0],
  3719. endDate: this.WorktimeDatepickValue[1],
  3720. },
  3721. (res) => {
  3722. if (res.code == "ok") {
  3723. let url = res.data;
  3724. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3725. }
  3726. },
  3727. (error) => {
  3728. this.$message({
  3729. message: error,
  3730. type: "error",
  3731. });
  3732. }
  3733. );
  3734. },
  3735. exportMembWorkHoursReminder() {
  3736. this.http.post(
  3737. "/report/exportUserDailyWorkTimeReminder",
  3738. {
  3739. // month: this.date,
  3740. startDate: this.WorktimeDatepickValue[0],
  3741. endDate: this.WorktimeDatepickValue[1],
  3742. },
  3743. (res) => {
  3744. if (res.code == "ok") {
  3745. let url = res.data;
  3746. this.downloadByA('工时异常表.xlsx', url);
  3747. }
  3748. },
  3749. (error) => {
  3750. this.$message({
  3751. message: error,
  3752. type: "error",
  3753. });
  3754. }
  3755. );
  3756. },
  3757. exportMembNotWorkHours() {
  3758. this.http.post(
  3759. "/report/exportNoReportUserList",
  3760. {
  3761. // month: this.date,
  3762. startDate: this.WorktimeDatepickValue[0],
  3763. endDate: this.WorktimeDatepickValue[1],
  3764. },
  3765. (res) => {
  3766. if (res.code == "ok") {
  3767. let url = res.data;
  3768. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3769. }
  3770. },
  3771. (error) => {
  3772. this.$message({
  3773. message: error,
  3774. type: "error",
  3775. });
  3776. }
  3777. );
  3778. },
  3779. downloadByA(name, url) {
  3780. const a = document.createElement("a"); // 创建a标签
  3781. a.setAttribute("download", name); // download属性
  3782. a.setAttribute("href", url); // href链接
  3783. a.click(); // 自执行点击事件
  3784. a.remove();
  3785. },
  3786. // 是否本月判断
  3787. istoMonth(){
  3788. let todate = new Date()
  3789. let tomonth = todate.getMonth() + 1
  3790. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3791. if(this.date == adate){
  3792. return []
  3793. }else{
  3794. let sedate = new Date(this.date)
  3795. let semonth = sedate.getMonth() + 1
  3796. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3797. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3798. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3799. return [sedates1, sedates2]
  3800. }
  3801. },
  3802. showMonthWorkTime() {
  3803. this.monthTotalPage = 0,
  3804. this.tbload = true
  3805. let parameter={
  3806. startDate: this.WorktimeDatepickValue[0],
  3807. endDate: this.WorktimeDatepickValue[1],
  3808. }
  3809. this.http.post(
  3810. "/report/getUserDailyWorkTime",
  3811. // "/report/getNoReportUserList",
  3812. parameter,
  3813. (res) => {
  3814. if (res.code == "ok") {
  3815. this.tbload = false;
  3816. this.pickDateArray = res.data.days;
  3817. // console.log('dataarray',res.data.days);
  3818. this.monthWorkData = res.data.list;
  3819. // this.monthWorkDataS = this.monthWorkData
  3820. // this.monthWorkDataS1 = res.data.list
  3821. this.monthTotal = res.data.list.length
  3822. if (this.monthWorkData.length > 50) {
  3823. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3824. }else{
  3825. this.monthWorkDataS = this.monthWorkData
  3826. }
  3827. this.searchScreen(0)
  3828. // this.monthWorkDataS = infoList
  3829. // 判断
  3830. // if (this.monthWorkDataS1.length > 0) {
  3831. // setTimeout(() => {
  3832. // this.tableListener()
  3833. // }, 1000);
  3834. // }
  3835. this.$nextTick(function(){
  3836. this.$refs.hasworkTbl.doLayout();
  3837. });
  3838. // this.$forceUpdate()
  3839. }
  3840. },
  3841. (error) => {
  3842. this.tbload = false
  3843. this.$message({
  3844. message: error,
  3845. type: "error",
  3846. });
  3847. }
  3848. );
  3849. },
  3850. showMonthWorkTimeReminder() {
  3851. this.monthTotalPage = 0,
  3852. this.tbload = true
  3853. let parameter={}
  3854. parameter={
  3855. startDate: this.WorktimeDatepickValue[0],
  3856. endDate: this.WorktimeDatepickValue[1],
  3857. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3858. viewValue:this.isReminder?1:0
  3859. }
  3860. this.http.post(
  3861. "/report/getUserDailyWorkTimeReminder",
  3862. parameter,
  3863. (res) => {
  3864. if (res.code == "ok") {
  3865. this.tbload = false;
  3866. this.monthWorkData = res.data.list;
  3867. this.monthTotal = res.data.list.length
  3868. if (this.monthWorkData.length > 50) {
  3869. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3870. }else{
  3871. this.monthWorkDataS = this.monthWorkData
  3872. }
  3873. this.searchScreen(0)
  3874. this.$nextTick(function(){
  3875. this.$refs.hasworkTbl.doLayout();
  3876. });
  3877. }
  3878. },
  3879. (error) => {
  3880. this.tbload = false
  3881. this.$message({
  3882. message: error,
  3883. type: "error",
  3884. });
  3885. }
  3886. );
  3887. },
  3888. // tableListener(){
  3889. // let that = this;
  3890. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3891. // // 添加scroll监听事件
  3892. // dom.addEventListener("scroll", function () {
  3893. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3894. // if (scrollDistance < 2) {
  3895. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3896. // that.monthTotalPage++; //当前页数自增
  3897. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3898. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3899. // var infoList = arrList.splice(
  3900. // that.monthTotalPage * that.monthTotalLages,
  3901. // that.monthTotalLages
  3902. // );
  3903. // // 数据添加
  3904. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3905. // }
  3906. // }
  3907. // })
  3908. // },
  3909. showMonthNotWorkTime() {
  3910. this.monthTotalPage = 0,
  3911. this.tbload = true,
  3912. this.http.post(
  3913. "/report/getNoReportUserList",
  3914. {
  3915. startDate: this.WorktimeDatepickValue[0],
  3916. endDate: this.WorktimeDatepickValue[1],
  3917. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3918. },
  3919. (res) => {
  3920. if (res.code == "ok") {
  3921. this.tbload = false
  3922. this.monthNotWorkDate = res.data;
  3923. // this.monthNotWorkDateS1 = res.data
  3924. this.monthnotTotal = res.data.length
  3925. // 2222111
  3926. if (this.monthNotWorkDate.length > 50) {
  3927. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3928. } else {
  3929. this.monthNotWorkDateS = this.monthNotWorkDate
  3930. }
  3931. this.searchScreen(1)
  3932. // 判断
  3933. // if (this.monthnotworkDateS1.length > 0) {
  3934. // setTimeout(() => {
  3935. // this.tableListenernot()
  3936. // }, 1000);
  3937. // }
  3938. this.$nextTick(function(){
  3939. this.$refs.hasworkTbl2.doLayout();
  3940. });
  3941. }
  3942. },
  3943. (error) => {
  3944. this.tbload = false
  3945. this.$message({
  3946. message: error,
  3947. type: "error",
  3948. });
  3949. }
  3950. );
  3951. },
  3952. // tableListenernot(){
  3953. // let that = this;
  3954. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3955. // dom.addEventListener("scroll", function () {
  3956. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3957. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3958. // if (scrollDistance2 < 2) {
  3959. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3960. // that.monthnotTotalPage++; //当前页数自增
  3961. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3962. // var infoList = arrList.splice(
  3963. // that.monthnotTotalPage * that.monthnotTotalLages,
  3964. // that.monthnotTotalLages
  3965. // );
  3966. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3967. // }
  3968. // }
  3969. // })
  3970. // },
  3971. listScroll(){
  3972. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3973. this.isMore = true
  3974. setTimeout(()=>{
  3975. this.isMore = false
  3976. },1000)
  3977. }else {
  3978. this.isFlag = true
  3979. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3980. this.monthWorkDataS = datalist
  3981. setTimeout(()=>{
  3982. this.isFlag = false
  3983. },300)
  3984. }
  3985. },
  3986. notListScroll(){
  3987. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3988. this.isMore = true
  3989. setTimeout(()=>{
  3990. this.isMore = false
  3991. },1000)
  3992. }else {
  3993. this.isFlag = true
  3994. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3995. this.monthNotWorkDateS = datalist
  3996. // console.log('length',this.monthNotWorkDateS.length)
  3997. setTimeout(()=>{
  3998. this.isFlag = false
  3999. },300)
  4000. }
  4001. },
  4002. getFirstAndLastDay() {
  4003. // 将选定的月份转换为Date对象
  4004. var monthDate = new Date();
  4005. var year = monthDate.getFullYear();
  4006. var month = monthDate.getMonth();
  4007. // 计算起始日和结束日
  4008. var startDay = new Date(year, month, 1);
  4009. var endDay = new Date(year, month + 1, 0);
  4010. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4011. this.WorktimeDatepickValueForMonth=lastmd
  4012. },
  4013. formatDate(date) {
  4014. var year = date.getFullYear();
  4015. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4016. var day = ("0" + date.getDate()).slice(-2);
  4017. return year + "-" + month + "-" + day;
  4018. },
  4019. // 获取默认这zhou日期参数 222
  4020. getLastWeek(e){
  4021. let newdate = new Date()
  4022. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4023. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4024. if(e==1){
  4025. this.WorktimeDatepickValue = lastwd
  4026. this.showMonthWorkTime()
  4027. }else if(e==2){
  4028. this.WorktimeDatepickValue = lastwd
  4029. this.showMonthWorkTimeReminder()
  4030. }else{
  4031. this.WorktimeDatepickValue = lastwd
  4032. this.showMonthNotWorkTime()
  4033. }
  4034. },
  4035. getThisWeek(e){
  4036. let newdate = new Date();
  4037. let nowdate = newdate.toLocaleDateString();
  4038. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4039. if(e==1){
  4040. this.WorktimeDatepickValue = nowwd
  4041. this.showMonthWorkTime()
  4042. }else if(e==2){
  4043. this.WorktimeDatepickValue = nowwd
  4044. this.showMonthWorkTimeReminder()
  4045. }else{
  4046. this.WorktimeDatepickValue = nowwd
  4047. this.showMonthNotWorkTime()
  4048. }
  4049. },
  4050. getDoubleLastWeek(e){
  4051. let newdate = new Date()
  4052. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4053. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4054. if(e==1){
  4055. this.WorktimeDatepickValue = nextwd
  4056. this.showMonthWorkTime()
  4057. }else if(e==2){
  4058. this.WorktimeDatepickValue = nextwd
  4059. this.showMonthWorkTimeReminder()
  4060. }else{
  4061. this.WorktimeDatepickValue = nextwd
  4062. this.showMonthNotWorkTime()
  4063. }
  4064. },
  4065. alreadyAllDate(stime,etime){
  4066. let diffdate = new Array();
  4067. let i=0;
  4068. while(stime<=etime){
  4069. let dateArray = stime.split("-");
  4070. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4071. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4072. let stimewk = this.weekDay[date.getDay()]
  4073. 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')
  4074. 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])
  4075. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4076. let stime_ts = new Date(stime).getTime();
  4077. let next_date = stime_ts + (24*60*60*1000);
  4078. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4079. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4080. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4081. stime = next_dates_y+next_dates_m+next_dates_d;
  4082. i++;
  4083. }
  4084. return diffdate
  4085. },
  4086. getAutoWeekDate(e) {
  4087. let dateString = e;
  4088. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4089. if (dateString.match(dateStringReg)) {
  4090. let presentDate = new Date(dateString),
  4091. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4092. return Array.from(new Array(7), function (val, index) {
  4093. let formatDate = new Date(
  4094. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4095. );
  4096. return (
  4097. formatDate.getFullYear() +
  4098. "-" +
  4099. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4100. "-" +
  4101. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4102. );
  4103. });
  4104. } else {
  4105. throw new Error(
  4106. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4107. );
  4108. }
  4109. },
  4110. onProgressChange() {
  4111. this.$forceUpdate();
  4112. },
  4113. showChooseMembTree() {
  4114. this.chosenMembCount = this.participator.length;
  4115. this.chooseParticipVisible = true;
  4116. },
  4117. onTreeItemChange() {
  4118. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4119. var list = chosenList.filter(item=>item.isUser == 1);
  4120. this.chosenMembCount = list.length;
  4121. },
  4122. findUserInTree() {
  4123. if (this.filterName == '') {
  4124. this.deptMembData = this.allMembData;
  4125. } else {
  4126. var list = this.findRecursively(this.filterName, this.allMembData);
  4127. this.deptMembData = list;
  4128. }
  4129. },
  4130. findRecursively(username, list) {
  4131. var filterList = [];
  4132. for (var i=0;i<list.length; i++) {
  4133. if (list[i].isUser == 1) {
  4134. if (list[i].label.indexOf(username) >= 0) {
  4135. //匹配上了
  4136. filterList.push(list[i]);
  4137. }
  4138. } else if (list[i].children != null && list[i].children.length > 0) {
  4139. var subList = this.findRecursively(username, list[i].children);
  4140. if (subList.length > 0) {
  4141. subList.forEach(s=>filterList.push(s));
  4142. }
  4143. }
  4144. }
  4145. return filterList;
  4146. },
  4147. //确定选择参与人
  4148. chooseParticip() {
  4149. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4150. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4151. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4152. if (this.user.company.packageProject == 1) {
  4153. if (this.chosenMembList.length > 1) {
  4154. this.$message({
  4155. message: '每次仅支持代填一个人',
  4156. type: "error",
  4157. });
  4158. return;
  4159. }
  4160. }
  4161. this.chooseParticipVisible = false;
  4162. this.workForm.userNames = '';
  4163. this.workForm.userId = [];
  4164. this.participator = [];
  4165. for (var i=0;i<this.chosenMembList.length; i++) {
  4166. this.workForm.userId.push(this.chosenMembList[i].id);
  4167. this.workForm.userNames += this.chosenMembList[i].label+',';
  4168. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4169. this.participator.push(item);
  4170. }
  4171. if (this.workForm.userNames.length > 0) {
  4172. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4173. }
  4174. if(this.user.userNameNeedTranslate == 1) {
  4175. if(this.workForm.userNames) {
  4176. this.workForm.userNames = this.workForm.userNames.split(',')
  4177. }
  4178. }
  4179. },
  4180. notifySel(sel){
  4181. // console.log(sel);
  4182. this.notifySelList = sel
  4183. },
  4184. //微信通知人员填写
  4185. Notify(code) {
  4186. if (this.notifySelList.length == 0) return;
  4187. var ids = '';
  4188. this.notifySelList.forEach(f=>{
  4189. ids += f.id+',';
  4190. })
  4191. this.http.post('/user/pushFillReport',{
  4192. ids: ids, date: this.curDate,
  4193. code: code
  4194. },
  4195. res => {
  4196. if (res.code == "ok") {
  4197. this.$message({
  4198. message: this.$t('message.sentSuccessfully'),
  4199. type: "success"
  4200. });
  4201. }
  4202. },
  4203. error => {
  4204. this.$message({
  4205. message: error,
  4206. type: "error"
  4207. });
  4208. }
  4209. );
  4210. },
  4211. //导出人员列表
  4212. exportMemb() {
  4213. if (this.fillMembList.length == 0) return;
  4214. var ids = '';
  4215. this.fillMembList.forEach(f=>{
  4216. ids += f.id+',';
  4217. })
  4218. this.http.post('/user/exportMembList',{
  4219. ids: ids,isFill: this.isFill, date: this.curDate
  4220. },
  4221. res => {
  4222. if (res.code == "ok") {
  4223. var aTag = document.createElement('a');
  4224. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4225. aTag.href = res.data;
  4226. aTag.click();
  4227. }
  4228. },
  4229. error => {
  4230. this.$message({
  4231. message: error,
  4232. type: "error"
  4233. });
  4234. }
  4235. );
  4236. },
  4237. showMembList(fill) {
  4238. this.membListVisible = true;
  4239. if (fill == 0) {
  4240. this.fillMembList = this.unFillList;
  4241. this.isFill = false;
  4242. let leaveList = []
  4243. let unleaveList = []
  4244. for(let i in this.fillMembList){
  4245. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4246. leaveList.push(this.fillMembList[i])
  4247. }else{
  4248. unleaveList.push(this.fillMembList[i])
  4249. }
  4250. }
  4251. this.fillMembList = unleaveList
  4252. this.fillMembList_leave = leaveList
  4253. } else if(fill == 1){
  4254. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4255. this.isFill = true;
  4256. }else{
  4257. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4258. this.isFill = true;
  4259. }
  4260. },
  4261. //获取自己填写的日报状态
  4262. getReportFillStatus() {
  4263. this.http.post('/report/getReportFillStatus',{
  4264. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4265. },
  4266. res => {
  4267. if (res.code == "ok") {
  4268. this.fillStatusList = res.data;
  4269. this.allDate.forEach(d=>{
  4270. var fillInfo = null;
  4271. d.state = null;
  4272. this.fillStatusList.forEach(s=>{
  4273. var d1 = s.createDate.split('-')[2];
  4274. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4275. if (d1.indexOf('0') == 0) {
  4276. d1 = d1.substring(1,d1.length);
  4277. }
  4278. if (d1 == d2) {
  4279. d.state = s.state;
  4280. d.exceedCardTime = s.exceedCardTime
  4281. }
  4282. })
  4283. })
  4284. this.$forceUpdate();
  4285. }
  4286. },
  4287. error => {
  4288. this.$message({
  4289. message: error,
  4290. type: "error"
  4291. });
  4292. }
  4293. );
  4294. },
  4295. scrollFunction () {
  4296. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4297. if (this.domObj.attachEvent) { // IE
  4298. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4299. } else if (this.domObj.addEventListener) {
  4300. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4301. }
  4302. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4303. },
  4304. mouseScroll(event) { // google 浏览器下
  4305. let detail = event.wheelDelta || event.detail
  4306. let moveForwardStep = -1
  4307. let moveBackStep = 1
  4308. let step = 0
  4309. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4310. event.preventDefault() // 阻止浏览器默认事件
  4311. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4312. },
  4313. // //左右滚动
  4314. // wheel(e){
  4315. // var a = document.getElementById("dateScroll");
  4316. // var scroll_width = 80; //滚动一下的距离
  4317. // var e = e || window.event, v;
  4318. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4319. // if(v>3||-v>3) v=-v;
  4320. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4321. // e.preventDefault(); //阻止浏览器的默认滚动
  4322. // },
  4323. showExportDialog() {
  4324. this.exportType = 0
  4325. this.exportDialog = true;
  4326. },
  4327. showExportTimeDialog() {
  4328. this.exportTimeDialog = true;
  4329. },
  4330. changeAllTime() {
  4331. //总时长发生改变,自动按比例计算
  4332. this.workForm.domains.forEach(d=>{
  4333. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4334. });
  4335. //计算jsTime
  4336. if (this.workForm.createDate) {
  4337. let sdate = new Date(this.workForm.createDate[0]);
  4338. let edate = new Date(this.workForm.createDate[1]);
  4339. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4340. console.log('days===', days)
  4341. if (days < 0) {
  4342. days = 0;
  4343. }
  4344. this.jsTime = this.reportTimeType.allday * days;
  4345. }
  4346. },
  4347. // 是否加班的单机事件
  4348. check() {
  4349. this.selected = !this.selected
  4350. this.isNew = this.selected
  4351. },
  4352. updateSubProject() {
  4353. this.$forceUpdate();
  4354. },
  4355. selectDegreeId(domain, index) {
  4356. this.http.post('/report/defaultDegree',{
  4357. projectId: domain.projectId
  4358. },
  4359. res => {
  4360. if (res.code == "ok") {
  4361. if(res.data) {
  4362. this.workForm.domains[index].degreeId = res.data.id + ''
  4363. this.$forceUpdate();
  4364. }
  4365. }
  4366. },
  4367. error => {
  4368. this.$message({
  4369. message: error,
  4370. type: "error"
  4371. });
  4372. }
  4373. );
  4374. },
  4375. //项目选中了, 加载子项目
  4376. selectProject(domain, index) {
  4377. if(!domain.projectId){
  4378. return;
  4379. }
  4380. // 默认选中上次填写的自定义维度
  4381. if(this.yonghuUser.customDegreeActive == 1) {
  4382. this.selectDegreeId(domain, index)
  4383. }
  4384. // console.log('projectId===',domain.projectId);
  4385. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4386. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4387. this.http.post('/sub-project/list',{
  4388. projectId: domain.projectId,
  4389. isReport: true
  4390. },
  4391. res => {
  4392. //清空之前选中的子项目
  4393. // this.workForm.domains[index].subProjectId = 0;
  4394. if (res.code == "ok") {
  4395. this.workForm.domains[index].subProjectList = res.data;
  4396. this.workForm.domains[index].subProjectId = null;
  4397. this.$forceUpdate();
  4398. }
  4399. },
  4400. error => {
  4401. this.$message({
  4402. message: error,
  4403. type: "error"
  4404. });
  4405. }
  4406. );
  4407. //项目相关的近期任务
  4408. if (this.user.company.packageProject == 1) {
  4409. this.getRecentTaskList(domain, index);
  4410. //获取项目相关专业
  4411. if (this.user.company.packageEngineering == 1) {
  4412. this.getProjectProfessions(domain, index);
  4413. }
  4414. //获取项目下的任务分组
  4415. this.getTaskGroups(domain, index);
  4416. }
  4417. // 获取项目相关的维度
  4418. // domain.degreeId = null
  4419. this.$set(domain,'degreeId',null)
  4420. this.$set(domain,'multiDegrIdArray',null)
  4421. this.dimension(domain, index);
  4422. //获取项目审核人
  4423. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4424. this.getProjectAuditorList(domain, index);
  4425. } else {
  4426. //按分组的负责人来审核
  4427. domain.projectAuditorId = null;
  4428. domain.projectAuditorName = null;
  4429. domain.auditUserList = null;
  4430. }
  4431. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4432. if (this.reportTimeType.type == 3) {
  4433. //新增项目时,自动计算
  4434. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4435. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4436. }
  4437. //加载昱众的工作职责
  4438. if (this.user.companyId == this.yuzhongCompId) {
  4439. this.updateResponse(domain);
  4440. }
  4441. },
  4442. getRecentTaskList(domain, index) {
  4443. //刷新任务时,清空服务
  4444. this.$set(domain, 'sapServiceId', null);
  4445. this.$set(domain, 'taskId', null);
  4446. var param = {
  4447. projectId: domain.projectId,
  4448. isSubstitude:this.isSubstitude?1:0,
  4449. };
  4450. if (domain.groupId) {
  4451. param.groupId = domain.groupId;
  4452. }
  4453. if (domain.stage) {
  4454. param.stage = domain.stage;
  4455. }
  4456. //专业版代填,获取代填员工的任务
  4457. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4458. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4459. this.$message({
  4460. message: '请选择代填的员工',
  4461. type: "error"
  4462. });
  4463. return;
  4464. } else {
  4465. param.userId = this.workForm.userId[0];
  4466. }
  4467. }
  4468. this.http.post('/task/getRecentTask',param,
  4469. res => {
  4470. if (res.code == "ok") {
  4471. this.workForm.domains[index].allTaskList = res.data;
  4472. this.workForm.domains[index].taskList = res.data;
  4473. this.$forceUpdate();
  4474. }
  4475. },
  4476. error => {
  4477. this.$message({
  4478. message: error,
  4479. type: "error"
  4480. });
  4481. }
  4482. );
  4483. },
  4484. //获取项目审核人
  4485. getProjectAuditorList(domainItem, index) {
  4486. if(domainItem.projectId == '') {
  4487. return
  4488. }
  4489. domainItem.projectAuditorId = null;
  4490. domainItem.projectAuditorName = null;
  4491. this.http.post('/project-auditor/getList',{
  4492. projectId: domainItem.projectId,
  4493. },
  4494. res => {
  4495. if (res.code == "ok") {
  4496. domainItem.auditUserList = res.data;
  4497. if (res.data.length==0) {
  4498. this.$message({
  4499. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4500. type: "error"
  4501. });
  4502. } else if (res.data.length==1) {
  4503. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4504. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4505. }
  4506. this.$forceUpdate();
  4507. }
  4508. },
  4509. error => {
  4510. this.$message({
  4511. message: error,
  4512. type: "error"
  4513. });
  4514. }
  4515. );
  4516. },
  4517. // 获取维度数据
  4518. dimension(domain, index) {
  4519. if(domain.projectId == '') {
  4520. return
  4521. }
  4522. this.http.post('/project/getDegreeList',{
  4523. projectId: domain.projectId,
  4524. },
  4525. res => {
  4526. if (res.code == "ok") {
  4527. // console.log("维度数据",res.data);
  4528. this.workForm.domains[index].wuduList = res.data
  4529. // this.workForm = this.workForm
  4530. this.$forceUpdate()
  4531. }
  4532. },
  4533. error => {
  4534. this.$message({
  4535. message: error,
  4536. type: "error"
  4537. });
  4538. }
  4539. );
  4540. },
  4541. //切换任务阶段
  4542. changeStages(domain, index) {
  4543. if (domain.stage == null || domain.stage == '') {
  4544. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4545. } else {
  4546. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4547. }
  4548. this.getRecentTaskList(domain, index);
  4549. this.$forceUpdate();
  4550. },
  4551. getGroupStages(domain, index, keepStage) {
  4552. // console.log(domain);
  4553. if(!domain.groupId){
  4554. domain.projectAuditorId = ''
  4555. domain.stages = []
  4556. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4557. domain.taskId = ''
  4558. domain.sapServiceId = ''
  4559. }
  4560. if(this.user.timeType.reportAuditType >= 1){
  4561. domain.auditUserList = []
  4562. }
  4563. this.$forceUpdate();
  4564. return
  4565. }
  4566. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4567. res => {
  4568. if (res.code == "ok") {
  4569. if (!keepStage) {
  4570. domain.stage = '';
  4571. }
  4572. domain.stages = res.data;
  4573. this.getRecentTaskList(domain, index);
  4574. this.$forceUpdate();
  4575. }
  4576. },
  4577. error => {
  4578. this.$message({
  4579. message: error,
  4580. type: "error"
  4581. });
  4582. });
  4583. //检查当前的项目是否需要获取分组的负责人
  4584. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4585. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4586. res => {
  4587. if (res.code == "ok") {
  4588. domain.getProjectAuditorList = res.data;
  4589. domain.auditUserList = res.data;
  4590. if (res.data.length==1) {
  4591. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4592. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4593. } else if (res.data.length==0) {
  4594. domain.projectAuditorId = null;
  4595. domain.projectAuditorName = null;
  4596. }
  4597. this.$forceUpdate();
  4598. }
  4599. },
  4600. error => {
  4601. this.$message({
  4602. message: error,
  4603. type: "error"
  4604. });
  4605. });
  4606. }
  4607. },
  4608. getProjectProfessions(domain, index) {
  4609. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4610. res => {
  4611. if (res.code == "ok") {
  4612. this.workForm.domains[index].professionProgress = res.data;
  4613. this.$forceUpdate();
  4614. }
  4615. },
  4616. error => {
  4617. this.$message({
  4618. message: error,
  4619. type: "error"
  4620. });
  4621. });
  4622. },
  4623. //删除自己的日报
  4624. deleteReport() {
  4625. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4626. confirmButtonText: this.$t('btn.determine'),
  4627. cancelButtonText: this.$t('btn.cancel'),
  4628. type: "warning"
  4629. })
  4630. .then(() => {
  4631. this.listLoading = true;
  4632. this.http.post('/report/delete',{
  4633. userId: this.user.id,
  4634. date: this.workForm.createDate
  4635. },
  4636. res => {
  4637. this.listLoading = false;
  4638. if (res.code == "ok") {
  4639. this.$message({
  4640. message: this.$t('message.successfullyDeleted'),
  4641. type: "success"
  4642. });
  4643. this.getReportList();
  4644. this.getDepartment();
  4645. this.dialogVisible = false;
  4646. } else {
  4647. this.$message({
  4648. message: res.msg,
  4649. type: "error"
  4650. });
  4651. }
  4652. },
  4653. error => {
  4654. this.listLoading = false;
  4655. this.$message({
  4656. message: error,
  4657. type: "error"
  4658. });
  4659. }
  4660. );
  4661. })
  4662. .catch(() => {});
  4663. },
  4664. // 管理员删除日报
  4665. guanli(item) {
  4666. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4667. let param = {date: this.date + day, userId: item.id};
  4668. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4669. confirmButtonText: this.$t('btn.determine'),
  4670. cancelButtonText: this.$t('btn.cancel'),
  4671. type: "warning"
  4672. })
  4673. .then(() => {
  4674. this.listLoading = true;
  4675. this.http.post('/report/delete',param,
  4676. res => {
  4677. this.listLoading = false;
  4678. if (res.code == "ok") {
  4679. this.$message({
  4680. message: this.$t('message.successfullyDeleted'),
  4681. type: "success"
  4682. });
  4683. this.getReportList();
  4684. this.getDepartment();
  4685. this.dialogVisible = false;
  4686. } else {
  4687. this.$message({
  4688. message: res.msg,
  4689. type: "error"
  4690. });
  4691. }
  4692. },
  4693. error => {
  4694. this.listLoading = false;
  4695. this.$message({
  4696. message: error,
  4697. type: "error"
  4698. });
  4699. }
  4700. );
  4701. })
  4702. .catch(() => {});
  4703. },
  4704. selectAll() {
  4705. if (this.isAllSelect) {
  4706. var keys = [];
  4707. this.reportNames.forEach(b=>{
  4708. keys.push(b.id);
  4709. })
  4710. this.$refs.approveTree.setCheckedKeys(keys);
  4711. } else {
  4712. this.$refs.approveTree.setCheckedKeys([]);
  4713. }
  4714. },
  4715. removeEmptyNode(list) {
  4716. for (var i=0;i<list.length;i++) {
  4717. var cnt = 0;
  4718. if (list[i].membCount == 0) {
  4719. list.splice(i, 1);
  4720. i--;
  4721. } else if (list[i].children != null) {
  4722. this.removeEmptyNode(list[i].children);
  4723. }
  4724. }
  4725. },
  4726. calculateMembCount(list) {
  4727. for (var i in list) {
  4728. var cnt = 0;
  4729. if (list[i].children != null) {
  4730. this.calculateMembCount(list[i].children);
  4731. for (var m in list[i].children) {
  4732. cnt += list[i].children[m].membCount;
  4733. }
  4734. }
  4735. if (list[i].isUser == 1) {
  4736. cnt++;
  4737. this.membCount++;
  4738. }
  4739. list[i].membCount = cnt;
  4740. }
  4741. },
  4742. stateChange() {
  4743. // console.log(this.allData,'alldate');
  4744. this.membCount = 0;
  4745. if (this.selectState == -1) {
  4746. //全部状态
  4747. this.data = this.allData;
  4748. } else {
  4749. //未填报
  4750. this.seluserText = ''
  4751. var newData = JSON.parse(JSON.stringify(this.allData));
  4752. this.filterState(this.selectState, newData);
  4753. this.data = newData;
  4754. }
  4755. this.calculateMembCount(this.data);
  4756. this.data[0].membCount = this.membCount;//总人数
  4757. },
  4758. //按状态过滤部门人员
  4759. filterState(state, list) {
  4760. for (var i =0;i<list.length; i++) {
  4761. var obj = list[i];
  4762. if (obj.isUser == 1) {
  4763. var match = false;
  4764. if (state == -2) {
  4765. if (obj.state == null) {
  4766. match = true;
  4767. }
  4768. } else {
  4769. if (obj.state == state) {
  4770. match = true;
  4771. }
  4772. }
  4773. if (!match) {
  4774. list.splice(i, 1);
  4775. i--;
  4776. } else {
  4777. }
  4778. } else {
  4779. if (obj.children != null) {
  4780. this.filterState(state, obj.children);
  4781. }
  4782. }
  4783. }
  4784. },
  4785. //a按名称过滤部门人员
  4786. async seluserforText(){
  4787. const { userNameNeedTranslate } = this.user
  4788. this.membCount = 0;
  4789. var newData = JSON.parse(JSON.stringify(this.allData));
  4790. let textList = [this.seluserText]
  4791. if(userNameNeedTranslate == 1) {
  4792. this.dataLoading = true
  4793. let res = await this.postData('/user/getEmployeeList', {
  4794. keyword: this.seluserText,
  4795. cursor: '',
  4796. departmentId: -1,
  4797. pageIndex: 1,
  4798. pageSize: 1000
  4799. })
  4800. textList = res.data.records.map(item => item.name)
  4801. this.dataLoading = false
  4802. }
  4803. // return
  4804. console.log(textList, '<=== textList')
  4805. this.seluserforTextin(this.seluserText, newData, textList)
  4806. console.log(newData, 'Data')
  4807. this.data = newData;
  4808. this.calculateMembCount(this.data);
  4809. this.data[0].membCount = this.membCount;//总人数
  4810. },
  4811. seluserforTextin(text, list, textList = []){
  4812. for (var i =0;i<list.length; i++) {
  4813. var obj = list[i];
  4814. if (obj.isUser == 1) {
  4815. var match = false;
  4816. // if (obj.label.indexOf(text) != -1) {
  4817. // match = true
  4818. // }
  4819. if(textList.some(item => item.includes(obj.label))) {
  4820. match = true
  4821. }
  4822. if (!match) {
  4823. list.splice(i, 1);
  4824. i--;
  4825. } else {
  4826. }
  4827. } else {
  4828. if (obj.children != null) {
  4829. this.seluserforTextin(text, obj.children, textList);
  4830. }
  4831. }
  4832. }
  4833. },
  4834. // 当节点发生变化时
  4835. nodeChangeExpand(data) {
  4836. // 保存当前展开的节点
  4837. let flag = false
  4838. this.nodeModelData.some(item => {
  4839. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4840. flag = true
  4841. return true
  4842. }
  4843. })
  4844. if (!flag) { // 不存在则存到数组里
  4845. this.nodeModelData.push(data.id)
  4846. }
  4847. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4848. },
  4849. nodeChangeCollapse(data) {
  4850. console.log(this.nodeModelData)
  4851. this.nodeModelData.some((item, i) => {
  4852. if (item === data.id) {
  4853. this.nodeModelData.length = i
  4854. }
  4855. })
  4856. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4857. },
  4858. // 部门列表点击
  4859. handleNodeClick(data) {
  4860. // this.dealList = data
  4861. this.theValues(data.id, this.allData)
  4862. // this.depData = data;
  4863. var list = [];
  4864. if (data.id == -1) {
  4865. this.deptId = null;
  4866. this.targetUid = null;
  4867. list = this.data;
  4868. } else if (data.isUser == 1) {
  4869. this.deptId = null;
  4870. this.targetUid = data.id;
  4871. } else {
  4872. this.deptId = data.id;
  4873. this.targetUid = null;
  4874. list.push(data);
  4875. }
  4876. this.getReportList();
  4877. if (list.length > 0) {
  4878. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4879. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4880. }
  4881. },
  4882. exportPushLog(){
  4883. this.http.post('/sap-sync-log/export',{},
  4884. res => {
  4885. if (res.code == "ok") {
  4886. var filePath = res.data;
  4887. var fName = '推送日志.xlsx'
  4888. const a = document.createElement('a'); // 创建a标签
  4889. a.setAttribute('download', fName);// download属性
  4890. a.setAttribute('href', filePath);// href链接
  4891. a.click(); //自执行点击事件
  4892. a.remove();
  4893. } else {
  4894. this.$message({
  4895. message: res.msg,
  4896. type: "error"
  4897. });
  4898. }
  4899. },
  4900. error => {
  4901. this.$message({
  4902. message: error,
  4903. type: "error"
  4904. });
  4905. });
  4906. },
  4907. theValues(id, item) {
  4908. for(var i in item) {
  4909. if(item[i].id == id) {
  4910. this.depData = item[i]
  4911. if(id == '-1') {
  4912. this.translation = '1'
  4913. } else {
  4914. if(item[i].children) {
  4915. this.translation = '2'
  4916. } else {
  4917. this.translation = '3'
  4918. }
  4919. }
  4920. return
  4921. } else {
  4922. if(item[i].children) {
  4923. this.theValues(id, item[i].children)
  4924. }
  4925. }
  4926. }
  4927. },
  4928. //获取可以选择的代填的人员列表
  4929. getSubstitudeUserDeptList() {
  4930. if (this.deptMembData.length == 0) {
  4931. this.http.post("/department/listMyMembs", {},
  4932. res => {
  4933. if (res.code == "ok") {
  4934. let noAllData = JSON.parse(JSON.stringify(res.data));
  4935. if (noAllData.length > 0) {
  4936. // if (noAllData[0].label == '全部人员') {
  4937. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4938. noAllData.splice(0,1);
  4939. }
  4940. }
  4941. this.setUserToDept(noAllData);
  4942. this.deptMembData = noAllData;
  4943. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4944. console.log(this.deptMembData, '代填人员数据')
  4945. } else {
  4946. this.$message({
  4947. message: res.msg,
  4948. type: "error"
  4949. });
  4950. }
  4951. },
  4952. error => {
  4953. this.$message({
  4954. message: error,
  4955. type: "error"
  4956. });
  4957. });
  4958. }
  4959. },
  4960. // 获取部门列表
  4961. getDepartmentForApprove() {
  4962. this.http.post( this.port.manage.depList, {},
  4963. res => {
  4964. if (res.code == "ok") {
  4965. var list1 = JSON.parse(JSON.stringify(res.data));
  4966. this.deptOptionList = this.changeArr(list1);
  4967. console.log(this.deptOptionList, '部门')
  4968. } else {
  4969. this.$message({
  4970. message: res.msg,
  4971. type: "error"
  4972. });
  4973. }
  4974. },
  4975. error => {
  4976. this.$message({
  4977. message: error,
  4978. type: "error"
  4979. });
  4980. });
  4981. },
  4982. // 获取部门列表
  4983. getDepartment() {
  4984. //如果没有权限,就不需要获取
  4985. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4986. return;
  4987. }
  4988. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4989. var param = {date:this.date + day};
  4990. this.http.post("/report/getMembList", param,
  4991. res => {
  4992. if (res.code == "ok") {
  4993. if(res.data.length == 0){
  4994. return
  4995. }
  4996. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4997. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4998. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4999. // if (this.user.role > 0) {
  5000. // }
  5001. list.splice(0,0,{
  5002. id: -1,
  5003. label: this.$t('lable.allStaff'),
  5004. })
  5005. this.membCount = 0;
  5006. //设置员工到部门下面
  5007. this.setUserToDept(list);
  5008. this.data = list;
  5009. // console.log('data',this.data);
  5010. this.expandDate = [this.data[1].id]
  5011. this.allData = list;
  5012. // if (noAllData.length > 0) {
  5013. // if (noAllData[0].label == '全部人员') {
  5014. // noAllData.splice(0,1);
  5015. // }
  5016. // }
  5017. // this.setUserToDept(noAllData);
  5018. // this.deptMembData = noAllData;
  5019. this.option = this.changeArr(list1);
  5020. list[0].membCount = this.membCount;
  5021. if (this.depData.id == -1) {
  5022. this.depData.membCount = this.membCount;
  5023. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5024. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5025. } else {
  5026. if (this.depData.isUser == null) {
  5027. var dep = this.findTargetDept(this.data, this.depData.id);
  5028. var membDeptList = [];
  5029. membDeptList.push(dep);
  5030. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5031. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5032. }
  5033. }
  5034. if (this.depData.isUser == null) {
  5035. if (this.isFill) {
  5036. this.fillMembList = this.fillList;
  5037. } else {
  5038. this.fillMembList = this.unFillList;
  5039. }
  5040. }
  5041. this.leaveAllNum = 0
  5042. for(let i in this.unFillList){
  5043. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5044. this.leaveAllNum += 1
  5045. }
  5046. }
  5047. this.stateChange()
  5048. } else {
  5049. this.$message({
  5050. message: res.msg,
  5051. type: "error"
  5052. });
  5053. }
  5054. },
  5055. error => {
  5056. this.$message({
  5057. message: error,
  5058. type: "error"
  5059. });
  5060. });
  5061. this.getReportFillStatus();
  5062. },
  5063. findTargetDept(list, deptId) {
  5064. var t = null;
  5065. for (var i=0;i<list.length; i++) {
  5066. if (list[i].isUser == null && list[i].id == deptId) {
  5067. t = list[i];
  5068. break;
  5069. }
  5070. }
  5071. if (t == null) {
  5072. for (var i=0;i<list.length; i++) {
  5073. if (list[i].children != null && list[i].children.length > 0) {
  5074. t = this.findTargetDept(list[i].children, deptId);
  5075. if (t != null) {
  5076. break;
  5077. }
  5078. }
  5079. }
  5080. }
  5081. return t;
  5082. },
  5083. getUserMembListFromDeptList(list, isFill) {
  5084. var membList = [];
  5085. for (var i in list) {
  5086. var deptName = list[i].label;
  5087. if (list[i].userList != null) {
  5088. list[i].userList.forEach(element => {
  5089. if (isFill == 0) {
  5090. //获取未填的
  5091. if (element.state == null) {
  5092. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5093. membList.push(obj);
  5094. }
  5095. } else {
  5096. if (element.state != null) {
  5097. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5098. membList.push(obj);
  5099. }
  5100. }
  5101. });
  5102. }
  5103. if (list[i].children != null) {
  5104. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5105. }
  5106. }
  5107. return membList;
  5108. },
  5109. setUserToDept(list) {
  5110. for (var i in list) {
  5111. var cnt = 0;
  5112. if (list[i].children != null) {
  5113. this.setUserToDept(list[i].children);
  5114. for (var m in list[i].children) {
  5115. cnt += list[i].children[m].membCount;
  5116. }
  5117. }
  5118. if (list[i].userList != null) {
  5119. if (list[i].children == null) {
  5120. list[i].children = [];
  5121. }
  5122. list[i].userList.forEach(element => {
  5123. var obj = {
  5124. id: element.id,
  5125. label:element.name,
  5126. state:element.state,
  5127. parentId:element.departmentId,
  5128. isUser:1,
  5129. workingTime: element.workingTime,
  5130. leaveDays: element.leaveDays,
  5131. leaveTimes: element.leaveTimes
  5132. };
  5133. list[i].children.push(obj);
  5134. this.membCount++;
  5135. cnt++;
  5136. });
  5137. }
  5138. list[i].membCount = cnt;
  5139. }
  5140. },
  5141. // 修改数组
  5142. changeArr(arr) {
  5143. for (var i = 0; i < arr.length; i++) {
  5144. if(arr[i].id != -1 && arr[i].id != 0) {
  5145. if (arr[i].children != null && arr[i].children.length>0) {
  5146. arr[i].children = this.changeArr(arr[i].children);
  5147. }
  5148. arr[i].id && (arr[i].value = arr[i].id);
  5149. delete arr[i].id;
  5150. }
  5151. }
  5152. for(var i in arr) {
  5153. if(arr[i].id == -1 || arr[i].id == 0) {
  5154. arr.splice(i,1)
  5155. }
  5156. }
  5157. return arr;
  5158. },
  5159. //时间段范围设置改动,监听
  5160. onTimeTypeChange(timeType) {
  5161. this.seleChn(1)
  5162. this.showAddMore = true;
  5163. for(var i in this.workForm.domains) {
  5164. if (this.workForm.domains[i].timeType == 0) {
  5165. this.showAddMore = false;
  5166. break;
  5167. }
  5168. }
  5169. if (this.showAddMore) {
  5170. //检测数量
  5171. if (this.workForm.domains.length == 2) {
  5172. this.showAddMore = false;
  5173. } else {
  5174. this.showAddMore = true;
  5175. }
  5176. }
  5177. },
  5178. getTimeType() {
  5179. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5180. res => {
  5181. if (res.code == "ok") {
  5182. var t = res.data;
  5183. this.reportTimeType = t;
  5184. if (this.reportTimeType.type > 0) {
  5185. this.showAddMore = true;
  5186. }
  5187. //转化时间格式
  5188. if (t.allday != null) {
  5189. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5190. }
  5191. if (t.am != null) {
  5192. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5193. }
  5194. if (t.pm != null) {
  5195. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5196. }
  5197. let arr = []
  5198. for(var i in res.data.excludeTimeList) {
  5199. let obj = {
  5200. s: res.data.excludeTimeList[i].startTime,
  5201. e: res.data.excludeTimeList[i].endTime,
  5202. }
  5203. arr.push(obj)
  5204. }
  5205. this.vacationTime = arr
  5206. } else {
  5207. this.$message({
  5208. message: res.msg,
  5209. type: "error"
  5210. });
  5211. }
  5212. },
  5213. error => {
  5214. this.listLoading = false;
  5215. this.$message({
  5216. message: error,
  5217. type: "error"
  5218. });
  5219. });
  5220. },
  5221. // 改变月份 -------
  5222. changeMonthOut() {
  5223. this.getAllDate();
  5224. this.getReportList();
  5225. this.getDepartment();
  5226. },
  5227. // 选择日期
  5228. choseDate(i, item) {
  5229. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5230. return
  5231. }
  5232. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5233. this.choseDay = i;
  5234. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5235. sessionStorage.msg = this.date + day,
  5236. this.getReportList();
  5237. this.getDepartment();
  5238. this.curDate = item.date;
  5239. },
  5240. canClick(i, item){
  5241. let nowDate = new Date()
  5242. let nowDateYear = nowDate.getFullYear()
  5243. let itemYear = parseInt(this.date.split('-')[0])
  5244. let nowDateMonth = nowDate.getMonth() + 1
  5245. let itemMonth = parseInt(this.date.split('-')[1])
  5246. let nowDateDay = nowDate.getDate()
  5247. let itemDay = parseInt(item.showDate.split('.')[1])
  5248. if(nowDateYear < itemYear){
  5249. return false
  5250. }else if(nowDateYear == itemYear){
  5251. if(nowDateMonth < itemMonth){
  5252. return false
  5253. }else if(nowDateMonth == itemMonth){
  5254. if(nowDateDay < itemDay){
  5255. return false
  5256. }
  5257. }
  5258. }
  5259. },
  5260. // 获取日期列表
  5261. getAllDate(e) {
  5262. var dayArry = [];
  5263. var day = this.getCountDays();
  5264. let curMonthDay = null;
  5265. for (var k = 1; k <= day; k++) {
  5266. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5267. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5268. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5269. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5270. if(sessionStorage.msg) {
  5271. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5272. this.choseDay = k - 1;
  5273. curMonthDay = str;
  5274. }
  5275. } else {
  5276. if (new Date().getDate() == k) {
  5277. this.choseDay = k - 1;
  5278. }
  5279. }
  5280. } else {
  5281. this.choseDay = 0;
  5282. }
  5283. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5284. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5285. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5286. }
  5287. this.allDate = dayArry;
  5288. //不能超过最大日期
  5289. if (this.choseDay > day-1) {
  5290. this.choseDay = day-1;
  5291. }
  5292. if(sessionStorage.from != 1){
  5293. let nowmonth = new Date().getMonth() + 1
  5294. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5295. let nowdate = new Date().getDate()
  5296. if(nowd == this.date){
  5297. if(e && sessionStorage.msg){
  5298. }else{
  5299. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5300. }
  5301. let nowday = new Date(sessionStorage.msg).getDate()
  5302. this.choseDay = nowday - 1
  5303. let monthdate = new Date(sessionStorage.msg)
  5304. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5305. }else{
  5306. if(e && sessionStorage.msg){
  5307. }else{
  5308. sessionStorage.msg = this.date + '-01'
  5309. }
  5310. let monthdate = new Date(sessionStorage.msg)
  5311. this.choseDay = monthdate.getDate() - 1
  5312. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5313. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5314. }
  5315. }else{
  5316. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5317. }
  5318. //从消息点击跳转过来的,直接加载指定日期
  5319. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5320. this.curDate = sessionStorage.msg;
  5321. sessionStorage.from = 0;
  5322. } else {
  5323. // if (curMonthDay != null) {
  5324. // // this.curDate = curMonthDay;
  5325. // let d = new Date(sessionStorage.msg)
  5326. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5327. // } else {
  5328. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5329. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5330. // }
  5331. }
  5332. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5333. // if(!sessionStorage.msg){
  5334. // let msgday = this.choseDay + 1
  5335. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5336. // }
  5337. this.getReportFillStatus();
  5338. },
  5339. getCountDays() {
  5340. var newstr = this.date.replace(/-/g, "/");
  5341. var curDate = new Date(newstr+'/01');
  5342. var curMonth = curDate.getMonth();
  5343. curDate.setMonth(curMonth + 1);
  5344. curDate.setDate(0);
  5345. return curDate.getDate();
  5346. },
  5347. reqMore() {
  5348. if (this.hasMore) {
  5349. this.pageIndex++;
  5350. this.requestHttpReports();
  5351. }
  5352. },
  5353. //加载日报数据
  5354. requestHttpReports() {
  5355. //请求数据
  5356. this.listLoading = true;
  5357. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5358. let param = {date: this.date + day};
  5359. if (this.deptId) {
  5360. param.deptId = this.deptId;
  5361. }
  5362. if (this.targetUid) {
  5363. param.userId = this.targetUid;
  5364. }
  5365. //传页码
  5366. if (this.hasMore) {
  5367. param.pageIndex = this.pageIndex;
  5368. }
  5369. this.http.post( this.port.report.list, param,
  5370. res => {
  5371. this.listLoading = false;
  5372. if (res.code == "ok") {
  5373. //扩增
  5374. this.reportList = this.reportList.concat(res.data.data);
  5375. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5376. if(document.querySelector("#day"+this.choseDay)){
  5377. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5378. }
  5379. } else {
  5380. this.$message({
  5381. message: res.msg,
  5382. type: "error"
  5383. });
  5384. }
  5385. },
  5386. error => {
  5387. this.listLoading = false;
  5388. this.$message({
  5389. message: error,
  5390. type: "error"
  5391. });
  5392. });
  5393. },
  5394. //获取日报列表
  5395. getReportList() {
  5396. //初始化,重置数据
  5397. this.pageIndex = 0;
  5398. this.hasMore = true;
  5399. this.reportList = [];
  5400. this.requestHttpReports();
  5401. },
  5402. //刷新日报状态,用于审核后更新
  5403. refreshReportData(reportId) {
  5404. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5405. res => {
  5406. if (res.code == "ok") {
  5407. for (var m=0;m<this.reportList.length; m++) {
  5408. var d = this.reportList[m].data;
  5409. var find = d.filter(r=>r.id == reportId);
  5410. if (find.length > 0) {
  5411. find[0].state = res.data.state;
  5412. if (find[0].state == 2) {//被驳回,要可以编辑
  5413. this.reportList[m].state = 2;
  5414. }
  5415. find[0].isDeptAudit = res.data.isDeptAudit;
  5416. find[0].departmentAuditState = res.data.departmentAuditState;
  5417. find[0].projectAuditorName = res.data.projectAuditorName;
  5418. find[0].projectAuditorId = res.data.projectAuditorId;
  5419. find[0].projectAuditState = res.data.projectAuditState;
  5420. find[0].rejectUserid = res.data.rejectUserid;
  5421. find[0].rejectUsername = res.data.rejectUsername;
  5422. find[0].rejectReason = res.data.rejectReason;
  5423. this.$forceUpdate();
  5424. break;
  5425. }
  5426. }
  5427. } else {
  5428. this.$message({
  5429. message: res.msg,
  5430. type: "error"
  5431. });
  5432. }
  5433. },
  5434. error => {
  5435. this.listLoading = false;
  5436. this.$message({
  5437. message: error,
  5438. type: "error"
  5439. });
  5440. });
  5441. },
  5442. //导出员工工时统计
  5443. exportUserTime() {
  5444. this.listLoading = true;
  5445. var param = {};
  5446. if (this.exportParam.dateRange != null) {
  5447. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5448. }
  5449. this.http.post('/department/exportDeptStatistic', param,
  5450. res => {
  5451. this.listLoading = false;
  5452. if (res.code == "ok") {
  5453. location.href = res.data;
  5454. this.exportTimeDialog = false;
  5455. } else {
  5456. this.$message({
  5457. message: res.msg,
  5458. type: "error"
  5459. });
  5460. }
  5461. },
  5462. error => {
  5463. this.listLoading = false;
  5464. this.$message({
  5465. message: error,
  5466. type: "error"
  5467. });
  5468. });
  5469. },
  5470. //导出日报
  5471. exportReport() {
  5472. this.exportingData = true;
  5473. var param = {};
  5474. if (this.exportParam.dateRange != null) {
  5475. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5476. }
  5477. if (this.exportParam.projectId != null) {
  5478. param.projectId = this.exportParam.projectId;
  5479. }
  5480. if (this.exportParam.departmentId != null) {
  5481. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5482. }
  5483. param.stateKey = this.stateKey
  5484. // param.departmentId = this.user.departmentId
  5485. console.log(param, '《=== 导出传的参数');
  5486. console.log('开始调用exportReport接口');
  5487. this.http.post(this.port.report.export, param,
  5488. res => {
  5489. this.exportingData = false;
  5490. if (res.code == "ok") {
  5491. location.href = res.data;
  5492. this.exportDialog = false;
  5493. } else {
  5494. this.$message({
  5495. message: res.msg,
  5496. type: "error"
  5497. });
  5498. }
  5499. },
  5500. error => {
  5501. this.exportingData = false;
  5502. this.$message({
  5503. message: error,
  5504. type: "error"
  5505. });
  5506. });
  5507. },
  5508. //获取项目列表
  5509. getProjectList() {
  5510. this.listLoading = true;
  5511. this.http.post( this.port.project.list, {},
  5512. res => {
  5513. this.listLoading = false;
  5514. if (res.code == "ok") {
  5515. for(var i in res.data) {
  5516. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5517. res.data[i].projectCode = ''
  5518. }
  5519. }
  5520. this.projectList = res.data;
  5521. console.log("项目列表",this.projectList);
  5522. } else {
  5523. this.$message({
  5524. message: res.msg,
  5525. type: "error"
  5526. });
  5527. }
  5528. },
  5529. error => {
  5530. this.listLoading = false;
  5531. this.$message({
  5532. message: error,
  5533. type: "error"
  5534. });
  5535. });
  5536. },
  5537. // 获取填报日报的项目下拉列表
  5538. getFillProjectList() {
  5539. this.http.post( this.port.project.list, {
  5540. forReport: 1
  5541. },res => {
  5542. if (res.code == "ok") {
  5543. for(var i in res.data) {
  5544. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5545. res.data[i].projectCode = ''
  5546. }
  5547. }
  5548. this.fillProjectList = res.data;
  5549. this.getRecentlyProject()
  5550. } else {
  5551. this.$message({
  5552. message: res.msg,
  5553. type: "error"
  5554. });
  5555. }
  5556. },
  5557. error => {
  5558. this.$message({
  5559. message: error,
  5560. type: "error"
  5561. });
  5562. });
  5563. },
  5564. getBasecostItemList() {
  5565. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5566. companyId: this.user.companyId
  5567. },
  5568. res => {
  5569. if (res.code == "ok") {
  5570. this.timeBasecostList = res.data;
  5571. }
  5572. });
  5573. },
  5574. getAIReport(createDate) {
  5575. this.http.post('/report/getAIReport', {},
  5576. res => {
  5577. if (res.code == "ok") {
  5578. var quanbu = 0
  5579. this.jsDay = 1
  5580. var zhi = ''
  5581. var slp = res.data
  5582. for(var i in slp) {
  5583. var sp = +slp[i].workingTime + 0
  5584. zhi = this.jsDay * sp
  5585. quanbu = +quanbu + zhi
  5586. }
  5587. this.jsTime = quanbu
  5588. var aiReportData = res.data;
  5589. this.canCancelInDialog = false
  5590. if(aiReportData.length != 0) {
  5591. var arr = [];
  5592. for(var i in aiReportData) {
  5593. arr.push({
  5594. id: null,
  5595. projectId: aiReportData[i].projectId,
  5596. workingTime: aiReportData[i].workingTime,
  5597. content: '',
  5598. progress:100,
  5599. state: 2,
  5600. timeType: aiReportData[i].timeType,
  5601. subProjectList: aiReportData[i].subProjectList,
  5602. taskList: aiReportData[i].taskList,
  5603. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5604. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5605. taskId: aiReportData[i].taskId,
  5606. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5607. startTime: aiReportData[i].startTime,
  5608. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5609. endTime: aiReportData[i].endTime,
  5610. isOvertime: 0,
  5611. progress:aiReportData[i].progress,
  5612. professionProgress: aiReportData[i].professionProgressList,
  5613. stages:aiReportData[i].stages,
  5614. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5615. pics: null,
  5616. multiWorktime: aiReportData[i].multiWorktime,
  5617. worktimeList: [{}],
  5618. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5619. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5620. wuduList: aiReportData[i].degreeList,
  5621. taskGroups:aiReportData[i].taskGroups,
  5622. customData: aiReportData[i].customData,//自定义的数值
  5623. auditUserList: aiReportData[i].auditUserList,
  5624. projectAuditorId: aiReportData[i].projectAuditorId,
  5625. projectAuditorName: aiReportData[i].projectAuditorName,
  5626. overtimeHours: aiReportData[i].overtimeHours,
  5627. customText: aiReportData[i].customText,
  5628. basecostId: aiReportData[i].basecostId,
  5629. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5630. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5631. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5632. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5633. canEdit: true
  5634. })
  5635. }
  5636. this.workForm.domains = arr;
  5637. } else {
  5638. }
  5639. this.canEdit = true;
  5640. this.originCanEdit = true;
  5641. this.seleChn()
  5642. } else {
  5643. this.$message({
  5644. message: res.msg,
  5645. type: "error"
  5646. });
  5647. }
  5648. },
  5649. error => {
  5650. this.$message({
  5651. message: error,
  5652. type: "error"
  5653. });
  5654. });
  5655. },
  5656. // 获取个人某天的日报 111111
  5657. getReport() {
  5658. this.http.post( this.port.report.getPort, {
  5659. date: this.workForm.createDate
  5660. },
  5661. res => {
  5662. if (res.code == "ok") {
  5663. var quanbu = 0
  5664. this.jsDay = 1
  5665. var zhi = ''
  5666. var slp = res.data.report
  5667. for(var i in slp) {
  5668. var sp = +slp[i].workingTime + 0
  5669. zhi = this.jsDay * sp
  5670. quanbu = +quanbu + zhi
  5671. }
  5672. this.jsTime = quanbu
  5673. var list = res.data;
  5674. this.report = list;
  5675. this.reportTimeType = this.report.timeType;
  5676. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5677. this.isWeekend = !this.report.isWorkDay;
  5678. this.canCancelInDialog = false;
  5679. this.hasWrittenReport = list.report.length != 0;
  5680. if(list.report.length != 0) {
  5681. var arr = [];
  5682. this.canEdit = false;
  5683. let candelete = true
  5684. for(var i in list.report) {
  5685. var flg = null
  5686. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5687. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5688. var filteredRespList = null
  5689. if (targetP.length > 0) {
  5690. var isPublic = targetP[0].isPublic;
  5691. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5692. }
  5693. arr.push({
  5694. id: list.report[i].id,
  5695. projectId: list.report[i].projectId,
  5696. workingTime: list.report[i].workingTime,
  5697. content: list.report[i].content,
  5698. state: list.report[i].state,
  5699. timeType: list.report[i].timeType,
  5700. subProjectList: list.report[i].subProjectList,
  5701. taskList: list.report[i].taskList,
  5702. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5703. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5704. taskId: list.report[i].taskId,
  5705. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5706. startTime: list.report[i].startTime,
  5707. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5708. endTime: list.report[i].endTime,
  5709. isOvertime: flg,
  5710. progress:list.report[i].progress,
  5711. professionProgress: list.report[i].professionProgressList,
  5712. stages:list.report[i].stages,
  5713. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5714. pics: list.report[i].pics,
  5715. multiWorktime: list.report[i].multiWorktime,
  5716. worktimeList: list.report[i].worktimeList,
  5717. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5718. multiDegrIdArray: list.report[i].multiDegrIdList,
  5719. wuduList: list.report[i].degreeList,
  5720. taskGroups:list.report[i].taskGroups,
  5721. customData: list.report[i].customData,//自定义的数值
  5722. auditUserList: list.report[i].auditUserList,
  5723. projectAuditorId: list.report[i].projectAuditorId,
  5724. projectAuditorName: list.report[i].projectAuditorName,
  5725. overtimeHours: list.report[i].overtimeHours,
  5726. customText: list.report[i].customText,
  5727. basecostId: list.report[i].basecostId,
  5728. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5729. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5730. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5731. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5732. canEdit: list.report[i].state >= 2 ? true : false,
  5733. extraField1: list.report[i].extraField1,
  5734. extraField2: list.report[i].extraField2,
  5735. extraField3: list.report[i].extraField3,
  5736. workContentList: list.report[i].workContentList,
  5737. filteredRespList: filteredRespList,
  5738. serviceList: list.report[i].serviceList,
  5739. sapServiceId: list.report[i].sapServiceId,
  5740. reportTargetDeptId: list.report[i].deptId
  5741. })
  5742. if (list.report[i].state >= 2) {
  5743. this.canEdit = true;
  5744. }
  5745. if(list.report[i].state < 2){
  5746. candelete = false
  5747. }
  5748. if (list.report[i].state == 0){
  5749. this.canCancelInDialog = true
  5750. }
  5751. // 加判断
  5752. if(this.user.timeType.choseFromAlbum == 1) {
  5753. let arrList = []
  5754. for(var k in list.report[i].pics) {
  5755. let obj = {
  5756. name: k,
  5757. url: list.report[i].pics[k]
  5758. }
  5759. arrList.push(obj)
  5760. }
  5761. arr[i].imgListUrl = arrList
  5762. arr[i].imgList = list.report[i].pics
  5763. }
  5764. }
  5765. this.reportCanDelete = candelete
  5766. this.workForm = {
  5767. createDate: this.workForm.createDate,
  5768. domains: arr,
  5769. userNames:null,
  5770. userId:null,
  5771. time: list.time,
  5772. showRefresh: list.showRefresh
  5773. }
  5774. console.log('workForm', this.workForm)
  5775. } else {
  5776. this.workForm = {
  5777. createDate: this.workForm.createDate,
  5778. domains: [{
  5779. id: null,
  5780. projectId: "",
  5781. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5782. content: "",
  5783. progress:100,
  5784. state: 2,
  5785. timeType:0,
  5786. multiWorktime: this.reportTimeType.multiWorktime,
  5787. worktimeList:[{}],
  5788. canEdit: true,
  5789. auditorFirst: '',
  5790. auditorSec: '',
  5791. auditorThird: '',
  5792. ccUserid: ''
  5793. }],
  5794. userId:null,
  5795. userNames:null,
  5796. time: this.report.time,
  5797. showRefresh: list.showRefresh
  5798. }
  5799. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5800. this.$set(this.workForm.domains[0],'isOvertime',true)
  5801. if(this.reportTimeType.type != 2){
  5802. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5803. }
  5804. }
  5805. if(this.user.timeType.type == 1) {
  5806. var shuzhi = this.user.timeType.allday + ''
  5807. // console.log('执行一次', shuzhi.indexOf('.'))
  5808. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5809. }
  5810. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5811. //默认给第一个,必填字段
  5812. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5813. }
  5814. this.canEdit = true;
  5815. }
  5816. this.originCanEdit = this.canEdit;
  5817. this.seleChn()
  5818. } else {
  5819. this.$message({
  5820. message: res.msg,
  5821. type: "error"
  5822. });
  5823. }
  5824. },
  5825. error => {
  5826. this.$message({
  5827. message: error,
  5828. type: "error"
  5829. });
  5830. });
  5831. },
  5832. guanbi() {
  5833. this.falsss = false,
  5834. this.workTimeForMinYi=0
  5835. },
  5836. // 打开日报填写
  5837. fillInReport(i, isBatch) {
  5838. this.isWeekend = false
  5839. this.reportCanDelete = false
  5840. // console.log(this.user.timeType.type, '选择时长')
  5841. if(i != 1) {
  5842. this.falsss = false
  5843. } else {
  5844. this.falsss = true
  5845. }
  5846. if (this.isSubstitude) {
  5847. this.getSubstitudeUserDeptList();
  5848. }
  5849. if(i == -1 || this.isSubstitude) {
  5850. this.isDisable = false;
  5851. } else {
  5852. this.isDisable = true;
  5853. }
  5854. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5855. this.isBatch = isBatch;
  5856. if (this.isBatch == 0 && !this.isSubstitude) {
  5857. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5858. let weekday = new Date(this.workForm.createDate).getDay()
  5859. if(this.user.companyId == 817){
  5860. if(weekday == 0){
  5861. this.isWeekend = true
  5862. }
  5863. }else{
  5864. if(weekday == 0 || weekday == 6){
  5865. this.isWeekend = true
  5866. }
  5867. }
  5868. this.getReport(i);
  5869. } else {
  5870. // console.log('执行到了这里')
  5871. this.jsTime = 0
  5872. this.jsDay = 0
  5873. this.workForm = {
  5874. createDate: null,//批量填报没有日期
  5875. domains: [{
  5876. id: null,
  5877. projectId: "",
  5878. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5879. content: "",
  5880. progress:100,
  5881. state: 2,
  5882. timeType:0,
  5883. multiWorktime: this.reportTimeType.multiWorktime,
  5884. worktimeList:[{}],
  5885. canEdit: true,
  5886. }],
  5887. }
  5888. if(this.user.timeType.type == 1) {
  5889. var shuzhi = this.user.timeType.allday + ''
  5890. // console.log('执行二次')
  5891. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5892. }
  5893. // console.log(this.workForm)
  5894. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5895. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5896. }
  5897. this.canEdit = true;
  5898. }
  5899. this.dialogVisible = true;
  5900. },
  5901. //按周填报的弹窗口中编辑单项目相关数据
  5902. setWeekFormReportItem(reportId, i, names, row,sss) {
  5903. console.log(sss)
  5904. this.http.post('/report/getReportById', {
  5905. reportId: reportId
  5906. },
  5907. res => {
  5908. if (res.code == "ok") {
  5909. var data = res.data.report;
  5910. sss.subProjectId = data.subProjectId
  5911. sss.subProjectList = data.subProjectList;
  5912. sss.stage = data.stage
  5913. sss.subProjectList = data.subProjectList
  5914. sss.stages = data.stages
  5915. sss.taskGroups = data.taskGroups;
  5916. sss.auditUserList = data.auditUserList;
  5917. sss.degreeId = data.degreeId;
  5918. sss.customData = data.customData;
  5919. sss.wuduList = data.degreeList;
  5920. this.zhoBaoIdx = i
  5921. this.zhoBaoName = names
  5922. this.zhoBao = sss
  5923. this.zhis = row
  5924. if (sss.groupId) {
  5925. //最后一个参数表示是否保留stage的值,不要重置为空
  5926. this.getGroupStages(this.zhoBao, 0, true)
  5927. }
  5928. this.$forceUpdate();
  5929. }
  5930. });
  5931. },
  5932. // 按周填报里内容的填写
  5933. tianxies(item, i, names, row) {
  5934. if (item.state == 0) {
  5935. this.$message({
  5936. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5937. type: "error"
  5938. });
  5939. return;
  5940. }
  5941. if (item.state == 1) {
  5942. this.$message({
  5943. message: '已通过状态不可修改',
  5944. type: "error"
  5945. });
  5946. return;
  5947. }
  5948. if(this.user.timeType.notAllowedNoAttendance == 1){
  5949. if(this.zhoData[i].corpTime){
  5950. if(this.zhoData[i].corpTime.workHours == 0){
  5951. this.$message({
  5952. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5953. type: 'error'
  5954. })
  5955. return
  5956. }
  5957. }else{
  5958. this.$message({
  5959. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5960. type: 'error'
  5961. })
  5962. return
  5963. }
  5964. }
  5965. var idd = ''
  5966. var obj = {}
  5967. for(var l in this.projectList) {
  5968. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5969. }
  5970. obj.projectId = idd
  5971. this.tianxieDialogVisible = true
  5972. this.scopess = item
  5973. console.log(item, '《==== 当前的对象')
  5974. var sss = {}
  5975. if (item.id != null) {
  5976. sss.id = item.id;
  5977. sss.state = item.state;
  5978. } else {
  5979. sss.id = -1;
  5980. sss.state = 3;
  5981. }
  5982. sss.projectId = idd;
  5983. sss.progress = item.progress
  5984. sss.time = item.time
  5985. sss.content = item.content;
  5986. console.log('333', sss.content)
  5987. if (sss.time == '' && this.reportTimeType.type == 2) {
  5988. //取已填时间范围中最大的一个作为开始时间
  5989. var startTime = '09:00';
  5990. var fillStartTime = '00:00';
  5991. for (var t in this.selProjectList) {
  5992. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5993. if (fillItem.time) {
  5994. if (fillItem.time[1] > fillStartTime) {
  5995. fillStartTime = fillItem.time[1];
  5996. }
  5997. }
  5998. }
  5999. if (fillStartTime == '00:00') {
  6000. fillStartTime = '09:00';
  6001. }
  6002. var fillEndMax = '18:00';
  6003. if (fillStartTime >= '18:00') {
  6004. fillEndMax = '23:59';
  6005. }
  6006. sss.time = [fillStartTime, fillEndMax];
  6007. }
  6008. sss.groupId = item.groupId
  6009. sss.stage = item.stage;
  6010. sss.workingTime = item.workingTime
  6011. sss.projectAuditorId = item.projectAuditorId;
  6012. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6013. //默认选中第一个
  6014. sss.basecostId = this.timeBasecostList[0].id;
  6015. }
  6016. var hasEdited = this.zhoData[i][names].hasEdited;
  6017. if (hasEdited) {
  6018. sss = { ...item }
  6019. //编辑过了
  6020. sss.subProjectId = item.subProjectId
  6021. sss.stage = item.stage
  6022. sss.subProjectList = item.subProjectList
  6023. sss.stages = item.stages
  6024. sss.taskGroups = item.taskGroups;
  6025. console.log(sss.taskGroups, '33333');
  6026. sss.auditUserList = obj.auditUserList;
  6027. sss.degreeId = item.degreeId;
  6028. sss.customData = item.customData;
  6029. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6030. //只有一个审核人,自动设置上去
  6031. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6032. }
  6033. sss.wuduList = item.wuduList;
  6034. this.zhoBaoIdx = i
  6035. this.zhoBaoName = names
  6036. this.zhoBao = sss
  6037. this.zhis = row
  6038. if (sss.groupId) {
  6039. //最后一个参数表示是否保留stage的值,不要重置为空
  6040. this.getGroupStages(this.zhoBao, 0, true)
  6041. }
  6042. this.$forceUpdate();
  6043. this.getWeeklyTaskList(sss)
  6044. console.log('最后的周报 ===>', this.zhoBao)
  6045. } else {
  6046. //第一次打开,获取数据
  6047. if (sss.id == -1) {
  6048. //新填报的
  6049. this.selectProject(obj, 0);
  6050. var that = this
  6051. setTimeout(() =>{
  6052. sss.subProjectId = that.workForm.domains[0].subProjectId
  6053. sss.subProjectList = item.subProjectList;
  6054. sss.stage = that.workForm.domains[0].stage
  6055. sss.subProjectList = that.workForm.domains[0].subProjectList
  6056. sss.stages = that.workForm.domains[0].stages
  6057. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6058. sss.auditUserList = obj.auditUserList;
  6059. sss.degreeId = item.degreeId;
  6060. sss.customData = item.customData;
  6061. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6062. //只有一个审核人,自动设置上去
  6063. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6064. }
  6065. sss.wuduList = row[0].wuduList
  6066. that.zhoBaoIdx = i
  6067. that.zhoBaoName = names
  6068. that.zhoBao = sss
  6069. that.zhis = row
  6070. if (sss.groupId) {
  6071. //最后一个参数表示是否保留stage的值,不要重置为空
  6072. this.getGroupStages(that.zhoBao, 0, false)
  6073. }
  6074. that.$forceUpdate();
  6075. this.getWeeklyTaskList(sss)
  6076. },600);
  6077. } else {
  6078. //编辑填报过的;数据库已经存在的
  6079. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6080. }
  6081. }
  6082. },
  6083. // 按周填报里内容的填写点击确定
  6084. setWeekProItemData() {
  6085. //专业版模式下,任务分组和阶段必填
  6086. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6087. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6088. this.$message({
  6089. message: '任务分组和阶段必填,请检查',
  6090. type: "error"
  6091. });
  6092. return;
  6093. }
  6094. }
  6095. // 检查任务分组
  6096. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6097. this.$message({
  6098. message: '任务分组必填,请检查',
  6099. type: "error"
  6100. });
  6101. return
  6102. }
  6103. //检查子项目是否必填
  6104. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6105. this.$message({
  6106. message: '子项目必填,请检查',
  6107. type: "error"
  6108. });
  6109. return;
  6110. }
  6111. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6112. this.$message({
  6113. message: this.$t('message.Pleaseselectareviewer'),
  6114. type: "error"
  6115. });
  6116. return
  6117. }
  6118. if(this.user.timeType.reportAuditType == 3){
  6119. let auditTips = ''
  6120. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6121. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6122. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6123. if(auditTips){
  6124. auditTips = auditTips.substring(0,auditTips.length - 1)
  6125. this.$message({
  6126. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6127. type: 'error'
  6128. })
  6129. return
  6130. }
  6131. }
  6132. let errtips = ''
  6133. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6134. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6135. errtips += this.user.timeType.customDegreeName + '、'
  6136. }
  6137. }
  6138. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6139. errtips += this.user.timeType.customDataName + '、'
  6140. }
  6141. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6142. errtips += this.user.timeType.customTextName + '、'
  6143. }
  6144. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6145. errtips += this.$t('other.workMatters') +'、'
  6146. }
  6147. if(errtips){
  6148. errtips = errtips.substring(0,errtips.length - 1)
  6149. this.$message({
  6150. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6151. type: 'error'
  6152. })
  6153. return
  6154. }
  6155. this.tianxieDialogVisible = false
  6156. var zhong = this.zhoData
  6157. this.zhoBao.hasEdited = true;
  6158. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6159. this.zhoData = zhong
  6160. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6161. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6162. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6163. },
  6164. // 获取本周
  6165. getCurrentWeek() {
  6166. //今天
  6167. this.targetWeekDate = new Date();
  6168. this.initWeekFormData();
  6169. // this.jiazai()
  6170. },
  6171. // 获取上周
  6172. handleGetPrevWeek() {
  6173. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6174. this.initWeekFormData();
  6175. // this.jiazai()
  6176. },
  6177. // 获取下周
  6178. handleGetNextvWeek() {
  6179. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6180. this.initWeekFormData()
  6181. },
  6182. // 加载动画
  6183. jiazai() {
  6184. this.weekDataLoading = true
  6185. var that = this
  6186. setTimeout(() =>{
  6187. that.weekDataLoading = false
  6188. },1000);
  6189. },
  6190. // 转时间格式
  6191. dealdate(date) {
  6192. const dt = new Date(date)
  6193. const y = dt.getFullYear()
  6194. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6195. const d = (dt.getDate() + '').padStart(2, '0')
  6196. return `${y}-${m}-${d}`
  6197. },
  6198. // 按周填报
  6199. fillInReportss() {
  6200. window.addEventListener('scroll', this.handleScroll, true)
  6201. // this.jiazai()
  6202. this.fillWeekDialogVisi = true
  6203. this.getCurrentWeek();
  6204. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6205. //重新获取工时预警类型的预算项
  6206. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6207. companyId: this.user.companyId
  6208. },
  6209. res => {
  6210. if (res.code == "ok") {
  6211. this.timeBasecostList = res.data;
  6212. }
  6213. });
  6214. }
  6215. },
  6216. fillInReportCustom() {
  6217. this.weekIndex++
  6218. this.weekParentData = {
  6219. isSubstitude: this.isSubstitude
  6220. }
  6221. this.fillWeekDialogVisiCustom = true
  6222. },
  6223. // 按周填报的项目筛选
  6224. selListFun(){
  6225. this.selProjectList = []
  6226. if(this.selCon.length){
  6227. for (let i = 0; i < this.selCon.length; i++) {
  6228. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6229. }
  6230. this.selConShow = false ;
  6231. for (let i in this.zhoData) {
  6232. var obj = this.zhoData[i];
  6233. for(var j in this.selProjectList) {
  6234. var xinzhi = this.selProjectList[j].projectName
  6235. obj[xinzhi] = {}
  6236. obj[xinzhi].time = ''
  6237. obj[xinzhi].content = ''
  6238. obj[xinzhi].progress = 0
  6239. obj[xinzhi].workingTime = 0
  6240. }
  6241. }
  6242. this.initWeekFormData();
  6243. }else{
  6244. this.$message({
  6245. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6246. type:'error'
  6247. })
  6248. }
  6249. },
  6250. setWeekCardTimeData(list) {
  6251. for(let i in list){
  6252. let datei = '';
  6253. if (this.user.timeType.showDdCardtime == 1) {
  6254. datei = list[i].workDate;
  6255. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6256. datei = list[i].createDate;
  6257. } else if (this.user.timeType.syncFanwei == 1) {
  6258. datei = list[i].workDate;
  6259. }
  6260. for(let m in this.zhoData) {
  6261. if(datei == this.zhoData[m].zhoDataTime){
  6262. let item = {
  6263. startTime: list[i].startTime,
  6264. endTime: list[i].endTime,
  6265. workHours: list[i].workHours
  6266. }
  6267. this.$set(this.zhoData[m],'corpTime',item)
  6268. }
  6269. }
  6270. }
  6271. },
  6272. getWeeklyCardTime(){ //按周填报获取考勤信息
  6273. let dateStr = []
  6274. for(let i in this.zhoData){
  6275. dateStr.push(this.zhoData[i].zhoDataTime)
  6276. }
  6277. this.http.post('/report/getWeeklyCardTime',{
  6278. dateStr: JSON.stringify(dateStr)
  6279. },res => {
  6280. if(res.code == 'ok'){
  6281. for(let i in res.data){
  6282. let datei = '';
  6283. if (this.user.timeType.showDdCardtime == 1) {
  6284. datei = res.data[i].workDate.split('-');
  6285. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6286. datei = res.data[i].createDate.split('-');
  6287. }
  6288. for(let m in this.zhoData){
  6289. let datem = new Date(this.zhoData[m].zhoDataTime)
  6290. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6291. let item = {
  6292. startTime: res.data[i].startTime,
  6293. endTime: res.data[i].endTime,
  6294. workHours: res.data[i].workHours
  6295. }
  6296. this.$set(this.zhoData[m],'corpTime',item)
  6297. }
  6298. }
  6299. }
  6300. }else{
  6301. this.$message({
  6302. message: res.msg,
  6303. type: 'error'
  6304. })
  6305. }
  6306. },err => {
  6307. this.$message({
  6308. message: err,
  6309. type: 'error'
  6310. })
  6311. })
  6312. },
  6313. selListqx(){
  6314. this.fillWeekDialogVisi = false
  6315. this.selProjectList = []
  6316. this.selCon = []
  6317. },
  6318. handleScroll() {
  6319. this.changdu = this.projectList.length + 1
  6320. },
  6321. // 自动选择时间点的事件
  6322. // async zhoTimes(item, i) {
  6323. // var iss = i
  6324. // if(item.time == null) {
  6325. // return
  6326. // } else {
  6327. // const zhi = this.zhoData[iss];
  6328. // let he = 0;
  6329. // const timeArr = Object.values(zhi)
  6330. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6331. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6332. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6333. // console.log(data, 'data');
  6334. // zhi.he = `${he}h`;
  6335. // }
  6336. // },
  6337. async zhoTimes(item, index) {
  6338. const zho = this.zhoData[index];
  6339. if (!item.time) {
  6340. return;
  6341. }
  6342. const timeArr = Object.values(zho)
  6343. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6344. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6345. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6346. zho.he = `${totalHours[0]}h`;
  6347. },
  6348. // 判断两个时间段是否重叠
  6349. timeOverlap(idx, dateAr) {
  6350. let zhi = 0
  6351. for (let k in dateAr) {
  6352. if (idx !== k) {
  6353. 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))) {
  6354. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6355. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6356. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6357. }
  6358. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6359. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6360. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6361. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6362. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6363. } else {
  6364. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6365. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6366. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6367. }
  6368. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6369. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6370. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6371. }
  6372. }
  6373. }
  6374. }
  6375. }
  6376. return zhi
  6377. },
  6378. // 计算时间
  6379. getHourMinutes(str, end) {
  6380. var he = 0
  6381. var date2 = '2021/12/12 ' + end +':00'
  6382. var date1 = '2021/12/12 ' + str +':00'
  6383. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6384. var leave1=date3%(24*3600*1000)
  6385. var hours=Math.floor(leave1/(3600*1000))
  6386. var leave2=leave1%(3600*1000)
  6387. var minutes=Math.floor(leave2/(60*1000))
  6388. var shi = hours+'.'+ minutes
  6389. return he += +shi
  6390. },
  6391. // 自动选择事件长度的事件
  6392. zhoXuan(item, i) {
  6393. var iss = i
  6394. if(item.time == null) {
  6395. return
  6396. } else {
  6397. var zhi = this.zhoData[iss]
  6398. var he = 0
  6399. for(var i in zhi) {
  6400. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6401. he += +zhi[i].workingTime
  6402. }
  6403. }
  6404. zhi.he = he + 'h'
  6405. }
  6406. },
  6407. getPushWorkLogData(){
  6408. this.http.post('/sap-sync-log/list', {},
  6409. res => {
  6410. if (res.code == "ok") {
  6411. this.pushWorkTimeLogData = res.data;
  6412. } else {
  6413. this.$message({
  6414. message: res.msg,
  6415. type: "error"
  6416. });
  6417. }
  6418. },
  6419. error => {
  6420. this.$message({
  6421. message: error,
  6422. type: "error"
  6423. });
  6424. });
  6425. },
  6426. // 获取全部人员
  6427. getUsers() {
  6428. this.http.post('/user/getSimpleActiveUserList', {},
  6429. res => {
  6430. if (res.code == "ok") {
  6431. this.usersList = res.data;
  6432. } else {
  6433. this.$message({
  6434. message: res.msg,
  6435. type: "error"
  6436. });
  6437. }
  6438. },
  6439. error => {
  6440. this.$message({
  6441. message: error,
  6442. type: "error"
  6443. });
  6444. });
  6445. },
  6446. // 按时间比例
  6447. addBli(item, i) {
  6448. var iss = i
  6449. if(item.time == null) {
  6450. return
  6451. } else {
  6452. var zhi = this.zhoData[iss]
  6453. var he = 0
  6454. for(var i in zhi) {
  6455. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6456. he += +zhi[i].workingTime
  6457. }
  6458. }
  6459. zhi.he = he.toFixed(1) + 'h'
  6460. }
  6461. },
  6462. //按周填报选择的项目发生变化,需要设置列
  6463. onSelProjectChange() {
  6464. for (let i = 0; i < this.selCon.length; i++) {
  6465. var exists = false;
  6466. for (let j = 0; j < this.selProjectList.length; j++) {
  6467. if (this.selProjectList[j].id == this.selCon[i]) {
  6468. exists = true;
  6469. break;
  6470. }
  6471. }
  6472. if (!exists) {
  6473. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6474. this.selProjectList.push(newProject);
  6475. //添加新项目
  6476. for (var w in this.zhoData) {
  6477. var dayItem = this.zhoData[w];
  6478. var pName = newProject.projectName;
  6479. dayItem[pName] = {};
  6480. dayItem[pName].time = ''
  6481. dayItem[pName].content = ''
  6482. dayItem[pName].progress = 0
  6483. dayItem[pName].workingTime = 0
  6484. }
  6485. }
  6486. }
  6487. //去掉
  6488. for (let j = 0; j < this.selProjectList.length; j++) {
  6489. var exists = false;
  6490. for (let i = 0; i < this.selCon.length; i++) {
  6491. if (this.selProjectList[j].id == this.selCon[i]) {
  6492. exists = true;
  6493. break;
  6494. }
  6495. }
  6496. if (!exists) {
  6497. this.selProjectList.splice(j, 1);
  6498. j--;
  6499. }
  6500. }
  6501. this.loadFilledWeekReportItem();
  6502. //刷新表格
  6503. // this.$refs.weekTable.doLayout();
  6504. },
  6505. //根据选中的项目来刷新填写表格
  6506. loadFilledWeekReportItem() {
  6507. for (var w in this.zhoData) {
  6508. var dayItem = this.zhoData[w];
  6509. for (var i = 0; i < this.selProjectList.length; i++) {
  6510. var curColumnProject = this.selProjectList[i];
  6511. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6512. for (var t in dayItem.reportList) {
  6513. //有日报的项目,不能取消选择
  6514. for (var p in this.fillProjectList) {
  6515. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6516. }
  6517. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6518. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6519. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6520. if (this.reportTimeType.type == 2) {
  6521. //时间段模式
  6522. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6523. }
  6524. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6525. break;
  6526. }
  6527. }
  6528. // dayItem[curColumnProject.projectName] = matchReportItem;
  6529. }
  6530. }
  6531. this.$nextTick(()=>{
  6532. this.$refs.weekTable.doLayout();
  6533. });
  6534. },
  6535. initWeekFormData() {
  6536. this.weekDataLoading = true;
  6537. for (var p in this.fillProjectList) {
  6538. this.fillProjectList[p].canCancel = 1;
  6539. }
  6540. this.http.post('/report/getWeeklyReportData',{
  6541. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6542. },res => {
  6543. this.weekDataLoading = false;
  6544. if(res.code == 'ok'){
  6545. let projectList = res.data.projectList;
  6546. if (projectList.length > 0) {
  6547. //有选择过项目进行填报,直接选中
  6548. this.selProjectList = projectList;
  6549. this.selCon = [];
  6550. for (let i = 0; i < projectList.length; i++) {
  6551. this.selCon.push(projectList[i].id);
  6552. }
  6553. }
  6554. //设置日期
  6555. this.weekDateRange = res.data.dateList;
  6556. this.zhoData = [];
  6557. var arrst = []
  6558. for(var i in this.weekDateRange) {
  6559. var obj = {}
  6560. obj.zhoDataTime = this.weekDateRange[i].date
  6561. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6562. obj.he = this.weekDateRange[i].filledTime;
  6563. obj.canFill = this.weekDateRange[i].canFill;
  6564. // obj.filledTime = this.weekDateRange[i].filledTime;
  6565. obj.reportList = this.weekDateRange[i].reportList;
  6566. //初始化,防止渲染报错
  6567. for (var j = 0; j < this.selProjectList.length; j++) {
  6568. var pName = this.selProjectList[j].projectName
  6569. obj[pName] = {}
  6570. obj[pName].time = ''
  6571. obj[pName].content = ''
  6572. obj[pName].progress = 0
  6573. obj[pName].workingTime = 0
  6574. }
  6575. arrst.push(obj)
  6576. }
  6577. this.zhoData = arrst
  6578. this.setWeekCardTimeData(res.data.cardTimeList);
  6579. this.loadFilledWeekReportItem();
  6580. }else{
  6581. this.$message({
  6582. message: res.msg,
  6583. type: 'error'
  6584. })
  6585. }
  6586. },err => {
  6587. this.$message({
  6588. message: err,
  6589. type: 'error'
  6590. })
  6591. })
  6592. },
  6593. zhoZhi(res, i) {
  6594. var zhi = 0
  6595. for(var i in res) {
  6596. if(i != 'zhoDataTime' && i != 'he') {
  6597. zhi += +res[i]
  6598. }
  6599. }
  6600. res.he = zhi
  6601. },
  6602. zhoBtn(i) {
  6603. // this.zhoData.split(i, 1)
  6604. var arr = this.zhoData
  6605. arr.splice(i, 1)
  6606. },
  6607. zhoAddlast(){
  6608. this.selConShow = true
  6609. },
  6610. closeAddWeeklyReport(){
  6611. this.fillWeekDialogVisi = false
  6612. this.selConShow = true
  6613. this.selProjectList = []
  6614. this.selCon = []
  6615. },
  6616. checkDateWorkTime() {
  6617. //针对苏州景昱,单独的检查逻辑
  6618. if (this.user.companyId == 5978) {
  6619. //调接口,先检查工时是否存在异常
  6620. var zhi = this.zhoData;
  6621. var array = [];
  6622. for(let n in zhi){
  6623. if(zhi[n].he){
  6624. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6625. array.push(workData)
  6626. }
  6627. }
  6628. this.submitingReport = true;
  6629. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6630. res => {
  6631. this.submitingReport = false;
  6632. if (res.code == "ok") {
  6633. this.submitWeekReport(0)
  6634. } else {
  6635. this.$confirm(res.msg, '提示', {
  6636. confirmButtonText: '忽略并提交',
  6637. cancelButtonText: '取消',
  6638. type: 'error'
  6639. }).then(() => {
  6640. this.submitWeekReport(0)
  6641. }).catch(() => {
  6642. });
  6643. }
  6644. },
  6645. error => {
  6646. this.$message({
  6647. message: error,
  6648. type: "error"
  6649. });
  6650. });
  6651. }
  6652. },
  6653. // 提交按周填报
  6654. submitWeekReport(isDraft) {
  6655. var zhi = this.zhoData
  6656. var ll = 0
  6657. if(this.reportTimeType.type == 2) {
  6658. for(var i in zhi) {
  6659. this.dateAr = []
  6660. var alp = []
  6661. var zhis = zhi[i]
  6662. console.log(zhis)
  6663. for(var j in zhis) {
  6664. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6665. let objs = {}
  6666. objs.s = zhis[j].time[0]
  6667. objs.e = zhis[j].time[1]
  6668. objs.p = j
  6669. alp.push(objs)
  6670. }
  6671. }
  6672. console.log(alp)
  6673. this.dateAr = alp
  6674. if (this.reportTimeType.timeCanOverlap == 0) {
  6675. let str = this.$t('message.Filledtimeperiodsoverlap')
  6676. if(this.dateAr.length > 0) {
  6677. const trus = this.fns();
  6678. const overlapDataTime = this.getOverlapData(alp);
  6679. if (overlapDataTime.length > 0) {
  6680. const arrList = overlapDataTime.map((item) => item.p);
  6681. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6682. }
  6683. ll += 1
  6684. if(!trus) {
  6685. this.$message({
  6686. message: str,
  6687. type: 'error'
  6688. })
  6689. return false
  6690. }
  6691. }
  6692. } else {
  6693. if(this.dateAr.length > 0) {
  6694. ll +=1 ;
  6695. }
  6696. }
  6697. }
  6698. if(ll == 0) {
  6699. this.$message({
  6700. message: this.$t('message.Pleasefillinthetime'),
  6701. type: 'error'
  6702. })
  6703. return false
  6704. }
  6705. } else if(this.reportTimeType.type == 1){
  6706. for(var i in zhi) {
  6707. var zhis = zhi[i]
  6708. for(var j in zhis) {
  6709. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6710. ll += 1
  6711. }
  6712. }
  6713. }
  6714. if(ll == 0) {
  6715. this.$message({
  6716. message: this.$t('message.Pleaseselectatime'),
  6717. type: 'error'
  6718. })
  6719. return false
  6720. }
  6721. let overcorp = ''
  6722. for(let n in zhi){
  6723. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6724. overcorp += zhi[n].zhoDataTime + ','
  6725. }
  6726. }
  6727. if(this.user.companyId != 5978 && overcorp != ''){
  6728. overcorp = overcorp.substring(0,overcorp.length - 1)
  6729. this.$message({
  6730. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6731. type: 'error'
  6732. })
  6733. return
  6734. }
  6735. }
  6736. var submits = []
  6737. let formData = new FormData();
  6738. formData.append("draft", isDraft);
  6739. if(this.reportTimeType.multiWorktime == 1){
  6740. for (var i in this.zhoData) {
  6741. var zhoD = this.zhoData[i]
  6742. var flgs = false
  6743. for(var j in zhoD) {
  6744. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6745. flgs = true
  6746. // formData.append("degreeId", "-1");
  6747. formData.append("id", '-1');
  6748. for(var s in this.projectList) {
  6749. if(j == this.projectList[s].projectName) {
  6750. formData.append("projectId", this.projectList[s].id);
  6751. }
  6752. }
  6753. if(this.user.timeType.reportAuditType == 3){
  6754. let audItem = {}
  6755. if(this.user.timeType.auditLevel > 0){
  6756. audItem.auditorFirst = zhoD[j].auditorFirst
  6757. }
  6758. if(this.user.timeType.auditLevel > 1){
  6759. audItem.auditorSec = zhoD[j].auditorSec
  6760. }
  6761. if(this.user.timeType.auditLevel > 2){
  6762. audItem.auditorThird = zhoD[j].auditorThird
  6763. }
  6764. if(zhoD[j].ccUserid){
  6765. audItem.ccUserid = zhoD[j].ccUserid
  6766. }
  6767. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6768. }
  6769. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6770. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6771. formData.append("reportTimeType", this.reportTimeType.type);
  6772. formData.append("endTime", '');
  6773. formData.append("startTime", '');
  6774. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6775. var lix = []
  6776. var objjs = {}
  6777. objjs.startTime = zhoD[j].time[0]
  6778. objjs.endTime = zhoD[j].time[1]
  6779. if (zhoD[j].content == null || zhoD[j].content == '') {
  6780. zhoD[j].content == '-'
  6781. }
  6782. objjs.content = zhoD[j].content
  6783. lix.push(objjs)
  6784. var zhiZhi = JSON.stringify(lix)
  6785. zhiZhi = zhiZhi.replace(/,/g,"@");
  6786. formData.append("content", zhiZhi)
  6787. formData.append("isOvertime", 0)
  6788. formData.append("professionProgress", "[]")
  6789. if (zhoD[j].groupId) {
  6790. formData.append("groupId",zhoD[j].groupId)
  6791. } else {
  6792. //解决后台groupId数组越界的问题
  6793. formData.append("groupId",0)
  6794. }
  6795. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6796. formData.append("createDate",zhoD.zhoDataTime)
  6797. if (zhoD[j].projectAuditorId) {
  6798. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6799. }
  6800. if(zhoD[j].basecostId) {
  6801. formData.append("basecostId", zhoD[j].basecostId);
  6802. } else {
  6803. formData.append("basecostId", 0);
  6804. }
  6805. if(this.user.timeType.customDegreeActive){
  6806. if (this.user.timeType.customDegreeMultiple) {
  6807. if (zhoD[j].multiDegrIdArray) {
  6808. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6809. } else {
  6810. formData.append('multiDegrId','[]')
  6811. }
  6812. } else {
  6813. if (zhoD[j].degreeId) {
  6814. formData.append('degreeId',zhoD[j].degreeId)
  6815. } else {
  6816. formData.append('degreeId','-1')
  6817. }
  6818. }
  6819. }else{
  6820. formData.append("degreeId", "-1");
  6821. }
  6822. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6823. formData.append('customData',zhoD[j].customData)
  6824. }else if(this.user.timeType.customDataActive){
  6825. formData.append('customData',0)
  6826. }
  6827. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6828. formData.append('customText',zhoD[j].customText)
  6829. }else if(this.user.timeType.customTextActive){
  6830. formData.append('customText','-')
  6831. }
  6832. }
  6833. }
  6834. }
  6835. } else {
  6836. for (var i in this.zhoData) {
  6837. var zhoD = this.zhoData[i]
  6838. var flgs = false
  6839. if(this.reportTimeType.type == 2) {
  6840. for(var k in this.selProjectList) {
  6841. var pItem = this.selProjectList[k];
  6842. var pName = pItem.projectName;
  6843. var j = pName;
  6844. console.log('j==周报中的项目='+j);
  6845. if(zhoD[j].time && zhoD[j].time != 'null') {
  6846. flgs = true
  6847. // formData.append("degreeId", "-1");
  6848. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6849. for(var s in this.projectList) {
  6850. if(j == this.projectList[s].projectName) {
  6851. formData.append("projectId", this.projectList[s].id);
  6852. }
  6853. }
  6854. if(this.user.timeType.reportAuditType == 3){
  6855. let audItem = {}
  6856. if(this.user.timeType.auditLevel > 0){
  6857. audItem.auditorFirst = zhoD[j].auditorFirst
  6858. }
  6859. if(this.user.timeType.auditLevel > 1){
  6860. audItem.auditorSec = zhoD[j].auditorSec
  6861. }
  6862. if(this.user.timeType.auditLevel > 2){
  6863. audItem.auditorThird = zhoD[j].auditorThird
  6864. }
  6865. if(zhoD[j].ccUserid){
  6866. audItem.ccUserid = zhoD[j].ccUserid
  6867. }
  6868. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6869. }
  6870. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6871. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6872. formData.append("reportTimeType", this.reportTimeType.type);
  6873. formData.append("endTime", zhoD[j].time[1]);
  6874. formData.append("startTime", zhoD[j].time[0]);
  6875. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6876. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6877. formData.append("isOvertime", 0)
  6878. formData.append("professionProgress", "[]")
  6879. if (zhoD[j].groupId) {
  6880. formData.append("groupId",zhoD[j].groupId)
  6881. } else {
  6882. //解决后台groupId数组越界的问题
  6883. formData.append("groupId",0)
  6884. }
  6885. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6886. formData.append("createDate",zhoD.zhoDataTime)
  6887. if (zhoD[j].projectAuditorId) {
  6888. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6889. }
  6890. if(zhoD[j].basecostId) {
  6891. formData.append("basecostId", zhoD[j].basecostId);
  6892. } else {
  6893. formData.append("basecostId", 0);
  6894. }
  6895. if(this.user.timeType.customDegreeActive){
  6896. if (this.user.timeType.customDegreeMultiple) {
  6897. if (zhoD[j].multiDegrIdArray) {
  6898. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6899. } else {
  6900. formData.append("multiDegrId", "[]");
  6901. }
  6902. } else {
  6903. if (zhoD[j].degreeId) {
  6904. formData.append('degreeId',zhoD[j].degreeId)
  6905. } else {
  6906. formData.append("degreeId", "-1");
  6907. }
  6908. }
  6909. }else{
  6910. formData.append("degreeId", "-1");
  6911. }
  6912. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6913. formData.append('customData',zhoD[j].customData)
  6914. }else if(this.user.timeType.customDataActive){
  6915. formData.append('customData',0)
  6916. }
  6917. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6918. formData.append('customText',zhoD[j].customText)
  6919. }else if(this.user.timeType.customTextActive){
  6920. formData.append('customText','-')
  6921. }
  6922. }
  6923. }
  6924. } else {
  6925. for(var k in this.selProjectList) {
  6926. var pItem = this.selProjectList[k];
  6927. var pName = pItem.projectName;
  6928. var j = pName;
  6929. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6930. flgs = true
  6931. // formData.append("degreeId", "-1");
  6932. console.log('进入了workFpppp==='+j);
  6933. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6934. for(var s in this.projectList) {
  6935. if(j == this.projectList[s].projectName) {
  6936. formData.append("projectId", this.projectList[s].id);
  6937. }
  6938. }
  6939. if(this.user.timeType.reportAuditType == 3){
  6940. let audItem = {}
  6941. if(this.user.timeType.auditLevel > 0){
  6942. audItem.auditorFirst = zhoD[j].auditorFirst
  6943. }
  6944. if(this.user.timeType.auditLevel > 1){
  6945. audItem.auditorSec = zhoD[j].auditorSec
  6946. }
  6947. if(this.user.timeType.auditLevel > 2){
  6948. audItem.auditorThird = zhoD[j].auditorThird
  6949. }
  6950. if(zhoD[j].ccUserid){
  6951. audItem.ccUserid = zhoD[j].ccUserid
  6952. }
  6953. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6954. }
  6955. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6956. // formData.append("subProjectId", zhoD[j].subProjectId);
  6957. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6958. formData.append("reportTimeType", this.reportTimeType.type);
  6959. if(this.reportTimeType.type == 1) {
  6960. formData.append("workingTime", zhoD[j].workingTime);
  6961. } else if(this.reportTimeType.type == 2) {
  6962. formData.append("endTime", zhoD[j].time[1]);
  6963. formData.append("startTime", zhoD[j].time[0]);
  6964. } else if(this.reportTimeType.type == 3) {
  6965. formData.append("progress", zhoD[j].progress);
  6966. formData.append("workingTime", zhoD[j].workingTime);
  6967. }
  6968. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6969. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6970. formData.append("isOvertime", 0)
  6971. formData.append("professionProgress", "[]")
  6972. if (zhoD[j].groupId) {
  6973. formData.append("groupId",zhoD[j].groupId)
  6974. } else {
  6975. //解决后台groupId数组越界的问题
  6976. formData.append("groupId",0)
  6977. }
  6978. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6979. formData.append("createDate",zhoD.zhoDataTime)
  6980. if (zhoD[j].projectAuditorId) {
  6981. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6982. }
  6983. if(zhoD[j].basecostId) {
  6984. formData.append("basecostId", zhoD[j].basecostId);
  6985. } else {
  6986. formData.append("basecostId", 0);
  6987. }
  6988. if(this.user.timeType.customDegreeActive){
  6989. if (this.user.timeType.customDegreeMultiple) {
  6990. if (zhoD[j].multiDegrIdArray) {
  6991. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6992. } else {
  6993. formData.append("multiDegrId", "[]");
  6994. }
  6995. } else {
  6996. if (zhoD[j].degreeId) {
  6997. formData.append('degreeId',zhoD[j].degreeId)
  6998. } else {
  6999. formData.append("degreeId", "-1");
  7000. }
  7001. }
  7002. }else{
  7003. formData.append("degreeId", "-1");
  7004. }
  7005. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7006. formData.append('customData',zhoD[j].customData)
  7007. }else if(this.user.timeType.customDataActive){
  7008. formData.append('customData',0)
  7009. }
  7010. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7011. formData.append('customText',zhoD[j].customText)
  7012. }else if(this.user.timeType.customTextActive){
  7013. formData.append('customText','-')
  7014. }
  7015. }
  7016. }
  7017. }
  7018. }
  7019. }
  7020. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7021. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7022. if(!next) {
  7023. this.$message({
  7024. message: `【${error.join('、')}】请填写任务分组`,
  7025. type: 'error'
  7026. })
  7027. return
  7028. }
  7029. // 自定义维度
  7030. this.submitingReport = true;
  7031. this.http.uploadFile( this.port.report.editPort, formData,
  7032. res => {
  7033. // this.listLoading = false;
  7034. this.submitingReport = false;
  7035. if (res.code == "ok") {
  7036. this.$message({
  7037. message: this.$t('message.fillinsuccessfully'),
  7038. type: "success"
  7039. });
  7040. this.fillWeekDialogVisi = false
  7041. this.selConShow = true
  7042. this.zhoData = []
  7043. this.weekDateRange = ''
  7044. this.getReportList();
  7045. this.getDepartment();
  7046. // 关闭弹窗 并 清空
  7047. this.selProjectList = []
  7048. this.selCon = []
  7049. this.getRecentlyProject()
  7050. } else {
  7051. this.$message({
  7052. message: res.msg,
  7053. type: "error"
  7054. });
  7055. }
  7056. },
  7057. error => {
  7058. this.submitingReport = false;
  7059. this.$message({
  7060. message: error,
  7061. type: "error"
  7062. });
  7063. });
  7064. },
  7065. handleGroupAuditorData(data) {
  7066. const { reportAuditType } = this.user.timeType
  7067. if(reportAuditType != 1 && reportAuditType != 2) {
  7068. return {next: true}
  7069. }
  7070. let arrList = [];
  7071. Object.entries(data).forEach(([key, obj]) => {
  7072. Object.entries(obj).forEach(([projectName, projectData]) => {
  7073. if (projectData.workingTime && !projectData.groupId) {
  7074. arrList.push({
  7075. projectName,
  7076. date: obj.zhoDataTime,
  7077. dateText: obj.zhoDataTimeTxt
  7078. });
  7079. }
  7080. });
  7081. });
  7082. if(arrList.length > 0) {
  7083. return {
  7084. next: false,
  7085. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7086. }
  7087. } else {
  7088. return {
  7089. next: true,
  7090. error: [],
  7091. }
  7092. }
  7093. },
  7094. ChangeHourMinutestr (str) {
  7095. if (str !== "0" && str !== "" && str !== null) {
  7096. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7097. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7098. } else {
  7099. return "";
  7100. }
  7101. },
  7102. // 得到两个日期中间的日期
  7103. getdiffdate(stime,etime){
  7104. //初始化日期列表,数组
  7105. var diffdate = new Array();
  7106. var i=0;
  7107. //开始日期小于等于结束日期,并循环
  7108. while(stime<=etime){
  7109. diffdate[i] = stime;
  7110. //获取开始日期时间戳
  7111. var stime_ts = new Date(stime).getTime();
  7112. //增加一天时间戳后的日期
  7113. var next_date = stime_ts + (24*60*60*1000);
  7114. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7115. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7116. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7117. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7118. stime = next_dates_y+next_dates_m+next_dates_d;
  7119. //增加数组key
  7120. i++;
  7121. }
  7122. return diffdate;
  7123. },
  7124. // 添加模块
  7125. addDomain(i) {
  7126. var leftProgress = 10;
  7127. if (this.reportTimeType.type == 3) {
  7128. //计算已经待分配工时比例
  7129. let array = this.workForm.domains;
  7130. let totalProgress = 0;
  7131. for (var i=0;i<array.length; i++) {
  7132. totalProgress += array[i].progress;
  7133. }
  7134. if (totalProgress < 100) {
  7135. leftProgress = 100 - totalProgress;
  7136. }
  7137. }
  7138. var addItem = {
  7139. projectId: "",
  7140. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7141. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7142. ),
  7143. content: "",
  7144. progress:leftProgress,
  7145. state:2,//2-表示待提交
  7146. multiWorktime: this.reportTimeType.multiWorktime,
  7147. worktimeList:[{}],
  7148. canEdit: true,
  7149. auditorFirst: '',
  7150. auditorSec: '',
  7151. auditorThird: '',
  7152. ccUserid: ''
  7153. // degreeId: '',
  7154. };
  7155. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7156. this.$set(addItem,'isOvertime',true)
  7157. if(this.reportTimeType.type == 3){
  7158. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7159. }
  7160. }
  7161. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7162. //默认给第一个,必填字段
  7163. addItem.basecostId = this.timeBasecostList[0].id;
  7164. }
  7165. this.workForm.domains.push(addItem);
  7166. document.getElementById('workFormsItemBottom').scrollIntoView()
  7167. this.canEdit = true
  7168. if (this.reportTimeType.type == 0) {
  7169. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7170. var length = this.workForm.domains.length;
  7171. if (length == 2) {
  7172. this.showAddMore = false;
  7173. }
  7174. }
  7175. this.chuji()
  7176. this.seleChn()
  7177. },
  7178. // 移除模块
  7179. delDomain(i) {
  7180. this.workForm.domains.splice(i,1)
  7181. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7182. if (!this.originCanEdit) {
  7183. let iscan = false
  7184. for(let i in this.workForm.domains){
  7185. if(this.workForm.domains[i].canEdit){
  7186. iscan = true
  7187. }
  7188. }
  7189. this.canEdit = iscan
  7190. }
  7191. //检测当前剩下的一个,时间类型是否是全天
  7192. if (this.reportTimeType.type == 0) {
  7193. if (this.workForm.domains[0].timeType == 0) {
  7194. this.showAddMore = false;
  7195. } else {
  7196. this.showAddMore = true;
  7197. }
  7198. }
  7199. if(this.user.timeType.multiWorktime == 1) {
  7200. this.iptChangs()
  7201. } else {
  7202. this.seleChn(0)
  7203. }
  7204. },
  7205. // 改变月份
  7206. changeMonth() {
  7207. this.isWeekend = false
  7208. let date = new Date()
  7209. let nowmon = date.getMonth() + 1
  7210. let nowday = date.getDate()
  7211. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7212. if (this.isBatch == 0) {
  7213. if(this.user.timeType.fillAhead == 0){
  7214. let date_a = new Date(this.workForm.createDate)
  7215. if(date_a.getTime() > date.getTime()){
  7216. this.workForm.createDate = nowdate
  7217. }
  7218. }
  7219. //只有按天填报才能获取当天的日报
  7220. if(!this.isSubstitude){
  7221. let weekday = new Date(this.workForm.createDate).getDay()
  7222. if(this.user.companyId == 817){
  7223. if(weekday == 0){
  7224. this.isWeekend = true
  7225. }
  7226. }else{
  7227. if(weekday == 0 || weekday == 6){
  7228. this.isWeekend = true
  7229. }
  7230. }
  7231. this.getReport()
  7232. }
  7233. }else {
  7234. if(this.user.timeType.fillAhead == 0){
  7235. let date_a = new Date(this.workForm.createDate[1])
  7236. if(date_a.getTime() > date.getTime()){
  7237. this.workForm.createDate[1] = nowdate
  7238. let sdate = new Date(this.workForm.createDate[0])
  7239. let edate = new Date(this.workForm.createDate[1])
  7240. if(sdate > edate){
  7241. this.workForm.createDate[0] = this.workForm.createDate[1]
  7242. }
  7243. }
  7244. }
  7245. }
  7246. },
  7247. // 判断时间段
  7248. fns() {
  7249. for (let k in this.dateAr) {
  7250. if (!this.judege(k)) {
  7251. return false
  7252. }
  7253. }
  7254. return true
  7255. },
  7256. judege(idx){
  7257. for (let k in this.dateAr) {
  7258. if (idx !== k) {
  7259. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7260. return false
  7261. }
  7262. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7263. return false
  7264. }
  7265. }
  7266. }
  7267. return true
  7268. },
  7269. getOverlapData(data) {
  7270. let overlapData = [];
  7271. for (let i = 0; i < data.length; i++) {
  7272. for (let j = i + 1; j < data.length; j++) {
  7273. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7274. overlapData.push(data[i], data[j]);
  7275. }
  7276. }
  7277. }
  7278. return overlapData;
  7279. },
  7280. // 保存日报111111
  7281. submitReport(isDraft) {
  7282. this.isDraft = isDraft;
  7283. this.$refs.workForm.validate(valid => {
  7284. if (valid) {
  7285. if (!isDraft) {
  7286. //针对苏州景昱,单独的检查逻辑
  7287. if (this.user.companyId == 5978) {
  7288. //调接口,先检查工时是否存在异常
  7289. var totalTime = 0;
  7290. for (var t=0;t<this.workForm.domains.length; t++) {
  7291. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7292. }
  7293. var array = [];
  7294. if (this.isBatch) {
  7295. var startDate = new Date(this.workForm.createDate[0]);
  7296. var endDate = new Date(this.workForm.createDate[1]);
  7297. if (startDate > endDate) {
  7298. this.$message({
  7299. message: '开始日期不能大于结束日期',
  7300. type: "error"
  7301. });
  7302. return
  7303. } else {
  7304. while(true){
  7305. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7306. array.push(workData);
  7307. startDate.setDate(startDate.getDate() + 1);
  7308. if (startDate > endDate) {
  7309. break;
  7310. }
  7311. }
  7312. }
  7313. } else {
  7314. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7315. array.push(workData)
  7316. }
  7317. this.submitingReport = true;
  7318. var passUserId = this.user.id;
  7319. if (this.isSubstitude) {
  7320. passUserId = this.targetUids;
  7321. }
  7322. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7323. res => {
  7324. this.submitingReport = false;
  7325. if (res.code == "ok") {
  7326. this.submitReportSon()
  7327. } else {
  7328. this.$confirm(res.msg, '提示', {
  7329. confirmButtonText: '忽略并提交',
  7330. cancelButtonText: '取消',
  7331. type: 'error'
  7332. }).then(() => {
  7333. this.submitReportSon()
  7334. }).catch(() => {
  7335. });
  7336. }
  7337. },
  7338. error => {
  7339. this.$message({
  7340. message: error,
  7341. type: "error"
  7342. });
  7343. });
  7344. } else {
  7345. if(this.totalReportHours < this.user.timeType.allday){
  7346. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7347. confirmButtonText: '确定',
  7348. cancelButtonText: '取消',
  7349. type: 'warning'
  7350. }).then(() => {
  7351. this.submitReportSon()
  7352. }).catch(() => {
  7353. });
  7354. }else{
  7355. this.submitReportSon()
  7356. }
  7357. }
  7358. } else {
  7359. //暂存,不需要检查工时是否超过考勤
  7360. this.submitReportSon()
  7361. }
  7362. }
  7363. });
  7364. },
  7365. submitReportSon() {
  7366. this.dateAr = []
  7367. //检查重叠
  7368. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7369. let alp = []
  7370. if(this.user.timeType.multiWorktime != 1) {
  7371. for(var p in this.workForm.domains) {
  7372. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7373. let objs = {}
  7374. objs.s = this.workForm.domains[p].startTime
  7375. objs.e = this.workForm.domains[p].endTime
  7376. alp.push(objs)
  7377. }
  7378. }
  7379. this.dateAr = alp
  7380. if(this.dateAr.length > 0) {
  7381. let trus = this.fns()
  7382. if(!trus) {
  7383. this.$message({
  7384. message: this.$t('message.Filledtimeperiodsoverlap'),
  7385. type: "error"
  7386. });
  7387. return
  7388. }
  7389. }
  7390. } else {
  7391. for(var p in this.workForm.domains) {
  7392. var slll = this.workForm.domains[p]
  7393. for(var o in slll.worktimeList) {
  7394. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7395. let objs = {}
  7396. objs.s = slll.worktimeList[o].startTime
  7397. objs.e = slll.worktimeList[o].endTime
  7398. alp.push(objs)
  7399. }
  7400. }
  7401. }
  7402. this.dateAr = alp
  7403. if(this.dateAr.length > 0) {
  7404. let trus = this.fns()
  7405. if(!trus) {
  7406. this.$message({
  7407. message: this.$t('message.Filledtimeperiodsoverlap'),
  7408. type: "error"
  7409. });
  7410. return
  7411. }
  7412. }
  7413. }
  7414. }
  7415. //检查子项目
  7416. if (this.user.timeType.subProMustFill == 1) {
  7417. for(var p in this.workForm.domains) {
  7418. var oneProItem = this.workForm.domains[p]
  7419. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7420. //没有选择子项目
  7421. this.$message({
  7422. message: '子项目必填,请检查',
  7423. type: "error"
  7424. });
  7425. return
  7426. }
  7427. }
  7428. }
  7429. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7430. if (this.user.companyId == this.yuzhongCompId) {
  7431. for(var p in this.workForm.domains) {
  7432. var oneProItem = this.workForm.domains[p]
  7433. if (!oneProItem.extraField1) {
  7434. this.$message({
  7435. message: '角色必填,请检查',
  7436. type: "error"
  7437. });
  7438. return
  7439. }
  7440. if (!oneProItem.extraField2) {
  7441. this.$message({
  7442. message: '工作职责必填,请检查',
  7443. type: "error"
  7444. });
  7445. return
  7446. }
  7447. if (!oneProItem.extraField3) {
  7448. this.$message({
  7449. message: '工作内容必填,请检查',
  7450. type: "error"
  7451. });
  7452. return
  7453. }
  7454. }
  7455. }
  7456. // return
  7457. //代填的情况,检查人员是否已经选择
  7458. if (this.isSubstitude) {
  7459. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7460. this.$message({
  7461. message: this.$t('message.pleaseselectthepersontofillin'),
  7462. type: "error"
  7463. });
  7464. return;
  7465. }
  7466. }
  7467. //检查时间,全天和上下午不能同时存在
  7468. if (this.reportTimeType.type == 0) {
  7469. var alldayNum = 0;
  7470. var amNum = 0;
  7471. var pmNum = 0;
  7472. for(var i in this.workForm.domains) {
  7473. if (this.workForm.domains[i].timeType == 0) {
  7474. alldayNum ++;
  7475. } else if (this.workForm.domains[i].timeType == 1) {
  7476. amNum++;
  7477. } else if (this.workForm.domains[i].timeType == 2) {
  7478. pmNum++;
  7479. }
  7480. }
  7481. if (alldayNum > 1) {
  7482. this.$message({
  7483. // message: "工作时间-全天,只能选择一次",
  7484. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7485. type: "error"
  7486. });
  7487. return;
  7488. }
  7489. if (amNum > 1) {
  7490. this.$message({
  7491. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7492. type: "error"
  7493. });
  7494. return;
  7495. }
  7496. if (pmNum > 1) {
  7497. this.$message({
  7498. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7499. type: "error"
  7500. });
  7501. return;
  7502. }
  7503. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7504. this.$message({
  7505. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7506. type: "error"
  7507. });
  7508. return;
  7509. }
  7510. } else if (this.reportTimeType.type == 3) {
  7511. //总百分比不能超过100%
  7512. let total = 0;
  7513. this.workForm.domains.forEach(w=>{total += w.progress});
  7514. if (total > 100) {
  7515. this.$message({
  7516. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7517. type: "error"
  7518. });
  7519. return;
  7520. } else if (total < 100) {
  7521. this.$message({
  7522. message: this.$t('message.cannotbesubmitted'),
  7523. type: "error"
  7524. });
  7525. return;
  7526. }
  7527. }
  7528. this.listLoading = true;
  7529. let formData = new FormData();
  7530. formData.append("draft", this.isDraft);
  7531. var totalTime = 0;
  7532. for (var t=0;t<this.workForm.domains.length; t++) {
  7533. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7534. }
  7535. //批量填报不校验考勤时长,交给后台校验
  7536. if (!this.isBatch) {
  7537. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7538. if (this.workForm.time){
  7539. if (this.workForm.time.workHours == 0){
  7540. this.$message({
  7541. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7542. type: 'error'
  7543. })
  7544. return
  7545. }
  7546. }else{
  7547. this.$message({
  7548. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7549. type: 'error'
  7550. })
  7551. return
  7552. }
  7553. }
  7554. }
  7555. //针对凡己和景昱,此处不校验考勤时长
  7556. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7557. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7558. this.$message({
  7559. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7560. type: "error"
  7561. });
  7562. return;
  7563. }
  7564. }
  7565. for(var i in this.workForm.domains) {
  7566. // 检查任务/里程碑是否为必填
  7567. let taskRequired = this.user.timeType.taskRequired
  7568. if(taskRequired == 1) {
  7569. if(!this.workForm.domains[i].taskId) {
  7570. this.$message({
  7571. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7572. type: "error"
  7573. });
  7574. return
  7575. }
  7576. }
  7577. if(this.user.timeType.reportAuditType == 3){
  7578. let audItem = {}
  7579. let auditRule = ''
  7580. if(this.workForm.domains[i].id){
  7581. audItem.reportId = this.workForm.domains[i].id
  7582. }
  7583. if(this.user.timeType.auditLevel > 0){
  7584. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7585. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7586. }
  7587. if(this.user.timeType.auditLevel > 1){
  7588. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7589. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7590. }
  7591. if(this.user.timeType.auditLevel > 2){
  7592. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7593. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7594. }
  7595. if(this.workForm.domains[i].ccUserid){
  7596. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7597. }
  7598. if(auditRule){
  7599. auditRule = auditRule.substring(0,auditRule.length - 1)
  7600. this.$message({
  7601. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7602. type: 'error'
  7603. })
  7604. return
  7605. }
  7606. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7607. }
  7608. if (this.user.timeType.customDegreeActive) {
  7609. if (this.user.timeType.customDegreeMultiple) {
  7610. //多选
  7611. if (this.workForm.domains[i].multiDegrIdArray) {
  7612. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7613. degreeArray = degreeArray.replace(/,/g,"@");
  7614. formData.append("multiDegrId", degreeArray);
  7615. } else {
  7616. formData.append("multiDegrId", '[]');
  7617. }
  7618. } else {
  7619. //单选
  7620. if (this.workForm.domains[i].degreeId) {
  7621. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7622. } else {
  7623. formData.append("degreeId", -1);
  7624. }
  7625. }
  7626. } else {
  7627. formData.append("degreeId", -1);
  7628. }
  7629. if(this.workForm.domains[i].customData) {
  7630. // var sss = this.workForm.domains[i].degreeId.toString()
  7631. formData.append("customData", this.workForm.domains[i].customData);
  7632. } else {
  7633. formData.append("customData", 0);
  7634. }
  7635. if(this.workForm.domains[i].customText) {
  7636. formData.append("customText", this.workForm.domains[i].customText);
  7637. } else {
  7638. formData.append("customText", '-');
  7639. }
  7640. if (this.workForm.domains[i].id) {
  7641. formData.append("id", this.workForm.domains[i].id);
  7642. } else {
  7643. formData.append("id", -1);
  7644. }
  7645. formData.append("projectId", this.workForm.domains[i].projectId);
  7646. if (this.workForm.domains[i].subProjectId) {
  7647. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7648. } else {
  7649. formData.append("subProjectId", 0);
  7650. }
  7651. if (this.workForm.domains[i].groupId) {
  7652. formData.append("groupId", this.workForm.domains[i].groupId);
  7653. } else {
  7654. formData.append("groupId", 0);
  7655. }
  7656. if (this.workForm.domains[i].taskId) {
  7657. formData.append("taskId", this.workForm.domains[i].taskId);
  7658. } else {
  7659. formData.append("taskId", 0);
  7660. }
  7661. if (this.workForm.domains[i].taskFinish == true) {
  7662. formData.append("taskFinish", 1);
  7663. } else {
  7664. formData.append("taskFinish", 0);
  7665. }
  7666. formData.append("reportTimeType", this.reportTimeType.type);
  7667. if (this.reportTimeType.type == 0) {
  7668. formData.append("timeType", this.workForm.domains[i].timeType);
  7669. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7670. formData.append("workingTime", workingTime);
  7671. } else if (this.reportTimeType.type == 1){
  7672. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7673. } else if (this.reportTimeType.type == 2) {
  7674. formData.append("endTime", this.workForm.domains[i].endTime);
  7675. formData.append("startTime", this.workForm.domains[i].startTime);
  7676. } else if (this.reportTimeType.type == 3) {
  7677. //按比例分配
  7678. formData.append("progress", this.workForm.domains[i].progress);
  7679. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7680. }
  7681. if(this.user.timeType.choseFromAlbum == 1 ) {
  7682. console.log(this.workForm.domains[i].imgList)
  7683. if(this.workForm.domains[i].imgList) {
  7684. let imgListFor = this.workForm.domains[i].imgList
  7685. for(var b in imgListFor) {
  7686. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7687. }
  7688. console.log(imgListFor)
  7689. let m = JSON.stringify(imgListFor);
  7690. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7691. formData.append("picStr", m);
  7692. } else {
  7693. formData.append("picStr", '[]');
  7694. }
  7695. }
  7696. //处理多个时间事项
  7697. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7698. if (this.reportTimeType.multiWorktime == 1) {
  7699. //检查时间是否有重叠
  7700. var workList = this.workForm.domains[i].worktimeList;
  7701. for (var j=0;j<workList.length; j++) {
  7702. var curItem = workList[j];
  7703. //检查开始时间是否大于结束时间
  7704. if (curItem.startTime >= curItem.endTime) {
  7705. this.$message({
  7706. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7707. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7708. type: "error"
  7709. });
  7710. return;
  7711. }
  7712. //时间不可重叠
  7713. if (this.reportTimeType.timeCanOverlap == 0) {
  7714. for (var p = j+1;p<workList.length; p++) {
  7715. var jItem = workList[p];
  7716. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7717. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7718. this.$message({
  7719. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7720. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7721. type: "error"
  7722. });
  7723. return;
  7724. }
  7725. }
  7726. }
  7727. }
  7728. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7729. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7730. formData.append("content", m);
  7731. } else {
  7732. if (this.workForm.domains[i].content) {
  7733. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7734. m = m.replace(/,/g,",");
  7735. console.log(m, '需要传值的数据')
  7736. // formData.append("content", this.workForm.domains[i].content);
  7737. formData.append("content", m);
  7738. } else {
  7739. formData.append("content", '-');
  7740. }
  7741. }
  7742. if (this.isBatch == 0) {
  7743. formData.append("createDate", this.workForm.createDate);
  7744. } else {
  7745. //批量填报,时间范围
  7746. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7747. }
  7748. if(this.workForm.domains[i].isOvertime) {
  7749. formData.append("isOvertime", 1);
  7750. } else {
  7751. formData.append("isOvertime", 0);
  7752. }
  7753. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7754. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7755. } else {
  7756. formData.append("overtimeHours", 0);
  7757. }
  7758. if(this.workForm.domains[i].basecostId) {
  7759. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7760. } else {
  7761. formData.append("basecostId", 0);
  7762. }
  7763. if (this.workForm.userId != null) {
  7764. var targetUids = '';
  7765. this.workForm.userId.forEach(u=>{
  7766. targetUids += u + '@';
  7767. });
  7768. if (targetUids.length > 0) {
  7769. targetUids = targetUids.substring(0, targetUids.length -1);
  7770. formData.append("targetUids", targetUids);
  7771. }
  7772. }
  7773. //项目专业进度
  7774. if (this.workForm.domains[i].professionProgress) {
  7775. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7776. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7777. formData.append("professionProgress", m);
  7778. } else {
  7779. formData.append("professionProgress", "[]");
  7780. }
  7781. if (this.workForm.domains[i].stage) {
  7782. formData.append("stage", this.workForm.domains[i].stage);
  7783. } else {
  7784. formData.append("stage", "-");
  7785. }
  7786. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7787. if (this.workForm.domains[i].projectAuditorId) {
  7788. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7789. } else {
  7790. // console.log('执行到了这里')
  7791. // console.log(this.user.timeType.reportAuditType)
  7792. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7793. this.$message({
  7794. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7795. type: "error"
  7796. });
  7797. return;
  7798. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7799. //分组负责人先审核, 确定是选择了任务分组
  7800. if (this.workForm.domains[i].taskGroups.length == 0) {
  7801. this.$message({
  7802. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7803. type: "error"
  7804. });
  7805. } else if (!this.workForm.domains[i].groupId) {
  7806. // console.log(this.workForm.domains[i]);
  7807. this.$message({
  7808. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7809. type: "error"
  7810. });
  7811. } else {
  7812. this.$message({
  7813. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7814. type: "error"
  7815. });
  7816. }
  7817. return;
  7818. }
  7819. }
  7820. if (this.user.companyId == this.yuzhongCompId) {
  7821. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7822. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7823. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7824. }
  7825. //依斯贝的服务Id
  7826. if (this.user.companyId == this.yisibeiCompId) {
  7827. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7828. }
  7829. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7830. this.$message({
  7831. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7832. type: "error"
  7833. });
  7834. return
  7835. }
  7836. if(this.user.timeType.userWithMultiDept == 1) {
  7837. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  7838. }
  7839. }
  7840. this.submitingReport = true;
  7841. this.http.uploadFile( this.port.report.editPort, formData,
  7842. res => {
  7843. this.listLoading = false;
  7844. this.submitingReport = false;
  7845. if (res.code == "ok") {
  7846. if(res.msg!=null){
  7847. this.$message({
  7848. dangerouslyUseHTMLString: true,
  7849. message: res.msg,
  7850. type: "warning",
  7851. showClose: true,
  7852. duration: 0
  7853. });
  7854. }else{
  7855. this.$message({
  7856. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7857. type: "success"
  7858. });
  7859. }
  7860. this.dialogVisible = false;
  7861. this.jsDay = 0
  7862. this.jsTime = 0
  7863. this.getReportList();
  7864. this.getDepartment();
  7865. this.getRecentlyProject()
  7866. } else {
  7867. this.$message({
  7868. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7869. type: "error"
  7870. });
  7871. }
  7872. },
  7873. error => {
  7874. this.listLoading = false;
  7875. this.submitingReport = false;
  7876. this.$message({
  7877. message: error,
  7878. type: "error"
  7879. });
  7880. });
  7881. },
  7882. // 判断是展示那个工时导入
  7883. imports() {
  7884. if(this.user.timeType.syncCorpwxTime == 0) {
  7885. this.importDialog = true
  7886. } else {
  7887. this.importWxDialog = true
  7888. }
  7889. },
  7890. // 跳转
  7891. junpToDeskTop(id) {
  7892. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7893. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7894. },
  7895. // 通过日报
  7896. approve(id, item) {
  7897. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7898. this.approveinData = {
  7899. id: id,
  7900. date: this.date +day,
  7901. reportIds: item.id
  7902. }
  7903. if(this.user.timeType.needEvaluate == 1){
  7904. this.$set(this.approveinData,'evaluate','')
  7905. this.approveinDialog = true
  7906. }else{
  7907. this.logining = true;
  7908. this.approveinfun()
  7909. }
  7910. },
  7911. approveinfun(){
  7912. this.http.post( this.port.report.approve, this.approveinData,
  7913. res => {
  7914. this.logining = false;
  7915. if (res.code == "ok") {
  7916. this.approveinDialog = false
  7917. this.$message({
  7918. message: this.$t('message.Reviewsucceeded'),
  7919. type: "success"
  7920. });
  7921. this.refreshReportData(this.approveinData.reportIds);
  7922. this.getDepartment();
  7923. } else {
  7924. this.$message({
  7925. message: res.msg,
  7926. type: "error"
  7927. });
  7928. }
  7929. },
  7930. error => {
  7931. this.logining = false;
  7932. this.$message({
  7933. message: error,
  7934. type: "error"
  7935. });
  7936. });
  7937. },
  7938. //撤回日报
  7939. cancel(item,e) {
  7940. // console.log('can can need',item);
  7941. this.logining = true;
  7942. var ids = '';
  7943. var data = e ? item : item.data;
  7944. data.forEach(element => {
  7945. if(element.id){
  7946. ids +=(element.id+',');
  7947. }
  7948. });
  7949. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7950. res => {
  7951. this.logining = false;
  7952. if (res.code == "ok") {
  7953. this.$message({
  7954. message:this.$t('message.Withdrawalsucceeded'),
  7955. type: "success"
  7956. });
  7957. this.getReportList();
  7958. if(e){this.getReport()}
  7959. this.getDepartment();
  7960. } else {
  7961. this.$message({
  7962. message: res.msg,
  7963. type: "error"
  7964. });
  7965. }
  7966. },
  7967. error => {
  7968. this.logining = false;
  7969. this.$message({
  7970. message: error,
  7971. type: "error"
  7972. });
  7973. });
  7974. },
  7975. showDenyDialog(id,i, item) {
  7976. this.denyReasonDialog = true;
  7977. this.isDenying = false;
  7978. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7979. var ids = item.id;
  7980. // var data = item.data;
  7981. // data.forEach(element => {
  7982. // ids +=(element.id+',');
  7983. // });
  7984. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7985. },
  7986. // 未通过日报
  7987. deny() {
  7988. this.logining = true;
  7989. this.isDenying = true;
  7990. this.http.post( this.port.report.deny, this.denyForm,
  7991. res => {
  7992. this.logining = false;
  7993. this.isDenying = false;
  7994. if (res.code == "ok") {
  7995. this.$message({
  7996. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7997. type: "success"
  7998. });
  7999. this.refreshReportData(this.denyForm.reportIds);
  8000. this.getDepartment();
  8001. this.denyReasonDialog = false;
  8002. } else {
  8003. this.$message({
  8004. message: res.msg,
  8005. type: "error"
  8006. });
  8007. }
  8008. },
  8009. error => {
  8010. this.logining = false;
  8011. this.$message({
  8012. message: error,
  8013. type: "error"
  8014. });
  8015. });
  8016. },
  8017. // 查看工时记录弹窗
  8018. toView() {
  8019. this.toViewDialogVisible = true
  8020. this.toViewloading = true
  8021. this.getToView()
  8022. },
  8023. getToView() {
  8024. this.http.post( '/report-import-log/getList', this.toViewForm,
  8025. res => {
  8026. this.toViewloading = false;
  8027. if (res.code == "ok") {
  8028. // console.log(res.data, '数据数据')
  8029. this.toViewList = res.data.records
  8030. this.toViewForm.total = res.data.total
  8031. } else {
  8032. this.toViewloading = false;
  8033. this.$message({
  8034. message: res.msg,
  8035. type: "error"
  8036. });
  8037. }
  8038. })
  8039. },
  8040. // 触发 selectCat 组件更改他的值
  8041. selectCatCli(obj) {
  8042. // console.log(obj, '看看')
  8043. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8044. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8045. },
  8046. vueCasader(obj) {
  8047. console.log(obj, '看看值')
  8048. if(obj.distinction == 1 && obj.item) {
  8049. let arr = []
  8050. arr.push(obj.item.value)
  8051. this.exportParam.departmentId = arr
  8052. }
  8053. if(obj.distinction == '10' && obj) {
  8054. const { id, other } = obj
  8055. this.workForm.domains[other].reportTargetDeptId = id
  8056. }
  8057. },
  8058. //分页
  8059. handleCurrentChange(val) {
  8060. this.toViewForm.pageIndex = val;
  8061. this.getToView();
  8062. },
  8063. handleSizeChange(val) {
  8064. this.toViewForm.pageSize = val;
  8065. this.getToView();
  8066. },
  8067. getAllUsersList(){
  8068. this.http.post('/user/getSimpleActiveUserList',{
  8069. },res => {
  8070. if(res.code == 'ok'){
  8071. this.allUsersList = res.data
  8072. }else{
  8073. this.$message({
  8074. message: res.msg,
  8075. type: 'error'
  8076. })
  8077. }
  8078. },err => {
  8079. this.$message({
  8080. message: err,
  8081. type: 'error'
  8082. })
  8083. })
  8084. },
  8085. //景昱变更提醒
  8086. changeReminder(item){
  8087. console.log("============",item)
  8088. let parameter={
  8089. startDate: this.WorktimeDatepickValue[0],
  8090. endDate: this.WorktimeDatepickValue[1],
  8091. }
  8092. if(item){
  8093. parameter.createDate=item.createDate,
  8094. parameter.userId=item.userId
  8095. }
  8096. this.http.post('/report/changeReminder',parameter,res => {
  8097. if(res.code == 'ok'){
  8098. this.$message({
  8099. message: res.msg,
  8100. type: 'success'
  8101. })
  8102. }else{
  8103. this.$message({
  8104. message: res.msg,
  8105. type: 'error'
  8106. })
  8107. }
  8108. },err => {
  8109. this.$message({
  8110. message: err,
  8111. type: 'error'
  8112. })
  8113. })
  8114. },
  8115. //景昱取消异常
  8116. cancelReminder(item){
  8117. let parameter={}
  8118. if(item){
  8119. parameter.createDate=item.createDate,
  8120. parameter.userId=item.userId
  8121. }
  8122. this.http.post('/report/cancelReminder',parameter,res => {
  8123. if(res.code == 'ok'){
  8124. this.$message({
  8125. message: res.msg,
  8126. type: 'success'
  8127. })
  8128. }else{
  8129. this.$message({
  8130. message: res.msg,
  8131. type: 'error'
  8132. })
  8133. }
  8134. },err => {
  8135. this.$message({
  8136. message: err,
  8137. type: 'error'
  8138. })
  8139. })
  8140. this.showMonthWorkTimeReminder()
  8141. },
  8142. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8143. fillWeekCustomClne() {
  8144. this.fillWeekDialogVisiCustom = false
  8145. },
  8146. fillWeekCustomSubmit() {
  8147. this.getReportList();
  8148. this.getDepartment();
  8149. this.getRecentlyProject()
  8150. },
  8151. // 待填日报姓名搜索
  8152. nameAearchSeek(flg) {
  8153. if(!this.nameAearch) {
  8154. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8155. return
  8156. }
  8157. if(flg) {
  8158. this.enterpriseWechatgetUser()
  8159. }
  8160. },
  8161. handleThreeData(userList) {
  8162. console.log(userList, '人员数据')
  8163. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8164. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8165. },
  8166. // 过滤树节点
  8167. filterTreeNodes(treeData, filterKeywords) {
  8168. return treeData.filter((node) => {
  8169. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8170. if (node.children && node.children.length > 0) {
  8171. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8172. }
  8173. return true;
  8174. }
  8175. if (node.children && node.children.length > 0) {
  8176. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8177. return node.children.length > 0;
  8178. }
  8179. return false;
  8180. });
  8181. },
  8182. // 企业微信获取人员
  8183. enterpriseWechatgetUser() {
  8184. this.deptMembDataLoading = true
  8185. this.http.post('/user/getEmployeeList',{
  8186. departmentId: -1,
  8187. pageIndex: 1,
  8188. pageSize: 100,
  8189. keyword: this.nameAearch,
  8190. status: '',
  8191. roleId: '',
  8192. cursor: '',
  8193. onlyDirect: '',
  8194. matchingType: ''
  8195. },res => {
  8196. if(res.code == 'ok'){
  8197. this.deptMembDataLoading = false
  8198. const userListName = res.data.records.map(item => item.name)
  8199. this.handleThreeData(userListName)
  8200. }else{
  8201. this.deptMembDataLoading = false
  8202. this.$message({
  8203. message: res.msg,
  8204. type: 'error'
  8205. })
  8206. }
  8207. },err => {
  8208. this.deptMembDataLoading = false
  8209. this.$message({
  8210. message: err,
  8211. type: 'error'
  8212. })
  8213. })
  8214. },
  8215. // 按周填报获取相关任务
  8216. async getWeeklyTaskList(item) {
  8217. console.log(item, '<=== 数据')
  8218. const { projectId, groupId, stage, taskId } = item
  8219. console.log(projectId, groupId, stage)
  8220. let parms = { projectId, isSubstitude: 0 }
  8221. groupId ? parms.groupId = groupId : ''
  8222. stage ? parms.stage = stage : ''
  8223. const { data } = await this.postData('/task/getRecentTask', parms)
  8224. this.zhoBao.taskId = taskId
  8225. this.$set(this.zhoBao, 'taskList', data)
  8226. console.log(this.zhoBao)
  8227. },
  8228. // 封装 post 请求
  8229. postData(url, params) {
  8230. return new Promise((resolve, reject) => {
  8231. this.http.post(url, { ...params },
  8232. res => {
  8233. resolve(res)
  8234. },
  8235. error => {
  8236. this.$message({
  8237. message: error,
  8238. type: "error"
  8239. });
  8240. reject(error)
  8241. })
  8242. })
  8243. },
  8244. // 自定义事件
  8245. selectCal(obj) {
  8246. console.log(obj, '传数据来源')
  8247. if(obj.distinction == '1') {
  8248. this.zhoBao.projectAuditorId = obj.id
  8249. } else if(obj.distinction == '2') {
  8250. this.zhoBao.auditorFirst = obj.id
  8251. } else if(obj.distinction == '3') {
  8252. this.zhoBao.auditorSec = obj.id
  8253. } else if(obj.distinction == '4') {
  8254. this.zhoBao.auditorThird = obj.id
  8255. } else if(obj.distinction == '5') {
  8256. this.zhoBao.ccUserid = obj.id
  8257. } else if(obj.distinction == '12') {
  8258. this.usersListId = obj.id
  8259. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8260. this.searchKeyword = obj.name
  8261. } else {
  8262. this.searchKeyword = ''
  8263. }
  8264. this.searchScreen(0)
  8265. } else if(obj.distinction == '13') {
  8266. this.usersListId = obj.id
  8267. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8268. this.searchKeyword = obj.name
  8269. } else {
  8270. this.searchKeyword = ''
  8271. }
  8272. this.searchScreen(1)
  8273. }
  8274. }
  8275. },
  8276. created() {
  8277. this.getUsers()
  8278. let height = window.innerHeight;
  8279. this.tableHeight = height - 178;
  8280. const that = this;
  8281. window.onresize = function temp() {
  8282. that.tableHeight = window.innerHeight - 178;
  8283. };
  8284. this.toViewForm.companyId = this.user.companyId
  8285. this.initDrag([{
  8286. type: "LR",
  8287. domClass: {
  8288. // 中间分割线的名字
  8289. resize: "line-line",
  8290. // 左侧盒子的名字
  8291. left: "box-left",
  8292. // 右侧盒子的名字
  8293. right: "box-right",
  8294. // 父级的名字
  8295. box: "box-father",
  8296. },
  8297. otherInfo: {
  8298. // 限制左边栏最低宽度
  8299. leftWidth: 120,
  8300. },
  8301. },
  8302. {
  8303. type: "LR",
  8304. domClass: {
  8305. // 中间分割线的名字
  8306. resize: "line-second",
  8307. // 左侧盒子的名字
  8308. left: "left-laowang",
  8309. // 右侧盒子的名字
  8310. right: "box-second-father",
  8311. // 父级的名字
  8312. box: "grand",
  8313. },
  8314. otherInfo: {
  8315. // 限制左边栏最低宽度
  8316. leftWidth: 120,
  8317. },
  8318. },
  8319. ]);
  8320. }
  8321. };
  8322. </script>
  8323. <style lang="scss" scoped>
  8324. .fillWeekDialogVisiCustom {
  8325. width: 100%;
  8326. height: 70vh;
  8327. }
  8328. .fillWeekCustom {
  8329. .el-dialog__body {
  8330. padding: 20px 20px !important;
  8331. }
  8332. }
  8333. .photos {
  8334. position: relative;
  8335. display: flex;
  8336. flex-wrap: wrap;
  8337. }
  8338. .photos_img {
  8339. width: 120px;
  8340. height: 120px;
  8341. margin-right: 20px;
  8342. margin-bottom: 20px;
  8343. cursor: pointer;
  8344. img {
  8345. width: 100%;
  8346. height: 100%;
  8347. }
  8348. }
  8349. .paginatis {
  8350. padding: 10px 10px;
  8351. background: #f2f2f2;
  8352. }
  8353. .waiting {
  8354. color:orange;
  8355. }
  8356. .filledReportStyle {
  8357. color:#32CD32;
  8358. }
  8359. .RejectStyle {
  8360. color:red;
  8361. }
  8362. .waitSubmitStyle{
  8363. color: #409eff;
  8364. }
  8365. .chooseDate {
  8366. .waiting {
  8367. color: #20a0ff;
  8368. }
  8369. .filledReportStyle {
  8370. color:#20a0ff;
  8371. }
  8372. .RejectStyle {
  8373. color: #20a0ff;
  8374. }
  8375. .waitSubmitStyle{
  8376. color: #20a0ff;
  8377. }
  8378. }
  8379. .allDaily {
  8380. width:100%;
  8381. }
  8382. .report_title {
  8383. padding:10px 0;
  8384. color:#666;
  8385. }
  8386. .clearfix {
  8387. overflow-x: auto;
  8388. white-space: nowrap;
  8389. padding: 15px 0 10px 0;
  8390. // overflow-y: hidden;
  8391. .date_item {
  8392. padding: 0 3px;
  8393. cursor: pointer;
  8394. position: relative;
  8395. }
  8396. .chooseDate {
  8397. position: absolute;
  8398. bottom: -3px;
  8399. width: 37px;
  8400. height: 2px;
  8401. left: 14px;
  8402. background: #20a0ff;
  8403. }
  8404. }
  8405. .one_daily {
  8406. i {
  8407. color: #9ed0ff;
  8408. margin-right: 5px;
  8409. }
  8410. .one_daily_body {
  8411. padding: 10px 0px;
  8412. p {
  8413. margin: 0;
  8414. line-height: 30px;
  8415. }
  8416. }
  8417. ul {
  8418. padding: 0;
  8419. }
  8420. }
  8421. .checkbtn {
  8422. float: right;
  8423. margin-top: -10px;
  8424. }
  8425. .selConStyle{
  8426. margin-top:9rem;
  8427. margin-bottom:11rem;
  8428. .selConStyle_title{
  8429. height: 3rem;
  8430. text-align: center;
  8431. font-size: 17px;
  8432. }
  8433. .el-select{
  8434. margin: 0 15%;
  8435. width: 70%;
  8436. }
  8437. }
  8438. </style>
  8439. <style lang="scss">
  8440. /*去除upload组件过渡效果*/
  8441. .photos .el-upload-list__item {
  8442. transition: none !important;
  8443. }
  8444. .daily {
  8445. .el-card__body {
  8446. height: 80%;
  8447. overflow-y: auto;
  8448. }
  8449. .el-card__header {
  8450. padding: 0 20px;
  8451. }
  8452. }
  8453. .membListClass{
  8454. .el-dialog__body{
  8455. padding-top: 10px;
  8456. }
  8457. }
  8458. // .editReportDialog .el-dialog__footer{
  8459. // position: sticky;
  8460. // bottom: 0;
  8461. // background: #fff;
  8462. // height: 70px;
  8463. // z-index: 1010;
  8464. // }
  8465. .editReportDialog{
  8466. min-width: 800px;
  8467. }
  8468. .touruxiangmu{
  8469. max-width: 1000px;
  8470. }
  8471. </style>
  8472. <style scoped>
  8473. /* 项目标签的样式 */
  8474. .el-tag + .el-tag {
  8475. margin-left: 10px;
  8476. }
  8477. .button-new-tag {
  8478. margin-left: 10px;
  8479. height: 32px;
  8480. line-height: 30px;
  8481. padding-top: 0;
  8482. padding-bottom: 0;
  8483. }
  8484. .input-new-tag {
  8485. width: 90px;
  8486. margin-left: 10px;
  8487. vertical-align: bottom;
  8488. }
  8489. .selectworktime .el-table__fixed-body-wrapper{
  8490. top: 48px !important;
  8491. }
  8492. .selectworktime_export .selectworktime_export_l{
  8493. width: 650px;
  8494. float: left;
  8495. height: 42px;
  8496. }
  8497. .approvalProcessBox{
  8498. margin-left: 30px;
  8499. font-size: 14px;
  8500. line-height: 16px;
  8501. cursor: pointer;
  8502. }
  8503. .approvalProcessBox i {
  8504. margin-right: 0;
  8505. height: 16px;
  8506. width: 16px;
  8507. display: inline-block;
  8508. transform: scale(1.2);
  8509. position: relative;
  8510. top: 0.5px;
  8511. color: #409eff;
  8512. }
  8513. .approvalProcessBox .approvalProcessClick{
  8514. cursor: pointer;
  8515. color: #409eff;
  8516. font-size: 14px;
  8517. }
  8518. .approvalProcessBox:hover .approvalProcessClick{
  8519. color: #3485fb;
  8520. }
  8521. </style>
  8522. <style lang="scss" scoped>
  8523. // 加班样式
  8524. .overtime {
  8525. display: inline-block;
  8526. margin-left: 20px;
  8527. input {
  8528. display: inline-block;
  8529. margin-top: 5px;
  8530. }
  8531. }
  8532. .plus {
  8533. display: inline-block;
  8534. }
  8535. // .tages {
  8536. // float: right;
  8537. // }
  8538. .overtime {
  8539. display: inline-block;
  8540. margin-left: 30px;
  8541. }
  8542. .bloks {
  8543. display: inline-block;
  8544. width: 380px;
  8545. }
  8546. .zhiss {
  8547. display: flex;
  8548. justify-content: space-around;
  8549. align-items: center;
  8550. }
  8551. .zhoFel {
  8552. display: flex;
  8553. justify-content: space-between;
  8554. align-items: center;
  8555. }
  8556. // 左右滑动样式
  8557. .line {
  8558. width: 30px;
  8559. /* height: 500px; */
  8560. background: #f2f2f2;
  8561. cursor: w-resize;
  8562. }
  8563. .box-father {
  8564. border: 8px solid #000;
  8565. }
  8566. .line-second {
  8567. width: 10px;
  8568. /* background: red; */
  8569. }
  8570. .flex {
  8571. display: flex;
  8572. width: 100%;
  8573. }
  8574. .box-left {
  8575. flex: 0 0 400px;
  8576. /* height: 600px; */
  8577. /* background: blue; */
  8578. }
  8579. .box-right {
  8580. /* height: 600px; */
  8581. /* background: green; */
  8582. flex: 1;
  8583. }
  8584. .box-postion {
  8585. width: 200px;
  8586. /* height: 400px; */
  8587. background: #ccc;
  8588. }
  8589. .custom-tree-node {
  8590. flex: 1;
  8591. display: flex;
  8592. align-items: center;
  8593. justify-content: space-between;
  8594. font-size: 14px;
  8595. padding-right: 8px;
  8596. }
  8597. .daitianrbao {
  8598. width: 100%;
  8599. box-sizing: border-box;
  8600. height: 40px;
  8601. border-radius: 4px;
  8602. border: 1px solid #DCDFE6;
  8603. overflow: hidden;
  8604. text-overflow: ellipsis;
  8605. display: flex;
  8606. // align-items: center;
  8607. }
  8608. .daitianrbao .spnn {
  8609. display: inline-block;
  8610. box-sizing: border-box;
  8611. padding: 0 15px;
  8612. overflow: hidden;
  8613. text-overflow: ellipsis;
  8614. }
  8615. .daitianrbao .hover {
  8616. color: #DCDFE6 !important;
  8617. }
  8618. </style>