12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258 |
- <template>
- <section v-loading="zhoLoading">
- <!--列表-->
- <div>
- <el-card class="box-card daily" shadow="never">
- <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
- <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;"> -->
- <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;">
- <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
- style="width:190px;"
- @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
- <!-- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="tiaoshi"></el-button> -->
- </div>
- <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
- <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
- <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
- style="width:190px;"
- @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
- </div> -->
- <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
- @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 46px;text-align: center;' + (canClick(index,item) == false ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
- <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
- <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
- <br>
- <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
- <span class="chooseDate" v-if="index == choseDay"></span>
- <!-- <i v-if="item.state != null" class="iconfont firerock-icondot" :class="statusStyle[item.state]" style="position:absolute;top:-1px;right:-18px"></i> -->
- </div>
- </div>
- </span>
- </div>
- </div>
- <div style="display:flex;">
- <div v-if="permissions.reportsCompany || user.manageDeptId != 0" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
- <div style="width:205px;">
- <el-select v-model="selectState" size="small" @change="stateChange" >
- <el-option value="-1" label="全部状态" >全部状态</el-option>
- <el-option value="-2" label="未填报">未填报</el-option>
- <el-option value="1" label="已通过">已通过</el-option>
- <el-option value="0" label="待审核">待审核</el-option>
- <el-option value="2" label="不通过">不通过</el-option>
- <el-option value="3" label="待提交">待提交</el-option>
- </el-select></div>
- <div>
- <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate">
- <span class="custom-tree-node" slot-scope="{ node, data}">
- <span>{{ node.label }}</span>
- <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
- <div style="width:0%;float:right;">
- <span v-if="data.isUser == 1 && data.state == null" style="color:red;">
- 未填报
- </span>
- <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;">
- 待审核
- </span>
- <span v-if="data.isUser == 1 && data.state == 1" style="color:green;">
- 已通过
- </span>
- <span v-if="data.isUser == 1 && data.state == 2" style="color:red;">
- 未通过
- </span>
- <span v-if="data.isUser == 1 && data.state == 3" style="color:red;">
- 待提交
- </span>
- </div>
- </span>
- </el-tree>
- </div>
- </div>
-
- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
- <div class="allDaily" style="float:left;flex-grow:1">
- <!--系统管理员和部门负责人 -->
- <div class="report_title" >
-
- <span>工作日报 </span>
- <span v-if="permissions.reportsCompany||user.manageDeptId != 0">| {{depData != null ?depData.label:""}}
- <span v-if="targetUid == null">
- - 已填写
- <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
- 未填写<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>人
- </span>
- </span>
- <span style="float:right;">
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
- <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
- <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
- <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">工时导入</el-link>
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog">导出日报</el-link>
- <!--部门负责人给个导出工时的功能 -->
- <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">导出工时统计</el-link>
- </span>
- </div>
- <!--普通员工,含项目经理 -->
- <!-- <div class="report_title" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0"><span>日报列表</span>
- <span style="float:right;" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0">
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
- <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
- <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
- </span> -->
- <!-- </div> -->
- <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
- <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
- <i class="fa fa-circle"></i>{{item1.name}}
- <span style="margin-left:30px;">
- <span style="margin-right:20px;">
- <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
- 工作总时长:
- <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
- <span >{{item1.reportTime}}</span>h
- </span>
- </span>
- <div class="checkbtn" style="padding-right:20px;">
- <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">编辑日报</el-button>
- <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">删除</el-button>
- </div>
- <div class="one_daily_body">
- <el-timeline>
- <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
- <el-card shadow="never">
- <p>项目:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
-
- <span v-if="user.company.packageEngineering == 0">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
- <span v-if="item2.isDeptAudit==0">
- <span v-if="item2.projectAuditState==0">
- 待项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核
- </span>
- <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
- 项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核通过
- </span>
- </span>
- <span v-else-if="item2.isDeptAudit==1">
- {{('待'+item2.auditDeptName+'审核')}}
- </span>
- ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ 导入待审核 ]</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
- </span>
- <!-- <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> -->
- <span v-if="user.company.packageEngineering == 1">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ 导入待审核 ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ 待专业审核 ]</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ 待部门审核 ]</span>
- <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>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
- </span>
- <!--每个项目上单独审核 -->
- <span style="float:right;">
- <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
- size="small" @click="approve(item1.id, item2)">通过</el-button>
- <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
- size="small" @click="showDenyDialog(item1.id,0, item2)">驳回</el-button>
- <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
- @click="showDenyDialog(item1.id,1, item2)">撤销</el-button>
- <!--自己可以撤回待审核状态的报告 -->
- <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>
- </span>
- </p>
- <!--任务分组和阶段 -->
- <p v-if="item2.groupId != 0">任务分组:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">投入阶段:{{item2.stage}}</span></p>
- <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
- <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
- <!-- 自定义日报文本 -->
- <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
- <p v-if="user.company.packageEngineering == 1">
- 专业进度:
- <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
- <el-tooltip v-if="progressItem.auditState == 0" content="待审核" effect="light" placement="top">
- <i class="iconfont firerock-icondaibandengdaishenhe"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 1" content="已通过" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhetongguo"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 2" content="不通过" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhebohui"></i>
- </el-tooltip>
- </span>
- </p>
- <p v-if="item2.taskId != null">任务:{{item2.taskName}}
- </p>
- <div v-if="item2.multiWorktime==0">
- <p style="display: inline-block;">时长:
- <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
- {{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>
- <p>事项:<span v-html="item2.content"></span></p>
- </div>
- <div v-if="item2.multiWorktime==1" >
- <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>
- <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
- <p style="display: inline-block;">时长:
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
- {{timeItem.time.toFixed(1)}}h
- </p>
- <p>事项:<span v-html="timeItem.content"></span></p>
- </div>
- </div>
- <!--照片的显示 -->
- <p v-if="item2.pics != null && item2.pics.length > 0">
- <el-image v-for="(pic, index) in item2.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="item2.pics">
- </el-image>
- </p>
- </el-card>
- </el-timeline-item>
- </el-timeline>
- </div>
- </div>
- <!-- 简陋的无报告提示 -->
- <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}暂无报告</div>
- </div>
- </div>
- </div>
- </el-card>
- </div>
- <!-- 填写日报的dialog -->
- <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
- <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
- <el-form-item label="选择人员" v-if="isSubstitude">
- <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
- placeholder="请选择代填人员" ></el-input>
- </el-form-item>
- <el-form-item label="工作日期" prop="createDate">
- <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
- @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
- <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
- <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
- <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
- <el-input-number :disabled="!canEdit || user.timeType.lockWorktime" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
- v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
- <span v-if="reportTimeType.type == 3">小时</span>
- <span v-if="workForm.time">考勤打卡: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}小时</span>
- <span v-if="user.timeType.syncDingding==1&&!workForm.time">暂无考勤记录</span>
-
- </el-form-item>
-
- <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
- <div v-if="reportTimeType.multiWorktime==0">
- <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
- <el-select v-model="domain.timeType" style="width:200px;"
- v-if="reportTimeType.type == 0"
- placeholder="请选择工作时长"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- @change="onTimeTypeChange(domain.timeType)">
- <el-option
- v-for="item in timeType"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <!-- 数字时长选择 -->
- <el-select v-model="domain.workingTime" style="width:200px;"
- v-if="reportTimeType.type == 1"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- :placeholder="'请选择工作时长' + domain.workingTime"
- @change="seleChn(0,domain)">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- <span v-if="reportTimeType.type == 1">小时</span>
- <span v-if="reportTimeType.type == 2">
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.startTime"
- placeholder="起始时间"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30'
- }"
- @change="iptChang()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="domain.endTime"
- placeholder="结束时间"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '08:00',
- end: '23:30',
- minTime: domain.startTime
- }"
- @change="iptChang()">
- </el-time-picker>
- </span>
- <div class="overtime" v-if="user.timeType.fillOvertime">
- <el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">含加班</el-checkbox>
- <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>
- </div>
- </el-form-item>
-
- <el-form-item :label="user.companyId==781?'工作任务':'投入项目'" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: user.companyId==781?'请选择工作任务':'请选择投入项目', trigger: ['change','blur'] }">
- <el-select v-model="domain.projectId" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" style="width:200px;" clearable="true" filterable="true"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
- <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- style="margin-left:45px;">子项目</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
- v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
-
- <el-link v-if="index >= 1&&canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <el-form-item :label="user.companyId==781?'描述':'项目描述'" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
- <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item label="预算来源" v-if="timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!canEdit" @change="$forceUpdate()">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <!-- 项目的阶段 -->
- <span v-if="domain.stages != null && domain.stages.length> 0"
- style="margin-left:30px;">投入阶段</span>
- <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="user.companyId==781?'审核人':'项目审核人'">
- <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!-- 相关维度/自定义维度 -->
- <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList != [] ? { required: true, message: '请选择' + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
- <el-select v-model="domain.degreeId" clearable placeholder="请选择" :disabled="!canEdit">
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <el-input-number :id="'numberData_'+index" :disabled="!canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="25" show-word-limit></el-input>
- </el-form-item>
- <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
- <div style="width:300px;">
- <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>
- <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
- </div>
- <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox>
- <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>
- </div>
- </el-form-item>
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / 进度:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <el-form-item label="任务/里程碑" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
- <el-select v-model="domain.taskId" placeholder="请选择" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">已完成</el-checkbox>
- </el-form-item>
- <el-form-item :label="user.companyId==781?'具体内容与结果':'工作事项'" :prop="'domains.' + index + '.content'" >
- <el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请填写" clearable
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
- </el-form-item>
- </div>
- <!--多个工作事项填报的情况 -->
- <div v-if="reportTimeType.multiWorktime==1">
- <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
- :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
- <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true" filterable="true"
- @change="selectProject(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
- </el-option>
- </el-select>
- <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- style="margin-left:45px;">子项目</span>
- <!--子项目 -->
- <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
- v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
- <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <el-link v-if="index >= 1&&canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
- </el-link>
- <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">含加班</el-checkbox>
- <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>
- </div>
-
- <!-- <el-link type="primary" v-if="canEdit"
- :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
- </el-form-item>
- <el-form-item :label="user.companyId==781?'描述':'项目描述'" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
- <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
- </el-form-item>
- <!--如果设置了工时成本预警的预算成本项-->
- <el-form-item label="预算来源" v-if="timeBasecostList &&timeBasecostList.length>0">
- <el-select v-model="domain.basecostId" :disabled="!canEdit" @change="$forceUpdate()">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
- <!-- 任务分组 -->
- <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
- <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <!-- 项目的阶段 -->
- <span v-if="domain.stages != null && domain.stages.length> 0"
- style="margin-left:30px;">投入阶段</span>
- <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
- clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
- @change="changeStages(domain, index)"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="项目审核人" >
- <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
- <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!--工程专业版本模式下, 各个专业的进度填报 -->
- <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
- <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
- <span>{{item.professionName}}</span> / 进度:
- <el-input size="mini" style="width:60px;" v-model="item.progress"
- @keyup.native="onProgressChange"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
- </span>
- </el-form-item>
- <!-- 相关维度 -->
- <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'">
- <el-select v-model="domain.degreeId" clearable placeholder="请选择">
- <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <!-- 相关数值 -->
- <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">
- <el-input-number :id="'numberData_'+index" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
- </el-form-item>
- <!-- 自定义文本 -->
- <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">
- <el-input :disabled="!canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" maxlength="25" show-word-limit></el-input>
- </el-form-item>
- <!--项目管理专业版模式下,项目下的近期执行的任务 -->
- <el-form-item label="任务/里程碑" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
- <el-select v-model="domain.taskId" placeholder="请选择" style="width:75%;margin-right:7%" filterable="true"
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
- <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
- </el-select>
- <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">已完成</el-checkbox>
- </el-form-item>
- <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
- <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>
- <el-form-item label="工作时间" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
- :rules="{ required: true, message: '请选择工作时间', trigger: 'blur' }">
-
- <span v-if="reportTimeType.type == 2">
- <!-- <span> -->
- <!--时间范围选择 -->
- <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.startTime"
- placeholder="起始时间"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- }"
- @change="iptChangs()">
- </el-time-picker> - <el-time-picker
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- v-model="timeItem.endTime"
- placeholder="结束时间"
- style="width:120px;"
- format="HH:mm"
- value-format="HH:mm"
- :picker-options="{
- start: '00:00',
- end: '23:59',
- minTime: timeItem.startTime
- }"
- @change="iptChangs()">
- </el-time-picker>
- </span>
- </el-form-item>
- <el-form-item label="工作事项" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
- :rules="{ required: true, message: '填写工作事项', trigger: 'blur' }">
- <el-input v-model="timeItem.content" type="textarea" :rows="2" placeholder="请填写工作事项" clearable
- :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
- ></el-input>
- </el-form-item>
- </div>
- <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">添加工时</el-link>
- </div>
- <!--照片的显示 -->
- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
- <el-image v-for="(pic, index) in domain.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="domain.pics">
- </el-image>
- </p>
- <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
- </div>
- <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <!-- <el-button @click="cancelReport" v-if="workForm.domains[0].id != null && workForm.domains[0].state == 0">撤回</el-button> -->
- <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit">删除</el-button>
- <el-button @click="dialogVisible = false">取消</el-button>
- <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
- <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
- :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报 -->
- <el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
- <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
- <el-form-item label="工作日期" prop="createDate">
- <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>
- <el-button @click="handleGetPrevWeek()">上周</el-button>
- <el-button @click="getCurrentWeek()">本周</el-button>
- <el-button @click="handleGetNextvWeek()">下周</el-button>
- <el-button @click="newDates()">新增日期</el-button>
- </el-form-item>
- <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
- <el-table-column fixed="left" prop="zhoDataTime" label="日期" width="160">
- <template slot-scope="scope">
- {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData}})
- </template>
- </el-table-column>
- <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
- <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" width="200">
- <template slot-scope="scope">
- <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
- <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>
- <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>
- <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>
- <el-button v-else type="text" >请填写</el-button>
- </div>
- <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
- <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>
- <el-button v-else type="text" >请填写</el-button>
- </div>
- </template>
- </el-table-column>
- <el-table-column fixed="right" prop="he" label="合计(h)" width="120">
- <template slot-scope="scope">
- <div class="zhiss">
- <p>{{scope.row.he}}</p>
- <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-form>
- <!-- 按周填报项目筛选 -->
- <div v-if="selConShow" class="selConStyle">
- <div class="selConStyle_title">请选择要填报的项目</div>
- <el-select v-model="selCon" multiple placeholder="请选择" filterable>
- <el-option
- v-for="item in fillProjectList"
- :disabled="item.status>=2"
- :key="item.id"
- :label="item.projectName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer" v-if="selConShow">
- <el-button @click="selListqx()">取 消</el-button>
- <el-button type="primary" @click="selListFun()">下一步</el-button>
- <!-- :loading="submitingReport" -->
- </span>
- <span slot="footer" class="dialog-footer" v-if="!selConShow">
- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">选择项目</el-button>
- <el-button @click="zhoAddqx()">取 消</el-button>
- <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">提 交</el-button>
- </span>
- </el-dialog>
- <!-- 选择时间 -->
- <el-dialog title="时间选择" :visible.sync="btnZho" width="30%" :before-close="handleClose">
- <span>这是一段信息</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="btnZho = false">取 消</el-button>
- <el-button type="primary" @click="btnZho = false">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 按周填报弹窗 -->
- <el-dialog title="请填写" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
- <div>
- <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0">
- <p>子项目</p>
- <el-select v-model="zhoBao.subProjectId" placeholder="请选择" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <!--如果设置了工时成本预警的预算成本项-->
- <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
- <p>预算来源</p>
- <el-select v-model="zhoBao.basecostId" style="width: 355px">
- <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
- </el-select>
- </div>
- <!-- 任务分组 -->
- <div class="zhoFel" v-if="user.company.packageProject == 1">
- <p>任务分组</p>
- <el-select v-model="zhoBao.groupId" placeholder="请选择任务分组" clearable="true" style="width: 355px"
- @change="getGroupStages(zhoBao, 0)">
- <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
- <p>投入阶段</p>
- <el-select v-model="zhoBao.stage" placeholder="请选择" style="width: 355px" clearable="true" >
- <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="zhoBao.auditUserList != null && zhoBao.auditUserList.length > 0">
- <p>审核人</p>
- <el-select v-model="zhoBao.projectAuditorId" placeholder="请选择" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
- </el-select>
- </div>
- <!-- 自定义维度 -->
- <div class="zhoFel" v-if="user.timeType.customDegreeActive">
- <p>{{user.timeType.customDegreeName}}</p>
- <el-select v-model="zhoBao.degreeId" placeholder="请选择" clearable="true" style="width: 355px">
- <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
-
- </div>
- <!-- 自定义数值 -->
- <div class="zhoFel" v-if="user.timeType.customDataActive">
- <p>{{user.timeType.customDataName}}</p>
- <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>
- </div>
- <!-- 自定义文本 -->
- <div class="zhoFel" v-if="user.timeType.customTextActive">
- <p>{{user.timeType.customTextName}}</p>
- <el-input :disabled="!canEdit" v-model="zhoBao.customText" style="width:355px;" maxlength="25" show-word-limit></el-input>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 2">
- <p>选择时间</p>
- <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>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 1">
- <p>选择时长</p>
- <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" placeholder="请选择工作时长">
- <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
- </el-select>
- </div>
- <div class="zhoFel" v-if="reportTimeType.type == 3">
- <p>用时占比</p>
- <div style="width:355px;display: flex;align-items: center;">
- <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>
- <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}小时</span></el-col>
- </div>
- </div>
- <div class="zhoFel">
- <p>工作事项</p>
- <el-input type="textarea" v-model="zhoBao.con" placeholder="请输入工作事项" style="width: 355px" clearable></el-input>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="tianxieDialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="btnTianxiaes()">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 批量日报审核 -->
- <el-dialog title="批量项目报告审核" :visible.sync="approveDialogVisible" width="500px" >
-
- <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
- <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
- </el-tree>
- <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">仅能看到自己负责的待项目审核的日报填写人员</div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="approveDialogVisible = false">取消</el-button>
- <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
- </span>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="projectId" label="选择项目">
- <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable filterable style="width:350px;">
- <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item prop="departmentId" label="选择部门" v-if="permissions.reportsCompany">
- <el-cascader v-model="exportParam.departmentId" placeholder="全部部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
- </el-form-item>
- <el-form-item prop="projectId" label="日期范围">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- range-separator="至"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <el-form-item prop="stateKey" label="是否包含">
- <el-select v-model="stateKey" placeholder="请选择" filterable style="width:350px;">
- <el-option label="不包含未审核" value="0"></el-option>
- <el-option label="包含未审核" value="1"></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
- </div>
- </el-dialog>
- <!--导出报表条件选择 -->
- <el-dialog title="工时统计导出" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
- <el-form ref="form3" :model="exportParam" >
- <el-form-item prop="range" label="日期范围">
- <el-date-picker
- v-model="exportParam.dateRange" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- range-separator="至"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
-
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="exportUserTime" style="width:100%;" >导出</el-button>
- </div>
- </el-dialog>
- <!--人员列表 -->
- <el-dialog :title="(isFill?'已填':'未填')+'人员列表'" v-if="membListVisible" :visible.sync="membListVisible" width="500px">
- <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="label" label="姓名" ></el-table-column>
- <el-table-column prop="deptName" label="部门" >
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">企业微信催填</el-button>
- <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">钉钉催填</el-button>
- <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">微信催填</el-button>
- <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">导出</el-button>
- </div>
- </el-dialog>
-
- <!-- 按部门选择人员 -->
- <el-dialog title="选择需要代填报的人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-input style="width:100%" v-model="deptMembDataText" placeholder="请输入姓名搜索"></el-input>
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
- ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
- highlight-current :filter-node-method="filterNode"></el-tree>
- </el-scrollbar>
- </div>
- <div>已选中 {{chosenMembCount}} 人</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseParticipVisible = false" >取消</el-button>
- <el-button type="primary" @click="chooseParticip()" >确定</el-button>
- </div>
- </el-dialog>
- <el-dialog
- v-if="monthWorkTimeDialog"
- :visible.sync="monthWorkTimeDialog"
- :close-on-click-modal="false"
- customClass="customWidth selectworktime"
- width="63%"
- title=""
- >
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="已填工时情况" name="first">
- <div class="selectworktime_export" style="margin-top:10px;">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek(1)">上上周</el-button>
- <el-button size="small" @click="getLastWeek(1)">上周</el-button>
- <el-button size="small" @click="getThisWeek(1)">本周</el-button>
-
- <!-- 222 -->
- </div>
- <div>
- <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
- <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
- </el-input>
- </div>
- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembWorkHours()"
- >导出数据</el-link
- >
- </div>
- <el-table ref="hasworkTbl"
- :data="monthWorkDataS"
- v-el-table-infinite-scroll="listScroll"
- border
- :height="500"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- :lazy="true"
- >
- <el-table-column width="75" type="index" fixed="left" label="序号">
- <template slot-scope="scope">
- {{ scope.$index + 1 }}
- </template>
- </el-table-column>
- <el-table-column width="105" prop="name" fixed="left" label="姓名">
- <template slot-scope="scope">
- <span :style="scope.row.worktimeList.length==0?'color:red':''">{{scope.row.name}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="departmentName" fixed="left" label="部门">
-
- </el-table-column>
- <el-table-column
- min-width="105"
- v-for="(item, index) in pickDateArray"
- :key="index"
- :label="item.label"
- align="center"
- >
- <template slot-scope="scope">
- <div
- style="color: red"
- v-if="
- scope.row.worktimeList.filter(
- (w) =>
- w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime < reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- <div
- style="color: #20a0ff"
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime > reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == reportTimeType.allday
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length == 0
- "
- >
- 0
- </div>
- <div
- v-if="
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- ).length > 0 &&
- typeof scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime == 'string'
- "
- >
- {{
- scope.row.worktimeList.filter(
- (w) =>w.createDate==item.date
- )[0].workingTime
- }}
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="warning" center show-icon></el-alert>
- <!-- <div slot="title" class="dialog-title selectworktime_title">
- <label style="font-size: 16px">员工每日已填报工时数</label>
- <el-link
- type="primary"
- style="float: right; margin-right: 60px"
- @click="exportMembWorkHours()"
- >导出已填报数据</el-link
- > -->
- <!-- <el-button >导出</el-button> -->
- <!-- </div> -->
- </el-tab-pane>
- <el-tab-pane label="未填人员列表" name="second" >
- <div class="selectworktime_export" style="margin-top:10px">
- <div class="selectworktime_export_l">
- <el-date-picker
- class="selecteworktime_datapick"
- v-model="WorktimeDatepickValue"
- value-format="yyyy-MM-dd"
- type="daterange"
- align="right"
- unlink-panels
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-time="['12:00:00', '12:00:00']"
- size="small"
- popper-class="selecteorktime_datapick_popper"
- @change="showMonthNotWorkTime()"
- >
- </el-date-picker>
- <el-button size="small" @click="getDoubleLastWeek()">上上周</el-button>
- <el-button size="small" @click="getLastWeek()">上周</el-button>
- <el-button size="small" @click="getThisWeek()">本周</el-button>
-
- </div>
- <div>
- <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
- <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
- </el-input>
- </div>
- <el-link
- type="primary"
- style="float: right; vertical-align: middle;height:32px"
- @click="exportMembNotWorkHours()"
- >导出数据</el-link
- >
- </div>
- <el-table
- ref="hasworkTbl2"
- :data="monthNotWorkDateS"
- v-el-table-infinite-scroll="notListScroll"
- border
- :height="500"
- highlight-current-row
- style="width: 100%"
- v-loading="tbload"
- lazy
- >
- <el-table-column min-width="150" label="部门" prop="department">
- </el-table-column>
- <el-table-column min-width="150" prop="name" label="姓名" >
- </el-table-column>
- <el-table-column
- min-width="200"
- label="未填日期"
- align="center"
- prop="createDate"
- >
- </el-table-column>
- <el-table-column
- min-width="200"
- label="考勤数据"
- prop="cardTime"
- align="center"
- v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
- </el-table>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
- <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="success" center show-icon></el-alert>
- </el-tab-pane>
- </el-tabs>
- </el-dialog>
- <!--驳回弹出框 -->
- <el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <div>
- <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'" />
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="denyReasonDialog = false" >取消</el-button>
- <el-button type="primary" @click="deny()" >确定</el-button>
- </div>
- </el-dialog>
- <!--批量导入日报 -->
- <el-dialog title="工时批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
- <p>1. 下载
- <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/员工工时统计模板2.xlsx" download="员工工时导入模板.xlsx">员工工时统计模板.xlsx</el-link>
- </p>
- <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p>
- <p style="display: flex;justify-content: center;">
- <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
- </el-upload>
- </p>
- <div style="display: flex;justify-content: end;padding-bottom: 1em;">
- <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
- </div>
- </el-dialog>
- <!-- 工时导入记录弹窗 -->
- <el-dialog title="工时导入记录" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
- <div style="height: 452px">
- <el-table :data="toViewList" stripe style="width: 100%;" height="400">
- <el-table-column prop="indate" label="导入时间"> </el-table-column>
- <el-table-column prop="userName" label="操作人"> </el-table-column>
- <el-table-column prop="datel" label="文件">
- <template slot-scope="scope">
- <div>
- <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
- <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-col :span="24" class="paginatis">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="20"
- layout="total, sizes, prev, pager, next"
- :total="toViewForm.total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- </div>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog title="工时批量导入" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
- <el-steps :active="active" finish-status="success" style="margin-left:50px;">
- <el-step title="选择要导入工时的日期范围">
-
- </el-step>
- <el-step title="下载带考勤数据的模板"></el-step>
- <el-step title="填写模板,上传数据"></el-step>
- </el-steps>
-
-
- <div v-if="active==0" style="padding:30px;height:360px;">
- <div style="margin-top:50px;margin-left:280px;">
- <el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- range-separator="至"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- @change="loadCheckInData"
- ></el-date-picker>
- </div>
- </div>
- <div v-if="active==1" style="padding:10px;">
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
- style="width: 100%;margin-top:5px;" >
- <el-table-column prop="hasPassed" label="审核状态" width="100px">
- <template slot-scope="scope">
- <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">已审</span>
- <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">未审</span>
- </template>
- </el-table-column>
- <el-table-column prop="createDate" label="工作日期" >
- </el-table-column>
- <el-table-column prop="weekDayTxt" label="星期" ></el-table-column>
- <el-table-column prop="username" label="员工姓名" ></el-table-column>
- <el-table-column prop="startTime" label="上班时间" ></el-table-column>
- <el-table-column prop="endTime" label="下班时间" ></el-table-column>
- <el-table-column prop="workHours" label="实际工作时长" align="right">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div v-if="active==2" >
- <p style="display: flex;justify-content: center;height:390px;">
- <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">选择文件并上传</el-button>
- </el-upload>
- </p>
- </div>
- <div slot="title">
- <span style="font-size:16px;">工时批量导入</span>
- <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">查看工时导入记录</el-link>
- </div>
-
- <span slot="footer">
- <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
- type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
- <el-button @click="pre" v-if="active!=0">上一步</el-button>
-
- <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
-
- </span>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog title="工时批量代填" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
- <div>
- <span>选择日期范围:</span><el-date-picker
- v-model="importWxParam.date" :editable="false"
- format="yyyy-MM-dd" value-format="yyyy-MM-dd"
- :clearable="true"
- range-separator="至"
- type="daterange"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- @change="loadCheckInData"
- ></el-date-picker>
- <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">提交</el-button>
- </div>
- <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
- :key="timeStamp"
- style="width: 100%;margin-top:5px;" ref="tab">
- <el-table-column prop="createDate" label="工作日期" width="100px" fixed="left"></el-table-column>
- <el-table-column prop="username" label="员工姓名" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="startTime" label="上班时间" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="endTime" label="下班时间" width="80px" fixed="left"></el-table-column>
- <el-table-column prop="workHours" label="工作时长" width="80px" align="right" fixed="left">
- <template slot-scope="scope">
- {{scope.row.workHours.toFixed(1)}}h
- </template>
- </el-table-column>
- <!--项目名称列表 -->
- <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
- <template slot-scope="scope">
- <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input> h
- </template>
- </el-table-column>
- <el-table-column prop="totalFillTime" label="总工时" fixed="right">
- <template slot-scope="scope">
- {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}} h
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!--基于企业微信考勤数据的工时导入 -->
- <el-dialog title="工时导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
- <div>
- <span>{{importResultMsg}}</span>
-
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button type="primary" @click="showImportResult=false">确定</el-button>
- </span>
- </el-dialog>
-
- </section>
- </template>
- <script>
- import util from "../../common/js/util";
- export default {
- data() {
- return {
- alalal: '8.0',
- timeBasecostList:null,
- tbload: false,
- exportTimeDialog: false,
- searchKeyword: '',
- monthWorkDataS: [],
- monthNotWorkDateS: [],
- pickDateArray:[],
- WorktimeDatepickValue: [],
- activeName:"first",
- submitingReport: false,
- importResultMsg:null,
- showImportResult:false,
- importingData: false,
- isDraft: 0,
- timeStamp: 0,
- projectColumns:[],
- checkinLoading:false,
- importWxParam:{date:null,},
- active:0,
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- importWxDialog:false,
- importDialog:false,
- denyForm:null,
- denyReasonDialog:false,
- monthWorkTimeDialog: false,
- isSubstitude:false,
- isFill:false,
- unFillList:[],
- fillList:[],
- fillMembList:[],
- membListVisible: false,
- isBatch:0,//是否是批量填报
- weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
- statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
- fillStatusList: [],
- exportParam:{projectId: null, dateRange:[], departmentId: null},
- exportDialog:false,
- timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
- subProjectList:[],
- canEdit: true,
- 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],
- selectTime:null,
- reportTimeType:{},
- curDate:'',
- isAllSelect: false,
- approveDialogVisible:false,
- deptId:null,
- targetUid: null,
- membCount:0,
- selectState:"-1",
- user: JSON.parse(sessionStorage.getItem("user")),
- showAddMore:false,
- allDate: [],
- typeList:['全天','上午','下午'],
- date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
- choseDay: 0,
- tableHeight: 0,
- listLoading: false,
- projectList: [], //项目列表
- fillProjectList: [],
- reportList: [], //日报列表
- reportNames:[], //批量审批列表
- selCon:[], //筛选条件
- selProjectList:[], //筛选后项目列表
- selConShow: true,
- dialogVisible: false, //项目弹窗
- report: '',
- workForm: {
- createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
- domains: [{
- id: null,
- projectId: "",
- workingTime: "",
- timeType:0,
- content: "",
- state: 2,
- multiWorktime:0,
- worktimeList:[],
- degreeId: null,
- }],
- },
- workRules: {
- createDate: [{ required: true, message: "请选择工作日期", trigger: "change" }],
- },
- chooseParticipVisible: false,
- logining: false,
- isDisable: false,
- timeType:[],
- deptMembData: [
-
- ],
- //部门人员树状结构
- data: [
- {
- id: -1,
- label: '全部人员',
- membCount:0
- },
- {
- id: 0,
- label: '未分配',
- }
- ],
- allData:{},
- batchShowData:{},
- option: [],
- depData: {
- id: -1,
- label: '全部人员',
- },
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- isNew: false,
- selected: false,
- valuet: new Date(),
- domObj: null,
- participator:[],
- chosenMembCount:0,
- jsDay: 0,
- jsTime: 0,
- falsss: false,
- weidu: [],
- weiduList: [],
- yonghuUser: [],
- dateAr: [],
- batchSubFillDialog: false,
- isSubstiS: false,
- diasZho: false,
- zhoData: [],
- zhoRqi: [],
- btnZho: false,
- zhoLoading: false,
- changdu: 6,
- tianxieDialogVisible: false,
- scopess: {},
- zhoBao: {
- time: '',
- workingTime: '',
- progress: '',
- con: '',
- subProjectId: '',
- stage: '',
- subProjectList: [],
- stages: [],
- },
- zhoBaoIdx: '',
- zhoBaoName: '',
- zhis: {},
- dealList: [],
- toViewDialogVisible: false,
- toViewList: [],
- toViewloading: true,
- toViewForm: {
- pageIndex: '1',
- pageSize: '20',
- total: 0,
- },
- toViewloadings: false,
- tabPositionss: 'top',
- monthTotal: 0,
- monthTotalPage: 0,
- monthTotalLages: 20,
- monthWorkData: [],
- monthNotWorkDate: [],
- monthWorkDataS1: [],
- monthnotTotal: 0,
- monthnotTotalPage: 0,
- monthnotTotalLages: 20,
- monthNotWorkDateS1: [],
- deptMembDataText: '',
- isFlag: false,
- isMore: false,
- stateKey: '0',
- expandDate: [],
- notifySelList:[],
- departmentList: []
- };
- },
- watch: {
- deptMembDataText(val) {
- this.$refs.chooseMembTree.filter(val);
- }
- },
- filters: {
- // 过滤
- amounts(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
- return 0
- }
- var zhi = +value + 0
- return zhi.toFixed(1)
- },
- // zhoData
- zhoData(value) {
- var dateArray = value.split("-");
- var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- return "周" + "日一二三四五六".charAt(date.getDay());
- },
- // 过滤数字
- numbers(value) {
- if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
- return 0
- }
- return value
- },
-
- },
- methods: {
- filterNode(value, data) {
- // console.log(value, data, '搜索')
- if (!value) return true;
- return data.label.indexOf(value) !== -1;
- },
- triggerCalculateOT(index) {
- var str = this.workForm.domains[index].overtimeHours + ''
- if(str.indexOf('.') != '-1') {
- var s = str.split('.')[0]
- var st = str.split('.')[1]
- var sts = st.split('')
- this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
- }
- },
- searchScreen(e){
- if(e){
- this.monthNotWorkDateS1 = []
- for (let i = 0; i < this.monthNotWorkDate.length; i++) {
- if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
- this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
- }
- }
- if (this.monthNotWorkDateS1.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
- }else{
- this.monthNotWorkDateS = this.monthNotWorkDateS1
- }
- // if (this.monthNotWorkDateS1.length > 0) {
- // setTimeout(() => {
- // this.tableListenernot()
- // }, 1000);
- // }
- }else{
- this.monthWorkDataS1 = []
- for (let i = 0; i < this.monthWorkData.length; i++) {
- if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
- this.monthWorkDataS1.push(this.monthWorkData[i])
- }
- }
- if (this.monthWorkDataS1.length > 50) {
- this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkDataS1
- }
- // if (this.monthWorkDataS1.length > 0) {
- // setTimeout(() => {
- // this.tableListener()
- // }, 1000);
- // }
- }
- },
- addUpload(data) {
- // var zhi = data.fileName.split('.')[0]
- // var sss = zhi + '.xlsx'
- // console.log(sss, data)
- // return
- var filePath = '/upload/' + data.serverName;
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', data.fileName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
-
-
- //获取项目下的任务分组
- getTaskGroups(domain, index) {
- domain.groupId=null;
- this.http.post('/task-group/listMyJoinGroup',{
- projectId: domain.projectId
- },
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].taskGroups = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //下载带企业微信考勤数据的工时统计模板
- downloadCheckInExcel() {
- this.http.post('/user-corpwx-time/exportCheckInExcel',{
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- const a = document.createElement('a'); // 创建a标签
- var data = filePath.split("/");
- a.setAttribute('download', data[data.length-1]);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- pre() {
- if (this.active == 0) return;
- this.active--;
- },
- next() {
- this.active++;
- },
- triggerTotalTime(index) {
- var item = this.checkinList[index];
- var total = 0.0;
- for (var i=0;i<this.projectColumns.length; i++) {
- var key = this.projectColumns[i];
- if (item[key] != null && item[key] != '') {
- total += parseFloat(item[key]);
- }
- }
- item.totalFillTime = total;
- },
- //提交批量代填的数据
- submitBatchSubFillData() {
- var data = JSON.stringify(this.checkinList);
- this.http.post('/user-corpwx-time/submitProjectTime',{
- json: data,
- projectColumns: JSON.stringify(this.projectColumns)
- },
- res => {
- if (res.code == "ok") {
- this.$message({message:'提交成功', type:'success'});
- this.importWxDialog = false;
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- loadCheckInData() {
- if (this.importWxParam.date == null) {
- this.checkinList = [];
- return;
- }
- this.checkinLoading = true;
- this.http.post('/user-corpwx-time/getMyDeptMembsData',{
- startDate: this.importWxParam.date[0],
- endDate: this.importWxParam.date[1],
- },
- res => {
- if (res.code == "ok") {
- this.checkinLoading = false;
- this.checkinList = res.data.list;
- this.projectColumns = res.data.projects;
- // 自定义表格会导致表格错乱,需重新计算表格
- this.$nextTick(()=>{
- this.$refs.tab.doLayout()
- })
- }
- },
- error => {
- this.checkinLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- batchImportWxData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: "请选择.xls或.xlsx文件",
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- formData.append("withCheckIn", 1);
- this.http.uploadFile('/report/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.showImportResult = true;
- this.importingData = false;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = "导入成功:成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");
- this.getReportList();
- this.importWxDialog = false;
- } else {
- this.importResultMsg = "导入失败:"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- batchImportData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: "请选择.xls或.xlsx文件",
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("file", item.file);
- formData.append("companyId", this.user.companyId);
- this.http.uploadFile('/report/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.showImportResult = true;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = "成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");;
- this.getReportList();
- this.importWXDialog = false;
- } else {
- this.importResultMsg = "导入失败:"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- userssHu() {
- this.http.post('/time-type/getCompanyTimeSetting',{
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- // console.log("维度",res.data);
- this.yonghuUser = res.data
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- iptBlur(i) {
- if(this.isBatch == 0) {
- return
- }
- var stat = this.workForm.createDate[0]
- var end = this.workForm.createDate[1]
- // this.jsDay = 10
- this.http.post('/report/getWorkDays',{
- startDate: stat,
- endDate: end
- },
- res => {
- if (res.code == "ok") {
- this.jsDay = res.data
- this.chuji(i)
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- var sl = this.workForm.domains
- this.chuji(i)
- },
- chuji(i) {
- if(i == 0) {
- this.seleChn(1)
- } else if(i == 1) {
- this.seleChn(0)
- } else if(i == 2) {
- if(this.workForm.domains[0].multiWorktime > 0) {
- this.iptChangs()
- } else {
- this.iptChang()
- }
- } else if(i == 3) {
- this.seleChn(0)
- }
- },
- seleChn(e,domain) {
-
- if(e == 1) {
- for(var i in this.workForm.domains) {
- if(this.workForm.domains[i].timeType == 0) {
- this.workForm.domains[i].workingTime = 8
- } else {
- this.workForm.domains[i].workingTime = 4
- }
- }
- }
- var quanbu = 0
- var spl = this.workForm.domains
- var zhi = ''
- for(var i in spl) {
- var sp = +spl[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- let worktime = this.jsTime
- // 自动计算加班时长
- if(this.isBatch != 0){
- worktime = this.jsTime / this.jsDay
- }
- if(this.user.timeType.fillOvertime && domain){
- let isover = false
- let alltime = 0
- let allover = 0 //此处alltime同上面的worktime
- for(let d in spl){
- if(spl[d].isOvertime){
- isover = true
- allover += spl[d].overtimeHours*1
- }
- alltime += spl[d].workingTime*1
- }
- if(domain.overtimeHours){
- allover = allover - domain.overtimeHours
- }
- if(worktime*1 > this.user.timeType.allday){
- if(isover){
- if(alltime > (allover + this.user.timeType.allday)){
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
- }else{
- this.$set(domain,'isOvertime',false)
- this.$set(domain,'overtimeHours',null)
- if(alltime < (allover + this.user.timeType.allday)){
- let overtime = allover + this.user.timeType.allday - alltime
- for(let pi in spl){
- if(spl[pi].overtimeHours){
- if((overtime - spl[pi].overtimeHours*1) > 0){
- overtime = overtime - spl[pi].overtimeHours*1
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- }else if((overtime - spl[pi].overtimeHours*1) < 0){
- this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
- break
- }else{
- this.$set(spl[pi],'isOvertime',false)
- this.$set(spl[pi],'overtimeHours',null)
- break
- }
- }
- }
- }
- }
- }else{
- this.$set(domain,'isOvertime',true)
- this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
- }
- }else{
- for(let di in spl){
- this.$set(spl[di],'isOvertime',false)
- this.$set(spl[di],'overtimeHours',null)
- }
- }
-
- }
- // console.log('domain',quanbu);
- },
- iptChang() {
- var sl = this.workForm.domains
- var quanbu = 0
- var zhi = ''
- for(var i in sl) {
- if(sl[i].startTime && sl[i].endTime) {
- var date2 = '2021/12/12 ' + sl[i].endTime +':00'
- var date1 = '2021/12/12 ' + sl[i].startTime +':00'
- var date3 = new Date(date2).getTime() - new Date(date1).getTime();
- var leave1=date3%(24*3600*1000)
- var hours=Math.floor(leave1/(3600*1000))
- var leave2=leave1%(3600*1000)
- var minutes=Math.floor(leave2/(60*1000))
- var shi = hours+'.'+ minutes
- var sll = +shi + 0
- zhi = this.jsDay * sll
- quanbu = +quanbu + zhi
- }
- }
- this.jsTime = quanbu
- },
- iptChangs() {
- var sl = this.workForm.domains
- var quanbu = 0
- var zhi = ''
- for(var i in sl) {
- for(var j in sl[i].worktimeList){
- if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
- var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
- var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
- var date3 = new Date(date2).getTime() - new Date(date1).getTime();
- var leave1=date3%(24*3600*1000)
- var hours=Math.floor(leave1/(3600*1000))
- var leave2=leave1%(3600*1000)
- var minutes=Math.floor(leave2/(60*1000))
- var shi = hours+'.'+ minutes
- var sll = +shi + 0
- zhi = this.jsDay * sll
- quanbu = +quanbu + zhi
- }
- }
- }
- this.jsTime = quanbu
- },
- removeTimeItem(item, index) {
- item.worktimeList.splice(index, 1);
- this.iptChangs()
- },
- //添加工时
- addNewWorktime(index, item) {
- if(item.worktimeList == null ) {
- item.worktimeList = []
- }
- item.worktimeList.push({});
- },
- //复制项目
- copyProject(index) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var newIndex = index+1;
- var itemDomain = {
- projectId: this.workForm.domains[index].projectId,
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- };
- this.workForm.domains.splice(newIndex, 0,itemDomain);
-
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.selectProject(itemDomain, newIndex);
- },
- showWorkTime(){
- this.monthWorkTimeDialog = true;
- this.searchKeyword = ''
- this.WorktimeDatepickValue = this.istoMonth()
- if(this.WorktimeDatepickValue.length == 0){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let getauto = this.getAutoWeekDate(nowdate)
- let nowwd = [getauto[0],getauto[6]]
- this.WorktimeDatepickValue = nowwd
- }
- this.showMonthWorkTime()
- },
- handleClick(t,e){
- // console.log("tabname",t.name);
- if (t.name == "first") {
- this.showMonthWorkTime()
- }else{
- this.showMonthNotWorkTime()
- }
- },
- //导出员工每日填报工时数
- exportMembWorkHours() {
- // console.log("exportMembWorkHours",this.WorktimeDatepickValue);
- this.http.post(
- "/report/exportUserDailyWorkTime",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- // console.log(res);
- this.downloadByA("人员每日工时统计.xls", url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- exportMembNotWorkHours() {
-
- this.http.post(
- "/report/exportNoReportUserList",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- let url = res.data;
- // console.log(res.data);
- this.downloadByA("人员每日工时统计.xls", url);
- // console.log(url);
- }
- },
- (error) => {
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- downloadByA(name, url) {
- // console.log(name,url);
- const a = document.createElement("a"); // 创建a标签
- a.setAttribute("download", name); // download属性
- a.setAttribute("href", url); // href链接
- a.click(); // 自执行点击事件
- a.remove();
- },
- // 是否本月判断
- istoMonth(){
- let todate = new Date()
- let tomonth = todate.getMonth() + 1
- let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
- if(this.date == adate){
- return []
- }else{
- let sedate = new Date(this.date)
- let semonth = sedate.getMonth() + 1
- let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
- let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
- let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
- return [sedates1, sedates2]
- }
- },
- showMonthWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true
- this.http.post(
- "/report/getUserDailyWorkTime",
- // "/report/getNoReportUserList",
- {
- // month: this.date,
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false;
- this.pickDateArray = res.data.days;
- // console.log('dataarray',res.data.days);
- this.monthWorkData = res.data.list;
- // this.monthWorkDataS = this.monthWorkData
- // this.monthWorkDataS1 = res.data.list
- this.monthTotal = res.data.list.length
- if (this.monthWorkData.length > 50) {
- this.monthWorkDataS = this.monthWorkData.slice(0,50);
- }else{
- this.monthWorkDataS = this.monthWorkData
- }
- this.searchScreen(0)
- // this.monthWorkDataS = infoList
- // 判断
- // if (this.monthWorkDataS1.length > 0) {
- // setTimeout(() => {
- // this.tableListener()
- // }, 1000);
- // }
- this.$nextTick(function(){
- this.$refs.hasworkTbl.doLayout();
- });
- // this.$forceUpdate()
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- // tableListener(){
- // let that = this;
- // let dom = that.$refs.hasworkTbl.bodyWrapper;
- // // 添加scroll监听事件
- // dom.addEventListener("scroll", function () {
- // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
- // if (scrollDistance < 2) {
- // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
- // that.monthTotalPage++; //当前页数自增
- // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
- // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
- // var infoList = arrList.splice(
- // that.monthTotalPage * that.monthTotalLages,
- // that.monthTotalLages
- // );
- // // 数据添加
- // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
- // }
- // }
- // })
- // },
- showMonthNotWorkTime() {
- this.monthTotalPage = 0,
- this.tbload = true
- this.http.post(
- "/report/getNoReportUserList",
- {
- startDate: this.WorktimeDatepickValue[0],
- endDate: this.WorktimeDatepickValue[1],
- },
- (res) => {
- if (res.code == "ok") {
- this.tbload = false
- this.monthNotWorkDate = res.data;
- // this.monthNotWorkDateS1 = res.data
- this.monthnotTotal = res.data.length
- // 2222111
- if (this.monthNotWorkDate.length > 50) {
- this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
- } else {
- this.monthNotWorkDateS = this.monthNotWorkDate
- }
- this.searchScreen(1)
- // 判断
- // if (this.monthnotworkDateS1.length > 0) {
- // setTimeout(() => {
- // this.tableListenernot()
- // }, 1000);
- // }
- this.$nextTick(function(){
- this.$refs.hasworkTbl2.doLayout();
- });
- }
- },
- (error) => {
- this.tbload = false
- this.$message({
- message: error,
- type: "error",
- });
- }
- );
- },
- // tableListenernot(){
- // let that = this;
- // let dom = that.$refs.hasworkTbl2.bodyWrapper;
- // dom.addEventListener("scroll", function () {
- // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
- // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
- // if (scrollDistance2 < 2) {
- // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
- // that.monthnotTotalPage++; //当前页数自增
- // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
- // var infoList = arrList.splice(
- // that.monthnotTotalPage * that.monthnotTotalLages,
- // that.monthnotTotalLages
- // );
- // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
- // }
- // }
- // })
- // },
- listScroll(){
- if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
- this.monthWorkDataS = datalist
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- notListScroll(){
- if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
- this.isMore = true
- setTimeout(()=>{
- this.isMore = false
- },1000)
- }else {
- this.isFlag = true
- let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
- this.monthNotWorkDateS = datalist
- // console.log('length',this.monthNotWorkDateS.length)
- setTimeout(()=>{
- this.isFlag = false
- },300)
- }
- },
- // 获取默认这zhou日期参数 222
- getLastWeek(e){
- let newdate = new Date()
- let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
- let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
- if(e){
- this.WorktimeDatepickValue = lastwd
- this.showMonthWorkTime()
-
- }else{
- this.WorktimeDatepickValue = lastwd
- this.showMonthNotWorkTime()
- }
- },
- getThisWeek(e){
- let newdate = new Date();
- let nowdate = newdate.toLocaleDateString();
- let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
- if(e){
- this.WorktimeDatepickValue = nowwd
- this.showMonthWorkTime()
- }else{
- this.WorktimeDatepickValue = nowwd
- this.showMonthNotWorkTime()
- }
- },
- getDoubleLastWeek(e){
- let newdate = new Date()
- let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
- let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
- if(e){
- this.WorktimeDatepickValue = nextwd
- this.showMonthWorkTime()
- }else{
- this.WorktimeDatepickValue = nextwd
- this.showMonthNotWorkTime()
- }
- },
- alreadyAllDate(stime,etime){
- let diffdate = new Array();
- let i=0;
- while(stime<=etime){
- let dateArray = stime.split("-");
- let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
- let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
- 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]) + "日"
- 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])
- diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
- let stime_ts = new Date(stime).getTime();
- let next_date = stime_ts + (24*60*60*1000);
- let next_dates_y = new Date(next_date).getFullYear()+'-';
- let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
- stime = next_dates_y+next_dates_m+next_dates_d;
- i++;
- }
- return diffdate
- },
- getAutoWeekDate(e) {
- let dateString = e;
- let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
- if (dateString.match(dateStringReg)) {
- let presentDate = new Date(dateString),
- today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
- return Array.from(new Array(7), function (val, index) {
- let formatDate = new Date(
- presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
- );
- return (
- formatDate.getFullYear() +
- "-" +
- ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
- "-" +
- (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
- );
- });
- } else {
- throw new Error(
- 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
- );
- }
- },
- onProgressChange() {
- this.$forceUpdate();
- },
- showChooseMembTree() {
- this.chosenMembCount = this.participator.length;
- this.chooseParticipVisible = true;
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- findRecursively(username, list) {
- var filterList = [];
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == 1) {
- if (list[i].label.indexOf(username) >= 0) {
- //匹配上了
- filterList.push(list[i]);
- }
- } else if (list[i].children != null && list[i].children.length > 0) {
- var subList = this.findRecursively(username, list[i].children);
- if (subList.length > 0) {
- subList.forEach(s=>filterList.push(s));
- }
- }
- }
- return filterList;
- },
- //确定选择参与人
- chooseParticip() {
- this.chooseParticipVisible = false;
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
- this.workForm.userNames = '';
- this.workForm.userId = [];
- this.participator = [];
- for (var i=0;i<this.chosenMembList.length; i++) {
- this.workForm.userId.push(this.chosenMembList[i].id);
- this.workForm.userNames += this.chosenMembList[i].label+',';
- var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
- this.participator.push(item);
- }
- if (this.workForm.userNames.length > 0) {
- this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
- }
-
- },
- notifySel(sel){
- // console.log(sel);
- this.notifySelList = sel
- },
- //微信通知人员填写
- Notify(code) {
- if (this.notifySelList.length == 0) return;
- var ids = '';
- this.notifySelList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/pushFillReport',{
- ids: ids, date: this.curDate,
- code: code
- },
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '已发送成功',
- type: "success"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //导出人员列表
- exportMemb() {
- if (this.fillMembList.length == 0) return;
- var ids = '';
- this.fillMembList.forEach(f=>{
- ids += f.id+',';
- })
- this.http.post('/user/exportMembList',{
- ids: ids,isFill: this.isFill, date: this.curDate
- },
- res => {
- if (res.code == "ok") {
- var aTag = document.createElement('a');
- aTag.download = this.curDate+(this.isFill?"已填":"未填")+"人员列表.xls";
- aTag.href = res.data;
- aTag.click();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showMembList(fill) {
- this.membListVisible = true;
- if (fill == 0) {
- this.fillMembList = this.unFillList;
- this.isFill = false;
- } else {
- this.fillMembList = this.fillList;
- this.isFill = true;
- }
- },
- //获取自己填写的日报状态
- getReportFillStatus() {
- this.http.post('/report/getReportFillStatus',{
- startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
- },
- res => {
- if (res.code == "ok") {
- this.fillStatusList = res.data;
- this.allDate.forEach(d=>{
- var fillInfo = null;
- d.state = null;
- this.fillStatusList.forEach(s=>{
- var d1 = s.createDate.split('-')[2];
- var d2 = d.date.split('月')[1].split('日')[0];
- if (d1.indexOf('0') == 0) {
- d1 = d1.substring(1,d1.length);
- }
-
- if (d1 == d2) {
- d.state = s.state;
- }
- })
- })
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- scrollFunction () {
- this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
- if (this.domObj.attachEvent) { // IE
- this.domObj.attachEvent('onmousewheel', this.mouseScroll)
- } else if (this.domObj.addEventListener) {
- this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
- }
- this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
- },
- mouseScroll(event) { // google 浏览器下
- let detail = event.wheelDelta || event.detail
- let moveForwardStep = -1
- let moveBackStep = 1
- let step = 0
- step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
- event.preventDefault() // 阻止浏览器默认事件
- this.domObj.scrollLeft = this.domObj.scrollLeft + step
- },
- // //左右滚动
- // wheel(e){
- // var a = document.getElementById("dateScroll");
- // var scroll_width = 80; //滚动一下的距离
- // var e = e || window.event, v;
- // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
- // if(v>3||-v>3) v=-v;
- // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
-
- // e.preventDefault(); //阻止浏览器的默认滚动
- // },
- showExportDialog() {
- this.exportDialog = true;
- },
- showExportTimeDialog() {
- this.exportTimeDialog = true;
- },
- changeAllTime() {
- //总时长发生改变,自动按比例计算
- this.workForm.domains.forEach(d=>{
- d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
- });
- },
- // 是否加班的单机事件
- check() {
- this.selected = !this.selected
- this.isNew = this.selected
-
- },
- updateSubProject() {
- this.$forceUpdate();
- },
- //项目选中了, 加载子项目
- selectProject(domain, index) {
- if(domain.projectId == ""){
- return
- }
- this.http.post('/sub-project/list',{
- projectId: domain.projectId
- },
- res => {
- //清空之前选中的子项目
- // this.workForm.domains[index].subProjectId = 0;
- if (res.code == "ok") {
- this.workForm.domains[index].subProjectList = res.data;
- this.workForm.domains[index].subProjectId = null;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- //项目相关的近期任务
- if (this.user.company.packageProject == 1) {
- this.http.post('/task/getRecentTask',{
- projectId: domain.projectId,
- isSubstitude:this.isSubstitude?1:0
- },
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].allTaskList = res.data;
- this.workForm.domains[index].taskList = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- //获取项目相关专业
- if (this.user.company.packageEngineering == 1) {
- this.getProjectProfessions(domain, index);
- }
-
- // 获取项目相关的维度
- // domain.degreeId = null
- this.$set(domain,'degreeId',null)
- this.dimension(domain, index);
- //获取项目下的任务分组
- this.getTaskGroups(domain, index);
- //获取项目审核人
- var curProject = this.projectList.filter(p=>p.id == domain.projectId)[0];
- if (curProject.taskGpIncharge == 0) {
- this.getProjectAuditorList(domain, index);
- } else {
- //按分组的负责人来审核
- domain.projectAuditorId = null;
- domain.projectAuditorName = null;
- domain.auditUserList = null;
- }
- // // this.$set(this.workForm.domains[index], "taskGpIncharge", curProject.taskGpIncharge);
- domain.taskGpIncharge = curProject.taskGpIncharge;
- // this.$forceUpdate();
- },
- //获取项目审核人
- getProjectAuditorList(domainItem, index) {
- if(domainItem.projectId == '') {
- return
- }
- domainItem.projectAuditorId = null;
- domainItem.projectAuditorName = null;
- this.http.post('/project-auditor/getList',{
- projectId: domainItem.projectId,
- },
- res => {
- if (res.code == "ok") {
- domainItem.auditUserList = res.data;
- if (res.data.length==1) {
- domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
- domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- // 获取维度数据
- dimension(domain, index) {
- if(domain.projectId == '') {
- return
- }
- this.http.post('/project/getDegreeList',{
- projectId: domain.projectId,
- },
- res => {
- if (res.code == "ok") {
- // console.log("维度数据",res.data);
- this.workForm.domains[index].wuduList = res.data
- // this.workForm = this.workForm
- this.$forceUpdate()
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //切换任务阶段
- changeStages(domain, index) {
- if (domain.stage == null || domain.stage == '') {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
- } else {
- this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
- }
- this.$forceUpdate();
- },
- getGroupStages(domain, index) {
- this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- domain.stage = '';
- domain.stages = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- //检查当前的项目是否需要获取分组的负责人
- var curProject = this.projectList.filter(p=>p.id == domain.projectId)[0];
- if (curProject.taskGpIncharge == 1) {
- this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
- res => {
- if (res.code == "ok") {
- domain.getProjectAuditorList = res.data;
- domain.auditUserList = res.data;
- if (res.data.length==1) {
- domain.projectAuditorId = domain.auditUserList[0].auditorId;
- domain.projectAuditorName = domain.auditUserList[0].auditorName;
- }
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- getProjectProfessions(domain, index) {
- this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
- res => {
- if (res.code == "ok") {
- this.workForm.domains[index].professionProgress = res.data;
- this.$forceUpdate();
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除自己的日报
- deleteReport() {
- this.$confirm("确定要删除该日报吗?","提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',{
- userId: this.user.id,
- date: this.workForm.createDate
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
-
- },
- // 管理员删除日报
- guanli(item) {
-
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day, userId: item.id};
-
- this.$confirm("确定要删除该日报吗?","提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/report/delete',param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "删除成功",
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.dialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- //提交批量审核数据
- submitBatchApprove() {
- var data = this.$refs.approveTree.getCheckedNodes();
- var ids = '';
- if (data.length == 0) {
- this.$message({
- message: '请选择要审核的人员',
- type: "error"
- });
- return;
- }
- for (var i=0;i<data.length; i++) {
- ids += data[i].id;
- if (i < data.length-1) {
- ids += ',';
- }
- }
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
-
- this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
- res => {
- if (res.code == "ok") {
- this.$message({
- message: '审核成功',
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.approveDialogVisible = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- selectAll() {
- if (this.isAllSelect) {
- var keys = [];
- this.reportNames.forEach(b=>{
- keys.push(b.id);
- })
- this.$refs.approveTree.setCheckedKeys(keys);
- } else {
- this.$refs.approveTree.setCheckedKeys([]);
- }
- },
- //批量审核
- batchApprove() {
- this.approveDialogVisible = true;
-
- this.reportNames = [];
- for (var i=0;i<this.reportList.length; i++) {
- var report = this.reportList[i];
- var hasUnChecked =false;
- var id = '';
- for (var j=0;j<report.data.length; j++) {
- if (report.data[j].state == 0
- && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
- && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
- hasUnChecked = true;
- id += report.data[j].id+',';
- }
- }
- if (hasUnChecked) {
- this.reportNames.push({id:id, label: report.name});
- }
- }
- },
- removeEmptyNode(list) {
- for (var i=0;i<list.length;i++) {
- var cnt = 0;
- if (list[i].membCount == 0) {
- list.splice(i, 1);
- i--;
- } else if (list[i].children != null) {
- this.removeEmptyNode(list[i].children);
- }
- }
- },
- calculateMembCount(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.calculateMembCount(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].isUser == 1) {
- cnt++;
- this.membCount++;
- }
- list[i].membCount = cnt;
- }
- },
- stateChange() {
- this.membCount = 0;
- if (this.selectState == -1) {
- //全部状态
- this.data = this.allData;
- } else {
- //未填报
- var newData = JSON.parse(JSON.stringify(this.allData));
- this.filterState(this.selectState, newData);
- this.data = newData;
- }
- this.calculateMembCount(this.data);
- this.data[0].membCount = this.membCount;//总人数
- },
- //按状态过滤部门人员
- filterState(state, list) {
- for (var i =0;i<list.length; i++) {
- var obj = list[i];
- if (obj.isUser == 1) {
- var match = false;
- if (state == -2) {
- if (obj.state == null) {
- match = true;
- }
- } else {
- if (obj.state == state) {
- match = true;
- }
- }
- if (!match) {
- list.splice(i, 1);
- i--;
- } else {
- }
- } else {
- if (obj.children != null) {
- this.filterState(state, obj.children);
- }
- }
- }
- },
- // 部门列表点击
- handleNodeClick(data) {
- // this.dealList = data
- this.theValues(data.id, this.allData)
- // this.depData = data;
- var list = [];
- if (data.id == -1) {
- this.deptId = null;
- this.targetUid = null;
- list = this.data;
- } else if (data.isUser == 1) {
- this.deptId = null;
- this.targetUid = data.id;
- } else {
- this.deptId = data.id;
- this.targetUid = null;
- list.push(data);
- }
- this.getReportList();
- if (list.length > 0) {
- this.unFillList = this.getUserMembListFromDeptList(list, 0);
- this.fillList = this.getUserMembListFromDeptList(list, 1)
- }
- // console.log(this.depData.isUser)
- // console.log(this.depData.membCount)
- // console.log(this.depData)
- },
- theValues(id, item) {
- for(var i in item) {
- if(item[i].id == id) {
- this.depData = item[i]
- return
- } else {
- if(item[i].children) {
- this.theValues(id, item[i].children)
- }
- }
- }
- },
- //获取可以选择的代填的人员列表
- getSubstitudeUserDeptList() {
- if (this.deptMembData.length == 0) {
- this.http.post("/department/listMyMembs", {},
- res => {
- if (res.code == "ok") {
- let noAllData = JSON.parse(JSON.stringify(res.data));
- if (noAllData.length > 0) {
- if (noAllData[0].label == '全部人员') {
- noAllData.splice(0,1);
- }
- }
- this.setUserToDept(noAllData);
- this.deptMembData = noAllData;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
-
- // 获取部门列表
- getDepartment() {
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var param = {date:this.date + day};
- if (this.user.manageDeptId != 0 && !this.permissions.reportsCompany) {
- param.manageDeptId = this.user.manageDeptId;
- }
- this.http.post("/report/getMembList", param,
- res => {
- if (res.code == "ok") {
- this.departmentList = JSON.parse(JSON.stringify(res.data))
- var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
- // let noAllData = JSON.parse(JSON.stringify(res.data));
- // if (this.user.role > 0) {
-
- // }
- list.splice(0,0,{
- id: -1,
- label: '全部人员',
- })
- this.membCount = 0;
- //设置员工到部门下面
- this.setUserToDept(list);
- this.data = list;
- this.expandDate = [this.data[1].id]
- this.allData = list;
-
- // if (noAllData.length > 0) {
- // if (noAllData[0].label == '全部人员') {
- // noAllData.splice(0,1);
- // }
- // }
- // this.setUserToDept(noAllData);
- // this.deptMembData = noAllData;
- this.option = this.changeArr(list1);
- list[0].membCount = this.membCount;
- if (this.depData.id == -1) {
- this.depData.membCount = this.membCount;
- this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
- this.fillList = this.getUserMembListFromDeptList(this.data, 1);
- } else {
- if (this.depData.isUser == null) {
- var dep = this.findTargetDept(this.data, this.depData.id);
- var membDeptList = [];
- membDeptList.push(dep);
- this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
- this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
- }
- }
- if (this.depData.isUser == null) {
- if (this.isFill) {
- this.fillMembList = this.fillList;
- } else {
- this.fillMembList = this.unFillList;
- }
- }
- this.stateChange()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- this.getReportFillStatus();
- },
- findTargetDept(list, deptId) {
- var t = null;
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == null && list[i].id == deptId) {
- t = list[i];
- break;
- }
- }
- if (t == null) {
- for (var i=0;i<list.length; i++) {
- if (list[i].children != null && list[i].children.length > 0) {
- t = this.findTargetDept(list[i].children, deptId);
- if (t != null) {
- break;
- }
- }
- }
- }
- return t;
- },
- getUserMembListFromDeptList(list, isFill) {
- var membList = [];
- for (var i in list) {
- var deptName = list[i].label;
- if (list[i].userList != null) {
- list[i].userList.forEach(element => {
- if (isFill == 0) {
- //获取未填的
- if (element.state == null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
- membList.push(obj);
- }
- } else {
- if (element.state != null) {
- var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
- membList.push(obj);
- }
- }
-
- });
- }
- if (list[i].children != null) {
- membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
- }
- }
- return membList;
- },
- setUserToDept(list) {
- for (var i in list) {
- var cnt = 0;
- if (list[i].children != null) {
- this.setUserToDept(list[i].children);
- for (var m in list[i].children) {
- cnt += list[i].children[m].membCount;
- }
- }
-
- if (list[i].userList != null) {
- if (list[i].children == null) {
- list[i].children = [];
- }
- list[i].userList.forEach(element => {
- var obj = {id: element.id, label:element.name, state:element.state, parentId:element.departmentId, isUser:1};
- list[i].children.push(obj);
- this.membCount++;
- cnt++;
- });
- }
- list[i].membCount = cnt;
- }
- },
- // 修改数组
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
- //时间段范围设置改动,监听
- onTimeTypeChange(timeType) {
- this.seleChn(1)
- this.showAddMore = true;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- this.showAddMore = false;
- break;
- }
- }
- if (this.showAddMore) {
- //检测数量
- if (this.workForm.domains.length == 2) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
- },
- getTimeType() {
- this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
- res => {
- if (res.code == "ok") {
- var t = res.data;
- this.reportTimeType = t;
- if (this.reportTimeType.type > 0) {
- this.showAddMore = true;
- }
- //转化时间格式
- if (t.allday != null) {
- this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
- }
- if (t.am != null) {
- this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
- }
- if (t.pm != null) {
- this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 改变月份 -------
- changeMonthOut() {
- this.getAllDate();
- this.getReportList();
- this.getDepartment();
- },
- // 选择日期
- choseDate(i, item) {
- if(this.canClick(i,item) == false){
- return
- }
- // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
- this.choseDay = i;
- let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- sessionStorage.msg = this.date + day,
- this.getReportList();
- this.getDepartment();
- this.curDate = item.date;
- },
- canClick(i, item){
- let nowDate = new Date()
- let nowDateYear = nowDate.getFullYear()
- let itemYear = parseInt(this.date.split('-')[0])
- let nowDateMonth = nowDate.getMonth() + 1
- let itemMonth = parseInt(this.date.split('-')[1])
- let nowDateDay = nowDate.getDate()
- let itemDay = parseInt(item.showDate.split('.')[1])
- if(nowDateYear < itemYear){
- return false
- }else if(nowDateYear == itemYear){
- if(nowDateMonth < itemMonth){
- return false
- }else if(nowDateMonth == itemMonth){
- if(nowDateDay < itemDay){
- return false
- }
- }
- }
- },
- // 获取日期列表
- getAllDate() {
- var dayArry = [];
- var day = this.getCountDays();
- let curMonthDay = null;
- for (var k = 1; k <= day; k++) {
- var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + "月" + k+'日';
- var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
- if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
- new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
- if(sessionStorage.msg) {
- if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
- this.choseDay = k - 1;
- curMonthDay = str;
- }
- } else {
- if (new Date().getDate() == k) {
- this.choseDay = k - 1;
- }
- }
- } else {
- this.choseDay = 0;
- }
- var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
- var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
- dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
- }
- this.allDate = dayArry;
- //不能超过最大日期
- if (this.choseDay > day-1) {
- this.choseDay = day-1;
- }
- //从消息点击跳转过来的,直接加载指定日期
- if (sessionStorage.from == 1 && sessionStorage.msg) {
- this.curDate = sessionStorage.msg;
- sessionStorage.from = 0;
- } else {
- if (curMonthDay != null) {
- this.curDate = curMonthDay;
- } else {
- var d = new Date(this.date.replace(/-/g, "/")+'/01')
- this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
- }
- }
- this.getReportFillStatus();
- },
- getCountDays() {
- var newstr = this.date.replace(/-/g, "/");
- var curDate = new Date(newstr+'/01');
- var curMonth = curDate.getMonth();
- curDate.setMonth(curMonth + 1);
- curDate.setDate(0);
- return curDate.getDate();
- },
- //获取日报列表
- getReportList() {
- this.listLoading = true;
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- let param = {date: this.date + day};
- if (this.deptId != null) {
- param.deptId = this.deptId;
- }
- if (this.targetUid != null) {
- param.userId = this.targetUid;
- }
- this.http.post( this.port.report.list, param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.reportList = res.data;
- document.querySelector("#day"+this.choseDay).scrollIntoView(true);
- // this.dealWith()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 处理数据
- // dealWith() {
- // var tianxie = 0
- // var weixtianxie = 0
- // if(this.selectState == -1) {
- // } else {
- // var arr = []
- // for (var i in this.reportList) {
- // arr.push(this.reportList[i].id)
- // }
- // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
- // }
- // },
- // getDealWith(item, tx, wtx, arr) {
- // // console.log(item,12345)
- // for(var i in item) {
- // if(item[i].children) {
- // this.getDealWith(item[i].children, tx, wtx, arr)
- // } else {
- // console.log(arr.indexOf(item[i].id))
- // console.log(arr)
- // console.log(item[i].id)
- // if(arr.indexOf(item[i].id) != '-1') {
- // tx = +tx + 1
- // }
- // }
- // }
- // console.log(tx, '看看值')
- // },
- //导出员工工时统计
- exportUserTime() {
- this.listLoading = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
- }
- this.http.post('/department/exportDeptStatistic', param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- location.href = res.data;
- this.exportTimeDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //导出日报
- exportReport() {
- this.listLoading = true;
- var param = {};
- if (this.exportParam.dateRange != null) {
- param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
- }
- if (this.exportParam.projectId != null) {
- param.projectId = this.exportParam.projectId;
- }
- if (this.exportParam.departmentId != null) {
- param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
- }
- param.stateKey = this.stateKey
- // param.departmentId = this.user.departmentId
- this.http.post( this.port.report.export, param,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- location.href = res.data;
- this.exportDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取项目列表
- getProjectList() {
- this.listLoading = true;
- this.http.post( this.port.project.list, {},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.projectList = res.data;
- // console.log("项目列表",this.projectList);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取填报日报的项目下拉列表
- getFillProjectList() {
- this.http.post( this.port.project.list, {
- forReport: 1
- },res => {
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
- res.data[i].projectCode = ''
- }
- }
- this.fillProjectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getBasecostItemList() {
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
-
- },
- // 获取个人某天的日报
- getReport() {
- this.http.post( this.port.report.getPort, {
- date: this.workForm.createDate
- },
- res => {
- if (res.code == "ok") {
- var quanbu = 0
- this.jsDay = 1
- var zhi = ''
- var slp = res.data.report
- for(var i in slp) {
- var sp = +slp[i].workingTime + 0
- zhi = this.jsDay * sp
- quanbu = +quanbu + zhi
- }
- this.jsTime = quanbu
- var list = res.data;
- this.report = list;
-
- if(list.report.length != 0) {
- var arr = [];
- this.canEdit = false;
- for(var i in list.report) {
- var flg = null
- list.report[i].isOvertime == 1 ? flg = true : flg = false
- arr.push({
- id: list.report[i].id,
- projectId: list.report[i].projectId,
- workingTime: list.report[i].workingTime,
- content: list.report[i].content,
- state: list.report[i].state,
- timeType: list.report[i].timeType,
- subProjectList: list.report[i].subProjectList,
- taskList: list.report[i].taskList,
- subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
- groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
- taskId: list.report[i].taskId,
- // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
- startTime: list.report[i].startTime,
- // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
- endTime: list.report[i].endTime,
- isOvertime: flg,
- progress:list.report[i].progress,
- professionProgress: list.report[i].professionProgressList,
- stages:list.report[i].stages,
- stage:list.report[i].stage == '-'?null:list.report[i].stage,
- pics: list.report[i].pics,
- multiWorktime: list.report[i].multiWorktime,
- worktimeList: list.report[i].worktimeList,
- degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
- wuduList: list.report[i].degreeList,
- taskGroups:list.report[i].taskGroups,
- customData: list.report[i].customData,//自定义的数值
- auditUserList: list.report[i].auditUserList,
- projectAuditorId: list.report[i].projectAuditorId,
- projectAuditorName: list.report[i].projectAuditorName,
- overtimeHours: list.report[i].overtimeHours,
- customText: list.report[i].customText,
- basecostId: list.report[i].basecostId,
- })
- if (list.report[i].state >= 2) {
- this.canEdit = true;
- }
- }
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: arr,
- userNames:null,
- userId:null,
- time: list.time
- }
- } else {
- this.workForm = {
- createDate: this.workForm.createDate,
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- taskGpIncharge:1,
- }],
- userId:null,
- userNames:null,
- time: this.report.time
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行一次', shuzhi.indexOf('.'))
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
-
- this.canEdit = true;
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- guanbi() {
- this.falsss = false
- },
- // 打开日报填写
- fillInReport(i, isBatch) {
- // console.log(this.user.timeType.type, '选择时长')
- if(i != 1) {
- this.falsss = false
- } else {
- this.falsss = true
- }
- if (this.isSubstitude) {
- this.getSubstitudeUserDeptList();
- }
- if(i == -1 || this.isSubstitude) {
- this.isDisable = false;
- } else {
- this.isDisable = true;
- }
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.isBatch = isBatch;
- if (this.isBatch == 0 && !this.isSubstitude) {
- this.workForm.createDate = this.date + day; // 获取个人某天的日报
- this.getReport(i);
- } else {
- // console.log('执行到了这里')
- this.jsTime = 0
- this.jsDay = 0
- this.workForm = {
- createDate: null,//批量填报没有日期
- domains: [{
- id: null,
- projectId: "",
- workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
- content: "",
- progress:100,
- state: 2,
- timeType:0,
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- }],
- }
- if(this.user.timeType.type == 1) {
- var shuzhi = this.user.timeType.allday + ''
- // console.log('执行二次')
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
- }
- // console.log(this.workForm)
- if (this.timeBasecostList&&this.timeBasecostList.length>0) {
- this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
- }
- this.canEdit = true;
- }
-
- this.dialogVisible = true;
-
- },
- // 按周填报里内容的填写
- tianxies(item, i, names, row) {
- // console.log(item, i, names, row, '你好')
- var idd = ''
- var obj = {}
- for(var l in this.projectList) {
- if(this.projectList[l].projectName == names) idd = this.projectList[l].id
- }
- obj.projectId = idd
- this.selectProject(obj, 0)
- // console.log(this.workForm.domains[0], '打印出来的')
- this.tianxieDialogVisible = true
- this.scopess = item
- var sss = {}
-
- sss.projectId = idd;
- sss.con = item.con
- sss.progress = item.progress
- sss.time = item.time
- sss.workingTime = item.workingTime
- sss.projectAuditorId = item.projectAuditorId;
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认选中第一个
- sss.basecostId = this.timeBasecostList[0].id;
- }
- var that = this
- setTimeout(() =>{
- if(Object.keys(item).length < 5) {
- // console.log(456)
- sss.subProjectId = that.workForm.domains[0].subProjectId
- sss.stage = that.workForm.domains[0].stage
- sss.subProjectList = that.workForm.domains[0].subProjectList
- sss.stages = that.workForm.domains[0].stages
- sss.taskGroups = that.workForm.domains[0].taskGroups;
- sss.auditUserList = obj.auditUserList;
- } else {
- sss.subProjectId = item.subProjectId
- sss.stage = item.stage
- sss.subProjectList = item.subProjectList
- sss.stages = item.stages
- sss.taskGroups = item.taskGroups;
- sss.auditUserList = obj.auditUserList;
- }
- if (sss.auditUserList != null && sss.auditUserList.length==1) {
- //只有一个审核人,自动设置上去
- sss.projectAuditorId = sss.auditUserList[0].auditorId;
- }
- sss.wuduList = row[0].wuduList
- // console.log(sss, '数据')
- that.zhoBaoIdx = i
- that.zhoBaoName = names
- that.zhoBao = sss
- that.zhis = row
- that.$forceUpdate();
- },500);
- // if(Object.keys(sss).length <= 4) {
- // sss.subProjectId = this.workForm.domains[0].subProjectId
- // sss.stage = this.workForm.domains[0].stage
- // sss.subProjectList = this.workForm.domains[0].subProjectList
- // sss.stages = this.workForm.domains[0].stages
- // } else {
- // sss.subProjectId = item.subProjectId
- // sss.stage = item.stage
- // sss.subProjectList = item.subProjectList
- // sss.stages = item.stages
- // }
- // console.log(sss, '数据')
- // this.zhoBaoIdx = i
- // this.zhoBaoName = names
- // this.zhoBao = sss
- // this.zhis = row
- // this.selectProject(row[0], i)
- },
- // 按周填报里内容的填写点击确定
- btnTianxiaes() {
- if (this.zhoBao.projectAuditorId) {
-
- let errtips = ''
- if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
- errtips += this.user.timeType.customDegreeName + '、'
- }
- if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
- errtips += this.user.timeType.customDataName + '、'
- }
- if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
- errtips += this.user.timeType.customTextName + '、'
- }
- if(errtips != ''){
- errtips = errtips.substring(0,errtips.length - 1)
- this.$message({
- message: '请对' + errtips + '进行填写',
- type: 'error'
- })
- }else {
- this.tianxieDialogVisible = false
- var zhong = this.zhoData
- zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
- this.zhoData = zhong
- if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
- if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
- }
-
- } else {
- this.$message({
- message: '请选择审核人',
- type: "error"
- });
- }
-
- },
- // 获取本周
- getCurrentWeek() {
- const currentDate = new Date()
- const week = currentDate.getDay()
- const millisecond = 1000 * 60 * 60 * 24
- const minusDay = week != 0 ? week - 1 : 4
- const monday = new Date(currentDate.getTime() - minusDay * millisecond)
- const sunday = new Date()
- var stat = this.dealdate(monday)
- var end = this.dealdate(sunday)
- this.zhoRqi = [stat, end]
- this.zhoRqis()
- this.jiazai()
- },
- // 获取上周
- handleGetPrevWeek() {
- const Time = new Date(this.zhoRqi[0])
- let weekNum = Time.getDay()
- weekNum = weekNum == 0 ? 7 : weekNum
- let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
- let fitstDate = new Date(
- Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
- )
- let startDate = `${fitstDate.getFullYear()}-${
- fitstDate.getMonth() + 1 < 10
- ? '0' + (fitstDate.getMonth() + 1)
- : fitstDate.getMonth() + 1
- }-${
- fitstDate.getDate() < 10
- ? '0' + fitstDate.getDate()
- : fitstDate.getDate()
- }`
- let endDate = `${lastDate.getFullYear()}-${
- lastDate.getMonth() + 1 < 10
- ? '0' + (lastDate.getMonth() + 1)
- : lastDate.getMonth() + 1
- }-${
- lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
- }`
- var stat = this.dealdate(startDate)
- var ends = this.dealdate(endDate)
- var end = this.dateChange(-2, ends)
- this.zhoRqi = [stat, end]
- this.zhoRqis()
- this.jiazai()
- },
- // 获取下周
- handleGetNextvWeek() {
- const Time = new Date(this.zhoRqi[1])
- let weekNum = Time.getDay()
- weekNum = weekNum == 0 ? 7 : weekNum
- let fitstDate = new Date(
- Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
- )
- let lastDate = new Date(
- Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
- )
- let startDate = `${fitstDate.getFullYear()}-${
- fitstDate.getMonth() + 1 < 10
- ? '0' + (fitstDate.getMonth() + 1)
- : fitstDate.getMonth() + 1
- }-${
- fitstDate.getDate() < 10
- ? '0' + fitstDate.getDate()
- : fitstDate.getDate()
- }`
- let endDate = `${lastDate.getFullYear()}-${
- lastDate.getMonth() + 1 < 10
- ? '0' + (lastDate.getMonth() + 1)
- : lastDate.getMonth() + 1
- }-${
- lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
- }`
- var stat = this.dealdate(startDate)
- var ends = this.dealdate(endDate)
- var end = this.dateChange(-2, ends)
- this.zhoRqi = [stat, end]
- this.zhoRqis()
- this.jiazai()
- },
- // 新增日期
- newDates() {
- // console.log(this.zhoRqi, '看卡')
- let edate = new Date(this.zhoRqi[1])
- let nowdate = new Date()
- let nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
- if(edate >= nowdate2){
- return
- }
- this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
-
- // console.log(this.zhoRqi[1]);
- // console.log(this.zhoRqi[1])
- var obj = {}
- obj.zhoDataTime = this.zhoRqi[1]
- obj.he = 0
- for(var j in this.projectList) {
- var xinzhi = this.projectList[j].projectName
- obj[xinzhi] = {}
- obj[xinzhi].time = ''
- obj[xinzhi].con = ''
- obj[xinzhi].progress = 0
- obj[xinzhi].workingTime = 0
- }
- this.zhoData.push(obj)
- },
- // 减去时间
- dateChange(num = 1,date = false) {
- if (!date) {
- date = new Date();//没有传入值时,默认是当前日期
- date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
- }
- date += " 00:00:00";//设置为当天凌晨12点
- date = Date.parse(new Date(date))/1000;//转换为时间戳
- date += (86400) * num;//修改后的时间戳
- var newDate = new Date(parseInt(date) * 1000);//转换为时间
- var nian = newDate.getFullYear()
- var yue = ''
- var ri = ''
- var yues = (newDate.getMonth() + 1)
- var ris = newDate.getDate()
- yues > 9 ? yue = yues : yue = '0' + yues
- ris > 9 ? ri = ris : ri = '0' + ris
- return nian +'-'+yue+'-'+ri
- },
- // 加载动画
- jiazai() {
- this.zhoLoading = true
- var that = this
- setTimeout(() =>{
- that.zhoLoading = false
- },1000);
- },
- // 转时间格式
- dealdate(date) {
- const dt = new Date(date)
- const y = dt.getFullYear()
- const m = (dt.getMonth() + 1 + '').padStart(2, '0')
- const d = (dt.getDate() + '').padStart(2, '0')
- return `${y}-${m}-${d}`
- },
- // 按周填报
- fillInReportss() {
- window.addEventListener('scroll', this.handleScroll, true)
- this.jiazai()
- this.diasZho = true
- this.getCurrentWeek()
- // 项目数量判断 <=5
- if(this.projectList.length < 5){
- this.selProjectList = this.projectList
- this.selConShow = false
- }
- if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
- //重新获取工时预警类型的预算项
- this.http.post('/project-basecost-setting/getReportBasecostList', {
- companyId: this.user.companyId
- },
- res => {
- if (res.code == "ok") {
- this.timeBasecostList = res.data;
- }
- });
- }
- },
- // 按周填报的项目筛选
- selListFun(){
- this.selProjectList = []
- if(this.selCon.length){
- for (let i = 0; i < this.selCon.length; i++) {
- this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
- }
- // console.log("已筛选列表",this.selProjectList);
- this.selConShow = false
- }else{
- this.$message({
- message:'请选择要填报的项目',
- type:'error'
- })
- }
- },
- selListqx(){
- this.diasZho = false
- this.selProjectList = []
- this.selCon = []
- },
- handleScroll() {
- this.changdu = this.projectList.length + 1
- },
- // 自动选择时间点的事件
- zhoTimes(item, i, ims, event) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
- var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
- var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
- var date3 = new Date(date2).getTime() - new Date(date1).getTime();
- var leave1=date3%(24*3600*1000)
- var hours=Math.floor(leave1/(3600*1000))
- var leave2=leave1%(3600*1000)
- var minutes=Math.floor(leave2/(60*1000))
- var shi = hours+'.'+ minutes
- he += +shi
- }
- }
- zhi.he = he + 'h'
- }
- },
- // 自动选择事件长度的事件
- zhoXuan(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he + 'h'
- }
- },
- // 按时间比例
- addBli(item, i) {
- var iss = i
- if(item.time == null) {
- return
- } else {
- var zhi = this.zhoData[iss]
- var he = 0
- for(var i in zhi) {
- if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
- he += +zhi[i].workingTime
- }
- }
- zhi.he = he.toFixed(1) + 'h'
- }
- },
- zhoRqis() {
- let nowdate = new Date()
- let nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
- let edate = new Date(this.zhoRqi[1])
- if(edate >= nowdate2){
- let emon = nowdate2.getMonth() + 1
- let eday = nowdate2.getDate()
- let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
- this.zhoRqi[1] = edate2
- }
- this.zhoData = []
- if(this.zhoRqi) {
- var stime = this.zhoRqi[0]
- var etime = this.zhoRqi[1]
- var zhi = this.getdiffdate(stime, etime)
- var arrst = []
- for(var i in zhi) {
- var obj = {}
- obj.zhoDataTime = zhi[i]
- obj.he = 0
- for(var j in this.projectList) {
- var xinzhi = this.projectList[j].projectName
- obj[xinzhi] = {}
- obj[xinzhi].time = ''
- obj[xinzhi].con = ''
- obj[xinzhi].progress = 0
- obj[xinzhi].workingTime = 0
- }
- arrst.push(obj)
- }
- this.zhoData = arrst
- }
- },
- zhoZhi(res, i) {
- var zhi = 0
- for(var i in res) {
- if(i != 'zhoDataTime' && i != 'he') {
- zhi += +res[i]
- }
- }
- res.he = zhi
- },
- zhoBtn(i) {
- // this.zhoData.split(i, 1)
- var arr = this.zhoData
- arr.splice(i, 1)
- },
- zhoAddlast(){
- this.selConShow = true
- },
- zhoAddqx(){
- this.diasZho = false
- this.selConShow = true
- this.selProjectList = []
- this.selCon = []
- },
- // 提交按周填报
- zhoAdd() {
- var zhi = this.zhoData
- var ll = 0
- // console.log(this.reportTimeType.type)
- // console.log(this.reportTimeType.multiWorktime)
- if(this.reportTimeType.type == 2) {
- for(var i in zhi) {
- this.dateAr = []
- var alp = []
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
- let objs = {}
- objs.s = zhis[j].time[0]
- objs.e = zhis[j].time[1]
- alp.push(objs)
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- ll += 1
- if(!trus) {
- this.$message({
- message: '填写的时间段重叠',
- type: 'error'
- })
- return false
- }
- }
-
- }
- if(ll == 0) {
- this.$message({
- message: '请填写时间',
- type: 'error'
- })
- return false
- }
- } else if(this.reportTimeType.type == 1){
- for(var i in zhi) {
- var zhis = zhi[i]
- for(var j in zhis) {
- if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
- ll += 1
- }
- }
- }
- if(ll == 0) {
- this.$message({
- message: '请选择时间',
- type: 'error'
- })
- return false
- }
- }
-
- var submits = []
- let formData = new FormData();
- if(this.reportTimeType.multiWorktime == 1){
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- for(var j in zhoD) {
- if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", '');
- formData.append("startTime", '');
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- var lix = []
- var objjs = {}
- objjs.startTime = zhoD[j].time[0]
- objjs.endTime = zhoD[j].time[1]
- if (zhoD[j].con == null || zhoD[j].con == '') {
- zhoD[j].con == '-'
- }
- objjs.content = zhoD[j].con
- lix.push(objjs)
- var zhiZhi = JSON.stringify(lix)
- zhiZhi = zhiZhi.replace(/,/g,"@");
- formData.append("content", zhiZhi)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- }
- } else {
- for (var i in this.zhoData) {
- var zhoD = this.zhoData[i]
- var flgs = false
- if(this.reportTimeType.type == 2) {
- for(var j in zhoD) {
- if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- } else {
- for(var j in zhoD) {
- 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') {
- flgs = true
- // formData.append("degreeId", "-1");
- formData.append("id", '-1');
- for(var s in this.projectList) {
- if(j == this.projectList[s].projectName) {
- formData.append("projectId", this.projectList[s].id);
- }
- }
- zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
- // formData.append("subProjectId", zhoD[j].subProjectId);
- formData.append("taskId", 0);
- formData.append("reportTimeType", this.reportTimeType.type);
- if(this.reportTimeType.type == 1) {
- formData.append("workingTime", zhoD[j].workingTime);
- } else if(this.reportTimeType.type == 2) {
- formData.append("endTime", zhoD[j].time[1]);
- formData.append("startTime", zhoD[j].time[0]);
- } else if(this.reportTimeType.type == 3) {
- formData.append("progress", zhoD[j].progress);
- formData.append("workingTime", zhoD[j].workingTime);
- }
- formData.append("multiWorktime", this.reportTimeType.multiWorktime);
- zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
- formData.append("isOvertime", 0)
- formData.append("professionProgress", "[]")
- zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
- formData.append("createDate",zhoD.zhoDataTime)
- if (zhoD[j].projectAuditorId) {
- formData.append("projectAuditorId",zhoD[j].projectAuditorId)
- }
- if(zhoD[j].basecostId) {
- formData.append("basecostId", zhoD[j].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
- formData.append('degreeId',zhoD[j].degreeId)
- }else{
- formData.append("degreeId", "-1");
- }
- if(this.user.timeType.customDataActive && zhoD[j].customData){
- formData.append('customData',zhoD[j].customData)
- }else if(this.user.timeType.customDataActive){
- formData.append('customData',0)
- }
- if(this.user.timeType.customTextActive && zhoD[j].customText){
- formData.append('customText',zhoD[j].customText)
- }else if(this.user.timeType.customTextActive){
- formData.append('customText','-')
- }
- }
- }
- }
- }
- }
-
- // 自定义维度
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- // this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "填报成功",
- type: "success"
- });
- this.diasZho = false
- this.selConShow = true
- this.zhoData = []
- this.zhoRqi = ''
- this.getReportList();
- this.getDepartment();
- // 关闭弹窗 并 清空
- this.selProjectList = []
- this.selCon = []
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- ChangeHourMinutestr (str) {
- if (str !== "0" && str !== "" && str !== null) {
- return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
- (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
- } else {
- return "";
- }
- },
- // 得到两个日期中间的日期
- getdiffdate(stime,etime){
- //初始化日期列表,数组
- var diffdate = new Array();
- var i=0;
- //开始日期小于等于结束日期,并循环
- while(stime<=etime){
- diffdate[i] = stime;
-
- //获取开始日期时间戳
- var stime_ts = new Date(stime).getTime();
-
- //增加一天时间戳后的日期
- var next_date = stime_ts + (24*60*60*1000);
-
- //拼接年月日,这里的月份会返回(0-11),所以要+1
- var next_dates_y = new Date(next_date).getFullYear()+'-';
- var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
- var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
-
- stime = next_dates_y+next_dates_m+next_dates_d;
-
- //增加数组key
- i++;
- }
- return diffdate;
- },
- // 添加模块
- addDomain(i) {
- var leftProgress = 10;
- if (this.reportTimeType.type == 3) {
- //计算已经待分配工时比例
- let array = this.workForm.domains;
- let totalProgress = 0;
- for (var i=0;i<array.length; i++) {
- totalProgress += array[i].progress;
- }
- if (totalProgress < 100) {
- leftProgress = 100 - totalProgress;
- }
- }
- var addItem = {
- projectId: "",
- workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
- content: "",
- progress:leftProgress,
- state:2,//2-表示待提交
- multiWorktime: this.reportTimeType.multiWorktime,
- worktimeList:[{}],
- // degreeId: '',
- };
- if (this.timeBasecostList && this.timeBasecostList.length > 0) {
- //默认给第一个,必填字段
- addItem.basecostId = this.timeBasecostList[0].id;
- }
- this.workForm.domains.push(addItem);
-
- if (this.reportTimeType.type == 0) {
- //全天上下午模式下,检测时间段数量,达到2个,不能再加了
- var length = this.workForm.domains.length;
- if (length == 2) {
- this.showAddMore = false;
- }
- }
- this.chuji()
-
- },
- // 移除模块
- delDomain(i) {
- this.workForm.domains.splice(i,1)
- //检测当前剩下的一个,时间类型是否是全天
- if (this.reportTimeType.type == 0) {
- if (this.workForm.domains[0].timeType == 0) {
- this.showAddMore = false;
- } else {
- this.showAddMore = true;
- }
- }
-
- if(this.user.timeType.multiWorktime == 1) {
- this.iptChangs()
- } else {
- this.seleChn(0)
- }
- },
- // 改变月份
- changeMonth() {
- if (this.isBatch == 0 && !this.isSubstitude) {
- //只有按天填报才能获取当天的日报
- this.getReport()
- }
- },
- // 判断时间段
- fns() {
- for (let k in this.dateAr) {
- if (!this.judege(k)) {
- return false
- }
- }
- return true
- },
- judege(idx){
- for (let k in this.dateAr) {
- if (idx !== k) {
- if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
- return false
- }
- if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
- return false
- }
- }
- }
- return true
- },
- // 保存日报
- submitReport(isDraft) {
- this.isDraft = isDraft;
- this.$refs.workForm.validate(valid => {
- if (valid) {
- this.dateAr = []
- let alp = []
- if(this.user.timeType.multiWorktime != 1) {
- for(var p in this.workForm.domains) {
- if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
- let objs = {}
- objs.s = this.workForm.domains[p].startTime
- objs.e = this.workForm.domains[p].endTime
- alp.push(objs)
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: '填写的时间段重叠',
- type: "error"
- });
- return
- }
- }
- } else {
- for(var p in this.workForm.domains) {
- var slll = this.workForm.domains[p]
- for(var o in slll.worktimeList) {
- if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
- let objs = {}
- objs.s = slll.worktimeList[o].startTime
- objs.e = slll.worktimeList[o].endTime
- alp.push(objs)
- }
- }
- }
- this.dateAr = alp
- if(this.dateAr.length > 0) {
- let trus = this.fns()
- if(!trus) {
- this.$message({
- message: '填写的时间段重叠',
- type: "error"
- });
- return
- }
- }
- }
- // return
- //代填的情况,检查人员是否已经选择
- if (this.isSubstitude) {
- if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
- this.$message({
- message: "请选择代填的人员",
- type: "error"
- });
- return;
- }
- }
- //检查时间,全天和上下午不能同时存在
- if (this.reportTimeType.type == 0) {
- var alldayNum = 0;
- var amNum = 0;
- var pmNum = 0;
- for(var i in this.workForm.domains) {
- if (this.workForm.domains[i].timeType == 0) {
- alldayNum ++;
- } else if (this.workForm.domains[i].timeType == 1) {
- amNum++;
- } else if (this.workForm.domains[i].timeType == 2) {
- pmNum++;
- }
- }
- if (alldayNum > 1) {
- this.$message({
- message: "工作时间-全天,只能选择一次",
- type: "error"
- });
- return;
- }
- if (amNum > 1) {
- this.$message({
- message: "工作时间-上午,只能选择一次",
- type: "error"
- });
- return;
- }
- if (pmNum > 1) {
- this.$message({
- message: "工作时间-下午,只能选择一次",
- type: "error"
- });
- return;
- }
- if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
- this.$message({
- message: "工作时间-全天,不能和上下午同时存在",
- type: "error"
- });
- return;
- }
- } else if (this.reportTimeType.type == 3) {
- //总百分比不能超过100%
- let total = 0;
- this.workForm.domains.forEach(w=>{total += w.progress});
- if (total > 100) {
- this.$message({
- message: "用时比例之和不能超过100%",
- type: "error"
- });
- return;
- } else if (total < 100) {
- this.$message({
- message: "工时尚未完全分配,无法提交",
- type: "error"
- });
- return;
- }
- }
-
- this.listLoading = true;
- let formData = new FormData();
- formData.append("draft", this.isDraft);
- //检查workingTime合计
- if (this.reportTimeType.type == 1 && this.workForm.time) {
- var totalTime = 0;
- for (var t=0;t<this.workForm.domains.length; t++) {
- totalTime += parseFloat(this.workForm.domains[t].workingTime);
- }
- if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
- this.$message({
- message: "填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.workForm.time.workHours.toFixed(1)+"h)",
- type: "error"
- });
- return;
- }
- }
-
- for(var i in this.workForm.domains) {
- if(this.workForm.domains[i].degreeId) {
- // var sss = this.workForm.domains[i].degreeId.toString()
- formData.append("degreeId", this.workForm.domains[i].degreeId);
- } else {
- formData.append("degreeId", -1);
- }
- if(this.workForm.domains[i].customData) {
- // var sss = this.workForm.domains[i].degreeId.toString()
- formData.append("customData", this.workForm.domains[i].customData);
- } else {
- formData.append("customData", 0);
- }
- if(this.workForm.domains[i].customText) {
- formData.append("customText", this.workForm.domains[i].customText);
- } else {
- formData.append("customText", '-');
- }
- if (this.workForm.domains[i].id) {
- formData.append("id", this.workForm.domains[i].id);
- } else {
- formData.append("id", -1);
- }
- formData.append("projectId", this.workForm.domains[i].projectId);
- if (this.workForm.domains[i].subProjectId) {
- formData.append("subProjectId", this.workForm.domains[i].subProjectId);
- } else {
- formData.append("subProjectId", 0);
- }
- if (this.workForm.domains[i].groupId) {
- formData.append("groupId", this.workForm.domains[i].groupId);
- } else {
- formData.append("groupId", 0);
- }
- if (this.workForm.domains[i].taskId) {
- formData.append("taskId", this.workForm.domains[i].taskId);
- } else {
- formData.append("taskId", 0);
- }
- if (this.workForm.domains[i].taskFinish == true) {
- formData.append("taskFinish", 1);
- } else {
- formData.append("taskFinish", 0);
- }
-
- formData.append("reportTimeType", this.reportTimeType.type);
- if (this.reportTimeType.type == 0) {
- formData.append("timeType", this.workForm.domains[i].timeType);
- var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
- formData.append("workingTime", workingTime);
- } else if (this.reportTimeType.type == 1){
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- } else if (this.reportTimeType.type == 2) {
- formData.append("endTime", this.workForm.domains[i].endTime);
- formData.append("startTime", this.workForm.domains[i].startTime);
- } else if (this.reportTimeType.type == 3) {
- //按比例分配
- formData.append("progress", this.workForm.domains[i].progress);
- formData.append("workingTime", this.workForm.domains[i].workingTime);
- }
-
-
- //处理多个时间事项
- formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
- if (this.reportTimeType.multiWorktime == 1) {
- //检查时间是否有重叠
- var workList = this.workForm.domains[i].worktimeList;
- for (var j=0;j<workList.length; j++) {
- var curItem = workList[j];
- //检查开始时间是否大于结束时间
- if (curItem.startTime >= curItem.endTime) {
- this.$message({
- message: "时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
- "结束时间必须大于开始时间",
- type: "error"
- });
- return;
- }
- for (var p = j+1;p<workList.length; p++) {
- var jItem = workList[p];
- if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
- || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
- this.$message({
- message: "时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
- jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。",
- type: "error"
- });
- return;
- }
- }
- }
- let m = JSON.stringify(this.workForm.domains[i].worktimeList);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("content", m);
- } else {
- if (this.workForm.domains[i].content) {
- formData.append("content", this.workForm.domains[i].content);
- } else {
- formData.append("content", '-');
- }
- }
-
- if (this.isBatch == 0) {
- formData.append("createDate", this.workForm.createDate);
- } else {
- //批量填报,时间范围
- formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
- }
-
- if(this.workForm.domains[i].isOvertime) {
- formData.append("isOvertime", 1);
- } else {
- formData.append("isOvertime", 0);
- }
- if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
- formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
- } else {
- formData.append("overtimeHours", 0);
- }
- if(this.workForm.domains[i].basecostId) {
- formData.append("basecostId", this.workForm.domains[i].basecostId);
- } else {
- formData.append("basecostId", 0);
- }
- if (this.workForm.userId != null) {
- var targetUids = '';
- this.workForm.userId.forEach(u=>{
- targetUids += u + '@';
- });
- if (targetUids.length > 0) {
- targetUids = targetUids.substring(0, targetUids.length -1);
- formData.append("targetUids", targetUids);
- }
- }
- //项目专业进度
- if (this.workForm.domains[i].professionProgress) {
- var m = JSON.stringify(this.workForm.domains[i].professionProgress);
- m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
- formData.append("professionProgress", m);
- } else {
- formData.append("professionProgress", "[]");
- }
- if (this.workForm.domains[i].stage) {
- formData.append("stage", this.workForm.domains[i].stage);
- } else {
- formData.append("stage", "-");
- }
- if (this.workForm.domains[i].projectAuditorId) {
- formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
- } else {
- if (this.workForm.domains[i].taskGpIncharge == 0) {
- this.$message({
- message: "请指定项目审核人",
- type: "error"
- });
- } else if (this.workForm.domains[i].taskGroups.length == 0) {
- this.$message({
- message: "您在["+this.workForm.domains[i].projectName+"]项目上尚无参与的任务分组",
- type: "error"
- });
- }
-
- return;
- }
- }
- this.submitingReport = true;
- this.http.uploadFile( this.port.report.editPort, formData,
- res => {
- this.listLoading = false;
- this.submitingReport = false;
- if (res.code == "ok") {
- this.$message({
- message: this.isDraft==0?"提交成功":"暂存成功",
- type: "success"
- });
- this.dialogVisible = false;
- this.jsDay = 0
- this.jsTime = 0
- this.getReportList();
- this.getDepartment();
- } else {
- this.$message({
- message: (this.isDraft==0?'提交失败:':'暂存失败:')+res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.submitingReport = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- });
- },
- cli() {
-
- },
- // 判断是展示那个工时导入
- imports() {
- if(this.user.timeType.syncCorpwxTime == 0) {
- this.importDialog = true
- } else {
- this.importWxDialog = true
- }
- },
- // 跳转
- junpToDeskTop(id) {
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- this.$router.push("/desktop/" + id + "/" + this.date +day);
- },
- // 通过日报
- approve(id, item) {
- this.logining = true;
- let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var ids = item.id;
- // var data = item.data;
- // data.forEach(element => {
- // ids +=(element.id+',');
- // });
- this.http.post( this.port.report.approve, {id: id , date: this.date +day, reportIds: ids},
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message: "审核成功",
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //撤回日报
- cancel(item) {
- this.logining = true;
-
- var ids = '';
- var data = item.data;
- data.forEach(element => {
- ids +=(element.id+',');
- });
- this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message:"撤回成功",
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- showDenyDialog(id,i, item) {
- this.denyReasonDialog = true;
- let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
- var ids = item.id;
- // var data = item.data;
- // data.forEach(element => {
- // ids +=(element.id+',');
- // });
- this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
- },
- // 未通过日报
- deny() {
- this.logining = true;
-
- this.http.post( this.port.report.deny, this.denyForm,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message: this.denyForm.i==0?"驳回成功":"撤销成功",
- type: "success"
- });
- this.getReportList();
- this.getDepartment();
- this.denyReasonDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 查看工时记录弹窗
- toView() {
- this.toViewDialogVisible = true
- this.toViewloading = true
- this.getToView()
- },
- getToView() {
- this.http.post( '/report-import-log/getList', this.toViewForm,
- res => {
- this.toViewloading = false;
- if (res.code == "ok") {
- // console.log(res.data, '数据数据')
- this.toViewList = res.data.records
- this.toViewForm.total = res.data.total
- } else {
- this.toViewloading = false;
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- })
- },
- //分页
- handleCurrentChange(val) {
- this.toViewForm.pageIndex = val;
- this.getToView();
- },
- handleSizeChange(val) {
- this.toViewForm.pageSize = val;
- this.getToView();
- },
- },
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 178;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 178;
- };
- this.toViewForm.companyId = this.user.companyId
- },
- mounted() {
- var now = new Date();
- var t = util.formatDate.format(now, 'yyyy-MM-dd');
- var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
- this.exportParam.dateRange = [startStr,t];
- this.getAllDate();
- this.getReportList();
- this.getProjectList();
- this.getFillProjectList();
- this.getTimeType();
- this.getDepartment();
- this.scrollFunction()
- this.userssHu();
- if (this.user.company.packageProject == 1) {
- this.getBasecostItemList();
- }
- if(this.user.timeType.lockWorktime){
- this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .paginatis {
- padding: 10px 10px;
- background: #f2f2f2;
- }
- .waiting {
- color:orange;
- }
- .filledReportStyle {
- color:#32CD32;
- }
- .RejectStyle {
- color:red;
- }
- .waitSubmitStyle{
- color: #999;
- }
- .chooseDate {
- .waiting {
- color: #20a0ff;
- }
- .filledReportStyle {
- color:#20a0ff;
- }
- .RejectStyle {
- color: #20a0ff;
- }
- .waitSubmitStyle{
- color: #20a0ff;
- }
- }
- .allDaily {
- width:82%;
- }
- .report_title {
- padding:10px 0;
- color:#666;
- }
- .clearfix {
- overflow-x: auto;
- white-space: nowrap;
- padding: 15px 0 10px 0;
- // overflow-y: hidden;
- .date_item {
- padding: 0 3px;
- cursor: pointer;
- position: relative;
- }
- .chooseDate {
- position: absolute;
- bottom: -3px;
- width: 34px;
- height: 2px;
- left: 12px;
- background: #20a0ff;
- }
- }
- .one_daily {
- i {
- color: #9ed0ff;
- margin-right: 5px;
- }
- .one_daily_body {
- padding: 10px 0px;
- p {
- margin: 0;
- line-height: 30px;
- }
- }
- ul {
- padding: 0;
- }
- }
- .checkbtn {
- float: right;
- margin-top: -10px;
- }
- .selConStyle{
- margin-top:9rem;
- margin-bottom:11rem;
- .selConStyle_title{
- height: 3rem;
- text-align: center;
- font-size: 17px;
- }
- .el-select{
- margin: 0 15%;
- width: 70%;
- }
- }
- </style>
- <style lang="scss">
- .daily {
- .el-card__body {
- height: 80%;
- overflow-y: auto;
- }
- .el-card__header {
- padding: 0 20px;
- }
- }
-
- </style>
- <style scoped>
- /* 项目标签的样式 */
- .el-tag + .el-tag {
- margin-left: 10px;
- }
- .button-new-tag {
- margin-left: 10px;
- height: 32px;
- line-height: 30px;
- padding-top: 0;
- padding-bottom: 0;
- }
- .input-new-tag {
- width: 90px;
- margin-left: 10px;
- vertical-align: bottom;
- }
- .selectworktime .el-table__fixed-body-wrapper{
- top: 48px !important;
- }
- .selectworktime_export .selectworktime_export_l{
- width: 65%;
- float: left;
- height: 42px;
- }
- </style>
- <style lang="scss" scoped>
- // 加班样式
- .overtime {
- display: inline-block;
- margin-left: 20px;
- input {
- display: inline-block;
- margin-top: 5px;
- }
- }
- .plus {
- display: inline-block;
- }
- // .tages {
- // float: right;
- // }
- .overtime {
- display: inline-block;
- margin-left: 30px;
- }
- .bloks {
- display: inline-block;
- width: 380px;
- }
- .zhiss {
- display: flex;
- justify-content: space-around;
- align-items: center;
- }
- .zhoFel {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- </style>
|