daily.vue 270 KB

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