daily.vue 216 KB

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