daily.vue 243 KB

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