daily.vue 306 KB

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