daily.vue 299 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933
  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="选择月份" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  31. <el-select v-model="selectState" size="small" @change="stateChange" style="100%">
  32. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  33. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  34. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  35. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  36. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  37. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  38. </el-select></div>
  39. <div>
  40. <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate">
  41. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  42. <!-- <span>{{ node.label }}</span> -->
  43. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  44. {{ node.label }}<span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  45. </span>
  46. <div style="position: absolute;right: 15px;">
  47. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  48. <!-- 未填报 -->
  49. {{$t('state.DidNotFillIn')}}
  50. </span>
  51. <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'">
  52. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  53. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  54. </span>
  55. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  56. <!-- 待审核 -->
  57. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  58. </span>
  59. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  60. <!-- 已通过 -->
  61. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  62. </span>
  63. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  64. <!-- 未通过 -->
  65. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  66. </span>
  67. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  68. <!-- 待提交 -->
  69. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  70. </span>
  71. </div>
  72. </span>
  73. </el-tree>
  74. </div>
  75. </div>
  76. </div>
  77. <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">
  78. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  79. -
  80. -
  81. -
  82. </div>
  83. </div>
  84. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  85. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  86. <div class="allDaily" style="float:left;flex-grow:1">
  87. <!--系统管理员和部门负责人 -->
  88. <div class="report_title" style="display:flex;justify-content: space-between;">
  89. <span>
  90. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  91. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept">| {{depData != null ?depData.label:""}}
  92. <span v-if="targetUid == null">
  93. <!-- - 已提交 -->
  94. -{{$t('state.hasBeenSubmitted')}}
  95. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  96. <!-- 待提交 -->
  97. {{$t('state.waitingsubmit')}}
  98. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  99. <!-- 未填写 -->
  100. {{$t('state.DidNotFillIn')}}
  101. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>{{$t('other.people')}}
  102. </span>
  103. </span>
  104. </span>
  105. <span style="float:right;">
  106. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  107. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  108. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  109. <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  110. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  111. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  112. <!--部门负责人给个导出工时的功能 -->
  113. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  114. </span>
  115. </div>
  116. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  117. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  118. <i class="fa fa-circle"></i>{{item1.name}}
  119. <span style="margin-left:30px;">
  120. <span style="margin-right:20px;">
  121. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  122. <!-- 工作总时长: -->
  123. {{$t('other.totalWorkingHours')}}
  124. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  125. <span >{{item1.reportTime | amounts}}</span>h
  126. </span>
  127. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  128. <i class="iconfont firerock-iconliucheng1"></i>
  129. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  130. <!-- 审批流程 -->
  131. {{$t('other.approvalProcess')}}
  132. </span>
  133. </span>
  134. </span>
  135. <div class="checkbtn" style="padding-right:20px;">
  136. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  137. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  138. </div>
  139. <div class="one_daily_body">
  140. <el-timeline>
  141. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  142. <el-card shadow="never">
  143. <p><!-- 项目 -->{{$t('other.project')}}:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  144. <span v-if="user.company.packageEngineering == 0">
  145. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  146. <span v-if="item2.isDeptAudit==0">
  147. <span v-if="item2.projectAuditState==0">
  148. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  149. <span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>
  150. <!-- 审核 --> {{$t('other.audit')}}
  151. </span>
  152. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  153. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  154. <span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>
  155. <!-- 审核通过 --> {{$t('state.approved')}}
  156. </span>
  157. </span>
  158. <span v-else-if="item2.isDeptAudit==1">
  159. {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}}
  160. </span>
  161. ]</span>
  162. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  163. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  164. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  165. </span>
  166. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  167. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  168. </span>
  169. <!-- <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> -->
  170. <span v-if="user.company.packageEngineering == 1">
  171. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  172. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  173. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  174. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>{{$t('other.audit')}} ]</span>
  175. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  176. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  177. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  178. </span>
  179. <!--每个项目上单独审核 -->
  180. <span style="float:right;">
  181. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  182. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  183. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  184. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  185. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  186. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  187. <!--自己可以撤回待审核状态的报告 -->
  188. <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>
  189. </span>
  190. </p>
  191. <!--任务分组和阶段 -->
  192. <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
  193. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  194. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  195. <!-- 自定义日报文本 -->
  196. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  197. <p v-if="user.company.packageEngineering == 1">
  198. {{$t('other.professionalProgress')}}:
  199. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  200. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  201. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  202. </el-tooltip>
  203. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  204. <i class="iconfont firerock-iconshenhetongguo"></i>
  205. </el-tooltip>
  206. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  207. <i class="iconfont firerock-iconshenhebohui"></i>
  208. </el-tooltip>
  209. </span>
  210. </p>
  211. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  212. </p>
  213. <div v-if="item2.multiWorktime==0">
  214. <p style="display: inline-block;">{{$t('time.duration')}}:
  215. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  216. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  217. {{item2.time.toFixed(1)}}h
  218. <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>
  219. </p>
  220. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  221. </div>
  222. <div v-if="item2.multiWorktime==1" >
  223. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  224. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  225. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  226. <p style="display: inline-block;">{{$t('time.duration')}}:
  227. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  228. {{timeItem.time.toFixed(1)}}h
  229. </p>
  230. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  231. </div>
  232. </div>
  233. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  234. <!--照片的显示 -->
  235. <p v-if="item2.pics != null && item2.pics.length > 0">
  236. <el-image v-for="(pic, index) in item2.pics" :key="index"
  237. style="width: 100px; height: 100px; margin-right:10px;"
  238. :src="pic"
  239. :preview-src-list="item2.pics">
  240. </el-image>
  241. </p>
  242. </el-card>
  243. </el-timeline-item>
  244. </el-timeline>
  245. </div>
  246. </div>
  247. <!-- 简陋的无报告提示 -->
  248. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  249. </div>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </el-card>
  255. </div>
  256. <!-- 填写日报的dialog -->
  257. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" style="height:95%" :close-on-click-modal="false" @closed="guanbi()" custom-class="editReportDialog" ref="editReportDialog">
  258. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  259. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  260. <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
  261. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  262. </el-form-item>
  263. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  264. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  265. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  266. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  267. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  268. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
  269. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  270. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  271. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  272. <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
  273. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
  274. <span v-if="user.timeType.syncDingding==1&&!workForm.time">{{$t('other.noAttendanceRecord')}}</span>
  275. </el-form-item>
  276. <!-- 000000 -->
  277. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  278. <div v-if="reportTimeType.multiWorktime==0">
  279. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  280. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  281. <el-select v-model="domain.timeType" style="width:200px;"
  282. v-if="reportTimeType.type == 0"
  283. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  284. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  285. @change="onTimeTypeChange(domain.timeType)">
  286. <el-option
  287. v-for="item in timeType"
  288. :key="item.value"
  289. :label="item.label"
  290. :value="item.value">
  291. </el-option>
  292. </el-select>
  293. <!-- 数字时长选择 -->
  294. <el-select v-model="domain.workingTime" style="width:200px;"
  295. v-if="reportTimeType.type == 1"
  296. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  297. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  298. @change="seleChn(0,domain)">
  299. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  300. </el-select>
  301. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  302. <span v-if="reportTimeType.type == 2">
  303. <!--时间范围选择 -->
  304. <el-time-picker
  305. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  306. v-model="domain.startTime"
  307. :placeholder="$t('time.startTime')"
  308. style="width:120px;"
  309. format="HH:mm"
  310. value-format="HH:mm"
  311. :picker-options="{
  312. start: '08:00',
  313. end: '23:30'
  314. }"
  315. @change="iptChang()">
  316. </el-time-picker> - <el-time-picker
  317. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  318. v-model="domain.endTime"
  319. :placeholder="$t('time.endTime')"
  320. style="width:120px;"
  321. format="HH:mm"
  322. value-format="HH:mm"
  323. :picker-options="{
  324. start: '08:00',
  325. end: '23:30',
  326. minTime: domain.startTime
  327. }"
  328. @change="iptChang()">
  329. </el-time-picker>
  330. </span>
  331. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend">
  332. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  333. <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>
  334. </div>
  335. </el-form-item>
  336. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  337. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  338. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  339. @change="selectProject(domain, index)"
  340. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  341. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  342. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  343. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  344. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  345. </el-option>
  346. </el-select>
  347. <template v-if="user.timeType.mainProjectState != 1">
  348. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  349. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  350. <!--子项目 -->
  351. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  352. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  353. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  354. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  355. </el-select>
  356. </template>
  357. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  358. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  359. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  360. </el-link>
  361. <!-- <el-link type="primary" v-if="canEdit"
  362. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  363. </el-form-item>
  364. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  365. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  366. </el-form-item>
  367. <!--如果设置了工时成本预警的预算成本项-->
  368. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  369. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  370. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  371. </el-select>
  372. </el-form-item>
  373. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  374. <!-- 任务分组 -->
  375. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  376. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  377. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  378. </el-select>
  379. <!-- 项目的阶段 -->
  380. <span v-if="domain.stages != null && domain.stages.length> 0"
  381. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  382. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  383. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  384. @change="changeStages(domain, index)"
  385. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  386. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  387. </el-select>
  388. </el-form-item>
  389. <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')">
  390. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  391. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  392. </el-select>
  393. </el-form-item>
  394. <!-- 相关维度/自定义维度 -->
  395. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  396. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit">
  397. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  398. </el-option>
  399. </el-select>
  400. </el-form-item>
  401. <!-- 相关数值 -->
  402. <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">
  403. <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>
  404. </el-form-item>
  405. <!-- 自定义文本 -->
  406. <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">
  407. <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>
  408. </el-form-item>
  409. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  410. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  411. <div style="width:300px;">
  412. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="5" :show-tooltip="false" :step="5" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  413. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}{{$t('time.hour')}}</span></el-col>
  414. </div>
  415. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  416. <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>
  417. </div>
  418. </el-form-item>
  419. <!--工程专业版本模式下, 各个专业的进度填报 -->
  420. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  421. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  422. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  423. <el-input size="mini" style="width:60px;" v-model="item.progress"
  424. @keyup.native="onProgressChange"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  426. </span>
  427. </el-form-item>
  428. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  429. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  430. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  432. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  433. </el-select>
  434. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  435. </el-form-item>
  436. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  437. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  438. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable
  439. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  440. </el-form-item>
  441. </div>
  442. <!--多个工作事项填报的情况 -->
  443. <div v-if="reportTimeType.multiWorktime==1">
  444. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  445. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  446. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  447. @change="selectProject(domain, index)"
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  449. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  450. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  451. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  452. </el-option>
  453. </el-select>
  454. <template v-if="user.timeType.mainProjectState != 1">
  455. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  456. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  457. <!--子项目 -->
  458. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  459. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  460. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  461. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  462. </el-select>
  463. </template>
  464. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  465. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  466. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  467. </el-link>
  468. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  469. <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>
  470. </div>
  471. <!-- <el-link type="primary" v-if="canEdit"
  472. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  473. </el-form-item>
  474. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  475. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  476. </el-form-item>
  477. <!--如果设置了工时成本预警的预算成本项-->
  478. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  479. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  480. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  481. </el-select>
  482. </el-form-item>
  483. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  484. <!-- 任务分组 -->
  485. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  486. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  487. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  488. </el-select>
  489. <!-- 项目的阶段 -->
  490. <span v-if="domain.stages != null && domain.stages.length> 0"
  491. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  492. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  493. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  494. @change="changeStages(domain, index)"
  495. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  496. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  497. </el-select>
  498. </el-form-item>
  499. <el-form-item :label="$t('other.projectAuditor')" >
  500. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  501. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  502. </el-select>
  503. </el-form-item>
  504. <!--工程专业版本模式下, 各个专业的进度填报 -->
  505. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  506. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  507. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  508. <el-input size="mini" style="width:60px;" v-model="item.progress"
  509. @keyup.native="onProgressChange"
  510. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  511. </span>
  512. </el-form-item>
  513. <!-- 相关维度 -->
  514. <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'">
  515. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')">
  516. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  517. </el-option>
  518. </el-select>
  519. </el-form-item>
  520. <!-- 相关数值 -->
  521. <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">
  522. <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>
  523. </el-form-item>
  524. <!-- 自定义文本 -->
  525. <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">
  526. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  527. </el-form-item>
  528. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  529. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  530. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  531. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  532. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  533. </el-select>
  534. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  535. </el-form-item>
  536. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  537. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  538. <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>
  539. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  540. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  541. <span v-if="reportTimeType.type == 2">
  542. <!-- <span> -->
  543. <!--时间范围选择 -->
  544. <el-time-picker
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  546. v-model="timeItem.startTime"
  547. :placeholder="$t('time.startTime')"
  548. style="width:120px;"
  549. format="HH:mm"
  550. value-format="HH:mm"
  551. :picker-options="{
  552. start: '00:00',
  553. end: '23:59',
  554. }"
  555. @change="iptChangs()">
  556. </el-time-picker> - <el-time-picker
  557. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  558. v-model="timeItem.endTime"
  559. :placeholder="$t('time.endTime')"
  560. style="width:120px;"
  561. format="HH:mm"
  562. value-format="HH:mm"
  563. :picker-options="{
  564. start: '00:00',
  565. end: '23:59',
  566. minTime: timeItem.startTime
  567. }"
  568. @change="iptChangs()">
  569. </el-time-picker>
  570. </span>
  571. </el-form-item>
  572. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  573. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  574. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  575. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  576. ></el-input>
  577. </el-form-item>
  578. </div>
  579. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  580. </div>
  581. <!--照片的显示 -->
  582. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  583. <el-image v-for="(pic, index) in domain.pics" :key="index"
  584. style="width: 100px; height: 100px; margin-right:10px;"
  585. :src="pic"
  586. :preview-src-list="domain.pics">
  587. </el-image>
  588. </p>
  589. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  590. </div>
  591. <span id="workFormsItemBottom"></span>
  592. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;position:sticky;bottom:70px;background:#fff;z-index:1010">{{$t('other.addMore')}}</el-link>
  593. </el-form>
  594. <span slot="footer" class="dialog-footer">
  595. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  596. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  597. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  598. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  599. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  600. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  601. </span>
  602. </el-dialog>
  603. <!-- 按周填报 -->
  604. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  605. <!-- 按周填报-已填工时-点击 -->
  606. <el-dialog append-to-body title="已填日报" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  607. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  608. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  609. <el-table-column prop="time" label="工时(h)"></el-table-column>
  610. <el-table-column prop="state" label="状态">
  611. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  612. </el-table-column>
  613. <!-- <el-table-column label="操作">
  614. <template slot-scope="scope">
  615. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  616. </template>
  617. </el-table-column> -->
  618. </el-table>
  619. <span slot="footer" class="dialog-footer">
  620. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">删除</el-button>
  621. </span>
  622. </el-dialog>
  623. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  624. <el-form-item label="工作日期" prop="createDate">
  625. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px" :clearable="false"></el-date-picker>
  626. <el-button @click="handleGetPrevWeek()">上一周</el-button>
  627. <el-button @click="handleGetNextvWeek()">下一周</el-button>
  628. <el-button @click="getCurrentWeek()">本周</el-button>
  629. <el-button @click="newDates()">新增日期</el-button>
  630. </el-form-item>
  631. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  632. <el-table-column fixed="left" prop="zhoDataTime" label="日期" width="160">
  633. <template slot-scope="scope">
  634. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData}})
  635. </template>
  636. </el-table-column>
  637. <el-table-column fixed="left" label="已填工时(h)" width="100" prop="filledTime" align="center">
  638. <template slot-scope="scope">
  639. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  640. <p v-else></p>
  641. </template>
  642. </el-table-column>
  643. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  644. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
  645. <template slot-scope="scope">
  646. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  647. <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</el-button>
  648. <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</el-button>
  649. <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]}}</el-button>
  650. <el-button v-else type="text" >请填写</el-button>
  651. </div>
  652. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  653. <el-button v-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]}}</el-button>
  654. <el-button v-else type="text" >请填写</el-button>
  655. </div>
  656. </template>
  657. </el-table-column>
  658. <el-table-column fixed="right" label="考勤打卡" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  659. <template slot-scope="scope">
  660. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
  661. <span v-else>暂无考勤记录</span>
  662. </template>
  663. </el-table-column>
  664. <el-table-column fixed="right" prop="he" label="合计(h)" width="120">
  665. <template slot-scope="scope">
  666. <div class="zhiss">
  667. <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
  668. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  669. </div>
  670. </template>
  671. </el-table-column>
  672. </el-table>
  673. </el-form>
  674. <!-- 按周填报项目筛选 -->
  675. <div v-if="selConShow" class="selConStyle">
  676. <div class="selConStyle_title">请选择要填报的项目</div>
  677. <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
  678. <el-option
  679. v-for="item in fillProjectList"
  680. :disabled="item.status!=1 && item.status!=4"
  681. :key="item.id"
  682. :label="item.projectName"
  683. :value="item.id">
  684. </el-option>
  685. </el-select>
  686. </div>
  687. <span slot="footer" class="dialog-footer" v-if="selConShow">
  688. <el-button @click="selListqx()">取 消</el-button>
  689. <el-button type="primary" @click="selListFun()">下一步</el-button>
  690. <!-- :loading="submitingReport" -->
  691. </span>
  692. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  693. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">选择项目</el-button>
  694. <el-button @click="zhoAddqx()">取 消</el-button>
  695. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">提 交</el-button>
  696. </span>
  697. </el-dialog>
  698. <!-- 选择时间 -->
  699. <el-dialog title="时间选择" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  700. <span>这是一段信息</span>
  701. <span slot="footer" class="dialog-footer">
  702. <el-button @click="btnZho = false">取 消</el-button>
  703. <el-button type="primary" @click="btnZho = false">确 定</el-button>
  704. </span>
  705. </el-dialog>
  706. <!-- 按周填报弹窗 -->
  707. <el-dialog title="请填写" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  708. <div>
  709. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  710. <p>子项目</p>
  711. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  712. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  713. </el-select>
  714. </div>
  715. <!--如果设置了工时成本预警的预算成本项-->
  716. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  717. <p>预算来源</p>
  718. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  719. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  720. </el-select>
  721. </div>
  722. <!-- 任务分组 -->
  723. <div class="zhoFel" v-if="user.company.packageProject == 1">
  724. <p>任务分组</p>
  725. <el-select v-model="zhoBao.groupId" placeholder="请选择任务分组" clearable="true" style="width: 355px"
  726. @change="getGroupStages(zhoBao, 0)">
  727. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  728. </el-select>
  729. </div>
  730. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  731. <p>投入阶段</p>
  732. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  733. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  734. </el-select>
  735. </div>
  736. <div class="zhoFel" >
  737. <p>审核人</p>
  738. <el-select v-model="zhoBao.projectAuditorId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  739. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  740. </el-select>
  741. </div>
  742. <!-- 自定义维度 -->
  743. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  744. <p>{{user.timeType.customDegreeName}}</p>
  745. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  746. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  747. </el-select>
  748. </div>
  749. <!-- 自定义数值 -->
  750. <div class="zhoFel" v-if="user.timeType.customDataActive">
  751. <p>{{user.timeType.customDataName}}</p>
  752. <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>
  753. </div>
  754. <!-- 自定义文本 -->
  755. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  756. <p>{{user.timeType.customTextName}}</p>
  757. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  758. </div>
  759. <div class="zhoFel" v-if="reportTimeType.type == 2">
  760. <p>选择时间</p>
  761. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
  762. </div>
  763. <div class="zhoFel" v-if="reportTimeType.type == 1">
  764. <p>选择时长</p>
  765. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  766. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  767. </el-select>
  768. </div>
  769. <div class="zhoFel" v-if="reportTimeType.type == 3">
  770. <p>用时占比</p>
  771. <div style="width:355px;display: flex;align-items: center;">
  772. <el-col span="23"><el-slider style="margin-left: 5px;width:249px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)"></el-slider></el-col>
  773. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}小时</span></el-col>
  774. </div>
  775. </div>
  776. <div class="zhoFel">
  777. <p>工作事项</p>
  778. <el-input type="textarea" v-model="zhoBao.con" placeholder="请输入工作事项" style="width: 355px" clearable></el-input>
  779. </div>
  780. </div>
  781. <span slot="footer" class="dialog-footer">
  782. <el-button @click="tianxieDialogVisible = false">取 消</el-button>
  783. <el-button type="primary" @click="btnTianxiaes()">确 定</el-button>
  784. </span>
  785. </el-dialog>
  786. <!-- 批量日报审核 -->
  787. <el-dialog title="批量项目报告审核" :visible.sync="approveDialogVisible" width="500px" >
  788. <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  789. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  790. </el-tree>
  791. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">仅能看到自己负责的待项目审核的日报填写人员</div>
  792. <span slot="footer" class="dialog-footer">
  793. <el-button @click="approveDialogVisible = false">取消</el-button>
  794. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
  795. </span>
  796. </el-dialog>
  797. <!--导出报表条件选择 -->
  798. <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  799. <el-form ref="form3" :model="exportParam" >
  800. <el-form-item prop="projectId" label="选择项目">
  801. <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable filterable style="width:350px;">
  802. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  803. </el-select>
  804. </el-form-item>
  805. <el-form-item prop="departmentId" label="选择部门" v-if="permissions.reportsCompany">
  806. <el-cascader v-model="exportParam.departmentId" placeholder="全部部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  807. </el-form-item>
  808. <el-form-item prop="projectId" label="日期范围">
  809. <el-date-picker
  810. v-model="exportParam.dateRange" :editable="false"
  811. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  812. :clearable="true"
  813. range-separator="至"
  814. type="daterange"
  815. start-placeholder="开始日期"
  816. end-placeholder="结束日期"
  817. ></el-date-picker>
  818. </el-form-item>
  819. <el-form-item prop="stateKey" label="是否包含">
  820. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  821. <el-option label="不包含未审核" value="0"></el-option>
  822. <el-option label="包含未审核" value="1"></el-option>
  823. </el-select>
  824. </el-form-item>
  825. </el-form>
  826. <div slot="footer" class="dialog-footer">
  827. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">导出</el-button>
  828. </div>
  829. </el-dialog>
  830. <!--导出报表条件选择 -->
  831. <el-dialog title="工时统计导出" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  832. <el-form ref="form3" :model="exportParam" >
  833. <el-form-item prop="range" label="日期范围">
  834. <el-date-picker
  835. v-model="exportParam.dateRange" :editable="false"
  836. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  837. :clearable="true"
  838. range-separator="至"
  839. type="daterange"
  840. start-placeholder="开始日期"
  841. end-placeholder="结束日期"
  842. ></el-date-picker>
  843. </el-form-item>
  844. </el-form>
  845. <div slot="footer" class="dialog-footer">
  846. <el-button type="primary" @click="exportUserTime" style="width:100%;" >导出</el-button>
  847. </div>
  848. </el-dialog>
  849. <!--人员列表 -->
  850. <el-dialog :title="(isFill?'已填':'未填')+'人员列表'" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  851. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  852. <el-tab-pane :label="'当日未填(' + fillMembList.length +'人)'" :name="0">
  853. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  854. <el-table-column type="selection"></el-table-column>
  855. <el-table-column prop="label" label="姓名" >
  856. <template slot-scope="scope">
  857. <span>{{(scope.row.leaveDays || scope.row.leaveTimes) ? scope.row.label + (scope.row.leaveDays ? '(请假' + scope.row.leaveDays + '天)' : '(请假' + scope.row.leaveTimes + 'h)') : scope.row.label}}</span>
  858. </template>
  859. </el-table-column>
  860. <el-table-column prop="deptName" label="部门" >
  861. </el-table-column>
  862. </el-table>
  863. </el-tab-pane>
  864. <el-tab-pane :label="'全天请假(' + fillMembList_leave.length + '人)'" :name="1">
  865. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  866. <el-table-column prop="label" label="姓名" >
  867. <template slot-scope="scope">
  868. <!-- <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> -->
  869. <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>
  870. </template>
  871. </el-table-column>
  872. <el-table-column prop="deptName" label="部门" >
  873. </el-table-column>
  874. </el-table>
  875. </el-tab-pane>
  876. </el-tabs>
  877. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  878. <el-table-column type="selection"></el-table-column>
  879. <el-table-column prop="label" label="姓名" ></el-table-column>
  880. <el-table-column prop="deptName" label="部门" >
  881. </el-table-column>
  882. </el-table>
  883. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  884. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">企业微信催填</el-button>
  885. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">钉钉催填</el-button>
  886. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">微信催填</el-button>
  887. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">导出</el-button>
  888. </div>
  889. </el-dialog>
  890. <!-- 按部门选择人员 -->
  891. <el-dialog title="选择需要代填报的人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  892. <el-input style="width:100%" v-model="deptMembDataText" placeholder="请输入姓名搜索"></el-input>
  893. <div class="tree" style="height:400px">
  894. <el-scrollbar style="height:100%">
  895. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  896. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  897. highlight-current :filter-node-method="filterNode"></el-tree>
  898. </el-scrollbar>
  899. </div>
  900. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  901. <div slot="footer" class="dialog-footer">
  902. <el-button @click="chooseParticipVisible = false" >取消</el-button>
  903. <el-button type="primary" @click="chooseParticip()" >确定</el-button>
  904. </div>
  905. </el-dialog>
  906. <el-dialog
  907. v-if="monthWorkTimeDialog"
  908. :visible.sync="monthWorkTimeDialog"
  909. :close-on-click-modal="false"
  910. customClass="customWidth selectworktime"
  911. width="63%"
  912. title=""
  913. >
  914. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  915. <el-tabs v-model="activeName" @tab-click="handleClick">
  916. <el-tab-pane label="已填工时情况" name="first">
  917. <div class="selectworktime_export" style="margin-top:10px;">
  918. <div class="selectworktime_export_l">
  919. <el-date-picker
  920. class="selecteworktime_datapick"
  921. v-model="WorktimeDatepickValue"
  922. value-format="yyyy-MM-dd"
  923. type="daterange"
  924. align="right"
  925. unlink-panels
  926. range-separator="至"
  927. start-placeholder="开始日期"
  928. end-placeholder="结束日期"
  929. :default-time="['12:00:00', '12:00:00']"
  930. size="small"
  931. popper-class="selecteorktime_datapick_popper"
  932. @change="showMonthWorkTime()"
  933. >
  934. </el-date-picker>
  935. <el-button size="small" @click="getDoubleLastWeek(1)">上上周</el-button>
  936. <el-button size="small" @click="getLastWeek(1)">上周</el-button>
  937. <el-button size="small" @click="getThisWeek(1)">本周</el-button>
  938. <!-- 222 -->
  939. </div>
  940. <div>
  941. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  942. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  943. </el-input>
  944. </div>
  945. <el-link
  946. type="primary"
  947. style="float: right; vertical-align: middle;height:32px"
  948. @click="exportMembWorkHours()"
  949. >导出数据</el-link
  950. >
  951. </div>
  952. <el-table ref="hasworkTbl"
  953. :data="monthWorkDataS"
  954. v-el-table-infinite-scroll="listScroll"
  955. border
  956. :height="500"
  957. highlight-current-row
  958. style="width: 100%"
  959. v-loading="tbload"
  960. :lazy="true"
  961. >
  962. <el-table-column width="75" type="index" fixed="left" label="序号">
  963. <template slot-scope="scope">
  964. {{ scope.$index + 1 }}
  965. </template>
  966. </el-table-column>
  967. <el-table-column width="105" prop="name" fixed="left" label="姓名">
  968. <template slot-scope="scope">
  969. <span :style="scope.row.worktimeList.length==0?'color:red':''">{{scope.row.name}}</span>
  970. </template>
  971. </el-table-column>
  972. <el-table-column prop="departmentName" fixed="left" label="部门">
  973. </el-table-column>
  974. <el-table-column
  975. min-width="105"
  976. v-for="(item, index) in pickDateArray"
  977. :key="index"
  978. :label="item.label"
  979. align="center"
  980. >
  981. <template slot-scope="scope">
  982. <div
  983. style="color: red"
  984. v-if="
  985. scope.row.worktimeList.filter(
  986. (w) =>
  987. w.createDate==item.date
  988. ).length > 0 &&
  989. scope.row.worktimeList.filter(
  990. (w) =>w.createDate==item.date
  991. )[0].workingTime < reportTimeType.allday
  992. "
  993. >
  994. {{
  995. scope.row.worktimeList.filter(
  996. (w) =>w.createDate==item.date
  997. )[0].workingTime.toFixed(1)
  998. }}
  999. </div>
  1000. <div
  1001. style="color: #20a0ff"
  1002. v-if="
  1003. scope.row.worktimeList.filter(
  1004. (w) =>w.createDate==item.date
  1005. ).length > 0 &&
  1006. scope.row.worktimeList.filter(
  1007. (w) =>w.createDate==item.date
  1008. )[0].workingTime > reportTimeType.allday
  1009. "
  1010. >
  1011. {{
  1012. scope.row.worktimeList.filter(
  1013. (w) =>w.createDate==item.date
  1014. )[0].workingTime.toFixed(1)
  1015. }}
  1016. </div>
  1017. <div
  1018. v-if="
  1019. scope.row.worktimeList.filter(
  1020. (w) =>w.createDate==item.date
  1021. ).length > 0 &&
  1022. scope.row.worktimeList.filter(
  1023. (w) =>w.createDate==item.date
  1024. )[0].workingTime == reportTimeType.allday
  1025. "
  1026. >
  1027. {{
  1028. scope.row.worktimeList.filter(
  1029. (w) =>w.createDate==item.date
  1030. )[0].workingTime
  1031. }}
  1032. </div>
  1033. <div
  1034. v-if="
  1035. scope.row.worktimeList.filter(
  1036. (w) =>w.createDate==item.date
  1037. ).length == 0
  1038. "
  1039. >
  1040. 0
  1041. </div>
  1042. <div
  1043. v-if="
  1044. scope.row.worktimeList.filter(
  1045. (w) =>w.createDate==item.date
  1046. ).length > 0 &&
  1047. typeof scope.row.worktimeList.filter(
  1048. (w) =>w.createDate==item.date
  1049. )[0].workingTime == 'string'
  1050. "
  1051. >
  1052. {{
  1053. scope.row.worktimeList.filter(
  1054. (w) =>w.createDate==item.date
  1055. )[0].workingTime
  1056. }}
  1057. </div>
  1058. </template>
  1059. </el-table-column>
  1060. </el-table>
  1061. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
  1062. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="warning" center show-icon></el-alert>
  1063. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1064. <label style="font-size: 16px">员工每日已填报工时数</label>
  1065. <el-link
  1066. type="primary"
  1067. style="float: right; margin-right: 60px"
  1068. @click="exportMembWorkHours()"
  1069. >导出已填报数据</el-link
  1070. > -->
  1071. <!-- <el-button >导出</el-button> -->
  1072. <!-- </div> -->
  1073. </el-tab-pane>
  1074. <el-tab-pane label="未填人员列表" name="second" >
  1075. <div class="selectworktime_export" style="margin-top:10px">
  1076. <div class="selectworktime_export_l">
  1077. <el-date-picker
  1078. class="selecteworktime_datapick"
  1079. v-model="WorktimeDatepickValue"
  1080. value-format="yyyy-MM-dd"
  1081. type="daterange"
  1082. align="right"
  1083. unlink-panels
  1084. range-separator="至"
  1085. start-placeholder="开始日期"
  1086. end-placeholder="结束日期"
  1087. :default-time="['12:00:00', '12:00:00']"
  1088. size="small"
  1089. popper-class="selecteorktime_datapick_popper"
  1090. @change="showMonthNotWorkTime()"
  1091. >
  1092. </el-date-picker>
  1093. <el-button size="small" @click="getDoubleLastWeek()">上上周</el-button>
  1094. <el-button size="small" @click="getLastWeek()">上周</el-button>
  1095. <el-button size="small" @click="getThisWeek()">本周</el-button>
  1096. </div>
  1097. <div>
  1098. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  1099. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1100. </el-input>
  1101. </div>
  1102. <el-link
  1103. type="primary"
  1104. style="float: right; vertical-align: middle;height:32px"
  1105. @click="exportMembNotWorkHours()"
  1106. >导出数据</el-link
  1107. >
  1108. </div>
  1109. <el-table
  1110. ref="hasworkTbl2"
  1111. :data="monthNotWorkDateS"
  1112. v-el-table-infinite-scroll="notListScroll"
  1113. border
  1114. :height="500"
  1115. highlight-current-row
  1116. style="width: 100%"
  1117. v-loading="tbload"
  1118. lazy
  1119. >
  1120. <el-table-column min-width="150" label="部门" prop="department">
  1121. </el-table-column>
  1122. <el-table-column min-width="150" prop="name" label="姓名" >
  1123. </el-table-column>
  1124. <el-table-column
  1125. min-width="200"
  1126. label="未填日期"
  1127. align="center"
  1128. prop="createDate"
  1129. >
  1130. </el-table-column>
  1131. <el-table-column
  1132. min-width="200"
  1133. label="考勤数据"
  1134. prop="cardTime"
  1135. align="center"
  1136. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1137. </el-table>
  1138. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
  1139. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="success" center show-icon></el-alert>
  1140. </el-tab-pane>
  1141. </el-tabs>
  1142. </el-dialog>
  1143. <!--驳回弹出框 -->
  1144. <el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1145. <div>
  1146. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'" />
  1147. </div>
  1148. <div slot="footer" class="dialog-footer">
  1149. <el-button @click="denyReasonDialog = false" >取消</el-button>
  1150. <el-button type="primary" @click="deny()" >确定</el-button>
  1151. </div>
  1152. </el-dialog>
  1153. <!-- 通过弹出框 -->
  1154. <el-dialog title="审核评价" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1155. <div>
  1156. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" placeholder="请输入您决定通过的评价" />
  1157. </div>
  1158. <div slot="footer" class="dialog-footer">
  1159. <el-button @click="approveinDialog = false" >取消</el-button>
  1160. <el-button type="primary" @click="approveinfun()" >确定</el-button>
  1161. </div>
  1162. </el-dialog>
  1163. <!--批量导入日报 -->
  1164. <el-dialog title="工时批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1165. <p>1. 下载
  1166. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/员工工时统计模板2.xlsx" download="员工工时导入模板.xlsx">员工工时统计模板.xlsx</el-link>
  1167. </p>
  1168. <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p>
  1169. <p style="display: flex;justify-content: center;">
  1170. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1171. <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
  1172. </el-upload>
  1173. </p>
  1174. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1175. <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
  1176. </div>
  1177. </el-dialog>
  1178. <!-- 工时导入记录弹窗 -->
  1179. <el-dialog title="工时导入记录" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1180. <div style="height: 452px">
  1181. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1182. <el-table-column prop="indate" label="导入时间"> </el-table-column>
  1183. <el-table-column prop="userName" label="操作人"> </el-table-column>
  1184. <el-table-column prop="datel" label="文件">
  1185. <template slot-scope="scope">
  1186. <div>
  1187. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1188. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1189. </div>
  1190. </template>
  1191. </el-table-column>
  1192. </el-table>
  1193. <el-col :span="24" class="paginatis">
  1194. <el-pagination
  1195. @size-change="handleSizeChange"
  1196. @current-change="handleCurrentChange"
  1197. :page-sizes="[20 , 50 , 80 , 100]"
  1198. :page-size="20"
  1199. layout="total, sizes, prev, pager, next"
  1200. :total="toViewForm.total"
  1201. style="float:right;"
  1202. ></el-pagination>
  1203. </el-col>
  1204. </div>
  1205. </el-dialog>
  1206. <!--基于企业微信考勤数据的工时导入 -->
  1207. <el-dialog title="工时批量导入" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1208. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1209. <el-step title="选择要导入工时的日期范围">
  1210. </el-step>
  1211. <el-step title="下载带考勤数据的模板"></el-step>
  1212. <el-step title="填写模板,上传数据"></el-step>
  1213. </el-steps>
  1214. <div v-if="active==0" style="padding:30px;height:360px;">
  1215. <div style="margin-top:50px;margin-left:280px;">
  1216. <el-date-picker
  1217. v-model="importWxParam.date" :editable="false"
  1218. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1219. :clearable="true"
  1220. range-separator="至"
  1221. type="daterange"
  1222. start-placeholder="开始日期"
  1223. end-placeholder="结束日期"
  1224. @change="loadCheckInData"
  1225. ></el-date-picker>
  1226. </div>
  1227. </div>
  1228. <div v-if="active==1" style="padding:10px;">
  1229. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1230. style="width: 100%;margin-top:5px;" >
  1231. <el-table-column prop="hasPassed" label="审核状态" width="100px">
  1232. <template slot-scope="scope">
  1233. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">已审</span>
  1234. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">未审</span>
  1235. </template>
  1236. </el-table-column>
  1237. <el-table-column prop="createDate" label="工作日期" >
  1238. </el-table-column>
  1239. <el-table-column prop="weekDayTxt" label="星期" ></el-table-column>
  1240. <el-table-column prop="username" label="员工姓名" ></el-table-column>
  1241. <el-table-column prop="startTime" label="上班时间" ></el-table-column>
  1242. <el-table-column prop="endTime" label="下班时间" ></el-table-column>
  1243. <el-table-column prop="workHours" label="实际工作时长" align="right">
  1244. <template slot-scope="scope">
  1245. {{scope.row.workHours.toFixed(1)}}h
  1246. </template>
  1247. </el-table-column>
  1248. </el-table>
  1249. </div>
  1250. <div v-if="active==2" >
  1251. <p style="display: flex;justify-content: center;height:390px;">
  1252. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1253. <el-button type="primary" :underline="false" :loading="importingData">选择文件并上传</el-button>
  1254. </el-upload>
  1255. </p>
  1256. </div>
  1257. <div slot="title">
  1258. <span style="font-size:16px;">工时批量导入</span>
  1259. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">查看工时导入记录</el-link>
  1260. </div>
  1261. <span slot="footer">
  1262. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1263. type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
  1264. <el-button @click="pre" v-if="active!=0">上一步</el-button>
  1265. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
  1266. </span>
  1267. </el-dialog>
  1268. <!--工时批量代填 -->
  1269. <el-dialog title="工时批量代填" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1270. <div>
  1271. <span>选择日期范围:</span><el-date-picker
  1272. v-model="importWxParam.date" :editable="false"
  1273. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1274. :clearable="true"
  1275. range-separator="至"
  1276. type="daterange"
  1277. start-placeholder="开始日期"
  1278. end-placeholder="结束日期"
  1279. @change="loadCheckInData"
  1280. ></el-date-picker>
  1281. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">提交</el-button>
  1282. </div>
  1283. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1284. :key="timeStamp"
  1285. style="width: 100%;margin-top:5px;" ref="tab">
  1286. <el-table-column prop="createDate" label="工作日期" width="100px" fixed="left"></el-table-column>
  1287. <el-table-column prop="username" label="员工姓名" width="80px" fixed="left"></el-table-column>
  1288. <el-table-column prop="startTime" label="上班时间" width="80px" fixed="left"></el-table-column>
  1289. <el-table-column prop="endTime" label="下班时间" width="80px" fixed="left"></el-table-column>
  1290. <el-table-column prop="workHours" label="工作时长" width="80px" align="right" fixed="left">
  1291. <template slot-scope="scope">
  1292. {{scope.row.workHours.toFixed(1)}}h
  1293. </template>
  1294. </el-table-column>
  1295. <!--项目名称列表 -->
  1296. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1297. <template slot-scope="scope">
  1298. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1299. </template>
  1300. </el-table-column>
  1301. <el-table-column prop="totalFillTime" label="总工时" fixed="right">
  1302. <template slot-scope="scope">
  1303. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1304. </template>
  1305. </el-table-column>
  1306. </el-table>
  1307. </el-dialog>
  1308. <!--基于企业微信考勤数据的工时导入 -->
  1309. <el-dialog title="工时导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1310. <div>
  1311. <span>{{importResultMsg}}</span>
  1312. </div>
  1313. <span slot="footer" class="dialog-footer">
  1314. <el-button type="primary" @click="showImportResult=false">确定</el-button>
  1315. </span>
  1316. </el-dialog>
  1317. <!-- 审核流程展示 -->
  1318. <el-dialog title="审核流程" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1319. <div style="padding:20px 40px 20px 0">
  1320. <el-timeline :reverse="false">
  1321. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">{{item.msg}}</el-timeline-item>
  1322. </el-timeline>
  1323. </div>
  1324. </el-dialog>
  1325. </section>
  1326. </template>
  1327. <script>
  1328. // 左右滑动
  1329. import dragMixin from "@/common/js/tensile.js";
  1330. import util from "../../common/js/util";
  1331. export default {
  1332. mixins: [dragMixin],
  1333. data() {
  1334. return {
  1335. exportLoad: false,
  1336. getPickerOptions: {
  1337. disabledDate: (time) => {
  1338. var date = new Date();
  1339. var year = date.getFullYear();
  1340. var month = date.getMonth() + 1;
  1341. if (month >= 1 && month <= 9) {
  1342. month = "0" + month;
  1343. }
  1344. var currentdate = year.toString() + month.toString();
  1345. var timeyear = time.getFullYear();
  1346. var timemonth = time.getMonth() + 1;
  1347. if (timemonth >= 1 && timemonth <= 9) {
  1348. timemonth = "0" + timemonth;
  1349. }
  1350. var timedate = timeyear.toString() + timemonth.toString();
  1351. if(this.user.timeType.fillAhead == 0){
  1352. return currentdate < timedate;
  1353. }else{
  1354. return false
  1355. }
  1356. }
  1357. },
  1358. alalal: '8.0',
  1359. timeBasecostList:null,
  1360. tbload: false,
  1361. exportTimeDialog: false,
  1362. searchKeyword: '',
  1363. monthWorkDataS: [],
  1364. monthNotWorkDateS: [],
  1365. pickDateArray:[],
  1366. WorktimeDatepickValue: [],
  1367. activeName:"first",
  1368. isLeave: 0,
  1369. submitingReport: false,
  1370. importResultMsg:null,
  1371. showImportResult:false,
  1372. importingData: false,
  1373. isDraft: 0,
  1374. timeStamp: 0,
  1375. projectColumns:[],
  1376. checkinLoading:false,
  1377. importWxParam:{date:null,},
  1378. active:0,
  1379. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1380. importWxDialog:false,
  1381. importDialog:false,
  1382. denyForm:null,
  1383. denyReasonDialog:false,
  1384. monthWorkTimeDialog: false,
  1385. isSubstitude:false,
  1386. isFill:false,
  1387. unFillList:[],
  1388. fillList:[],
  1389. fillMembList:[],
  1390. fillMembList_leave: [],
  1391. membListVisible: false,
  1392. isBatch:0,//是否是批量填报
  1393. editTitle: ['填写日报','批量填报','代填日报'],
  1394. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1395. 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')],
  1396. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1397. fillStatusList: [],
  1398. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1399. exportDialog:false,
  1400. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1401. subProjectList:[],
  1402. canEdit: true,
  1403. timeRange:[0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0],
  1404. selectTime:null,
  1405. reportTimeType:{},
  1406. curDate:'',
  1407. isAllSelect: false,
  1408. approveDialogVisible:false,
  1409. deptId:null,
  1410. targetUid: null,
  1411. membCount:0,
  1412. selectState:"-1",
  1413. user: JSON.parse(sessionStorage.getItem("user")),
  1414. showAddMore:false,
  1415. allDate: [],
  1416. typeList:['全天','上午','下午'],
  1417. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1418. choseDay: 0,
  1419. tableHeight: 0,
  1420. listLoading: false,
  1421. projectList: [], //项目列表
  1422. fillProjectList: [],
  1423. reportList: [], //日报列表
  1424. reportNames:[], //批量审批列表
  1425. selCon:[], //筛选条件
  1426. selProjectList:[], //筛选后项目列表
  1427. selConShow: true,
  1428. dialogVisible: false, //项目弹窗
  1429. report: '',
  1430. workForm: {
  1431. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1432. domains: [{
  1433. id: null,
  1434. projectId: "",
  1435. workingTime: "",
  1436. timeType:0,
  1437. content: "",
  1438. state: 2,
  1439. multiWorktime:0,
  1440. worktimeList:[],
  1441. degreeId: null,
  1442. }],
  1443. },
  1444. workRules: {
  1445. createDate: [{ required: true, message: "请选择工作日期", trigger: "change" }],
  1446. },
  1447. chooseParticipVisible: false,
  1448. logining: false,
  1449. isDisable: false,
  1450. timeType:[],
  1451. deptMembData: [
  1452. ],
  1453. //部门人员树状结构
  1454. data: [
  1455. {
  1456. id: -1,
  1457. label: '全部人员',
  1458. membCount:0
  1459. },
  1460. {
  1461. id: 0,
  1462. label: '未分配',
  1463. }
  1464. ],
  1465. allData:{},
  1466. batchShowData:{},
  1467. option: [],
  1468. depData: {
  1469. id: -1,
  1470. label: '全部人员',
  1471. },
  1472. defaultProps: {
  1473. children: 'children',
  1474. label: 'label'
  1475. },
  1476. isNew: false,
  1477. selected: false,
  1478. valuet: new Date(),
  1479. domObj: null,
  1480. participator:[],
  1481. chosenMembCount:0,
  1482. jsDay: 0,
  1483. jsTime: 0,
  1484. falsss: false,
  1485. weidu: [],
  1486. weiduList: [],
  1487. yonghuUser: [],
  1488. dateAr: [],
  1489. batchSubFillDialog: false,
  1490. isSubstiS: false,
  1491. diasZho: false,
  1492. zhoData: [],
  1493. zhoRqi: [],
  1494. btnZho: false,
  1495. zhoLoading: false,
  1496. changdu: 6,
  1497. tianxieDialogVisible: false,
  1498. scopess: {},
  1499. zhoBao: {
  1500. time: '',
  1501. workingTime: '',
  1502. progress: '',
  1503. con: '',
  1504. subProjectId: '',
  1505. stage: '',
  1506. subProjectList: [],
  1507. stages: [],
  1508. },
  1509. zhoBaoIdx: '',
  1510. zhoBaoName: '',
  1511. zhis: {},
  1512. dealList: [],
  1513. toViewDialogVisible: false,
  1514. toViewList: [],
  1515. toViewloading: true,
  1516. toViewForm: {
  1517. pageIndex: '1',
  1518. pageSize: '20',
  1519. total: 0,
  1520. },
  1521. toViewloadings: false,
  1522. tabPositionss: 'top',
  1523. monthTotal: 0,
  1524. monthTotalPage: 0,
  1525. monthTotalLages: 20,
  1526. monthWorkData: [],
  1527. monthNotWorkDate: [],
  1528. monthWorkDataS1: [],
  1529. monthnotTotal: 0,
  1530. monthnotTotalPage: 0,
  1531. monthnotTotalLages: 20,
  1532. monthNotWorkDateS1: [],
  1533. deptMembDataText: '',
  1534. isFlag: false,
  1535. isMore: false,
  1536. stateKey: '0',
  1537. expandDate: [],
  1538. notifySelList:[],
  1539. departmentList: [],
  1540. approvalProcessDialog: false,
  1541. approvalProcessData: [],
  1542. leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  1543. isWeekend: false,
  1544. canCancelInDialog: false,
  1545. approveinData: {},
  1546. approveinDialog: false,
  1547. reportCanDelete: false,
  1548. weeklyFilledTimeDialog: false,
  1549. weeklyFilledTimeList: [],
  1550. weeklyFilledTimeLoading: false,
  1551. workReportStateString: ['待审核','已通过','已驳回','待提交'],
  1552. weeklyFilledTimeCanDelete: false,
  1553. weeklyFilledTimeDate: null
  1554. };
  1555. },
  1556. watch: {
  1557. deptMembDataText(val) {
  1558. this.$refs.chooseMembTree.filter(val);
  1559. }
  1560. },
  1561. filters: {
  1562. // 过滤
  1563. amounts(value) {
  1564. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1565. return 0
  1566. }
  1567. var zhi = +value + 0
  1568. return zhi.toFixed(1)
  1569. },
  1570. // zhoData
  1571. zhoData(value) {
  1572. var dateArray = value.split("-");
  1573. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1574. return "周" + "日一二三四五六".charAt(date.getDay());
  1575. },
  1576. // 过滤数字
  1577. numbers(value) {
  1578. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1579. return 0
  1580. }
  1581. return value
  1582. },
  1583. },
  1584. methods: {
  1585. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  1586. this.weeklyFilledTimeDialog = true
  1587. this.weeklyFilledTimeLoading = true
  1588. this.weeklyFilledTimeDate = parameterDate
  1589. this.http.post('/report/getReportList',{
  1590. date: parameterDate,
  1591. userId: this.user.id
  1592. },res => {
  1593. this.weeklyFilledTimeLoading = false
  1594. if(res.code == 'ok'){
  1595. this.weeklyFilledTimeList = res.data[0].data
  1596. let candelete = true
  1597. for(let i in this.weeklyFilledTimeList){
  1598. if(this.weeklyFilledTimeList[i].state < 2){
  1599. candelete = false
  1600. }
  1601. }
  1602. this.weeklyFilledTimeCanDelete = candelete
  1603. }else {
  1604. this.$message({
  1605. message: res.msg,
  1606. type: 'error'
  1607. })
  1608. }
  1609. },err => {
  1610. this.weeklyFilledTimeLoading = false
  1611. this.$message({
  1612. message: err,
  1613. type: 'error'
  1614. })
  1615. })
  1616. },
  1617. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  1618. this.$confirm("确定要删除该日报吗?","提示", {
  1619. confirmButtonText: "确定",
  1620. cancelButtonText: "取消",
  1621. type: "warning"
  1622. })
  1623. .then(() => {
  1624. this.http.post('/report/delete',{
  1625. userId: this.user.id,
  1626. date: this.weeklyFilledTimeDate
  1627. },res => {
  1628. if (res.code == "ok") {
  1629. this.$message({
  1630. message: "删除成功",
  1631. type: "success"
  1632. });
  1633. this.getWeeklyWorkTime()
  1634. this.getReportList();
  1635. this.getDepartment();
  1636. this.weeklyFilledTimeDialog = false;
  1637. } else {
  1638. this.$message({
  1639. message: res.msg,
  1640. type: "error"
  1641. });
  1642. }
  1643. },error => {
  1644. this.$message({
  1645. message: error,
  1646. type: "error"
  1647. });
  1648. }
  1649. );
  1650. }).catch(() => {});
  1651. },
  1652. getApprovalProcess(item){
  1653. // console.log('this.date',this.choseDate);
  1654. this.http.post('/report-log/get',{
  1655. creatorId: item.id,
  1656. createDate: sessionStorage.msg
  1657. },res => {
  1658. if(res.code == 'ok'){
  1659. this.approvalProcessDialog = true
  1660. this.approvalProcessData = res.data
  1661. }else{
  1662. this.$message({
  1663. message: res.msg,
  1664. type: 'error'
  1665. })
  1666. }
  1667. },err => {
  1668. this.$message({
  1669. message: err,
  1670. type: 'error'
  1671. })
  1672. })
  1673. },
  1674. filterNode(value, data) {
  1675. if (!value) return true;
  1676. return data.label.indexOf(value) !== -1;
  1677. },
  1678. triggerCalculateOT(index) {
  1679. var str = this.workForm.domains[index].overtimeHours + ''
  1680. if(str.indexOf('.') != '-1') {
  1681. var s = str.split('.')[0]
  1682. var st = str.split('.')[1]
  1683. var sts = st.split('')
  1684. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  1685. }
  1686. },
  1687. searchScreen(e){
  1688. if(e){
  1689. this.monthNotWorkDateS1 = []
  1690. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1691. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  1692. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  1693. }
  1694. }
  1695. if (this.monthNotWorkDateS1.length > 50) {
  1696. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  1697. }else{
  1698. this.monthNotWorkDateS = this.monthNotWorkDateS1
  1699. }
  1700. // if (this.monthNotWorkDateS1.length > 0) {
  1701. // setTimeout(() => {
  1702. // this.tableListenernot()
  1703. // }, 1000);
  1704. // }
  1705. }else{
  1706. this.monthWorkDataS1 = []
  1707. for (let i = 0; i < this.monthWorkData.length; i++) {
  1708. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  1709. this.monthWorkDataS1.push(this.monthWorkData[i])
  1710. }
  1711. }
  1712. if (this.monthWorkDataS1.length > 50) {
  1713. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  1714. }else{
  1715. this.monthWorkDataS = this.monthWorkDataS1
  1716. }
  1717. // if (this.monthWorkDataS1.length > 0) {
  1718. // setTimeout(() => {
  1719. // this.tableListener()
  1720. // }, 1000);
  1721. // }
  1722. }
  1723. },
  1724. addUpload(data) {
  1725. // var zhi = data.fileName.split('.')[0]
  1726. // var sss = zhi + '.xlsx'
  1727. // return
  1728. var filePath = '/upload/' + data.serverName;
  1729. const a = document.createElement('a'); // 创建a标签
  1730. a.setAttribute('download', data.fileName);// download属性
  1731. a.setAttribute('href', filePath);// href链接
  1732. a.click(); //自执行点击事件
  1733. a.remove();
  1734. },
  1735. restrictNumber(targetId) {
  1736. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1737. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1738. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1739. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1740. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1741. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1742. inpu.value = parseFloat(inpu.value);
  1743. }
  1744. },
  1745. //获取项目下的任务分组
  1746. getTaskGroups(domain, index) {
  1747. domain.groupId=null;
  1748. this.http.post('/task-group/listMyJoinGroup',{
  1749. projectId: domain.projectId
  1750. },
  1751. res => {
  1752. if (res.code == "ok") {
  1753. this.workForm.domains[index].taskGroups = res.data;
  1754. this.$forceUpdate();
  1755. }
  1756. },
  1757. error => {
  1758. this.$message({
  1759. message: error,
  1760. type: "error"
  1761. });
  1762. }
  1763. );
  1764. },
  1765. //下载带企业微信考勤数据的工时统计模板
  1766. downloadCheckInExcel() {
  1767. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  1768. startDate: this.importWxParam.date[0],
  1769. endDate: this.importWxParam.date[1],
  1770. },
  1771. res => {
  1772. if (res.code == "ok") {
  1773. var filePath = res.data;
  1774. const a = document.createElement('a'); // 创建a标签
  1775. var data = filePath.split("/");
  1776. a.setAttribute('download', data[data.length-1]);// download属性
  1777. a.setAttribute('href', filePath);// href链接
  1778. a.click(); //自执行点击事件
  1779. a.remove();
  1780. } else {
  1781. this.$message({
  1782. message: res.msg,
  1783. type: "error"
  1784. });
  1785. }
  1786. },
  1787. error => {
  1788. this.checkinLoading = false;
  1789. this.$message({
  1790. message: error,
  1791. type: "error"
  1792. });
  1793. }
  1794. );
  1795. },
  1796. pre() {
  1797. if (this.active == 0) return;
  1798. this.active--;
  1799. },
  1800. next() {
  1801. this.active++;
  1802. },
  1803. triggerTotalTime(index) {
  1804. var item = this.checkinList[index];
  1805. var total = 0.0;
  1806. for (var i=0;i<this.projectColumns.length; i++) {
  1807. var key = this.projectColumns[i];
  1808. if (item[key] != null && item[key] != '') {
  1809. total += parseFloat(item[key]);
  1810. }
  1811. }
  1812. item.totalFillTime = total;
  1813. },
  1814. //提交批量代填的数据
  1815. submitBatchSubFillData() {
  1816. var data = JSON.stringify(this.checkinList);
  1817. this.http.post('/user-corpwx-time/submitProjectTime',{
  1818. json: data,
  1819. projectColumns: JSON.stringify(this.projectColumns)
  1820. },
  1821. res => {
  1822. if (res.code == "ok") {
  1823. this.$message({message:'提交成功', type:'success'});
  1824. this.importWxDialog = false;
  1825. }
  1826. },
  1827. error => {
  1828. this.checkinLoading = false;
  1829. this.$message({
  1830. message: error,
  1831. type: "error"
  1832. });
  1833. }
  1834. );
  1835. },
  1836. loadCheckInData() {
  1837. if (this.importWxParam.date == null) {
  1838. this.checkinList = [];
  1839. return;
  1840. }
  1841. this.checkinLoading = true;
  1842. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  1843. startDate: this.importWxParam.date[0],
  1844. endDate: this.importWxParam.date[1],
  1845. },
  1846. res => {
  1847. if (res.code == "ok") {
  1848. this.checkinLoading = false;
  1849. this.checkinList = res.data.list;
  1850. this.projectColumns = res.data.projects;
  1851. // 自定义表格会导致表格错乱,需重新计算表格
  1852. this.$nextTick(()=>{
  1853. this.$refs.tab.doLayout()
  1854. })
  1855. }
  1856. },
  1857. error => {
  1858. this.checkinLoading = false;
  1859. this.$message({
  1860. message: error,
  1861. type: "error"
  1862. });
  1863. }
  1864. );
  1865. },
  1866. batchImportWxData(item) {
  1867. //首先判断文件类型
  1868. let str = item.file.name.split(".");
  1869. let format = str[str.length - 1];
  1870. if (format != "xls" && format != "xlsx") {
  1871. this.$message({
  1872. message: "请选择.xls或.xlsx文件",
  1873. type: "error"
  1874. });
  1875. } else {
  1876. this.importingData = true;
  1877. let formData = new FormData();
  1878. formData.append("file", item.file);
  1879. formData.append("companyId", this.user.companyId);
  1880. formData.append("withCheckIn", 1);
  1881. this.http.uploadFile('/report/importData', formData,
  1882. res => {
  1883. this.$refs.upload.clearFiles();
  1884. this.showImportResult = true;
  1885. this.importingData = false;
  1886. if (res.code == "ok") {
  1887. //换成弹出框,以免有人等了半天回来啥也没看到
  1888. this.importResultMsg = "导入成功:成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");
  1889. this.getReportList();
  1890. this.importWxDialog = false;
  1891. } else {
  1892. this.importResultMsg = "导入失败:"+res.msg;
  1893. }
  1894. },
  1895. error => {
  1896. this.$refs.upload.clearFiles();
  1897. this.listLoading = false;
  1898. this.$message({
  1899. message: error,
  1900. type: "error"
  1901. });
  1902. });
  1903. }
  1904. },
  1905. batchImportData(item) {
  1906. //首先判断文件类型
  1907. let str = item.file.name.split(".");
  1908. let format = str[str.length - 1];
  1909. if (format != "xls" && format != "xlsx") {
  1910. this.$message({
  1911. message: "请选择.xls或.xlsx文件",
  1912. type: "error"
  1913. });
  1914. } else {
  1915. this.importingData = true;
  1916. let formData = new FormData();
  1917. formData.append("file", item.file);
  1918. formData.append("companyId", this.user.companyId);
  1919. this.http.uploadFile('/report/importData', formData,
  1920. res => {
  1921. this.$refs.upload.clearFiles();
  1922. this.importingData = false;
  1923. this.showImportResult = true;
  1924. if (res.code == "ok") {
  1925. //换成弹出框,以免有人等了半天回来啥也没看到
  1926. this.importResultMsg = "成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");;
  1927. this.getReportList();
  1928. this.importWXDialog = false;
  1929. } else {
  1930. this.importResultMsg = "导入失败:"+res.msg;
  1931. }
  1932. },
  1933. error => {
  1934. this.$refs.upload.clearFiles();
  1935. this.importingData = false;
  1936. this.$message({
  1937. message: error,
  1938. type: "error"
  1939. });
  1940. });
  1941. }
  1942. },
  1943. userssHu() {
  1944. this.http.post('/time-type/getCompanyTimeSetting',{
  1945. companyId: this.user.companyId
  1946. },
  1947. res => {
  1948. if (res.code == "ok") {
  1949. this.yonghuUser = res.data
  1950. }
  1951. },
  1952. error => {
  1953. this.$message({
  1954. message: error,
  1955. type: "error"
  1956. });
  1957. }
  1958. );
  1959. },
  1960. iptBlur(i) {
  1961. if(this.isBatch == 0) {
  1962. return
  1963. }
  1964. this.http.post('/report/getWorkDays',{
  1965. startDate: this.workForm.createDate[0],
  1966. endDate: this.workForm.createDate[1]
  1967. },
  1968. res => {
  1969. if (res.code == "ok") {
  1970. this.jsDay = res.data
  1971. this.chuji(i)
  1972. } else {
  1973. this.$message({
  1974. message: res.msg,
  1975. type: "error"
  1976. });
  1977. this.workForm.createDate = [];
  1978. }
  1979. },
  1980. error => {
  1981. this.$message({
  1982. message: error,
  1983. type: "error"
  1984. });
  1985. }
  1986. );
  1987. var sl = this.workForm.domains
  1988. this.chuji(i)
  1989. },
  1990. chuji(i) {
  1991. if(i == 0) {
  1992. this.seleChn(1)
  1993. } else if(i == 1) {
  1994. this.seleChn(0)
  1995. } else if(i == 2) {
  1996. if(this.workForm.domains[0].multiWorktime > 0) {
  1997. this.iptChangs()
  1998. } else {
  1999. this.iptChang()
  2000. }
  2001. } else if(i == 3) {
  2002. this.seleChn(0)
  2003. }
  2004. },
  2005. seleChn(e,domain) {
  2006. if(e == 1) {
  2007. for(var i in this.workForm.domains) {
  2008. if(this.workForm.domains[i].timeType == 0) {
  2009. this.workForm.domains[i].workingTime = 8
  2010. } else {
  2011. this.workForm.domains[i].workingTime = 4
  2012. }
  2013. }
  2014. }
  2015. var quanbu = 0
  2016. var spl = this.workForm.domains
  2017. var zhi = ''
  2018. for(var i in spl) {
  2019. var sp = +spl[i].workingTime + 0
  2020. zhi = this.jsDay * sp
  2021. quanbu = +quanbu + zhi
  2022. }
  2023. this.jsTime = quanbu
  2024. let worktime = this.jsTime
  2025. // 自动计算加班时长
  2026. if(this.isBatch != 0){
  2027. worktime = this.jsTime / this.jsDay
  2028. }
  2029. if(this.user.timeType.fillOvertime && domain){
  2030. let isover = false
  2031. let alltime = 0
  2032. let allover = 0 //此处alltime同上面的worktime
  2033. for(let d in spl){
  2034. if(spl[d].isOvertime){
  2035. isover = true
  2036. allover += spl[d].overtimeHours*1
  2037. }
  2038. alltime += spl[d].workingTime*1
  2039. }
  2040. if(domain.overtimeHours){
  2041. allover = allover - domain.overtimeHours
  2042. }
  2043. if(worktime*1 > this.user.timeType.allday){
  2044. if(isover){
  2045. if(alltime > (allover + this.user.timeType.allday)){
  2046. this.$set(domain,'isOvertime',true)
  2047. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  2048. }else{
  2049. this.$set(domain,'isOvertime',false)
  2050. this.$set(domain,'overtimeHours',null)
  2051. if(alltime < (allover + this.user.timeType.allday)){
  2052. let overtime = allover + this.user.timeType.allday - alltime
  2053. for(let pi in spl){
  2054. if(spl[pi].overtimeHours){
  2055. if((overtime - spl[pi].overtimeHours*1) > 0){
  2056. overtime = overtime - spl[pi].overtimeHours*1
  2057. this.$set(spl[pi],'isOvertime',false)
  2058. this.$set(spl[pi],'overtimeHours',null)
  2059. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  2060. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  2061. break
  2062. }else{
  2063. this.$set(spl[pi],'isOvertime',false)
  2064. this.$set(spl[pi],'overtimeHours',null)
  2065. break
  2066. }
  2067. }
  2068. }
  2069. }
  2070. }
  2071. }else{
  2072. this.$set(domain,'isOvertime',true)
  2073. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  2074. }
  2075. }else{
  2076. for(let di in spl){
  2077. this.$set(spl[di],'isOvertime',false)
  2078. this.$set(spl[di],'overtimeHours',null)
  2079. }
  2080. }
  2081. }
  2082. },
  2083. iptChang() {
  2084. var sl = this.workForm.domains
  2085. var quanbu = 0
  2086. var zhi = ''
  2087. for(var i in sl) {
  2088. if(sl[i].startTime && sl[i].endTime) {
  2089. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  2090. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  2091. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2092. var leave1=date3%(24*3600*1000)
  2093. var hours=Math.floor(leave1/(3600*1000))
  2094. var leave2=leave1%(3600*1000)
  2095. var minutes=Math.floor(leave2/(60*1000))
  2096. var shi = hours+'.'+ minutes
  2097. var sll = +shi + 0
  2098. zhi = this.jsDay * sll
  2099. quanbu = +quanbu + zhi
  2100. }
  2101. }
  2102. this.jsTime = quanbu
  2103. },
  2104. iptChangs() {
  2105. var sl = this.workForm.domains
  2106. var quanbu = 0
  2107. var zhi = ''
  2108. for(var i in sl) {
  2109. for(var j in sl[i].worktimeList){
  2110. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  2111. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  2112. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  2113. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2114. var leave1=date3%(24*3600*1000)
  2115. var hours=Math.floor(leave1/(3600*1000))
  2116. var leave2=leave1%(3600*1000)
  2117. var minutes=Math.floor(leave2/(60*1000))
  2118. var shi = hours+'.'+ minutes
  2119. var sll = +shi + 0
  2120. zhi = this.jsDay * sll
  2121. quanbu = +quanbu + zhi
  2122. }
  2123. }
  2124. }
  2125. this.jsTime = quanbu
  2126. },
  2127. removeTimeItem(item, index) {
  2128. item.worktimeList.splice(index, 1);
  2129. this.iptChangs()
  2130. },
  2131. //添加工时
  2132. addNewWorktime(index, item) {
  2133. if(item.worktimeList == null ) {
  2134. item.worktimeList = []
  2135. }
  2136. item.worktimeList.push({});
  2137. },
  2138. //复制项目
  2139. copyProject(index) {
  2140. var leftProgress = 10;
  2141. if (this.reportTimeType.type == 3) {
  2142. //计算已经待分配工时比例
  2143. let array = this.workForm.domains;
  2144. let totalProgress = 0;
  2145. for (var i=0;i<array.length; i++) {
  2146. totalProgress += array[i].progress;
  2147. }
  2148. if (totalProgress < 100) {
  2149. leftProgress = 100 - totalProgress;
  2150. }
  2151. }
  2152. var newIndex = index+1;
  2153. var itemDomain = {
  2154. projectId: this.workForm.domains[index].projectId,
  2155. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2156. content: "",
  2157. progress:leftProgress,
  2158. state:2,//2-表示待提交
  2159. };
  2160. this.workForm.domains.splice(newIndex, 0,itemDomain);
  2161. if (this.reportTimeType.type == 0) {
  2162. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2163. var length = this.workForm.domains.length;
  2164. if (length == 2) {
  2165. this.showAddMore = false;
  2166. }
  2167. }
  2168. this.selectProject(itemDomain, newIndex);
  2169. },
  2170. showWorkTime(){
  2171. this.monthWorkTimeDialog = true;
  2172. this.searchKeyword = ''
  2173. this.WorktimeDatepickValue = this.istoMonth()
  2174. if(this.WorktimeDatepickValue.length == 0){
  2175. let newdate = new Date();
  2176. let nowdate = newdate.toLocaleDateString();
  2177. let getauto = this.getAutoWeekDate(nowdate)
  2178. let nowwd = [getauto[0],getauto[6]]
  2179. this.WorktimeDatepickValue = nowwd
  2180. }
  2181. this.showMonthWorkTime()
  2182. },
  2183. handleClick(t,e){
  2184. if (t.name == "first") {
  2185. this.showMonthWorkTime()
  2186. }else{
  2187. this.showMonthNotWorkTime()
  2188. }
  2189. },
  2190. //导出员工每日填报工时数
  2191. exportMembWorkHours() {
  2192. this.http.post(
  2193. "/report/exportUserDailyWorkTime",
  2194. {
  2195. // month: this.date,
  2196. startDate: this.WorktimeDatepickValue[0],
  2197. endDate: this.WorktimeDatepickValue[1],
  2198. },
  2199. (res) => {
  2200. if (res.code == "ok") {
  2201. let url = res.data;
  2202. this.downloadByA("人员每日工时统计.xls", url);
  2203. }
  2204. },
  2205. (error) => {
  2206. this.$message({
  2207. message: error,
  2208. type: "error",
  2209. });
  2210. }
  2211. );
  2212. },
  2213. exportMembNotWorkHours() {
  2214. this.http.post(
  2215. "/report/exportNoReportUserList",
  2216. {
  2217. // month: this.date,
  2218. startDate: this.WorktimeDatepickValue[0],
  2219. endDate: this.WorktimeDatepickValue[1],
  2220. },
  2221. (res) => {
  2222. if (res.code == "ok") {
  2223. let url = res.data;
  2224. this.downloadByA("人员每日工时统计.xls", url);
  2225. }
  2226. },
  2227. (error) => {
  2228. this.$message({
  2229. message: error,
  2230. type: "error",
  2231. });
  2232. }
  2233. );
  2234. },
  2235. downloadByA(name, url) {
  2236. const a = document.createElement("a"); // 创建a标签
  2237. a.setAttribute("download", name); // download属性
  2238. a.setAttribute("href", url); // href链接
  2239. a.click(); // 自执行点击事件
  2240. a.remove();
  2241. },
  2242. // 是否本月判断
  2243. istoMonth(){
  2244. let todate = new Date()
  2245. let tomonth = todate.getMonth() + 1
  2246. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  2247. if(this.date == adate){
  2248. return []
  2249. }else{
  2250. let sedate = new Date(this.date)
  2251. let semonth = sedate.getMonth() + 1
  2252. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  2253. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  2254. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  2255. return [sedates1, sedates2]
  2256. }
  2257. },
  2258. showMonthWorkTime() {
  2259. this.monthTotalPage = 0,
  2260. this.tbload = true
  2261. this.http.post(
  2262. "/report/getUserDailyWorkTime",
  2263. // "/report/getNoReportUserList",
  2264. {
  2265. // month: this.date,
  2266. startDate: this.WorktimeDatepickValue[0],
  2267. endDate: this.WorktimeDatepickValue[1],
  2268. },
  2269. (res) => {
  2270. if (res.code == "ok") {
  2271. this.tbload = false;
  2272. this.pickDateArray = res.data.days;
  2273. // console.log('dataarray',res.data.days);
  2274. this.monthWorkData = res.data.list;
  2275. // this.monthWorkDataS = this.monthWorkData
  2276. // this.monthWorkDataS1 = res.data.list
  2277. this.monthTotal = res.data.list.length
  2278. if (this.monthWorkData.length > 50) {
  2279. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  2280. }else{
  2281. this.monthWorkDataS = this.monthWorkData
  2282. }
  2283. this.searchScreen(0)
  2284. // this.monthWorkDataS = infoList
  2285. // 判断
  2286. // if (this.monthWorkDataS1.length > 0) {
  2287. // setTimeout(() => {
  2288. // this.tableListener()
  2289. // }, 1000);
  2290. // }
  2291. this.$nextTick(function(){
  2292. this.$refs.hasworkTbl.doLayout();
  2293. });
  2294. // this.$forceUpdate()
  2295. }
  2296. },
  2297. (error) => {
  2298. this.tbload = false
  2299. this.$message({
  2300. message: error,
  2301. type: "error",
  2302. });
  2303. }
  2304. );
  2305. },
  2306. // tableListener(){
  2307. // let that = this;
  2308. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2309. // // 添加scroll监听事件
  2310. // dom.addEventListener("scroll", function () {
  2311. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2312. // if (scrollDistance < 2) {
  2313. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2314. // that.monthTotalPage++; //当前页数自增
  2315. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2316. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2317. // var infoList = arrList.splice(
  2318. // that.monthTotalPage * that.monthTotalLages,
  2319. // that.monthTotalLages
  2320. // );
  2321. // // 数据添加
  2322. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2323. // }
  2324. // }
  2325. // })
  2326. // },
  2327. showMonthNotWorkTime() {
  2328. this.monthTotalPage = 0,
  2329. this.tbload = true
  2330. this.http.post(
  2331. "/report/getNoReportUserList",
  2332. {
  2333. startDate: this.WorktimeDatepickValue[0],
  2334. endDate: this.WorktimeDatepickValue[1],
  2335. },
  2336. (res) => {
  2337. if (res.code == "ok") {
  2338. this.tbload = false
  2339. this.monthNotWorkDate = res.data;
  2340. // this.monthNotWorkDateS1 = res.data
  2341. this.monthnotTotal = res.data.length
  2342. // 2222111
  2343. if (this.monthNotWorkDate.length > 50) {
  2344. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2345. } else {
  2346. this.monthNotWorkDateS = this.monthNotWorkDate
  2347. }
  2348. this.searchScreen(1)
  2349. // 判断
  2350. // if (this.monthnotworkDateS1.length > 0) {
  2351. // setTimeout(() => {
  2352. // this.tableListenernot()
  2353. // }, 1000);
  2354. // }
  2355. this.$nextTick(function(){
  2356. this.$refs.hasworkTbl2.doLayout();
  2357. });
  2358. }
  2359. },
  2360. (error) => {
  2361. this.tbload = false
  2362. this.$message({
  2363. message: error,
  2364. type: "error",
  2365. });
  2366. }
  2367. );
  2368. },
  2369. // tableListenernot(){
  2370. // let that = this;
  2371. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2372. // dom.addEventListener("scroll", function () {
  2373. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2374. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2375. // if (scrollDistance2 < 2) {
  2376. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2377. // that.monthnotTotalPage++; //当前页数自增
  2378. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2379. // var infoList = arrList.splice(
  2380. // that.monthnotTotalPage * that.monthnotTotalLages,
  2381. // that.monthnotTotalLages
  2382. // );
  2383. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2384. // }
  2385. // }
  2386. // })
  2387. // },
  2388. listScroll(){
  2389. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2390. this.isMore = true
  2391. setTimeout(()=>{
  2392. this.isMore = false
  2393. },1000)
  2394. }else {
  2395. this.isFlag = true
  2396. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2397. this.monthWorkDataS = datalist
  2398. setTimeout(()=>{
  2399. this.isFlag = false
  2400. },300)
  2401. }
  2402. },
  2403. notListScroll(){
  2404. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2405. this.isMore = true
  2406. setTimeout(()=>{
  2407. this.isMore = false
  2408. },1000)
  2409. }else {
  2410. this.isFlag = true
  2411. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2412. this.monthNotWorkDateS = datalist
  2413. // console.log('length',this.monthNotWorkDateS.length)
  2414. setTimeout(()=>{
  2415. this.isFlag = false
  2416. },300)
  2417. }
  2418. },
  2419. // 获取默认这zhou日期参数 222
  2420. getLastWeek(e){
  2421. let newdate = new Date()
  2422. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2423. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2424. if(e){
  2425. this.WorktimeDatepickValue = lastwd
  2426. this.showMonthWorkTime()
  2427. }else{
  2428. this.WorktimeDatepickValue = lastwd
  2429. this.showMonthNotWorkTime()
  2430. }
  2431. },
  2432. getThisWeek(e){
  2433. let newdate = new Date();
  2434. let nowdate = newdate.toLocaleDateString();
  2435. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2436. if(e){
  2437. this.WorktimeDatepickValue = nowwd
  2438. this.showMonthWorkTime()
  2439. }else{
  2440. this.WorktimeDatepickValue = nowwd
  2441. this.showMonthNotWorkTime()
  2442. }
  2443. },
  2444. getDoubleLastWeek(e){
  2445. let newdate = new Date()
  2446. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2447. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2448. if(e){
  2449. this.WorktimeDatepickValue = nextwd
  2450. this.showMonthWorkTime()
  2451. }else{
  2452. this.WorktimeDatepickValue = nextwd
  2453. this.showMonthNotWorkTime()
  2454. }
  2455. },
  2456. alreadyAllDate(stime,etime){
  2457. let diffdate = new Array();
  2458. let i=0;
  2459. while(stime<=etime){
  2460. let dateArray = stime.split("-");
  2461. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2462. let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2463. let timedate = (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]) + "日"
  2464. 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])
  2465. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2466. let stime_ts = new Date(stime).getTime();
  2467. let next_date = stime_ts + (24*60*60*1000);
  2468. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2469. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2470. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2471. stime = next_dates_y+next_dates_m+next_dates_d;
  2472. i++;
  2473. }
  2474. return diffdate
  2475. },
  2476. getAutoWeekDate(e) {
  2477. let dateString = e;
  2478. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2479. if (dateString.match(dateStringReg)) {
  2480. let presentDate = new Date(dateString),
  2481. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2482. return Array.from(new Array(7), function (val, index) {
  2483. let formatDate = new Date(
  2484. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2485. );
  2486. return (
  2487. formatDate.getFullYear() +
  2488. "-" +
  2489. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2490. "-" +
  2491. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2492. );
  2493. });
  2494. } else {
  2495. throw new Error(
  2496. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2497. );
  2498. }
  2499. },
  2500. onProgressChange() {
  2501. this.$forceUpdate();
  2502. },
  2503. showChooseMembTree() {
  2504. this.chosenMembCount = this.participator.length;
  2505. this.chooseParticipVisible = true;
  2506. },
  2507. onTreeItemChange() {
  2508. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2509. var list = chosenList.filter(item=>item.isUser == 1);
  2510. this.chosenMembCount = list.length;
  2511. },
  2512. findUserInTree() {
  2513. if (this.filterName == '') {
  2514. this.deptMembData = this.allMembData;
  2515. } else {
  2516. var list = this.findRecursively(this.filterName, this.allMembData);
  2517. this.deptMembData = list;
  2518. }
  2519. },
  2520. findRecursively(username, list) {
  2521. var filterList = [];
  2522. for (var i=0;i<list.length; i++) {
  2523. if (list[i].isUser == 1) {
  2524. if (list[i].label.indexOf(username) >= 0) {
  2525. //匹配上了
  2526. filterList.push(list[i]);
  2527. }
  2528. } else if (list[i].children != null && list[i].children.length > 0) {
  2529. var subList = this.findRecursively(username, list[i].children);
  2530. if (subList.length > 0) {
  2531. subList.forEach(s=>filterList.push(s));
  2532. }
  2533. }
  2534. }
  2535. return filterList;
  2536. },
  2537. //确定选择参与人
  2538. chooseParticip() {
  2539. this.chooseParticipVisible = false;
  2540. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2541. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2542. this.workForm.userNames = '';
  2543. this.workForm.userId = [];
  2544. this.participator = [];
  2545. for (var i=0;i<this.chosenMembList.length; i++) {
  2546. this.workForm.userId.push(this.chosenMembList[i].id);
  2547. this.workForm.userNames += this.chosenMembList[i].label+',';
  2548. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2549. this.participator.push(item);
  2550. }
  2551. if (this.workForm.userNames.length > 0) {
  2552. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2553. }
  2554. },
  2555. notifySel(sel){
  2556. // console.log(sel);
  2557. this.notifySelList = sel
  2558. },
  2559. //微信通知人员填写
  2560. Notify(code) {
  2561. if (this.notifySelList.length == 0) return;
  2562. var ids = '';
  2563. this.notifySelList.forEach(f=>{
  2564. ids += f.id+',';
  2565. })
  2566. this.http.post('/user/pushFillReport',{
  2567. ids: ids, date: this.curDate,
  2568. code: code
  2569. },
  2570. res => {
  2571. if (res.code == "ok") {
  2572. this.$message({
  2573. message: '已发送成功',
  2574. type: "success"
  2575. });
  2576. }
  2577. },
  2578. error => {
  2579. this.$message({
  2580. message: error,
  2581. type: "error"
  2582. });
  2583. }
  2584. );
  2585. },
  2586. //导出人员列表
  2587. exportMemb() {
  2588. if (this.fillMembList.length == 0) return;
  2589. var ids = '';
  2590. this.fillMembList.forEach(f=>{
  2591. ids += f.id+',';
  2592. })
  2593. this.http.post('/user/exportMembList',{
  2594. ids: ids,isFill: this.isFill, date: this.curDate
  2595. },
  2596. res => {
  2597. if (res.code == "ok") {
  2598. var aTag = document.createElement('a');
  2599. aTag.download = this.curDate+(this.isFill?"已填":"未填")+"人员列表.xls";
  2600. aTag.href = res.data;
  2601. aTag.click();
  2602. }
  2603. },
  2604. error => {
  2605. this.$message({
  2606. message: error,
  2607. type: "error"
  2608. });
  2609. }
  2610. );
  2611. },
  2612. showMembList(fill) {
  2613. this.membListVisible = true;
  2614. if (fill == 0) {
  2615. this.fillMembList = this.unFillList;
  2616. this.isFill = false;
  2617. let leaveList = []
  2618. let unleaveList = []
  2619. for(let i in this.fillMembList){
  2620. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  2621. leaveList.push(this.fillMembList[i])
  2622. }else{
  2623. unleaveList.push(this.fillMembList[i])
  2624. }
  2625. }
  2626. this.fillMembList = unleaveList
  2627. this.fillMembList_leave = leaveList
  2628. } else if(fill == 1){
  2629. this.fillMembList = this.fillList.filter(item => item.state != 3);
  2630. this.isFill = true;
  2631. }else{
  2632. this.fillMembList = this.fillList.filter(item => item.state == 3);
  2633. this.isFill = true;
  2634. }
  2635. },
  2636. //获取自己填写的日报状态
  2637. getReportFillStatus() {
  2638. this.http.post('/report/getReportFillStatus',{
  2639. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2640. },
  2641. res => {
  2642. if (res.code == "ok") {
  2643. this.fillStatusList = res.data;
  2644. this.allDate.forEach(d=>{
  2645. var fillInfo = null;
  2646. d.state = null;
  2647. this.fillStatusList.forEach(s=>{
  2648. var d1 = s.createDate.split('-')[2];
  2649. var d2 = d.date.split('月')[1].split('日')[0];
  2650. if (d1.indexOf('0') == 0) {
  2651. d1 = d1.substring(1,d1.length);
  2652. }
  2653. if (d1 == d2) {
  2654. d.state = s.state;
  2655. }
  2656. })
  2657. })
  2658. this.$forceUpdate();
  2659. }
  2660. },
  2661. error => {
  2662. this.$message({
  2663. message: error,
  2664. type: "error"
  2665. });
  2666. }
  2667. );
  2668. },
  2669. scrollFunction () {
  2670. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2671. if (this.domObj.attachEvent) { // IE
  2672. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2673. } else if (this.domObj.addEventListener) {
  2674. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2675. }
  2676. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2677. },
  2678. mouseScroll(event) { // google 浏览器下
  2679. let detail = event.wheelDelta || event.detail
  2680. let moveForwardStep = -1
  2681. let moveBackStep = 1
  2682. let step = 0
  2683. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2684. event.preventDefault() // 阻止浏览器默认事件
  2685. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2686. },
  2687. // //左右滚动
  2688. // wheel(e){
  2689. // var a = document.getElementById("dateScroll");
  2690. // var scroll_width = 80; //滚动一下的距离
  2691. // var e = e || window.event, v;
  2692. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2693. // if(v>3||-v>3) v=-v;
  2694. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2695. // e.preventDefault(); //阻止浏览器的默认滚动
  2696. // },
  2697. showExportDialog() {
  2698. this.exportDialog = true;
  2699. },
  2700. showExportTimeDialog() {
  2701. this.exportTimeDialog = true;
  2702. },
  2703. changeAllTime() {
  2704. //总时长发生改变,自动按比例计算
  2705. this.workForm.domains.forEach(d=>{
  2706. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2707. });
  2708. },
  2709. // 是否加班的单机事件
  2710. check() {
  2711. this.selected = !this.selected
  2712. this.isNew = this.selected
  2713. },
  2714. updateSubProject() {
  2715. this.$forceUpdate();
  2716. },
  2717. //项目选中了, 加载子项目
  2718. selectProject(domain, index) {
  2719. if(!domain.projectId){
  2720. return;
  2721. }
  2722. // console.log('projectId===',domain.projectId);
  2723. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  2724. this.http.post('/sub-project/list',{
  2725. projectId: domain.projectId
  2726. },
  2727. res => {
  2728. //清空之前选中的子项目
  2729. // this.workForm.domains[index].subProjectId = 0;
  2730. if (res.code == "ok") {
  2731. this.workForm.domains[index].subProjectList = res.data;
  2732. this.workForm.domains[index].subProjectId = null;
  2733. this.$forceUpdate();
  2734. }
  2735. },
  2736. error => {
  2737. this.$message({
  2738. message: error,
  2739. type: "error"
  2740. });
  2741. }
  2742. );
  2743. //项目相关的近期任务
  2744. if (this.user.company.packageProject == 1) {
  2745. this.http.post('/task/getRecentTask',{
  2746. projectId: domain.projectId,
  2747. isSubstitude:this.isSubstitude?1:0
  2748. },
  2749. res => {
  2750. if (res.code == "ok") {
  2751. this.workForm.domains[index].allTaskList = res.data;
  2752. this.workForm.domains[index].taskList = res.data;
  2753. this.$forceUpdate();
  2754. }
  2755. },
  2756. error => {
  2757. this.$message({
  2758. message: error,
  2759. type: "error"
  2760. });
  2761. }
  2762. );
  2763. }
  2764. //获取项目相关专业
  2765. if (this.user.company.packageEngineering == 1) {
  2766. this.getProjectProfessions(domain, index);
  2767. }
  2768. // 获取项目相关的维度
  2769. // domain.degreeId = null
  2770. this.$set(domain,'degreeId',null)
  2771. this.dimension(domain, index);
  2772. //获取项目下的任务分组
  2773. this.getTaskGroups(domain, index);
  2774. //获取项目审核人
  2775. if (this.user.timeType.reportAuditType == 0) {
  2776. this.getProjectAuditorList(domain, index);
  2777. } else {
  2778. //按分组的负责人来审核
  2779. domain.projectAuditorId = null;
  2780. domain.projectAuditorName = null;
  2781. domain.auditUserList = null;
  2782. }
  2783. },
  2784. //获取项目审核人
  2785. getProjectAuditorList(domainItem, index) {
  2786. if(domainItem.projectId == '') {
  2787. return
  2788. }
  2789. domainItem.projectAuditorId = null;
  2790. domainItem.projectAuditorName = null;
  2791. this.http.post('/project-auditor/getList',{
  2792. projectId: domainItem.projectId,
  2793. },
  2794. res => {
  2795. if (res.code == "ok") {
  2796. domainItem.auditUserList = res.data;
  2797. if (res.data.length==0) {
  2798. this.$message({
  2799. message: '日报审核人尚未设置,请联系该项目管理人员',
  2800. type: "error"
  2801. });
  2802. } else if (res.data.length==1) {
  2803. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  2804. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  2805. }
  2806. this.$forceUpdate();
  2807. }
  2808. },
  2809. error => {
  2810. this.$message({
  2811. message: error,
  2812. type: "error"
  2813. });
  2814. }
  2815. );
  2816. },
  2817. // 获取维度数据
  2818. dimension(domain, index) {
  2819. if(domain.projectId == '') {
  2820. return
  2821. }
  2822. this.http.post('/project/getDegreeList',{
  2823. projectId: domain.projectId,
  2824. },
  2825. res => {
  2826. if (res.code == "ok") {
  2827. // console.log("维度数据",res.data);
  2828. this.workForm.domains[index].wuduList = res.data
  2829. // this.workForm = this.workForm
  2830. this.$forceUpdate()
  2831. }
  2832. },
  2833. error => {
  2834. this.$message({
  2835. message: error,
  2836. type: "error"
  2837. });
  2838. }
  2839. );
  2840. },
  2841. //切换任务阶段
  2842. changeStages(domain, index) {
  2843. if (domain.stage == null || domain.stage == '') {
  2844. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  2845. } else {
  2846. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  2847. }
  2848. this.$forceUpdate();
  2849. },
  2850. getGroupStages(domain, index, keepStage) {
  2851. // console.log(domain);
  2852. if(!domain.groupId){
  2853. domain.projectAuditorId = ''
  2854. domain.stages = []
  2855. if(this.user.timeType.reportAuditType >= 1){
  2856. domain.auditUserList = []
  2857. }
  2858. this.$forceUpdate();
  2859. return
  2860. }
  2861. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  2862. res => {
  2863. if (res.code == "ok") {
  2864. if (!keepStage) {
  2865. domain.stage = '';
  2866. }
  2867. domain.stages = res.data;
  2868. this.$forceUpdate();
  2869. }
  2870. },
  2871. error => {
  2872. this.$message({
  2873. message: error,
  2874. type: "error"
  2875. });
  2876. });
  2877. //检查当前的项目是否需要获取分组的负责人
  2878. if (this.user.timeType.reportAuditType >= 1) {
  2879. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  2880. res => {
  2881. if (res.code == "ok") {
  2882. domain.getProjectAuditorList = res.data;
  2883. domain.auditUserList = res.data;
  2884. if (res.data.length==1) {
  2885. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  2886. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  2887. } else if (res.data.length==0) {
  2888. domain.projectAuditorId = null;
  2889. domain.projectAuditorName = null;
  2890. }
  2891. this.$forceUpdate();
  2892. }
  2893. },
  2894. error => {
  2895. this.$message({
  2896. message: error,
  2897. type: "error"
  2898. });
  2899. });
  2900. }
  2901. },
  2902. getProjectProfessions(domain, index) {
  2903. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  2904. res => {
  2905. if (res.code == "ok") {
  2906. this.workForm.domains[index].professionProgress = res.data;
  2907. this.$forceUpdate();
  2908. }
  2909. },
  2910. error => {
  2911. this.$message({
  2912. message: error,
  2913. type: "error"
  2914. });
  2915. });
  2916. },
  2917. //删除自己的日报
  2918. deleteReport() {
  2919. this.$confirm("确定要删除该日报吗?","提示", {
  2920. confirmButtonText: "确定",
  2921. cancelButtonText: "取消",
  2922. type: "warning"
  2923. })
  2924. .then(() => {
  2925. this.listLoading = true;
  2926. this.http.post('/report/delete',{
  2927. userId: this.user.id,
  2928. date: this.workForm.createDate
  2929. },
  2930. res => {
  2931. this.listLoading = false;
  2932. if (res.code == "ok") {
  2933. this.$message({
  2934. message: "删除成功",
  2935. type: "success"
  2936. });
  2937. this.getReportList();
  2938. this.getDepartment();
  2939. this.dialogVisible = false;
  2940. } else {
  2941. this.$message({
  2942. message: res.msg,
  2943. type: "error"
  2944. });
  2945. }
  2946. },
  2947. error => {
  2948. this.listLoading = false;
  2949. this.$message({
  2950. message: error,
  2951. type: "error"
  2952. });
  2953. }
  2954. );
  2955. })
  2956. .catch(() => {});
  2957. },
  2958. // 管理员删除日报
  2959. guanli(item) {
  2960. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2961. let param = {date: this.date + day, userId: item.id};
  2962. this.$confirm("确定要删除该日报吗?","提示", {
  2963. confirmButtonText: "确定",
  2964. cancelButtonText: "取消",
  2965. type: "warning"
  2966. })
  2967. .then(() => {
  2968. this.listLoading = true;
  2969. this.http.post('/report/delete',param,
  2970. res => {
  2971. this.listLoading = false;
  2972. if (res.code == "ok") {
  2973. this.$message({
  2974. message: "删除成功",
  2975. type: "success"
  2976. });
  2977. this.getReportList();
  2978. this.getDepartment();
  2979. this.dialogVisible = false;
  2980. } else {
  2981. this.$message({
  2982. message: res.msg,
  2983. type: "error"
  2984. });
  2985. }
  2986. },
  2987. error => {
  2988. this.listLoading = false;
  2989. this.$message({
  2990. message: error,
  2991. type: "error"
  2992. });
  2993. }
  2994. );
  2995. })
  2996. .catch(() => {});
  2997. },
  2998. //提交批量审核数据
  2999. submitBatchApprove() {
  3000. var data = this.$refs.approveTree.getCheckedNodes();
  3001. var ids = '';
  3002. if (data.length == 0) {
  3003. this.$message({
  3004. message: '请选择要审核的人员',
  3005. type: "error"
  3006. });
  3007. return;
  3008. }
  3009. for (var i=0;i<data.length; i++) {
  3010. ids += data[i].id;
  3011. if (i < data.length-1) {
  3012. ids += ',';
  3013. }
  3014. }
  3015. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3016. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  3017. res => {
  3018. if (res.code == "ok") {
  3019. this.$message({
  3020. message: '审核成功',
  3021. type: "success"
  3022. });
  3023. this.getReportList();
  3024. this.getDepartment();
  3025. this.approveDialogVisible = false;
  3026. } else {
  3027. this.$message({
  3028. message: res.msg,
  3029. type: "error"
  3030. });
  3031. }
  3032. },
  3033. error => {
  3034. this.$message({
  3035. message: error,
  3036. type: "error"
  3037. });
  3038. });
  3039. },
  3040. selectAll() {
  3041. if (this.isAllSelect) {
  3042. var keys = [];
  3043. this.reportNames.forEach(b=>{
  3044. keys.push(b.id);
  3045. })
  3046. this.$refs.approveTree.setCheckedKeys(keys);
  3047. } else {
  3048. this.$refs.approveTree.setCheckedKeys([]);
  3049. }
  3050. },
  3051. //批量审核
  3052. batchApprove() {
  3053. this.approveDialogVisible = true;
  3054. this.reportNames = [];
  3055. for (var i=0;i<this.reportList.length; i++) {
  3056. var report = this.reportList[i];
  3057. var hasUnChecked =false;
  3058. var id = '';
  3059. for (var j=0;j<report.data.length; j++) {
  3060. if (report.data[j].state == 0
  3061. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  3062. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  3063. hasUnChecked = true;
  3064. id += report.data[j].id+',';
  3065. }
  3066. }
  3067. if (hasUnChecked) {
  3068. this.reportNames.push({id:id, label: report.name});
  3069. }
  3070. }
  3071. },
  3072. removeEmptyNode(list) {
  3073. for (var i=0;i<list.length;i++) {
  3074. var cnt = 0;
  3075. if (list[i].membCount == 0) {
  3076. list.splice(i, 1);
  3077. i--;
  3078. } else if (list[i].children != null) {
  3079. this.removeEmptyNode(list[i].children);
  3080. }
  3081. }
  3082. },
  3083. calculateMembCount(list) {
  3084. for (var i in list) {
  3085. var cnt = 0;
  3086. if (list[i].children != null) {
  3087. this.calculateMembCount(list[i].children);
  3088. for (var m in list[i].children) {
  3089. cnt += list[i].children[m].membCount;
  3090. }
  3091. }
  3092. if (list[i].isUser == 1) {
  3093. cnt++;
  3094. this.membCount++;
  3095. }
  3096. list[i].membCount = cnt;
  3097. }
  3098. },
  3099. stateChange() {
  3100. this.membCount = 0;
  3101. if (this.selectState == -1) {
  3102. //全部状态
  3103. this.data = this.allData;
  3104. } else {
  3105. //未填报
  3106. var newData = JSON.parse(JSON.stringify(this.allData));
  3107. this.filterState(this.selectState, newData);
  3108. this.data = newData;
  3109. }
  3110. this.calculateMembCount(this.data);
  3111. this.data[0].membCount = this.membCount;//总人数
  3112. },
  3113. //按状态过滤部门人员
  3114. filterState(state, list) {
  3115. for (var i =0;i<list.length; i++) {
  3116. var obj = list[i];
  3117. if (obj.isUser == 1) {
  3118. var match = false;
  3119. if (state == -2) {
  3120. if (obj.state == null) {
  3121. match = true;
  3122. }
  3123. } else {
  3124. if (obj.state == state) {
  3125. match = true;
  3126. }
  3127. }
  3128. if (!match) {
  3129. list.splice(i, 1);
  3130. i--;
  3131. } else {
  3132. }
  3133. } else {
  3134. if (obj.children != null) {
  3135. this.filterState(state, obj.children);
  3136. }
  3137. }
  3138. }
  3139. },
  3140. // 部门列表点击
  3141. handleNodeClick(data) {
  3142. // this.dealList = data
  3143. this.theValues(data.id, this.allData)
  3144. // this.depData = data;
  3145. var list = [];
  3146. if (data.id == -1) {
  3147. this.deptId = null;
  3148. this.targetUid = null;
  3149. list = this.data;
  3150. } else if (data.isUser == 1) {
  3151. this.deptId = null;
  3152. this.targetUid = data.id;
  3153. } else {
  3154. this.deptId = data.id;
  3155. this.targetUid = null;
  3156. list.push(data);
  3157. }
  3158. this.getReportList();
  3159. if (list.length > 0) {
  3160. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  3161. this.fillList = this.getUserMembListFromDeptList(list, 1)
  3162. }
  3163. },
  3164. theValues(id, item) {
  3165. for(var i in item) {
  3166. if(item[i].id == id) {
  3167. this.depData = item[i]
  3168. return
  3169. } else {
  3170. if(item[i].children) {
  3171. this.theValues(id, item[i].children)
  3172. }
  3173. }
  3174. }
  3175. },
  3176. //获取可以选择的代填的人员列表
  3177. getSubstitudeUserDeptList() {
  3178. if (this.deptMembData.length == 0) {
  3179. this.http.post("/department/listMyMembs", {},
  3180. res => {
  3181. if (res.code == "ok") {
  3182. let noAllData = JSON.parse(JSON.stringify(res.data));
  3183. if (noAllData.length > 0) {
  3184. if (noAllData[0].label == '全部人员') {
  3185. noAllData.splice(0,1);
  3186. }
  3187. }
  3188. this.setUserToDept(noAllData);
  3189. this.deptMembData = noAllData;
  3190. } else {
  3191. this.$message({
  3192. message: res.msg,
  3193. type: "error"
  3194. });
  3195. }
  3196. },
  3197. error => {
  3198. this.$message({
  3199. message: error,
  3200. type: "error"
  3201. });
  3202. });
  3203. }
  3204. },
  3205. // 获取部门列表
  3206. getDepartment() {
  3207. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3208. var param = {date:this.date + day};
  3209. this.http.post("/report/getMembList", param,
  3210. res => {
  3211. if (res.code == "ok") {
  3212. if(res.data.length == 0){
  3213. // this.$message({
  3214. // message: '请联系管理员设置负责部门',
  3215. // type: 'error'
  3216. // })
  3217. return
  3218. }
  3219. this.departmentList = JSON.parse(JSON.stringify(res.data))
  3220. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  3221. // let noAllData = JSON.parse(JSON.stringify(res.data));
  3222. // if (this.user.role > 0) {
  3223. // }
  3224. list.splice(0,0,{
  3225. id: -1,
  3226. label: '全部人员',
  3227. })
  3228. this.membCount = 0;
  3229. //设置员工到部门下面
  3230. this.setUserToDept(list);
  3231. this.data = list;
  3232. // console.log('data',this.data);
  3233. this.expandDate = [this.data[1].id]
  3234. this.allData = list;
  3235. // if (noAllData.length > 0) {
  3236. // if (noAllData[0].label == '全部人员') {
  3237. // noAllData.splice(0,1);
  3238. // }
  3239. // }
  3240. // this.setUserToDept(noAllData);
  3241. // this.deptMembData = noAllData;
  3242. this.option = this.changeArr(list1);
  3243. list[0].membCount = this.membCount;
  3244. if (this.depData.id == -1) {
  3245. this.depData.membCount = this.membCount;
  3246. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  3247. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  3248. } else {
  3249. if (this.depData.isUser == null) {
  3250. var dep = this.findTargetDept(this.data, this.depData.id);
  3251. var membDeptList = [];
  3252. membDeptList.push(dep);
  3253. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  3254. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  3255. }
  3256. }
  3257. if (this.depData.isUser == null) {
  3258. if (this.isFill) {
  3259. this.fillMembList = this.fillList;
  3260. } else {
  3261. this.fillMembList = this.unFillList;
  3262. }
  3263. }
  3264. this.stateChange()
  3265. } else {
  3266. this.$message({
  3267. message: res.msg,
  3268. type: "error"
  3269. });
  3270. }
  3271. },
  3272. error => {
  3273. this.$message({
  3274. message: error,
  3275. type: "error"
  3276. });
  3277. });
  3278. this.getReportFillStatus();
  3279. },
  3280. findTargetDept(list, deptId) {
  3281. var t = null;
  3282. for (var i=0;i<list.length; i++) {
  3283. if (list[i].isUser == null && list[i].id == deptId) {
  3284. t = list[i];
  3285. break;
  3286. }
  3287. }
  3288. if (t == null) {
  3289. for (var i=0;i<list.length; i++) {
  3290. if (list[i].children != null && list[i].children.length > 0) {
  3291. t = this.findTargetDept(list[i].children, deptId);
  3292. if (t != null) {
  3293. break;
  3294. }
  3295. }
  3296. }
  3297. }
  3298. return t;
  3299. },
  3300. getUserMembListFromDeptList(list, isFill) {
  3301. var membList = [];
  3302. for (var i in list) {
  3303. var deptName = list[i].label;
  3304. if (list[i].userList != null) {
  3305. list[i].userList.forEach(element => {
  3306. if (isFill == 0) {
  3307. //获取未填的
  3308. if (element.state == null) {
  3309. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  3310. membList.push(obj);
  3311. }
  3312. } else {
  3313. if (element.state != null) {
  3314. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  3315. membList.push(obj);
  3316. }
  3317. }
  3318. });
  3319. }
  3320. if (list[i].children != null) {
  3321. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  3322. }
  3323. }
  3324. return membList;
  3325. },
  3326. setUserToDept(list) {
  3327. for (var i in list) {
  3328. var cnt = 0;
  3329. if (list[i].children != null) {
  3330. this.setUserToDept(list[i].children);
  3331. for (var m in list[i].children) {
  3332. cnt += list[i].children[m].membCount;
  3333. }
  3334. }
  3335. if (list[i].userList != null) {
  3336. if (list[i].children == null) {
  3337. list[i].children = [];
  3338. }
  3339. list[i].userList.forEach(element => {
  3340. var obj = {
  3341. id: element.id,
  3342. label:element.name,
  3343. state:element.state,
  3344. parentId:element.departmentId,
  3345. isUser:1,
  3346. workingTime: element.workingTime,
  3347. leaveDays: element.leaveDays,
  3348. leaveTimes: element.leaveTimes
  3349. };
  3350. list[i].children.push(obj);
  3351. this.membCount++;
  3352. cnt++;
  3353. });
  3354. }
  3355. list[i].membCount = cnt;
  3356. }
  3357. },
  3358. // 修改数组
  3359. changeArr(arr) {
  3360. for (var i = 0; i < arr.length; i++) {
  3361. if(arr[i].id != -1 && arr[i].id != 0) {
  3362. if (arr[i].children != null && arr[i].children.length>0) {
  3363. arr[i].children = this.changeArr(arr[i].children);
  3364. }
  3365. arr[i].id && (arr[i].value = arr[i].id);
  3366. delete arr[i].id;
  3367. }
  3368. }
  3369. for(var i in arr) {
  3370. if(arr[i].id == -1 || arr[i].id == 0) {
  3371. arr.splice(i,1)
  3372. }
  3373. }
  3374. return arr;
  3375. },
  3376. //时间段范围设置改动,监听
  3377. onTimeTypeChange(timeType) {
  3378. this.seleChn(1)
  3379. this.showAddMore = true;
  3380. for(var i in this.workForm.domains) {
  3381. if (this.workForm.domains[i].timeType == 0) {
  3382. this.showAddMore = false;
  3383. break;
  3384. }
  3385. }
  3386. if (this.showAddMore) {
  3387. //检测数量
  3388. if (this.workForm.domains.length == 2) {
  3389. this.showAddMore = false;
  3390. } else {
  3391. this.showAddMore = true;
  3392. }
  3393. }
  3394. },
  3395. getTimeType() {
  3396. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3397. res => {
  3398. if (res.code == "ok") {
  3399. var t = res.data;
  3400. this.reportTimeType = t;
  3401. if (this.reportTimeType.type > 0) {
  3402. this.showAddMore = true;
  3403. }
  3404. //转化时间格式
  3405. if (t.allday != null) {
  3406. this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  3407. }
  3408. if (t.am != null) {
  3409. this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  3410. }
  3411. if (t.pm != null) {
  3412. this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  3413. }
  3414. } else {
  3415. this.$message({
  3416. message: res.msg,
  3417. type: "error"
  3418. });
  3419. }
  3420. },
  3421. error => {
  3422. this.listLoading = false;
  3423. this.$message({
  3424. message: error,
  3425. type: "error"
  3426. });
  3427. });
  3428. },
  3429. // 改变月份 -------
  3430. changeMonthOut() {
  3431. this.getAllDate();
  3432. this.getReportList();
  3433. this.getDepartment();
  3434. },
  3435. // 选择日期
  3436. choseDate(i, item) {
  3437. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  3438. return
  3439. }
  3440. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3441. this.choseDay = i;
  3442. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3443. sessionStorage.msg = this.date + day,
  3444. this.getReportList();
  3445. this.getDepartment();
  3446. this.curDate = item.date;
  3447. },
  3448. canClick(i, item){
  3449. let nowDate = new Date()
  3450. let nowDateYear = nowDate.getFullYear()
  3451. let itemYear = parseInt(this.date.split('-')[0])
  3452. let nowDateMonth = nowDate.getMonth() + 1
  3453. let itemMonth = parseInt(this.date.split('-')[1])
  3454. let nowDateDay = nowDate.getDate()
  3455. let itemDay = parseInt(item.showDate.split('.')[1])
  3456. if(nowDateYear < itemYear){
  3457. return false
  3458. }else if(nowDateYear == itemYear){
  3459. if(nowDateMonth < itemMonth){
  3460. return false
  3461. }else if(nowDateMonth == itemMonth){
  3462. if(nowDateDay < itemDay){
  3463. return false
  3464. }
  3465. }
  3466. }
  3467. },
  3468. // 获取日期列表
  3469. getAllDate(e) {
  3470. var dayArry = [];
  3471. var day = this.getCountDays();
  3472. let curMonthDay = null;
  3473. for (var k = 1; k <= day; k++) {
  3474. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + "月" + k+'日';
  3475. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3476. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3477. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3478. if(sessionStorage.msg) {
  3479. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3480. this.choseDay = k - 1;
  3481. curMonthDay = str;
  3482. }
  3483. } else {
  3484. if (new Date().getDate() == k) {
  3485. this.choseDay = k - 1;
  3486. }
  3487. }
  3488. } else {
  3489. this.choseDay = 0;
  3490. }
  3491. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3492. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3493. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3494. }
  3495. this.allDate = dayArry;
  3496. //不能超过最大日期
  3497. if (this.choseDay > day-1) {
  3498. this.choseDay = day-1;
  3499. }
  3500. if(sessionStorage.from != 1){
  3501. let nowmonth = new Date().getMonth() + 1
  3502. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  3503. let nowdate = new Date().getDate()
  3504. if(nowd == this.date){
  3505. if(e && sessionStorage.msg){
  3506. }else{
  3507. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  3508. }
  3509. let nowday = new Date(sessionStorage.msg).getDate()
  3510. this.choseDay = nowday - 1
  3511. let monthdate = new Date(sessionStorage.msg)
  3512. this.curDate = (monthdate.getMonth() + 1) + '月' + monthdate.getDate() + '日'
  3513. }else{
  3514. if(e && sessionStorage.msg){
  3515. }else{
  3516. sessionStorage.msg = this.date + '-01'
  3517. }
  3518. let monthdate = new Date(sessionStorage.msg)
  3519. this.choseDay = monthdate.getDate() - 1
  3520. this.curDate = (monthdate.getMonth() + 1) + '月' + monthdate.getDate() + '日'
  3521. console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  3522. }
  3523. }else{
  3524. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  3525. }
  3526. //从消息点击跳转过来的,直接加载指定日期
  3527. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3528. this.curDate = sessionStorage.msg;
  3529. sessionStorage.from = 0;
  3530. } else {
  3531. // if (curMonthDay != null) {
  3532. // // this.curDate = curMonthDay;
  3533. // let d = new Date(sessionStorage.msg)
  3534. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3535. // } else {
  3536. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  3537. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3538. // }
  3539. }
  3540. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  3541. // if(!sessionStorage.msg){
  3542. // let msgday = this.choseDay + 1
  3543. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  3544. // }
  3545. this.getReportFillStatus();
  3546. },
  3547. getCountDays() {
  3548. var newstr = this.date.replace(/-/g, "/");
  3549. var curDate = new Date(newstr+'/01');
  3550. var curMonth = curDate.getMonth();
  3551. curDate.setMonth(curMonth + 1);
  3552. curDate.setDate(0);
  3553. return curDate.getDate();
  3554. },
  3555. //获取日报列表
  3556. getReportList() {
  3557. this.listLoading = true;
  3558. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3559. let param = {date: this.date + day};
  3560. if (this.deptId) {
  3561. param.deptId = this.deptId;
  3562. }
  3563. if (this.targetUid) {
  3564. param.userId = this.targetUid;
  3565. }
  3566. this.http.post( this.port.report.list, param,
  3567. res => {
  3568. this.listLoading = false;
  3569. if (res.code == "ok") {
  3570. this.reportList = res.data;
  3571. if(document.querySelector("#day"+this.choseDay)){
  3572. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3573. }
  3574. } else {
  3575. this.$message({
  3576. message: res.msg,
  3577. type: "error"
  3578. });
  3579. }
  3580. },
  3581. error => {
  3582. this.listLoading = false;
  3583. this.$message({
  3584. message: error,
  3585. type: "error"
  3586. });
  3587. });
  3588. },
  3589. // 处理数据
  3590. // dealWith() {
  3591. // var tianxie = 0
  3592. // var weixtianxie = 0
  3593. // if(this.selectState == -1) {
  3594. // } else {
  3595. // var arr = []
  3596. // for (var i in this.reportList) {
  3597. // arr.push(this.reportList[i].id)
  3598. // }
  3599. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  3600. // }
  3601. // },
  3602. // getDealWith(item, tx, wtx, arr) {
  3603. // for(var i in item) {
  3604. // if(item[i].children) {
  3605. // this.getDealWith(item[i].children, tx, wtx, arr)
  3606. // } else {
  3607. // if(arr.indexOf(item[i].id) != '-1') {
  3608. // tx = +tx + 1
  3609. // }
  3610. // }
  3611. // }
  3612. // },
  3613. //导出员工工时统计
  3614. exportUserTime() {
  3615. this.listLoading = true;
  3616. var param = {};
  3617. if (this.exportParam.dateRange != null) {
  3618. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3619. }
  3620. this.http.post('/department/exportDeptStatistic', param,
  3621. res => {
  3622. this.listLoading = false;
  3623. if (res.code == "ok") {
  3624. location.href = res.data;
  3625. this.exportTimeDialog = false;
  3626. } else {
  3627. this.$message({
  3628. message: res.msg,
  3629. type: "error"
  3630. });
  3631. }
  3632. },
  3633. error => {
  3634. this.listLoading = false;
  3635. this.$message({
  3636. message: error,
  3637. type: "error"
  3638. });
  3639. });
  3640. },
  3641. //导出日报
  3642. exportReport() {
  3643. this.listLoading = true;
  3644. var param = {};
  3645. if (this.exportParam.dateRange != null) {
  3646. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3647. }
  3648. if (this.exportParam.projectId != null) {
  3649. param.projectId = this.exportParam.projectId;
  3650. }
  3651. if (this.exportParam.departmentId != null) {
  3652. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  3653. }
  3654. param.stateKey = this.stateKey
  3655. // param.departmentId = this.user.departmentId
  3656. this.http.post( this.port.report.export, param,
  3657. res => {
  3658. this.listLoading = false;
  3659. if (res.code == "ok") {
  3660. location.href = res.data;
  3661. this.exportDialog = false;
  3662. } else {
  3663. this.$message({
  3664. message: res.msg,
  3665. type: "error"
  3666. });
  3667. }
  3668. },
  3669. error => {
  3670. this.listLoading = false;
  3671. this.$message({
  3672. message: error,
  3673. type: "error"
  3674. });
  3675. });
  3676. },
  3677. //获取项目列表
  3678. getProjectList() {
  3679. this.listLoading = true;
  3680. this.http.post( this.port.project.list, {},
  3681. res => {
  3682. this.listLoading = false;
  3683. if (res.code == "ok") {
  3684. for(var i in res.data) {
  3685. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3686. res.data[i].projectCode = ''
  3687. }
  3688. }
  3689. this.projectList = res.data;
  3690. // console.log("项目列表",this.projectList);
  3691. } else {
  3692. this.$message({
  3693. message: res.msg,
  3694. type: "error"
  3695. });
  3696. }
  3697. },
  3698. error => {
  3699. this.listLoading = false;
  3700. this.$message({
  3701. message: error,
  3702. type: "error"
  3703. });
  3704. });
  3705. },
  3706. // 获取填报日报的项目下拉列表
  3707. getFillProjectList() {
  3708. this.http.post( this.port.project.list, {
  3709. forReport: 1
  3710. },res => {
  3711. if (res.code == "ok") {
  3712. for(var i in res.data) {
  3713. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3714. res.data[i].projectCode = ''
  3715. }
  3716. }
  3717. this.fillProjectList = res.data;
  3718. } else {
  3719. this.$message({
  3720. message: res.msg,
  3721. type: "error"
  3722. });
  3723. }
  3724. },
  3725. error => {
  3726. this.$message({
  3727. message: error,
  3728. type: "error"
  3729. });
  3730. });
  3731. },
  3732. getBasecostItemList() {
  3733. this.http.post('/project-basecost-setting/getReportBasecostList', {
  3734. companyId: this.user.companyId
  3735. },
  3736. res => {
  3737. if (res.code == "ok") {
  3738. this.timeBasecostList = res.data;
  3739. }
  3740. });
  3741. },
  3742. // 获取个人某天的日报 000000
  3743. getReport() {
  3744. this.http.post( this.port.report.getPort, {
  3745. date: this.workForm.createDate
  3746. },
  3747. res => {
  3748. if (res.code == "ok") {
  3749. var quanbu = 0
  3750. this.jsDay = 1
  3751. var zhi = ''
  3752. var slp = res.data.report
  3753. for(var i in slp) {
  3754. var sp = +slp[i].workingTime + 0
  3755. zhi = this.jsDay * sp
  3756. quanbu = +quanbu + zhi
  3757. }
  3758. this.jsTime = quanbu
  3759. var list = res.data;
  3760. this.report = list;
  3761. this.canCancelInDialog = false
  3762. if(list.report.length != 0) {
  3763. var arr = [];
  3764. this.canEdit = false;
  3765. let candelete = true
  3766. for(var i in list.report) {
  3767. var flg = null
  3768. list.report[i].isOvertime == 1 ? flg = true : flg = false
  3769. arr.push({
  3770. id: list.report[i].id,
  3771. projectId: list.report[i].projectId,
  3772. workingTime: list.report[i].workingTime,
  3773. content: list.report[i].content,
  3774. state: list.report[i].state,
  3775. timeType: list.report[i].timeType,
  3776. subProjectList: list.report[i].subProjectList,
  3777. taskList: list.report[i].taskList,
  3778. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  3779. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  3780. taskId: list.report[i].taskId,
  3781. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  3782. startTime: list.report[i].startTime,
  3783. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  3784. endTime: list.report[i].endTime,
  3785. isOvertime: flg,
  3786. progress:list.report[i].progress,
  3787. professionProgress: list.report[i].professionProgressList,
  3788. stages:list.report[i].stages,
  3789. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  3790. pics: list.report[i].pics,
  3791. multiWorktime: list.report[i].multiWorktime,
  3792. worktimeList: list.report[i].worktimeList,
  3793. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  3794. wuduList: list.report[i].degreeList,
  3795. taskGroups:list.report[i].taskGroups,
  3796. customData: list.report[i].customData,//自定义的数值
  3797. auditUserList: list.report[i].auditUserList,
  3798. projectAuditorId: list.report[i].projectAuditorId,
  3799. projectAuditorName: list.report[i].projectAuditorName,
  3800. overtimeHours: list.report[i].overtimeHours,
  3801. customText: list.report[i].customText,
  3802. basecostId: list.report[i].basecostId,
  3803. canEdit: list.report[i].state >= 2 ? true : false
  3804. })
  3805. if (list.report[i].state >= 2) {
  3806. this.canEdit = true;
  3807. }
  3808. if(list.report[i].state < 2){
  3809. candelete = false
  3810. }
  3811. if (list.report[i].state == 0){
  3812. this.canCancelInDialog = true
  3813. }
  3814. }
  3815. this.reportCanDelete = candelete
  3816. this.workForm = {
  3817. createDate: this.workForm.createDate,
  3818. domains: arr,
  3819. userNames:null,
  3820. userId:null,
  3821. time: list.time
  3822. }
  3823. } else {
  3824. this.workForm = {
  3825. createDate: this.workForm.createDate,
  3826. domains: [{
  3827. id: null,
  3828. projectId: "",
  3829. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3830. content: "",
  3831. progress:100,
  3832. state: 2,
  3833. timeType:0,
  3834. multiWorktime: this.reportTimeType.multiWorktime,
  3835. worktimeList:[{}],
  3836. canEdit: true
  3837. }],
  3838. userId:null,
  3839. userNames:null,
  3840. time: this.report.time
  3841. }
  3842. if(this.isWeekend){
  3843. this.$set(this.workForm.domains[0],'isOvertime',true)
  3844. if(this.reportTimeType.type != 2){
  3845. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  3846. }
  3847. }
  3848. if(this.user.timeType.type == 1) {
  3849. var shuzhi = this.user.timeType.allday + ''
  3850. // console.log('执行一次', shuzhi.indexOf('.'))
  3851. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  3852. }
  3853. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  3854. //默认给第一个,必填字段
  3855. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  3856. }
  3857. this.canEdit = true;
  3858. }
  3859. } else {
  3860. this.$message({
  3861. message: res.msg,
  3862. type: "error"
  3863. });
  3864. }
  3865. },
  3866. error => {
  3867. this.$message({
  3868. message: error,
  3869. type: "error"
  3870. });
  3871. });
  3872. },
  3873. guanbi() {
  3874. this.falsss = false
  3875. },
  3876. // 打开日报填写
  3877. fillInReport(i, isBatch) {
  3878. this.isWeekend = false
  3879. this.reportCanDelete = false
  3880. // console.log(this.user.timeType.type, '选择时长')
  3881. if(i != 1) {
  3882. this.falsss = false
  3883. } else {
  3884. this.falsss = true
  3885. }
  3886. if (this.isSubstitude) {
  3887. this.getSubstitudeUserDeptList();
  3888. }
  3889. if(i == -1 || this.isSubstitude) {
  3890. this.isDisable = false;
  3891. } else {
  3892. this.isDisable = true;
  3893. }
  3894. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3895. this.isBatch = isBatch;
  3896. if (this.isBatch == 0 && !this.isSubstitude) {
  3897. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  3898. let weekday = new Date(this.workForm.createDate).getDay()
  3899. if(this.user.companyId == 817){
  3900. if(weekday == 0){
  3901. this.isWeekend = true
  3902. }
  3903. }else{
  3904. if(weekday == 0 || weekday == 6){
  3905. this.isWeekend = true
  3906. }
  3907. }
  3908. this.getReport(i);
  3909. } else {
  3910. // console.log('执行到了这里')
  3911. this.jsTime = 0
  3912. this.jsDay = 0
  3913. this.workForm = {
  3914. createDate: null,//批量填报没有日期
  3915. domains: [{
  3916. id: null,
  3917. projectId: "",
  3918. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3919. content: "",
  3920. progress:100,
  3921. state: 2,
  3922. timeType:0,
  3923. multiWorktime: this.reportTimeType.multiWorktime,
  3924. worktimeList:[{}],
  3925. canEdit: true
  3926. }],
  3927. }
  3928. if(this.user.timeType.type == 1) {
  3929. var shuzhi = this.user.timeType.allday + ''
  3930. // console.log('执行二次')
  3931. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  3932. }
  3933. // console.log(this.workForm)
  3934. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  3935. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  3936. }
  3937. this.canEdit = true;
  3938. }
  3939. this.dialogVisible = true;
  3940. },
  3941. // 按周填报里内容的填写
  3942. tianxies(item, i, names, row) {
  3943. var idd = ''
  3944. var obj = {}
  3945. for(var l in this.projectList) {
  3946. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  3947. }
  3948. obj.projectId = idd
  3949. this.selectProject(obj, 0)
  3950. // console.log(this.workForm.domains[0], '打印出来的')
  3951. this.tianxieDialogVisible = true
  3952. this.scopess = item
  3953. var sss = {}
  3954. sss.projectId = idd;
  3955. sss.con = item.con
  3956. sss.progress = item.progress
  3957. sss.time = item.time
  3958. sss.groupId = item.groupId
  3959. sss.stage = item.stage;
  3960. sss.workingTime = item.workingTime
  3961. sss.projectAuditorId = item.projectAuditorId;
  3962. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  3963. //默认选中第一个
  3964. sss.basecostId = this.timeBasecostList[0].id;
  3965. }
  3966. var that = this
  3967. setTimeout(() =>{
  3968. var isFirstEdit = false;
  3969. if(Object.keys(item).length < 5) {
  3970. //首次点开当前的这个cell,初始化数据
  3971. isFirstEdit = true;
  3972. sss.subProjectId = that.workForm.domains[0].subProjectId
  3973. sss.stage = that.workForm.domains[0].stage
  3974. sss.subProjectList = that.workForm.domains[0].subProjectList
  3975. sss.stages = that.workForm.domains[0].stages
  3976. sss.taskGroups = that.workForm.domains[0].taskGroups;
  3977. sss.auditUserList = obj.auditUserList;
  3978. } else {
  3979. sss.subProjectId = item.subProjectId
  3980. sss.stage = item.stage
  3981. sss.subProjectList = item.subProjectList
  3982. sss.stages = item.stages
  3983. sss.taskGroups = item.taskGroups;
  3984. sss.auditUserList = obj.auditUserList;
  3985. sss.degreeId = item.degreeId;
  3986. sss.customData = item.customData;
  3987. }
  3988. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  3989. //只有一个审核人,自动设置上去
  3990. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  3991. }
  3992. sss.wuduList = row[0].wuduList
  3993. // console.log(sss, '数据')
  3994. that.zhoBaoIdx = i
  3995. that.zhoBaoName = names
  3996. that.zhoBao = sss
  3997. that.zhis = row
  3998. if (sss.groupId) {
  3999. //最后一个参数表示是否保留stage的值,不要重置为空
  4000. this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
  4001. }
  4002. that.$forceUpdate();
  4003. },600);
  4004. },
  4005. // 按周填报里内容的填写点击确定
  4006. btnTianxiaes() {
  4007. if (this.zhoBao.projectAuditorId) {
  4008. let errtips = ''
  4009. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  4010. errtips += this.user.timeType.customDegreeName + '、'
  4011. }
  4012. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  4013. errtips += this.user.timeType.customDataName + '、'
  4014. }
  4015. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  4016. errtips += this.user.timeType.customTextName + '、'
  4017. }
  4018. if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
  4019. errtips += this.user.companyId==781?'具体内容与结果、':'工作事项、'
  4020. }
  4021. if(errtips){
  4022. errtips = errtips.substring(0,errtips.length - 1)
  4023. this.$message({
  4024. message: '请对' + errtips + '进行填写',
  4025. type: 'warning'
  4026. })
  4027. }else {
  4028. this.tianxieDialogVisible = false
  4029. var zhong = this.zhoData
  4030. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  4031. this.zhoData = zhong
  4032. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  4033. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  4034. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  4035. }
  4036. } else {
  4037. this.$message({
  4038. message: '请选择审核人',
  4039. type: "error"
  4040. });
  4041. }
  4042. },
  4043. // 获取本周
  4044. getCurrentWeek() {
  4045. const currentDate = new Date()
  4046. const week = currentDate.getDay()
  4047. const millisecond = 1000 * 60 * 60 * 24
  4048. const minusDay = week != 0 ? week - 1 : 4
  4049. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  4050. var stat = this.dealdate(monday)
  4051. var end
  4052. if(this.user.timeType.fillAhead == 1){
  4053. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4054. const endDate = new Date(currentDate.getTime() + endDay * millisecond)
  4055. end = this.dealdate(endDate)
  4056. }else{
  4057. end = this.dealdate(currentDate)
  4058. }
  4059. this.zhoRqi = [stat, end]
  4060. // console.log('date',currentDate,this.zhoRqi);
  4061. this.zhoRqis()
  4062. // this.jiazai()
  4063. },
  4064. // 获取上周
  4065. handleGetPrevWeek() {
  4066. const Time = new Date(this.zhoRqi[0])
  4067. let weekNum = Time.getDay()
  4068. weekNum = weekNum == 0 ? 7 : weekNum
  4069. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  4070. let fitstDate = new Date(
  4071. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  4072. )
  4073. let startDate = `${fitstDate.getFullYear()}-${
  4074. fitstDate.getMonth() + 1 < 10
  4075. ? '0' + (fitstDate.getMonth() + 1)
  4076. : fitstDate.getMonth() + 1
  4077. }-${
  4078. fitstDate.getDate() < 10
  4079. ? '0' + fitstDate.getDate()
  4080. : fitstDate.getDate()
  4081. }`
  4082. let endDate = `${lastDate.getFullYear()}-${
  4083. lastDate.getMonth() + 1 < 10
  4084. ? '0' + (lastDate.getMonth() + 1)
  4085. : lastDate.getMonth() + 1
  4086. }-${
  4087. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4088. }`
  4089. var stat = this.dealdate(startDate)
  4090. var ends = this.dealdate(endDate)
  4091. var end = this.dateChange(-2, ends)
  4092. this.zhoRqi = [stat, end]
  4093. this.zhoRqis()
  4094. // this.jiazai()
  4095. },
  4096. // 获取下周
  4097. handleGetNextvWeek() {
  4098. const Time = new Date(this.zhoRqi[1])
  4099. let weekNum = Time.getDay()
  4100. weekNum = weekNum == 0 ? 7 : weekNum
  4101. let fitstDate = new Date(
  4102. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  4103. )
  4104. let lastDate = new Date(
  4105. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  4106. )
  4107. let startDate = `${fitstDate.getFullYear()}-${
  4108. fitstDate.getMonth() + 1 < 10
  4109. ? '0' + (fitstDate.getMonth() + 1)
  4110. : fitstDate.getMonth() + 1
  4111. }-${
  4112. fitstDate.getDate() < 10
  4113. ? '0' + fitstDate.getDate()
  4114. : fitstDate.getDate()
  4115. }`
  4116. let endDate = `${lastDate.getFullYear()}-${
  4117. lastDate.getMonth() + 1 < 10
  4118. ? '0' + (lastDate.getMonth() + 1)
  4119. : lastDate.getMonth() + 1
  4120. }-${
  4121. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4122. }`
  4123. var stat = this.dealdate(startDate)
  4124. var ends = this.dealdate(endDate)
  4125. var end = this.dateChange(-2, ends)
  4126. this.zhoRqi = [stat, end]
  4127. this.zhoRqis()
  4128. // this.jiazai()
  4129. },
  4130. // 新增日期
  4131. newDates() {
  4132. // console.log(this.zhoRqi, '看卡')
  4133. let edate = new Date(this.zhoRqi[1])
  4134. let nowdate = new Date()
  4135. let nowdate2
  4136. if(this.user.timeType.fillAhead == 1){
  4137. let week = nowdate.getDay()
  4138. const endDay = week > 5 ? 0 : 5 - week
  4139. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4140. nowdate2 = this.dealdate(endDate)
  4141. }else{
  4142. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4143. }
  4144. if(edate >= nowdate2){
  4145. return
  4146. }
  4147. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  4148. var obj = {}
  4149. obj.zhoDataTime = this.zhoRqi[1]
  4150. obj.he = 0
  4151. for(var j in this.projectList) {
  4152. var xinzhi = this.projectList[j].projectName
  4153. obj[xinzhi] = {}
  4154. obj[xinzhi].time = ''
  4155. obj[xinzhi].con = ''
  4156. obj[xinzhi].progress = 0
  4157. obj[xinzhi].workingTime = 0
  4158. }
  4159. this.zhoData.push(obj)
  4160. if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
  4161. this.getWeeklyCardTime();
  4162. }
  4163. this.getWeeklyWorkTime();
  4164. },
  4165. // 减去时间
  4166. dateChange(num = 1,date = false) {
  4167.   if (!date) {
  4168.     date = new Date();//没有传入值时,默认是当前日期
  4169.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4170.   }
  4171.   date += " 00:00:00";//设置为当天凌晨12点
  4172.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  4173.   date += (86400) * num;//修改后的时间戳
  4174.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4175. var nian = newDate.getFullYear()
  4176. var yue = ''
  4177. var ri = ''
  4178. var yues = (newDate.getMonth() + 1)
  4179. var ris = newDate.getDate()
  4180. yues > 9 ? yue = yues : yue = '0' + yues
  4181. ris > 9 ? ri = ris : ri = '0' + ris
  4182. return nian +'-'+yue+'-'+ri
  4183. },
  4184. // 加载动画
  4185. jiazai() {
  4186. this.zhoLoading = true
  4187. var that = this
  4188. setTimeout(() =>{
  4189. that.zhoLoading = false
  4190. },1000);
  4191. },
  4192. // 转时间格式
  4193. dealdate(date) {
  4194. const dt = new Date(date)
  4195. const y = dt.getFullYear()
  4196. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  4197. const d = (dt.getDate() + '').padStart(2, '0')
  4198. return `${y}-${m}-${d}`
  4199. },
  4200. // 按周填报
  4201. fillInReportss() {
  4202. window.addEventListener('scroll', this.handleScroll, true)
  4203. // this.jiazai()
  4204. this.diasZho = true
  4205. this.getCurrentWeek()
  4206. // 项目数量判断 <=5
  4207. if(this.projectList.length < 5){
  4208. this.selProjectList = this.projectList
  4209. this.selConShow = false
  4210. }
  4211. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  4212. //重新获取工时预警类型的预算项
  4213. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4214. companyId: this.user.companyId
  4215. },
  4216. res => {
  4217. if (res.code == "ok") {
  4218. this.timeBasecostList = res.data;
  4219. }
  4220. });
  4221. }
  4222. },
  4223. // 按周填报的项目筛选
  4224. selListFun(){
  4225. this.selProjectList = []
  4226. if(this.selCon.length){
  4227. for (let i = 0; i < this.selCon.length; i++) {
  4228. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  4229. }
  4230. this.selConShow = false
  4231. }else{
  4232. this.$message({
  4233. message:'请选择要填报的项目',
  4234. type:'error'
  4235. })
  4236. }
  4237. },
  4238. getWeeklyCardTime(){ //按周填报获取考勤信息
  4239. let dateStr = []
  4240. for(let i in this.zhoData){
  4241. dateStr.push(this.zhoData[i].zhoDataTime)
  4242. }
  4243. this.http.post('/report/getWeeklyCardTime',{
  4244. dateStr: JSON.stringify(dateStr)
  4245. },res => {
  4246. if(res.code == 'ok'){
  4247. for(let i in res.data){
  4248. let datei = '';
  4249. if (this.user.timeType.showDdCardtime == 1) {
  4250. datei = res.data[i].workDate.split('-');
  4251. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  4252. datei = res.data[i].createDate.split('-');
  4253. }
  4254. for(let m in this.zhoData){
  4255. let datem = new Date(this.zhoData[m].zhoDataTime)
  4256. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4257. let item = {
  4258. startTime: res.data[i].startTime,
  4259. endTime: res.data[i].endTime,
  4260. workHours: res.data[i].workHours
  4261. }
  4262. this.$set(this.zhoData[m],'corpTime',item)
  4263. }
  4264. }
  4265. }
  4266. }else{
  4267. this.$message({
  4268. message: res.msg,
  4269. type: 'error'
  4270. })
  4271. }
  4272. },err => {
  4273. this.$message({
  4274. message: err,
  4275. type: 'error'
  4276. })
  4277. })
  4278. },
  4279. getWeeklyWorkTime(){ //按周填报获取已填工时
  4280. let dateStr = []
  4281. for(let i in this.zhoData){
  4282. dateStr.push(this.zhoData[i].zhoDataTime)
  4283. }
  4284. this.http.post('/report/getWeeklyWorkTime',{
  4285. dateStr: JSON.stringify(dateStr)
  4286. },res => {
  4287. if(res.code == 'ok'){
  4288. for(let n in this.zhoData){
  4289. delete this.zhoData[n].filledTime
  4290. }
  4291. for(let i in res.data){
  4292. let datei = res.data[i].createDate.split('-');
  4293. for(let m in this.zhoData){
  4294. let datem = new Date(this.zhoData[m].zhoDataTime)
  4295. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4296. this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
  4297. }
  4298. }
  4299. }
  4300. console.log('zhodata',this.zhoData);
  4301. }else{
  4302. this.$message({
  4303. message: res.msg,
  4304. type: 'error'
  4305. })
  4306. }
  4307. },err => {
  4308. this.$message({
  4309. message: err,
  4310. type: 'error'
  4311. })
  4312. })
  4313. },
  4314. selListqx(){
  4315. this.diasZho = false
  4316. this.selProjectList = []
  4317. this.selCon = []
  4318. },
  4319. handleScroll() {
  4320. this.changdu = this.projectList.length + 1
  4321. },
  4322. // 自动选择时间点的事件
  4323. zhoTimes(item, i, ims, event) {
  4324. var iss = i
  4325. if(item.time == null) {
  4326. return
  4327. } else {
  4328. var zhi = this.zhoData[iss]
  4329. var he = 0
  4330. for(var i in zhi) {
  4331. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  4332. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  4333. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  4334. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  4335. var leave1=date3%(24*3600*1000)
  4336. var hours=Math.floor(leave1/(3600*1000))
  4337. var leave2=leave1%(3600*1000)
  4338. var minutes=Math.floor(leave2/(60*1000))
  4339. var shi = hours+'.'+ minutes
  4340. he += +shi
  4341. }
  4342. }
  4343. zhi.he = he + 'h'
  4344. }
  4345. },
  4346. // 自动选择事件长度的事件
  4347. zhoXuan(item, i) {
  4348. var iss = i
  4349. if(item.time == null) {
  4350. return
  4351. } else {
  4352. var zhi = this.zhoData[iss]
  4353. var he = 0
  4354. for(var i in zhi) {
  4355. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4356. he += +zhi[i].workingTime
  4357. }
  4358. }
  4359. zhi.he = he + 'h'
  4360. }
  4361. },
  4362. // 按时间比例
  4363. addBli(item, i) {
  4364. var iss = i
  4365. if(item.time == null) {
  4366. return
  4367. } else {
  4368. var zhi = this.zhoData[iss]
  4369. var he = 0
  4370. for(var i in zhi) {
  4371. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4372. he += +zhi[i].workingTime
  4373. }
  4374. }
  4375. zhi.he = he.toFixed(1) + 'h'
  4376. }
  4377. },
  4378. zhoRqis() {
  4379. let nowdate = new Date()
  4380. let nowdate2
  4381. if(this.user.timeType.fillAhead == 1){
  4382. const millisecond = 1000 * 60 * 60 * 24
  4383. let week = nowdate.getDay()
  4384. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4385. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4386. nowdate2 = this.dealdate(endDate)
  4387. }else{
  4388. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4389. }
  4390. let edate = new Date(this.zhoRqi[1])
  4391. if(edate >= nowdate2){
  4392. let emon = nowdate2.getMonth() + 1
  4393. let eday = nowdate2.getDate()
  4394. let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
  4395. this.zhoRqi[1] = edate2
  4396. }
  4397. this.zhoData = []
  4398. if(this.zhoRqi) {
  4399. var stime = this.zhoRqi[0]
  4400. var etime = this.zhoRqi[1]
  4401. var zhi = this.getdiffdate(stime, etime)
  4402. var arrst = []
  4403. for(var i in zhi) {
  4404. var obj = {}
  4405. obj.zhoDataTime = zhi[i]
  4406. obj.he = 0
  4407. for(var j in this.projectList) {
  4408. var xinzhi = this.projectList[j].projectName
  4409. obj[xinzhi] = {}
  4410. obj[xinzhi].time = ''
  4411. obj[xinzhi].con = ''
  4412. obj[xinzhi].progress = 0
  4413. obj[xinzhi].workingTime = 0
  4414. }
  4415. arrst.push(obj)
  4416. }
  4417. this.zhoData = arrst
  4418. }
  4419. if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
  4420. this.getWeeklyCardTime()
  4421. // this.getWeeklyFilledTime()
  4422. }
  4423. if (this.zhoData.length) {
  4424. this.getWeeklyWorkTime();
  4425. }
  4426. },
  4427. zhoZhi(res, i) {
  4428. var zhi = 0
  4429. for(var i in res) {
  4430. if(i != 'zhoDataTime' && i != 'he') {
  4431. zhi += +res[i]
  4432. }
  4433. }
  4434. res.he = zhi
  4435. },
  4436. zhoBtn(i) {
  4437. // this.zhoData.split(i, 1)
  4438. var arr = this.zhoData
  4439. arr.splice(i, 1)
  4440. },
  4441. zhoAddlast(){
  4442. this.selConShow = true
  4443. },
  4444. zhoAddqx(){
  4445. this.diasZho = false
  4446. this.selConShow = true
  4447. this.selProjectList = []
  4448. this.selCon = []
  4449. },
  4450. // 提交按周填报
  4451. zhoAdd() {
  4452. var zhi = this.zhoData
  4453. var ll = 0
  4454. if(this.reportTimeType.type == 2) {
  4455. for(var i in zhi) {
  4456. this.dateAr = []
  4457. var alp = []
  4458. var zhis = zhi[i]
  4459. for(var j in zhis) {
  4460. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  4461. let objs = {}
  4462. objs.s = zhis[j].time[0]
  4463. objs.e = zhis[j].time[1]
  4464. alp.push(objs)
  4465. }
  4466. }
  4467. this.dateAr = alp
  4468. if(this.dateAr.length > 0) {
  4469. let trus = this.fns()
  4470. ll += 1
  4471. if(!trus) {
  4472. this.$message({
  4473. message: '填写的时间段重叠',
  4474. type: 'error'
  4475. })
  4476. return false
  4477. }
  4478. }
  4479. }
  4480. if(ll == 0) {
  4481. this.$message({
  4482. message: '请填写时间',
  4483. type: 'error'
  4484. })
  4485. return false
  4486. }
  4487. } else if(this.reportTimeType.type == 1){
  4488. for(var i in zhi) {
  4489. var zhis = zhi[i]
  4490. for(var j in zhis) {
  4491. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  4492. ll += 1
  4493. }
  4494. }
  4495. }
  4496. if(ll == 0) {
  4497. this.$message({
  4498. message: '请选择时间',
  4499. type: 'error'
  4500. })
  4501. return false
  4502. }
  4503. let overcorp = ''
  4504. for(let n in zhi){
  4505. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  4506. overcorp += zhi[n].zhoDataTime + ','
  4507. }
  4508. }
  4509. if(overcorp != ''){
  4510. overcorp = overcorp.substring(0,overcorp.length - 1)
  4511. this.$message({
  4512. message: '日期[' + overcorp + ']填报工时之和不能超过考勤总工时',
  4513. type: 'error'
  4514. })
  4515. return
  4516. }
  4517. }
  4518. var submits = []
  4519. let formData = new FormData();
  4520. if(this.reportTimeType.multiWorktime == 1){
  4521. for (var i in this.zhoData) {
  4522. var zhoD = this.zhoData[i]
  4523. var flgs = false
  4524. for(var j in zhoD) {
  4525. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4526. flgs = true
  4527. // formData.append("degreeId", "-1");
  4528. formData.append("id", '-1');
  4529. for(var s in this.projectList) {
  4530. if(j == this.projectList[s].projectName) {
  4531. formData.append("projectId", this.projectList[s].id);
  4532. }
  4533. }
  4534. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4535. formData.append("taskId", 0);
  4536. formData.append("reportTimeType", this.reportTimeType.type);
  4537. formData.append("endTime", '');
  4538. formData.append("startTime", '');
  4539. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4540. var lix = []
  4541. var objjs = {}
  4542. objjs.startTime = zhoD[j].time[0]
  4543. objjs.endTime = zhoD[j].time[1]
  4544. if (zhoD[j].con == null || zhoD[j].con == '') {
  4545. zhoD[j].con == '-'
  4546. }
  4547. objjs.content = zhoD[j].con
  4548. lix.push(objjs)
  4549. var zhiZhi = JSON.stringify(lix)
  4550. zhiZhi = zhiZhi.replace(/,/g,"@");
  4551. formData.append("content", zhiZhi)
  4552. formData.append("isOvertime", 0)
  4553. formData.append("professionProgress", "[]")
  4554. if (zhoD[j].groupId) {
  4555. formData.append("groupId",zhoD[j].groupId)
  4556. } else {
  4557. //解决后台groupId数组越界的问题
  4558. formData.append("groupId",0)
  4559. }
  4560. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4561. formData.append("createDate",zhoD.zhoDataTime)
  4562. if (zhoD[j].projectAuditorId) {
  4563. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4564. }
  4565. if(zhoD[j].basecostId) {
  4566. formData.append("basecostId", zhoD[j].basecostId);
  4567. } else {
  4568. formData.append("basecostId", 0);
  4569. }
  4570. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4571. formData.append('degreeId',zhoD[j].degreeId)
  4572. }else{
  4573. formData.append("degreeId", "-1");
  4574. }
  4575. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4576. formData.append('customData',zhoD[j].customData)
  4577. }else if(this.user.timeType.customDataActive){
  4578. formData.append('customData',0)
  4579. }
  4580. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4581. formData.append('customText',zhoD[j].customText)
  4582. }else if(this.user.timeType.customTextActive){
  4583. formData.append('customText','-')
  4584. }
  4585. }
  4586. }
  4587. }
  4588. } else {
  4589. for (var i in this.zhoData) {
  4590. var zhoD = this.zhoData[i]
  4591. var flgs = false
  4592. if(this.reportTimeType.type == 2) {
  4593. for(var j in zhoD) {
  4594. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4595. flgs = true
  4596. // formData.append("degreeId", "-1");
  4597. formData.append("id", '-1');
  4598. for(var s in this.projectList) {
  4599. if(j == this.projectList[s].projectName) {
  4600. formData.append("projectId", this.projectList[s].id);
  4601. }
  4602. }
  4603. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4604. formData.append("taskId", 0);
  4605. formData.append("reportTimeType", this.reportTimeType.type);
  4606. formData.append("endTime", zhoD[j].time[1]);
  4607. formData.append("startTime", zhoD[j].time[0]);
  4608. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4609. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4610. formData.append("isOvertime", 0)
  4611. formData.append("professionProgress", "[]")
  4612. if (zhoD[j].groupId) {
  4613. formData.append("groupId",zhoD[j].groupId)
  4614. }
  4615. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4616. formData.append("createDate",zhoD.zhoDataTime)
  4617. if (zhoD[j].projectAuditorId) {
  4618. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4619. }
  4620. if(zhoD[j].basecostId) {
  4621. formData.append("basecostId", zhoD[j].basecostId);
  4622. } else {
  4623. formData.append("basecostId", 0);
  4624. }
  4625. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4626. formData.append('degreeId',zhoD[j].degreeId)
  4627. }else{
  4628. formData.append("degreeId", "-1");
  4629. }
  4630. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4631. formData.append('customData',zhoD[j].customData)
  4632. }else if(this.user.timeType.customDataActive){
  4633. formData.append('customData',0)
  4634. }
  4635. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4636. formData.append('customText',zhoD[j].customText)
  4637. }else if(this.user.timeType.customTextActive){
  4638. formData.append('customText','-')
  4639. }
  4640. }
  4641. }
  4642. } else {
  4643. for(var j in zhoD) {
  4644. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].workingTime && zhoD[j].workingTime.length > 0 && zhoD[j].workingTime > 0 && zhoD[j].workingTime != null && zhoD[j].workingTime != 'null') {
  4645. flgs = true
  4646. // formData.append("degreeId", "-1");
  4647. formData.append("id", '-1');
  4648. for(var s in this.projectList) {
  4649. if(j == this.projectList[s].projectName) {
  4650. formData.append("projectId", this.projectList[s].id);
  4651. }
  4652. }
  4653. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  4654. // formData.append("subProjectId", zhoD[j].subProjectId);
  4655. formData.append("taskId", 0);
  4656. formData.append("reportTimeType", this.reportTimeType.type);
  4657. if(this.reportTimeType.type == 1) {
  4658. formData.append("workingTime", zhoD[j].workingTime);
  4659. } else if(this.reportTimeType.type == 2) {
  4660. formData.append("endTime", zhoD[j].time[1]);
  4661. formData.append("startTime", zhoD[j].time[0]);
  4662. } else if(this.reportTimeType.type == 3) {
  4663. formData.append("progress", zhoD[j].progress);
  4664. formData.append("workingTime", zhoD[j].workingTime);
  4665. }
  4666. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4667. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4668. formData.append("isOvertime", 0)
  4669. formData.append("professionProgress", "[]")
  4670. if (zhoD[j].groupId) {
  4671. formData.append("groupId",zhoD[j].groupId)
  4672. }
  4673. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4674. formData.append("createDate",zhoD.zhoDataTime)
  4675. if (zhoD[j].projectAuditorId) {
  4676. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4677. }
  4678. if(zhoD[j].basecostId) {
  4679. formData.append("basecostId", zhoD[j].basecostId);
  4680. } else {
  4681. formData.append("basecostId", 0);
  4682. }
  4683. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4684. formData.append('degreeId',zhoD[j].degreeId)
  4685. }else{
  4686. formData.append("degreeId", "-1");
  4687. }
  4688. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4689. formData.append('customData',zhoD[j].customData)
  4690. }else if(this.user.timeType.customDataActive){
  4691. formData.append('customData',0)
  4692. }
  4693. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4694. formData.append('customText',zhoD[j].customText)
  4695. }else if(this.user.timeType.customTextActive){
  4696. formData.append('customText','-')
  4697. }
  4698. }
  4699. }
  4700. }
  4701. }
  4702. }
  4703. // 自定义维度
  4704. this.submitingReport = true;
  4705. this.http.uploadFile( this.port.report.editPort, formData,
  4706. res => {
  4707. // this.listLoading = false;
  4708. this.submitingReport = false;
  4709. if (res.code == "ok") {
  4710. this.$message({
  4711. message: "填报成功",
  4712. type: "success"
  4713. });
  4714. this.diasZho = false
  4715. this.selConShow = true
  4716. this.zhoData = []
  4717. this.zhoRqi = ''
  4718. this.getReportList();
  4719. this.getDepartment();
  4720. // 关闭弹窗 并 清空
  4721. this.selProjectList = []
  4722. this.selCon = []
  4723. } else {
  4724. this.$message({
  4725. message: res.msg,
  4726. type: "error"
  4727. });
  4728. }
  4729. },
  4730. error => {
  4731. this.submitingReport = false;
  4732. this.$message({
  4733. message: error,
  4734. type: "error"
  4735. });
  4736. });
  4737. },
  4738. ChangeHourMinutestr (str) {
  4739. if (str !== "0" && str !== "" && str !== null) {
  4740. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  4741. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  4742. } else {
  4743. return "";
  4744. }
  4745. },
  4746. // 得到两个日期中间的日期
  4747. getdiffdate(stime,etime){
  4748. //初始化日期列表,数组
  4749. var diffdate = new Array();
  4750. var i=0;
  4751. //开始日期小于等于结束日期,并循环
  4752. while(stime<=etime){
  4753. diffdate[i] = stime;
  4754. //获取开始日期时间戳
  4755. var stime_ts = new Date(stime).getTime();
  4756. //增加一天时间戳后的日期
  4757. var next_date = stime_ts + (24*60*60*1000);
  4758. //拼接年月日,这里的月份会返回(0-11),所以要+1
  4759. var next_dates_y = new Date(next_date).getFullYear()+'-';
  4760. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4761. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4762. stime = next_dates_y+next_dates_m+next_dates_d;
  4763. //增加数组key
  4764. i++;
  4765. }
  4766. return diffdate;
  4767. },
  4768. // 添加模块
  4769. addDomain(i) {
  4770. var leftProgress = 10;
  4771. if (this.reportTimeType.type == 3) {
  4772. //计算已经待分配工时比例
  4773. let array = this.workForm.domains;
  4774. let totalProgress = 0;
  4775. for (var i=0;i<array.length; i++) {
  4776. totalProgress += array[i].progress;
  4777. }
  4778. if (totalProgress < 100) {
  4779. leftProgress = 100 - totalProgress;
  4780. }
  4781. }
  4782. var addItem = {
  4783. projectId: "",
  4784. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  4785. content: "",
  4786. progress:leftProgress,
  4787. state:2,//2-表示待提交
  4788. multiWorktime: this.reportTimeType.multiWorktime,
  4789. worktimeList:[{}],
  4790. canEdit: true
  4791. // degreeId: '',
  4792. };
  4793. if(this.isWeekend){
  4794. this.$set(addItem,'isOvertime',true)
  4795. if(this.reportTimeType.type == 3){
  4796. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  4797. }
  4798. }
  4799. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4800. //默认给第一个,必填字段
  4801. addItem.basecostId = this.timeBasecostList[0].id;
  4802. }
  4803. this.workForm.domains.push(addItem);
  4804. document.getElementById('workFormsItemBottom').scrollIntoView()
  4805. this.canEdit = true
  4806. if (this.reportTimeType.type == 0) {
  4807. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4808. var length = this.workForm.domains.length;
  4809. if (length == 2) {
  4810. this.showAddMore = false;
  4811. }
  4812. }
  4813. this.chuji()
  4814. },
  4815. // 移除模块
  4816. delDomain(i) {
  4817. this.workForm.domains.splice(i,1)
  4818. let iscan = false
  4819. for(let i in this.workForm.domains){
  4820. if(this.workForm.domains[i].canEdit){
  4821. iscan = true
  4822. }
  4823. }
  4824. this.canEdit = iscan
  4825. //检测当前剩下的一个,时间类型是否是全天
  4826. if (this.reportTimeType.type == 0) {
  4827. if (this.workForm.domains[0].timeType == 0) {
  4828. this.showAddMore = false;
  4829. } else {
  4830. this.showAddMore = true;
  4831. }
  4832. }
  4833. if(this.user.timeType.multiWorktime == 1) {
  4834. this.iptChangs()
  4835. } else {
  4836. this.seleChn(0)
  4837. }
  4838. },
  4839. // 改变月份
  4840. changeMonth() {
  4841. this.isWeekend = false
  4842. let date = new Date()
  4843. let nowmon = date.getMonth() + 1
  4844. let nowday = date.getDate()
  4845. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  4846. if (this.isBatch == 0) {
  4847. if(this.user.timeType.fillAhead == 0){
  4848. let date_a = new Date(this.workForm.createDate)
  4849. if(date_a.getTime() > date.getTime()){
  4850. this.workForm.createDate = nowdate
  4851. }
  4852. }
  4853. //只有按天填报才能获取当天的日报
  4854. if(!this.isSubstitude){
  4855. let weekday = new Date(this.workForm.createDate).getDay()
  4856. if(this.user.companyId == 817){
  4857. if(weekday == 0){
  4858. this.isWeekend = true
  4859. }
  4860. }else{
  4861. if(weekday == 0 || weekday == 6){
  4862. this.isWeekend = true
  4863. }
  4864. }
  4865. this.getReport()
  4866. }
  4867. }else {
  4868. if(this.user.timeType.fillAhead == 0){
  4869. let date_a = new Date(this.workForm.createDate[1])
  4870. if(date_a.getTime() > date.getTime()){
  4871. this.workForm.createDate[1] = nowdate
  4872. let sdate = new Date(this.workForm.createDate[0])
  4873. let edate = new Date(this.workForm.createDate[1])
  4874. if(sdate > edate){
  4875. this.workForm.createDate[0] = this.workForm.createDate[1]
  4876. }
  4877. }
  4878. }
  4879. }
  4880. },
  4881. // 判断时间段
  4882. fns() {
  4883. for (let k in this.dateAr) {
  4884. if (!this.judege(k)) {
  4885. return false
  4886. }
  4887. }
  4888. return true
  4889. },
  4890. judege(idx){
  4891. for (let k in this.dateAr) {
  4892. if (idx !== k) {
  4893. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  4894. return false
  4895. }
  4896. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  4897. return false
  4898. }
  4899. }
  4900. }
  4901. return true
  4902. },
  4903. // 保存日报
  4904. submitReport(isDraft) {
  4905. this.isDraft = isDraft;
  4906. this.$refs.workForm.validate(valid => {
  4907. if (valid) {
  4908. this.dateAr = []
  4909. let alp = []
  4910. if(this.user.timeType.multiWorktime != 1) {
  4911. for(var p in this.workForm.domains) {
  4912. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  4913. let objs = {}
  4914. objs.s = this.workForm.domains[p].startTime
  4915. objs.e = this.workForm.domains[p].endTime
  4916. alp.push(objs)
  4917. }
  4918. }
  4919. this.dateAr = alp
  4920. if(this.dateAr.length > 0) {
  4921. let trus = this.fns()
  4922. if(!trus) {
  4923. this.$message({
  4924. message: '填写的时间段重叠',
  4925. type: "error"
  4926. });
  4927. return
  4928. }
  4929. }
  4930. } else {
  4931. for(var p in this.workForm.domains) {
  4932. var slll = this.workForm.domains[p]
  4933. for(var o in slll.worktimeList) {
  4934. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  4935. let objs = {}
  4936. objs.s = slll.worktimeList[o].startTime
  4937. objs.e = slll.worktimeList[o].endTime
  4938. alp.push(objs)
  4939. }
  4940. }
  4941. }
  4942. this.dateAr = alp
  4943. if(this.dateAr.length > 0) {
  4944. let trus = this.fns()
  4945. if(!trus) {
  4946. this.$message({
  4947. message: '填写的时间段重叠',
  4948. type: "error"
  4949. });
  4950. return
  4951. }
  4952. }
  4953. }
  4954. // return
  4955. //代填的情况,检查人员是否已经选择
  4956. if (this.isSubstitude) {
  4957. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  4958. this.$message({
  4959. message: "请选择代填的人员",
  4960. type: "error"
  4961. });
  4962. return;
  4963. }
  4964. }
  4965. //检查时间,全天和上下午不能同时存在
  4966. if (this.reportTimeType.type == 0) {
  4967. var alldayNum = 0;
  4968. var amNum = 0;
  4969. var pmNum = 0;
  4970. for(var i in this.workForm.domains) {
  4971. if (this.workForm.domains[i].timeType == 0) {
  4972. alldayNum ++;
  4973. } else if (this.workForm.domains[i].timeType == 1) {
  4974. amNum++;
  4975. } else if (this.workForm.domains[i].timeType == 2) {
  4976. pmNum++;
  4977. }
  4978. }
  4979. if (alldayNum > 1) {
  4980. this.$message({
  4981. message: "工作时间-全天,只能选择一次",
  4982. type: "error"
  4983. });
  4984. return;
  4985. }
  4986. if (amNum > 1) {
  4987. this.$message({
  4988. message: "工作时间-上午,只能选择一次",
  4989. type: "error"
  4990. });
  4991. return;
  4992. }
  4993. if (pmNum > 1) {
  4994. this.$message({
  4995. message: "工作时间-下午,只能选择一次",
  4996. type: "error"
  4997. });
  4998. return;
  4999. }
  5000. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  5001. this.$message({
  5002. message: "工作时间-全天,不能和上下午同时存在",
  5003. type: "error"
  5004. });
  5005. return;
  5006. }
  5007. } else if (this.reportTimeType.type == 3) {
  5008. //总百分比不能超过100%
  5009. let total = 0;
  5010. this.workForm.domains.forEach(w=>{total += w.progress});
  5011. if (total > 100) {
  5012. this.$message({
  5013. message: "用时比例之和不能超过100%",
  5014. type: "error"
  5015. });
  5016. return;
  5017. } else if (total < 100) {
  5018. this.$message({
  5019. message: "工时尚未完全分配,无法提交",
  5020. type: "error"
  5021. });
  5022. return;
  5023. }
  5024. }
  5025. this.listLoading = true;
  5026. let formData = new FormData();
  5027. formData.append("draft", this.isDraft);
  5028. //检查workingTime合计
  5029. if (this.reportTimeType.type == 1 && this.workForm.time) {
  5030. var totalTime = 0;
  5031. for (var t=0;t<this.workForm.domains.length; t++) {
  5032. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  5033. }
  5034. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  5035. this.$message({
  5036. message: "填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.workForm.time.workHours.toFixed(1)+"h)",
  5037. type: "error"
  5038. });
  5039. return;
  5040. }
  5041. }
  5042. for(var i in this.workForm.domains) {
  5043. if(this.workForm.domains[i].degreeId) {
  5044. // var sss = this.workForm.domains[i].degreeId.toString()
  5045. formData.append("degreeId", this.workForm.domains[i].degreeId);
  5046. } else {
  5047. formData.append("degreeId", -1);
  5048. }
  5049. if(this.workForm.domains[i].customData) {
  5050. // var sss = this.workForm.domains[i].degreeId.toString()
  5051. formData.append("customData", this.workForm.domains[i].customData);
  5052. } else {
  5053. formData.append("customData", 0);
  5054. }
  5055. if(this.workForm.domains[i].customText) {
  5056. formData.append("customText", this.workForm.domains[i].customText);
  5057. } else {
  5058. formData.append("customText", '-');
  5059. }
  5060. if (this.workForm.domains[i].id) {
  5061. formData.append("id", this.workForm.domains[i].id);
  5062. } else {
  5063. formData.append("id", -1);
  5064. }
  5065. formData.append("projectId", this.workForm.domains[i].projectId);
  5066. if (this.workForm.domains[i].subProjectId) {
  5067. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  5068. } else {
  5069. formData.append("subProjectId", 0);
  5070. }
  5071. if (this.workForm.domains[i].groupId) {
  5072. formData.append("groupId", this.workForm.domains[i].groupId);
  5073. } else {
  5074. formData.append("groupId", 0);
  5075. }
  5076. if (this.workForm.domains[i].taskId) {
  5077. formData.append("taskId", this.workForm.domains[i].taskId);
  5078. } else {
  5079. formData.append("taskId", 0);
  5080. }
  5081. if (this.workForm.domains[i].taskFinish == true) {
  5082. formData.append("taskFinish", 1);
  5083. } else {
  5084. formData.append("taskFinish", 0);
  5085. }
  5086. formData.append("reportTimeType", this.reportTimeType.type);
  5087. if (this.reportTimeType.type == 0) {
  5088. formData.append("timeType", this.workForm.domains[i].timeType);
  5089. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  5090. formData.append("workingTime", workingTime);
  5091. } else if (this.reportTimeType.type == 1){
  5092. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5093. } else if (this.reportTimeType.type == 2) {
  5094. formData.append("endTime", this.workForm.domains[i].endTime);
  5095. formData.append("startTime", this.workForm.domains[i].startTime);
  5096. } else if (this.reportTimeType.type == 3) {
  5097. //按比例分配
  5098. formData.append("progress", this.workForm.domains[i].progress);
  5099. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5100. }
  5101. //处理多个时间事项
  5102. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  5103. if (this.reportTimeType.multiWorktime == 1) {
  5104. //检查时间是否有重叠
  5105. var workList = this.workForm.domains[i].worktimeList;
  5106. for (var j=0;j<workList.length; j++) {
  5107. var curItem = workList[j];
  5108. //检查开始时间是否大于结束时间
  5109. if (curItem.startTime >= curItem.endTime) {
  5110. this.$message({
  5111. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
  5112. "结束时间必须大于开始时间",
  5113. type: "error"
  5114. });
  5115. return;
  5116. }
  5117. for (var p = j+1;p<workList.length; p++) {
  5118. var jItem = workList[p];
  5119. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  5120. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  5121. this.$message({
  5122. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
  5123. jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。",
  5124. type: "error"
  5125. });
  5126. return;
  5127. }
  5128. }
  5129. }
  5130. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  5131. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5132. formData.append("content", m);
  5133. } else {
  5134. if (this.workForm.domains[i].content) {
  5135. formData.append("content", this.workForm.domains[i].content);
  5136. } else {
  5137. formData.append("content", '-');
  5138. }
  5139. }
  5140. if (this.isBatch == 0) {
  5141. formData.append("createDate", this.workForm.createDate);
  5142. } else {
  5143. //批量填报,时间范围
  5144. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  5145. }
  5146. if(this.workForm.domains[i].isOvertime) {
  5147. formData.append("isOvertime", 1);
  5148. } else {
  5149. formData.append("isOvertime", 0);
  5150. }
  5151. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  5152. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  5153. } else {
  5154. formData.append("overtimeHours", 0);
  5155. }
  5156. if(this.workForm.domains[i].basecostId) {
  5157. formData.append("basecostId", this.workForm.domains[i].basecostId);
  5158. } else {
  5159. formData.append("basecostId", 0);
  5160. }
  5161. if (this.workForm.userId != null) {
  5162. var targetUids = '';
  5163. this.workForm.userId.forEach(u=>{
  5164. targetUids += u + '@';
  5165. });
  5166. if (targetUids.length > 0) {
  5167. targetUids = targetUids.substring(0, targetUids.length -1);
  5168. formData.append("targetUids", targetUids);
  5169. }
  5170. }
  5171. //项目专业进度
  5172. if (this.workForm.domains[i].professionProgress) {
  5173. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  5174. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5175. formData.append("professionProgress", m);
  5176. } else {
  5177. formData.append("professionProgress", "[]");
  5178. }
  5179. if (this.workForm.domains[i].stage) {
  5180. formData.append("stage", this.workForm.domains[i].stage);
  5181. } else {
  5182. formData.append("stage", "-");
  5183. }
  5184. if (this.workForm.domains[i].projectAuditorId) {
  5185. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  5186. } else {
  5187. if (this.user.timeType.reportAuditType == 0) {
  5188. this.$message({
  5189. message: "请指定项目审核人",
  5190. type: "error"
  5191. });
  5192. } else {
  5193. //分组负责人先审核, 确定是选择了任务分组
  5194. if (this.workForm.domains[i].taskGroups.length == 0) {
  5195. this.$message({
  5196. message: "您在["+this.workForm.domains[i].projectName+"]项目上尚无参与的任务分组",
  5197. type: "error"
  5198. });
  5199. } else if (!this.workForm.domains[i].groupId) {
  5200. // console.log(this.workForm.domains[i]);
  5201. this.$message({
  5202. message: "请选择["+this.workForm.domains[i].projectName+"]项目的任务分组",
  5203. type: "error"
  5204. });
  5205. } else {
  5206. this.$message({
  5207. message: "请设置["+this.workForm.domains[i].projectName+"]项目的分组负责人",
  5208. type: "error"
  5209. });
  5210. }
  5211. }
  5212. return;
  5213. }
  5214. }
  5215. this.submitingReport = true;
  5216. this.http.uploadFile( this.port.report.editPort, formData,
  5217. res => {
  5218. this.listLoading = false;
  5219. this.submitingReport = false;
  5220. if (res.code == "ok") {
  5221. this.$message({
  5222. message: this.isDraft==0?"提交成功":"暂存成功",
  5223. type: "success"
  5224. });
  5225. this.dialogVisible = false;
  5226. this.jsDay = 0
  5227. this.jsTime = 0
  5228. this.getReportList();
  5229. this.getDepartment();
  5230. } else {
  5231. this.$message({
  5232. message: (this.isDraft==0?'提交失败:':'暂存失败:')+res.msg,
  5233. type: "error"
  5234. });
  5235. }
  5236. },
  5237. error => {
  5238. this.listLoading = false;
  5239. this.submitingReport = false;
  5240. this.$message({
  5241. message: error,
  5242. type: "error"
  5243. });
  5244. });
  5245. }
  5246. });
  5247. },
  5248. cli() {
  5249. },
  5250. // 判断是展示那个工时导入
  5251. imports() {
  5252. if(this.user.timeType.syncCorpwxTime == 0) {
  5253. this.importDialog = true
  5254. } else {
  5255. this.importWxDialog = true
  5256. }
  5257. },
  5258. // 跳转
  5259. junpToDeskTop(id) {
  5260. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5261. this.$router.push("/desktop/" + id + "/" + this.date +day);
  5262. },
  5263. // 通过日报
  5264. approve(id, item) {
  5265. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5266. this.approveinData = {
  5267. id: id,
  5268. date: this.date +day,
  5269. reportIds: item.id
  5270. }
  5271. if(this.user.timeType.needEvaluate == 1){
  5272. this.$set(this.approveinData,'evaluate','')
  5273. this.approveinDialog = true
  5274. }else{
  5275. this.logining = true;
  5276. this.approveinfun()
  5277. }
  5278. },
  5279. approveinfun(){
  5280. this.http.post( this.port.report.approve, this.approveinData,
  5281. res => {
  5282. this.logining = false;
  5283. if (res.code == "ok") {
  5284. this.approveinDialog = false
  5285. this.$message({
  5286. message: "审核成功",
  5287. type: "success"
  5288. });
  5289. this.getReportList();
  5290. this.getDepartment();
  5291. } else {
  5292. this.$message({
  5293. message: res.msg,
  5294. type: "error"
  5295. });
  5296. }
  5297. },
  5298. error => {
  5299. this.logining = false;
  5300. this.$message({
  5301. message: error,
  5302. type: "error"
  5303. });
  5304. });
  5305. },
  5306. //撤回日报
  5307. cancel(item,e) {
  5308. console.log('can can need',item);
  5309. this.logining = true;
  5310. var ids = '';
  5311. var data = e ? item : item.data;
  5312. data.forEach(element => {
  5313. if(element.id){
  5314. ids +=(element.id+',');
  5315. }
  5316. });
  5317. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  5318. res => {
  5319. this.logining = false;
  5320. if (res.code == "ok") {
  5321. this.$message({
  5322. message:"撤回成功",
  5323. type: "success"
  5324. });
  5325. this.getReportList();
  5326. if(e){this.getReport()}
  5327. this.getDepartment();
  5328. } else {
  5329. this.$message({
  5330. message: res.msg,
  5331. type: "error"
  5332. });
  5333. }
  5334. },
  5335. error => {
  5336. this.logining = false;
  5337. this.$message({
  5338. message: error,
  5339. type: "error"
  5340. });
  5341. });
  5342. },
  5343. showDenyDialog(id,i, item) {
  5344. this.denyReasonDialog = true;
  5345. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5346. var ids = item.id;
  5347. // var data = item.data;
  5348. // data.forEach(element => {
  5349. // ids +=(element.id+',');
  5350. // });
  5351. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  5352. },
  5353. // 未通过日报
  5354. deny() {
  5355. this.logining = true;
  5356. this.http.post( this.port.report.deny, this.denyForm,
  5357. res => {
  5358. this.logining = false;
  5359. if (res.code == "ok") {
  5360. this.$message({
  5361. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  5362. type: "success"
  5363. });
  5364. this.getReportList();
  5365. this.getDepartment();
  5366. this.denyReasonDialog = false;
  5367. } else {
  5368. this.$message({
  5369. message: res.msg,
  5370. type: "error"
  5371. });
  5372. }
  5373. },
  5374. error => {
  5375. this.logining = false;
  5376. this.$message({
  5377. message: error,
  5378. type: "error"
  5379. });
  5380. });
  5381. },
  5382. // 查看工时记录弹窗
  5383. toView() {
  5384. this.toViewDialogVisible = true
  5385. this.toViewloading = true
  5386. this.getToView()
  5387. },
  5388. getToView() {
  5389. this.http.post( '/report-import-log/getList', this.toViewForm,
  5390. res => {
  5391. this.toViewloading = false;
  5392. if (res.code == "ok") {
  5393. // console.log(res.data, '数据数据')
  5394. this.toViewList = res.data.records
  5395. this.toViewForm.total = res.data.total
  5396. } else {
  5397. this.toViewloading = false;
  5398. this.$message({
  5399. message: res.msg,
  5400. type: "error"
  5401. });
  5402. }
  5403. })
  5404. },
  5405. //分页
  5406. handleCurrentChange(val) {
  5407. this.toViewForm.pageIndex = val;
  5408. this.getToView();
  5409. },
  5410. handleSizeChange(val) {
  5411. this.toViewForm.pageSize = val;
  5412. this.getToView();
  5413. },
  5414. },
  5415. created() {
  5416. let height = window.innerHeight;
  5417. this.tableHeight = height - 178;
  5418. const that = this;
  5419. window.onresize = function temp() {
  5420. that.tableHeight = window.innerHeight - 178;
  5421. };
  5422. this.toViewForm.companyId = this.user.companyId
  5423. this.initDrag([{
  5424. type: "LR",
  5425. domClass: {
  5426. // 中间分割线的名字
  5427. resize: "line-line",
  5428. // 左侧盒子的名字
  5429. left: "box-left",
  5430. // 右侧盒子的名字
  5431. right: "box-right",
  5432. // 父级的名字
  5433. box: "box-father",
  5434. },
  5435. otherInfo: {
  5436. // 限制左边栏最低宽度
  5437. leftWidth: 120,
  5438. },
  5439. },
  5440. {
  5441. type: "LR",
  5442. domClass: {
  5443. // 中间分割线的名字
  5444. resize: "line-second",
  5445. // 左侧盒子的名字
  5446. left: "left-laowang",
  5447. // 右侧盒子的名字
  5448. right: "box-second-father",
  5449. // 父级的名字
  5450. box: "grand",
  5451. },
  5452. otherInfo: {
  5453. // 限制左边栏最低宽度
  5454. leftWidth: 120,
  5455. },
  5456. },
  5457. ]);
  5458. },
  5459. mounted() {
  5460. var now = new Date();
  5461. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  5462. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  5463. this.exportParam.dateRange = [startStr,t];
  5464. this.getAllDate(1);
  5465. this.getReportList();
  5466. this.getProjectList();
  5467. this.getFillProjectList();
  5468. this.getTimeType();
  5469. this.getDepartment();
  5470. this.scrollFunction()
  5471. this.userssHu();
  5472. if (this.user.company.packageProject == 1) {
  5473. this.getBasecostItemList();
  5474. }
  5475. if(this.user.timeType.lockWorktime){
  5476. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  5477. }
  5478. }
  5479. };
  5480. </script>
  5481. <style lang="scss" scoped>
  5482. .paginatis {
  5483. padding: 10px 10px;
  5484. background: #f2f2f2;
  5485. }
  5486. .waiting {
  5487. color:orange;
  5488. }
  5489. .filledReportStyle {
  5490. color:#32CD32;
  5491. }
  5492. .RejectStyle {
  5493. color:red;
  5494. }
  5495. .waitSubmitStyle{
  5496. color: #409eff;
  5497. }
  5498. .chooseDate {
  5499. .waiting {
  5500. color: #20a0ff;
  5501. }
  5502. .filledReportStyle {
  5503. color:#20a0ff;
  5504. }
  5505. .RejectStyle {
  5506. color: #20a0ff;
  5507. }
  5508. .waitSubmitStyle{
  5509. color: #20a0ff;
  5510. }
  5511. }
  5512. .allDaily {
  5513. width:100%;
  5514. }
  5515. .report_title {
  5516. padding:10px 0;
  5517. color:#666;
  5518. }
  5519. .clearfix {
  5520. overflow-x: auto;
  5521. white-space: nowrap;
  5522. padding: 15px 0 10px 0;
  5523. // overflow-y: hidden;
  5524. .date_item {
  5525. padding: 0 3px;
  5526. cursor: pointer;
  5527. position: relative;
  5528. }
  5529. .chooseDate {
  5530. position: absolute;
  5531. bottom: -3px;
  5532. width: 34px;
  5533. height: 2px;
  5534. left: 12px;
  5535. background: #20a0ff;
  5536. }
  5537. }
  5538. .one_daily {
  5539. i {
  5540. color: #9ed0ff;
  5541. margin-right: 5px;
  5542. }
  5543. .one_daily_body {
  5544. padding: 10px 0px;
  5545. p {
  5546. margin: 0;
  5547. line-height: 30px;
  5548. }
  5549. }
  5550. ul {
  5551. padding: 0;
  5552. }
  5553. }
  5554. .checkbtn {
  5555. float: right;
  5556. margin-top: -10px;
  5557. }
  5558. .selConStyle{
  5559. margin-top:9rem;
  5560. margin-bottom:11rem;
  5561. .selConStyle_title{
  5562. height: 3rem;
  5563. text-align: center;
  5564. font-size: 17px;
  5565. }
  5566. .el-select{
  5567. margin: 0 15%;
  5568. width: 70%;
  5569. }
  5570. }
  5571. </style>
  5572. <style lang="scss">
  5573. .daily {
  5574. .el-card__body {
  5575. height: 80%;
  5576. overflow-y: auto;
  5577. }
  5578. .el-card__header {
  5579. padding: 0 20px;
  5580. }
  5581. }
  5582. .membListClass{
  5583. .el-dialog__body{
  5584. padding-top: 10px;
  5585. }
  5586. }
  5587. .editReportDialog .el-dialog__footer{
  5588. position: sticky;
  5589. bottom: 0;
  5590. background: #fff;
  5591. height: 70px;
  5592. z-index: 1010;
  5593. }
  5594. .touruxiangmu{
  5595. max-width: 1000px;
  5596. }
  5597. </style>
  5598. <style scoped>
  5599. /* 项目标签的样式 */
  5600. .el-tag + .el-tag {
  5601. margin-left: 10px;
  5602. }
  5603. .button-new-tag {
  5604. margin-left: 10px;
  5605. height: 32px;
  5606. line-height: 30px;
  5607. padding-top: 0;
  5608. padding-bottom: 0;
  5609. }
  5610. .input-new-tag {
  5611. width: 90px;
  5612. margin-left: 10px;
  5613. vertical-align: bottom;
  5614. }
  5615. .selectworktime .el-table__fixed-body-wrapper{
  5616. top: 48px !important;
  5617. }
  5618. .selectworktime_export .selectworktime_export_l{
  5619. width: 65%;
  5620. float: left;
  5621. height: 42px;
  5622. }
  5623. .approvalProcessBox{
  5624. margin-left: 30px;
  5625. font-size: 14px;
  5626. line-height: 16px;
  5627. cursor: pointer;
  5628. }
  5629. .approvalProcessBox i {
  5630. margin-right: 0;
  5631. height: 16px;
  5632. width: 16px;
  5633. display: inline-block;
  5634. transform: scale(1.2);
  5635. position: relative;
  5636. top: 0.5px;
  5637. color: #409eff;
  5638. }
  5639. .approvalProcessBox .approvalProcessClick{
  5640. cursor: pointer;
  5641. color: #409eff;
  5642. font-size: 14px;
  5643. }
  5644. .approvalProcessBox:hover .approvalProcessClick{
  5645. color: #3485fb;
  5646. }
  5647. </style>
  5648. <style lang="scss" scoped>
  5649. // 加班样式
  5650. .overtime {
  5651. display: inline-block;
  5652. margin-left: 20px;
  5653. input {
  5654. display: inline-block;
  5655. margin-top: 5px;
  5656. }
  5657. }
  5658. .plus {
  5659. display: inline-block;
  5660. }
  5661. // .tages {
  5662. // float: right;
  5663. // }
  5664. .overtime {
  5665. display: inline-block;
  5666. margin-left: 30px;
  5667. }
  5668. .bloks {
  5669. display: inline-block;
  5670. width: 380px;
  5671. }
  5672. .zhiss {
  5673. display: flex;
  5674. justify-content: space-around;
  5675. align-items: center;
  5676. }
  5677. .zhoFel {
  5678. display: flex;
  5679. justify-content: space-between;
  5680. align-items: center;
  5681. }
  5682. // 左右滑动样式
  5683. .line {
  5684. width: 30px;
  5685. /* height: 500px; */
  5686. background: #f2f2f2;
  5687. cursor: w-resize;
  5688. }
  5689. .box-father {
  5690. border: 8px solid #000;
  5691. }
  5692. .line-second {
  5693. width: 10px;
  5694. /* background: red; */
  5695. }
  5696. .flex {
  5697. display: flex;
  5698. width: 100%;
  5699. }
  5700. .box-left {
  5701. flex: 0 0 400px;
  5702. /* height: 600px; */
  5703. /* background: blue; */
  5704. }
  5705. .box-right {
  5706. /* height: 600px; */
  5707. /* background: green; */
  5708. flex: 1;
  5709. }
  5710. .box-postion {
  5711. width: 200px;
  5712. /* height: 400px; */
  5713. background: #ccc;
  5714. }
  5715. .custom-tree-node {
  5716. flex: 1;
  5717. display: flex;
  5718. align-items: center;
  5719. justify-content: space-between;
  5720. font-size: 14px;
  5721. padding-right: 8px;
  5722. }
  5723. </style>