daily.vue 518 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746
  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;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree class="el-tree-resetStyles" :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <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'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{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)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="font-size:13px" class="themeFontColor">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <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">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <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')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <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')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <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')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <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>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <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>
  178. <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>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <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> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <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>
  257. <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"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <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"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <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"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <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>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <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>
  275. </p>
  276. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time.toFixed(1)}}h
  305. <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>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <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>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <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>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <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>
  405. <!-- AI智能填报 -->
  406. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  407. </el-form-item>
  408. <!--考勤时长显示-->
  409. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
  410. <template v-if="user.companyId != 7536">
  411. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  412. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  413. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  414. </span>
  415. </template>
  416. <template v-if="user.companyId == 7536 && workForm.time">
  417. {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  418. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  419. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  420. </template>
  421. <!--批量填报不显示考勤记录-->
  422. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  423. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  424. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  425. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  426. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  427. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  428. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  429. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  430. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  431. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  432. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  433. @click="refreshAttendance(workForm.createDate)"></el-button>
  434. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  435. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  436. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  437. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  438. v-if="!isBatch && user.companyId === 7536" icon="el-icon-refresh"
  439. @click="refreshBeiSengAttendanceTwo(workForm.createDate)"></el-button>
  440. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  441. </el-form-item>
  442. <!-- 000000 -->
  443. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  444. <div v-if="reportTimeType.multiWorktime==0">
  445. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  446. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  447. <el-select v-model="domain.timeType" style="width:200px;"
  448. v-if="reportTimeType.type == 0"
  449. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  450. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  451. @change="onTimeTypeChange(domain.timeType)">
  452. <el-option
  453. v-for="item in timeType"
  454. :key="item.value"
  455. :label="item.label"
  456. :value="item.value">
  457. </el-option>
  458. </el-select>
  459. <!-- 数字时长选择 -->
  460. <el-select v-model="domain.workingTime" style="width:200px;"
  461. v-if="reportTimeType.type == 1"
  462. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  463. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  464. @change="seleChn(0,domain)">
  465. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  466. </el-select>
  467. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  468. <span v-if="reportTimeType.type == 2">
  469. <!--时间范围选择 -->
  470. <el-time-picker
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  472. v-model="domain.startTime"
  473. :placeholder="$t('time.startTime')"
  474. style="width:120px;"
  475. format="HH:mm"
  476. value-format="HH:mm"
  477. :picker-options="{
  478. start: '08:00',
  479. end: '23:30'
  480. }"
  481. @change="iptChang()">
  482. </el-time-picker> - <el-time-picker
  483. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  484. v-model="domain.endTime"
  485. :placeholder="$t('time.endTime')"
  486. style="width:120px;"
  487. format="HH:mm"
  488. value-format="HH:mm"
  489. :picker-options="{
  490. start: '08:00',
  491. end: '23:30',
  492. minTime: domain.startTime
  493. }"
  494. @change="iptChang()">
  495. </el-time-picker>
  496. </span>
  497. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  498. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  499. <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>
  500. </div>
  501. </el-form-item>
  502. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  503. :prop="'domains.' + index + '.reportTargetDeptId'"
  504. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  505. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  506. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  507. <span style="float: left">
  508. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  509. </span>
  510. </el-option>
  511. </el-select>
  512. <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>
  513. </el-form-item>
  514. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  515. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  516. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  517. @change="selectProject(domain, index)"
  518. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  519. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  520. <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">
  521. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  522. <span style="float: right;">{{ item.projectName }}</span>
  523. </el-option>
  524. </el-option-group>
  525. </el-select>
  526. <!--昱众不显示子项目-->
  527. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  528. <span style="margin-left:45px;">
  529. {{$t('lable.subproject')}}</span>
  530. <!--子项目 -->
  531. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  533. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  534. </el-select>
  535. </template>
  536. <template v-if="user.companyId == yuzhongCompId">
  537. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  538. <!--角色选择 -->
  539. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  540. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  541. <el-option
  542. v-for="item in roleList"
  543. :key="item.value"
  544. :label="item.label"
  545. :value="item.value">
  546. </el-option>
  547. </el-select>
  548. </template>
  549. <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%;"
  550. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  551. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  552. </el-link>
  553. <!-- <el-link type="primary" v-if="canEdit"
  554. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  555. </el-form-item>
  556. <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">
  557. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  558. </el-form-item>
  559. <!--如果设置了工时成本预警的预算成本项-->
  560. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  561. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  562. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  563. </el-select>
  564. </el-form-item>
  565. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  566. <template slot="label">
  567. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  568. <span >{{$t('lable.taskGrouping')}}</span>
  569. </template>
  570. <!-- 任务分组 -->
  571. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  572. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  573. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  574. </el-select>
  575. <template v-if="user.companyId == yuzhongCompId">
  576. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  577. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  578. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  579. <el-option
  580. v-for="item in domain.filteredRespList"
  581. :key="item.id"
  582. :label="item.jobRespon"
  583. :value="item.id">
  584. </el-option>
  585. </el-select>
  586. </template>
  587. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  588. <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>
  589. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  590. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  591. @change="changeStages(domain, index)"
  592. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  593. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  594. </el-select>
  595. </template>
  596. </el-form-item>
  597. <!-- 工单号,行号 -->
  598. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  599. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  600. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  601. </el-option>
  602. </el-select>
  603. </el-form-item>
  604. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  605. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  606. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  607. </el-option>
  608. </el-select>
  609. </el-form-item>
  610. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  611. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  612. <template slot="label">
  613. <span style="color:#FF0000;">*</span>
  614. <span >{{$t('other.projectAuditor')}}</span>
  615. </template>
  616. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  617. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  618. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  619. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  620. </el-option>
  621. </el-select>
  622. <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>
  623. </el-form-item>
  624. </div>
  625. <el-form-item v-if="user.companyId == yuzhongCompId">
  626. <template slot="label">
  627. <span style="color:#FF0000;">*</span>
  628. <span >{{ $t('gongZuoNeiRong') }}</span>
  629. </template>
  630. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  631. :disabled="(workForm.domains[index].state>=2?false:true)" >
  632. <el-option
  633. v-for="item in domain.workContentList"
  634. :key="item.id"
  635. :label="item.workContext"
  636. :value="item.id">
  637. </el-option>
  638. </el-select>
  639. </el-form-item>
  640. <!-- 111111 -->
  641. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  642. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  643. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  644. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  645. <span v-else>{{item.name}}</span>
  646. </el-option>
  647. </el-select>
  648. <template v-if="user.timeType.auditLevel > 1">
  649. <i class="el-icon-right"></i>
  650. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  651. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  652. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  653. <span v-else>{{item.name}}</span>
  654. </el-option>
  655. </el-select>
  656. </template>
  657. <template v-if="user.timeType.auditLevel > 2">
  658. <i class="el-icon-right"></i>
  659. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  660. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  661. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  662. <span v-else>{{item.name}}</span>
  663. </el-option>
  664. </el-select>
  665. </template>
  666. </el-form-item>
  667. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  668. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  669. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  670. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  671. <span v-else>{{item.name}}</span>
  672. </el-option>
  673. </el-select>
  674. </el-form-item>
  675. <!-- 相关维度/自定义维度 -->
  676. <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'">
  677. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  678. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  679. </el-option>
  680. </el-select>
  681. </el-form-item>
  682. <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'">
  683. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  684. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  685. </el-option>
  686. </el-select>
  687. </el-form-item>
  688. <!-- 相关数值 -->
  689. <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">
  690. <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>
  691. </el-form-item>
  692. <!-- 自定义文本 -->
  693. <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">
  694. <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>
  695. </el-form-item>
  696. <!--按比例填报-->
  697. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  698. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  699. <div style="width:400px;">
  700. <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>
  701. <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>
  702. </div>
  703. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  704. <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>
  705. </div>
  706. </el-form-item>
  707. <!--工程专业版本模式下, 各个专业的进度填报 -->
  708. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  709. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  710. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  711. <el-input size="mini" style="width:60px;" v-model="item.progress"
  712. @keyup.native="onProgressChange"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  714. </span>
  715. </el-form-item>
  716. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  717. <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))" >
  718. <template slot="label" v-if="user.timeType.taskRequired == 1">
  719. <span style="color:#FF0000;">*</span>
  720. <span >{{ $t('other.task') }}</span>
  721. </template>
  722. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  723. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  724. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  725. </el-select>
  726. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  727. </el-form-item>
  728. <!--针对依斯贝的SAP服务-->
  729. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  730. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  731. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  732. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  733. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  734. </el-select>
  735. </el-form-item>
  736. <!--工作事项-->
  737. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  738. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  739. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  740. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  741. </el-form-item>
  742. <!-- 拍照上传 -->
  743. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  744. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  745. <div class="photos">
  746. <div>
  747. <el-upload
  748. list-type="picture-card"
  749. :http-request="(file) => {return addImg(file, index)}"
  750. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  751. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  752. :file-list="domain.imgListUrl" :limit="9"
  753. :disabled="workForm.domains[index].state>=2?false:true">
  754. <i class="el-icon-plus"></i>
  755. </el-upload>
  756. </div>
  757. </div>
  758. </el-form-item>
  759. </div>
  760. <!--多个工作事项填报的情况 -->
  761. <div v-if="reportTimeType.multiWorktime==1">
  762. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  763. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  764. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  765. @change="selectProject(domain, index)"
  766. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  767. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  768. <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">
  769. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  770. <span style="float: right;">{{ item.projectName }}</span>
  771. </el-option>
  772. </el-option-group>
  773. </el-select>
  774. <template v-if="user.timeType.mainProjectState != 1">
  775. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  776. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  777. <!--子项目 -->
  778. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  779. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  780. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  781. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  782. </el-select>
  783. </template>
  784. <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;"
  785. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  786. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  787. </el-link>
  788. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  789. <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>
  790. </div>
  791. <!-- <el-link type="primary" v-if="canEdit"
  792. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  793. </el-form-item>
  794. <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">
  795. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  796. </el-form-item>
  797. <!--如果设置了工时成本预警的预算成本项-->
  798. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  799. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  800. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  801. </el-select>
  802. </el-form-item>
  803. <el-form-item v-if="user.company.packageProject == 1">
  804. <template slot="label">
  805. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  806. <span >{{$t('lable.taskGrouping')}}</span>
  807. </template>
  808. <!-- 任务分组 -->
  809. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  810. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  811. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  812. </el-select>
  813. <!-- 项目的阶段 -->
  814. <span v-if="domain.stages != null && domain.stages.length> 0"
  815. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  816. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  817. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  818. @change="changeStages(domain, index)"
  819. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  820. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  821. </el-select>
  822. </el-form-item>
  823. <el-form-item :label="$t('other.projectAuditor')" >
  824. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  825. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  826. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  827. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  828. </el-option>
  829. </el-select>
  830. <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>
  831. </el-form-item>
  832. <!--工程专业版本模式下, 各个专业的进度填报 -->
  833. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  834. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  835. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  836. <el-input size="mini" style="width:60px;" v-model="item.progress"
  837. @keyup.native="onProgressChange"
  838. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  839. </span>
  840. </el-form-item>
  841. <!-- 相关维度 -->
  842. <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'">
  843. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  844. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  845. </el-option>
  846. </el-select>
  847. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  848. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  849. </el-option>
  850. </el-select>
  851. </el-form-item>
  852. <!-- 相关数值 -->
  853. <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">
  854. <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>
  855. </el-form-item>
  856. <!-- 自定义文本 -->
  857. <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">
  858. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  859. </el-form-item>
  860. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  861. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  862. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  863. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  864. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  865. </el-select>
  866. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  867. </el-form-item>
  868. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  869. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  870. <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>
  871. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  872. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  873. <span v-if="reportTimeType.type == 2">
  874. <!-- <span> -->
  875. <!--时间范围选择 -->
  876. <el-time-picker
  877. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  878. v-model="timeItem.startTime"
  879. :placeholder="$t('time.startTime')"
  880. style="width:120px;"
  881. format="HH:mm"
  882. value-format="HH:mm"
  883. :picker-options="{
  884. start: '00:00',
  885. end: '23:59',
  886. }"
  887. @change="iptChangs()">
  888. </el-time-picker> - <el-time-picker
  889. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  890. v-model="timeItem.endTime"
  891. :placeholder="$t('time.endTime')"
  892. style="width:120px;"
  893. format="HH:mm"
  894. value-format="HH:mm"
  895. :picker-options="{
  896. start: '00:00',
  897. end: '23:59',
  898. minTime: timeItem.startTime
  899. }"
  900. @change="iptChangs()">
  901. </el-time-picker>
  902. </span>
  903. <!--工作细项-->
  904. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  905. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  906. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  907. </el-select>
  908. </el-form-item>
  909. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  910. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  911. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  912. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  913. ></el-input>
  914. </el-form-item>
  915. </div>
  916. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  917. </div>
  918. <!--照片的显示 -->
  919. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  920. <el-image v-for="(pic, index) in domain.pics" :key="index"
  921. style="width: 100px; height: 100px; margin-right:10px;"
  922. :src="pic"
  923. :preview-src-list="domain.pics">
  924. </el-image>
  925. </p>
  926. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  927. </div>
  928. <span id="workFormsItemBottom"></span>
  929. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  930. </el-form>
  931. </div>
  932. <span slot="footer" class="dialog-footer">
  933. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  934. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  935. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  936. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  937. <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>
  938. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  939. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  940. </span>
  941. </el-dialog>
  942. <!-- 按周填报 -->
  943. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  944. <!-- 按周填报-已填工时-点击 -->
  945. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  946. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  947. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  948. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  949. <el-table-column prop="state" :label="$t('state.states')">
  950. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  951. </el-table-column>
  952. </el-table>
  953. <span slot="footer" class="dialog-footer">
  954. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  955. </span>
  956. </el-dialog>
  957. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  958. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  959. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  960. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  961. <span class="spnn" v-if="workForm.userNames">
  962. <span v-for="(item, index) in workForm.userNames" :key="index">
  963. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  964. <span v-if="index < workForm.userNames.length - 1">,</span>
  965. </span>
  966. </span>
  967. <span class="spnn hover" v-else>
  968. {{$t('defaultText.pleaseSelectAsubstitute')}}
  969. </span>
  970. </div>
  971. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  972. </div>
  973. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  974. <el-form-item style="height:30px;margin-top:-72px;">
  975. <!-- <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> -->
  976. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  977. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  978. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  979. <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>
  980. <el-option
  981. v-for="item in fillProjectList"
  982. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  983. :key="item.id"
  984. :label="item.projectName + '\u3000' + item.projectCode"
  985. :value="item.id">
  986. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  987. <span style="float: right">{{ item.projectName }}</span>
  988. </el-option>
  989. </el-select>
  990. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  991. </el-form-item>
  992. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  993. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  994. <template slot-scope="scope">
  995. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  996. </template>
  997. </el-table-column>
  998. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  999. <template slot-scope="scope">
  1000. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  1001. <p v-else></p>
  1002. </template>
  1003. </el-table-column> -->
  1004. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  1005. <template slot-scope="scope">
  1006. <div v-if="scope.row.canFill == 1">
  1007. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  1008. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  1009. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
  1010. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1011. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1012. </div>
  1013. </template>
  1014. <template v-else>
  1015. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1016. <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>
  1017. <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>
  1018. <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>
  1019. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1020. </div>
  1021. </template>
  1022. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1023. <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>
  1024. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1025. </div>
  1026. </div>
  1027. <div v-else >
  1028. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1029. </div>
  1030. </template>
  1031. </el-table-column>
  1032. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1033. <template slot-scope="scope">
  1034. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1035. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1036. </span>
  1037. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1038. </template>
  1039. </el-table-column>
  1040. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1041. <template slot-scope="scope">
  1042. <div class="zhiss">
  1043. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1044. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1045. </div>
  1046. </template>
  1047. </el-table-column>
  1048. </el-table>
  1049. </el-form>
  1050. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1051. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1052. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1053. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1054. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1055. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1056. <!--针对景昱,先检查工时是否存在异常-->
  1057. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1058. </span>
  1059. </el-dialog>
  1060. <!-- 重庆物奇私人定制的按周填报 -->
  1061. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1062. <div class="fillWeekDialogVisiCustom">
  1063. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1064. </div>
  1065. </el-dialog>
  1066. <!-- enableNewWeeklyfill==2 -->
  1067. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1068. <div class="fillWeekDialogVisiCustom">
  1069. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1070. </div>
  1071. </el-dialog>
  1072. <!-- 选择时间 -->
  1073. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1074. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1075. <span slot="footer" class="dialog-footer">
  1076. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1077. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1078. </span>
  1079. </el-dialog>
  1080. <!-- 按周填报弹窗 -->
  1081. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1082. <div>
  1083. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1084. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1085. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1086. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1087. </el-select>
  1088. </div>
  1089. <!--如果设置了工时成本预警的预算成本项-->
  1090. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1091. <p>{{$t('lable.budgetSource')}}</p>
  1092. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1093. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1094. </el-select>
  1095. </div>
  1096. <!-- 任务分组 -->
  1097. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1098. <p>{{$t('lable.taskGrouping')}}</p>
  1099. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1100. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1101. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1102. </el-select>
  1103. </div>
  1104. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1105. <p>{{$t('other.inputStage')}}</p>
  1106. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1107. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1108. </el-select>
  1109. </div>
  1110. <!-- 工单号,行号 -->
  1111. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1112. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1113. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1114. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1115. </el-option>
  1116. </el-select>
  1117. </div>
  1118. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1119. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1120. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1121. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1122. </el-option>
  1123. </el-select>
  1124. </div>
  1125. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1126. <p>{{$t('other.reviewer')}}</p>
  1127. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1128. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1129. </el-select>
  1130. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1131. </div>
  1132. <template v-if="user.timeType.reportAuditType == 3">
  1133. <div class="zhoFel">
  1134. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1135. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1136. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1137. </el-select>
  1138. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1139. </div>
  1140. <div class="zhoFel">
  1141. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1142. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1143. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1144. </el-select>
  1145. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1146. </div>
  1147. <div class="zhoFel">
  1148. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1149. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1150. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1151. </el-select>
  1152. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1153. </div>
  1154. <div class="zhoFel">
  1155. <p>{{ $t('chao-song-ren') }}</p>
  1156. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1157. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1158. </el-select>
  1159. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1160. </div>
  1161. </template>
  1162. <!-- 自定义维度 -->
  1163. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1164. <p>{{user.timeType.customDegreeName}}</p>
  1165. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1166. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1167. </el-select>
  1168. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1169. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1170. </el-select>
  1171. </div>
  1172. <!-- 自定义数值 -->
  1173. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1174. <p>{{user.timeType.customDataName}}</p>
  1175. <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>
  1176. </div>
  1177. <!-- 自定义文本 -->
  1178. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1179. <p>{{user.timeType.customTextName}}</p>
  1180. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1181. </div>
  1182. <!-- 选择任务 -->
  1183. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1184. <p>{{ $t('renWuLiChengBei') }}</p>
  1185. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1186. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1187. </el-select>
  1188. </div>
  1189. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1190. <p>{{$t('other.timeSelection')}}</p>
  1191. <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>
  1192. </div>
  1193. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1194. <p>{{$t('other.chooseDuration')}}</p>
  1195. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1196. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1197. </el-select>
  1198. </div>
  1199. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1200. <p>{{$t('lable.percentageOfTime')}}</p>
  1201. <div style="width:400px;display: flex;align-items: center;">
  1202. <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>
  1203. <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>
  1204. </div>
  1205. </div>
  1206. <div class="zhoFel">
  1207. <p>{{$t('other.workMatters')}}</p>
  1208. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1209. </div>
  1210. </div>
  1211. <span slot="footer" class="dialog-footer">
  1212. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1213. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1214. </span>
  1215. </el-dialog>
  1216. <!--导出报表条件选择 -->
  1217. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1218. <el-form ref="form3" :model="exportParam" >
  1219. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1220. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1221. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1222. </el-select>
  1223. </el-form-item>
  1224. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1225. <!-- <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>
  1226. <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> -->
  1227. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1228. </el-form-item>
  1229. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1230. <el-date-picker
  1231. v-model="exportParam.dateRange" :editable="false"
  1232. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1233. :range-separator="$t('other.to')"
  1234. type="daterange"
  1235. :start-placeholder="$t('time.startDate')"
  1236. :end-placeholder="$t('time.endDate')"
  1237. ></el-date-picker>
  1238. </el-form-item>
  1239. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1240. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1241. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1242. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1243. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1244. </el-select>
  1245. </el-form-item>
  1246. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1247. <div class="exportReportRadio">
  1248. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1249. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1250. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1251. <i class="el-icon-question"></i>
  1252. </el-tooltip>
  1253. </div>
  1254. </el-form-item>
  1255. </el-form>
  1256. <div slot="footer" class="dialog-footer">
  1257. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1258. </div>
  1259. </el-dialog>
  1260. <!--导出报表条件选择 -->
  1261. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1262. <el-form ref="form3" :model="exportParam" >
  1263. <el-form-item prop="range" :label="$t('time.dateRange')">
  1264. <el-date-picker
  1265. v-model="exportParam.dateRange" :editable="false"
  1266. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1267. :clearable="true"
  1268. :range-separator="$t('other.to')"
  1269. type="daterange"
  1270. :start-placeholder="$t('time.startDate')"
  1271. :end-placeholder="$t('time.endDate')"
  1272. ></el-date-picker>
  1273. </el-form-item>
  1274. </el-form>
  1275. <div slot="footer" class="dialog-footer">
  1276. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1277. </div>
  1278. </el-dialog>
  1279. <!--人员列表 -->
  1280. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1281. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1282. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1283. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1284. <el-table-column type="selection"></el-table-column>
  1285. <el-table-column prop="label" :label="$t('lable.name')" >
  1286. <template slot-scope="scope">
  1287. <span>
  1288. <!-- {{(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}} -->
  1289. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1290. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1291. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1292. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1293. </span>
  1294. <span v-else>
  1295. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1296. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1297. </span>
  1298. </span>
  1299. </template>
  1300. </el-table-column>
  1301. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1302. <template slot-scope="scope">
  1303. <div>
  1304. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1305. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1306. </div>
  1307. </template>
  1308. </el-table-column>
  1309. </el-table>
  1310. </el-tab-pane>
  1311. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1312. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1313. <el-table-column prop="label" :label="$t('lable.name')" >
  1314. <template slot-scope="scope">
  1315. <!-- <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> -->
  1316. <!-- <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> -->
  1317. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1318. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1319. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1320. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1321. </span>
  1322. <span v-else>
  1323. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1324. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1325. </span>
  1326. </template>
  1327. </el-table-column>
  1328. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1329. <template slot-scope="scope">
  1330. <div>
  1331. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1332. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1333. </div>
  1334. </template>
  1335. </el-table-column>
  1336. </el-table>
  1337. </el-tab-pane>
  1338. </el-tabs>
  1339. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1340. <el-table-column type="selection"></el-table-column>
  1341. <el-table-column prop="label" :label="$t('lable.name')" >
  1342. <template slot-scope="scope">
  1343. <div>
  1344. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1345. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1346. </div>
  1347. </template>
  1348. </el-table-column>
  1349. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1350. <template slot-scope="scope">
  1351. <div>
  1352. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1353. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1354. </div>
  1355. </template>
  1356. </el-table-column>
  1357. </el-table>
  1358. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1359. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1360. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1361. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1362. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1363. </div>
  1364. </el-dialog>
  1365. <!-- 日报审核修改 -->
  1366. <el-dialog
  1367. :title="$t('riBaoShenHeXiuGai')"
  1368. :visible.sync="reportLogCheckDialog"
  1369. width="30%"
  1370. :before-close="handleClose">
  1371. <el-form ref="form3" :model="exportReportLogParam" >
  1372. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1373. <el-date-picker
  1374. v-model="exportReportLogParam.dateRange" :editable="false"
  1375. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1376. :range-separator="$t('other.to')"
  1377. type="daterange"
  1378. :start-placeholder="$t('time.startDate')"
  1379. :end-placeholder="$t('time.endDate')"
  1380. ></el-date-picker>
  1381. </el-form-item>
  1382. </el-form>
  1383. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1384. <br>
  1385. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1386. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1387. <span slot="footer" class="dialog-footer">
  1388. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1389. </span>
  1390. </el-dialog>
  1391. <!-- 按部门选择人员 -->
  1392. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1393. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1394. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1395. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1396. </el-input>
  1397. <div class="tree" style="height:400px">
  1398. <el-scrollbar style="height:100%">
  1399. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1400. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1401. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1402. <span class="custom-tree-node" slot-scope="{ node }">
  1403. <span v-if="user.userNameNeedTranslate == '1'">
  1404. <span v-if="node.data.children">
  1405. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1406. </span>
  1407. <span v-else>
  1408. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1409. </span>
  1410. </span>
  1411. <span v-if="user.userNameNeedTranslate != '1'">
  1412. {{ node.label }}
  1413. </span>
  1414. <!-- {{ node.label }} -->
  1415. </span>
  1416. </el-tree>
  1417. </el-scrollbar>
  1418. </div>
  1419. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1420. <div slot="footer" class="dialog-footer">
  1421. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1422. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1423. </div>
  1424. </el-dialog>
  1425. <el-dialog
  1426. v-if="monthWorkTimeDialog"
  1427. :visible.sync="monthWorkTimeDialog"
  1428. :close-on-click-modal="false"
  1429. customClass="customWidth selectworktime"
  1430. width="92%"
  1431. top="60px"
  1432. >
  1433. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1434. <el-tabs v-model="activeName" @tab-click="handleClick">
  1435. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1436. <div class="selectworktime_export" style="margin-top:10px;">
  1437. <div class="selectworktime_export_l">
  1438. <el-date-picker
  1439. class="selecteworktime_datapick"
  1440. v-model="WorktimeDatepickValue"
  1441. value-format="yyyy-MM-dd"
  1442. type="daterange"
  1443. align="right"
  1444. unlink-panels
  1445. :range-separator="$t('other.to')"
  1446. :start-placeholder="$t('time.startDate')"
  1447. :end-placeholder="$t('time.endDate')"
  1448. :default-time="['12:00:00', '12:00:00']"
  1449. size="small"
  1450. popper-class="selecteorktime_datapick_popper"
  1451. @change="showMonthWorkTime()"
  1452. >
  1453. </el-date-picker>
  1454. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1455. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1456. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1457. <!-- 222 -->
  1458. </div>
  1459. <div>
  1460. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1461. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1462. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1463. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1464. </el-input>
  1465. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1466. </div>
  1467. <div style="float: left; height:32px; padding-top:10px;">
  1468. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1469. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1470. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1471. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1472. </div>
  1473. <div style="float: right; vertical-align: middle;height:32px">
  1474. <el-link
  1475. type="primary"
  1476. @click="exportMembWorkHours()"
  1477. >{{$t('export.exportData')}}</el-link
  1478. >
  1479. </div>
  1480. </div>
  1481. <el-table ref="hasworkTbl"
  1482. :data="monthWorkDataS"
  1483. v-el-table-infinite-scroll="listScroll"
  1484. border
  1485. :height="'70vh'"
  1486. highlight-current-row
  1487. style="width: 100%"
  1488. v-loading="tbload"
  1489. :lazy="true"
  1490. :cell-style="hasworkTblCellStyle"
  1491. >
  1492. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1493. <template slot-scope="scope">
  1494. {{ scope.$index + 1 }}
  1495. </template>
  1496. </el-table-column>
  1497. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1498. <template slot-scope="scope">
  1499. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1500. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1501. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1502. <!-- {{scope.row.name}} -->
  1503. </span>
  1504. </template>
  1505. </el-table-column>
  1506. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1507. <template slot-scope="scope">
  1508. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1509. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1510. </template>
  1511. </el-table-column>
  1512. <el-table-column
  1513. min-width="60"
  1514. v-for="(item, index) in pickDateArray"
  1515. :key="index"
  1516. :label="item"
  1517. align="center"
  1518. >
  1519. <template slot="header" slot-scope="scope">
  1520. <div>{{ scope.column.label.dateStr }}</div>
  1521. <div>{{ scope.column.label.weekStr }}</div>
  1522. </template>
  1523. <template slot-scope="scope">
  1524. <div
  1525. v-if="
  1526. scope.row.worktimeList.filter(
  1527. (w) =>
  1528. w.createDate==item.date
  1529. ).length > 0 &&
  1530. scope.row.worktimeList.filter(
  1531. (w) =>w.createDate==item.date
  1532. )[0].workingTime < reportTimeType.allday
  1533. "
  1534. >
  1535. {{
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime.toFixed(1)
  1539. }}
  1540. </div>
  1541. <div
  1542. v-if="
  1543. scope.row.worktimeList.filter(
  1544. (w) =>w.createDate==item.date
  1545. ).length > 0 &&
  1546. scope.row.worktimeList.filter(
  1547. (w) =>w.createDate==item.date
  1548. )[0].workingTime > reportTimeType.allday
  1549. "
  1550. >
  1551. {{
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime.toFixed(1)
  1555. }}
  1556. </div>
  1557. <div
  1558. v-if="
  1559. scope.row.worktimeList.filter(
  1560. (w) =>w.createDate==item.date
  1561. ).length > 0 &&
  1562. scope.row.worktimeList.filter(
  1563. (w) =>w.createDate==item.date
  1564. )[0].workingTime == reportTimeType.allday
  1565. "
  1566. >
  1567. {{
  1568. scope.row.worktimeList.filter(
  1569. (w) =>w.createDate==item.date
  1570. )[0].workingTime
  1571. }}
  1572. </div>
  1573. <div
  1574. v-if="
  1575. scope.row.worktimeList.filter(
  1576. (w) =>w.createDate==item.date
  1577. ).length == 0
  1578. "
  1579. >
  1580. 0
  1581. </div>
  1582. <div
  1583. v-if="
  1584. scope.row.worktimeList.filter(
  1585. (w) =>w.createDate==item.date
  1586. ).length > 0 &&
  1587. typeof scope.row.worktimeList.filter(
  1588. (w) =>w.createDate==item.date
  1589. )[0].workingTime == 'string'
  1590. "
  1591. >
  1592. {{
  1593. scope.row.worktimeList.filter(
  1594. (w) =>w.createDate==item.date
  1595. )[0].workingTime
  1596. }}
  1597. </div>
  1598. </template>
  1599. </el-table-column>
  1600. </el-table>
  1601. <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>
  1602. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1603. </el-tab-pane>
  1604. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1605. <div class="selectworktime_export" style="margin-top:10px">
  1606. <div class="selectworktime_export_l">
  1607. <el-date-picker
  1608. class="selecteworktime_datapick"
  1609. v-model="WorktimeDatepickValue"
  1610. value-format="yyyy-MM-dd"
  1611. type="daterange"
  1612. align="right"
  1613. unlink-panels
  1614. :range-separator="$t('other.to')"
  1615. :start-placeholder="$t('time.startDate')"
  1616. :end-placeholder="$t('time.endDate')"
  1617. :default-time="['12:00:00', '12:00:00']"
  1618. size="small"
  1619. popper-class="selecteorktime_datapick_popper"
  1620. @change="showMonthNotWorkTime()"
  1621. >
  1622. </el-date-picker>
  1623. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1624. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1625. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1626. </div>
  1627. <div>
  1628. <div style="margin-top:10px;">
  1629. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1630. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1631. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1632. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1633. </el-input>
  1634. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1635. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1636. <el-link
  1637. type="primary"
  1638. style="float: right; vertical-align: middle;height:32px"
  1639. @click="exportMembNotWorkHours()"
  1640. >{{$t('export.exportData')}}</el-link
  1641. >
  1642. </div>
  1643. </div>
  1644. </div>
  1645. <el-table
  1646. ref="hasworkTbl2"
  1647. :data="monthNotWorkDateS"
  1648. v-el-table-infinite-scroll="notListScroll"
  1649. border
  1650. :height="'70vh'"
  1651. highlight-current-row
  1652. style="width: 100%"
  1653. v-loading="tbload"
  1654. lazy
  1655. >
  1656. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1657. <template slot-scope="scope">
  1658. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1659. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1663. <template slot-scope="scope">
  1664. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1665. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1666. </template>
  1667. </el-table-column>
  1668. <el-table-column
  1669. min-width="200"
  1670. :label="$t('weekDay.date')"
  1671. align="center"
  1672. prop="createDate"
  1673. >
  1674. </el-table-column>
  1675. <el-table-column
  1676. min-width="200"
  1677. :label="$t('state.states')"
  1678. align="center"
  1679. prop="status"
  1680. />
  1681. <el-table-column
  1682. min-width="200"
  1683. :label="$t('other.attendanceData')"
  1684. prop="cardTime"
  1685. align="center"
  1686. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1687. </el-table>
  1688. <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>
  1689. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1690. </el-tab-pane>
  1691. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="(user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1) && user.companyId!=5978">
  1692. <div class="selectworktime_export" style="margin-top:10px">
  1693. <div class="selectworktime_export_l">
  1694. <el-date-picker
  1695. class="selecteworktime_datapick"
  1696. v-model="notfullSelectDateMonth"
  1697. value-format="yyyy-MM"
  1698. type="month"
  1699. align="right"
  1700. unlink-panels
  1701. size="small"
  1702. popper-class="selecteorktime_datapick_popper"
  1703. @change="showReportTimeLessThanCardTimeList()"
  1704. >
  1705. </el-date-picker>
  1706. </div>
  1707. <div>
  1708. <div style="margin-top:10px;">
  1709. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showReportTimeLessThanCardTimeList()"></el-cascader>
  1710. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1711. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1712. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1713. </el-input>
  1714. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1715. <div style="float: right; vertical-align: middle;height:32px">
  1716. <el-link
  1717. type="primary" v-loading="remindering"
  1718. @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
  1719. <!-- <el-link
  1720. type="primary"
  1721. @click="exportMembWorkHoursReminder()"
  1722. >{{$t('export.exportData')}}</el-link> -->
  1723. </div>
  1724. <!-- <el-link
  1725. type="primary"
  1726. style="float: right; vertical-align: middle;height:32px"
  1727. @click="exportMembNotWorkHours()"
  1728. >{{$t('export.exportData')}}</el-link
  1729. > -->
  1730. </div>
  1731. </div>
  1732. </div>
  1733. <el-table
  1734. ref="hasworkTbl4"
  1735. :data="notFullData"
  1736. border
  1737. :height="'70vh'"
  1738. highlight-current-row
  1739. style="width: 100%"
  1740. v-loading="tbload"
  1741. lazy
  1742. >
  1743. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1744. <template slot-scope="scope">
  1745. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1746. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1747. </template>
  1748. </el-table-column>
  1749. <el-table-column
  1750. min-width="200"
  1751. :label="$t('weekDay.date')"
  1752. align="center"
  1753. prop="createDate"
  1754. >
  1755. </el-table-column>
  1756. <el-table-column
  1757. min-width="200"
  1758. :label="$t('fillReportTime')"
  1759. align="center"
  1760. prop="reportTime"
  1761. />
  1762. <el-table-column
  1763. min-width="200"
  1764. :label="$t('workAttendance')"
  1765. prop="workHours"
  1766. align="center"></el-table-column>
  1767. </el-table>
  1768. </el-tab-pane>
  1769. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1770. <div class="selectworktime_export" style="margin-top:10px;">
  1771. <div class="selectworktime_export_l">
  1772. <el-date-picker
  1773. class="selecteworktime_datapick"
  1774. v-model="WorktimeDatepickValue"
  1775. value-format="yyyy-MM-dd"
  1776. type="daterange"
  1777. align="right"
  1778. unlink-panels
  1779. :range-separator="$t('other.to')"
  1780. :start-placeholder="$t('time.startDate')"
  1781. :end-placeholder="$t('time.endDate')"
  1782. :default-time="['12:00:00', '12:00:00']"
  1783. size="small"
  1784. popper-class="selecteorktime_datapick_popper"
  1785. @change="showMonthWorkTimeReminder()"
  1786. >
  1787. </el-date-picker>
  1788. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1789. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1790. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1791. </div>
  1792. <div>
  1793. <div style="margin-top:10px;">
  1794. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1795. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1796. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1797. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1798. </el-input>
  1799. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1800. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1801. </div>
  1802. </div>
  1803. <div style="float: right; vertical-align: middle;height:32px">
  1804. <el-link
  1805. type="primary" v-loading="remindering"
  1806. @click="changeReminder()"
  1807. >{{ $t('bianGengTiXing') }}</el-link>
  1808. <el-link
  1809. type="primary"
  1810. @click="exportMembWorkHoursReminder()"
  1811. >{{$t('export.exportData')}}</el-link>
  1812. </div>
  1813. </div>
  1814. <el-table ref="hasworkTbl"
  1815. :data="monthWorkDataS"
  1816. v-el-table-infinite-scroll="listScroll"
  1817. border
  1818. :height="'70vh'"
  1819. highlight-current-row
  1820. style="width: 100%"
  1821. v-loading="tbload"
  1822. :lazy="true"
  1823. >
  1824. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1825. <template slot-scope="scope">
  1826. {{ scope.row.createDate}}
  1827. </template>
  1828. </el-table-column>
  1829. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1830. <template slot-scope="scope">
  1831. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1832. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1833. <!-- {{scope.row.name}} -->
  1834. </template>
  1835. </el-table-column>
  1836. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1837. <template slot-scope="scope">
  1838. {{scope.row.invokeValue}}
  1839. </template>
  1840. </el-table-column>
  1841. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1842. <template slot-scope="scope">
  1843. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1844. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1845. </template>
  1846. </el-table-column>
  1847. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1848. <template slot-scope="scope">
  1849. {{ scope.row.workingTime}}
  1850. </template>
  1851. </el-table-column>
  1852. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1853. <template slot-scope="scope">
  1854. {{ scope.row.cardTime}}
  1855. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1856. </template>
  1857. </el-table-column>
  1858. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1859. <template slot-scope="scope">
  1860. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1861. </template>
  1862. </el-table-column>
  1863. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1864. <template slot-scope="scope">
  1865. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1866. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1867. </template>
  1868. </el-table-column>
  1869. </el-table>
  1870. <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>
  1871. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1872. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1873. <label style="font-size: 16px">员工每日已填报工时数</label>
  1874. <el-link
  1875. type="primary"
  1876. style="float: right; margin-right: 60px"
  1877. @click="exportMembWorkHours()"
  1878. >导出已填报数据</el-link
  1879. > -->
  1880. <!-- <el-button >导出</el-button> -->
  1881. <!-- </div> -->
  1882. </el-tab-pane>
  1883. </el-tabs>
  1884. </el-dialog>
  1885. <!--驳回弹出框 -->
  1886. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1887. <div>
  1888. <span style="color:red;">*</span><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')" />
  1889. </div>
  1890. <div slot="footer" class="dialog-footer">
  1891. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1892. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1893. </div>
  1894. </el-dialog>
  1895. <!-- 通过弹出框 -->
  1896. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1897. <div>
  1898. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1899. </div>
  1900. <div slot="footer" class="dialog-footer">
  1901. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1902. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1903. </div>
  1904. </el-dialog>
  1905. <!--批量导入日报 -->
  1906. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1907. <p>1. {{$t('other.download')}}
  1908. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./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>
  1909. </p>
  1910. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1911. <p style="display: flex;justify-content: center;">
  1912. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1913. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1914. </el-upload>
  1915. </p>
  1916. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1917. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1918. </div>
  1919. </el-dialog>
  1920. <!-- 工时导入记录弹窗 -->
  1921. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1922. <div style="height: 452px">
  1923. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1924. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1925. <el-table-column prop="userName" :label="$t('other.operator')">
  1926. <template slot-scope="scope">
  1927. <div>
  1928. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1929. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1930. </div>
  1931. </template>
  1932. </el-table-column>
  1933. <el-table-column prop="datel" :label="$t('other.document')">
  1934. <template slot-scope="scope">
  1935. <div>
  1936. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1937. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1938. </div>
  1939. </template>
  1940. </el-table-column>
  1941. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1942. <template slot-scope="scope">
  1943. <div>
  1944. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1945. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1946. </div>
  1947. </template>
  1948. </el-table-column>
  1949. </el-table>
  1950. <el-col :span="24" class="paginatis">
  1951. <el-pagination
  1952. @size-change="handleSizeChange"
  1953. @current-change="handleCurrentChange"
  1954. :page-sizes="[20 , 50 , 80 , 100]"
  1955. :page-size="20"
  1956. layout="total, sizes, prev, pager, next"
  1957. :total="toViewForm.total"
  1958. style="float:right;"
  1959. ></el-pagination>
  1960. </el-col>
  1961. </div>
  1962. </el-dialog>
  1963. <!--基于企业微信考勤数据的工时导入 -->
  1964. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1965. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1966. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1967. </el-step>
  1968. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1969. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1970. </el-steps>
  1971. <div v-if="active==0" style="padding:30px;height:360px;">
  1972. <div style="margin-top:50px;margin-left:280px;">
  1973. <el-date-picker
  1974. v-model="importWxParam.date" :editable="false"
  1975. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1976. :clearable="true"
  1977. :range-separator="$t('other.to')"
  1978. type="daterange"
  1979. :start-placeholder="$t('time.startDate')"
  1980. :end-placeholder="$t('time.endDate')"
  1981. @change="loadCheckInData"
  1982. ></el-date-picker>
  1983. </div>
  1984. </div>
  1985. <div v-if="active==1" style="padding:10px;">
  1986. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1987. style="width: 100%;margin-top:5px;" >
  1988. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1989. <template slot-scope="scope">
  1990. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1991. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1992. </template>
  1993. </el-table-column>
  1994. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1995. </el-table-column>
  1996. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1997. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1998. <template slot-scope="scope">
  1999. <div>
  2000. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2001. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2002. </div>
  2003. </template>
  2004. </el-table-column>
  2005. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  2006. <template slot-scope="scope">
  2007. <div>
  2008. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  2009. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  2010. </div>
  2011. </template>
  2012. </el-table-column>
  2013. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  2014. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  2015. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  2016. <template slot-scope="scope">
  2017. {{scope.row.workHours.toFixed(1)}}h
  2018. </template>
  2019. </el-table-column>
  2020. </el-table>
  2021. </div>
  2022. <div v-if="active==2" >
  2023. <p style="display: flex;justify-content: center;height:390px;">
  2024. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2025. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2026. </el-upload>
  2027. </p>
  2028. </div>
  2029. <div slot="title">
  2030. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2031. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2032. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2033. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703 || user.companyId == 7544) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2034. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  2035. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  2036. </div>
  2037. <span slot="footer">
  2038. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2039. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2040. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2041. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2042. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2043. </span>
  2044. </el-dialog>
  2045. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2046. <p style="display: flex;justify-content: center;height:100px;">
  2047. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2048. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2049. </el-upload>
  2050. </p>
  2051. </el-dialog>
  2052. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2053. <div>
  2054. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2055. v-model="deleteReportParam.date" :editable="false"
  2056. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2057. :clearable="true"
  2058. :range-separator="$t('other.to')"
  2059. type="daterange"
  2060. :start-placeholder="$t('time.startDate')"
  2061. :end-placeholder="$t('time.endDate')"
  2062. ></el-date-picker>
  2063. </div>
  2064. <div style="margin-top:10px;">
  2065. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2066. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2067. <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>
  2068. </div>
  2069. <div style="margin-top:10px;">
  2070. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2071. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2072. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2073. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2074. <span v-else>{{item.name}}</span>
  2075. </el-option>
  2076. </el-select>
  2077. </div>
  2078. <span slot="footer">
  2079. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2080. </span>
  2081. </el-dialog>
  2082. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2083. <div>
  2084. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2085. v-model="deleteReportParam.date" :editable="false"
  2086. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2087. :clearable="true"
  2088. :range-separator="$t('other.to')"
  2089. type="daterange"
  2090. :start-placeholder="$t('time.startDate')"
  2091. :end-placeholder="$t('time.endDate')"
  2092. ></el-date-picker>
  2093. </div>
  2094. <div style="margin-top:15px;">
  2095. <span>{{ $t('other.selectdepartment') }}:</span>
  2096. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2097. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2098. size="small" v-if="user.userNameNeedTranslate != 1"
  2099. ></el-cascader>
  2100. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2101. </div>
  2102. <span slot="footer">
  2103. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2104. </span>
  2105. </el-dialog>
  2106. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2107. <div>
  2108. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2109. v-model="modImportTime"
  2110. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2111. :clearable="true"
  2112. type="datetime"
  2113. ></el-date-picker>
  2114. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2115. v-model="modImportUserId"
  2116. >
  2117. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2118. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2119. <span v-else>{{item.name}}</span>
  2120. </el-option>
  2121. </el-select>
  2122. </div>
  2123. <span slot="footer">
  2124. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2125. </span>
  2126. </el-dialog>
  2127. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2128. <div>
  2129. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2130. <el-date-picker
  2131. v-model="ratioYmonth" :editable="false"
  2132. format="yyyyMM" value-format="yyyyMM"
  2133. type="month"
  2134. ></el-date-picker>
  2135. </div>
  2136. <span slot="footer">
  2137. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2138. </span>
  2139. </el-dialog>
  2140. <!--工时批量代填 -->
  2141. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2142. <div>
  2143. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2144. v-model="importWxParam.date" :editable="false"
  2145. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2146. :clearable="true"
  2147. :range-separator="$t('other.to')"
  2148. type="daterange"
  2149. :start-placeholder="$t('time.startDate')"
  2150. :end-placeholder="$t('time.endDate')"
  2151. @change="loadCheckInData"
  2152. ></el-date-picker>
  2153. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2154. </div>
  2155. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2156. :key="timeStamp"
  2157. style="width: 100%;margin-top:5px;" ref="tab">
  2158. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2159. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2160. <template slot-scope="scope">
  2161. <div>
  2162. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2163. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2164. </div>
  2165. </template>
  2166. </el-table-column>
  2167. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2168. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2169. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2170. <template slot-scope="scope">
  2171. {{scope.row.workHours.toFixed(1)}}h
  2172. </template>
  2173. </el-table-column>
  2174. <!--项目名称列表 -->
  2175. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2176. <template slot-scope="scope">
  2177. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2178. </template>
  2179. </el-table-column>
  2180. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2181. <template slot-scope="scope">
  2182. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2183. </template>
  2184. </el-table-column>
  2185. </el-table>
  2186. </el-dialog>
  2187. <!--基于企业微信考勤数据的工时导入 -->
  2188. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2189. <div style="padding-bottom:10px;">
  2190. <p>{{importResultMsg}}</p>
  2191. </div>
  2192. <!-- <span slot="footer" class="dialog-footer">
  2193. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2194. </span> -->
  2195. </el-dialog>
  2196. <!-- 审核流程展示 -->
  2197. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2198. <div style="padding:20px 40px 20px 0">
  2199. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2200. <el-step title="待提交"></el-step>
  2201. <el-step title="员工提交"></el-step>
  2202. <el-step title="审核通过"></el-step>
  2203. </el-steps>
  2204. <el-divider v-if="user.companyId == 7544"></el-divider>
  2205. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2206. <el-timeline :reverse="false" style="margin-top:10px;">
  2207. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2208. <!-- {{item.msg}} -->
  2209. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2210. <span v-if="user.userNameNeedTranslate == 1">
  2211. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2212. <span>{{item.msgCon.two}}</span>
  2213. </span>
  2214. </el-timeline-item>
  2215. </el-timeline>
  2216. </div>
  2217. </el-dialog>
  2218. <!-- 威派格定制 -->
  2219. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2220. </section>
  2221. </template>
  2222. <script>
  2223. // 左右滑动
  2224. import dragMixin from "@/common/js/tensile.js";
  2225. import util from "../../common/js/util";
  2226. // 自定义select组件
  2227. import selectCat from "@/components/select.vue"
  2228. // 引入自定义级联组件
  2229. import vueCascader from "@/components/cascader.vue"
  2230. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2231. // 重庆物奇定制组件
  2232. import WeeklyCustomization from "./weeklyCustomization.vue"
  2233. // 威派格定制转移工时
  2234. import TransferWorkingHours from "./transferWorkingHours.vue"
  2235. // 新的按周填报
  2236. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2237. import { mapMutations } from 'vuex'
  2238. let _that = this
  2239. export default {
  2240. mixins: [dragMixin],
  2241. components: {
  2242. selectCat,
  2243. vueCascader,
  2244. WeeklyCustomization,
  2245. vueMultipleDept,
  2246. TransferWorkingHours,
  2247. NewWeeklyCustomization
  2248. },
  2249. data() {
  2250. return {
  2251. remindering: false,
  2252. onlyHaveAttendance: false,
  2253. notFullData:[],
  2254. notFullOriginList:[],
  2255. singleDate:1,
  2256. subFillProjectList:[],
  2257. curAuditNode: 1,
  2258. refreshingTime: false,
  2259. substitudeStep: 1,
  2260. showHidden: false,
  2261. pageIndex: 0,
  2262. hasMore: true,
  2263. exportType: 0,
  2264. exportingData: false,
  2265. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2266. jobResponseList:[],
  2267. yisibeiCompId: 3092,
  2268. yuzhongCompId: 3385,
  2269. mingyiName : '成都明夷电子科技有限公司',
  2270. // mingyiName : '明夷',
  2271. modItemDataId: null,
  2272. modImportTime: null,
  2273. modImportUserId: null,
  2274. showModImportTimeDialog: false,
  2275. showBatchSimpleApproveReport: false,
  2276. startDeleting: false,
  2277. showBatchDeleteReport: false,
  2278. deleteReportParam: {date:null, userIds:[]},
  2279. isDenying: false,
  2280. targetWeekDate: null,//填写周报中的周日期
  2281. importCardTimeVisi: false,
  2282. startRatioExporting: false,
  2283. exportUserRatio: false,
  2284. ratioYmonth:null,
  2285. hasWrittenReport: false,
  2286. today:null,
  2287. syncTimeLoading: false,
  2288. seluserText: '',
  2289. translation: '1', // 1、文字, 2、部门, 3、人员
  2290. exportLoad: false,
  2291. getPickerOptions: {
  2292. disabledDate: (time) => {
  2293. var date = new Date();
  2294. var year = date.getFullYear();
  2295. var month = date.getMonth() + 1;
  2296. if (month >= 1 && month <= 9) {
  2297. month = "0" + month;
  2298. }
  2299. var currentdate = year.toString() + month.toString();
  2300. var timeyear = time.getFullYear();
  2301. var timemonth = time.getMonth() + 1;
  2302. if (timemonth >= 1 && timemonth <= 9) {
  2303. timemonth = "0" + timemonth;
  2304. }
  2305. var timedate = timeyear.toString() + timemonth.toString();
  2306. if(this.user.timeType.fillAhead == 0){
  2307. return currentdate < timedate;
  2308. }else{
  2309. return false
  2310. }
  2311. }
  2312. },
  2313. alalal: '8.0',
  2314. timeBasecostList:null,
  2315. tbload: false,
  2316. exportTimeDialog: false,
  2317. searchKeyword: '',
  2318. monthWorkDataS: [],
  2319. monthNotWorkDateS: [],
  2320. pickDateArray:[],
  2321. WorktimeDatepickValue: [],
  2322. activeName:"first",
  2323. isLeave: 0,
  2324. submitingReport: false,
  2325. importResultMsg:null,
  2326. showImportResult:false,
  2327. importingData: false,
  2328. isDraft: 0,
  2329. timeStamp: 0,
  2330. projectColumns:[],
  2331. checkinLoading:false,
  2332. importWxParam:{date:null,},
  2333. active:0,
  2334. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2335. importWxDialog:false,
  2336. importDialog:false,
  2337. denyForm:null,
  2338. denyReasonDialog:false,
  2339. monthWorkTimeDialog: false,
  2340. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2341. isSubstitude:false,
  2342. isFill:false,
  2343. unFillList:[],
  2344. fillList:[],
  2345. fillMembList:[],
  2346. fillMembList_leave: [],
  2347. membListVisible: false,
  2348. isBatch:0,//是否是批量填报
  2349. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2350. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2351. 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')],
  2352. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2353. fillStatusList: [],
  2354. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2355. exportReportLogParam:{dateRange:[]},
  2356. exportDialog:false,
  2357. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2358. subProjectList:[],
  2359. canEdit: true,
  2360. originCanEdit: true,
  2361. 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],
  2362. selectTime:null,
  2363. reportTimeType:{},
  2364. curDate:'',
  2365. isAllSelect: false,
  2366. approveDialogVisible:false,
  2367. deptId:null,
  2368. targetUid: null,
  2369. membCount:0,
  2370. selectState:"-1",
  2371. user: JSON.parse(sessionStorage.getItem("user")),
  2372. allUsersList: [],
  2373. showAddMore:false,
  2374. allDate: [],
  2375. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2376. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2377. choseDay: 0,
  2378. tableHeight: 0,
  2379. listLoading: false,
  2380. projectList: [], //项目列表
  2381. fillProjectList: [],
  2382. reportList: [], //日报列表
  2383. reportNames:[], //批量审批列表
  2384. selCon:[], //筛选条件
  2385. selProjectList:[], //筛选后项目列表
  2386. selConShow: true,
  2387. usersList: [], // 全部人员列表
  2388. usersListId: '', // 选中的人员id
  2389. dialogVisible: false, //项目弹窗
  2390. report: '',
  2391. workForm: {
  2392. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2393. domains: [{
  2394. id: null,
  2395. projectId: "",
  2396. workingTime: "",
  2397. timeType:0,
  2398. content: "",
  2399. state: 2,
  2400. multiWorktime:0,
  2401. worktimeList:[],
  2402. degreeId: null,
  2403. auditUserList: [],
  2404. }],
  2405. showRefresh: false,
  2406. },
  2407. workRules: {
  2408. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2409. },
  2410. chooseParticipVisible: false,
  2411. logining: false,
  2412. isDisable: false,
  2413. timeType:[],
  2414. deptMembData: [
  2415. ],
  2416. //部门人员树状结构
  2417. data: [
  2418. {
  2419. id: -1,
  2420. label: this.$t('lable.allStaff'),
  2421. membCount:0
  2422. },
  2423. {
  2424. id: 0,
  2425. label: this.$t('lable.unassigned'),
  2426. }
  2427. ],
  2428. allData:{},
  2429. batchShowData:{},
  2430. option: [],
  2431. deptOptionList: [],
  2432. depData: {
  2433. id: -1,
  2434. label: this.$t('lable.allStaff'),
  2435. },
  2436. defaultProps: {
  2437. children: 'children',
  2438. label: 'label'
  2439. },
  2440. isNew: false,
  2441. selected: false,
  2442. valuet: new Date(),
  2443. domObj: null,
  2444. participator:[],
  2445. chosenMembCount:0,
  2446. jsDay: 0,
  2447. jsTime: 0,
  2448. falsss: false,
  2449. weidu: [],
  2450. weiduList: [],
  2451. yonghuUser: [],
  2452. dateAr: [],
  2453. batchSubFillDialog: false,
  2454. isSubstiS: false,
  2455. fillWeekDialogVisi: false,
  2456. fillWeekDialogVisiCustom: false,
  2457. fillWeekDialogVisiCustomTwo: false,
  2458. zhoData: [],
  2459. weekDateRange: [],
  2460. btnZho: false,
  2461. weekDataLoading: false,
  2462. changdu: 6,
  2463. tianxieDialogVisible: false,
  2464. scopess: {},
  2465. zhoBao: {
  2466. time: '',
  2467. workingTime: '',
  2468. progress: '',
  2469. con: '',
  2470. subProjectId: '',
  2471. stage: '',
  2472. subProjectList: [],
  2473. stages: [],
  2474. },
  2475. zhoBaoIdx: '',
  2476. zhoBaoName: '',
  2477. zhis: {},
  2478. dealList: [],
  2479. toViewDialogVisible: false,
  2480. toViewList: [],
  2481. toViewloading: true,
  2482. toViewForm: {
  2483. pageIndex: '1',
  2484. pageSize: '20',
  2485. total: 0,
  2486. },
  2487. toViewloadings: false,
  2488. tabPositionss: 'top',
  2489. monthTotal: 0,
  2490. monthTotalPage: 0,
  2491. monthTotalLages: 20,
  2492. monthWorkData: [],
  2493. monthNotWorkDate: [],
  2494. monthWorkDataS1: [],
  2495. monthnotTotal: 0,
  2496. monthnotTotalPage: 0,
  2497. monthnotTotalLages: 20,
  2498. monthNotWorkDateS1: [],
  2499. deptMembDataText: '',
  2500. isFlag: false,
  2501. isMore: false,
  2502. stateKey: '0',
  2503. expandDate: [],
  2504. notifySelList:[],
  2505. departmentList: [],
  2506. trandepartmentList:[],
  2507. approvalProcessDialog: false,
  2508. approvalProcessData: [],
  2509. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2510. 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')],
  2511. isWeekend: false,
  2512. canCancelInDialog: false,
  2513. approveinData: {},
  2514. approveinDialog: false,
  2515. reportCanDelete: false,
  2516. weeklyFilledTimeDialog: false,
  2517. weeklyFilledTimeList: [],
  2518. weeklyFilledTimeLoading: false,
  2519. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2520. weeklyFilledTimeCanDelete: false,
  2521. weeklyFilledTimeDate: null,
  2522. leaveAllNum: 0,
  2523. dataLoading: false,
  2524. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2525. vacationTime: {},
  2526. integrationProjectList: [],
  2527. totalReportHours: 0, // 合计的工时
  2528. workTimeForMinYi:0,
  2529. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2530. weekIndex: 1,
  2531. weekParentData: {},
  2532. deptIdForNoReport:[],
  2533. deptIdForReminder:[],
  2534. nameAearch: '', // 企业微信姓名搜索
  2535. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2536. deptMembDataLoading: false,
  2537. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2538. {
  2539. id: 4811,
  2540. // id: 10,
  2541. name: '陕西柘中建设工程有限公司'
  2542. }
  2543. ],
  2544. pushWorkTimeLogDig:false,
  2545. pushWorkTimeLogData:[],
  2546. userReportDeptList: [],
  2547. isReminder:true,
  2548. reportLogCheckDialog:false,
  2549. deptIdForHasReport:[],
  2550. transferWorkingHoursVisable: false,
  2551. multiOptionData:[],
  2552. businessTripsArray: [],
  2553. };
  2554. },
  2555. watch: {
  2556. deptMembDataText(val) {
  2557. this.$refs.chooseMembTree.filter(val);
  2558. }
  2559. },
  2560. filters: {
  2561. // 过滤
  2562. amounts(value) {
  2563. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2564. return 0
  2565. }
  2566. var zhi = +value + 0
  2567. return zhi.toFixed(1)
  2568. },
  2569. // zhoData
  2570. zhoData(value, arr) {
  2571. var dateArray = value.split("-");
  2572. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2573. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2574. // console.log(arr[date.getDay()])
  2575. // return "周" + "日一二三四五六".charAt(date.getDay());
  2576. return arr[date.getDay()]
  2577. },
  2578. // 过滤数字
  2579. numbers(value) {
  2580. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2581. return 0
  2582. }
  2583. return value
  2584. },
  2585. },
  2586. computed: {},
  2587. mounted() {
  2588. var now = new Date();
  2589. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2590. this.today = t;
  2591. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2592. this.exportParam.dateRange = [startStr,t];
  2593. this.exportReportLogParam.dateRange = [startStr,t];
  2594. this.getAllDate(1);
  2595. this.getReportList();
  2596. this.getProjectList();
  2597. this.getFillProjectList();
  2598. this.getTimeType();
  2599. this.getDepartment();
  2600. this.scrollFunction()
  2601. this.userssHu();
  2602. this.getFirstAndLastDay()
  2603. this.getMultiOptionData();
  2604. if(this.user.timeType.reportAuditType == 3){
  2605. this.getAllUsersList()
  2606. }
  2607. if (this.user.company.packageProject == 1) {
  2608. this.getBasecostItemList();
  2609. }
  2610. if(this.user.timeType.userWithMultiDept == 1) {
  2611. this.getDeptMembData();
  2612. }
  2613. if(this.user.timeType.lockWorktime){
  2614. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2615. }
  2616. //设置了下限
  2617. if (this.user.timeType.minReportTime) {
  2618. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2619. }
  2620. const that = this
  2621. if(this.user.userNameNeedTranslate == 1) {
  2622. that.dataLoading = that.$store.state.dataLoading
  2623. this.upDataLoading()
  2624. setTimeout(()=>{
  2625. that.dataLoading = that.$store.state.dataLoading
  2626. }, 1000)
  2627. }
  2628. if (this.user.companyId == this.yuzhongCompId) {
  2629. this.getJobResponList();
  2630. }
  2631. },
  2632. methods: {
  2633. ...mapMutations(['upDataLoading']),
  2634. // 已填工时情况表设置背景色
  2635. hasworkTblCellStyle({ columnIndex, row, column }) {
  2636. if(columnIndex > 2) {
  2637. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2638. const worktimeList = row.worktimeList || []
  2639. const times = this.reportTimeType.allday
  2640. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2641. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2642. const missReport = filterData[0] && filterData[0].missReport;
  2643. const state = filterData[0] && filterData[0].state
  2644. if (missReport) {
  2645. return "backgroundColor: red"
  2646. } else {
  2647. if (state == 0 || state == -1) {
  2648. return "backgroundColor: orange"
  2649. } else if (state == 1) {
  2650. //审核通过
  2651. return "backgroundColor: #32CD32"
  2652. } else if (state == 2) {
  2653. return "backgroundColor: red"
  2654. } else {
  2655. return "backgroundColor: #E0E0E0"
  2656. }
  2657. }
  2658. }
  2659. },
  2660. getMultiOptionData() {
  2661. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2662. res => {
  2663. if (res.code == "ok") {
  2664. this.multiOptionData = res.data;
  2665. } else {
  2666. this.$message({
  2667. message: res.msg,
  2668. type: "error"
  2669. });
  2670. }
  2671. },
  2672. error => {
  2673. this.$message({
  2674. message: error,
  2675. type: "error"
  2676. });
  2677. }
  2678. );
  2679. },
  2680. showReportTimeLessThanCardTimeList() {
  2681. this.monthTotalPage = 0,
  2682. this.tbload = true,
  2683. this.http.post(
  2684. "/report/getReportTimeLessThanCardTimeList",
  2685. {
  2686. date: this.notfullSelectDateMonth,
  2687. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2688. userId: this.usersListId
  2689. },
  2690. (res) => {
  2691. if (res.code == "ok") {
  2692. this.tbload = false
  2693. this.notFullData = res.data;
  2694. this.notFullOriginList = res.data;
  2695. }
  2696. },
  2697. (error) => {
  2698. this.tbload = false
  2699. this.$message({
  2700. message: error,
  2701. type: "error",
  2702. });
  2703. }
  2704. );
  2705. },
  2706. //按选择的日期范围刷新考勤
  2707. refreshWXCardTimeByRange() {
  2708. this.refreshingTime = true;
  2709. var param = {
  2710. companyId: this.user.companyId,
  2711. startDate: this.importWxParam.date[0],
  2712. endDate: this.importWxParam.date[1],
  2713. }
  2714. //非管理员只能看到自己的
  2715. if (this.user.roleName.indexOf('管理员') == -1) {
  2716. param.userId = this.user.id;
  2717. }
  2718. this.http.post('/wxcorp/getUserCheckInDayData',param,res => {
  2719. this.refreshingTime = false;
  2720. if(res.code == 'ok'){
  2721. this.loadCheckInData();
  2722. }else {
  2723. this.$message({
  2724. message: res.msg,
  2725. type: 'error'
  2726. })
  2727. }
  2728. },err => {
  2729. this.syncTimeLoading = false;
  2730. this.$message({
  2731. message: err,
  2732. type: 'error'
  2733. })
  2734. })
  2735. },
  2736. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2737. isCustomization(userInfo, permissionArray) {
  2738. const { companyId } = userInfo
  2739. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2740. return isReportPictureRequired
  2741. },
  2742. showHiddenFunction() {
  2743. this.showHidden = true;
  2744. },
  2745. // 获取如何信息选的可填写部门
  2746. getDeptMembData() {
  2747. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2748. if (res.code == "ok") {
  2749. let lists = res.data.userReportDeptList || []
  2750. const optimizedList = lists.map(item => ({
  2751. ...item,
  2752. label: item.departmentName,
  2753. value: item.departmentId,
  2754. }));
  2755. this.$set(this, 'userReportDeptList', optimizedList || []);
  2756. } else {
  2757. this.$message({
  2758. message: res.msg,
  2759. type: "error"
  2760. });
  2761. }
  2762. },error => { });
  2763. },
  2764. //任务被选中
  2765. onTaskSelected(domainItem) {
  2766. //取服务
  2767. if (domainItem.taskId) {
  2768. var that = this;
  2769. var param = {taskId:domainItem.taskId};
  2770. if (this.isSubstitude) {
  2771. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2772. param.userId = this.workForm.userId[0];
  2773. }
  2774. }
  2775. this.http.post('/task/getMyTaskService',param, res => {
  2776. if (res.code == "ok") {
  2777. // domainItem.workContentList = res.data;
  2778. that.$set(domainItem, 'sapServiceId', null);
  2779. that.$set(domainItem, 'serviceList', res.data);
  2780. } else {
  2781. this.$message({
  2782. message: res.msg,
  2783. type: "error"
  2784. });
  2785. }
  2786. },error => {
  2787. this.$message({
  2788. message: error,
  2789. type: "error"
  2790. });
  2791. }
  2792. );
  2793. } else {
  2794. //清空服务
  2795. }
  2796. },
  2797. onBatchTimeChange() {
  2798. //反向计算每日工作时长
  2799. if (this.workForm.createDate) {
  2800. let sdate = new Date(this.workForm.createDate[0]);
  2801. let edate = new Date(this.workForm.createDate[1]);
  2802. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2803. if (days < 0) {
  2804. return;
  2805. }
  2806. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2807. //总时长发生改变,自动按比例计算
  2808. this.workForm.domains.forEach(d=>{
  2809. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2810. });
  2811. }
  2812. },
  2813. //更新工作内容列表
  2814. updateJobContent(domainItem) {
  2815. var that = this;
  2816. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2817. if (res.code == "ok") {
  2818. // domainItem.workContentList = res.data;
  2819. that.$set(domainItem, 'extraField3', null);
  2820. that.$set(domainItem, 'workContentList', res.data);
  2821. } else {
  2822. this.$message({
  2823. message: res.msg,
  2824. type: "error"
  2825. });
  2826. }
  2827. },error => {
  2828. this.$message({
  2829. message: error,
  2830. type: "error"
  2831. });
  2832. }
  2833. );
  2834. },
  2835. updateResponse(domainItem) {
  2836. var that = this;
  2837. var selectPid = domainItem.projectId;
  2838. domainItem.extraField2 = null;
  2839. domainItem.extraField3 = null;
  2840. if (selectPid && domainItem.extraField1) {
  2841. //是否非项目
  2842. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2843. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2844. domainItem.filteredRespList = filteredRespList;
  2845. }
  2846. },
  2847. getJobResponList() {
  2848. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2849. if (res.code == "ok") {
  2850. this.jobResponseList = res.data;
  2851. } else {
  2852. this.$message({
  2853. message: res.msg,
  2854. type: "error"
  2855. });
  2856. }
  2857. },error => {
  2858. this.$message({
  2859. message: error,
  2860. type: "error"
  2861. });
  2862. }
  2863. );
  2864. },
  2865. openModImportTime(row) {
  2866. this.showModImportTimeDialog = true;
  2867. this.modItemDataId = row.id;
  2868. },
  2869. delImportTime(row) {
  2870. let rowId = row.id;
  2871. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2872. confirmButtonText: this.$t('btn.determine'),
  2873. cancelButtonText: this.$t('btn.cancel'),
  2874. type: "warning"
  2875. })
  2876. .then(() => {
  2877. this.http.post('/report-import-log/delete',{
  2878. id: rowId
  2879. },res => {
  2880. if (res.code == "ok") {
  2881. this.$message({
  2882. message: this.$t('message.successfullyDeleted'),
  2883. type: "success"
  2884. });
  2885. this.getToView();
  2886. } else {
  2887. this.$message({
  2888. message: res.msg,
  2889. type: "error"
  2890. });
  2891. }
  2892. },error => {
  2893. this.$message({
  2894. message: error,
  2895. type: "error"
  2896. });
  2897. }
  2898. );
  2899. }).catch(() => {this.startDeleting = false});
  2900. },
  2901. confirmChangeModTime() {
  2902. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2903. this.$message({
  2904. message: this.$t('message.Pleaseselectatime'),
  2905. type: "error"
  2906. });
  2907. return;
  2908. }
  2909. this.http.post('/report-import-log/changeTime',{
  2910. modLogDateTime: this.modImportTime,
  2911. modImportUserId: this.modImportUserId,
  2912. id: this.modItemDataId
  2913. },res => {
  2914. if (res.code == "ok") {
  2915. this.$message({
  2916. message: this.$t('message.modifyTheSuccess'),
  2917. type: "success"
  2918. });
  2919. this.getToView();
  2920. this.showModImportTimeDialog = false;
  2921. } else {
  2922. this.$message({
  2923. message: res.msg,
  2924. type: "error"
  2925. });
  2926. }
  2927. },error => {
  2928. this.$message({
  2929. message: error,
  2930. type: "error"
  2931. });
  2932. }
  2933. );
  2934. },
  2935. confirmBatchApproveReport() {
  2936. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2937. this.$message({
  2938. message: this.$t('qingXuanZeRiQiFanWei'),
  2939. type: "error"
  2940. });
  2941. return;
  2942. }
  2943. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2944. confirmButtonText: this.$t('btn.determine'),
  2945. cancelButtonText: this.$t('btn.cancel'),
  2946. type: "warning"
  2947. })
  2948. .then(() => {
  2949. this.startDeleting = true;
  2950. let obj = {
  2951. startDate: this.deleteReportParam.date[0],
  2952. endDate: this.deleteReportParam.date[1]
  2953. }
  2954. if(this.deleteReportParam.departmentId) {
  2955. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2956. } else {
  2957. obj.departmentId = null
  2958. }
  2959. this.http.post('/report/batchApproveByDate',obj,res => {
  2960. if (res.code == "ok") {
  2961. this.$message({
  2962. message: this.$t('state.approved'),
  2963. type: "success"
  2964. });
  2965. this.getReportList();
  2966. this.getDepartment();
  2967. this.startDeleting = false;
  2968. } else {
  2969. this.$message({
  2970. message: res.msg,
  2971. type: "error"
  2972. });
  2973. }
  2974. },error => {
  2975. this.$message({
  2976. message: error,
  2977. type: "error"
  2978. });
  2979. }
  2980. );
  2981. }).catch(() => {this.startDeleting = false});
  2982. },
  2983. confirmBatchDelReport() {
  2984. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2985. this.$message({
  2986. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2987. type: "error"
  2988. });
  2989. return;
  2990. }
  2991. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2992. this.$message({
  2993. message: this.$t('qingXuanZeRiQiFanWei'),
  2994. type: "error"
  2995. });
  2996. return;
  2997. }
  2998. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2999. confirmButtonText: this.$t('btn.determine'),
  3000. cancelButtonText: this.$t('btn.cancel'),
  3001. type: "warning"
  3002. })
  3003. .then(() => {
  3004. this.startDeleting = true;
  3005. this.http.post('/report/batchDelete',{
  3006. userIds: JSON.stringify(this.deleteReportParam.userIds),
  3007. startDate: this.deleteReportParam.date[0],
  3008. endDate: this.deleteReportParam.date[1],
  3009. deptId: this.deleteReportParam.deptId[0]
  3010. },res => {
  3011. if (res.code == "ok") {
  3012. this.$message({
  3013. message: this.$t('message.successfullyDeleted'),
  3014. type: "success"
  3015. });
  3016. this.getReportList();
  3017. this.getDepartment();
  3018. this.startDeleting = false;
  3019. } else {
  3020. this.$message({
  3021. message: res.msg,
  3022. type: "error"
  3023. });
  3024. }
  3025. },error => {
  3026. this.$message({
  3027. message: error,
  3028. type: "error"
  3029. });
  3030. }
  3031. );
  3032. }).catch(() => {this.startDeleting = false});
  3033. },
  3034. getRecentlyProject(userId) {
  3035. this.http.post('/project/nearProject',{userId: userId},res => {
  3036. if(res.code == 'ok'){
  3037. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3038. let topObj = {
  3039. label: this.$t('zuiJinXuanZeXiangMu'),
  3040. peojectList: res.data
  3041. }
  3042. let botomObj = {
  3043. label: this.$t('other.allProject'),
  3044. peojectList: bottomList
  3045. }
  3046. //最近项目如果在fillProjectList中不存在,需要移除
  3047. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3048. this.integrationProjectList = [topObj, botomObj]
  3049. }else {
  3050. this.$message({
  3051. message: res.msg,
  3052. type: 'error'
  3053. })
  3054. }
  3055. },err => {
  3056. this.$message({
  3057. message: err,
  3058. type: 'error'
  3059. })
  3060. })
  3061. },
  3062. handlePictureCardPreview(file, index) {
  3063. let arr = []
  3064. let imgArr = this.workForm.domains[index].imgListUrl
  3065. for(var i in imgArr) {
  3066. arr.push(imgArr[i].url)
  3067. }
  3068. const $viewer = this.$viewerApi({
  3069. images: arr
  3070. });
  3071. },
  3072. // 图片上传
  3073. addImg(e, index) {
  3074. let formData = new FormData()
  3075. formData.append('multipartFile', e.file)
  3076. this.http.uploadFile('/common/uploadFile', formData,
  3077. res => {
  3078. if (res.code == "ok") {
  3079. this.$message({
  3080. message: this.$t('uploadedsuccessfully'),
  3081. type: "success"
  3082. });
  3083. if(!this.workForm.domains[index].imgList) {
  3084. this.workForm.domains[index].imgList = []
  3085. this.workForm.domains[index].imgListUrl = []
  3086. }
  3087. this.workForm.domains[index].imgList.push(res.data)
  3088. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3089. } else {
  3090. this.$message({message: res.msg,type: "error"});
  3091. }
  3092. },
  3093. error => {this.$message({message: error,type: "error"});
  3094. });
  3095. },
  3096. // 删除图片
  3097. delImg(file,fileList, index) {
  3098. let idx = 0
  3099. for(let i in fileList) {
  3100. if(fileList[i].uid == file.uid) {
  3101. idx = i
  3102. }
  3103. }
  3104. this.workForm.domains[index].imgList.splice(idx, 1)
  3105. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3106. },
  3107. test(){
  3108. console.log('test',this.workForm.domains);
  3109. },
  3110. getHour(s1, s2) {
  3111. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3112. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3113. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3114. var ms = s2.getTime() - s1.getTime();
  3115. if (ms < 0) return 0;
  3116. let ma = ms / 1000 / 60 / 60
  3117. return ma; //小时
  3118. },
  3119. refreshDDCardTime(workdate) {
  3120. if (!workdate) return;
  3121. this.syncTimeLoading = true;
  3122. this.http.post('/dingding/refreshUserCardTime',{
  3123. companyId: this.user.companyId,
  3124. userId: this.user.id,
  3125. date: workdate,
  3126. },res => {
  3127. this.syncTimeLoading = false;
  3128. if(res.code == 'ok'){
  3129. if (!res.data) {
  3130. this.$message({
  3131. message: '获取考勤失败',
  3132. type: 'error'
  3133. })
  3134. } else {
  3135. this.workForm.time = res.data;
  3136. }
  3137. }else {
  3138. this.$message({
  3139. message: res.msg,
  3140. type: 'error'
  3141. })
  3142. }
  3143. },err => {
  3144. this.syncTimeLoading = false;
  3145. this.$message({
  3146. message: err,
  3147. type: 'error'
  3148. })
  3149. })
  3150. },
  3151. refreshWXCardTime(workdate) {
  3152. if (!workdate) return;
  3153. this.syncTimeLoading = true;
  3154. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3155. date: workdate,
  3156. },res => {
  3157. this.syncTimeLoading = false;
  3158. if(res.code == 'ok'){
  3159. this.workForm.time = res.data.time;
  3160. }else {
  3161. this.$message({
  3162. message: res.msg,
  3163. type: 'error'
  3164. })
  3165. }
  3166. },err => {
  3167. this.syncTimeLoading = false;
  3168. this.$message({
  3169. message: err,
  3170. type: 'error'
  3171. })
  3172. })
  3173. },
  3174. refreshAttendance(workdate) {
  3175. if (!workdate) return;
  3176. this.syncTimeLoading = true;
  3177. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3178. startDate: workdate[0],
  3179. endDate: workdate[1]
  3180. },res => {
  3181. this.syncTimeLoading = false;
  3182. if(res.code == 'ok'){
  3183. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3184. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3185. this.totalReportHours = this.workTimeForMinYi;
  3186. }else {
  3187. this.$message({
  3188. message: res.msg,
  3189. type: 'error'
  3190. })
  3191. }
  3192. },err => {
  3193. this.syncTimeLoading = false;
  3194. this.$message({
  3195. message: err,
  3196. type: 'error'
  3197. })
  3198. })
  3199. },
  3200. refreshBeiSengAttendance(workdate) {
  3201. if (!workdate) return;
  3202. this.syncTimeLoading = true;
  3203. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3204. createDate: workdate
  3205. },res => {
  3206. this.syncTimeLoading = false;
  3207. if(res.code == 'ok'){
  3208. this.workForm.time = res.data;
  3209. }else {
  3210. this.$message({
  3211. message: res.msg,
  3212. type: 'error'
  3213. })
  3214. }
  3215. },err => {
  3216. this.syncTimeLoading = false;
  3217. this.$message({
  3218. message: err,
  3219. type: 'error'
  3220. })
  3221. })
  3222. },
  3223. refreshBeiSengAttendanceTwo(workdate) {
  3224. if (!workdate) return;
  3225. this.syncTimeLoading = true;
  3226. this.http.post('/user-fv-time/syncHongHuFvTime',{
  3227. startDate: workdate,
  3228. endDate: workdate,
  3229. userId: this.user.id
  3230. },res => {
  3231. this.syncTimeLoading = false;
  3232. if(res.code == 'ok'){
  3233. this.workForm.time = res.data;
  3234. }else {
  3235. this.$message({
  3236. message: res.msg,
  3237. type: 'error'
  3238. })
  3239. }
  3240. },err => {
  3241. this.syncTimeLoading = false;
  3242. this.$message({
  3243. message: err,
  3244. type: 'error'
  3245. })
  3246. })
  3247. },
  3248. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3249. this.weeklyFilledTimeDialog = true
  3250. this.weeklyFilledTimeLoading = true
  3251. this.weeklyFilledTimeDate = parameterDate
  3252. this.http.post('/report/getReportList',{
  3253. date: parameterDate,
  3254. userId: this.user.id
  3255. },res => {
  3256. this.weeklyFilledTimeLoading = false
  3257. if(res.code == 'ok'){
  3258. this.weeklyFilledTimeList = res.data[0].data
  3259. let candelete = true
  3260. for(let i in this.weeklyFilledTimeList){
  3261. if(this.weeklyFilledTimeList[i].state < 2){
  3262. candelete = false
  3263. }
  3264. }
  3265. this.weeklyFilledTimeCanDelete = candelete
  3266. }else {
  3267. this.$message({
  3268. message: res.msg,
  3269. type: 'error'
  3270. })
  3271. }
  3272. },err => {
  3273. this.weeklyFilledTimeLoading = false
  3274. this.$message({
  3275. message: err,
  3276. type: 'error'
  3277. })
  3278. })
  3279. },
  3280. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3281. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3282. confirmButtonText: this.$t('btn.determine'),
  3283. cancelButtonText: this.$t('btn.cancel'),
  3284. type: "warning"
  3285. })
  3286. .then(() => {
  3287. this.http.post('/report/delete',{
  3288. userId: this.user.id,
  3289. date: this.weeklyFilledTimeDate
  3290. },res => {
  3291. if (res.code == "ok") {
  3292. this.$message({
  3293. message: this.$t('message.successfullyDeleted'),
  3294. type: "success"
  3295. });
  3296. this.getWeeklyWorkTime()
  3297. this.getReportList();
  3298. this.getDepartment();
  3299. this.weeklyFilledTimeDialog = false;
  3300. } else {
  3301. this.$message({
  3302. message: res.msg,
  3303. type: "error"
  3304. });
  3305. }
  3306. },error => {
  3307. this.$message({
  3308. message: error,
  3309. type: "error"
  3310. });
  3311. }
  3312. );
  3313. }).catch(() => {});
  3314. },
  3315. getApprovalProcess(item){
  3316. // console.log('this.date',this.choseDate);
  3317. this.http.post('/report-log/get',{
  3318. creatorId: item.id,
  3319. createDate: sessionStorage.msg
  3320. },res => {
  3321. if(res.code == 'ok'){
  3322. this.approvalProcessDialog = true
  3323. if(this.user.userNameNeedTranslate == 1) {
  3324. for(var i in res.data) {
  3325. let obj = {
  3326. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3327. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3328. }
  3329. res.data[i].msgCon = obj
  3330. }
  3331. }
  3332. this.approvalProcessData = res.data
  3333. }else{
  3334. this.$message({
  3335. message: res.msg,
  3336. type: 'error'
  3337. })
  3338. }
  3339. },err => {
  3340. this.$message({
  3341. message: err,
  3342. type: 'error'
  3343. })
  3344. })
  3345. //获取审批节点状态
  3346. if (this.user.companyId == 7544) {
  3347. this.http.post('/report/getCurAuditNode',{
  3348. userId: item.id,
  3349. date: sessionStorage.msg
  3350. },res => {
  3351. if(res.code == 'ok'){
  3352. this.curAuditNode = res.data
  3353. }else{
  3354. }
  3355. },err => {
  3356. this.$message({
  3357. message: err,
  3358. type: 'error'
  3359. })
  3360. })
  3361. }
  3362. },
  3363. filterNode(value, data) {
  3364. if (!value) return true;
  3365. return data.label.indexOf(value) !== -1;
  3366. },
  3367. triggerCalculateOT(index) {
  3368. var str = this.workForm.domains[index].overtimeHours + ''
  3369. if(str.indexOf('.') != '-1') {
  3370. var s = str.split('.')[0]
  3371. var st = str.split('.')[1]
  3372. var sts = st.split('')
  3373. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3374. }
  3375. },
  3376. searchScreen(e){
  3377. if(e == 1){
  3378. this.monthNotWorkDateS1 = []
  3379. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3380. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3381. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3382. }
  3383. }
  3384. if (this.monthNotWorkDateS1.length > 50) {
  3385. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3386. }else{
  3387. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3388. }
  3389. } else if (e == 0) {
  3390. this.monthWorkDataS1 = []
  3391. for (let i = 0; i < this.monthWorkData.length; i++) {
  3392. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3393. this.monthWorkDataS1.push(this.monthWorkData[i])
  3394. }
  3395. }
  3396. if (this.monthWorkDataS1.length > 50) {
  3397. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3398. }else{
  3399. this.monthWorkDataS = this.monthWorkDataS1
  3400. }
  3401. } else if (e == 2) {
  3402. this.monthWorkDataS1 = []
  3403. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3404. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3405. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3406. }
  3407. }
  3408. if (this.monthWorkDataS1.length > 50) {
  3409. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3410. }else{
  3411. this.notFullData = this.monthWorkDataS1
  3412. }
  3413. }
  3414. },
  3415. addUpload(data) {
  3416. // var zhi = data.fileName.split('.')[0]
  3417. // var sss = zhi + '.xlsx'
  3418. // return
  3419. var filePath = '/upload/' + data.serverName;
  3420. const a = document.createElement('a'); // 创建a标签
  3421. a.setAttribute('download', data.fileName);// download属性
  3422. a.setAttribute('href', filePath);// href链接
  3423. a.click(); //自执行点击事件
  3424. a.remove();
  3425. },
  3426. restrictNumber(targetId) {
  3427. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3428. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3429. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3430. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3431. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3432. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3433. inpu.value = parseFloat(inpu.value);
  3434. }
  3435. },
  3436. //获取项目下的任务分组
  3437. getTaskGroups(domain, index) {
  3438. domain.groupId=null;
  3439. this.http.post('/task-group/listMyJoinGroup',{
  3440. projectId: domain.projectId,
  3441. isSubstitude: this.isSubstitude ? 1 : 0
  3442. },
  3443. res => {
  3444. if (res.code == "ok") {
  3445. this.workForm.domains[index].taskGroups = res.data;
  3446. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3447. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3448. // this.getGroupStages(domain, index);
  3449. // }
  3450. const projectIdStr = domain.projectId;
  3451. const businessTripsArray = this.businessTripsArray
  3452. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3453. if(list.length > 0) {
  3454. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3455. this.workForm.domains[index].groupId = obj.id || ''
  3456. }
  3457. this.$forceUpdate();
  3458. }
  3459. },
  3460. error => {
  3461. this.$message({
  3462. message: error,
  3463. type: "error"
  3464. });
  3465. }
  3466. );
  3467. },
  3468. //下载填报工时占比报表
  3469. downloadProjectRatio() {
  3470. this.exportUserRatio = true;
  3471. // let now = new Date();
  3472. // let month = now.getMonth();//默认看上个月的
  3473. // let monthStr = month<10? ('0'+month): month;
  3474. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3475. const today = new Date();
  3476. const year = today.getFullYear();
  3477. const month = today.getMonth() + 1;
  3478. let lastMonthYear, lastMonth;
  3479. if (month === 1) {
  3480. lastMonthYear = year - 1;
  3481. lastMonth = 12;
  3482. } else {
  3483. lastMonthYear = year;
  3484. lastMonth = month - 1;
  3485. }
  3486. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3487. },
  3488. confirmDownloadRatio() {
  3489. this.startRatioExporting = true;
  3490. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3491. ymonth: this.ratioYmonth
  3492. },
  3493. res => {
  3494. if (res.code == "ok") {
  3495. this.startRatioExporting = false;
  3496. var filePath = res.data;
  3497. const a = document.createElement('a'); // 创建a标签
  3498. var data = filePath.split("/");
  3499. a.setAttribute('download', data[data.length-1]);// download属性
  3500. a.setAttribute('href', filePath);// href链接
  3501. a.click(); //自执行点击事件
  3502. a.remove();
  3503. } else {
  3504. this.startRatioExporting = false;
  3505. this.$message({
  3506. message: res.msg,
  3507. type: "error"
  3508. });
  3509. }
  3510. },
  3511. error => {
  3512. this.checkinLoading = false;
  3513. this.$message({
  3514. message: error,
  3515. type: "error"
  3516. });
  3517. }
  3518. );
  3519. },
  3520. //下载带企业微信考勤数据的工时统计模板
  3521. downloadCheckInExcel() {
  3522. var param = {
  3523. startDate: this.importWxParam.date[0],
  3524. endDate: this.importWxParam.date[1],
  3525. };
  3526. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3527. param.onlySelfData = false;
  3528. }
  3529. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3530. res => {
  3531. if (res.code == "ok") {
  3532. var filePath = res.data;
  3533. const a = document.createElement('a'); // 创建a标签
  3534. var data = filePath.split("/");
  3535. a.setAttribute('download', data[data.length-1]);// download属性
  3536. a.setAttribute('href', filePath);// href链接
  3537. a.click(); //自执行点击事件
  3538. a.remove();
  3539. } else {
  3540. this.$message({
  3541. message: res.msg,
  3542. type: "error"
  3543. });
  3544. }
  3545. },
  3546. error => {
  3547. this.checkinLoading = false;
  3548. this.$message({
  3549. message: error,
  3550. type: "error"
  3551. });
  3552. }
  3553. );
  3554. },
  3555. pre() {
  3556. if (this.active == 0) return;
  3557. this.active--;
  3558. },
  3559. next() {
  3560. this.active++;
  3561. },
  3562. triggerTotalTime(index) {
  3563. var item = this.checkinList[index];
  3564. var total = 0.0;
  3565. for (var i=0;i<this.projectColumns.length; i++) {
  3566. var key = this.projectColumns[i];
  3567. if (item[key] != null && item[key] != '') {
  3568. total += parseFloat(item[key]);
  3569. }
  3570. }
  3571. item.totalFillTime = total;
  3572. },
  3573. //提交批量代填的数据
  3574. submitBatchSubFillData() {
  3575. var data = JSON.stringify(this.checkinList);
  3576. this.http.post('/user-corpwx-time/submitProjectTime',{
  3577. json: data,
  3578. projectColumns: JSON.stringify(this.projectColumns)
  3579. },
  3580. res => {
  3581. if (res.code == "ok") {
  3582. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3583. this.importWxDialog = false;
  3584. }
  3585. },
  3586. error => {
  3587. this.checkinLoading = false;
  3588. this.$message({
  3589. message: error,
  3590. type: "error"
  3591. });
  3592. }
  3593. );
  3594. },
  3595. loadCheckInData() {
  3596. if (this.importWxParam.date == null) {
  3597. this.checkinList = [];
  3598. return;
  3599. }
  3600. this.checkinLoading = true;
  3601. this.http.post('/user-corpwx-time/getMyData',{
  3602. startDate: this.importWxParam.date[0],
  3603. endDate: this.importWxParam.date[1],
  3604. },
  3605. res => {
  3606. if (res.code == "ok") {
  3607. this.checkinLoading = false;
  3608. this.checkinList = res.data.list;
  3609. this.projectColumns = res.data.projects;
  3610. // 自定义表格会导致表格错乱,需重新计算表格
  3611. this.$nextTick(()=>{
  3612. this.$refs.tab.doLayout()
  3613. })
  3614. }
  3615. },
  3616. error => {
  3617. this.checkinLoading = false;
  3618. this.$message({
  3619. message: error,
  3620. type: "error"
  3621. });
  3622. }
  3623. );
  3624. },
  3625. importCardTime(item) {
  3626. //首先判断文件类型
  3627. let str = item.file.name.split(".");
  3628. let format = str[str.length - 1];
  3629. if (format != "xls" && format != "xlsx") {
  3630. this.$message({
  3631. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3632. type: "error"
  3633. });
  3634. } else {
  3635. this.importingData = true;
  3636. let formData = new FormData();
  3637. formData.append("multipartFile", item.file);
  3638. formData.append("companyId", this.user.companyId);
  3639. this.http.uploadFile(this.user.companyId == 7703?'/user-corpwx-time/importZhengBeiAttendance':'/user-corpwx-time/importCardTime', formData,
  3640. res => {
  3641. this.$refs.uploadCardTime.clearFiles();
  3642. this.importingData = false;
  3643. if (res.code == "ok") {
  3644. //换成弹出框,以免有人等了半天回来啥也没看到
  3645. this.$message({
  3646. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3647. type: "success"
  3648. });
  3649. } else {
  3650. this.$message({
  3651. message: res.msg,
  3652. type: "error"
  3653. });
  3654. }
  3655. },
  3656. error => {
  3657. this.$refs.upload.clearFiles();
  3658. this.listLoading = false;
  3659. this.$message({
  3660. message: error,
  3661. type: "error"
  3662. });
  3663. });
  3664. }
  3665. },
  3666. batchImportWxData(item) {
  3667. //首先判断文件类型
  3668. let str = item.file.name.split(".");
  3669. let format = str[str.length - 1];
  3670. if (format != "xls" && format != "xlsx") {
  3671. this.$message({
  3672. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3673. type: "error"
  3674. });
  3675. } else {
  3676. this.importingData = true;
  3677. let formData = new FormData();
  3678. formData.append("file", item.file);
  3679. formData.append("companyId", this.user.companyId);
  3680. formData.append("withCheckIn", 1);
  3681. this.http.uploadFile('/report/importData', formData,
  3682. res => {
  3683. this.$refs.upload.clearFiles();
  3684. this.showImportResult = true;
  3685. this.importingData = false;
  3686. if (res.code == "ok") {
  3687. //换成弹出框,以免有人等了半天回来啥也没看到
  3688. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3689. this.getReportList();
  3690. this.importWxDialog = false;
  3691. } else {
  3692. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3693. }
  3694. },
  3695. error => {
  3696. this.$refs.upload.clearFiles();
  3697. this.listLoading = false;
  3698. this.$message({
  3699. message: error,
  3700. type: "error"
  3701. });
  3702. });
  3703. }
  3704. },
  3705. batchImportData(item) {
  3706. //首先判断文件类型
  3707. let str = item.file.name.split(".");
  3708. let format = str[str.length - 1];
  3709. if (format != "xls" && format != "xlsx") {
  3710. this.$message({
  3711. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3712. type: "error"
  3713. });
  3714. } else {
  3715. this.importingData = true;
  3716. let formData = new FormData();
  3717. formData.append("file", item.file);
  3718. formData.append("companyId", this.user.companyId);
  3719. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3720. this.http.uploadFile(url, formData,
  3721. res => {
  3722. this.$refs.upload.clearFiles();
  3723. this.importingData = false;
  3724. this.showImportResult = true;
  3725. if (res.code == "ok") {
  3726. //换成弹出框,以免有人等了半天回来啥也没看到
  3727. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3728. this.getReportList();
  3729. this.importWXDialog = false;
  3730. } else {
  3731. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3732. }
  3733. },
  3734. error => {
  3735. this.$refs.upload.clearFiles();
  3736. this.importingData = false;
  3737. this.$message({
  3738. message: error,
  3739. type: "error"
  3740. });
  3741. });
  3742. }
  3743. },
  3744. userssHu() {
  3745. this.http.post('/time-type/getCompanyTimeSetting',{
  3746. companyId: this.user.companyId
  3747. },
  3748. res => {
  3749. if (res.code == "ok") {
  3750. this.yonghuUser = res.data
  3751. }
  3752. },
  3753. error => {
  3754. this.$message({
  3755. message: error,
  3756. type: "error"
  3757. });
  3758. }
  3759. );
  3760. },
  3761. iptBlur(i) {
  3762. if(this.isBatch == 0) {
  3763. return
  3764. }
  3765. var reqParam = {
  3766. startDate: this.workForm.createDate[0],
  3767. endDate: this.workForm.createDate[1]
  3768. };
  3769. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3770. reqParam.userId = this.workForm.userId[0];
  3771. }
  3772. this.http.post('/report/getWorkDays',reqParam,
  3773. res => {
  3774. if (res.code == "ok") {
  3775. this.jsDay = res.data
  3776. this.chuji(i)
  3777. } else {
  3778. this.$message({
  3779. message: res.msg,
  3780. type: "error"
  3781. });
  3782. }
  3783. },
  3784. error => {
  3785. this.$message({
  3786. message: error,
  3787. type: "error"
  3788. });
  3789. }
  3790. );
  3791. //明夷硬编码获取
  3792. if (this.user.company.companyName == this.mingyiName) {
  3793. this.getWorkTimeForMinYi();
  3794. }
  3795. },
  3796. getWorkTimeForMinYi(){
  3797. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3798. startDate: this.workForm.createDate[0],
  3799. endDate: this.workForm.createDate[1]
  3800. },
  3801. res => {
  3802. if (res.code == "ok") {
  3803. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3804. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3805. this.totalReportHours = this.workTimeForMinYi;
  3806. } else {
  3807. this.$message({
  3808. message: res.msg,
  3809. type: "error"
  3810. });
  3811. this.workForm.createDate = [];
  3812. }
  3813. },
  3814. error => {
  3815. this.$message({
  3816. message: error,
  3817. type: "error"
  3818. });
  3819. }
  3820. );
  3821. },
  3822. chuji(i) {
  3823. if(i == 0) {
  3824. this.seleChn(1)
  3825. } else if(i == 1) {
  3826. this.seleChn(0)
  3827. } else if(i == 2) {
  3828. if(this.workForm.domains[0].multiWorktime > 0) {
  3829. this.iptChangs()
  3830. } else {
  3831. this.iptChang()
  3832. }
  3833. } else if(i == 3) {
  3834. this.seleChn(0)
  3835. }
  3836. },
  3837. seleChn(e,domain) {
  3838. if(e == 1) {
  3839. for(var i in this.workForm.domains) {
  3840. if(this.workForm.domains[i].timeType == 0) {
  3841. this.workForm.domains[i].workingTime = 8
  3842. } else {
  3843. this.workForm.domains[i].workingTime = 4
  3844. }
  3845. }
  3846. }
  3847. var quanbu = 0
  3848. var spl = this.workForm.domains
  3849. var zhi = ''
  3850. for(var i in spl) {
  3851. var sp = +spl[i].workingTime + 0
  3852. zhi = this.jsDay * sp
  3853. quanbu = +quanbu + zhi
  3854. }
  3855. this.jsTime = quanbu
  3856. this.totalReportHours = quanbu
  3857. let worktime = this.jsTime
  3858. // 自动计算加班时长
  3859. if(this.isBatch != 0){
  3860. worktime = this.jsTime / this.jsDay
  3861. }
  3862. if(this.user.timeType.fillOvertime && domain){
  3863. let isover = false
  3864. let alltime = 0
  3865. let allover = 0 //此处alltime同上面的worktime
  3866. for(let d in spl){
  3867. if(spl[d].isOvertime){
  3868. isover = true
  3869. allover += spl[d].overtimeHours*1
  3870. }
  3871. alltime += spl[d].workingTime*1
  3872. }
  3873. if(domain.overtimeHours){
  3874. allover = allover - domain.overtimeHours
  3875. }
  3876. if(worktime*1 > this.user.timeType.allday){
  3877. if(isover){
  3878. if(alltime > (allover + this.user.timeType.allday)){
  3879. this.$set(domain,'isOvertime',true)
  3880. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3881. }else{
  3882. this.$set(domain,'isOvertime',false)
  3883. this.$set(domain,'overtimeHours',null)
  3884. if(alltime < (allover + this.user.timeType.allday)){
  3885. let overtime = allover + this.user.timeType.allday - alltime
  3886. for(let pi in spl){
  3887. if(spl[pi].overtimeHours){
  3888. if((overtime - spl[pi].overtimeHours*1) > 0){
  3889. overtime = overtime - spl[pi].overtimeHours*1
  3890. this.$set(spl[pi],'isOvertime',false)
  3891. this.$set(spl[pi],'overtimeHours',null)
  3892. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3893. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3894. break
  3895. }else{
  3896. this.$set(spl[pi],'isOvertime',false)
  3897. this.$set(spl[pi],'overtimeHours',null)
  3898. break
  3899. }
  3900. }
  3901. }
  3902. }
  3903. }
  3904. }else{
  3905. this.$set(domain,'isOvertime',true)
  3906. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3907. }
  3908. }else{
  3909. for(let di in spl){
  3910. this.$set(spl[di],'isOvertime',false)
  3911. this.$set(spl[di],'overtimeHours',null)
  3912. }
  3913. }
  3914. }
  3915. },
  3916. iptChang() {
  3917. var sl = this.workForm.domains
  3918. let timeArr = []
  3919. for(var i in sl) {
  3920. if(sl[i].startTime && sl[i].endTime) {
  3921. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3922. }
  3923. }
  3924. this.getTimeHours(timeArr)
  3925. },
  3926. iptChangs() {
  3927. var sl = this.workForm.domains
  3928. let timeArr = []
  3929. for(var i in sl) {
  3930. for(var j in sl[i].worktimeList){
  3931. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3932. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3933. }
  3934. }
  3935. }
  3936. this.getTimeHours(timeArr)
  3937. },
  3938. // 调用接口或去数据
  3939. getTimeHours(arr) {
  3940. this.http.post('/report/getHoursByTimeRange',{
  3941. timeJsonStr: JSON.stringify(arr)
  3942. },res => {
  3943. if(res.code === 'ok') {
  3944. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3945. } else {
  3946. this.$message({
  3947. message: res.msg,
  3948. type: 'error'
  3949. })
  3950. }
  3951. },err => {
  3952. this.$message({
  3953. message: err,
  3954. type: 'error'
  3955. })
  3956. })
  3957. },
  3958. // 按周填报调用接口计算时间
  3959. async getWeekHoursByTimeRange(timeRange) {
  3960. const url = '/report/getHoursByTimeRange';
  3961. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3962. var that = this;
  3963. return new Promise((resolve, reject) => {
  3964. this.http.post(url, data, function(res) {
  3965. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3966. }, function(err) {
  3967. reject(err);
  3968. });
  3969. });
  3970. },
  3971. removeTimeItem(item, index) {
  3972. item.worktimeList.splice(index, 1);
  3973. this.iptChangs()
  3974. },
  3975. //添加工时
  3976. addNewWorktime(index, item) {
  3977. if(item.worktimeList == null ) {
  3978. item.worktimeList = []
  3979. }
  3980. item.worktimeList.push({});
  3981. },
  3982. //复制项目
  3983. copyProject(index) {
  3984. var leftProgress = 10;
  3985. if (this.reportTimeType.type == 3) {
  3986. //计算已经待分配工时比例
  3987. let array = this.workForm.domains;
  3988. let totalProgress = 0;
  3989. for (var i=0;i<array.length; i++) {
  3990. totalProgress += array[i].progress;
  3991. }
  3992. if (totalProgress < 100) {
  3993. leftProgress = 100 - totalProgress;
  3994. }
  3995. }
  3996. var newIndex = index+1;
  3997. var itemDomain = {
  3998. projectId: this.workForm.domains[index].projectId,
  3999. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  4000. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  4001. ),
  4002. content: "",
  4003. progress:leftProgress,
  4004. state:2,//2-表示待提交
  4005. };
  4006. this.workForm.domains.splice(newIndex, 0,itemDomain);
  4007. if (this.reportTimeType.type == 0) {
  4008. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4009. var length = this.workForm.domains.length;
  4010. if (length == 2) {
  4011. this.showAddMore = false;
  4012. }
  4013. }
  4014. this.selectProject(itemDomain, newIndex);
  4015. },
  4016. pushWorkTime(reportId){
  4017. let url=''
  4018. if(this.user.timeType.syncSap == 1){
  4019. url='/report/pushProjectReportToSap'
  4020. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4021. var pushDate = this.date + day;
  4022. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  4023. confirmButtonText: this.$t('btn.determine'),
  4024. cancelButtonText: this.$t('btn.cancel'),
  4025. type: 'info'
  4026. }).then(() => {
  4027. const loading = this.$loading({
  4028. lock: true,
  4029. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4030. spinner: 'el-icon-loading',
  4031. background: 'rgba(0, 0, 0, 0.7)'
  4032. });
  4033. this.http.post(url,{
  4034. pushDate: pushDate,
  4035. reportId: reportId
  4036. },res => {
  4037. loading.close();
  4038. if(res.code == 'ok'){
  4039. this.$message({
  4040. type: 'success',
  4041. message: res.data
  4042. });
  4043. }else{
  4044. this.$message({
  4045. type: 'error',
  4046. message: res.msg
  4047. })
  4048. }
  4049. },err => {
  4050. loading.close();
  4051. this.$message({
  4052. type: 'error',
  4053. message: err
  4054. })
  4055. })
  4056. }).catch(() => {
  4057. });
  4058. }else{
  4059. url='/report/pushReportDataToThird'
  4060. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4061. confirmButtonText: this.$t('btn.determine'),
  4062. cancelButtonText: this.$t('btn.cancel'),
  4063. type: 'info'
  4064. }).then(() => {
  4065. const loading = this.$loading({
  4066. lock: true,
  4067. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4068. spinner: 'el-icon-loading',
  4069. background: 'rgba(0, 0, 0, 0.7)'
  4070. });
  4071. this.http.post(url,{
  4072. yearMonth: this.date
  4073. },res => {
  4074. loading.close();
  4075. if(res.code == 'ok'){
  4076. this.$message({
  4077. type: 'success',
  4078. message: this.$t('tuiSongChengGong')
  4079. });
  4080. }else{
  4081. this.$message({
  4082. type: 'error',
  4083. message: res.msg
  4084. })
  4085. }
  4086. },err => {
  4087. loading.close();
  4088. this.$message({
  4089. type: 'error',
  4090. message: err
  4091. })
  4092. })
  4093. }).catch(() => {
  4094. });
  4095. }
  4096. },
  4097. showWorkTime(){
  4098. this.monthWorkTimeDialog = true;
  4099. this.searchKeyword = ''
  4100. this.WorktimeDatepickValue = this.istoMonth()
  4101. if(this.WorktimeDatepickValue.length == 0){
  4102. let newdate = new Date();
  4103. let nowdate = newdate.toLocaleDateString();
  4104. let getauto = this.getAutoWeekDate(nowdate)
  4105. let nowwd = [getauto[0],getauto[6]]
  4106. this.WorktimeDatepickValue = nowwd
  4107. }
  4108. this.showMonthWorkTime()
  4109. },
  4110. handleClick(t,e){
  4111. if (t.name == "second") {
  4112. this.showMonthNotWorkTime()
  4113. }else if(t.name == "first"){
  4114. this.showMonthWorkTime()
  4115. }else if(t.name == "third"){
  4116. this.showMonthWorkTimeReminder()
  4117. } else if (t.name == "fourth") {
  4118. this.showReportTimeLessThanCardTimeList();
  4119. }
  4120. },
  4121. //导出员工每日填报工时数
  4122. exportMembWorkHours() {
  4123. this.http.post(
  4124. "/report/exportUserDailyWorkTime",
  4125. {
  4126. // month: this.date,
  4127. startDate: this.WorktimeDatepickValue[0],
  4128. endDate: this.WorktimeDatepickValue[1],
  4129. },
  4130. (res) => {
  4131. if (res.code == "ok") {
  4132. let url = res.data;
  4133. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4134. }
  4135. },
  4136. (error) => {
  4137. this.$message({
  4138. message: error,
  4139. type: "error",
  4140. });
  4141. }
  4142. );
  4143. },
  4144. exportMembWorkHoursReminder() {
  4145. this.http.post(
  4146. "/report/exportUserDailyWorkTimeReminder",
  4147. {
  4148. // month: this.date,
  4149. startDate: this.WorktimeDatepickValue[0],
  4150. endDate: this.WorktimeDatepickValue[1],
  4151. },
  4152. (res) => {
  4153. if (res.code == "ok") {
  4154. let url = res.data;
  4155. this.downloadByA('工时异常表.xlsx', url);
  4156. }
  4157. },
  4158. (error) => {
  4159. this.$message({
  4160. message: error,
  4161. type: "error",
  4162. });
  4163. }
  4164. );
  4165. },
  4166. exportMembNotWorkHours() {
  4167. this.http.post(
  4168. "/report/exportNoReportUserList",
  4169. {
  4170. // month: this.date,
  4171. startDate: this.WorktimeDatepickValue[0],
  4172. endDate: this.WorktimeDatepickValue[1],
  4173. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4174. },
  4175. (res) => {
  4176. if (res.code == "ok") {
  4177. let url = res.data;
  4178. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4179. }
  4180. },
  4181. (error) => {
  4182. this.$message({
  4183. message: error,
  4184. type: "error",
  4185. });
  4186. }
  4187. );
  4188. },
  4189. downloadByA(name, url) {
  4190. const a = document.createElement("a"); // 创建a标签
  4191. a.setAttribute("download", name); // download属性
  4192. a.setAttribute("href", url); // href链接
  4193. a.click(); // 自执行点击事件
  4194. a.remove();
  4195. },
  4196. // 是否本月判断
  4197. istoMonth(){
  4198. let todate = new Date()
  4199. let tomonth = todate.getMonth() + 1
  4200. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4201. if(this.date == adate){
  4202. return []
  4203. }else{
  4204. let sedate = new Date(this.date)
  4205. let semonth = sedate.getMonth() + 1
  4206. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4207. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4208. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4209. return [sedates1, sedates2]
  4210. }
  4211. },
  4212. showMonthWorkTime() {
  4213. this.monthTotalPage = 0,
  4214. this.tbload = true
  4215. let parameter={
  4216. startDate: this.WorktimeDatepickValue[0],
  4217. endDate: this.WorktimeDatepickValue[1],
  4218. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4219. }
  4220. this.http.post(
  4221. "/report/getUserDailyWorkTime",
  4222. // "/report/getNoReportUserList",
  4223. parameter,
  4224. (res) => {
  4225. if (res.code == "ok") {
  4226. this.tbload = false;
  4227. this.pickDateArray = res.data.days.map(item => {
  4228. return {
  4229. ...item,
  4230. dateStr: item.label.split('/')[0],
  4231. weekStr: item.label.split('/')[1]
  4232. }
  4233. });
  4234. // console.log('dataarray',res.data.days);
  4235. this.monthWorkData = res.data.list;
  4236. // this.monthWorkDataS = this.monthWorkData
  4237. // this.monthWorkDataS1 = res.data.list
  4238. this.monthTotal = res.data.list.length
  4239. if (this.monthWorkData.length > 50) {
  4240. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4241. }else{
  4242. this.monthWorkDataS = this.monthWorkData
  4243. }
  4244. this.searchScreen(0)
  4245. // this.monthWorkDataS = infoList
  4246. // 判断
  4247. // if (this.monthWorkDataS1.length > 0) {
  4248. // setTimeout(() => {
  4249. // this.tableListener()
  4250. // }, 1000);
  4251. // }
  4252. this.$nextTick(function(){
  4253. this.$refs.hasworkTbl.doLayout();
  4254. });
  4255. // this.$forceUpdate()
  4256. }
  4257. },
  4258. (error) => {
  4259. this.tbload = false
  4260. this.$message({
  4261. message: error,
  4262. type: "error",
  4263. });
  4264. }
  4265. );
  4266. },
  4267. showMonthWorkTimeReminder() {
  4268. this.monthTotalPage = 0,
  4269. this.tbload = true
  4270. let parameter={}
  4271. parameter={
  4272. startDate: this.WorktimeDatepickValue[0],
  4273. endDate: this.WorktimeDatepickValue[1],
  4274. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4275. viewValue:this.isReminder?1:0
  4276. }
  4277. this.http.post(
  4278. "/report/getUserDailyWorkTimeReminder",
  4279. parameter,
  4280. (res) => {
  4281. if (res.code == "ok") {
  4282. this.tbload = false;
  4283. this.monthWorkData = res.data.list;
  4284. this.monthTotal = res.data.list.length
  4285. if (this.monthWorkData.length > 50) {
  4286. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4287. }else{
  4288. this.monthWorkDataS = this.monthWorkData
  4289. }
  4290. this.searchScreen(0)
  4291. this.$nextTick(function(){
  4292. this.$refs.hasworkTbl.doLayout();
  4293. });
  4294. }
  4295. },
  4296. (error) => {
  4297. this.tbload = false
  4298. this.$message({
  4299. message: error,
  4300. type: "error",
  4301. });
  4302. }
  4303. );
  4304. },
  4305. showMonthNotWorkTime() {
  4306. this.monthTotalPage = 0,
  4307. this.tbload = true,
  4308. this.http.post(
  4309. "/report/getNoReportUserList",
  4310. {
  4311. startDate: this.WorktimeDatepickValue[0],
  4312. endDate: this.WorktimeDatepickValue[1],
  4313. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4314. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4315. },
  4316. (res) => {
  4317. if (res.code == "ok") {
  4318. this.tbload = false
  4319. this.monthNotWorkDate = res.data;
  4320. this.monthnotTotal = res.data.length
  4321. if (this.monthNotWorkDate.length > 50) {
  4322. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4323. } else {
  4324. this.monthNotWorkDateS = this.monthNotWorkDate
  4325. }
  4326. this.searchScreen(1)
  4327. this.$nextTick(function(){
  4328. this.$refs.hasworkTbl2.doLayout();
  4329. });
  4330. }
  4331. },
  4332. (error) => {
  4333. this.tbload = false
  4334. this.$message({
  4335. message: error,
  4336. type: "error",
  4337. });
  4338. }
  4339. );
  4340. },
  4341. listScroll(){
  4342. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4343. this.isMore = true
  4344. setTimeout(()=>{
  4345. this.isMore = false
  4346. },1000)
  4347. }else {
  4348. this.isFlag = true
  4349. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4350. this.monthWorkDataS = datalist
  4351. setTimeout(()=>{
  4352. this.isFlag = false
  4353. },300)
  4354. }
  4355. },
  4356. notListScroll(){
  4357. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4358. this.isMore = true
  4359. setTimeout(()=>{
  4360. this.isMore = false
  4361. },1000)
  4362. }else {
  4363. this.isFlag = true
  4364. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4365. this.monthNotWorkDateS = datalist
  4366. // console.log('length',this.monthNotWorkDateS.length)
  4367. setTimeout(()=>{
  4368. this.isFlag = false
  4369. },300)
  4370. }
  4371. },
  4372. getFirstAndLastDay() {
  4373. // 将选定的月份转换为Date对象
  4374. var monthDate = new Date();
  4375. var year = monthDate.getFullYear();
  4376. var month = monthDate.getMonth();
  4377. // 计算起始日和结束日
  4378. var startDay = new Date(year, month, 1);
  4379. var endDay = new Date(year, month + 1, 0);
  4380. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4381. this.WorktimeDatepickValueForMonth=lastmd
  4382. },
  4383. formatDate(date) {
  4384. var year = date.getFullYear();
  4385. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4386. var day = ("0" + date.getDate()).slice(-2);
  4387. return year + "-" + month + "-" + day;
  4388. },
  4389. // 获取默认这zhou日期参数 222
  4390. getLastWeek(e){
  4391. let newdate = new Date()
  4392. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4393. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4394. if(e==1){
  4395. this.WorktimeDatepickValue = lastwd
  4396. this.showMonthWorkTime()
  4397. }else if(e==2){
  4398. this.WorktimeDatepickValue = lastwd
  4399. this.showMonthWorkTimeReminder()
  4400. }else{
  4401. this.WorktimeDatepickValue = lastwd
  4402. this.showMonthNotWorkTime()
  4403. }
  4404. },
  4405. getThisWeek(e){
  4406. let newdate = new Date();
  4407. let nowdate = newdate.toLocaleDateString();
  4408. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4409. if(e==1){
  4410. this.WorktimeDatepickValue = nowwd
  4411. this.showMonthWorkTime()
  4412. }else if(e==2){
  4413. this.WorktimeDatepickValue = nowwd
  4414. this.showMonthWorkTimeReminder()
  4415. }else{
  4416. this.WorktimeDatepickValue = nowwd
  4417. this.showMonthNotWorkTime()
  4418. }
  4419. },
  4420. getDoubleLastWeek(e){
  4421. let newdate = new Date()
  4422. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4423. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4424. if(e==1){
  4425. this.WorktimeDatepickValue = nextwd
  4426. this.showMonthWorkTime()
  4427. }else if(e==2){
  4428. this.WorktimeDatepickValue = nextwd
  4429. this.showMonthWorkTimeReminder()
  4430. }else{
  4431. this.WorktimeDatepickValue = nextwd
  4432. this.showMonthNotWorkTime()
  4433. }
  4434. },
  4435. alreadyAllDate(stime,etime){
  4436. let diffdate = new Array();
  4437. let i=0;
  4438. while(stime<=etime){
  4439. let dateArray = stime.split("-");
  4440. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4441. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4442. let stimewk = this.weekDay[date.getDay()]
  4443. 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')
  4444. 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])
  4445. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4446. let stime_ts = new Date(stime).getTime();
  4447. let next_date = stime_ts + (24*60*60*1000);
  4448. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4449. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4450. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4451. stime = next_dates_y+next_dates_m+next_dates_d;
  4452. i++;
  4453. }
  4454. return diffdate
  4455. },
  4456. getAutoWeekDate(e) {
  4457. let dateString = e;
  4458. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4459. if (dateString.match(dateStringReg)) {
  4460. let presentDate = new Date(dateString),
  4461. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4462. return Array.from(new Array(7), function (val, index) {
  4463. let formatDate = new Date(
  4464. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4465. );
  4466. return (
  4467. formatDate.getFullYear() +
  4468. "-" +
  4469. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4470. "-" +
  4471. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4472. );
  4473. });
  4474. } else {
  4475. throw new Error(
  4476. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4477. );
  4478. }
  4479. },
  4480. onProgressChange() {
  4481. this.$forceUpdate();
  4482. },
  4483. showChooseMembTree() {
  4484. this.chosenMembCount = this.participator.length;
  4485. this.chooseParticipVisible = true;
  4486. },
  4487. onTreeItemChange() {
  4488. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4489. var list = chosenList.filter(item=>item.isUser == 1);
  4490. this.chosenMembCount = list.length;
  4491. },
  4492. findUserInTree() {
  4493. if (this.filterName == '') {
  4494. this.deptMembData = this.allMembData;
  4495. } else {
  4496. var list = this.findRecursively(this.filterName, this.allMembData);
  4497. this.deptMembData = list;
  4498. }
  4499. },
  4500. findRecursively(username, list) {
  4501. var filterList = [];
  4502. for (var i=0;i<list.length; i++) {
  4503. if (list[i].isUser == 1) {
  4504. if (list[i].label.indexOf(username) >= 0) {
  4505. //匹配上了
  4506. filterList.push(list[i]);
  4507. }
  4508. } else if (list[i].children != null && list[i].children.length > 0) {
  4509. var subList = this.findRecursively(username, list[i].children);
  4510. if (subList.length > 0) {
  4511. subList.forEach(s=>filterList.push(s));
  4512. }
  4513. }
  4514. }
  4515. return filterList;
  4516. },
  4517. //确定选择参与人
  4518. chooseParticip() {
  4519. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4520. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4521. //只能选择一个人进行代填,防止任务有问题
  4522. if (this.chosenMembList.length > 1) {
  4523. this.$message({
  4524. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4525. type: "error",
  4526. });
  4527. return;
  4528. }
  4529. this.chooseParticipVisible = false;
  4530. this.workForm.userNames = '';
  4531. this.workForm.userId = [];
  4532. this.participator = [];
  4533. for (var i=0;i<this.chosenMembList.length; i++) {
  4534. this.workForm.userId.push(this.chosenMembList[i].id);
  4535. this.workForm.userNames += this.chosenMembList[i].label+',';
  4536. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4537. this.participator.push(item);
  4538. }
  4539. if (this.workForm.userNames.length > 0) {
  4540. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4541. }
  4542. if(this.user.userNameNeedTranslate == 1) {
  4543. if(this.workForm.userNames) {
  4544. this.workForm.userNames = this.workForm.userNames.split(',')
  4545. }
  4546. }
  4547. //加载该人员的可填报项目
  4548. if (this.workForm.userId.length > 0) {
  4549. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4550. }
  4551. //打通企业微信考勤的情况,获取考勤
  4552. if (this.user.timeType.showCorpwxCardtime) {
  4553. this.getTargetUserCardTime();
  4554. }
  4555. },
  4556. getTargetUserCardTime() {
  4557. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4558. this.http.post('/user-corpwx-time/getUserCardTime',{
  4559. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4560. },
  4561. res => {
  4562. if (res.code == "ok") {
  4563. this.$set(this.workForm,'time', res.data);
  4564. }
  4565. },
  4566. error => {
  4567. this.$message({
  4568. message: error,
  4569. type: "error"
  4570. });
  4571. }
  4572. );
  4573. }
  4574. },
  4575. notifySel(sel){
  4576. // console.log(sel);
  4577. this.notifySelList = sel
  4578. },
  4579. //微信通知人员填写
  4580. Notify(code) {
  4581. if (this.notifySelList.length == 0) return;
  4582. var ids = '';
  4583. this.notifySelList.forEach(f=>{
  4584. ids += f.id+',';
  4585. })
  4586. this.http.post('/user/pushFillReport',{
  4587. ids: ids, date: this.curDate,
  4588. code: code
  4589. },
  4590. res => {
  4591. if (res.code == "ok") {
  4592. this.$message({
  4593. message: this.$t('message.sentSuccessfully'),
  4594. type: "success"
  4595. });
  4596. }
  4597. },
  4598. error => {
  4599. this.$message({
  4600. message: error,
  4601. type: "error"
  4602. });
  4603. }
  4604. );
  4605. },
  4606. //导出人员列表
  4607. exportMemb() {
  4608. if (this.fillMembList.length == 0) return;
  4609. var ids = '';
  4610. this.fillMembList.forEach(f=>{
  4611. ids += f.id+',';
  4612. })
  4613. this.http.post('/user/exportMembList',{
  4614. ids: ids,isFill: this.isFill, date: this.curDate
  4615. },
  4616. res => {
  4617. if (res.code == "ok") {
  4618. var aTag = document.createElement('a');
  4619. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4620. aTag.href = res.data;
  4621. aTag.click();
  4622. }
  4623. },
  4624. error => {
  4625. this.$message({
  4626. message: error,
  4627. type: "error"
  4628. });
  4629. }
  4630. );
  4631. },
  4632. showMembList(fill) {
  4633. this.membListVisible = true;
  4634. if (fill == 0) {
  4635. this.fillMembList = this.unFillList;
  4636. this.isFill = false;
  4637. let leaveList = []
  4638. let unleaveList = []
  4639. for(let i in this.fillMembList){
  4640. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4641. leaveList.push(this.fillMembList[i])
  4642. }else{
  4643. unleaveList.push(this.fillMembList[i])
  4644. }
  4645. }
  4646. this.fillMembList = unleaveList
  4647. this.fillMembList_leave = leaveList
  4648. } else if(fill == 1){
  4649. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4650. this.isFill = true;
  4651. }else{
  4652. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4653. this.isFill = true;
  4654. }
  4655. },
  4656. //获取自己填写的日报状态
  4657. getReportFillStatus() {
  4658. this.http.post('/report/getReportFillStatus',{
  4659. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4660. },
  4661. res => {
  4662. if (res.code == "ok") {
  4663. this.fillStatusList = res.data;
  4664. this.allDate.forEach(d=>{
  4665. var fillInfo = null;
  4666. d.state = null;
  4667. this.fillStatusList.forEach(s=>{
  4668. var d1 = s.createDate.split('-')[2];
  4669. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4670. if (d1.indexOf('0') == 0) {
  4671. d1 = d1.substring(1,d1.length);
  4672. }
  4673. if (d1 == d2) {
  4674. d.state = s.state;
  4675. d.missReport = s.missReport;//是否漏填
  4676. d.exceedCardTime = s.exceedCardTime
  4677. }
  4678. })
  4679. })
  4680. this.$forceUpdate();
  4681. }
  4682. },
  4683. error => {
  4684. this.$message({
  4685. message: error,
  4686. type: "error"
  4687. });
  4688. }
  4689. );
  4690. },
  4691. scrollFunction () {
  4692. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4693. if (this.domObj.attachEvent) { // IE
  4694. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4695. } else if (this.domObj.addEventListener) {
  4696. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4697. }
  4698. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4699. },
  4700. mouseScroll(event) { // google 浏览器下
  4701. let detail = event.wheelDelta || event.detail
  4702. let moveForwardStep = -1
  4703. let moveBackStep = 1
  4704. let step = 0
  4705. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4706. event.preventDefault() // 阻止浏览器默认事件
  4707. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4708. },
  4709. // //左右滚动
  4710. // wheel(e){
  4711. // var a = document.getElementById("dateScroll");
  4712. // var scroll_width = 80; //滚动一下的距离
  4713. // var e = e || window.event, v;
  4714. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4715. // if(v>3||-v>3) v=-v;
  4716. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4717. // e.preventDefault(); //阻止浏览器的默认滚动
  4718. // },
  4719. showExportDialog() {
  4720. this.exportType = 0
  4721. this.exportDialog = true;
  4722. },
  4723. showExportTimeDialog() {
  4724. this.exportTimeDialog = true;
  4725. },
  4726. changeAllTime() {
  4727. //总时长发生改变,自动按比例计算
  4728. this.workForm.domains.forEach(d=>{
  4729. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4730. });
  4731. //计算jsTime
  4732. if (this.workForm.createDate) {
  4733. let sdate = new Date(this.workForm.createDate[0]);
  4734. let edate = new Date(this.workForm.createDate[1]);
  4735. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4736. if (days < 0) {
  4737. days = 0;
  4738. }
  4739. this.jsTime = this.reportTimeType.allday * days;
  4740. }
  4741. },
  4742. // 是否加班的单机事件
  4743. check() {
  4744. this.selected = !this.selected
  4745. this.isNew = this.selected
  4746. },
  4747. updateSubProject() {
  4748. this.$forceUpdate();
  4749. },
  4750. selectDegreeId(domain, index) {
  4751. this.http.post('/report/defaultDegree',{
  4752. projectId: domain.projectId
  4753. },
  4754. res => {
  4755. if (res.code == "ok") {
  4756. if(res.data) {
  4757. this.workForm.domains[index].degreeId = res.data.id + ''
  4758. this.$forceUpdate();
  4759. }
  4760. }
  4761. },
  4762. error => {
  4763. this.$message({
  4764. message: error,
  4765. type: "error"
  4766. });
  4767. }
  4768. );
  4769. },
  4770. //项目选中了, 加载子项目
  4771. selectProject(domain, index) {
  4772. if(!domain.projectId){
  4773. return;
  4774. }
  4775. // 默认选中上次填写的自定义维度
  4776. if(this.yonghuUser.customDegreeActive == 1) {
  4777. this.selectDegreeId(domain, index)
  4778. }
  4779. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4780. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4781. this.http.post('/sub-project/list',{
  4782. projectId: domain.projectId,
  4783. isReport: true
  4784. },
  4785. res => {
  4786. //清空之前选中的子项目
  4787. // this.workForm.domains[index].subProjectId = 0;
  4788. if (res.code == "ok") {
  4789. this.workForm.domains[index].subProjectList = res.data;
  4790. this.workForm.domains[index].subProjectId = null;
  4791. this.$forceUpdate();
  4792. }
  4793. },
  4794. error => {
  4795. this.$message({
  4796. message: error,
  4797. type: "error"
  4798. });
  4799. }
  4800. );
  4801. //项目相关的近期任务
  4802. if (this.user.company.packageProject == 1) {
  4803. this.getRecentTaskList(domain, index);
  4804. //获取项目相关专业
  4805. if (this.user.company.packageEngineering == 1) {
  4806. this.getProjectProfessions(domain, index);
  4807. }
  4808. //获取项目下的任务分组
  4809. this.getTaskGroups(domain, index);
  4810. }
  4811. // 获取项目相关的维度
  4812. // domain.degreeId = null
  4813. this.$set(domain,'degreeId',null)
  4814. this.$set(domain,'multiDegrIdArray',null)
  4815. this.dimension(domain, index);
  4816. //获取项目审核人
  4817. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4818. this.getProjectAuditorList(domain, index);
  4819. } else {
  4820. //按分组的负责人来审核
  4821. domain.projectAuditorId = null;
  4822. domain.projectAuditorName = null;
  4823. domain.auditUserList = null;
  4824. }
  4825. if (this.reportTimeType.type == 3) {
  4826. //新增项目时,自动计算
  4827. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4828. }
  4829. //加载昱众的工作职责
  4830. if (this.user.companyId == this.yuzhongCompId) {
  4831. this.updateResponse(domain);
  4832. }
  4833. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4834. if(reportExtraField4Name || reportExtraField5Name) {
  4835. this.getInfoByProjectId(domain, index)
  4836. }
  4837. },
  4838. getInfoByProjectId(domain, index, flag = true) {
  4839. const { projectId } = domain
  4840. const projectList = this.fillProjectList || this.subFillProjectList
  4841. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4842. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4843. projectId: projectCode,
  4844. date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1]
  4845. },
  4846. res => {
  4847. if (res.code == "ok") {
  4848. if(flag) {
  4849. this.workForm.domains[index].extraField4 = ''
  4850. this.workForm.domains[index].extraField5 = ''
  4851. }
  4852. if((res.data.orderIds || []).length > 0) {
  4853. this.workForm.domains[index].extraField4 = res.data.orderIds[0]
  4854. }
  4855. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4856. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4857. this.$forceUpdate();
  4858. }
  4859. },
  4860. error => {
  4861. this.$message({
  4862. message: error,
  4863. type: "error"
  4864. });
  4865. }
  4866. );
  4867. },
  4868. getRecentTaskList(domain, index) {
  4869. //刷新任务时,清空服务
  4870. this.$set(domain, 'sapServiceId', null);
  4871. this.$set(domain, 'taskId', null);
  4872. var param = {
  4873. projectId: domain.projectId,
  4874. isSubstitude:this.isSubstitude?1:0,
  4875. };
  4876. if (domain.groupId) {
  4877. param.groupId = domain.groupId;
  4878. }
  4879. if (domain.stage) {
  4880. param.stage = domain.stage;
  4881. }
  4882. //专业版代填,获取代填员工的任务
  4883. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4884. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4885. this.$message({
  4886. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4887. type: "error"
  4888. });
  4889. return;
  4890. } else {
  4891. param.userId = this.workForm.userId[0];
  4892. }
  4893. }
  4894. this.http.post('/task/getRecentTask',param,
  4895. res => {
  4896. if (res.code == "ok") {
  4897. this.workForm.domains[index].allTaskList = res.data;
  4898. this.workForm.domains[index].taskList = res.data;
  4899. this.$forceUpdate();
  4900. }
  4901. },
  4902. error => {
  4903. this.$message({
  4904. message: error,
  4905. type: "error"
  4906. });
  4907. }
  4908. );
  4909. },
  4910. //获取项目审核人
  4911. getProjectAuditorList(domainItem, index) {
  4912. if(domainItem.projectId == '') {
  4913. return
  4914. }
  4915. domainItem.projectAuditorId = null;
  4916. domainItem.projectAuditorName = null;
  4917. var param = { projectId: domainItem.projectId};
  4918. if (this.isSubstitude) {
  4919. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4920. param.userId = this.workForm.userId[0];
  4921. }
  4922. }
  4923. this.http.post('/project-auditor/getList',param,
  4924. res => {
  4925. if (res.code == "ok") {
  4926. domainItem.auditUserList = res.data;
  4927. if (res.data.length==0) {
  4928. this.$message({
  4929. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4930. type: "error"
  4931. });
  4932. } else if (res.data.length==1) {
  4933. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4934. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4935. }
  4936. this.$forceUpdate();
  4937. }
  4938. },
  4939. error => {
  4940. this.$message({
  4941. message: error,
  4942. type: "error"
  4943. });
  4944. }
  4945. );
  4946. },
  4947. // 获取维度数据
  4948. dimension(domain, index) {
  4949. if(domain.projectId == '') {
  4950. return
  4951. }
  4952. this.http.post('/project/getDegreeList',{
  4953. projectId: domain.projectId,
  4954. },
  4955. res => {
  4956. if (res.code == "ok") {
  4957. // console.log("维度数据",res.data);
  4958. this.workForm.domains[index].wuduList = res.data
  4959. // this.workForm = this.workForm
  4960. this.$forceUpdate()
  4961. }
  4962. },
  4963. error => {
  4964. this.$message({
  4965. message: error,
  4966. type: "error"
  4967. });
  4968. }
  4969. );
  4970. },
  4971. //切换任务阶段
  4972. changeStages(domain, index) {
  4973. if (domain.stage == null || domain.stage == '') {
  4974. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4975. } else {
  4976. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4977. }
  4978. this.getRecentTaskList(domain, index);
  4979. this.$forceUpdate();
  4980. },
  4981. getGroupStages(domain, index, keepStage) {
  4982. // console.log(domain);
  4983. if(!domain.groupId){
  4984. domain.projectAuditorId = ''
  4985. domain.stages = []
  4986. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4987. domain.taskId = ''
  4988. domain.sapServiceId = ''
  4989. }
  4990. if(this.user.timeType.reportAuditType >= 1){
  4991. domain.auditUserList = []
  4992. }
  4993. this.$forceUpdate();
  4994. return
  4995. }
  4996. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4997. res => {
  4998. if (res.code == "ok") {
  4999. if (!keepStage) {
  5000. domain.stage = '';
  5001. }
  5002. domain.stages = res.data;
  5003. this.getRecentTaskList(domain, index);
  5004. this.$forceUpdate();
  5005. }
  5006. },
  5007. error => {
  5008. this.$message({
  5009. message: error,
  5010. type: "error"
  5011. });
  5012. });
  5013. //检查当前的项目是否需要获取分组的负责人
  5014. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  5015. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  5016. res => {
  5017. if (res.code == "ok") {
  5018. domain.getProjectAuditorList = res.data;
  5019. domain.auditUserList = res.data;
  5020. if (res.data.length==1) {
  5021. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  5022. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  5023. } else if (res.data.length==0) {
  5024. domain.projectAuditorId = null;
  5025. domain.projectAuditorName = null;
  5026. }
  5027. this.$forceUpdate();
  5028. }
  5029. },
  5030. error => {
  5031. this.$message({
  5032. message: error,
  5033. type: "error"
  5034. });
  5035. });
  5036. }
  5037. },
  5038. getProjectProfessions(domain, index) {
  5039. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  5040. res => {
  5041. if (res.code == "ok") {
  5042. this.workForm.domains[index].professionProgress = res.data;
  5043. this.$forceUpdate();
  5044. }
  5045. },
  5046. error => {
  5047. this.$message({
  5048. message: error,
  5049. type: "error"
  5050. });
  5051. });
  5052. },
  5053. //删除自己的日报
  5054. deleteReport() {
  5055. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5056. confirmButtonText: this.$t('btn.determine'),
  5057. cancelButtonText: this.$t('btn.cancel'),
  5058. type: "warning"
  5059. })
  5060. .then(() => {
  5061. this.listLoading = true;
  5062. this.http.post('/report/delete',{
  5063. userId: this.user.id,
  5064. date: this.workForm.createDate
  5065. },
  5066. res => {
  5067. this.listLoading = false;
  5068. if (res.code == "ok") {
  5069. this.$message({
  5070. message: this.$t('message.successfullyDeleted'),
  5071. type: "success"
  5072. });
  5073. this.getReportList();
  5074. this.getDepartment();
  5075. this.dialogVisible = false;
  5076. } else {
  5077. this.$message({
  5078. message: res.msg,
  5079. type: "error"
  5080. });
  5081. }
  5082. },
  5083. error => {
  5084. this.listLoading = false;
  5085. this.$message({
  5086. message: error,
  5087. type: "error"
  5088. });
  5089. }
  5090. );
  5091. })
  5092. .catch(() => {});
  5093. },
  5094. // 管理员删除日报
  5095. guanli(item) {
  5096. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5097. let param = {date: this.date + day, userId: item.id};
  5098. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5099. confirmButtonText: this.$t('btn.determine'),
  5100. cancelButtonText: this.$t('btn.cancel'),
  5101. type: "warning"
  5102. })
  5103. .then(() => {
  5104. this.listLoading = true;
  5105. this.http.post('/report/delete',param,
  5106. res => {
  5107. this.listLoading = false;
  5108. if (res.code == "ok") {
  5109. this.$message({
  5110. message: this.$t('message.successfullyDeleted'),
  5111. type: "success"
  5112. });
  5113. this.getReportList();
  5114. this.getDepartment();
  5115. this.dialogVisible = false;
  5116. } else {
  5117. this.$message({
  5118. message: res.msg,
  5119. type: "error"
  5120. });
  5121. }
  5122. },
  5123. error => {
  5124. this.listLoading = false;
  5125. this.$message({
  5126. message: error,
  5127. type: "error"
  5128. });
  5129. }
  5130. );
  5131. })
  5132. .catch(() => {});
  5133. },
  5134. selectAll() {
  5135. if (this.isAllSelect) {
  5136. var keys = [];
  5137. this.reportNames.forEach(b=>{
  5138. keys.push(b.id);
  5139. })
  5140. this.$refs.approveTree.setCheckedKeys(keys);
  5141. } else {
  5142. this.$refs.approveTree.setCheckedKeys([]);
  5143. }
  5144. },
  5145. removeEmptyNode(list) {
  5146. for (var i=0;i<list.length;i++) {
  5147. var cnt = 0;
  5148. if (list[i].membCount == 0) {
  5149. list.splice(i, 1);
  5150. i--;
  5151. } else if (list[i].children != null) {
  5152. this.removeEmptyNode(list[i].children);
  5153. }
  5154. }
  5155. },
  5156. calculateMembCount(list) {
  5157. for (var i in list) {
  5158. var cnt = 0;
  5159. if (list[i].children != null) {
  5160. this.calculateMembCount(list[i].children);
  5161. for (var m in list[i].children) {
  5162. cnt += list[i].children[m].membCount;
  5163. }
  5164. }
  5165. if (list[i].isUser == 1) {
  5166. cnt++;
  5167. this.membCount++;
  5168. }
  5169. list[i].membCount = cnt;
  5170. }
  5171. },
  5172. stateChange() {
  5173. // console.log(this.allData,'alldate');
  5174. this.membCount = 0;
  5175. if (this.selectState == -1) {
  5176. //全部状态
  5177. this.data = this.allData;
  5178. } else {
  5179. //未填报
  5180. this.seluserText = ''
  5181. var newData = JSON.parse(JSON.stringify(this.allData));
  5182. this.filterState(this.selectState, newData);
  5183. this.data = newData;
  5184. }
  5185. this.calculateMembCount(this.data);
  5186. this.data[0].membCount = this.membCount;//总人数
  5187. },
  5188. //按状态过滤部门人员
  5189. filterState(state, list) {
  5190. for (var i =0;i<list.length; i++) {
  5191. var obj = list[i];
  5192. if (obj.isUser == 1) {
  5193. var match = false;
  5194. if (state == -2) {
  5195. if (obj.state == null) {
  5196. match = true;
  5197. }
  5198. } else {
  5199. if (obj.state == state) {
  5200. match = true;
  5201. }
  5202. }
  5203. if (!match) {
  5204. list.splice(i, 1);
  5205. i--;
  5206. } else {
  5207. }
  5208. } else {
  5209. if (obj.children != null) {
  5210. this.filterState(state, obj.children);
  5211. }
  5212. }
  5213. }
  5214. },
  5215. //a按名称过滤部门人员
  5216. async seluserforText(){
  5217. const { userNameNeedTranslate } = this.user
  5218. this.membCount = 0;
  5219. var newData = JSON.parse(JSON.stringify(this.allData));
  5220. let textList = [this.seluserText]
  5221. if(userNameNeedTranslate == 1) {
  5222. this.dataLoading = true
  5223. let res = await this.postData('/user/getEmployeeList', {
  5224. keyword: this.seluserText,
  5225. cursor: '',
  5226. departmentId: -1,
  5227. pageIndex: 1,
  5228. pageSize: 1000
  5229. })
  5230. textList = res.data.records.map(item => item.name)
  5231. this.dataLoading = false
  5232. }
  5233. // return
  5234. this.seluserforTextin(this.seluserText, newData, textList)
  5235. this.data = newData;
  5236. this.calculateMembCount(this.data);
  5237. this.data[0].membCount = this.membCount;//总人数
  5238. },
  5239. seluserforTextin(text, list, textList = []){
  5240. for (var i =0;i<list.length; i++) {
  5241. var obj = list[i];
  5242. if (obj.isUser == 1) {
  5243. var match = false;
  5244. // if (obj.label.indexOf(text) != -1) {
  5245. // match = true
  5246. // }
  5247. if(textList.some(item => item.includes(obj.label))) {
  5248. match = true
  5249. }
  5250. if (!match) {
  5251. list.splice(i, 1);
  5252. i--;
  5253. } else {
  5254. }
  5255. } else {
  5256. if (obj.children != null) {
  5257. this.seluserforTextin(text, obj.children, textList);
  5258. }
  5259. }
  5260. }
  5261. },
  5262. // 当节点发生变化时
  5263. nodeChangeExpand(data) {
  5264. // 保存当前展开的节点
  5265. let flag = false
  5266. this.nodeModelData.some(item => {
  5267. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5268. flag = true
  5269. return true
  5270. }
  5271. })
  5272. if (!flag) { // 不存在则存到数组里
  5273. this.nodeModelData.push(data.id)
  5274. }
  5275. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5276. },
  5277. nodeChangeCollapse(data) {
  5278. this.nodeModelData.some((item, i) => {
  5279. if (item === data.id) {
  5280. this.nodeModelData.length = i
  5281. }
  5282. })
  5283. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5284. },
  5285. // 部门列表点击
  5286. handleNodeClick(data) {
  5287. // this.dealList = data
  5288. this.theValues(data.id, this.allData)
  5289. // this.depData = data;
  5290. var list = [];
  5291. if (data.id == -1) {
  5292. this.deptId = null;
  5293. this.targetUid = null;
  5294. list = this.data;
  5295. } else if (data.isUser == 1) {
  5296. this.deptId = null;
  5297. this.targetUid = data.id;
  5298. } else {
  5299. this.deptId = data.id;
  5300. this.targetUid = null;
  5301. list.push(data);
  5302. }
  5303. this.getReportList();
  5304. if (list.length > 0) {
  5305. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5306. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5307. }
  5308. },
  5309. exportPushLog(){
  5310. this.http.post('/sap-sync-log/export',{},
  5311. res => {
  5312. if (res.code == "ok") {
  5313. var filePath = res.data;
  5314. var fName = '推送日志.xlsx'
  5315. const a = document.createElement('a'); // 创建a标签
  5316. a.setAttribute('download', fName);// download属性
  5317. a.setAttribute('href', filePath);// href链接
  5318. a.click(); //自执行点击事件
  5319. a.remove();
  5320. } else {
  5321. this.$message({
  5322. message: res.msg,
  5323. type: "error"
  5324. });
  5325. }
  5326. },
  5327. error => {
  5328. this.$message({
  5329. message: error,
  5330. type: "error"
  5331. });
  5332. });
  5333. },
  5334. theValues(id, item) {
  5335. for(var i in item) {
  5336. if(item[i].id == id) {
  5337. this.depData = item[i]
  5338. if(id == '-1') {
  5339. this.translation = '1'
  5340. } else {
  5341. if(item[i].children) {
  5342. this.translation = '2'
  5343. } else {
  5344. this.translation = '3'
  5345. }
  5346. }
  5347. return
  5348. } else {
  5349. if(item[i].children) {
  5350. this.theValues(id, item[i].children)
  5351. }
  5352. }
  5353. }
  5354. },
  5355. //获取可以选择的代填的人员列表
  5356. getSubstitudeUserDeptList() {
  5357. if (this.deptMembData.length == 0) {
  5358. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5359. res => {
  5360. if (res.code == "ok") {
  5361. let noAllData = JSON.parse(JSON.stringify(res.data));
  5362. if (noAllData.length > 0) {
  5363. // if (noAllData[0].label == '全部人员') {
  5364. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5365. noAllData.splice(0,1);
  5366. }
  5367. }
  5368. this.setUserToDept(noAllData);
  5369. this.deptMembData = noAllData;
  5370. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5371. } else {
  5372. this.$message({
  5373. message: res.msg,
  5374. type: "error"
  5375. });
  5376. }
  5377. },
  5378. error => {
  5379. this.$message({
  5380. message: error,
  5381. type: "error"
  5382. });
  5383. });
  5384. }
  5385. },
  5386. // 获取部门列表
  5387. getDepartmentForApprove() {
  5388. this.http.post( this.port.manage.depList, {},
  5389. res => {
  5390. if (res.code == "ok") {
  5391. var list1 = JSON.parse(JSON.stringify(res.data));
  5392. this.deptOptionList = this.changeArr(list1);
  5393. } else {
  5394. this.$message({
  5395. message: res.msg,
  5396. type: "error"
  5397. });
  5398. }
  5399. },
  5400. error => {
  5401. this.$message({
  5402. message: error,
  5403. type: "error"
  5404. });
  5405. });
  5406. },
  5407. // 获取部门列表
  5408. getDepartment() {
  5409. //如果没有权限,就不需要获取
  5410. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5411. return;
  5412. }
  5413. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5414. var param = {date:this.date + day};
  5415. this.http.post("/report/getMembList", param,
  5416. res => {
  5417. if (res.code == "ok") {
  5418. if(res.data.length == 0){
  5419. return
  5420. }
  5421. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5422. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5423. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5424. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5425. // if (this.user.role > 0) {
  5426. // }
  5427. list.splice(0,0,{
  5428. id: -1,
  5429. label: this.$t('lable.allStaff'),
  5430. })
  5431. this.membCount = 0;
  5432. //设置员工到部门下面
  5433. this.setUserToDept(list);
  5434. this.data = list;
  5435. // console.log('data',this.data);
  5436. this.expandDate = [this.data[1].id]
  5437. this.allData = list;
  5438. // if (noAllData.length > 0) {
  5439. // if (noAllData[0].label == '全部人员') {
  5440. // noAllData.splice(0,1);
  5441. // }
  5442. // }
  5443. // this.setUserToDept(noAllData);
  5444. // this.deptMembData = noAllData;
  5445. this.option = this.changeArr(list1);
  5446. list[0].membCount = this.membCount;
  5447. if (this.depData.id == -1) {
  5448. this.depData.membCount = this.membCount;
  5449. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5450. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5451. } else {
  5452. if (this.depData.isUser == null) {
  5453. var dep = this.findTargetDept(this.data, this.depData.id);
  5454. var membDeptList = [];
  5455. membDeptList.push(dep);
  5456. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5457. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5458. }
  5459. }
  5460. if (this.depData.isUser == null) {
  5461. if (this.isFill) {
  5462. this.fillMembList = this.fillList;
  5463. } else {
  5464. this.fillMembList = this.unFillList;
  5465. }
  5466. }
  5467. this.leaveAllNum = 0
  5468. for(let i in this.unFillList){
  5469. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5470. this.leaveAllNum += 1
  5471. }
  5472. }
  5473. this.stateChange()
  5474. } else {
  5475. this.$message({
  5476. message: res.msg,
  5477. type: "error"
  5478. });
  5479. }
  5480. },
  5481. error => {
  5482. this.$message({
  5483. message: error,
  5484. type: "error"
  5485. });
  5486. });
  5487. this.getReportFillStatus();
  5488. },
  5489. findTargetDept(list, deptId) {
  5490. var t = null;
  5491. for (var i=0;i<list.length; i++) {
  5492. if (list[i].isUser == null && list[i].id == deptId) {
  5493. t = list[i];
  5494. break;
  5495. }
  5496. }
  5497. if (t == null) {
  5498. for (var i=0;i<list.length; i++) {
  5499. if (list[i].children != null && list[i].children.length > 0) {
  5500. t = this.findTargetDept(list[i].children, deptId);
  5501. if (t != null) {
  5502. break;
  5503. }
  5504. }
  5505. }
  5506. }
  5507. return t;
  5508. },
  5509. getUserMembListFromDeptList(list, isFill) {
  5510. var membList = [];
  5511. for (var i in list) {
  5512. var deptName = list[i].label;
  5513. if (list[i].userList != null) {
  5514. list[i].userList.forEach(element => {
  5515. if (isFill == 0) {
  5516. //获取未填的
  5517. if (element.state == null) {
  5518. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5519. membList.push(obj);
  5520. }
  5521. } else {
  5522. if (element.state != null) {
  5523. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5524. membList.push(obj);
  5525. }
  5526. }
  5527. });
  5528. }
  5529. if (list[i].children != null) {
  5530. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5531. }
  5532. }
  5533. return membList;
  5534. },
  5535. setUserToDept(list) {
  5536. for (var i in list) {
  5537. var cnt = 0;
  5538. if (list[i].children != null) {
  5539. this.setUserToDept(list[i].children);
  5540. for (var m in list[i].children) {
  5541. cnt += list[i].children[m].membCount;
  5542. }
  5543. }
  5544. if (list[i].userList != null) {
  5545. if (list[i].children == null) {
  5546. list[i].children = [];
  5547. }
  5548. list[i].userList.forEach(element => {
  5549. var obj = {
  5550. id: element.id,
  5551. label:element.name,
  5552. state:element.state,
  5553. parentId:element.departmentId,
  5554. isUser:1,
  5555. workingTime: element.workingTime,
  5556. leaveDays: element.leaveDays,
  5557. leaveTimes: element.leaveTimes
  5558. };
  5559. list[i].children.push(obj);
  5560. this.membCount++;
  5561. cnt++;
  5562. });
  5563. }
  5564. list[i].membCount = cnt;
  5565. }
  5566. },
  5567. // 修改数组
  5568. changeArr(arr) {
  5569. for (var i = 0; i < arr.length; i++) {
  5570. if(arr[i].id != -1 && arr[i].id != 0) {
  5571. if (arr[i].children != null && arr[i].children.length>0) {
  5572. arr[i].children = this.changeArr(arr[i].children);
  5573. }
  5574. arr[i].id && (arr[i].value = arr[i].id);
  5575. delete arr[i].id;
  5576. }
  5577. }
  5578. for(var i in arr) {
  5579. if(arr[i].id == -1 || arr[i].id == 0) {
  5580. arr.splice(i,1)
  5581. }
  5582. }
  5583. return arr;
  5584. },
  5585. //时间段范围设置改动,监听
  5586. onTimeTypeChange(timeType) {
  5587. this.seleChn(1)
  5588. this.showAddMore = true;
  5589. for(var i in this.workForm.domains) {
  5590. if (this.workForm.domains[i].timeType == 0) {
  5591. this.showAddMore = false;
  5592. break;
  5593. }
  5594. }
  5595. if (this.showAddMore) {
  5596. //检测数量
  5597. if (this.workForm.domains.length == 2) {
  5598. this.showAddMore = false;
  5599. } else {
  5600. this.showAddMore = true;
  5601. }
  5602. }
  5603. },
  5604. getTimeType() {
  5605. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5606. res => {
  5607. if (res.code == "ok") {
  5608. var t = res.data;
  5609. this.reportTimeType = t;
  5610. if (this.reportTimeType.type > 0) {
  5611. this.showAddMore = true;
  5612. }
  5613. //转化时间格式
  5614. if (t.allday != null) {
  5615. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5616. }
  5617. if (t.am != null) {
  5618. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5619. }
  5620. if (t.pm != null) {
  5621. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5622. }
  5623. let arr = []
  5624. for(var i in res.data.excludeTimeList) {
  5625. let obj = {
  5626. s: res.data.excludeTimeList[i].startTime,
  5627. e: res.data.excludeTimeList[i].endTime,
  5628. }
  5629. arr.push(obj)
  5630. }
  5631. this.vacationTime = arr
  5632. } else {
  5633. this.$message({
  5634. message: res.msg,
  5635. type: "error"
  5636. });
  5637. }
  5638. },
  5639. error => {
  5640. this.listLoading = false;
  5641. this.$message({
  5642. message: error,
  5643. type: "error"
  5644. });
  5645. });
  5646. },
  5647. // 改变月份 -------
  5648. changeMonthOut() {
  5649. this.getAllDate();
  5650. this.getReportList();
  5651. this.getDepartment();
  5652. },
  5653. // 选择日期
  5654. choseDate(i, item) {
  5655. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5656. return
  5657. }
  5658. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5659. this.choseDay = i;
  5660. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5661. sessionStorage.msg = this.date + day,
  5662. this.getReportList();
  5663. this.getDepartment();
  5664. this.curDate = item.date;
  5665. },
  5666. canClick(i, item){
  5667. let nowDate = new Date()
  5668. let nowDateYear = nowDate.getFullYear()
  5669. let itemYear = parseInt(this.date.split('-')[0])
  5670. let nowDateMonth = nowDate.getMonth() + 1
  5671. let itemMonth = parseInt(this.date.split('-')[1])
  5672. let nowDateDay = nowDate.getDate()
  5673. let itemDay = parseInt(item.showDate.split('.')[1])
  5674. if(nowDateYear < itemYear){
  5675. return false
  5676. }else if(nowDateYear == itemYear){
  5677. if(nowDateMonth < itemMonth){
  5678. return false
  5679. }else if(nowDateMonth == itemMonth){
  5680. if(nowDateDay < itemDay){
  5681. return false
  5682. }
  5683. }
  5684. }
  5685. },
  5686. // 获取日期列表
  5687. getAllDate(e) {
  5688. var dayArry = [];
  5689. var day = this.getCountDays();
  5690. let curMonthDay = null;
  5691. for (var k = 1; k <= day; k++) {
  5692. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5693. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5694. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5695. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5696. if(sessionStorage.msg) {
  5697. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5698. this.choseDay = k - 1;
  5699. curMonthDay = str;
  5700. }
  5701. } else {
  5702. if (new Date().getDate() == k) {
  5703. this.choseDay = k - 1;
  5704. }
  5705. }
  5706. } else {
  5707. this.choseDay = 0;
  5708. }
  5709. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5710. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5711. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5712. }
  5713. this.allDate = dayArry;
  5714. //不能超过最大日期
  5715. if (this.choseDay > day-1) {
  5716. this.choseDay = day-1;
  5717. }
  5718. if(sessionStorage.from != 1){
  5719. let nowmonth = new Date().getMonth() + 1
  5720. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5721. let nowdate = new Date().getDate()
  5722. if(nowd == this.date){
  5723. if(e && sessionStorage.msg){
  5724. }else{
  5725. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5726. }
  5727. let nowday = new Date(sessionStorage.msg).getDate()
  5728. this.choseDay = nowday - 1
  5729. let monthdate = new Date(sessionStorage.msg)
  5730. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5731. }else{
  5732. if(e && sessionStorage.msg){
  5733. }else{
  5734. sessionStorage.msg = this.date + '-01'
  5735. }
  5736. let monthdate = new Date(sessionStorage.msg)
  5737. this.choseDay = monthdate.getDate() - 1
  5738. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5739. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5740. }
  5741. }else{
  5742. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5743. }
  5744. //从消息点击跳转过来的,直接加载指定日期
  5745. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5746. this.curDate = sessionStorage.msg;
  5747. sessionStorage.from = 0;
  5748. } else {
  5749. // if (curMonthDay != null) {
  5750. // // this.curDate = curMonthDay;
  5751. // let d = new Date(sessionStorage.msg)
  5752. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5753. // } else {
  5754. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5755. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5756. // }
  5757. }
  5758. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5759. // if(!sessionStorage.msg){
  5760. // let msgday = this.choseDay + 1
  5761. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5762. // }
  5763. this.getReportFillStatus();
  5764. },
  5765. getCountDays() {
  5766. var newstr = this.date.replace(/-/g, "/");
  5767. var curDate = new Date(newstr+'/01');
  5768. var curMonth = curDate.getMonth();
  5769. curDate.setMonth(curMonth + 1);
  5770. curDate.setDate(0);
  5771. return curDate.getDate();
  5772. },
  5773. reqMore() {
  5774. if (this.hasMore) {
  5775. this.pageIndex++;
  5776. this.requestHttpReports();
  5777. }
  5778. },
  5779. //加载日报数据
  5780. requestHttpReports() {
  5781. //请求数据
  5782. this.listLoading = true;
  5783. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5784. let param = {date: this.date + day};
  5785. if (this.deptId) {
  5786. param.deptId = this.deptId;
  5787. }
  5788. if (this.targetUid) {
  5789. param.userId = this.targetUid;
  5790. }
  5791. //传页码
  5792. if (this.hasMore) {
  5793. param.pageIndex = this.pageIndex;
  5794. }
  5795. this.http.post( this.port.report.list, param,
  5796. res => {
  5797. this.listLoading = false;
  5798. if (res.code == "ok") {
  5799. //扩增
  5800. if (res.data.data.length > 0) {
  5801. this.reportList = this.reportList.concat(res.data.data);
  5802. } else if (this.pageIndex > 1){
  5803. this.$message({
  5804. message: this.$t('meiYouGengDuoShuJuLe'),
  5805. type: "info"
  5806. });
  5807. }
  5808. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5809. if(document.querySelector("#day"+this.choseDay)){
  5810. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5811. }
  5812. } else {
  5813. this.$message({
  5814. message: res.msg,
  5815. type: "error"
  5816. });
  5817. }
  5818. },
  5819. error => {
  5820. this.listLoading = false;
  5821. this.$message({
  5822. message: error,
  5823. type: "error"
  5824. });
  5825. });
  5826. },
  5827. //获取日报列表
  5828. getReportList() {
  5829. //初始化,重置数据
  5830. this.pageIndex = 0;
  5831. this.hasMore = true;
  5832. this.reportList = [];
  5833. this.requestHttpReports();
  5834. },
  5835. //刷新日报状态,用于审核后更新
  5836. refreshReportData(reportId) {
  5837. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5838. res => {
  5839. if (res.code == "ok") {
  5840. for (var m=0;m<this.reportList.length; m++) {
  5841. var d = this.reportList[m].data;
  5842. var find = d.filter(r=>r.id == reportId);
  5843. if (find.length > 0) {
  5844. find[0].state = res.data.state;
  5845. if (find[0].state == 2) {//被驳回,要可以编辑
  5846. this.reportList[m].state = 2;
  5847. }
  5848. find[0].isDeptAudit = res.data.isDeptAudit;
  5849. find[0].departmentAuditState = res.data.departmentAuditState;
  5850. find[0].projectAuditorName = res.data.projectAuditorName;
  5851. find[0].projectAuditorId = res.data.projectAuditorId;
  5852. find[0].projectAuditState = res.data.projectAuditState;
  5853. find[0].rejectUserid = res.data.rejectUserid;
  5854. find[0].rejectUsername = res.data.rejectUsername;
  5855. find[0].rejectReason = res.data.rejectReason;
  5856. this.$forceUpdate();
  5857. break;
  5858. }
  5859. }
  5860. } else {
  5861. this.$message({
  5862. message: res.msg,
  5863. type: "error"
  5864. });
  5865. }
  5866. },
  5867. error => {
  5868. this.listLoading = false;
  5869. this.$message({
  5870. message: error,
  5871. type: "error"
  5872. });
  5873. });
  5874. },
  5875. //导出员工工时统计
  5876. exportUserTime() {
  5877. this.listLoading = true;
  5878. var param = {};
  5879. if (this.exportParam.dateRange != null) {
  5880. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5881. }
  5882. this.http.post('/department/exportDeptStatistic', param,
  5883. res => {
  5884. this.listLoading = false;
  5885. if (res.code == "ok") {
  5886. location.href = res.data;
  5887. this.exportTimeDialog = false;
  5888. } else {
  5889. this.$message({
  5890. message: res.msg,
  5891. type: "error"
  5892. });
  5893. }
  5894. },
  5895. error => {
  5896. this.listLoading = false;
  5897. this.$message({
  5898. message: error,
  5899. type: "error"
  5900. });
  5901. });
  5902. },
  5903. //导出日报
  5904. exportReport() {
  5905. this.exportingData = true;
  5906. var param = {};
  5907. if (this.exportParam.dateRange != null) {
  5908. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5909. }
  5910. if (this.exportParam.projectId != null) {
  5911. param.projectId = this.exportParam.projectId;
  5912. }
  5913. if (this.exportParam.departmentId != null) {
  5914. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5915. param.departmentIds = this.exportParam.departmentId.join(',')
  5916. }
  5917. param.stateKey = this.stateKey
  5918. // param.departmentId = this.user.departmentId
  5919. this.http.post(this.port.report.export, param,
  5920. res => {
  5921. this.exportingData = false;
  5922. if (res.code == "ok") {
  5923. var filePath = res.data;
  5924. const a = document.createElement('a'); // 创建a标签
  5925. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5926. a.setAttribute('href', filePath);// href链接
  5927. a.click(); //自执行点击事件
  5928. a.remove();
  5929. this.exportDialog = false;
  5930. } else {
  5931. this.$message({
  5932. message: res.msg,
  5933. type: "error"
  5934. });
  5935. }
  5936. },
  5937. error => {
  5938. this.exportingData = false;
  5939. this.$message({
  5940. message: error,
  5941. type: "error"
  5942. });
  5943. });
  5944. },
  5945. //导出日报审核记录
  5946. exportReportLog() {
  5947. this.exportingData = true;
  5948. var param = {};
  5949. if (this.exportReportLogParam.dateRange != null) {
  5950. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5951. }
  5952. this.http.post('/report-log/exportReportLog', param,
  5953. res => {
  5954. this.exportingData = false;
  5955. if (res.code == "ok") {
  5956. var filePath = res.data;
  5957. const a = document.createElement('a'); // 创建a标签
  5958. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5959. a.setAttribute('href', filePath);// href链接
  5960. a.click(); //自执行点击事件
  5961. a.remove();
  5962. this.exportDialog = false;
  5963. } else {
  5964. this.$message({
  5965. message: res.msg,
  5966. type: "error"
  5967. });
  5968. }
  5969. },
  5970. error => {
  5971. this.exportingData = false;
  5972. this.$message({
  5973. message: error,
  5974. type: "error"
  5975. });
  5976. });
  5977. },
  5978. restUserCardTime(item){
  5979. let param={}
  5980. param.userId=item.userId
  5981. param.createDate=item.createDate
  5982. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5983. res => {
  5984. if (res.code == "ok") {
  5985. this.showMonthWorkTimeReminder()
  5986. } else {
  5987. this.$message({
  5988. message: res.msg,
  5989. type: "error"
  5990. });
  5991. }
  5992. },
  5993. error => {
  5994. this.$message({
  5995. message: error,
  5996. type: "error"
  5997. });
  5998. });
  5999. },
  6000. importReportLog(item){
  6001. //首先判断文件类型
  6002. let str = item.file.name.split(".");
  6003. let format = str[str.length - 1];
  6004. if (format != "xls" && format != "xlsx") {
  6005. this.$message({
  6006. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  6007. type: "error"
  6008. });
  6009. } else {
  6010. const loading = this.$loading({
  6011. lock: true,
  6012. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  6013. spinner: 'el-icon-loading',
  6014. background: 'rgba(0, 0, 0, 0.7)'
  6015. });
  6016. let formData = new FormData();
  6017. formData.append("multipartFile", item.file);
  6018. this.http.uploadFile('/report-log/importReportLogChange', formData,
  6019. res => {
  6020. this.$refs.upload.clearFiles();
  6021. loading.close();
  6022. if (res.code == "ok") {
  6023. this.$message({
  6024. message: res.msg,
  6025. type: "success"
  6026. });
  6027. } else {
  6028. this.$message({
  6029. message: res.msg,
  6030. type: "error"
  6031. });
  6032. }
  6033. },
  6034. error => {
  6035. this.$refs.upload.clearFiles();
  6036. loading.close();
  6037. this.$message({
  6038. message: error,
  6039. type: "error"
  6040. });
  6041. });
  6042. }
  6043. },
  6044. //获取项目列表
  6045. getProjectList() {
  6046. this.listLoading = true;
  6047. this.http.post( this.port.project.list, {},
  6048. res => {
  6049. this.listLoading = false;
  6050. if (res.code == "ok") {
  6051. for(var i in res.data) {
  6052. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6053. res.data[i].projectCode = ''
  6054. }
  6055. }
  6056. this.projectList = res.data;
  6057. } else {
  6058. this.$message({
  6059. message: res.msg,
  6060. type: "error"
  6061. });
  6062. }
  6063. },
  6064. error => {
  6065. this.listLoading = false;
  6066. this.$message({
  6067. message: error,
  6068. type: "error"
  6069. });
  6070. });
  6071. },
  6072. getSubUsersFillProjectList(userId) {
  6073. this.http.post( this.port.project.list, {
  6074. forReport: 1,
  6075. userId: userId
  6076. },res => {
  6077. if (res.code == "ok") {
  6078. for(var i in res.data) {
  6079. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6080. res.data[i].projectCode = ''
  6081. }
  6082. }
  6083. this.subFillProjectList = res.data;
  6084. this.getRecentlyProject(userId)
  6085. } else {
  6086. this.$message({
  6087. message: res.msg,
  6088. type: "error"
  6089. });
  6090. }
  6091. },
  6092. error => {
  6093. this.$message({
  6094. message: error,
  6095. type: "error"
  6096. });
  6097. });
  6098. },
  6099. // 获取填报日报的项目下拉列表
  6100. getFillProjectList() {
  6101. this.http.post( this.port.project.list, {
  6102. forReport: 1
  6103. },res => {
  6104. if (res.code == "ok") {
  6105. for(var i in res.data) {
  6106. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6107. res.data[i].projectCode = ''
  6108. }
  6109. }
  6110. this.fillProjectList = res.data;
  6111. this.getRecentlyProject()
  6112. } else {
  6113. this.$message({
  6114. message: res.msg,
  6115. type: "error"
  6116. });
  6117. }
  6118. },
  6119. error => {
  6120. this.$message({
  6121. message: error,
  6122. type: "error"
  6123. });
  6124. });
  6125. },
  6126. //自己填写日报时,刷新到自己的可填报日报列表
  6127. refreshToMyReportProjectList() {
  6128. this.getRecentlyProject();
  6129. },
  6130. getBasecostItemList() {
  6131. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6132. companyId: this.user.companyId
  6133. },
  6134. res => {
  6135. if (res.code == "ok") {
  6136. this.timeBasecostList = res.data;
  6137. }
  6138. });
  6139. },
  6140. getAIReport(createDate) {
  6141. this.http.post('/report/getAIReport', {},
  6142. res => {
  6143. if (res.code == "ok") {
  6144. var quanbu = 0
  6145. this.jsDay = 1
  6146. var zhi = ''
  6147. var slp = res.data
  6148. for(var i in slp) {
  6149. var sp = +slp[i].workingTime + 0
  6150. zhi = this.jsDay * sp
  6151. quanbu = +quanbu + zhi
  6152. }
  6153. this.jsTime = quanbu
  6154. var aiReportData = res.data;
  6155. this.canCancelInDialog = false
  6156. if(aiReportData.length != 0) {
  6157. var arr = [];
  6158. for(var i in aiReportData) {
  6159. arr.push({
  6160. id: null,
  6161. projectId: aiReportData[i].projectId,
  6162. workingTime: aiReportData[i].workingTime,
  6163. content: '',
  6164. progress:100,
  6165. state: 2,
  6166. timeType: aiReportData[i].timeType,
  6167. subProjectList: aiReportData[i].subProjectList,
  6168. taskList: aiReportData[i].taskList,
  6169. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6170. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6171. taskId: aiReportData[i].taskId,
  6172. startTime: aiReportData[i].startTime,
  6173. endTime: aiReportData[i].endTime,
  6174. isOvertime: 0,
  6175. progress:aiReportData[i].progress,
  6176. professionProgress: aiReportData[i].professionProgressList,
  6177. stages:aiReportData[i].stages,
  6178. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6179. pics: null,
  6180. multiWorktime: aiReportData[i].multiWorktime || 0,
  6181. worktimeList: [{}],
  6182. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6183. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6184. wuduList: aiReportData[i].degreeList,
  6185. taskGroups:aiReportData[i].taskGroups,
  6186. customData: aiReportData[i].customData,//自定义的数值
  6187. auditUserList: aiReportData[i].auditUserList,
  6188. projectAuditorId: aiReportData[i].projectAuditorId,
  6189. projectAuditorName: aiReportData[i].projectAuditorName,
  6190. overtimeHours: aiReportData[i].overtimeHours,
  6191. customText: aiReportData[i].customText,
  6192. basecostId: aiReportData[i].basecostId,
  6193. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6194. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6195. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6196. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6197. canEdit: true
  6198. })
  6199. }
  6200. this.workForm.domains = arr;
  6201. } else {
  6202. }
  6203. this.canEdit = true;
  6204. this.originCanEdit = true;
  6205. this.seleChn()
  6206. } else {
  6207. this.$message({
  6208. message: res.msg,
  6209. type: "error"
  6210. });
  6211. }
  6212. },
  6213. error => {
  6214. this.$message({
  6215. message: error,
  6216. type: "error"
  6217. });
  6218. });
  6219. },
  6220. // 获取个人某天的日报 111111
  6221. getReport() {
  6222. this.http.post( this.port.report.getPort, {
  6223. date: this.workForm.createDate
  6224. },
  6225. res => {
  6226. if (res.code == "ok") {
  6227. var quanbu = 0
  6228. this.jsDay = 1
  6229. var zhi = ''
  6230. var slp = res.data.report
  6231. for(var i in slp) {
  6232. var sp = +slp[i].workingTime + 0
  6233. zhi = this.jsDay * sp
  6234. quanbu = +quanbu + zhi
  6235. }
  6236. this.jsTime = quanbu
  6237. var list = res.data;
  6238. this.report = list;
  6239. this.reportTimeType = this.report.timeType;
  6240. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6241. this.isWeekend = !this.report.isWorkDay;
  6242. this.canCancelInDialog = false;
  6243. this.hasWrittenReport = list.report.length != 0;
  6244. if(list.report.length != 0) {
  6245. var arr = [];
  6246. this.canEdit = false;
  6247. let candelete = true
  6248. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6249. for(var i in list.report) {
  6250. var flg = null
  6251. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6252. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6253. var filteredRespList = null
  6254. if (targetP.length > 0) {
  6255. var isPublic = targetP[0].isPublic;
  6256. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6257. }
  6258. let copyData = {
  6259. id: list.report[i].id,
  6260. projectId: list.report[i].projectId,
  6261. workingTime: list.report[i].workingTime,
  6262. content: list.report[i].content,
  6263. state: list.report[i].state,
  6264. timeType: list.report[i].timeType,
  6265. subProjectList: list.report[i].subProjectList,
  6266. taskList: list.report[i].taskList,
  6267. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6268. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6269. taskId: list.report[i].taskId,
  6270. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6271. startTime: list.report[i].startTime,
  6272. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6273. endTime: list.report[i].endTime,
  6274. isOvertime: flg,
  6275. progress:list.report[i].progress,
  6276. professionProgress: list.report[i].professionProgressList,
  6277. stages:list.report[i].stages,
  6278. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6279. pics: list.report[i].pics,
  6280. multiWorktime: list.report[i].multiWorktime,
  6281. worktimeList: list.report[i].worktimeList,
  6282. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6283. multiDegrIdArray: list.report[i].multiDegrIdList,
  6284. wuduList: list.report[i].degreeList,
  6285. taskGroups:list.report[i].taskGroups,
  6286. customData: list.report[i].customData,//自定义的数值
  6287. auditUserList: list.report[i].auditUserList,
  6288. overtimeHours: list.report[i].overtimeHours,
  6289. customText: list.report[i].customText,
  6290. basecostId: list.report[i].basecostId,
  6291. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6292. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6293. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6294. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6295. canEdit: list.report[i].state >= 2 ? true : false,
  6296. extraField1: list.report[i].extraField1,
  6297. extraField2: list.report[i].extraField2,
  6298. extraField3: list.report[i].extraField3,
  6299. extraField4: list.report[i].extraField4,
  6300. extraField5: list.report[i].extraField5,
  6301. workContentList: list.report[i].workContentList,
  6302. filteredRespList: filteredRespList,
  6303. serviceList: list.report[i].serviceList,
  6304. sapServiceId: list.report[i].sapServiceId,
  6305. reportTargetDeptId: list.report[i].deptId
  6306. }
  6307. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6308. //分组负责人审核的情况下,前端不需要显示,无需设置
  6309. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6310. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6311. }
  6312. arr.push(copyData);
  6313. if (list.report[i].state >= 2) {
  6314. this.canEdit = true;
  6315. }
  6316. if(list.report[i].state < 2){
  6317. candelete = false
  6318. }
  6319. if (list.report[i].state == 0){
  6320. this.canCancelInDialog = true
  6321. }
  6322. // 加判断
  6323. if(this.user.timeType.choseFromAlbum == 1) {
  6324. let arrList = []
  6325. for(var k in list.report[i].pics) {
  6326. let obj = {
  6327. name: k,
  6328. url: list.report[i].pics[k]
  6329. }
  6330. arrList.push(obj)
  6331. }
  6332. arr[i].imgListUrl = arrList
  6333. arr[i].imgList = list.report[i].pics
  6334. }
  6335. if(reportExtraField4Name || reportExtraField5Name) {
  6336. this.getInfoByProjectId(copyData, i, false)
  6337. }
  6338. }
  6339. this.reportCanDelete = candelete
  6340. this.workForm = {
  6341. createDate: this.workForm.createDate,
  6342. domains: arr,
  6343. userNames:null,
  6344. userId:null,
  6345. time: list.time,
  6346. showRefresh: list.showRefresh
  6347. }
  6348. } else {
  6349. this.workForm = {
  6350. createDate: this.workForm.createDate,
  6351. domains: [{
  6352. id: null,
  6353. projectId: "",
  6354. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6355. content: "",
  6356. progress:100,
  6357. state: 2,
  6358. timeType:0,
  6359. multiWorktime: this.reportTimeType.multiWorktime,
  6360. worktimeList:[{}],
  6361. canEdit: true,
  6362. auditorFirst: '',
  6363. auditorSec: '',
  6364. auditorThird: '',
  6365. ccUserid: ''
  6366. }],
  6367. userId:null,
  6368. userNames:null,
  6369. time: this.report.time,
  6370. showRefresh: list.showRefresh
  6371. }
  6372. // businessTrips 有数据的情况下
  6373. const businessTrips = res.data.businessTrips || []
  6374. this.businessTripsArray = res.data.businessTrips || []
  6375. if(businessTrips.length > 0) {
  6376. this.workForm.domains = businessTrips.map((item, index) => {
  6377. return {
  6378. id: null,
  6379. projectId: item.projectId,
  6380. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6381. content: "",
  6382. progress:100,
  6383. state: 2,
  6384. timeType:0,
  6385. multiWorktime: this.reportTimeType.multiWorktime,
  6386. worktimeList:[{}],
  6387. canEdit: true,
  6388. auditorFirst: '',
  6389. auditorSec: '',
  6390. auditorThird: '',
  6391. ccUserid: ''
  6392. }
  6393. })
  6394. for(let domainsIndex in this.workForm.domains) {
  6395. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6396. }
  6397. }
  6398. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6399. this.$set(this.workForm.domains[0],'isOvertime',true)
  6400. if(this.reportTimeType.type != 2){
  6401. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6402. }
  6403. }
  6404. if(this.user.timeType.type == 1) {
  6405. var shuzhi = this.user.timeType.allday + ''
  6406. // console.log('执行一次', shuzhi.indexOf('.'))
  6407. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6408. }
  6409. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6410. //默认给第一个,必填字段
  6411. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6412. }
  6413. this.canEdit = true;
  6414. }
  6415. this.originCanEdit = this.canEdit;
  6416. this.seleChn()
  6417. } else {
  6418. this.$message({
  6419. message: res.msg,
  6420. type: "error"
  6421. });
  6422. }
  6423. },
  6424. error => {
  6425. this.$message({
  6426. message: error,
  6427. type: "error"
  6428. });
  6429. });
  6430. },
  6431. guanbi() {
  6432. this.falsss = false,
  6433. this.workTimeForMinYi=0
  6434. },
  6435. // 打开日报填写
  6436. fillInReport(i, isBatch) {
  6437. this.isWeekend = false
  6438. this.reportCanDelete = false
  6439. // console.log(this.user.timeType.type, '选择时长')
  6440. if(i != 1) {
  6441. this.falsss = false
  6442. } else {
  6443. this.falsss = true
  6444. }
  6445. if (this.isSubstitude) {
  6446. this.getSubstitudeUserDeptList();
  6447. } else {
  6448. this.refreshToMyReportProjectList();
  6449. }
  6450. if(i == -1 || this.isSubstitude) {
  6451. this.isDisable = false;
  6452. } else {
  6453. this.isDisable = true;
  6454. }
  6455. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6456. this.isBatch = isBatch;
  6457. if (this.isBatch == 0 && !this.isSubstitude) {
  6458. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6459. let weekday = new Date(this.workForm.createDate).getDay()
  6460. if(this.user.companyId == 817){
  6461. if(weekday == 0){
  6462. this.isWeekend = true
  6463. }
  6464. }else{
  6465. if(weekday == 0 || weekday == 6){
  6466. this.isWeekend = true
  6467. }
  6468. }
  6469. this.getReport(i);
  6470. } else {
  6471. this.jsTime = 0
  6472. this.jsDay = 0
  6473. this.workForm = {
  6474. createDate: null,//批量填报没有日期
  6475. domains: [{
  6476. id: null,
  6477. projectId: "",
  6478. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6479. content: "",
  6480. progress:100,
  6481. state: 2,
  6482. timeType:0,
  6483. multiWorktime: this.reportTimeType.multiWorktime,
  6484. worktimeList:[{}],
  6485. canEdit: true,
  6486. }],
  6487. }
  6488. if(this.user.timeType.type == 1) {
  6489. var shuzhi = this.user.timeType.allday + ''
  6490. // console.log('执行二次')
  6491. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6492. }
  6493. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6494. this.workForm.showRefresh = true;
  6495. }
  6496. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6497. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6498. }
  6499. this.canEdit = true;
  6500. }
  6501. if (this.isSubstitude) {
  6502. //代填情况,默认计算合计工时
  6503. this.jsDay = 1
  6504. this.seleChn();
  6505. }
  6506. this.dialogVisible = true;
  6507. },
  6508. //按周填报的弹窗口中编辑单项目相关数据
  6509. setWeekFormReportItem(reportId, i, names, row,sss) {
  6510. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6511. this.http.post('/report/getReportById', {
  6512. reportId: reportId
  6513. },
  6514. res => {
  6515. if (res.code == "ok") {
  6516. var data = res.data.report;
  6517. sss.subProjectId = data.subProjectId
  6518. sss.subProjectList = data.subProjectList;
  6519. sss.stage = data.stage
  6520. sss.subProjectList = data.subProjectList
  6521. sss.stages = data.stages
  6522. sss.taskGroups = data.taskGroups;
  6523. sss.auditUserList = data.auditUserList;
  6524. sss.degreeId = data.degreeId;
  6525. sss.customData = data.customData;
  6526. sss.wuduList = data.degreeList;
  6527. if(reportExtraField4Name || reportExtraField5Name) {
  6528. sss.extraField4 = data.extraField4 || ''
  6529. sss.extraField5 = data.extraField5 || ''
  6530. }
  6531. this.zhoBaoIdx = i
  6532. this.zhoBaoName = names
  6533. this.zhoBao = sss
  6534. this.zhis = row
  6535. if (sss.groupId) {
  6536. //最后一个参数表示是否保留stage的值,不要重置为空
  6537. this.getGroupStages(this.zhoBao, 0, true)
  6538. }
  6539. if(reportExtraField4Name || reportExtraField5Name) {
  6540. this.weekGetInfoByProjectId(sss)
  6541. }
  6542. this.$forceUpdate();
  6543. }
  6544. });
  6545. },
  6546. // 重新计算合计
  6547. fillInThePedometerOnAWeeklyBasis(index) {
  6548. const weeklyItem = this.zhoData[index] || {}
  6549. const dynamicProjectList = this.selProjectList || []
  6550. const collectionArray = dynamicProjectList.map(item => {
  6551. const name = item.projectName
  6552. return Number(weeklyItem[name].workingTime || 0)
  6553. })
  6554. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6555. this.zhoData[index].he = totalNum
  6556. },
  6557. //输入工时触发
  6558. onInputWorkTime(index) {
  6559. const weeklyItem = this.zhoData[index] || {}
  6560. },
  6561. // 按周填报里内容的填写
  6562. showWeekItemEdit(item, i, projectId,names, row) {
  6563. if (item.state == 0) {
  6564. this.$message({
  6565. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6566. type: "error"
  6567. });
  6568. return;
  6569. }
  6570. if (item.state == 1) {
  6571. this.$message({
  6572. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6573. type: "error"
  6574. });
  6575. return;
  6576. }
  6577. if(this.user.timeType.notAllowedNoAttendance == 1){
  6578. if(this.zhoData[i].corpTime){
  6579. if(this.zhoData[i].corpTime.workHours == 0){
  6580. this.$message({
  6581. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6582. type: 'error'
  6583. })
  6584. return
  6585. }
  6586. }else{
  6587. this.$message({
  6588. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6589. type: 'error'
  6590. })
  6591. return
  6592. }
  6593. }
  6594. var obj = {}
  6595. obj.projectId = projectId
  6596. this.tianxieDialogVisible = true
  6597. this.scopess = item
  6598. var sss = {}
  6599. if (item.id != null) {
  6600. sss.id = item.id;
  6601. sss.state = item.state;
  6602. } else {
  6603. sss.id = -1;
  6604. sss.state = 3;
  6605. }
  6606. sss.projectId = projectId;
  6607. sss.progress = item.progress
  6608. sss.time = item.time
  6609. sss.content = item.content;
  6610. if (sss.time == '' && this.reportTimeType.type == 2) {
  6611. //取已填时间范围中最大的一个作为开始时间
  6612. var startTime = '09:00';
  6613. var fillStartTime = '00:00';
  6614. for (var t in this.selProjectList) {
  6615. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6616. if (fillItem.time) {
  6617. if (fillItem.time[1] > fillStartTime) {
  6618. fillStartTime = fillItem.time[1];
  6619. }
  6620. }
  6621. }
  6622. if (fillStartTime == '00:00') {
  6623. fillStartTime = '09:00';
  6624. }
  6625. var fillEndMax = '18:00';
  6626. if (fillStartTime >= '18:00') {
  6627. fillEndMax = '23:59';
  6628. }
  6629. sss.time = [fillStartTime, fillEndMax];
  6630. }
  6631. sss.groupId = item.groupId
  6632. sss.stage = item.stage;
  6633. sss.workingTime = item.workingTime
  6634. sss.projectAuditorId = item.projectAuditorId;
  6635. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6636. //默认选中第一个
  6637. sss.basecostId = this.timeBasecostList[0].id;
  6638. }
  6639. var hasEdited = this.zhoData[i][names].hasEdited;
  6640. if (hasEdited) {
  6641. console.log('执行到了这个')
  6642. console.log('执行到了这个', { ...item }, obj)
  6643. sss = { ...item }
  6644. //编辑过了
  6645. sss.subProjectId = item.subProjectId
  6646. sss.stage = item.stage
  6647. sss.subProjectList = item.subProjectList
  6648. sss.stages = item.stages
  6649. sss.taskGroups = item.taskGroups;
  6650. // sss.auditUserList = obj.auditUserList ;
  6651. sss.degreeId = item.degreeId;
  6652. sss.customData = item.customData;
  6653. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6654. //只有一个审核人,自动设置上去
  6655. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6656. }
  6657. sss.wuduList = item.wuduList;
  6658. this.zhoBaoIdx = i
  6659. this.zhoBaoName = names
  6660. this.zhoBao = sss
  6661. this.zhis = row
  6662. if (sss.groupId) {
  6663. //最后一个参数表示是否保留stage的值,不要重置为空
  6664. this.getGroupStages(this.zhoBao, 0, true)
  6665. }
  6666. this.$forceUpdate();
  6667. this.getWeeklyTaskList(sss)
  6668. } else {
  6669. //第一次打开,获取数据
  6670. if (sss.id == -1) {
  6671. //新填报的
  6672. this.selectProject(obj, 0);
  6673. var that = this
  6674. setTimeout(() =>{
  6675. sss.subProjectId = that.workForm.domains[0].subProjectId
  6676. sss.subProjectList = item.subProjectList;
  6677. sss.stage = that.workForm.domains[0].stage
  6678. sss.subProjectList = that.workForm.domains[0].subProjectList
  6679. sss.stages = that.workForm.domains[0].stages
  6680. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6681. sss.auditUserList = obj.auditUserList;
  6682. sss.degreeId = item.degreeId;
  6683. sss.customData = item.customData;
  6684. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6685. //只有一个审核人,自动设置上去
  6686. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6687. }
  6688. sss.wuduList = row[0].wuduList
  6689. that.zhoBaoIdx = i
  6690. that.zhoBaoName = names
  6691. that.zhoBao = sss
  6692. that.zhis = row
  6693. if (sss.groupId) {
  6694. //最后一个参数表示是否保留stage的值,不要重置为空
  6695. this.getGroupStages(that.zhoBao, 0, false)
  6696. }
  6697. that.$forceUpdate();
  6698. this.getWeeklyTaskList(sss)
  6699. },600);
  6700. } else {
  6701. //编辑填报过的;数据库已经存在的
  6702. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6703. }
  6704. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6705. setTimeout(() => {
  6706. this.weekGetInfoByProjectId(sss)
  6707. }, 1000)
  6708. }
  6709. }
  6710. },
  6711. weekGetInfoByProjectId(item) {
  6712. console.log(item, '<=== item')
  6713. const { projectId } = item
  6714. const projectList = this.fillProjectList || this.subFillProjectList
  6715. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6716. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6717. projectId: projectCode,
  6718. date: this.zhoData[this.zhoBaoIdx].zhoDataTime
  6719. },
  6720. res => {
  6721. if (res.code == "ok") {
  6722. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6723. this.zhoBao.reportExtraField5List = res.data.lines || []
  6724. if((res.data.orderIds || []).length > 0) {
  6725. this.zhoBao.extraField4 = res.data.orderIds[0]
  6726. }
  6727. console.log(this.zhoBao, '<===== this.zhoBao')
  6728. this.$forceUpdate();
  6729. }
  6730. },
  6731. error => {
  6732. this.$message({
  6733. message: error,
  6734. type: "error"
  6735. });
  6736. });
  6737. // console.log(item)
  6738. // console.log(this.zhoBao)
  6739. },
  6740. // 按周填报里内容的填写点击确定
  6741. setWeekProItemData() {
  6742. //专业版模式下,任务分组和阶段必填
  6743. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6744. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6745. this.$message({
  6746. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6747. type: "error"
  6748. });
  6749. return;
  6750. }
  6751. }
  6752. // 检查任务分组
  6753. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6754. this.$message({
  6755. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6756. type: "error"
  6757. });
  6758. return
  6759. }
  6760. //检查子项目是否必填
  6761. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6762. this.$message({
  6763. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6764. type: "error"
  6765. });
  6766. return;
  6767. }
  6768. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6769. this.$message({
  6770. message: this.$t('message.Pleaseselectareviewer'),
  6771. type: "error"
  6772. });
  6773. return
  6774. }
  6775. if(this.user.timeType.reportAuditType == 3){
  6776. let auditTips = ''
  6777. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6778. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6779. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6780. if(auditTips){
  6781. auditTips = auditTips.substring(0,auditTips.length - 1)
  6782. this.$message({
  6783. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6784. type: 'error'
  6785. })
  6786. return
  6787. }
  6788. }
  6789. let errtips = ''
  6790. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6791. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6792. errtips += this.user.timeType.customDegreeName + '、'
  6793. }
  6794. }
  6795. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6796. errtips += this.user.timeType.customDataName + '、'
  6797. }
  6798. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6799. errtips += this.user.timeType.customTextName + '、'
  6800. }
  6801. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6802. errtips += this.$t('other.workMatters') +'、'
  6803. }
  6804. if(errtips){
  6805. errtips = errtips.substring(0,errtips.length - 1)
  6806. this.$message({
  6807. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6808. type: 'error'
  6809. })
  6810. return
  6811. }
  6812. this.tianxieDialogVisible = false
  6813. var zhong = this.zhoData
  6814. this.zhoBao.hasEdited = true;
  6815. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6816. this.zhoData = zhong
  6817. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6818. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6819. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6820. },
  6821. // 获取本周
  6822. getCurrentWeek() {
  6823. //今天
  6824. this.targetWeekDate = new Date();
  6825. this.initWeekFormData();
  6826. // this.jiazai()
  6827. },
  6828. // 获取上周
  6829. handleGetPrevWeek() {
  6830. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6831. this.initWeekFormData();
  6832. // this.jiazai()
  6833. },
  6834. // 获取下周
  6835. handleGetNextvWeek() {
  6836. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6837. this.initWeekFormData()
  6838. },
  6839. // 加载动画
  6840. jiazai() {
  6841. this.weekDataLoading = true
  6842. var that = this
  6843. setTimeout(() =>{
  6844. that.weekDataLoading = false
  6845. },1000);
  6846. },
  6847. // 转时间格式
  6848. dealdate(date) {
  6849. const dt = new Date(date)
  6850. const y = dt.getFullYear()
  6851. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6852. const d = (dt.getDate() + '').padStart(2, '0')
  6853. return `${y}-${m}-${d}`
  6854. },
  6855. // 按周填报
  6856. fillInReportss() {
  6857. window.addEventListener('scroll', this.handleScroll, true)
  6858. // this.jiazai()
  6859. this.fillWeekDialogVisi = true;
  6860. if (this.isSubstitude) {
  6861. this.substitudeStep = 1;
  6862. this.getSubstitudeUserDeptList();
  6863. } else {
  6864. this.getCurrentWeek();
  6865. }
  6866. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6867. //重新获取工时预警类型的预算项
  6868. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6869. companyId: this.user.companyId
  6870. },
  6871. res => {
  6872. if (res.code == "ok") {
  6873. this.timeBasecostList = res.data;
  6874. }
  6875. });
  6876. }
  6877. },
  6878. fillInReportCustom() {
  6879. this.weekIndex++
  6880. this.weekParentData = {
  6881. isSubstitude: this.isSubstitude
  6882. }
  6883. this.fillWeekDialogVisiCustom = true
  6884. },
  6885. // 按周填报的项目筛选
  6886. selListFun(){
  6887. this.selProjectList = []
  6888. if(this.selCon.length){
  6889. for (let i = 0; i < this.selCon.length; i++) {
  6890. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6891. }
  6892. this.selConShow = false ;
  6893. for (let i in this.zhoData) {
  6894. var obj = this.zhoData[i];
  6895. for(var j in this.selProjectList) {
  6896. var xinzhi = this.selProjectList[j].projectName
  6897. obj[xinzhi] = {}
  6898. obj[xinzhi].time = ''
  6899. obj[xinzhi].content = ''
  6900. obj[xinzhi].progress = 0
  6901. obj[xinzhi].workingTime = 0
  6902. }
  6903. }
  6904. this.initWeekFormData();
  6905. }else{
  6906. this.$message({
  6907. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6908. type:'error'
  6909. })
  6910. }
  6911. },
  6912. setWeekCardTimeData(list) {
  6913. for(let i in list){
  6914. let datei = '';
  6915. if (this.user.timeType.showDdCardtime == 1) {
  6916. datei = list[i].workDate;
  6917. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6918. datei = list[i].createDate;
  6919. } else if (this.user.timeType.syncFanwei == 1) {
  6920. datei = list[i].workDate;
  6921. }
  6922. for(let m in this.zhoData) {
  6923. if(datei == this.zhoData[m].zhoDataTime){
  6924. let item = {
  6925. startTime: list[i].startTime,
  6926. endTime: list[i].endTime,
  6927. workHours: list[i].workHours,
  6928. otTime: list[i].otTime
  6929. }
  6930. this.$set(this.zhoData[m],'corpTime',item)
  6931. }
  6932. }
  6933. }
  6934. },
  6935. getWeeklyCardTime(){ //按周填报获取考勤信息
  6936. let dateStr = []
  6937. for(let i in this.zhoData){
  6938. dateStr.push(this.zhoData[i].zhoDataTime)
  6939. }
  6940. this.http.post('/report/getWeeklyCardTime',{
  6941. dateStr: JSON.stringify(dateStr)
  6942. },res => {
  6943. if(res.code == 'ok'){
  6944. for(let i in res.data){
  6945. let datei = '';
  6946. if (this.user.timeType.showDdCardtime == 1) {
  6947. datei = res.data[i].workDate.split('-');
  6948. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6949. datei = res.data[i].createDate.split('-');
  6950. }
  6951. for(let m in this.zhoData){
  6952. let datem = new Date(this.zhoData[m].zhoDataTime)
  6953. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6954. let item = {
  6955. startTime: res.data[i].startTime,
  6956. endTime: res.data[i].endTime,
  6957. workHours: res.data[i].workHours
  6958. }
  6959. this.$set(this.zhoData[m],'corpTime',item)
  6960. }
  6961. }
  6962. }
  6963. }else{
  6964. this.$message({
  6965. message: res.msg,
  6966. type: 'error'
  6967. })
  6968. }
  6969. },err => {
  6970. this.$message({
  6971. message: err,
  6972. type: 'error'
  6973. })
  6974. })
  6975. },
  6976. selListqx(){
  6977. this.fillWeekDialogVisi = false
  6978. this.selProjectList = []
  6979. this.selCon = []
  6980. },
  6981. handleScroll() {
  6982. this.changdu = this.projectList.length + 1
  6983. },
  6984. // 自动选择时间点的事件
  6985. // async zhoTimes(item, i) {
  6986. // var iss = i
  6987. // if(item.time == null) {
  6988. // return
  6989. // } else {
  6990. // const zhi = this.zhoData[iss];
  6991. // let he = 0;
  6992. // const timeArr = Object.values(zhi)
  6993. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6994. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6995. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6996. // console.log(data, 'data');
  6997. // zhi.he = `${he}h`;
  6998. // }
  6999. // },
  7000. async zhoTimes(item, index) {
  7001. const zho = this.zhoData[index];
  7002. if (!item.time) {
  7003. return;
  7004. }
  7005. const timeArr = Object.values(zho)
  7006. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  7007. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  7008. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  7009. zho.he = `${totalHours[0]}h`;
  7010. },
  7011. // 判断两个时间段是否重叠
  7012. timeOverlap(idx, dateAr) {
  7013. let zhi = 0
  7014. for (let k in dateAr) {
  7015. if (idx !== k) {
  7016. 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))) {
  7017. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  7018. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  7019. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  7020. }
  7021. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  7022. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7023. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  7024. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7025. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7026. } else {
  7027. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  7028. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  7029. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  7030. }
  7031. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  7032. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  7033. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7034. }
  7035. }
  7036. }
  7037. }
  7038. }
  7039. return zhi
  7040. },
  7041. // 计算时间
  7042. getHourMinutes(str, end) {
  7043. var he = 0
  7044. var date2 = '2021/12/12 ' + end +':00'
  7045. var date1 = '2021/12/12 ' + str +':00'
  7046. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  7047. var leave1=date3%(24*3600*1000)
  7048. var hours=Math.floor(leave1/(3600*1000))
  7049. var leave2=leave1%(3600*1000)
  7050. var minutes=Math.floor(leave2/(60*1000))
  7051. var shi = hours+'.'+ minutes
  7052. return he += +shi
  7053. },
  7054. // 自动选择事件长度的事件
  7055. zhoXuan(item, i) {
  7056. var iss = i
  7057. if(item.time == null) {
  7058. return
  7059. } else {
  7060. var zhi = this.zhoData[iss]
  7061. var he = 0
  7062. for(var i in zhi) {
  7063. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7064. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7065. console.log('执行')
  7066. he += +zhi[i].workingTime
  7067. }
  7068. }
  7069. zhi.he = he + 'h'
  7070. }
  7071. },
  7072. getPushWorkLogData(){
  7073. this.http.post('/sap-sync-log/list', {},
  7074. res => {
  7075. if (res.code == "ok") {
  7076. this.pushWorkTimeLogData = res.data;
  7077. } else {
  7078. this.$message({
  7079. message: res.msg,
  7080. type: "error"
  7081. });
  7082. }
  7083. },
  7084. error => {
  7085. this.$message({
  7086. message: error,
  7087. type: "error"
  7088. });
  7089. });
  7090. },
  7091. // 获取全部人员
  7092. getUsers() {
  7093. this.http.post('/user/getSimpleActiveUserList', {},
  7094. res => {
  7095. if (res.code == "ok") {
  7096. this.usersList = res.data;
  7097. } else {
  7098. this.$message({
  7099. message: res.msg,
  7100. type: "error"
  7101. });
  7102. }
  7103. },
  7104. error => {
  7105. this.$message({
  7106. message: error,
  7107. type: "error"
  7108. });
  7109. });
  7110. },
  7111. // 按时间比例
  7112. addBli(item, i) {
  7113. var iss = i
  7114. if(item.time == null) {
  7115. return
  7116. } else {
  7117. var zhi = this.zhoData[iss]
  7118. var he = 0
  7119. for(var i in zhi) {
  7120. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7121. he += +zhi[i].workingTime
  7122. }
  7123. }
  7124. zhi.he = he.toFixed(1) + 'h'
  7125. }
  7126. },
  7127. //按周填报选择的项目发生变化,需要设置列
  7128. onSelProjectChange() {
  7129. for (let i = 0; i < this.selCon.length; i++) {
  7130. var exists = false;
  7131. for (let j = 0; j < this.selProjectList.length; j++) {
  7132. if (this.selProjectList[j].id == this.selCon[i]) {
  7133. exists = true;
  7134. break;
  7135. }
  7136. }
  7137. if (!exists) {
  7138. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7139. this.selProjectList.push(newProject);
  7140. //添加新项目
  7141. for (var w in this.zhoData) {
  7142. var dayItem = this.zhoData[w];
  7143. var pName = newProject.projectName;
  7144. dayItem[pName] = {};
  7145. dayItem[pName].time = ''
  7146. dayItem[pName].content = ''
  7147. dayItem[pName].progress = 0
  7148. dayItem[pName].workingTime = 0
  7149. }
  7150. }
  7151. }
  7152. //去掉
  7153. for (let j = 0; j < this.selProjectList.length; j++) {
  7154. var exists = false;
  7155. for (let i = 0; i < this.selCon.length; i++) {
  7156. if (this.selProjectList[j].id == this.selCon[i]) {
  7157. exists = true;
  7158. break;
  7159. }
  7160. }
  7161. if (!exists) {
  7162. this.selProjectList.splice(j, 1);
  7163. j--;
  7164. }
  7165. }
  7166. this.loadFilledWeekReportItem();
  7167. //刷新表格
  7168. // this.$refs.weekTable.doLayout();
  7169. },
  7170. //根据选中的项目来刷新填写表格
  7171. loadFilledWeekReportItem() {
  7172. for (var w in this.zhoData) {
  7173. var dayItem = this.zhoData[w];
  7174. for (var i = 0; i < this.selProjectList.length; i++) {
  7175. var curColumnProject = this.selProjectList[i];
  7176. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7177. for (var t in dayItem.reportList) {
  7178. //有日报的项目,不能取消选择
  7179. for (var p in this.fillProjectList) {
  7180. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7181. }
  7182. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7183. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7184. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7185. if (this.reportTimeType.type == 2) {
  7186. //时间段模式
  7187. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7188. }
  7189. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7190. break;
  7191. }
  7192. }
  7193. // dayItem[curColumnProject.projectName] = matchReportItem;
  7194. }
  7195. }
  7196. this.$nextTick(()=>{
  7197. this.$refs.weekTable.doLayout();
  7198. });
  7199. },
  7200. initWeekFormData() {
  7201. this.weekDataLoading = true;
  7202. for (var p in this.fillProjectList) {
  7203. this.fillProjectList[p].canCancel = 1;
  7204. }
  7205. var param = {
  7206. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7207. };
  7208. if (this.isSubstitude) {
  7209. //传代填人的userId
  7210. param.targetUserId = this.workForm.userId[0];
  7211. }
  7212. this.http.post('/report/getWeeklyReportData',param,res => {
  7213. this.weekDataLoading = false;
  7214. if(res.code == 'ok'){
  7215. let projectList = res.data.projectList;
  7216. if (projectList.length > 0) {
  7217. //有选择过项目进行填报,直接选中
  7218. this.selProjectList = projectList;
  7219. this.selCon = [];
  7220. for (let i = 0; i < projectList.length; i++) {
  7221. this.selCon.push(projectList[i].id);
  7222. }
  7223. }
  7224. //设置日期
  7225. this.weekDateRange = res.data.dateList;
  7226. this.zhoData = [];
  7227. var arrst = []
  7228. for(var i in this.weekDateRange) {
  7229. var obj = {}
  7230. obj.zhoDataTime = this.weekDateRange[i].date
  7231. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7232. obj.he = this.weekDateRange[i].filledTime;
  7233. obj.canFill = this.weekDateRange[i].canFill;
  7234. // obj.filledTime = this.weekDateRange[i].filledTime;
  7235. obj.reportList = this.weekDateRange[i].reportList;
  7236. //初始化,防止渲染报错
  7237. for (var j = 0; j < this.selProjectList.length; j++) {
  7238. var pName = this.selProjectList[j].projectName
  7239. obj[pName] = {}
  7240. obj[pName].time = ''
  7241. obj[pName].content = ''
  7242. obj[pName].progress = 0
  7243. obj[pName].workingTime = 0
  7244. }
  7245. arrst.push(obj)
  7246. }
  7247. this.zhoData = arrst
  7248. this.setWeekCardTimeData(res.data.cardTimeList);
  7249. this.loadFilledWeekReportItem();
  7250. }else{
  7251. this.$message({
  7252. message: res.msg,
  7253. type: 'error'
  7254. })
  7255. }
  7256. },err => {
  7257. this.$message({
  7258. message: err,
  7259. type: 'error'
  7260. })
  7261. })
  7262. },
  7263. zhoZhi(res, i) {
  7264. var zhi = 0
  7265. for(var i in res) {
  7266. if(i != 'zhoDataTime' && i != 'he') {
  7267. zhi += +res[i]
  7268. }
  7269. }
  7270. res.he = zhi
  7271. },
  7272. zhoBtn(i) {
  7273. // this.zhoData.split(i, 1)
  7274. var arr = this.zhoData
  7275. arr.splice(i, 1)
  7276. },
  7277. zhoAddlast(){
  7278. this.selConShow = true
  7279. },
  7280. closeAddWeeklyReport(){
  7281. this.fillWeekDialogVisi = false
  7282. this.selConShow = true
  7283. this.selProjectList = []
  7284. this.selCon = []
  7285. },
  7286. checkDateWorkTime() {
  7287. //针对苏州景昱,单独的检查逻辑
  7288. if (this.user.companyId == 5978) {
  7289. //调接口,先检查工时是否存在异常
  7290. var zhi = this.zhoData;
  7291. var array = [];
  7292. for(let n in zhi){
  7293. if(zhi[n].he){
  7294. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7295. array.push(workData)
  7296. }
  7297. }
  7298. this.submitingReport = true;
  7299. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7300. res => {
  7301. this.submitingReport = false;
  7302. if (res.code == "ok") {
  7303. this.submitWeekReport(0)
  7304. } else {
  7305. this.$confirm(res.msg, this.$t('other.prompts'), {
  7306. confirmButtonText: this.$t('huLveBingTiJiao'),
  7307. cancelButtonText: this.$t('btn.cancel'),
  7308. type: 'error'
  7309. }).then(() => {
  7310. this.submitWeekReport(0)
  7311. }).catch(() => {
  7312. });
  7313. }
  7314. },
  7315. error => {
  7316. this.$message({
  7317. message: error,
  7318. type: "error"
  7319. });
  7320. });
  7321. }
  7322. },
  7323. // 提交按周填报
  7324. submitWeekReport(isDraft) {
  7325. var zhi = this.zhoData
  7326. var ll = 0
  7327. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7328. if(this.reportTimeType.type == 2) {
  7329. for(var i in zhi) {
  7330. this.dateAr = []
  7331. var alp = []
  7332. var zhis = zhi[i]
  7333. for(var j in zhis) {
  7334. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7335. let objs = {}
  7336. objs.s = zhis[j].time[0]
  7337. objs.e = zhis[j].time[1]
  7338. objs.p = j
  7339. alp.push(objs)
  7340. }
  7341. }
  7342. this.dateAr = alp
  7343. if (this.reportTimeType.timeCanOverlap == 0) {
  7344. let str = this.$t('message.Filledtimeperiodsoverlap')
  7345. if(this.dateAr.length > 0) {
  7346. const trus = this.fns();
  7347. const overlapDataTime = this.getOverlapData(alp);
  7348. if (overlapDataTime.length > 0) {
  7349. const arrList = overlapDataTime.map((item) => item.p);
  7350. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7351. }
  7352. ll += 1
  7353. if(!trus) {
  7354. this.$message({
  7355. message: str,
  7356. type: 'error'
  7357. })
  7358. return false
  7359. }
  7360. }
  7361. } else {
  7362. if(this.dateAr.length > 0) {
  7363. ll +=1 ;
  7364. }
  7365. }
  7366. }
  7367. if(ll == 0) {
  7368. this.$message({
  7369. message: this.$t('message.Pleasefillinthetime'),
  7370. type: 'error'
  7371. })
  7372. return false
  7373. }
  7374. } else if(this.reportTimeType.type == 1){
  7375. for(var i in zhi) {
  7376. var zhis = zhi[i]
  7377. for(var j in zhis) {
  7378. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7379. ll += 1
  7380. }
  7381. }
  7382. }
  7383. if(ll == 0) {
  7384. this.$message({
  7385. message: this.$t('message.Pleaseselectatime'),
  7386. type: 'error'
  7387. })
  7388. return false
  7389. }
  7390. let overcorp = ''
  7391. for(let n in zhi){
  7392. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7393. overcorp += zhi[n].zhoDataTime + ','
  7394. }
  7395. }
  7396. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7397. overcorp = overcorp.substring(0,overcorp.length - 1)
  7398. this.$message({
  7399. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7400. type: 'error'
  7401. })
  7402. return
  7403. }
  7404. }
  7405. var submits = []
  7406. let formData = new FormData();
  7407. formData.append("draft", isDraft);
  7408. if(this.reportTimeType.multiWorktime == 1){
  7409. for (var i in this.zhoData) {
  7410. var zhoD = this.zhoData[i]
  7411. var flgs = false
  7412. for(var j in zhoD) {
  7413. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7414. flgs = true
  7415. // formData.append("degreeId", "-1");
  7416. formData.append("id", '-1');
  7417. if (this.isSubstitude) {
  7418. formData.append('targetUids',this.workForm.userId[0]);
  7419. }
  7420. for(var s in this.selProjectList) {
  7421. if(j == this.selProjectList[s].projectName) {
  7422. formData.append("projectId", this.selProjectList[s].id);
  7423. break;
  7424. }
  7425. }
  7426. if(this.user.timeType.reportAuditType == 3){
  7427. let audItem = {}
  7428. if(this.user.timeType.auditLevel > 0){
  7429. audItem.auditorFirst = zhoD[j].auditorFirst
  7430. }
  7431. if(this.user.timeType.auditLevel > 1){
  7432. audItem.auditorSec = zhoD[j].auditorSec
  7433. }
  7434. if(this.user.timeType.auditLevel > 2){
  7435. audItem.auditorThird = zhoD[j].auditorThird
  7436. }
  7437. if(zhoD[j].ccUserid){
  7438. audItem.ccUserid = zhoD[j].ccUserid
  7439. }
  7440. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7441. }
  7442. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7443. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7444. formData.append("reportTimeType", this.reportTimeType.type);
  7445. formData.append("endTime", '');
  7446. formData.append("startTime", '');
  7447. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7448. var lix = []
  7449. var objjs = {}
  7450. objjs.startTime = zhoD[j].time[0]
  7451. objjs.endTime = zhoD[j].time[1]
  7452. if (zhoD[j].content == null || zhoD[j].content == '') {
  7453. zhoD[j].content == '-'
  7454. }
  7455. objjs.content = zhoD[j].content
  7456. lix.push(objjs)
  7457. var zhiZhi = JSON.stringify(lix)
  7458. zhiZhi = zhiZhi.replace(/,/g,"@");
  7459. formData.append("content", zhiZhi)
  7460. formData.append("isOvertime", 0)
  7461. formData.append("professionProgress", "[]")
  7462. if (zhoD[j].groupId) {
  7463. formData.append("groupId",zhoD[j].groupId)
  7464. } else {
  7465. //解决后台groupId数组越界的问题
  7466. formData.append("groupId",0)
  7467. }
  7468. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7469. formData.append("createDate",zhoD.zhoDataTime)
  7470. if (zhoD[j].projectAuditorId) {
  7471. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7472. }
  7473. if(zhoD[j].basecostId) {
  7474. formData.append("basecostId", zhoD[j].basecostId);
  7475. } else {
  7476. formData.append("basecostId", 0);
  7477. }
  7478. if(this.user.timeType.customDegreeActive){
  7479. if (this.user.timeType.customDegreeMultiple) {
  7480. if (zhoD[j].multiDegrIdArray) {
  7481. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7482. } else {
  7483. formData.append('multiDegrId','[]')
  7484. }
  7485. } else {
  7486. if (zhoD[j].degreeId) {
  7487. formData.append('degreeId',zhoD[j].degreeId)
  7488. } else {
  7489. formData.append('degreeId','-1')
  7490. }
  7491. }
  7492. }else{
  7493. formData.append("degreeId", "-1");
  7494. }
  7495. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7496. formData.append('customData',zhoD[j].customData)
  7497. }else if(this.user.timeType.customDataActive){
  7498. formData.append('customData',0)
  7499. }
  7500. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7501. formData.append('customText',zhoD[j].customText)
  7502. }else if(this.user.timeType.customTextActive){
  7503. formData.append('customText','-')
  7504. }
  7505. if(reportExtraField4Name || reportExtraField5Name) {
  7506. formData.append('extraField4', zhoD[j].extraField4 || '')
  7507. formData.append('extraField5', zhoD[j].extraField5 || '')
  7508. }
  7509. }
  7510. }
  7511. }
  7512. } else {
  7513. for (var i in this.zhoData) {
  7514. var zhoD = this.zhoData[i]
  7515. var flgs = false
  7516. if(this.reportTimeType.type == 2) {
  7517. for(var k in this.selProjectList) {
  7518. var pItem = this.selProjectList[k];
  7519. var pName = pItem.projectName;
  7520. var j = pName;
  7521. var pid = pItem.id;
  7522. console.log('j==周报中的项目='+j);
  7523. if(zhoD[j].time && zhoD[j].time != 'null') {
  7524. flgs = true
  7525. // formData.append("degreeId", "-1");
  7526. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7527. if (this.isSubstitude) {
  7528. formData.append('targetUids',this.workForm.userId[0]);
  7529. }
  7530. formData.append("projectId", pid);
  7531. if(this.user.timeType.reportAuditType == 3){
  7532. let audItem = {}
  7533. if(this.user.timeType.auditLevel > 0){
  7534. audItem.auditorFirst = zhoD[j].auditorFirst
  7535. }
  7536. if(this.user.timeType.auditLevel > 1){
  7537. audItem.auditorSec = zhoD[j].auditorSec
  7538. }
  7539. if(this.user.timeType.auditLevel > 2){
  7540. audItem.auditorThird = zhoD[j].auditorThird
  7541. }
  7542. if(zhoD[j].ccUserid){
  7543. audItem.ccUserid = zhoD[j].ccUserid
  7544. }
  7545. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7546. }
  7547. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7548. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7549. formData.append("reportTimeType", this.reportTimeType.type);
  7550. formData.append("endTime", zhoD[j].time[1]);
  7551. formData.append("startTime", zhoD[j].time[0]);
  7552. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7553. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7554. formData.append("isOvertime", 0)
  7555. formData.append("professionProgress", "[]")
  7556. if (zhoD[j].groupId) {
  7557. formData.append("groupId",zhoD[j].groupId)
  7558. } else {
  7559. //解决后台groupId数组越界的问题
  7560. formData.append("groupId",0)
  7561. }
  7562. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7563. formData.append("createDate",zhoD.zhoDataTime)
  7564. if (zhoD[j].projectAuditorId) {
  7565. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7566. } else {
  7567. //对齐数据
  7568. formData.append("projectAuditorId",'-');
  7569. }
  7570. if(zhoD[j].basecostId) {
  7571. formData.append("basecostId", zhoD[j].basecostId);
  7572. } else {
  7573. formData.append("basecostId", 0);
  7574. }
  7575. if(this.user.timeType.customDegreeActive){
  7576. if (this.user.timeType.customDegreeMultiple) {
  7577. if (zhoD[j].multiDegrIdArray) {
  7578. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7579. } else {
  7580. formData.append("multiDegrId", "[]");
  7581. }
  7582. } else {
  7583. if (zhoD[j].degreeId) {
  7584. formData.append('degreeId',zhoD[j].degreeId)
  7585. } else {
  7586. formData.append("degreeId", "-1");
  7587. }
  7588. }
  7589. }else{
  7590. formData.append("degreeId", "-1");
  7591. }
  7592. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7593. formData.append('customData',zhoD[j].customData)
  7594. }else if(this.user.timeType.customDataActive){
  7595. formData.append('customData',0)
  7596. }
  7597. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7598. formData.append('customText',zhoD[j].customText)
  7599. }else if(this.user.timeType.customTextActive){
  7600. formData.append('customText','-')
  7601. }
  7602. if(reportExtraField4Name || reportExtraField5Name) {
  7603. formData.append('extraField4', zhoD[j].extraField4 || '')
  7604. formData.append('extraField5', zhoD[j].extraField5 || '')
  7605. }
  7606. }
  7607. }
  7608. } else {
  7609. for(var k in this.selProjectList) {
  7610. var pItem = this.selProjectList[k];
  7611. var pName = pItem.projectName;
  7612. var j = pName;
  7613. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7614. flgs = true
  7615. // formData.append("degreeId", "-1");
  7616. console.log('进入了workFpppp==='+j);
  7617. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7618. if (this.isSubstitude) {
  7619. formData.append('targetUids',this.workForm.userId[0]);
  7620. }
  7621. formData.append("projectId", pItem.id);
  7622. if(this.user.timeType.reportAuditType == 3){
  7623. let audItem = {}
  7624. if(this.user.timeType.auditLevel > 0){
  7625. audItem.auditorFirst = zhoD[j].auditorFirst
  7626. }
  7627. if(this.user.timeType.auditLevel > 1){
  7628. audItem.auditorSec = zhoD[j].auditorSec
  7629. }
  7630. if(this.user.timeType.auditLevel > 2){
  7631. audItem.auditorThird = zhoD[j].auditorThird
  7632. }
  7633. if(zhoD[j].ccUserid){
  7634. audItem.ccUserid = zhoD[j].ccUserid
  7635. }
  7636. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7637. }
  7638. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7639. // formData.append("subProjectId", zhoD[j].subProjectId);
  7640. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7641. formData.append("reportTimeType", this.reportTimeType.type);
  7642. if(this.reportTimeType.type == 1) {
  7643. formData.append("workingTime", zhoD[j].workingTime);
  7644. } else if(this.reportTimeType.type == 2) {
  7645. formData.append("endTime", zhoD[j].time[1]);
  7646. formData.append("startTime", zhoD[j].time[0]);
  7647. } else if(this.reportTimeType.type == 3) {
  7648. formData.append("progress", zhoD[j].progress);
  7649. formData.append("workingTime", zhoD[j].workingTime);
  7650. }
  7651. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7652. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7653. formData.append("isOvertime", 0)
  7654. formData.append("professionProgress", "[]")
  7655. if (zhoD[j].groupId) {
  7656. formData.append("groupId",zhoD[j].groupId)
  7657. } else {
  7658. //解决后台groupId数组越界的问题
  7659. formData.append("groupId",0)
  7660. }
  7661. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7662. formData.append("createDate",zhoD.zhoDataTime)
  7663. if (zhoD[j].projectAuditorId) {
  7664. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7665. } else {
  7666. //对齐数据
  7667. formData.append("projectAuditorId",'-')
  7668. }
  7669. if(zhoD[j].basecostId) {
  7670. formData.append("basecostId", zhoD[j].basecostId);
  7671. } else {
  7672. formData.append("basecostId", 0);
  7673. }
  7674. if(this.user.timeType.customDegreeActive){
  7675. if (this.user.timeType.customDegreeMultiple) {
  7676. if (zhoD[j].multiDegrIdArray) {
  7677. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7678. } else {
  7679. formData.append("multiDegrId", "[]");
  7680. }
  7681. } else {
  7682. if (zhoD[j].degreeId) {
  7683. formData.append('degreeId',zhoD[j].degreeId)
  7684. } else {
  7685. formData.append("degreeId", "-1");
  7686. }
  7687. }
  7688. }else{
  7689. formData.append("degreeId", "-1");
  7690. }
  7691. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7692. formData.append('customData',zhoD[j].customData)
  7693. }else if(this.user.timeType.customDataActive){
  7694. formData.append('customData',0)
  7695. }
  7696. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7697. formData.append('customText',zhoD[j].customText)
  7698. }else if(this.user.timeType.customTextActive){
  7699. formData.append('customText','-')
  7700. }
  7701. if(reportExtraField4Name || reportExtraField5Name) {
  7702. formData.append('extraField4', zhoD[j].extraField4 || '')
  7703. formData.append('extraField5', zhoD[j].extraField5 || '')
  7704. }
  7705. }
  7706. }
  7707. }
  7708. }
  7709. }
  7710. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7711. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7712. if(!next) {
  7713. this.$message({
  7714. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7715. type: 'error'
  7716. })
  7717. return
  7718. }
  7719. // 自定义维度
  7720. this.submitingReport = true;
  7721. this.http.uploadFile( this.port.report.editPort, formData,
  7722. res => {
  7723. // this.listLoading = false;
  7724. this.submitingReport = false;
  7725. if (res.code == "ok") {
  7726. this.$message({
  7727. message: this.$t('message.fillinsuccessfully'),
  7728. type: "success"
  7729. });
  7730. this.fillWeekDialogVisi = false
  7731. this.selConShow = true
  7732. this.zhoData = []
  7733. this.weekDateRange = ''
  7734. this.getReportList();
  7735. this.getDepartment();
  7736. // 关闭弹窗 并 清空
  7737. this.selProjectList = []
  7738. this.selCon = []
  7739. this.getRecentlyProject()
  7740. } else {
  7741. this.$message({
  7742. message: res.msg,
  7743. type: "error"
  7744. });
  7745. }
  7746. },
  7747. error => {
  7748. this.submitingReport = false;
  7749. this.$message({
  7750. message: error,
  7751. type: "error"
  7752. });
  7753. });
  7754. },
  7755. handleGroupAuditorData(data) {
  7756. const { reportAuditType } = this.user.timeType
  7757. if(reportAuditType != 1 && reportAuditType != 2) {
  7758. return {next: true}
  7759. }
  7760. let arrList = [];
  7761. Object.entries(data).forEach(([key, obj]) => {
  7762. Object.entries(obj).forEach(([projectName, projectData]) => {
  7763. if (projectData.workingTime && !projectData.groupId) {
  7764. arrList.push({
  7765. projectName,
  7766. date: obj.zhoDataTime,
  7767. dateText: obj.zhoDataTimeTxt
  7768. });
  7769. }
  7770. });
  7771. });
  7772. if(arrList.length > 0) {
  7773. return {
  7774. next: false,
  7775. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7776. }
  7777. } else {
  7778. return {
  7779. next: true,
  7780. error: [],
  7781. }
  7782. }
  7783. },
  7784. ChangeHourMinutestr (str) {
  7785. if (str !== "0" && str !== "" && str !== null) {
  7786. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7787. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7788. } else {
  7789. return "";
  7790. }
  7791. },
  7792. // 得到两个日期中间的日期
  7793. getdiffdate(stime,etime){
  7794. //初始化日期列表,数组
  7795. var diffdate = new Array();
  7796. var i=0;
  7797. //开始日期小于等于结束日期,并循环
  7798. while(stime<=etime){
  7799. diffdate[i] = stime;
  7800. //获取开始日期时间戳
  7801. var stime_ts = new Date(stime).getTime();
  7802. //增加一天时间戳后的日期
  7803. var next_date = stime_ts + (24*60*60*1000);
  7804. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7805. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7806. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7807. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7808. stime = next_dates_y+next_dates_m+next_dates_d;
  7809. //增加数组key
  7810. i++;
  7811. }
  7812. return diffdate;
  7813. },
  7814. // 添加模块
  7815. addDomain(i) {
  7816. var leftProgress = 10;
  7817. if (this.reportTimeType.type == 3) {
  7818. //计算已经待分配工时比例
  7819. let array = this.workForm.domains;
  7820. let totalProgress = 0;
  7821. for (var i=0;i<array.length; i++) {
  7822. totalProgress += array[i].progress;
  7823. }
  7824. if (totalProgress < 100) {
  7825. leftProgress = 100 - totalProgress;
  7826. }
  7827. }
  7828. var addItem = {
  7829. projectId: "",
  7830. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7831. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7832. ),
  7833. content: "",
  7834. progress:leftProgress,
  7835. state:2,//2-表示待提交
  7836. multiWorktime: this.reportTimeType.multiWorktime,
  7837. worktimeList:[{}],
  7838. canEdit: true,
  7839. auditorFirst: '',
  7840. auditorSec: '',
  7841. auditorThird: '',
  7842. ccUserid: ''
  7843. // degreeId: '',
  7844. };
  7845. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7846. this.$set(addItem,'isOvertime',true)
  7847. if(this.reportTimeType.type == 3){
  7848. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7849. }
  7850. }
  7851. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7852. //默认给第一个,必填字段
  7853. addItem.basecostId = this.timeBasecostList[0].id;
  7854. }
  7855. this.workForm.domains.push(addItem);
  7856. document.getElementById('workFormsItemBottom').scrollIntoView()
  7857. this.canEdit = true
  7858. if (this.reportTimeType.type == 0) {
  7859. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7860. var length = this.workForm.domains.length;
  7861. if (length == 2) {
  7862. this.showAddMore = false;
  7863. }
  7864. }
  7865. this.chuji()
  7866. this.seleChn()
  7867. },
  7868. // 移除模块
  7869. delDomain(i) {
  7870. this.workForm.domains.splice(i,1)
  7871. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7872. if (!this.originCanEdit) {
  7873. let iscan = false
  7874. for(let i in this.workForm.domains){
  7875. if(this.workForm.domains[i].canEdit){
  7876. iscan = true
  7877. }
  7878. }
  7879. this.canEdit = iscan
  7880. }
  7881. //检测当前剩下的一个,时间类型是否是全天
  7882. if (this.reportTimeType.type == 0) {
  7883. if (this.workForm.domains[0].timeType == 0) {
  7884. this.showAddMore = false;
  7885. } else {
  7886. this.showAddMore = true;
  7887. }
  7888. }
  7889. if(this.user.timeType.multiWorktime == 1) {
  7890. this.iptChangs()
  7891. } else {
  7892. this.seleChn(0)
  7893. }
  7894. },
  7895. // 改变月份
  7896. changeMonth() {
  7897. this.isWeekend = false
  7898. let date = new Date()
  7899. let nowmon = date.getMonth() + 1
  7900. let nowday = date.getDate()
  7901. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7902. if (this.isBatch == 0) {
  7903. if(this.user.timeType.fillAhead == 0){
  7904. let date_a = new Date(this.workForm.createDate)
  7905. if(date_a.getTime() > date.getTime()){
  7906. this.workForm.createDate = nowdate
  7907. }
  7908. }
  7909. //只有按天填报才能获取当天的日报
  7910. if(!this.isSubstitude){
  7911. let weekday = new Date(this.workForm.createDate).getDay()
  7912. if(this.user.companyId == 817){
  7913. if(weekday == 0){
  7914. this.isWeekend = true
  7915. }
  7916. }else{
  7917. if(weekday == 0 || weekday == 6){
  7918. this.isWeekend = true
  7919. }
  7920. }
  7921. this.getReport()
  7922. } else {
  7923. //获取代填人员的考勤
  7924. if (this.user.timeType.showCorpwxCardtime == 1) {
  7925. this.getTargetUserCardTime();
  7926. }
  7927. }
  7928. }else {
  7929. if(this.user.timeType.fillAhead == 0){
  7930. let date_a = new Date(this.workForm.createDate[1])
  7931. if(date_a.getTime() > date.getTime()){
  7932. this.workForm.createDate[1] = nowdate
  7933. let sdate = new Date(this.workForm.createDate[0])
  7934. let edate = new Date(this.workForm.createDate[1])
  7935. if(sdate > edate){
  7936. this.workForm.createDate[0] = this.workForm.createDate[1]
  7937. }
  7938. }
  7939. }
  7940. }
  7941. },
  7942. // 判断时间段
  7943. fns() {
  7944. for (let k in this.dateAr) {
  7945. if (!this.judege(k)) {
  7946. return false
  7947. }
  7948. }
  7949. return true
  7950. },
  7951. judege(idx){
  7952. for (let k in this.dateAr) {
  7953. if (idx !== k) {
  7954. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7955. return false
  7956. }
  7957. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7958. return false
  7959. }
  7960. }
  7961. }
  7962. return true
  7963. },
  7964. getOverlapData(data) {
  7965. let overlapData = [];
  7966. for (let i = 0; i < data.length; i++) {
  7967. for (let j = i + 1; j < data.length; j++) {
  7968. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7969. overlapData.push(data[i], data[j]);
  7970. }
  7971. }
  7972. }
  7973. return overlapData;
  7974. },
  7975. // 保存日报111111
  7976. submitReport(isDraft) {
  7977. this.isDraft = isDraft;
  7978. this.$refs.workForm.validate(valid => {
  7979. if (valid) {
  7980. if (!isDraft) {
  7981. //针对苏州景昱,单独的检查逻辑
  7982. if (this.user.companyId == 5978) {
  7983. //调接口,先检查工时是否存在异常
  7984. var totalTime = 0;
  7985. for (var t=0;t<this.workForm.domains.length; t++) {
  7986. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7987. }
  7988. var array = [];
  7989. if (this.isBatch) {
  7990. var startDate = new Date(this.workForm.createDate[0]);
  7991. var endDate = new Date(this.workForm.createDate[1]);
  7992. if (startDate > endDate) {
  7993. this.$message({
  7994. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7995. type: "error"
  7996. });
  7997. return
  7998. } else {
  7999. while(true){
  8000. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  8001. array.push(workData);
  8002. startDate.setDate(startDate.getDate() + 1);
  8003. if (startDate > endDate) {
  8004. break;
  8005. }
  8006. }
  8007. }
  8008. } else {
  8009. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  8010. array.push(workData)
  8011. }
  8012. this.submitingReport = true;
  8013. var passUserId = this.user.id;
  8014. if (this.isSubstitude) {
  8015. passUserId = this.targetUids;
  8016. }
  8017. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  8018. res => {
  8019. this.submitingReport = false;
  8020. if (res.code == "ok") {
  8021. this.submitReportSon()
  8022. } else {
  8023. this.$confirm(res.msg, this.$t('other.prompts'), {
  8024. confirmButtonText: this.$t('huLveBingTiJiao'),
  8025. cancelButtonText: this.$t('btn.cancel'),
  8026. type: 'error'
  8027. }).then(() => {
  8028. this.submitReportSon()
  8029. }).catch(() => {
  8030. });
  8031. }
  8032. },
  8033. error => {
  8034. this.$message({
  8035. message: error,
  8036. type: "error"
  8037. });
  8038. });
  8039. } else if (this.user.companyId == 469) {
  8040. //试点,针对赛元微电子校验考勤工时
  8041. if (this.workForm.time && this.workForm.time.workHours) {
  8042. if (this.totalReportHours > this.workForm.time.workHours) {
  8043. this.$message({
  8044. message: '填报工时不得超过考勤时长',
  8045. type: "error"
  8046. });
  8047. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8048. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8049. confirmButtonText: this.$t('btn.determine'),
  8050. cancelButtonText: this.$t('btn.cancel'),
  8051. type: 'warning'
  8052. }).then(() => {
  8053. this.submitReportSon()
  8054. }).catch(() => {
  8055. });
  8056. } else {
  8057. this.submitReportSon();
  8058. }
  8059. } else {
  8060. this.$message({
  8061. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8062. type: "error"
  8063. });
  8064. }
  8065. } else {
  8066. if(this.totalReportHours < this.user.timeType.allday){
  8067. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8068. confirmButtonText: this.$t('btn.determine'),
  8069. cancelButtonText: this.$t('btn.cancel'),
  8070. type: 'warning'
  8071. }).then(() => {
  8072. this.submitReportSon()
  8073. }).catch(() => {
  8074. });
  8075. }else{
  8076. this.submitReportSon()
  8077. }
  8078. }
  8079. } else {
  8080. //暂存,不需要检查工时是否超过考勤
  8081. this.submitReportSon()
  8082. }
  8083. }
  8084. });
  8085. },
  8086. submitReportSon() {
  8087. this.dateAr = []
  8088. //检查重叠
  8089. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8090. let alp = []
  8091. if(this.user.timeType.multiWorktime != 1) {
  8092. for(var p in this.workForm.domains) {
  8093. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8094. let objs = {}
  8095. objs.s = this.workForm.domains[p].startTime
  8096. objs.e = this.workForm.domains[p].endTime
  8097. alp.push(objs)
  8098. }
  8099. }
  8100. this.dateAr = alp
  8101. if(this.dateAr.length > 0) {
  8102. let trus = this.fns()
  8103. if(!trus) {
  8104. this.$message({
  8105. message: this.$t('message.Filledtimeperiodsoverlap'),
  8106. type: "error"
  8107. });
  8108. return
  8109. }
  8110. }
  8111. } else {
  8112. for(var p in this.workForm.domains) {
  8113. var slll = this.workForm.domains[p]
  8114. for(var o in slll.worktimeList) {
  8115. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8116. let objs = {}
  8117. objs.s = slll.worktimeList[o].startTime
  8118. objs.e = slll.worktimeList[o].endTime
  8119. alp.push(objs)
  8120. }
  8121. }
  8122. }
  8123. this.dateAr = alp
  8124. if(this.dateAr.length > 0) {
  8125. let trus = this.fns()
  8126. if(!trus) {
  8127. this.$message({
  8128. message: this.$t('message.Filledtimeperiodsoverlap'),
  8129. type: "error"
  8130. });
  8131. return
  8132. }
  8133. }
  8134. }
  8135. }
  8136. //检查子项目
  8137. if (this.user.timeType.subProMustFill == 1) {
  8138. for(var p in this.workForm.domains) {
  8139. var oneProItem = this.workForm.domains[p]
  8140. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8141. //没有选择子项目
  8142. this.$message({
  8143. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8144. type: "error"
  8145. });
  8146. return
  8147. }
  8148. }
  8149. }
  8150. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8151. if (this.user.companyId == this.yuzhongCompId) {
  8152. for(var p in this.workForm.domains) {
  8153. var oneProItem = this.workForm.domains[p]
  8154. if (!oneProItem.extraField1) {
  8155. this.$message({
  8156. message: this.$t('jiaoSeBiTianQingJianCha'),
  8157. type: "error"
  8158. });
  8159. return
  8160. }
  8161. if (!oneProItem.extraField2) {
  8162. this.$message({
  8163. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8164. type: "error"
  8165. });
  8166. return
  8167. }
  8168. if (!oneProItem.extraField3) {
  8169. this.$message({
  8170. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8171. type: "error"
  8172. });
  8173. return
  8174. }
  8175. }
  8176. }
  8177. // return
  8178. //代填的情况,检查人员是否已经选择
  8179. if (this.isSubstitude) {
  8180. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8181. this.$message({
  8182. message: this.$t('message.pleaseselectthepersontofillin'),
  8183. type: "error"
  8184. });
  8185. return;
  8186. }
  8187. }
  8188. //检查时间,全天和上下午不能同时存在
  8189. if (this.reportTimeType.type == 0) {
  8190. var alldayNum = 0;
  8191. var amNum = 0;
  8192. var pmNum = 0;
  8193. for(var i in this.workForm.domains) {
  8194. if (this.workForm.domains[i].timeType == 0) {
  8195. alldayNum ++;
  8196. } else if (this.workForm.domains[i].timeType == 1) {
  8197. amNum++;
  8198. } else if (this.workForm.domains[i].timeType == 2) {
  8199. pmNum++;
  8200. }
  8201. }
  8202. if (alldayNum > 1) {
  8203. this.$message({
  8204. // message: "工作时间-全天,只能选择一次",
  8205. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8206. type: "error"
  8207. });
  8208. return;
  8209. }
  8210. if (amNum > 1) {
  8211. this.$message({
  8212. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8213. type: "error"
  8214. });
  8215. return;
  8216. }
  8217. if (pmNum > 1) {
  8218. this.$message({
  8219. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8220. type: "error"
  8221. });
  8222. return;
  8223. }
  8224. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8225. this.$message({
  8226. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8227. type: "error"
  8228. });
  8229. return;
  8230. }
  8231. } else if (this.reportTimeType.type == 3) {
  8232. //总百分比不能超过100%
  8233. let total = 0;
  8234. this.workForm.domains.forEach(w=>{total += w.progress});
  8235. if (total > 100) {
  8236. this.$message({
  8237. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8238. type: "error"
  8239. });
  8240. return;
  8241. } else if (total < 100) {
  8242. this.$message({
  8243. message: this.$t('message.cannotbesubmitted'),
  8244. type: "error"
  8245. });
  8246. return;
  8247. }
  8248. }
  8249. this.listLoading = true;
  8250. let formData = new FormData();
  8251. formData.append("draft", this.isDraft);
  8252. var totalTime = 0;
  8253. for (var t=0;t<this.workForm.domains.length; t++) {
  8254. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8255. }
  8256. //批量填报不校验考勤时长,交给后台校验
  8257. if (!this.isBatch) {
  8258. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8259. if (this.workForm.time){
  8260. if (this.workForm.time.workHours == 0){
  8261. this.$message({
  8262. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8263. type: 'error'
  8264. })
  8265. return
  8266. }
  8267. }else{
  8268. this.$message({
  8269. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8270. type: 'error'
  8271. })
  8272. return
  8273. }
  8274. }
  8275. }
  8276. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8277. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8278. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8279. this.$message({
  8280. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8281. type: "error"
  8282. });
  8283. return;
  8284. }
  8285. }
  8286. for(var i in this.workForm.domains) {
  8287. // 检查任务/里程碑是否为必填
  8288. let taskRequired = this.user.timeType.taskRequired
  8289. if(taskRequired == 1) {
  8290. if(!this.workForm.domains[i].taskId) {
  8291. this.$message({
  8292. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8293. type: "error"
  8294. });
  8295. return
  8296. }
  8297. }
  8298. if(this.user.timeType.reportAuditType == 3){
  8299. let audItem = {}
  8300. let auditRule = ''
  8301. if(this.workForm.domains[i].id){
  8302. audItem.reportId = this.workForm.domains[i].id
  8303. }
  8304. if(this.user.timeType.auditLevel > 0){
  8305. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8306. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8307. }
  8308. if(this.user.timeType.auditLevel > 1){
  8309. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8310. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8311. }
  8312. if(this.user.timeType.auditLevel > 2){
  8313. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8314. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8315. }
  8316. if(this.workForm.domains[i].ccUserid){
  8317. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8318. }
  8319. if(auditRule){
  8320. auditRule = auditRule.substring(0,auditRule.length - 1)
  8321. this.$message({
  8322. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8323. type: 'error'
  8324. })
  8325. return
  8326. }
  8327. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8328. }
  8329. if (this.user.timeType.customDegreeActive) {
  8330. if (this.user.timeType.customDegreeMultiple) {
  8331. //多选
  8332. if (this.workForm.domains[i].multiDegrIdArray) {
  8333. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8334. degreeArray = degreeArray.replace(/,/g,"@");
  8335. formData.append("multiDegrId", degreeArray);
  8336. } else {
  8337. formData.append("multiDegrId", '[]');
  8338. }
  8339. } else {
  8340. //单选
  8341. if (this.workForm.domains[i].degreeId) {
  8342. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8343. } else {
  8344. formData.append("degreeId", -1);
  8345. }
  8346. }
  8347. } else {
  8348. formData.append("degreeId", -1);
  8349. }
  8350. if(this.workForm.domains[i].customData) {
  8351. // var sss = this.workForm.domains[i].degreeId.toString()
  8352. formData.append("customData", this.workForm.domains[i].customData);
  8353. } else {
  8354. formData.append("customData", 0);
  8355. }
  8356. if(this.workForm.domains[i].customText) {
  8357. formData.append("customText", this.workForm.domains[i].customText);
  8358. } else {
  8359. formData.append("customText", '-');
  8360. }
  8361. if (this.workForm.domains[i].id) {
  8362. formData.append("id", this.workForm.domains[i].id);
  8363. } else {
  8364. formData.append("id", -1);
  8365. }
  8366. formData.append("projectId", this.workForm.domains[i].projectId);
  8367. if (this.workForm.domains[i].subProjectId) {
  8368. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8369. } else {
  8370. formData.append("subProjectId", 0);
  8371. }
  8372. if (this.workForm.domains[i].groupId) {
  8373. formData.append("groupId", this.workForm.domains[i].groupId);
  8374. } else {
  8375. formData.append("groupId", 0);
  8376. }
  8377. if (this.workForm.domains[i].taskId) {
  8378. formData.append("taskId", this.workForm.domains[i].taskId);
  8379. } else {
  8380. formData.append("taskId", 0);
  8381. }
  8382. if (this.workForm.domains[i].taskFinish == true) {
  8383. formData.append("taskFinish", 1);
  8384. } else {
  8385. formData.append("taskFinish", 0);
  8386. }
  8387. formData.append("reportTimeType", this.reportTimeType.type);
  8388. if (this.reportTimeType.type == 0) {
  8389. formData.append("timeType", this.workForm.domains[i].timeType);
  8390. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8391. formData.append("workingTime", workingTime);
  8392. } else if (this.reportTimeType.type == 1){
  8393. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8394. } else if (this.reportTimeType.type == 2) {
  8395. formData.append("endTime", this.workForm.domains[i].endTime);
  8396. formData.append("startTime", this.workForm.domains[i].startTime);
  8397. } else if (this.reportTimeType.type == 3) {
  8398. //按比例分配
  8399. formData.append("progress", this.workForm.domains[i].progress);
  8400. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8401. }
  8402. if(this.user.timeType.choseFromAlbum == 1 ) {
  8403. console.log(this.workForm.domains[i].imgList)
  8404. if(this.workForm.domains[i].imgList) {
  8405. let imgListFor = this.workForm.domains[i].imgList
  8406. for(var b in imgListFor) {
  8407. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8408. }
  8409. console.log(imgListFor)
  8410. let m = JSON.stringify(imgListFor);
  8411. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8412. formData.append("picStr", m);
  8413. } else {
  8414. formData.append("picStr", '[]');
  8415. }
  8416. }
  8417. //处理多个时间事项
  8418. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8419. if (this.reportTimeType.multiWorktime == 1) {
  8420. //检查时间是否有重叠
  8421. var workList = this.workForm.domains[i].worktimeList;
  8422. for (var j=0;j<workList.length; j++) {
  8423. var curItem = workList[j];
  8424. //检查开始时间是否大于结束时间
  8425. if (curItem.startTime >= curItem.endTime) {
  8426. this.$message({
  8427. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8428. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8429. type: "error"
  8430. });
  8431. return;
  8432. }
  8433. //时间不可重叠
  8434. if (this.reportTimeType.timeCanOverlap == 0) {
  8435. for (var p = j+1;p<workList.length; p++) {
  8436. var jItem = workList[p];
  8437. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8438. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8439. this.$message({
  8440. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8441. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8442. type: "error"
  8443. });
  8444. return;
  8445. }
  8446. }
  8447. }
  8448. }
  8449. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8450. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8451. formData.append("content", m);
  8452. } else {
  8453. if (this.workForm.domains[i].content) {
  8454. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8455. m = m.replace(/,/g,",");
  8456. console.log(m, '需要传值的数据')
  8457. // formData.append("content", this.workForm.domains[i].content);
  8458. formData.append("content", m);
  8459. } else {
  8460. formData.append("content", '-');
  8461. }
  8462. }
  8463. if (this.isBatch == 0) {
  8464. formData.append("createDate", this.workForm.createDate);
  8465. } else {
  8466. //批量填报,时间范围
  8467. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8468. }
  8469. if(this.workForm.domains[i].isOvertime) {
  8470. formData.append("isOvertime", 1);
  8471. } else {
  8472. formData.append("isOvertime", 0);
  8473. }
  8474. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8475. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8476. } else {
  8477. formData.append("overtimeHours", 0);
  8478. }
  8479. if(this.workForm.domains[i].basecostId) {
  8480. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8481. } else {
  8482. formData.append("basecostId", 0);
  8483. }
  8484. if (this.workForm.userId != null) {
  8485. var targetUids = '';
  8486. this.workForm.userId.forEach(u=>{
  8487. targetUids += u + '@';
  8488. });
  8489. if (targetUids.length > 0) {
  8490. targetUids = targetUids.substring(0, targetUids.length -1);
  8491. formData.append("targetUids", targetUids);
  8492. }
  8493. }
  8494. //项目专业进度
  8495. if (this.workForm.domains[i].professionProgress) {
  8496. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8497. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8498. formData.append("professionProgress", m);
  8499. } else {
  8500. formData.append("professionProgress", "[]");
  8501. }
  8502. if (this.workForm.domains[i].stage) {
  8503. formData.append("stage", this.workForm.domains[i].stage);
  8504. } else {
  8505. formData.append("stage", "-");
  8506. }
  8507. if (this.workForm.domains[i].projectAuditorId) {
  8508. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8509. } else {
  8510. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8511. this.$message({
  8512. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8513. type: "error"
  8514. });
  8515. return;
  8516. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8517. //分组负责人先审核, 确定是选择了任务分组
  8518. if (this.workForm.domains[i].taskGroups.length == 0) {
  8519. this.$message({
  8520. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8521. type: "error"
  8522. });
  8523. return;
  8524. } else if (!this.workForm.domains[i].groupId) {
  8525. // console.log(this.workForm.domains[i]);
  8526. this.$message({
  8527. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8528. type: "error"
  8529. });
  8530. return;
  8531. }
  8532. }
  8533. }
  8534. if (this.user.companyId == this.yuzhongCompId) {
  8535. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8536. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8537. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8538. }
  8539. //依斯贝的服务Id
  8540. if (this.user.companyId == this.yisibeiCompId) {
  8541. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8542. }
  8543. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8544. this.$message({
  8545. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8546. type: "error"
  8547. });
  8548. return
  8549. }
  8550. if(this.user.timeType.userWithMultiDept == 1) {
  8551. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8552. }
  8553. if(this.user.timeType.reportExtraField4Name) {
  8554. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8555. }
  8556. if(this.user.timeType.reportExtraField5Name) {
  8557. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8558. }
  8559. }
  8560. this.submitingReport = true;
  8561. this.http.uploadFile( this.port.report.editPort, formData,
  8562. res => {
  8563. this.listLoading = false;
  8564. this.submitingReport = false;
  8565. if (res.code == "ok") {
  8566. if(res.msg!=null){
  8567. this.$message({
  8568. dangerouslyUseHTMLString: true,
  8569. message: res.msg,
  8570. type: "warning",
  8571. showClose: true,
  8572. duration: 0
  8573. });
  8574. }else{
  8575. this.$message({
  8576. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8577. type: "success"
  8578. });
  8579. }
  8580. this.dialogVisible = false;
  8581. this.jsDay = 0
  8582. this.jsTime = 0
  8583. this.getReportList();
  8584. this.getDepartment();
  8585. this.getRecentlyProject()
  8586. } else {
  8587. this.$message({
  8588. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8589. type: "error"
  8590. });
  8591. }
  8592. },
  8593. error => {
  8594. this.listLoading = false;
  8595. this.submitingReport = false;
  8596. this.$message({
  8597. message: error,
  8598. type: "error"
  8599. });
  8600. });
  8601. },
  8602. // 判断是展示那个工时导入
  8603. imports() {
  8604. if(this.user.timeType.syncCorpwxTime == 0) {
  8605. this.importDialog = true
  8606. } else {
  8607. this.importWxDialog = true
  8608. }
  8609. },
  8610. // 跳转
  8611. junpToDeskTop(id) {
  8612. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8613. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8614. },
  8615. // 通过日报
  8616. approve(id, item) {
  8617. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8618. this.approveinData = {
  8619. id: id,
  8620. date: this.date +day,
  8621. reportIds: item.id
  8622. }
  8623. if(this.user.timeType.needEvaluate == 1){
  8624. this.$set(this.approveinData,'evaluate','')
  8625. this.approveinDialog = true
  8626. }else{
  8627. this.logining = true;
  8628. this.approveinfun()
  8629. }
  8630. },
  8631. approveinfun(){
  8632. this.http.post( this.port.report.approve, this.approveinData,
  8633. res => {
  8634. this.logining = false;
  8635. if (res.code == "ok") {
  8636. this.approveinDialog = false
  8637. this.$message({
  8638. message: this.$t('message.Reviewsucceeded'),
  8639. type: "success"
  8640. });
  8641. this.refreshReportData(this.approveinData.reportIds);
  8642. this.getDepartment();
  8643. } else {
  8644. this.$message({
  8645. message: res.msg,
  8646. type: "error"
  8647. });
  8648. }
  8649. },
  8650. error => {
  8651. this.logining = false;
  8652. this.$message({
  8653. message: error,
  8654. type: "error"
  8655. });
  8656. });
  8657. },
  8658. //撤回日报
  8659. cancel(item,e) {
  8660. // console.log('can can need',item);
  8661. this.logining = true;
  8662. var ids = '';
  8663. var data = e ? item : item.data;
  8664. data.forEach(element => {
  8665. if(element.id){
  8666. ids +=(element.id+',');
  8667. }
  8668. });
  8669. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8670. res => {
  8671. this.logining = false;
  8672. if (res.code == "ok") {
  8673. this.$message({
  8674. message:this.$t('message.Withdrawalsucceeded'),
  8675. type: "success"
  8676. });
  8677. this.getReportList();
  8678. if(e){this.getReport()}
  8679. this.getDepartment();
  8680. } else {
  8681. this.$message({
  8682. message: res.msg,
  8683. type: "error"
  8684. });
  8685. }
  8686. },
  8687. error => {
  8688. this.logining = false;
  8689. this.$message({
  8690. message: error,
  8691. type: "error"
  8692. });
  8693. });
  8694. },
  8695. showDenyDialog(id,i, item) {
  8696. this.denyReasonDialog = true;
  8697. this.isDenying = false;
  8698. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8699. var ids = item.id;
  8700. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8701. },
  8702. // 未通过日报
  8703. deny() {
  8704. this.logining = true;
  8705. this.isDenying = true;
  8706. this.http.post( this.port.report.deny, this.denyForm,
  8707. res => {
  8708. this.logining = false;
  8709. this.isDenying = false;
  8710. if (res.code == "ok") {
  8711. this.$message({
  8712. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8713. type: "success"
  8714. });
  8715. this.refreshReportData(this.denyForm.reportIds);
  8716. this.getDepartment();
  8717. this.denyReasonDialog = false;
  8718. } else {
  8719. this.$message({
  8720. message: res.msg,
  8721. type: "error"
  8722. });
  8723. }
  8724. },
  8725. error => {
  8726. this.logining = false;
  8727. this.$message({
  8728. message: error,
  8729. type: "error"
  8730. });
  8731. });
  8732. },
  8733. // 查看工时记录弹窗
  8734. toView() {
  8735. this.toViewDialogVisible = true
  8736. this.toViewloading = true
  8737. this.getToView()
  8738. },
  8739. getToView() {
  8740. this.http.post( '/report-import-log/getList', this.toViewForm,
  8741. res => {
  8742. this.toViewloading = false;
  8743. if (res.code == "ok") {
  8744. // console.log(res.data, '数据数据')
  8745. this.toViewList = res.data.records
  8746. this.toViewForm.total = res.data.total
  8747. } else {
  8748. this.toViewloading = false;
  8749. this.$message({
  8750. message: res.msg,
  8751. type: "error"
  8752. });
  8753. }
  8754. })
  8755. },
  8756. // 触发 selectCat 组件更改他的值
  8757. selectCatCli(obj) {
  8758. // console.log(obj, '看看')
  8759. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8760. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8761. },
  8762. vueCasader(obj) {
  8763. if(obj.distinction == 1 && obj.item) {
  8764. let arr = []
  8765. arr.push(obj.item.value)
  8766. this.exportParam.departmentId = arr
  8767. }
  8768. if(obj.distinction == '10' && obj) {
  8769. const { id, other } = obj
  8770. this.workForm.domains[other].reportTargetDeptId = id
  8771. }
  8772. if(obj.distinction == '14' && obj) {
  8773. let arr = []
  8774. arr.push(obj.id)
  8775. this.deptIdForHasReport = arr
  8776. this.showMonthWorkTime()
  8777. }
  8778. if(obj.distinction == '15' && obj) {
  8779. let arr = []
  8780. arr.push(obj.id)
  8781. this.deptIdForNoReport = arr
  8782. this.showMonthNotWorkTime()
  8783. }
  8784. if(obj.distinction == '16' && obj) {
  8785. let arr = []
  8786. arr.push(obj.id)
  8787. this.deptIdForReminder = arr
  8788. this.showMonthWorkTimeReminder()
  8789. }
  8790. if(obj.distinction == '17' && obj) {
  8791. let arr = []
  8792. arr.push(obj.id)
  8793. this.deptIdForHasReport = arr
  8794. this.showReportTimeLessThanCardTimeList();
  8795. }
  8796. },
  8797. //分页
  8798. handleCurrentChange(val) {
  8799. this.toViewForm.pageIndex = val;
  8800. this.getToView();
  8801. },
  8802. handleSizeChange(val) {
  8803. this.toViewForm.pageSize = val;
  8804. this.getToView();
  8805. },
  8806. getAllUsersList(){
  8807. this.http.post('/user/getSimpleActiveUserList',{
  8808. },res => {
  8809. if(res.code == 'ok'){
  8810. this.allUsersList = res.data
  8811. }else{
  8812. this.$message({
  8813. message: res.msg,
  8814. type: 'error'
  8815. })
  8816. }
  8817. },err => {
  8818. this.$message({
  8819. message: err,
  8820. type: 'error'
  8821. })
  8822. })
  8823. },
  8824. //考勤工时异常,一键驳回并提醒修改
  8825. batchRejectAndRemind(item){
  8826. this.$confirm('您确定要一键驳回异常考勤工时的日报并发送消息提醒吗?',this.$t('other.prompts'), {
  8827. confirmButtonText: this.$t('btn.determine'),
  8828. cancelButtonText: this.$t('btn.cancel'),
  8829. type: "warning"
  8830. })
  8831. .then(() => {
  8832. let parameter={
  8833. ymonth: this.notfullSelectDateMonth
  8834. }
  8835. this.remindering = true;
  8836. this.http.post('/report/rejectAbnormalReportTime',parameter,res => {
  8837. this.remindering = false;
  8838. if(res.code == 'ok'){
  8839. this.$message({
  8840. message: res.msg,
  8841. type: 'success'
  8842. })
  8843. }else{
  8844. this.$message({
  8845. message: res.msg,
  8846. type: 'error'
  8847. })
  8848. }
  8849. },err => {
  8850. this.$message({
  8851. message: err,
  8852. type: 'error'
  8853. })
  8854. })
  8855. }).catch(() => {this.startDeleting = false});
  8856. },
  8857. //景昱变更提醒
  8858. changeReminder(item){
  8859. let parameter={
  8860. startDate: this.WorktimeDatepickValue[0],
  8861. endDate: this.WorktimeDatepickValue[1],
  8862. }
  8863. if(item){
  8864. parameter.createDate=item.createDate,
  8865. parameter.userId=item.userId
  8866. }
  8867. this.remindering = true;
  8868. this.http.post('/report/changeReminder',parameter,res => {
  8869. this.remindering = false;
  8870. if(res.code == 'ok'){
  8871. this.$message({
  8872. message: res.msg,
  8873. type: 'success'
  8874. })
  8875. }else{
  8876. this.$message({
  8877. message: res.msg,
  8878. type: 'error'
  8879. })
  8880. }
  8881. },err => {
  8882. this.$message({
  8883. message: err,
  8884. type: 'error'
  8885. })
  8886. })
  8887. },
  8888. //景昱取消异常
  8889. cancelReminder(item){
  8890. let parameter={}
  8891. if(item){
  8892. parameter.createDate=item.createDate,
  8893. parameter.userId=item.userId
  8894. }
  8895. this.http.post('/report/cancelReminder',parameter,res => {
  8896. if(res.code == 'ok'){
  8897. this.$message({
  8898. message: res.msg,
  8899. type: 'success'
  8900. })
  8901. }else{
  8902. this.$message({
  8903. message: res.msg,
  8904. type: 'error'
  8905. })
  8906. }
  8907. },err => {
  8908. this.$message({
  8909. message: err,
  8910. type: 'error'
  8911. })
  8912. })
  8913. this.showMonthWorkTimeReminder()
  8914. },
  8915. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8916. fillWeekCustomClne() {
  8917. this.fillWeekDialogVisiCustom = false
  8918. },
  8919. fillWeekCustomClneTwo() {
  8920. this.fillWeekDialogVisiCustomTwo = false
  8921. },
  8922. fillWeekCustomSubmit() {
  8923. this.getReportList();
  8924. this.getDepartment();
  8925. this.getRecentlyProject()
  8926. },
  8927. // 待填日报姓名搜索
  8928. nameAearchSeek(flg) {
  8929. if(!this.nameAearch) {
  8930. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8931. return
  8932. }
  8933. if(flg) {
  8934. this.enterpriseWechatgetUser()
  8935. }
  8936. },
  8937. handleThreeData(userList) {
  8938. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8939. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8940. },
  8941. // 过滤树节点
  8942. filterTreeNodes(treeData, filterKeywords) {
  8943. return treeData.filter((node) => {
  8944. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8945. if (node.children && node.children.length > 0) {
  8946. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8947. }
  8948. return true;
  8949. }
  8950. if (node.children && node.children.length > 0) {
  8951. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8952. return node.children.length > 0;
  8953. }
  8954. return false;
  8955. });
  8956. },
  8957. // 企业微信获取人员
  8958. enterpriseWechatgetUser() {
  8959. this.deptMembDataLoading = true
  8960. this.http.post('/user/getEmployeeList',{
  8961. departmentId: -1,
  8962. pageIndex: 1,
  8963. pageSize: 100,
  8964. keyword: this.nameAearch,
  8965. status: '',
  8966. roleId: '',
  8967. cursor: '',
  8968. onlyDirect: '',
  8969. matchingType: ''
  8970. },res => {
  8971. if(res.code == 'ok'){
  8972. this.deptMembDataLoading = false
  8973. const userListName = res.data.records.map(item => item.name)
  8974. this.handleThreeData(userListName)
  8975. setTimeout(() => {
  8976. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8977. }, 200)
  8978. }else{
  8979. this.deptMembDataLoading = false
  8980. this.$message({
  8981. message: res.msg,
  8982. type: 'error'
  8983. })
  8984. }
  8985. },err => {
  8986. this.deptMembDataLoading = false
  8987. this.$message({
  8988. message: err,
  8989. type: 'error'
  8990. })
  8991. })
  8992. },
  8993. changeTreeNodeStatus(node) {
  8994. let allZt = true
  8995. node.expanded = allZt
  8996. for (let i = 0; i < node.childNodes.length; i++) {
  8997. node.childNodes[i].expanded = allZt
  8998. if (node.childNodes[i].childNodes.length > 0) {
  8999. this.changeTreeNodeStatus(node.childNodes[i])
  9000. }
  9001. }
  9002. },
  9003. // 按周填报获取相关任务
  9004. async getWeeklyTaskList(item) {
  9005. const { projectId, groupId, stage, taskId } = item
  9006. let parms = { projectId, isSubstitude: 0 }
  9007. groupId ? parms.groupId = groupId : ''
  9008. stage ? parms.stage = stage : ''
  9009. const { data } = await this.postData('/task/getRecentTask', parms)
  9010. this.zhoBao.taskId = taskId
  9011. this.$set(this.zhoBao, 'taskList', data)
  9012. },
  9013. // 封装 post 请求
  9014. postData(url, params) {
  9015. return new Promise((resolve, reject) => {
  9016. this.http.post(url, { ...params },
  9017. res => {
  9018. resolve(res)
  9019. },
  9020. error => {
  9021. this.$message({
  9022. message: error,
  9023. type: "error"
  9024. });
  9025. reject(error)
  9026. })
  9027. })
  9028. },
  9029. // 自定义事件
  9030. selectCal(obj) {
  9031. if(obj.distinction == '1') {
  9032. this.zhoBao.projectAuditorId = obj.id
  9033. } else if(obj.distinction == '2') {
  9034. this.zhoBao.auditorFirst = obj.id
  9035. } else if(obj.distinction == '3') {
  9036. this.zhoBao.auditorSec = obj.id
  9037. } else if(obj.distinction == '4') {
  9038. this.zhoBao.auditorThird = obj.id
  9039. } else if(obj.distinction == '5') {
  9040. this.zhoBao.ccUserid = obj.id
  9041. } else if(obj.distinction == '12') {
  9042. this.usersListId = obj.id
  9043. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9044. this.searchKeyword = obj.name
  9045. } else {
  9046. this.searchKeyword = ''
  9047. }
  9048. this.searchScreen(0)
  9049. } else if(obj.distinction == '13') {
  9050. this.usersListId = obj.id
  9051. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9052. this.searchKeyword = obj.name
  9053. } else {
  9054. this.searchKeyword = ''
  9055. }
  9056. this.searchScreen(1)
  9057. } else if(obj.distinction == '15') {
  9058. this.usersListId = obj.id
  9059. this.showReportTimeLessThanCardTimeList();
  9060. }
  9061. }
  9062. },
  9063. created() {
  9064. this.getUsers()
  9065. let height = window.innerHeight;
  9066. this.tableHeight = height - 178;
  9067. const that = this;
  9068. window.onresize = function temp() {
  9069. that.tableHeight = window.innerHeight - 178;
  9070. };
  9071. this.toViewForm.companyId = this.user.companyId
  9072. this.initDrag([{
  9073. type: "LR",
  9074. domClass: {
  9075. // 中间分割线的名字
  9076. resize: "line-line",
  9077. // 左侧盒子的名字
  9078. left: "box-left",
  9079. // 右侧盒子的名字
  9080. right: "box-right",
  9081. // 父级的名字
  9082. box: "box-father",
  9083. },
  9084. otherInfo: {
  9085. // 限制左边栏最低宽度
  9086. leftWidth: 120,
  9087. },
  9088. },
  9089. {
  9090. type: "LR",
  9091. domClass: {
  9092. // 中间分割线的名字
  9093. resize: "line-second",
  9094. // 左侧盒子的名字
  9095. left: "left-laowang",
  9096. // 右侧盒子的名字
  9097. right: "box-second-father",
  9098. // 父级的名字
  9099. box: "grand",
  9100. },
  9101. otherInfo: {
  9102. // 限制左边栏最低宽度
  9103. leftWidth: 120,
  9104. },
  9105. },
  9106. ]);
  9107. }
  9108. };
  9109. </script>
  9110. <style lang="scss" scoped>
  9111. @import "../../assets/scss/handle";
  9112. .themeFontColor {
  9113. @include font_color("color");
  9114. }
  9115. .fillWeekDialogVisiCustom {
  9116. width: 100%;
  9117. height: 70vh;
  9118. }
  9119. .fillWeekCustom {
  9120. .el-dialog__body {
  9121. padding: 20px 20px !important;
  9122. }
  9123. }
  9124. .photos {
  9125. position: relative;
  9126. display: flex;
  9127. flex-wrap: wrap;
  9128. }
  9129. .photos_img {
  9130. width: 120px;
  9131. height: 120px;
  9132. margin-right: 20px;
  9133. margin-bottom: 20px;
  9134. cursor: pointer;
  9135. img {
  9136. width: 100%;
  9137. height: 100%;
  9138. }
  9139. }
  9140. .paginatis {
  9141. padding: 10px 10px;
  9142. background: #f2f2f2;
  9143. }
  9144. .waiting {
  9145. color:orange;
  9146. }
  9147. .filledReportStyle {
  9148. color:#32CD32;
  9149. }
  9150. .RejectStyle {
  9151. color:red;
  9152. }
  9153. .waitSubmitStyle{
  9154. @include font_color("color");
  9155. }
  9156. .chooseDate {
  9157. .waiting {
  9158. @include font_color("color");
  9159. }
  9160. .filledReportStyle {
  9161. @include font_color("color");
  9162. }
  9163. .RejectStyle {
  9164. @include font_color("color");
  9165. }
  9166. .waitSubmitStyle{
  9167. @include font_color("color");
  9168. }
  9169. }
  9170. .allDaily {
  9171. width:100%;
  9172. }
  9173. .report_title {
  9174. padding:10px 0;
  9175. color:#666;
  9176. }
  9177. .clearfix {
  9178. overflow-x: auto;
  9179. white-space: nowrap;
  9180. padding: 15px 0 10px 0;
  9181. // overflow-y: hidden;
  9182. .date_item {
  9183. padding: 0 3px;
  9184. cursor: pointer;
  9185. position: relative;
  9186. }
  9187. .chooseDate {
  9188. position: absolute;
  9189. bottom: -3px;
  9190. width: 37px;
  9191. height: 2px;
  9192. left: 14px;
  9193. @include background_color("background_color");
  9194. }
  9195. }
  9196. .one_daily {
  9197. i {
  9198. @include font_color("color1");
  9199. margin-right: 5px;
  9200. }
  9201. .one_daily_body {
  9202. padding: 10px 0px;
  9203. p {
  9204. margin: 0;
  9205. line-height: 30px;
  9206. }
  9207. }
  9208. ul {
  9209. padding: 0;
  9210. }
  9211. }
  9212. .checkbtn {
  9213. float: right;
  9214. margin-top: -10px;
  9215. }
  9216. .selConStyle{
  9217. margin-top:9rem;
  9218. margin-bottom:11rem;
  9219. .selConStyle_title{
  9220. height: 3rem;
  9221. text-align: center;
  9222. font-size: 17px;
  9223. }
  9224. .el-select{
  9225. margin: 0 15%;
  9226. width: 70%;
  9227. }
  9228. }
  9229. </style>
  9230. <style lang="scss">
  9231. /*去除upload组件过渡效果*/
  9232. .photos .el-upload-list__item {
  9233. transition: none !important;
  9234. }
  9235. .daily {
  9236. .el-card__body {
  9237. height: 80%;
  9238. overflow-y: auto;
  9239. }
  9240. .el-card__header {
  9241. padding: 0 20px;
  9242. }
  9243. }
  9244. .membListClass{
  9245. .el-dialog__body{
  9246. padding-top: 10px;
  9247. }
  9248. }
  9249. // .editReportDialog .el-dialog__footer{
  9250. // position: sticky;
  9251. // bottom: 0;
  9252. // background: #fff;
  9253. // height: 70px;
  9254. // z-index: 1010;
  9255. // }
  9256. .editReportDialog{
  9257. min-width: 800px;
  9258. }
  9259. .touruxiangmu{
  9260. max-width: 1000px;
  9261. }
  9262. </style>
  9263. <style scoped>
  9264. /* 项目标签的样式 */
  9265. .el-tag + .el-tag {
  9266. margin-left: 10px;
  9267. }
  9268. .button-new-tag {
  9269. margin-left: 10px;
  9270. height: 32px;
  9271. line-height: 30px;
  9272. padding-top: 0;
  9273. padding-bottom: 0;
  9274. }
  9275. .input-new-tag {
  9276. width: 90px;
  9277. margin-left: 10px;
  9278. vertical-align: bottom;
  9279. }
  9280. .selectworktime .el-table__fixed-body-wrapper{
  9281. top: 48px !important;
  9282. }
  9283. .selectworktime_export .selectworktime_export_l{
  9284. width: 650px;
  9285. float: left;
  9286. height: 42px;
  9287. }
  9288. .approvalProcessBox{
  9289. margin-left: 30px;
  9290. font-size: 14px;
  9291. line-height: 16px;
  9292. cursor: pointer;
  9293. }
  9294. .approvalProcessBox i {
  9295. margin-right: 0;
  9296. height: 16px;
  9297. width: 16px;
  9298. display: inline-block;
  9299. transform: scale(1.2);
  9300. position: relative;
  9301. top: 0.5px;
  9302. @include font_color("color");
  9303. }
  9304. .approvalProcessBox .approvalProcessClick{
  9305. cursor: pointer;
  9306. @include font_color("color");
  9307. font-size: 14px;
  9308. }
  9309. .approvalProcessBox:hover .approvalProcessClick{
  9310. color: #3485fb;
  9311. }
  9312. </style>
  9313. <style lang="scss" scoped>
  9314. .bionicClass {
  9315. -webkit-appearance: none;
  9316. background-color: #FFF;
  9317. background-image: none;
  9318. border-radius: 4px;
  9319. border: 1px solid #DCDFE6;
  9320. box-sizing: border-box;
  9321. color: #606266;
  9322. display: inline-block;
  9323. height: 40px;
  9324. line-height: 40px;
  9325. outline: 0;
  9326. padding: 0 15px;
  9327. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9328. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9329. width: 350px;
  9330. cursor: pointer;
  9331. .bionicClassText {
  9332. color: #C0C4CC;
  9333. }
  9334. }
  9335. // 加班样式
  9336. .overtime {
  9337. display: inline-block;
  9338. margin-left: 20px;
  9339. input {
  9340. display: inline-block;
  9341. margin-top: 5px;
  9342. }
  9343. }
  9344. .plus {
  9345. display: inline-block;
  9346. }
  9347. // .tages {
  9348. // float: right;
  9349. // }
  9350. .overtime {
  9351. display: inline-block;
  9352. margin-left: 30px;
  9353. }
  9354. .bloks {
  9355. display: inline-block;
  9356. width: 380px;
  9357. }
  9358. .zhiss {
  9359. display: flex;
  9360. justify-content: space-around;
  9361. align-items: center;
  9362. }
  9363. .zhoFel {
  9364. display: flex;
  9365. justify-content: space-between;
  9366. align-items: center;
  9367. }
  9368. // 左右滑动样式
  9369. .line {
  9370. width: 30px;
  9371. /* height: 500px; */
  9372. background: #f2f2f2;
  9373. cursor: w-resize;
  9374. }
  9375. .box-father {
  9376. border: 8px solid #000;
  9377. }
  9378. .line-second {
  9379. width: 10px;
  9380. /* background: red; */
  9381. }
  9382. .flex {
  9383. display: flex;
  9384. width: 100%;
  9385. }
  9386. .box-left {
  9387. flex: 0 0 400px;
  9388. /* height: 600px; */
  9389. /* background: blue; */
  9390. }
  9391. .box-right {
  9392. /* height: 600px; */
  9393. /* background: green; */
  9394. flex: 1;
  9395. }
  9396. .box-postion {
  9397. width: 200px;
  9398. /* height: 400px; */
  9399. background: #ccc;
  9400. }
  9401. .custom-tree-node {
  9402. flex: 1;
  9403. display: flex;
  9404. align-items: center;
  9405. justify-content: space-between;
  9406. font-size: 14px;
  9407. padding-right: 8px;
  9408. }
  9409. .daitianrbao {
  9410. width: 100%;
  9411. box-sizing: border-box;
  9412. height: 40px;
  9413. border-radius: 4px;
  9414. border: 1px solid #DCDFE6;
  9415. overflow: hidden;
  9416. text-overflow: ellipsis;
  9417. display: flex;
  9418. // align-items: center;
  9419. }
  9420. .daitianrbao .spnn {
  9421. display: inline-block;
  9422. box-sizing: border-box;
  9423. padding: 0 15px;
  9424. overflow: hidden;
  9425. text-overflow: ellipsis;
  9426. }
  9427. .daitianrbao .hover {
  9428. color: #DCDFE6 !important;
  9429. }
  9430. </style>