daily.vue 146 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980
  1. <template>
  2. <section>
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  7. <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showMonthWorkTime"></el-button>
  12. </div>
  13. <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
  14. @click="choseDate(index, item)" :key="index" >
  15. <div :style="'display:inline-block;'+(item.state == null?'padding:0px 6px;':'')" >
  16. <div><span>{{item.showDate}}</span>
  17. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  18. </div>
  19. </div>
  20. <i v-if="item.state != null" class="iconfont firerock-icondot" :class="statusStyle[item.state]"></i>
  21. </span>
  22. </div>
  23. <div style="display:flex;">
  24. <div v-if="user.role > 0 || user.manageDeptId != 0" >
  25. <div style="width:190px;">
  26. <el-select v-model="selectState" size="small" @change="stateChange" >
  27. <el-option value="-1" label="全部状态" >全部状态</el-option>
  28. <el-option value="-2" label="未填报">未填报</el-option>
  29. <el-option value="1" label="已通过">已通过</el-option>
  30. <el-option value="0" label="待审核">待审核</el-option>
  31. <el-option value="2" label="不通过">不通过</el-option>
  32. <el-option value="3" label="已撤回">已撤回</el-option>
  33. </el-select></div>
  34. <div>
  35. <el-tree :data="data" @node-click="handleNodeClick" >
  36. <span class="custom-tree-node" slot-scope="{ node, data}">
  37. <span>{{ node.label }}</span>
  38. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  39. <div style="width:0%;float:right;">
  40. <span v-if="data.isUser == 1 && data.state == null" style="color:red;">
  41. 未填报
  42. </span>
  43. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;">
  44. 待审核
  45. </span>
  46. <span v-if="data.isUser == 1 && data.state == 1" style="color:green;">
  47. 已通过
  48. </span>
  49. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;">
  50. 未通过
  51. </span>
  52. <span v-if="data.isUser == 1 && data.state == 3" style="color:red;">
  53. 已撤回
  54. </span>
  55. </div>
  56. </span>
  57. </el-tree>
  58. </div>
  59. </div>
  60. <div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
  61. <div class="allDaily" style="float:left;flex-grow:1">
  62. <!--系统管理员和部门负责人 -->
  63. <div class="report_title" v-if="user.role == 1 || user.role == 2 || user.manageDeptId > 0">
  64. <span>工作日报 | {{depData != null ?depData.label:""}}</span>
  65. <span v-if="targetUid == null">
  66. - 已填写
  67. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
  68. 未填写<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}}</span></el-link>人
  69. </span>
  70. <span style="float:right;">
  71. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  72. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  73. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  74. <el-link type="primary" v-if="user.role==1||user.role==2||user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">工时导入</el-link>
  75. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,1)">批量代填</el-link> -->
  76. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog">导出日报</el-link>
  77. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="batchApprove" >批量审核</el-link>
  78. </span>
  79. </div>
  80. <!--普通员工,含项目经理 -->
  81. <div class="report_title" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0"><span>日报列表</span>
  82. <span style="float:right;" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0">
  83. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  84. <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  85. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  86. <!-- <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,1)">批量代填</el-link> -->
  87. <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="batchApprove">批量审核</el-link>
  88. </span>
  89. </div>
  90. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  91. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  92. <i class="fa fa-circle"></i>{{item1.name}}
  93. <span style="margin-left:30px;">
  94. <span style="margin-right:20px;">
  95. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  96. 工作总时长:
  97. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  98. <span >{{item1.reportTime}}</span>h
  99. <span v-if="user.role ==1 || user.role == 2 ||user.role == 6"><span style="margin-left:10px;">成本:</span>
  100. <span >{{item1.cost}}</span>元</span>
  101. </span>
  102. </span>
  103. <div class="checkbtn">
  104. <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id, item1)">通过</el-button>
  105. <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="danger" :loading="logining" size="small" @click="showDenyDialog(item1.id,0, item1)">驳回</el-button>
  106. <!--自己可以撤回待审核状态的报告 -->
  107. <el-button v-if="(user.id == item1.id) && item1.state == 0" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
  108. <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 1" type="normal" :loading="logining" size="small" @click="showDenyDialog(item1.id,1, item1)">撤销</el-button>
  109. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">编辑日报</el-button>
  110. </div>
  111. <div class="one_daily_body">
  112. <el-timeline>
  113. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  114. <el-card shadow="never">
  115. <p>项目:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  116. <span v-if="user.company.packageEngineering == 0">
  117. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[ 待审核 ]</span>
  118. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  119. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  120. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 已撤回 ]</span>
  121. </span>
  122. <span v-if="user.company.packageEngineering == 1">
  123. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ 待专业审核 ]</span>
  124. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ 待部门审核 ]</span>
  125. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ 待项目经理审核 ]</span>
  126. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  127. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  128. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 已撤回 ]</span>
  129. </span>
  130. </p>
  131. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  132. <p v-if="user.company.packageEngineering == 1">
  133. 专业进度:
  134. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  135. <el-tooltip v-if="progressItem.auditState == 0" content="待审核" effect="light" placement="top">
  136. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  137. </el-tooltip>
  138. <el-tooltip v-if="progressItem.auditState == 1" content="已通过" effect="light" placement="top">
  139. <i class="iconfont firerock-iconshenhetongguo"></i>
  140. </el-tooltip>
  141. <el-tooltip v-if="progressItem.auditState == 2" content="不通过" effect="light" placement="top">
  142. <i class="iconfont firerock-iconshenhebohui"></i>
  143. </el-tooltip>
  144. </span>
  145. </p>
  146. <p v-if="item2.taskId != null">任务:{{item2.taskName}}
  147. </p>
  148. <div v-if="item2.multiWorktime==0">
  149. <p style="display: inline-block;">时长:
  150. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  151. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  152. {{item2.time.toFixed(1)}}h
  153. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
  154. <!-- 阶段 -->
  155. <span v-if="item2.stage != null" style="margin-left:10px;"> 投入阶段:{{item2.stage}}</span>
  156. </p>
  157. <p>事项:<span v-html="item2.content"></span></p>
  158. </div>
  159. <div v-if="item2.multiWorktime==1" >
  160. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  161. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  162. <p style="display: inline-block;">时长:
  163. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  164. {{timeItem.time.toFixed(2)}}h
  165. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班</el-tag>
  166. </p>
  167. <p>事项:<span v-html="timeItem.content"></span></p>
  168. </div>
  169. </div>
  170. <!--照片的显示 -->
  171. <p v-if="item2.pics != null && item2.pics.length > 0">
  172. <el-image v-for="(pic, index) in item2.pics" :key="index"
  173. style="width: 100px; height: 100px; margin-right:10px;"
  174. :src="pic"
  175. :preview-src-list="item2.pics">
  176. </el-image>
  177. </p>
  178. </el-card>
  179. </el-timeline-item>
  180. </el-timeline>
  181. </div>
  182. </div>
  183. <!-- 简陋的无报告提示 -->
  184. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}暂无报告</div>
  185. </div>
  186. </div>
  187. </div>
  188. </el-card>
  189. </div>
  190. <!-- 填写日报的dialog -->
  191. <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
  192. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px">
  193. <el-form-item label="选择人员" v-if="isSubstitude">
  194. <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
  195. placeholder="请选择代填人员" ></el-input>
  196. </el-form-item>
  197. <el-form-item label="工作日期" prop="createDate">
  198. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  199. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  200. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
  201. <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  202. <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  203. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
  204. <el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  205. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  206. <span v-if="reportTimeType.type == 3">小时</span>
  207. </el-form-item>
  208. <div v-for="(domain, index) in workForm.domains" :key="domain.id">
  209. <div v-if="reportTimeType.multiWorktime==0">
  210. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  211. :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
  212. <el-select v-model="domain.timeType" style="width:200px;"
  213. v-if="reportTimeType.type == 0"
  214. placeholder="请选择工作时长"
  215. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  216. @change="onTimeTypeChange(domain.timeType)">
  217. <el-option
  218. v-for="item in timeType"
  219. :key="item.value"
  220. :label="item.label"
  221. :value="item.value">
  222. </el-option>
  223. </el-select>
  224. <!-- 数字时长选择 -->
  225. <el-select v-model="domain.workingTime" style="width:200px;"
  226. v-if="reportTimeType.type == 1"
  227. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  228. placeholder="请选择工作时长"
  229. @change="seleChn(0)">
  230. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  231. </el-select>
  232. <span v-if="reportTimeType.type == 1">小时</span>
  233. <span v-if="reportTimeType.type == 2">
  234. <!--时间范围选择 -->
  235. <el-time-picker
  236. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  237. v-model="domain.startTime"
  238. placeholder="起始时间"
  239. style="width:120px;"
  240. format="HH:mm"
  241. value-format="HH:mm"
  242. :picker-options="{
  243. start: '08:00',
  244. end: '23:30'
  245. }"
  246. @change="iptChang()">
  247. </el-time-picker> - <el-time-picker
  248. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  249. v-model="domain.endTime"
  250. placeholder="结束时间"
  251. style="width:120px;"
  252. format="HH:mm"
  253. value-format="HH:mm"
  254. :picker-options="{
  255. start: '08:00',
  256. end: '23:30',
  257. minTime: domain.startTime
  258. }"
  259. @change="iptChang()">
  260. </el-time-picker>
  261. </span>
  262. <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
  263. </el-form-item>
  264. <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
  265. :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
  266. <el-select v-model="domain.projectId" placeholder="请选择" style="width:200px;" clearable="true" filterable="true"
  267. @change="selectProject(domain, index)"
  268. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  269. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  270. </el-select>
  271. <!--子项目 -->
  272. <el-select v-model="domain.subProjectId" placeholder="请选择" style="width:200px;" clearable="true" v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  273. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  274. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  275. </el-select>
  276. <!-- 项目的阶段 -->
  277. <span v-if="user.company.packageProject == 1 && domain.stages != null && domain.stages.length> 0"
  278. style="margin-left:30px;">投入阶段</span>
  279. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
  280. clearable="true" v-if="user.company.packageProject == 1 && domain.stages != null && domain.stages.length> 0"
  281. @change="changeStages(domain, index)"
  282. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  283. <el-option v-for="item in domain.stages" :key="item" :label="item" :value="item"></el-option>
  284. </el-select>
  285. <el-link v-if="index >= 1" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  286. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  287. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  288. </el-link>
  289. <el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
  290. :underline="false" style="margin-left:5px;" @click="copyProject(index)">复制</el-link>
  291. </el-form-item>
  292. <!-- 相关维度 -->
  293. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  294. <el-select v-model="domain.degreeId" clearable placeholder="请选择">
  295. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  296. </el-option>
  297. </el-select>
  298. </el-form-item>
  299. <!-- </el-form-item> -->
  300. <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  301. :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
  302. <div style="width:300px;">
  303. <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>
  304. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
  305. </div>
  306. <div class="overtime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox></div>
  307. </el-form-item>
  308. <!--工程专业版本模式下, 各个专业的进度填报 -->
  309. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  310. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  311. <span>{{item.professionName}}</span> / 进度:
  312. <el-input size="mini" style="width:60px;" v-model="item.progress"
  313. @keyup.native="onProgressChange"
  314. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  315. </span>
  316. </el-form-item>
  317. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  318. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  319. <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true"
  320. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  321. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  322. </el-select>
  323. </el-form-item>
  324. <el-form-item label="工作事项" :prop="'domains.' + index + '.content'" >
  325. <el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请填写工作事项" clearable
  326. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  327. </el-form-item>
  328. </div>
  329. <!--多个工作事项填报的情况 -->
  330. <div v-if="reportTimeType.multiWorktime==1">
  331. <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
  332. :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
  333. <el-select v-model="domain.projectId" placeholder="请选择" style="width:200px;" clearable="true" filterable="true"
  334. @change="selectProject(domain, index)"
  335. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  336. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  337. </el-select>
  338. <!--子项目 -->
  339. <el-select v-model="domain.subProjectId" placeholder="请选择" style="width:200px;" clearable="true" v-if="domain.subProjectList != null && domain.subProjectList.length> 0"
  340. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  341. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  342. </el-select>
  343. <!-- 项目的阶段 -->
  344. <span v-if="user.company.packageProject == 1 && domain.stages != null && domain.stages.length> 0"
  345. style="margin-left:30px;">投入阶段</span>
  346. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;" clearable="true" v-if="user.company.packageProject == 1 && 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" :label="item" :value="item"></el-option>
  350. </el-select>
  351. <el-link v-if="index >= 1" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  352. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  353. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  354. </el-link>
  355. <el-link type="primary" v-if="workForm.domains[index].state == 0 || workForm.domains[index].state == 2"
  356. :underline="false" style="margin-left:5px;" @click="copyProject(index)">复制</el-link>
  357. </el-form-item>
  358. <!--工程专业版本模式下, 各个专业的进度填报 -->
  359. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  360. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  361. <span>{{item.professionName}}</span> / 进度:
  362. <el-input size="mini" style="width:60px;" v-model="item.progress"
  363. @keyup.native="onProgressChange"
  364. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  365. </span>
  366. </el-form-item>
  367. <!-- 相关维度 -->
  368. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  369. <el-select v-model="domain.degreeId" clearable placeholder="请选择">
  370. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  371. </el-option>
  372. </el-select>
  373. </el-form-item>
  374. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  375. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  376. <el-select v-model="domain.taskId" placeholder="请选择" style="width:100%;" filterable="true"
  377. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  378. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  379. </el-select>
  380. </el-form-item>
  381. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  382. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  383. <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>
  384. <el-form-item label="工作时间" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  385. :rules="{ required: true, message: '请选择工作时间', trigger: 'blur' }">
  386. <span v-if="reportTimeType.type == 2">
  387. <!-- <span> -->
  388. <!--时间范围选择 -->
  389. <el-time-picker
  390. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  391. v-model="timeItem.startTime"
  392. placeholder="起始时间"
  393. style="width:120px;"
  394. format="HH:mm"
  395. value-format="HH:mm"
  396. :picker-options="{
  397. start: '00:00',
  398. end: '23:59',
  399. }"
  400. @change="iptChangs()">
  401. </el-time-picker> - <el-time-picker
  402. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  403. v-model="timeItem.endTime"
  404. placeholder="结束时间"
  405. style="width:120px;"
  406. format="HH:mm"
  407. value-format="HH:mm"
  408. :picker-options="{
  409. start: '00:00',
  410. end: '23:59',
  411. minTime: timeItem.startTime
  412. }"
  413. @change="iptChangs()">
  414. </el-time-picker>
  415. </span>
  416. </el-form-item>
  417. <el-form-item label="工作事项" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  418. :rules="{ required: true, message: '填写工作事项', trigger: 'blur' }">
  419. <el-input v-model="timeItem.content" type="textarea" :rows="2" placeholder="请填写工作事项" clearable
  420. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  421. ></el-input>
  422. </el-form-item>
  423. </div>
  424. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">添加工时</el-link>
  425. </div>
  426. <!--照片的显示 -->
  427. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  428. <el-image v-for="(pic, index) in domain.pics" :key="index"
  429. style="width: 100px; height: 100px; margin-right:10px;"
  430. :src="pic"
  431. :preview-src-list="domain.pics">
  432. </el-image>
  433. </p>
  434. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  435. </div>
  436. <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
  437. </el-form>
  438. <span slot="footer" class="dialog-footer">
  439. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null">删除</el-button>
  440. <el-button @click="dialogVisible = false">取消</el-button>
  441. <el-button type="primary" @click="submitDepartment"
  442. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
  443. </span>
  444. </el-dialog>
  445. <!-- 批量日报审核 -->
  446. <el-dialog title="批量日报审核" :visible.sync="approveDialogVisible" width="500px" >
  447. <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  448. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  449. </el-tree>
  450. <span slot="footer" class="dialog-footer">
  451. <el-button @click="approveDialogVisible = false">取消</el-button>
  452. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
  453. </span>
  454. </el-dialog>
  455. <!--导出报表条件选择 -->
  456. <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  457. <el-form ref="form3" :model="exportParam" >
  458. <el-form-item prop="projectId" label="选择项目">
  459. <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable style="width:350px;">
  460. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  461. </el-select>
  462. </el-form-item>
  463. <el-form-item prop="projectId" label="日期范围">
  464. <el-date-picker
  465. v-model="exportParam.dateRange" :editable="false"
  466. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  467. :clearable="true"
  468. range-separator="至"
  469. type="daterange"
  470. start-placeholder="开始日期"
  471. end-placeholder="结束日期"
  472. ></el-date-picker>
  473. </el-form-item>
  474. </el-form>
  475. <div slot="footer" class="dialog-footer">
  476. <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
  477. </div>
  478. </el-dialog>
  479. <!--人员列表 -->
  480. <el-dialog :title="(isFill?'已填':'未填')+'人员列表'" v-if="membListVisible" :visible.sync="membListVisible" width="500px">
  481. <el-table :show-header="false" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;">
  482. <el-table-column type="index" width="60">
  483. <template slot-scope="scope" >
  484. {{scope.$index+1}}
  485. </template>
  486. </el-table-column>
  487. <el-table-column prop="label" label="姓名" ></el-table-column>
  488. <el-table-column prop="deptName" label="部门" >
  489. </el-table-column>
  490. </el-table>
  491. <div slot="footer" class="dialog-footer">
  492. <el-button type="primary" @click="weixinNotify" v-if="!isFill" :disabled="fillMembList == 0">微信催填</el-button>
  493. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">导出</el-button>
  494. </div>
  495. </el-dialog>
  496. <!-- 按部门选择人员 -->
  497. <el-dialog title="选择需要代填报的人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  498. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  499. <div class="tree" style="height:400px">
  500. <el-scrollbar style="height:100%">
  501. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  502. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  503. highlight-current ></el-tree>
  504. </el-scrollbar>
  505. </div>
  506. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  507. <div slot="footer" class="dialog-footer">
  508. <el-button @click="chooseParticipVisible = false" >取消</el-button>
  509. <el-button type="primary" @click="chooseParticip()" >确定</el-button>
  510. </div>
  511. </el-dialog>
  512. <el-dialog title="员工每日填报工时数" v-if="monthWorkTimeDialog" :visible.sync="monthWorkTimeDialog" :close-on-click-modal="false" customClass="customWidth" width="90%">
  513. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  514. <el-table :data="monthWorkData" border :height="500" highlight-current-row style="width: 100%;">
  515. <el-table-column width="60" type="index" fixed="left" label="序号">
  516. <template slot-scope="scope" >
  517. {{scope.$index+1}}
  518. </template>
  519. </el-table-column>
  520. <el-table-column width="100" prop="name" fixed="left" label="姓名">
  521. </el-table-column>
  522. <el-table-column width="90" v-for="(item,index) in allDate" :key="index" :label="item.showDate+'/'+item.weekDay" align="center">
  523. <template slot-scope="scope">
  524. <div style="color:red;"
  525. v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  526. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  527. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime < reportTimeType.allday">
  528. {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  529. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
  530. }}</div>
  531. <div style="color:#20a0ff;"
  532. v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  533. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  534. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime > reportTimeType.allday">
  535. {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  536. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
  537. }}</div>
  538. <div v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  539. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length > 0 && scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  540. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime == reportTimeType.allday">
  541. {{scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  542. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') )[0].workingTime
  543. }}</div>
  544. <div v-if="scope.row.worktimeList.filter(w=>w.createDate.split('-')[2] == item.date.split('月')[1].replace('日','')
  545. || w.createDate.split('-')[2] == '0'+item.date.split('月')[1].replace('日','') ).length == 0">
  546. 0
  547. </div>
  548. </template>
  549. </el-table-column>
  550. </el-table>
  551. <div slot="title" class="dialog-title">
  552. <label style="font-size:16px;">员工每日填报工时数</label>
  553. <el-link type="primary" style="float:right;margin-right:60px;" @click="exportMembWorkHours()" >导出数据</el-link>
  554. <!-- <el-button >导出</el-button> -->
  555. </div>
  556. </el-dialog>
  557. <!--驳回弹出框 -->
  558. <el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  559. <div>
  560. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'" />
  561. </div>
  562. <div slot="footer" class="dialog-footer">
  563. <el-button @click="denyReasonDialog = false" >取消</el-button>
  564. <el-button type="primary" @click="deny()" >确定</el-button>
  565. </div>
  566. </el-dialog>
  567. <!--批量导入日报 -->
  568. <el-dialog title="工时批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  569. <p>1. 下载
  570. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/员工工时统计模板2.xlsx" download="员工工时导入模板.xlsx">员工工时统计模板.xlsx</el-link>
  571. </p>
  572. <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p>
  573. <p style="display: flex;justify-content: center;">
  574. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  575. <el-button type="primary" :underline="false" >开始导入</el-button>
  576. </el-upload>
  577. </p>
  578. </el-dialog>
  579. <!--基于企业微信考勤数据的工时导入 -->
  580. <el-dialog title="工时批量代填" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="650px">
  581. <el-steps :active="active" finish-status="success">
  582. <el-step title="选择要导入工时的日期范围">
  583. </el-step>
  584. <el-step title="下载带考勤数据的模板"></el-step>
  585. <el-step title="填写模板,上传数据"></el-step>
  586. </el-steps>
  587. <div v-if="active==0" style="padding:30px;height:360px;">
  588. <div style="margin-top:50px;margin-left:80px;">
  589. <el-date-picker
  590. v-model="importWxParam.date" :editable="false"
  591. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  592. :clearable="true"
  593. range-separator="至"
  594. type="daterange"
  595. start-placeholder="开始日期"
  596. end-placeholder="结束日期"
  597. @change="loadCheckInData"
  598. ></el-date-picker>
  599. </div>
  600. </div>
  601. <div v-if="active==1" style="padding:10px;">
  602. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  603. style="width: 100%;margin-top:5px;" >
  604. <el-table-column prop="createDate" label="工作日期" ></el-table-column>
  605. <el-table-column prop="username" label="员工姓名" ></el-table-column>
  606. <el-table-column prop="startTime" label="上班时间" ></el-table-column>
  607. <el-table-column prop="endTime" label="下班时间" ></el-table-column>
  608. <el-table-column prop="workHours" label="工作时长" >
  609. <template slot-scope="scope">
  610. {{scope.row.workHours.toFixed(1)}}h
  611. </template>
  612. </el-table-column>
  613. </el-table>
  614. </div>
  615. <div v-if="active==2" >
  616. <p style="display: flex;justify-content: center;height:390px;">
  617. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  618. <el-button type="primary" :underline="false" >选择文件并上传</el-button>
  619. </el-upload>
  620. </p>
  621. </div>
  622. <el-button style="margin: 0 auto;" @click="pre">上一步</el-button>
  623. <el-button style="float:right;" @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
  624. <el-link v-if="active==1" style="float:right;margin-right:150px;margin-top:10px;"
  625. type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
  626. </el-dialog>
  627. <!--基于企业微信考勤数据的工时导入 -->
  628. <el-dialog title="工时批量代填" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  629. <div>
  630. <span>选择日期范围:</span><el-date-picker
  631. v-model="importWxParam.date" :editable="false"
  632. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  633. :clearable="true"
  634. range-separator="至"
  635. type="daterange"
  636. start-placeholder="开始日期"
  637. end-placeholder="结束日期"
  638. @change="loadCheckInData"
  639. ></el-date-picker>
  640. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">提交</el-button>
  641. </div>
  642. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  643. :key="timeStamp"
  644. style="width: 100%;margin-top:5px;" ref="tab">
  645. <el-table-column prop="createDate" label="工作日期" width="100px" fixed="left"></el-table-column>
  646. <el-table-column prop="username" label="员工姓名" width="80px" fixed="left"></el-table-column>
  647. <el-table-column prop="startTime" label="上班时间" width="80px" fixed="left"></el-table-column>
  648. <el-table-column prop="endTime" label="下班时间" width="80px" fixed="left"></el-table-column>
  649. <el-table-column prop="workHours" label="工作时长" width="80px" align="right" fixed="left">
  650. <template slot-scope="scope">
  651. {{scope.row.workHours.toFixed(1)}}h
  652. </template>
  653. </el-table-column>
  654. <!--项目名称列表 -->
  655. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  656. <template slot-scope="scope">
  657. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  658. </template>
  659. </el-table-column>
  660. <el-table-column prop="totalFillTime" label="总工时" fixed="right">
  661. <template slot-scope="scope">
  662. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  663. </template>
  664. </el-table-column>
  665. </el-table>
  666. </el-dialog>
  667. </section>
  668. </template>
  669. <script>
  670. import util from "../../common/js/util";
  671. export default {
  672. data() {
  673. return {
  674. timeStamp: 0,
  675. projectColumns:[],
  676. checkinLoading:false,
  677. importWxParam:{date:null,},
  678. active:0,
  679. importWxDialog:false,
  680. importDialog:false,
  681. denyForm:null,
  682. denyReasonDialog:false,
  683. monthWorkTimeDialog: false,
  684. isSubstitude:false,
  685. isFill:false,
  686. unFillList:[],
  687. fillList:[],
  688. fillMembList:[],
  689. membListVisible: false,
  690. isBatch:0,//是否是批量填报
  691. weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  692. statusStyle:["waiting", "filledReportStyle", "RejectStyle", ""],
  693. fillStatusList: [],
  694. exportParam:{projectId: null, dateRange:[]},
  695. exportDialog:false,
  696. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  697. subProjectList:[],
  698. canEdit: true,
  699. 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],
  700. selectTime:null,
  701. reportTimeType:{},
  702. curDate:'',
  703. isAllSelect: false,
  704. approveDialogVisible:false,
  705. deptId:null,
  706. targetUid: null,
  707. membCount:0,
  708. selectState:"-1",
  709. user: JSON.parse(sessionStorage.getItem("user")),
  710. showAddMore:false,
  711. allDate: [],
  712. typeList:['全天','上午','下午'],
  713. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  714. choseDay: 0,
  715. tableHeight: 0,
  716. listLoading: false,
  717. projectList: [], //项目列表
  718. reportList: [], //日报列表
  719. reportNames:[], //批量审批列表
  720. dialogVisible: false, //项目弹窗
  721. report: '',
  722. workForm: {
  723. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  724. domains: [{
  725. id: null,
  726. projectId: "",
  727. workingTime: "",
  728. timeType:0,
  729. content: "",
  730. state: 2,
  731. multiWorktime:0,
  732. worktimeList:[],
  733. degreeId: null
  734. }],
  735. },
  736. workRules: {
  737. createDate: [{ required: true, message: "请选择工作日期", trigger: "change" }],
  738. },
  739. chooseParticipVisible: false,
  740. logining: false,
  741. isDisable: false,
  742. timeType:[],
  743. deptMembData: [
  744. ],
  745. //部门人员树状结构
  746. data: [
  747. {
  748. id: -1,
  749. label: '全部人员',
  750. membCount:0
  751. },
  752. {
  753. id: 0,
  754. label: '未分配',
  755. }
  756. ],
  757. allData:{},
  758. batchShowData:{},
  759. option: [],
  760. depData: {
  761. id: -1,
  762. label: '全部人员',
  763. },
  764. defaultProps: {
  765. children: 'children',
  766. label: 'label'
  767. },
  768. isNew: false,
  769. selected: false,
  770. valuet: new Date(),
  771. domObj: null,
  772. participator:[],
  773. chosenMembCount:0,
  774. jsDay: 0,
  775. jsTime: 0,
  776. falsss: false,
  777. weidu: [],
  778. weiduList: [],
  779. yonghuUser: [],
  780. dateAr: [],
  781. batchSubFillDialog: false
  782. };
  783. },
  784. methods: {
  785. //下载带企业微信考勤数据的工时统计模板
  786. downloadCheckInExcel() {
  787. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  788. startDate: this.importWxParam.date[0],
  789. endDate: this.importWxParam.date[1],
  790. },
  791. res => {
  792. if (res.code == "ok") {
  793. var filePath = res.data;
  794. const a = document.createElement('a'); // 创建a标签
  795. var data = filePath.split("\\.");
  796. a.setAttribute('download', data[data.length-1]);// download属性
  797. a.setAttribute('href', filePath);// href链接
  798. a.click(); //自执行点击事件
  799. a.remove();
  800. }
  801. },
  802. error => {
  803. this.checkinLoading = false;
  804. this.$message({
  805. message: error,
  806. type: "error"
  807. });
  808. }
  809. );
  810. },
  811. pre() {
  812. if (this.active == 0) return;
  813. this.active--;
  814. },
  815. next() {
  816. this.active++;
  817. },
  818. triggerTotalTime(index) {
  819. var item = this.checkinList[index];
  820. var total = 0.0;
  821. for (var i=0;i<this.projectColumns.length; i++) {
  822. var key = this.projectColumns[i];
  823. if (item[key] != null && item[key] != '') {
  824. total += parseFloat(item[key]);
  825. }
  826. }
  827. console.log(total);
  828. item.totalFillTime = total;
  829. },
  830. //提交批量代填的数据
  831. submitBatchSubFillData() {
  832. var data = JSON.stringify(this.checkinList);
  833. this.http.post('/user-corpwx-time/submitProjectTime',{
  834. json: data,
  835. projectColumns: JSON.stringify(this.projectColumns)
  836. },
  837. res => {
  838. if (res.code == "ok") {
  839. this.$message({message:'提交成功', type:'success'});
  840. this.importWxDialog = false;
  841. }
  842. },
  843. error => {
  844. this.checkinLoading = false;
  845. this.$message({
  846. message: error,
  847. type: "error"
  848. });
  849. }
  850. );
  851. },
  852. loadCheckInData() {
  853. if (this.importWxParam.date == null) {
  854. this.checkinList = [];
  855. return;
  856. }
  857. this.checkinLoading = true;
  858. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  859. startDate: this.importWxParam.date[0],
  860. endDate: this.importWxParam.date[1],
  861. },
  862. res => {
  863. if (res.code == "ok") {
  864. this.checkinLoading = false;
  865. this.checkinList = res.data.list;
  866. this.projectColumns = res.data.projects;
  867. console.log(res.data);
  868. // 自定义表格会导致表格错乱,需重新计算表格
  869. this.$nextTick(()=>{
  870. this.$refs.tab.doLayout()
  871. })
  872. }
  873. },
  874. error => {
  875. this.checkinLoading = false;
  876. this.$message({
  877. message: error,
  878. type: "error"
  879. });
  880. }
  881. );
  882. },
  883. batchImportWxData(item) {
  884. //首先判断文件类型
  885. let str = item.file.name.split(".");
  886. let format = str[str.length - 1];
  887. if (format != "xls" && format != "xlsx") {
  888. this.$message({
  889. message: "请选择.xls或.xlsx文件",
  890. type: "error"
  891. });
  892. } else {
  893. this.listLoading = true;
  894. let formData = new FormData();
  895. formData.append("file", item.file);
  896. formData.append("companyId", this.user.companyId);
  897. formData.append("withCheckIn", 1);
  898. this.http.uploadFile('/report/importData', formData,
  899. res => {
  900. this.$refs.upload.clearFiles();
  901. this.listLoading = false;
  902. if (res.code == "ok") {
  903. this.$message({
  904. message: "成功导入"+res.data+"名人员的工时数据",
  905. type: "success"
  906. });
  907. this.getReportList();
  908. this.importWxDialog = false;
  909. } else {
  910. this.$message({
  911. message: res.msg,
  912. type: "error"
  913. });
  914. }
  915. },
  916. error => {
  917. this.$refs.upload.clearFiles();
  918. this.listLoading = false;
  919. this.$message({
  920. message: error,
  921. type: "error"
  922. });
  923. });
  924. }
  925. },
  926. batchImportData(item) {
  927. //首先判断文件类型
  928. let str = item.file.name.split(".");
  929. let format = str[str.length - 1];
  930. if (format != "xls" && format != "xlsx") {
  931. this.$message({
  932. message: "请选择.xls或.xlsx文件",
  933. type: "error"
  934. });
  935. } else {
  936. this.listLoading = true;
  937. let formData = new FormData();
  938. formData.append("file", item.file);
  939. formData.append("companyId", this.user.companyId);
  940. this.http.uploadFile('/report/importData', formData,
  941. res => {
  942. this.$refs.upload.clearFiles();
  943. this.listLoading = false;
  944. if (res.code == "ok") {
  945. this.$message({
  946. message: "成功导入"+res.data+"名人员的工时数据",
  947. type: "success"
  948. });
  949. this.getReportList();
  950. this.importDialog = false;
  951. } else {
  952. this.$message({
  953. message: res.msg,
  954. type: "error"
  955. });
  956. }
  957. },
  958. error => {
  959. this.$refs.upload.clearFiles();
  960. this.listLoading = false;
  961. this.$message({
  962. message: error,
  963. type: "error"
  964. });
  965. });
  966. }
  967. },
  968. userssHu() {
  969. this.http.post('/time-type/getCompanyTimeSetting',{
  970. companyId: this.user.companyId
  971. },
  972. res => {
  973. if (res.code == "ok") {
  974. this.yonghuUser = res.data
  975. console.log(this.yonghuUser)
  976. }
  977. },
  978. error => {
  979. this.$message({
  980. message: error,
  981. type: "error"
  982. });
  983. }
  984. );
  985. },
  986. iptBlur(i) {
  987. console.log(i)
  988. // console.log(this.workForm.createDate)
  989. if(this.isBatch == 0) {
  990. return
  991. }
  992. var stat = this.workForm.createDate[0]
  993. var end = this.workForm.createDate[1]
  994. // this.jsDay = 10
  995. this.http.post('/report/getWorkDays',{
  996. startDate: stat,
  997. endDate: end
  998. },
  999. res => {
  1000. if (res.code == "ok") {
  1001. // console.log(res, '出来的数据')
  1002. this.jsDay = res.data
  1003. this.chuji(i)
  1004. }
  1005. },
  1006. error => {
  1007. this.$message({
  1008. message: error,
  1009. type: "error"
  1010. });
  1011. }
  1012. );
  1013. var sl = this.workForm.domains
  1014. this.chuji(i)
  1015. // console.log(this.workForm, '看看')
  1016. },
  1017. chuji(i) {
  1018. console.log(12345, i)
  1019. if(i == 0) {
  1020. this.seleChn(1)
  1021. } else if(i == 1) {
  1022. this.seleChn(0)
  1023. } else if(i == 2) {
  1024. if(this.workForm.domains[0].multiWorktime > 0) {
  1025. console.log('触发上面的')
  1026. this.iptChangs()
  1027. } else {
  1028. console.log('触发下面的')
  1029. this.iptChang()
  1030. }
  1031. } else if(i == 3) {
  1032. this.seleChn(0)
  1033. }
  1034. },
  1035. seleChn(e) {
  1036. console.log('出发了', e)
  1037. if(e == 1) {
  1038. for(var i in this.workForm.domains) {
  1039. if(this.workForm.domains[i].timeType == 0) {
  1040. this.workForm.domains[i].workingTime = 8
  1041. } else {
  1042. this.workForm.domains[i].workingTime = 4
  1043. }
  1044. }
  1045. }
  1046. var quanbu = 0
  1047. var spl = this.workForm.domains
  1048. var zhi = ''
  1049. for(var i in spl) {
  1050. var sp = +spl[i].workingTime + 0
  1051. zhi = this.jsDay * sp
  1052. quanbu = +quanbu + zhi
  1053. }
  1054. this.jsTime = quanbu
  1055. },
  1056. iptChang() {
  1057. var sl = this.workForm.domains
  1058. var quanbu = 0
  1059. var zhi = ''
  1060. for(var i in sl) {
  1061. if(sl[i].startTime && sl[i].endTime) {
  1062. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  1063. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  1064. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1065. var leave1=date3%(24*3600*1000)
  1066. var hours=Math.floor(leave1/(3600*1000))
  1067. var leave2=leave1%(3600*1000)
  1068. var minutes=Math.floor(leave2/(60*1000))
  1069. var shi = hours+'.'+ minutes
  1070. var sll = +shi + 0
  1071. zhi = this.jsDay * sll
  1072. quanbu = +quanbu + zhi
  1073. }
  1074. }
  1075. this.jsTime = quanbu
  1076. },
  1077. iptChangs() {
  1078. console.log(this.workForm)
  1079. var sl = this.workForm.domains
  1080. var quanbu = 0
  1081. var zhi = ''
  1082. for(var i in sl) {
  1083. for(var j in sl[i].worktimeList){
  1084. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  1085. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  1086. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  1087. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1088. var leave1=date3%(24*3600*1000)
  1089. var hours=Math.floor(leave1/(3600*1000))
  1090. var leave2=leave1%(3600*1000)
  1091. var minutes=Math.floor(leave2/(60*1000))
  1092. var shi = hours+'.'+ minutes
  1093. var sll = +shi + 0
  1094. zhi = this.jsDay * sll
  1095. quanbu = +quanbu + zhi
  1096. }
  1097. }
  1098. }
  1099. this.jsTime = quanbu
  1100. },
  1101. removeTimeItem(item, index) {
  1102. // console.log(1234)
  1103. item.worktimeList.splice(index, 1);
  1104. this.iptChangs()
  1105. },
  1106. //添加工时
  1107. addNewWorktime(index, item) {
  1108. item.worktimeList.push({});
  1109. },
  1110. //复制项目
  1111. copyProject(index) {
  1112. var leftProgress = 10;
  1113. if (this.reportTimeType.type == 3) {
  1114. //计算已经待分配工时比例
  1115. let array = this.workForm.domains;
  1116. let totalProgress = 0;
  1117. for (var i=0;i<array.length; i++) {
  1118. totalProgress += array[i].progress;
  1119. }
  1120. if (totalProgress < 100) {
  1121. leftProgress = 100 - totalProgress;
  1122. }
  1123. }
  1124. var newIndex = index+1;
  1125. var itemDomain = {
  1126. projectId: this.workForm.domains[index].projectId,
  1127. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  1128. content: "",
  1129. progress:leftProgress,
  1130. state:2,//2-表示待提交
  1131. };
  1132. this.workForm.domains.splice(newIndex, 0,itemDomain);
  1133. if (this.reportTimeType.type == 0) {
  1134. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  1135. var length = this.workForm.domains.length;
  1136. if (length == 2) {
  1137. this.showAddMore = false;
  1138. }
  1139. }
  1140. this.selectProject(itemDomain, newIndex);
  1141. },
  1142. //导出员工每日填报工时数
  1143. exportMembWorkHours() {
  1144. this.http.post('/report/exportUserDailyWorkTime',{
  1145. month: this.date
  1146. },
  1147. res => {
  1148. if (res.code == "ok") {
  1149. var url = res.data;
  1150. this.downloadByA("人员每日工时统计.xls", url);
  1151. }
  1152. },
  1153. error => {
  1154. this.$message({
  1155. message: error,
  1156. type: "error"
  1157. });
  1158. }
  1159. );
  1160. },
  1161. downloadByA(name, url) {
  1162. const a = document.createElement('a'); // 创建a标签
  1163. a.setAttribute('download', name);// download属性
  1164. a.setAttribute('href', url);// href链接
  1165. a.click();// 自执行点击事件
  1166. a.remove();
  1167. },
  1168. showMonthWorkTime() {
  1169. this.monthWorkTimeDialog = true;
  1170. this.http.post('/report/getUserDailyWorkTime',{
  1171. month: this.date
  1172. },
  1173. res => {
  1174. if (res.code == "ok") {
  1175. this.monthWorkData = res.data.list;
  1176. // console.log('获取到数据:'+this.monthWorkData[0].name+', daytime='+this.reportTimeType.allday);
  1177. this.$forceUpdate();
  1178. }
  1179. },
  1180. error => {
  1181. this.$message({
  1182. message: error,
  1183. type: "error"
  1184. });
  1185. }
  1186. );
  1187. },
  1188. onProgressChange() {
  1189. this.$forceUpdate();
  1190. },
  1191. showChooseMembTree() {
  1192. this.chosenMembCount = this.participator.length;
  1193. this.chooseParticipVisible = true;
  1194. },
  1195. onTreeItemChange() {
  1196. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1197. var list = chosenList.filter(item=>item.isUser == 1);
  1198. this.chosenMembCount = list.length;
  1199. },
  1200. findUserInTree() {
  1201. if (this.filterName == '') {
  1202. this.deptMembData = this.allMembData;
  1203. } else {
  1204. var list = this.findRecursively(this.filterName, this.allMembData);
  1205. this.deptMembData = list;
  1206. }
  1207. },
  1208. findRecursively(username, list) {
  1209. var filterList = [];
  1210. for (var i=0;i<list.length; i++) {
  1211. if (list[i].isUser == 1) {
  1212. if (list[i].label.indexOf(username) >= 0) {
  1213. //匹配上了
  1214. filterList.push(list[i]);
  1215. }
  1216. } else if (list[i].children != null && list[i].children.length > 0) {
  1217. var subList = this.findRecursively(username, list[i].children);
  1218. if (subList.length > 0) {
  1219. subList.forEach(s=>filterList.push(s));
  1220. }
  1221. }
  1222. }
  1223. return filterList;
  1224. },
  1225. //确定选择参与人
  1226. chooseParticip() {
  1227. this.chooseParticipVisible = false;
  1228. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  1229. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  1230. this.workForm.userNames = '';
  1231. this.workForm.userId = [];
  1232. this.participator = [];
  1233. for (var i=0;i<this.chosenMembList.length; i++) {
  1234. this.workForm.userId.push(this.chosenMembList[i].id);
  1235. this.workForm.userNames += this.chosenMembList[i].label+',';
  1236. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  1237. this.participator.push(item);
  1238. }
  1239. if (this.workForm.userNames.length > 0) {
  1240. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  1241. }
  1242. },
  1243. //微信通知人员填写
  1244. weixinNotify() {
  1245. if (this.fillMembList.length == 0) return;
  1246. var ids = '';
  1247. this.fillMembList.forEach(f=>{
  1248. ids += f.id+',';
  1249. })
  1250. this.http.post('/user/pushFillReport',{
  1251. ids: ids, date: this.curDate
  1252. },
  1253. res => {
  1254. if (res.code == "ok") {
  1255. this.$message({
  1256. message: '已发送成功',
  1257. type: "success"
  1258. });
  1259. }
  1260. },
  1261. error => {
  1262. this.$message({
  1263. message: error,
  1264. type: "error"
  1265. });
  1266. }
  1267. );
  1268. },
  1269. //导出人员列表
  1270. exportMemb() {
  1271. if (this.fillMembList.length == 0) return;
  1272. var ids = '';
  1273. this.fillMembList.forEach(f=>{
  1274. ids += f.id+',';
  1275. })
  1276. this.http.post('/user/exportMembList',{
  1277. ids: ids,isFill: this.isFill, date: this.curDate
  1278. },
  1279. res => {
  1280. if (res.code == "ok") {
  1281. var aTag = document.createElement('a');
  1282. aTag.download = this.curDate+(this.isFill?"已填":"未填")+"人员列表.xls";
  1283. aTag.href = res.data;
  1284. aTag.click();
  1285. }
  1286. },
  1287. error => {
  1288. this.$message({
  1289. message: error,
  1290. type: "error"
  1291. });
  1292. }
  1293. );
  1294. },
  1295. showMembList(fill) {
  1296. this.membListVisible = true;
  1297. if (fill == 0) {
  1298. this.fillMembList = this.unFillList;
  1299. this.isFill = false;
  1300. } else {
  1301. this.fillMembList = this.fillList;
  1302. this.isFill = true;
  1303. }
  1304. },
  1305. //获取自己填写的日报状态
  1306. getReportFillStatus() {
  1307. this.http.post('/report/getReportFillStatus',{
  1308. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  1309. },
  1310. res => {
  1311. if (res.code == "ok") {
  1312. this.fillStatusList = res.data;
  1313. this.allDate.forEach(d=>{
  1314. var fillInfo = null;
  1315. d.state = null;
  1316. this.fillStatusList.forEach(s=>{
  1317. var d1 = s.createDate.split('-')[2];
  1318. var d2 = d.date.split('月')[1].split('日')[0];
  1319. if (d1.indexOf('0') == 0) {
  1320. d1 = d1.substring(1,d1.length);
  1321. }
  1322. if (d1 == d2) {
  1323. d.state = s.state;
  1324. }
  1325. })
  1326. })
  1327. this.$forceUpdate();
  1328. }
  1329. },
  1330. error => {
  1331. this.$message({
  1332. message: error,
  1333. type: "error"
  1334. });
  1335. }
  1336. );
  1337. },
  1338. scrollFunction () {
  1339. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  1340. if (this.domObj.attachEvent) { // IE
  1341. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  1342. } else if (this.domObj.addEventListener) {
  1343. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  1344. }
  1345. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  1346. },
  1347. mouseScroll(event) { // google 浏览器下
  1348. let detail = event.wheelDelta || event.detail
  1349. let moveForwardStep = -1
  1350. let moveBackStep = 1
  1351. let step = 0
  1352. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  1353. event.preventDefault() // 阻止浏览器默认事件
  1354. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  1355. },
  1356. // //左右滚动
  1357. // wheel(e){
  1358. // var a = document.getElementById("dateScroll");
  1359. // var scroll_width = 80; //滚动一下的距离
  1360. // var e = e || window.event, v;
  1361. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  1362. // if(v>3||-v>3) v=-v;
  1363. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  1364. // e.preventDefault(); //阻止浏览器的默认滚动
  1365. // },
  1366. showExportDialog() {
  1367. this.exportDialog = true;
  1368. },
  1369. changeAllTime() {
  1370. //总时长发生改变,自动按比例计算
  1371. this.workForm.domains.forEach(d=>{
  1372. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  1373. });
  1374. },
  1375. // 是否加班的单机事件
  1376. check() {
  1377. this.selected = !this.selected
  1378. this.isNew = this.selected
  1379. },
  1380. //项目选中了, 加载子项目
  1381. selectProject(domain, index) {
  1382. this.http.post('/sub-project/list',{
  1383. projectId: domain.projectId
  1384. },
  1385. res => {
  1386. if (res.code == "ok") {
  1387. this.workForm.domains[index].subProjectList = res.data;
  1388. this.$forceUpdate();
  1389. }
  1390. },
  1391. error => {
  1392. this.$message({
  1393. message: error,
  1394. type: "error"
  1395. });
  1396. }
  1397. );
  1398. //项目相关的近期任务
  1399. if (this.user.company.packageProject == 1) {
  1400. this.http.post('/task/getRecentTask',{
  1401. projectId: domain.projectId,
  1402. isSubstitude:this.isSubstitude?1:0
  1403. },
  1404. res => {
  1405. if (res.code == "ok") {
  1406. this.workForm.domains[index].allTaskList = res.data;
  1407. this.workForm.domains[index].taskList = res.data;
  1408. this.$forceUpdate();
  1409. }
  1410. },
  1411. error => {
  1412. this.$message({
  1413. message: error,
  1414. type: "error"
  1415. });
  1416. }
  1417. );
  1418. }
  1419. //获取项目相关专业
  1420. if (this.user.company.packageEngineering == 1) {
  1421. this.getProjectProfessions(domain, index);
  1422. }
  1423. //获取项目相关的任务阶段
  1424. if (this.user.company.packageProject == 1) {
  1425. this.getProjectStages(domain, index);
  1426. }
  1427. // 获取项目相关的维度
  1428. this.dimension(domain, index)
  1429. },
  1430. // 获取维度数据
  1431. dimension(domain, index) {
  1432. console.log(domain)
  1433. if(domain.projectId == '') {
  1434. return
  1435. }
  1436. this.http.post('/project/getDegreeList',{
  1437. projectId: domain.projectId,
  1438. },
  1439. res => {
  1440. if (res.code == "ok") {
  1441. this.workForm.domains[index].wuduList = res.data
  1442. // this.workForm = this.workForm
  1443. this.$forceUpdate()
  1444. }
  1445. },
  1446. error => {
  1447. this.$message({
  1448. message: error,
  1449. type: "error"
  1450. });
  1451. }
  1452. );
  1453. },
  1454. //切换任务阶段
  1455. changeStages(domain, index) {
  1456. if (domain.stage == null || domain.stage == '') {
  1457. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  1458. } else {
  1459. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  1460. }
  1461. },
  1462. getProjectStages(domain, index) {
  1463. this.http.post("/stages/getProjectStages", {projectId: domain.projectId},
  1464. res => {
  1465. if (res.code == "ok") {
  1466. this.workForm.domains[index].stages = res.data;
  1467. this.$forceUpdate();
  1468. }
  1469. },
  1470. error => {
  1471. this.$message({
  1472. message: error,
  1473. type: "error"
  1474. });
  1475. });
  1476. },
  1477. getProjectProfessions(domain, index) {
  1478. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  1479. res => {
  1480. if (res.code == "ok") {
  1481. this.workForm.domains[index].professionProgress = res.data;
  1482. this.$forceUpdate();
  1483. }
  1484. },
  1485. error => {
  1486. this.$message({
  1487. message: error,
  1488. type: "error"
  1489. });
  1490. });
  1491. },
  1492. //删除自己的日报
  1493. deleteReport() {
  1494. this.$confirm("确定要删除该日报吗?","提示", {
  1495. confirmButtonText: "确定",
  1496. cancelButtonText: "取消",
  1497. type: "warning"
  1498. })
  1499. .then(() => {
  1500. this.listLoading = true;
  1501. this.http.post('/report/delete',{
  1502. userId: this.user.id,
  1503. date: this.workForm.createDate
  1504. },
  1505. res => {
  1506. this.listLoading = false;
  1507. if (res.code == "ok") {
  1508. this.$message({
  1509. message: "删除成功",
  1510. type: "success"
  1511. });
  1512. this.getReportList();
  1513. this.getDepartment();
  1514. this.dialogVisible = false;
  1515. } else {
  1516. this.$message({
  1517. message: res.msg,
  1518. type: "error"
  1519. });
  1520. }
  1521. },
  1522. error => {
  1523. this.listLoading = false;
  1524. this.$message({
  1525. message: error,
  1526. type: "error"
  1527. });
  1528. }
  1529. );
  1530. })
  1531. .catch(() => {});
  1532. },
  1533. //提交批量审核数据
  1534. submitBatchApprove() {
  1535. var data = this.$refs.approveTree.getCheckedNodes();
  1536. var ids = '';
  1537. if (data.length == 0) {
  1538. this.$message({
  1539. message: '请选择要审核的人员',
  1540. type: "error"
  1541. });
  1542. return;
  1543. }
  1544. for (var i=0;i<data.length; i++) {
  1545. ids += data[i].id;
  1546. if (i < data.length-1) {
  1547. ids += ',';
  1548. }
  1549. }
  1550. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  1551. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  1552. res => {
  1553. if (res.code == "ok") {
  1554. this.$message({
  1555. message: '审核成功',
  1556. type: "success"
  1557. });
  1558. this.getReportList();
  1559. this.getDepartment();
  1560. this.approveDialogVisible = false;
  1561. } else {
  1562. this.$message({
  1563. message: res.msg,
  1564. type: "error"
  1565. });
  1566. }
  1567. },
  1568. error => {
  1569. this.$message({
  1570. message: error,
  1571. type: "error"
  1572. });
  1573. });
  1574. },
  1575. selectAll() {
  1576. if (this.isAllSelect) {
  1577. var keys = [];
  1578. this.reportNames.forEach(b=>{
  1579. keys.push(b.id);
  1580. })
  1581. this.$refs.approveTree.setCheckedKeys(keys);
  1582. } else {
  1583. this.$refs.approveTree.setCheckedKeys([]);
  1584. }
  1585. },
  1586. //批量审核
  1587. batchApprove() {
  1588. this.approveDialogVisible = true;
  1589. this.reportNames = [];
  1590. for (var i=0;i<this.reportList.length; i++) {
  1591. var report = this.reportList[i];
  1592. var hasUnChecked =false;
  1593. var id = '';
  1594. for (var j=0;j<report.data.length; j++) {
  1595. if (report.data[j].state == 0) {
  1596. hasUnChecked = true;
  1597. id += report.data[j].id+',';
  1598. }
  1599. }
  1600. if (hasUnChecked) {
  1601. this.reportNames.push({id:id, label: report.name});
  1602. }
  1603. }
  1604. },
  1605. removeEmptyNode(list) {
  1606. for (var i=0;i<list.length;i++) {
  1607. var cnt = 0;
  1608. if (list[i].membCount == 0) {
  1609. list.splice(i, 1);
  1610. i--;
  1611. } else if (list[i].children != null) {
  1612. this.removeEmptyNode(list[i].children);
  1613. }
  1614. }
  1615. },
  1616. calculateMembCount(list) {
  1617. for (var i in list) {
  1618. var cnt = 0;
  1619. if (list[i].children != null) {
  1620. this.calculateMembCount(list[i].children);
  1621. for (var m in list[i].children) {
  1622. cnt += list[i].children[m].membCount;
  1623. }
  1624. }
  1625. if (list[i].isUser == 1) {
  1626. cnt++;
  1627. this.membCount++;
  1628. }
  1629. list[i].membCount = cnt;
  1630. }
  1631. },
  1632. stateChange() {
  1633. this.membCount = 0;
  1634. if (this.selectState == -1) {
  1635. //全部状态
  1636. this.data = this.allData;
  1637. } else {
  1638. //未填报
  1639. var newData = JSON.parse(JSON.stringify(this.allData));
  1640. this.filterState(this.selectState, newData);
  1641. this.data = newData;
  1642. }
  1643. this.calculateMembCount(this.data);
  1644. this.data[0].membCount = this.membCount;//总人数
  1645. },
  1646. //按状态过滤部门人员
  1647. filterState(state, list) {
  1648. for (var i =0;i<list.length; i++) {
  1649. var obj = list[i];
  1650. if (obj.isUser == 1) {
  1651. var match = false;
  1652. if (state == -2) {
  1653. if (obj.state == null) {
  1654. match = true;
  1655. }
  1656. } else {
  1657. if (obj.state == state) {
  1658. match = true;
  1659. }
  1660. }
  1661. if (!match) {
  1662. list.splice(i, 1);
  1663. i--;
  1664. } else {
  1665. }
  1666. } else {
  1667. if (obj.children != null) {
  1668. this.filterState(state, obj.children);
  1669. }
  1670. }
  1671. }
  1672. },
  1673. // 部门列表点击
  1674. handleNodeClick(data) {
  1675. this.depData = data;
  1676. var list = [];
  1677. if (data.id == -1) {
  1678. this.deptId = null;
  1679. this.targetUid = null;
  1680. list = this.data;
  1681. } else if (data.isUser == 1) {
  1682. this.deptId = null;
  1683. this.targetUid = data.id;
  1684. } else {
  1685. this.deptId = data.id;
  1686. this.targetUid = null;
  1687. list.push(data);
  1688. }
  1689. this.getReportList();
  1690. if (list.length > 0) {
  1691. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  1692. this.fillList = this.getUserMembListFromDeptList(list, 1);
  1693. }
  1694. },
  1695. //获取可以选择的代填的人员列表
  1696. getSubstitudeUserDeptList() {
  1697. if (this.deptMembData.length == 0) {
  1698. this.http.post("/department/listMyMembs", {},
  1699. res => {
  1700. if (res.code == "ok") {
  1701. let noAllData = JSON.parse(JSON.stringify(res.data));
  1702. if (noAllData.length > 0) {
  1703. if (noAllData[0].label == '全部人员') {
  1704. noAllData.splice(0,1);
  1705. }
  1706. }
  1707. this.setUserToDept(noAllData);
  1708. this.deptMembData = noAllData;
  1709. } else {
  1710. this.$message({
  1711. message: res.msg,
  1712. type: "error"
  1713. });
  1714. }
  1715. },
  1716. error => {
  1717. this.$message({
  1718. message: error,
  1719. type: "error"
  1720. });
  1721. });
  1722. }
  1723. },
  1724. // 获取部门列表
  1725. getDepartment() {
  1726. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  1727. var param = {date:this.date + day};
  1728. if (this.user.manageDeptId != 0) {
  1729. param.manageDeptId = this.user.manageDeptId;
  1730. }
  1731. this.http.post("/report/getMembList", param,
  1732. res => {
  1733. if (res.code == "ok") {
  1734. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1735. // let noAllData = JSON.parse(JSON.stringify(res.data));
  1736. if (this.user.role > 0) {
  1737. list.splice(0,0,{
  1738. id: -1,
  1739. label: '全部人员',
  1740. })
  1741. }
  1742. this.membCount = 0;
  1743. //设置员工到部门下面
  1744. this.setUserToDept(list);
  1745. this.data = list;
  1746. this.allData = list;
  1747. // if (noAllData.length > 0) {
  1748. // if (noAllData[0].label == '全部人员') {
  1749. // noAllData.splice(0,1);
  1750. // }
  1751. // }
  1752. // this.setUserToDept(noAllData);
  1753. // this.deptMembData = noAllData;
  1754. this.option = this.changeArr(list1);
  1755. list[0].membCount = this.membCount;
  1756. if (this.depData.id == -1) {
  1757. this.depData.membCount = this.membCount;
  1758. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  1759. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  1760. } else {
  1761. if (this.depData.isUser == null) {
  1762. var dep = this.findTargetDept(this.data, this.depData.id);
  1763. var membDeptList = [];
  1764. membDeptList.push(dep);
  1765. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  1766. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  1767. }
  1768. }
  1769. if (this.depData.isUser == null) {
  1770. if (this.isFill) {
  1771. this.fillMembList = this.fillList;
  1772. } else {
  1773. this.fillMembList = this.unFillList;
  1774. }
  1775. }
  1776. } else {
  1777. this.$message({
  1778. message: res.msg,
  1779. type: "error"
  1780. });
  1781. }
  1782. },
  1783. error => {
  1784. this.$message({
  1785. message: error,
  1786. type: "error"
  1787. });
  1788. });
  1789. this.getReportFillStatus();
  1790. },
  1791. findTargetDept(list, deptId) {
  1792. var t = null;
  1793. for (var i=0;i<list.length; i++) {
  1794. if (list[i].isUser == null && list[i].id == deptId) {
  1795. t = list[i];
  1796. break;
  1797. }
  1798. }
  1799. if (t == null) {
  1800. for (var i=0;i<list.length; i++) {
  1801. if (list[i].children != null && list[i].children.length > 0) {
  1802. t = this.findTargetDept(list[i].children, deptId);
  1803. if (t != null) {
  1804. break;
  1805. }
  1806. }
  1807. }
  1808. }
  1809. return t;
  1810. },
  1811. getUserMembListFromDeptList(list, isFill) {
  1812. var membList = [];
  1813. for (var i in list) {
  1814. var deptName = list[i].label;
  1815. if (list[i].userList != null) {
  1816. list[i].userList.forEach(element => {
  1817. if (isFill == 0) {
  1818. //获取未填的
  1819. if (element.state == null) {
  1820. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  1821. membList.push(obj);
  1822. }
  1823. } else {
  1824. if (element.state != null) {
  1825. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  1826. membList.push(obj);
  1827. }
  1828. }
  1829. });
  1830. }
  1831. if (list[i].children != null) {
  1832. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  1833. }
  1834. }
  1835. return membList;
  1836. },
  1837. setUserToDept(list) {
  1838. for (var i in list) {
  1839. var cnt = 0;
  1840. if (list[i].children != null) {
  1841. this.setUserToDept(list[i].children);
  1842. for (var m in list[i].children) {
  1843. cnt += list[i].children[m].membCount;
  1844. }
  1845. }
  1846. if (list[i].userList != null) {
  1847. if (list[i].children == null) {
  1848. list[i].children = [];
  1849. }
  1850. list[i].userList.forEach(element => {
  1851. var obj = {id: element.id, label:element.name, state:element.state, parentId:element.departmentId, isUser:1};
  1852. list[i].children.push(obj);
  1853. this.membCount++;
  1854. cnt++;
  1855. });
  1856. }
  1857. list[i].membCount = cnt;
  1858. }
  1859. },
  1860. // 修改数组
  1861. changeArr(arr) {
  1862. for (var i = 0; i < arr.length; i++) {
  1863. if(arr[i].id != -1 && arr[i].id != 0) {
  1864. if (arr[i].children != null && arr[i].children.length>0) {
  1865. arr[i].children = this.changeArr(arr[i].children);
  1866. }
  1867. arr[i].id && (arr[i].value = arr[i].id);
  1868. delete arr[i].id;
  1869. }
  1870. }
  1871. for(var i in arr) {
  1872. if(arr[i].id == -1 || arr[i].id == 0) {
  1873. arr.splice(i,1)
  1874. }
  1875. }
  1876. return arr;
  1877. },
  1878. //时间段范围设置改动,监听
  1879. onTimeTypeChange(timeType) {
  1880. this.seleChn(1)
  1881. this.showAddMore = true;
  1882. for(var i in this.workForm.domains) {
  1883. if (this.workForm.domains[i].timeType == 0) {
  1884. this.showAddMore = false;
  1885. break;
  1886. }
  1887. }
  1888. if (this.showAddMore) {
  1889. //检测数量
  1890. if (this.workForm.domains.length == 2) {
  1891. this.showAddMore = false;
  1892. } else {
  1893. this.showAddMore = true;
  1894. }
  1895. }
  1896. },
  1897. getTimeType() {
  1898. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  1899. res => {
  1900. if (res.code == "ok") {
  1901. var t = res.data;
  1902. this.reportTimeType = t;
  1903. if (this.reportTimeType.type > 0) {
  1904. this.showAddMore = true;
  1905. }
  1906. //转化时间格式
  1907. if (t.allday != null) {
  1908. this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  1909. }
  1910. if (t.am != null) {
  1911. this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  1912. }
  1913. if (t.pm != null) {
  1914. this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  1915. }
  1916. } else {
  1917. this.$message({
  1918. message: res.msg,
  1919. type: "error"
  1920. });
  1921. }
  1922. },
  1923. error => {
  1924. this.listLoading = false;
  1925. this.$message({
  1926. message: error,
  1927. type: "error"
  1928. });
  1929. });
  1930. },
  1931. // 改变月份
  1932. changeMonthOut() {
  1933. this.getAllDate();
  1934. this.getReportList();
  1935. this.getDepartment();
  1936. },
  1937. // 选择日期
  1938. choseDate(i, item) {
  1939. this.choseDay = i;
  1940. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  1941. sessionStorage.msg = this.date + day,
  1942. this.getReportList();
  1943. this.getDepartment();
  1944. this.curDate = item.date;
  1945. },
  1946. // 获取日期列表
  1947. getAllDate() {
  1948. var dayArry = [];
  1949. var day = this.getCountDays();
  1950. let curMonthDay = null;
  1951. for (var k = 1; k <= day; k++) {
  1952. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + "月" + k+'日';
  1953. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  1954. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  1955. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  1956. if(sessionStorage.msg) {
  1957. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  1958. this.choseDay = k - 1;
  1959. curMonthDay = str;
  1960. }
  1961. } else {
  1962. if (new Date().getDate() == k) {
  1963. this.choseDay = k - 1;
  1964. }
  1965. }
  1966. } else {
  1967. this.choseDay = 0;
  1968. }
  1969. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  1970. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  1971. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  1972. }
  1973. this.allDate = dayArry;
  1974. //不能超过最大日期
  1975. if (this.choseDay > day-1) {
  1976. this.choseDay = day-1;
  1977. }
  1978. //从消息点击跳转过来的,直接加载指定日期
  1979. if (sessionStorage.from == 1 && sessionStorage.msg) {
  1980. this.curDate = sessionStorage.msg;
  1981. sessionStorage.from = 0;
  1982. } else {
  1983. if (curMonthDay != null) {
  1984. this.curDate = curMonthDay;
  1985. } else {
  1986. var d = new Date(this.date.replace(/-/g, "/")+'/01')
  1987. this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  1988. }
  1989. }
  1990. this.getReportFillStatus();
  1991. },
  1992. getCountDays() {
  1993. var newstr = this.date.replace(/-/g, "/");
  1994. var curDate = new Date(newstr+'/01');
  1995. var curMonth = curDate.getMonth();
  1996. curDate.setMonth(curMonth + 1);
  1997. curDate.setDate(0);
  1998. return curDate.getDate();
  1999. },
  2000. //获取日报列表
  2001. getReportList() {
  2002. this.listLoading = true;
  2003. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2004. let param = {date: this.date + day};
  2005. if (this.deptId != null) {
  2006. param.deptId = this.deptId;
  2007. }
  2008. if (this.targetUid != null) {
  2009. param.userId = this.targetUid;
  2010. }
  2011. this.http.post( this.port.report.list, param,
  2012. res => {
  2013. this.listLoading = false;
  2014. if (res.code == "ok") {
  2015. this.reportList = res.data;
  2016. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  2017. } else {
  2018. this.$message({
  2019. message: res.msg,
  2020. type: "error"
  2021. });
  2022. }
  2023. },
  2024. error => {
  2025. this.listLoading = false;
  2026. this.$message({
  2027. message: error,
  2028. type: "error"
  2029. });
  2030. });
  2031. },
  2032. //导出日报
  2033. exportReport() {
  2034. this.listLoading = true;
  2035. var param = {};
  2036. if (this.exportParam.dateRange != null) {
  2037. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  2038. }
  2039. if (this.exportParam.projectId != null) {
  2040. param.projectId = this.exportParam.projectId;
  2041. }
  2042. this.http.post( this.port.report.export, param,
  2043. res => {
  2044. this.listLoading = false;
  2045. if (res.code == "ok") {
  2046. location.href = res.data;
  2047. this.exportDialog = false;
  2048. } else {
  2049. this.$message({
  2050. message: res.msg,
  2051. type: "error"
  2052. });
  2053. }
  2054. },
  2055. error => {
  2056. this.listLoading = false;
  2057. this.$message({
  2058. message: error,
  2059. type: "error"
  2060. });
  2061. });
  2062. },
  2063. //获取项目列表
  2064. getProjectList() {
  2065. this.listLoading = true;
  2066. this.http.post( this.port.project.list, {},
  2067. res => {
  2068. this.listLoading = false;
  2069. if (res.code == "ok") {
  2070. this.projectList = res.data;
  2071. } else {
  2072. this.$message({
  2073. message: res.msg,
  2074. type: "error"
  2075. });
  2076. }
  2077. },
  2078. error => {
  2079. this.listLoading = false;
  2080. this.$message({
  2081. message: error,
  2082. type: "error"
  2083. });
  2084. });
  2085. },
  2086. // 获取个人某天的日报
  2087. getReport() {
  2088. this.http.post( this.port.report.getPort, {
  2089. date: this.workForm.createDate
  2090. },
  2091. res => {
  2092. if (res.code == "ok") {
  2093. var quanbu = 0
  2094. this.jsDay = 1
  2095. var zhi = ''
  2096. var slp = res.data.report
  2097. for(var i in slp) {
  2098. var sp = +slp[i].workingTime + 0
  2099. zhi = this.jsDay * sp
  2100. quanbu = +quanbu + zhi
  2101. }
  2102. this.jsTime = quanbu
  2103. var list = res.data;
  2104. this.report = list;
  2105. if(list.report.length != 0) {
  2106. console.log('执行上面')
  2107. var arr = [];
  2108. this.canEdit = false;
  2109. for(var i in list.report) {
  2110. var flg = null
  2111. list.report[i].isOvertime == 1 ? flg = true : flg = false
  2112. // var srr = []
  2113. // if(list.report[i].degreeId != null) {
  2114. // var a = list.report[i].degreeId + ''
  2115. // var ace = a.split('')
  2116. // for(var b in ace) {
  2117. // var nnm = +ace[b] + 0
  2118. // srr.push(nnm)
  2119. // }
  2120. // }
  2121. arr.push({
  2122. id: list.report[i].id,
  2123. projectId: list.report[i].projectId,
  2124. workingTime: list.report[i].workingTime,
  2125. content: list.report[i].content,
  2126. state: list.report[i].state,
  2127. timeType: list.report[i].timeType,
  2128. subProjectList: list.report[i].subProjectList,
  2129. taskList: list.report[i].taskList,
  2130. subProjectId: list.report[i].subProjectId,
  2131. taskId: list.report[i].taskId,
  2132. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  2133. startTime: list.report[i].startTime,
  2134. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  2135. endTime: list.report[i].endTime,
  2136. isOvertime: flg,
  2137. progress:list.report[i].progress,
  2138. professionProgress: list.report[i].professionProgressList,
  2139. stages:list.report[i].stages,
  2140. stage:list.report[i].stage,
  2141. pics: list.report[i].pics,
  2142. multiWorktime: list.report[i].multiWorktime,
  2143. worktimeList: list.report[i].worktimeList,
  2144. degreeId: list.report[i].degreeId,
  2145. wuduList: list.report[i].degreeList,
  2146. })
  2147. if (list.report[i].state >= 2) {
  2148. this.canEdit = true;
  2149. }
  2150. }
  2151. this.workForm = {
  2152. createDate: this.workForm.createDate,
  2153. domains: arr,
  2154. userNames:null,
  2155. userId:null,
  2156. }
  2157. console.log(this.workForm, '数据')
  2158. } else {
  2159. this.workForm = {
  2160. createDate: this.workForm.createDate,
  2161. domains: [{
  2162. id: null,
  2163. projectId: "",
  2164. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  2165. content: "",
  2166. progress:100,
  2167. state: 2,
  2168. timeType:0,
  2169. multiWorktime: this.reportTimeType.multiWorktime,
  2170. worktimeList:[{}],
  2171. }],
  2172. userId:null,
  2173. userNames:null,
  2174. }
  2175. this.canEdit = true;
  2176. }
  2177. } else {
  2178. this.$message({
  2179. message: res.msg,
  2180. type: "error"
  2181. });
  2182. }
  2183. },
  2184. error => {
  2185. this.$message({
  2186. message: error,
  2187. type: "error"
  2188. });
  2189. });
  2190. },
  2191. guanbi() {
  2192. this.falsss = false
  2193. },
  2194. // wuduLists(id) {
  2195. // console.log(id)
  2196. // this.http.post('/project/getDegreeList',{
  2197. // projectId: id,
  2198. // },
  2199. // res => {
  2200. // if (res.code == "ok") {
  2201. // return res.data
  2202. // }
  2203. // },
  2204. // error => {
  2205. // this.$message({
  2206. // message: error,
  2207. // type: "error"
  2208. // });
  2209. // }
  2210. // );
  2211. // },
  2212. // 打开日报填写
  2213. fillInReport(i, isBatch) {
  2214. if(i != 1) {
  2215. this.falsss = false
  2216. } else {
  2217. this.falsss = true
  2218. }
  2219. if (this.isSubstitude) {
  2220. this.getSubstitudeUserDeptList();
  2221. }
  2222. if(i == -1 || this.isSubstitude) {
  2223. this.isDisable = false;
  2224. } else {
  2225. this.isDisable = true;
  2226. }
  2227. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2228. this.isBatch = isBatch;
  2229. if (this.isBatch == 0 && !this.isSubstitude) {
  2230. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  2231. this.getReport(i);
  2232. } else {
  2233. this.workForm = {
  2234. createDate: null,//批量填报没有日期
  2235. domains: [{
  2236. id: null,
  2237. projectId: "",
  2238. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  2239. content: "",
  2240. progress:100,
  2241. state: 2,
  2242. timeType:0,
  2243. multiWorktime: this.reportTimeType.multiWorktime,
  2244. worktimeList:[{}],
  2245. }],
  2246. }
  2247. this.canEdit = true;
  2248. }
  2249. this.dialogVisible = true;
  2250. },
  2251. // 添加模块
  2252. addDomain(i) {
  2253. var leftProgress = 10;
  2254. if (this.reportTimeType.type == 3) {
  2255. //计算已经待分配工时比例
  2256. let array = this.workForm.domains;
  2257. let totalProgress = 0;
  2258. for (var i=0;i<array.length; i++) {
  2259. totalProgress += array[i].progress;
  2260. }
  2261. if (totalProgress < 100) {
  2262. leftProgress = 100 - totalProgress;
  2263. }
  2264. }
  2265. this.workForm.domains.push({
  2266. projectId: "",
  2267. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2268. content: "",
  2269. progress:leftProgress,
  2270. state:2,//2-表示待提交
  2271. multiWorktime: this.reportTimeType.multiWorktime,
  2272. worktimeList:[{}],
  2273. // degreeId: '',
  2274. });
  2275. if (this.reportTimeType.type == 0) {
  2276. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2277. var length = this.workForm.domains.length;
  2278. if (length == 2) {
  2279. this.showAddMore = false;
  2280. }
  2281. }
  2282. this.chuji()
  2283. },
  2284. // 移除模块
  2285. delDomain(i) {
  2286. this.workForm.domains.splice(i,1)
  2287. //检测当前剩下的一个,时间类型是否是全天
  2288. if (this.reportTimeType.type == 0) {
  2289. if (this.workForm.domains[0].timeType == 0) {
  2290. this.showAddMore = false;
  2291. } else {
  2292. this.showAddMore = true;
  2293. }
  2294. }
  2295. if(this.user.timeType.multiWorktime == 1) {
  2296. this.iptChangs()
  2297. } else {
  2298. this.seleChn(0)
  2299. }
  2300. },
  2301. // 改变月份
  2302. changeMonth() {
  2303. if (this.isBatch == 0 && !this.isSubstitude) {
  2304. //只有按天填报才能获取当天的日报
  2305. this.getReport()
  2306. }
  2307. },
  2308. // 判断时间段
  2309. fns() {
  2310. for (let k in this.dateAr) {
  2311. if (!this.judege(k)) {
  2312. return false
  2313. }
  2314. }
  2315. return true
  2316. },
  2317. judege(idx){
  2318. for (let k in this.dateAr) {
  2319. if (idx !== k) {
  2320. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  2321. return false
  2322. }
  2323. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  2324. return false
  2325. }
  2326. }
  2327. }
  2328. return true
  2329. },
  2330. // 保存日报
  2331. submitDepartment() {
  2332. this.$refs.workForm.validate(valid => {
  2333. if (valid) {
  2334. this.dateAr = []
  2335. let alp = []
  2336. if(this.user.timeType.multiWorktime != 1) {
  2337. for(var p in this.workForm.domains) {
  2338. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  2339. let objs = {}
  2340. objs.s = this.workForm.domains[p].startTime
  2341. objs.e = this.workForm.domains[p].endTime
  2342. alp.push(objs)
  2343. }
  2344. }
  2345. this.dateAr = alp
  2346. if(this.dateAr.length > 0) {
  2347. let trus = this.fns()
  2348. if(!trus) {
  2349. this.$message({
  2350. message: '填写的时间段重叠',
  2351. type: "error"
  2352. });
  2353. return
  2354. }
  2355. }
  2356. } else {
  2357. for(var p in this.workForm.domains) {
  2358. var slll = this.workForm.domains[p]
  2359. for(var o in slll.worktimeList) {
  2360. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  2361. let objs = {}
  2362. objs.s = slll.worktimeList[o].startTime
  2363. objs.e = slll.worktimeList[o].endTime
  2364. alp.push(objs)
  2365. }
  2366. }
  2367. }
  2368. this.dateAr = alp
  2369. console.log(this.dateAr, '123456')
  2370. if(this.dateAr.length > 0) {
  2371. let trus = this.fns()
  2372. if(!trus) {
  2373. this.$message({
  2374. message: '填写的时间段重叠',
  2375. type: "error"
  2376. });
  2377. return
  2378. }
  2379. }
  2380. }
  2381. // return
  2382. //代填的情况,检查人员是否已经选择
  2383. if (this.isSubstitude) {
  2384. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  2385. this.$message({
  2386. message: "请选择代填的人员",
  2387. type: "error"
  2388. });
  2389. return;
  2390. }
  2391. }
  2392. //检查时间,全天和上下午不能同时存在
  2393. if (this.reportTimeType.type == 0) {
  2394. var alldayNum = 0;
  2395. var amNum = 0;
  2396. var pmNum = 0;
  2397. for(var i in this.workForm.domains) {
  2398. if (this.workForm.domains[i].timeType == 0) {
  2399. alldayNum ++;
  2400. } else if (this.workForm.domains[i].timeType == 1) {
  2401. amNum++;
  2402. } else if (this.workForm.domains[i].timeType == 2) {
  2403. pmNum++;
  2404. }
  2405. }
  2406. if (alldayNum > 1) {
  2407. this.$message({
  2408. message: "工作时间-全天,只能选择一次",
  2409. type: "error"
  2410. });
  2411. return;
  2412. }
  2413. if (amNum > 1) {
  2414. this.$message({
  2415. message: "工作时间-上午,只能选择一次",
  2416. type: "error"
  2417. });
  2418. return;
  2419. }
  2420. if (pmNum > 1) {
  2421. this.$message({
  2422. message: "工作时间-下午,只能选择一次",
  2423. type: "error"
  2424. });
  2425. return;
  2426. }
  2427. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  2428. this.$message({
  2429. message: "工作时间-全天,不能和上下午同时存在",
  2430. type: "error"
  2431. });
  2432. return;
  2433. }
  2434. } else if (this.reportTimeType.type == 3) {
  2435. //总百分比不能超过100%
  2436. let total = 0;
  2437. this.workForm.domains.forEach(w=>{total += w.progress});
  2438. if (total > 100) {
  2439. this.$message({
  2440. message: "用时比例之和不能超过100%",
  2441. type: "error"
  2442. });
  2443. return;
  2444. } else if (total < 100) {
  2445. this.$message({
  2446. message: "工时尚未完全分配,无法提交",
  2447. type: "error"
  2448. });
  2449. return;
  2450. }
  2451. }
  2452. this.listLoading = true;
  2453. let formData = new FormData();
  2454. for(var i in this.workForm.domains) {
  2455. if(this.workForm.domains[i].degreeId) {
  2456. // var sss = this.workForm.domains[i].degreeId.toString()
  2457. formData.append("degreeId", this.workForm.domains[i].degreeId);
  2458. } else {
  2459. formData.append("degreeId", "-1");
  2460. }
  2461. if (this.workForm.domains[i].id != null) {
  2462. formData.append("id", this.workForm.domains[i].id);
  2463. } else {
  2464. formData.append("id", -1);
  2465. }
  2466. formData.append("projectId", this.workForm.domains[i].projectId);
  2467. if (this.workForm.domains[i].subProjectId != null) {
  2468. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  2469. } else {
  2470. formData.append("subProjectId", 0);
  2471. }
  2472. if (this.workForm.domains[i].taskId != null) {
  2473. formData.append("taskId", this.workForm.domains[i].taskId);
  2474. } else {
  2475. formData.append("taskId", 0);
  2476. }
  2477. formData.append("reportTimeType", this.reportTimeType.type);
  2478. if (this.reportTimeType.type == 0) {
  2479. formData.append("timeType", this.workForm.domains[i].timeType);
  2480. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  2481. formData.append("workingTime", workingTime);
  2482. } else if (this.reportTimeType.type == 1){
  2483. formData.append("workingTime", this.workForm.domains[i].workingTime);
  2484. } else if (this.reportTimeType.type == 2) {
  2485. formData.append("endTime", this.workForm.domains[i].endTime);
  2486. formData.append("startTime", this.workForm.domains[i].startTime);
  2487. } else if (this.reportTimeType.type == 3) {
  2488. //按比例分配
  2489. formData.append("progress", this.workForm.domains[i].progress);
  2490. formData.append("workingTime", this.workForm.domains[i].workingTime);
  2491. }
  2492. //处理多个时间事项
  2493. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  2494. if (this.reportTimeType.multiWorktime == 1) {
  2495. //检查时间是否有重叠
  2496. var workList = this.workForm.domains[i].worktimeList;
  2497. for (var j=0;j<workList.length; j++) {
  2498. var curItem = workList[j];
  2499. //检查开始时间是否大于结束时间
  2500. if (curItem.startTime >= curItem.endTime) {
  2501. this.$message({
  2502. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
  2503. "结束时间必须大于开始时间",
  2504. type: "error"
  2505. });
  2506. return;
  2507. }
  2508. for (var p = j+1;p<workList.length; p++) {
  2509. var jItem = workList[p];
  2510. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  2511. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  2512. this.$message({
  2513. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
  2514. jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。",
  2515. type: "error"
  2516. });
  2517. return;
  2518. }
  2519. }
  2520. }
  2521. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  2522. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  2523. console.log(m);
  2524. formData.append("content", m);
  2525. } else {
  2526. if (this.workForm.domains[i].content == null || this.workForm.domains[i].content == '') {
  2527. formData.append("content", '-');
  2528. } else {
  2529. formData.append("content", this.workForm.domains[i].content);
  2530. }
  2531. }
  2532. if (this.isBatch == 0) {
  2533. formData.append("createDate", this.workForm.createDate);
  2534. } else {
  2535. //批量填报,时间范围
  2536. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  2537. }
  2538. if(this.workForm.domains[i].isOvertime == undefined ) {
  2539. this.workForm.domains[i].isOvertime = '0'
  2540. formData.append("isOvertime", this.workForm.domains[i].isOvertime);
  2541. } else if (this.workForm.domains[i].isOvertime == false){
  2542. this.workForm.domains[i].isOvertime = '0'
  2543. formData.append("isOvertime", this.workForm.domains[i].isOvertime);
  2544. } else {
  2545. this.workForm.domains[i].isOvertime = '1'
  2546. formData.append("isOvertime", this.workForm.domains[i].isOvertime);
  2547. }
  2548. if (this.workForm.userId != null) {
  2549. var targetUids = '';
  2550. this.workForm.userId.forEach(u=>{
  2551. targetUids += u + '@';
  2552. });
  2553. if (targetUids.length > 0) {
  2554. targetUids = targetUids.substring(0, targetUids.length -1);
  2555. formData.append("targetUids", targetUids);
  2556. }
  2557. }
  2558. //项目专业进度
  2559. if (this.workForm.domains[i].professionProgress != null) {
  2560. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  2561. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  2562. formData.append("professionProgress", m);
  2563. } else {
  2564. formData.append("professionProgress", "[]");
  2565. }
  2566. if (this.workForm.domains[i].stage != null) {
  2567. formData.append("stage", this.workForm.domains[i].stage);
  2568. } else {
  2569. formData.append("stage", "");
  2570. }
  2571. }
  2572. // console.log(formData, '看看数据')
  2573. // formData.forEach((value, key) => {
  2574. // console.log("%s=%s", key, value);
  2575. // })
  2576. // console.log(this.workForm, '这里是数据')
  2577. // return
  2578. this.http.uploadFile( this.port.report.editPort, formData,
  2579. res => {
  2580. this.listLoading = false;
  2581. if (res.code == "ok") {
  2582. this.$message({
  2583. message: "填报成功",
  2584. type: "success"
  2585. });
  2586. this.dialogVisible = false;
  2587. this.jsDay = 0
  2588. this.jsTime = 0
  2589. this.getReportList();
  2590. this.getDepartment();
  2591. } else {
  2592. this.$message({
  2593. message: res.msg,
  2594. type: "error"
  2595. });
  2596. }
  2597. },
  2598. error => {
  2599. this.listLoading = false;
  2600. this.$message({
  2601. message: error,
  2602. type: "error"
  2603. });
  2604. });
  2605. }
  2606. });
  2607. },
  2608. cli() {
  2609. },
  2610. // 判断是展示那个工时导入
  2611. imports() {
  2612. console.log(this.user.timeType.syncCorpwxTime)
  2613. if(this.user.timeType.syncCorpwxTime == 0) {
  2614. this.importDialog = true
  2615. } else {
  2616. this.importWxDialog = true
  2617. }
  2618. },
  2619. // 跳转
  2620. junpToDeskTop(id) {
  2621. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2622. this.$router.push("/desktop/" + id + "/" + this.date +day);
  2623. },
  2624. // 通过日报
  2625. approve(id, item) {
  2626. this.logining = true;
  2627. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2628. var ids = '';
  2629. var data = item.data;
  2630. data.forEach(element => {
  2631. ids +=(element.id+',');
  2632. });
  2633. this.http.post( this.port.report.approve, {id: id , date: this.date +day, reportIds: ids},
  2634. res => {
  2635. this.logining = false;
  2636. if (res.code == "ok") {
  2637. this.$message({
  2638. message: "审核成功",
  2639. type: "success"
  2640. });
  2641. this.getReportList();
  2642. this.getDepartment();
  2643. } else {
  2644. this.$message({
  2645. message: res.msg,
  2646. type: "error"
  2647. });
  2648. }
  2649. },
  2650. error => {
  2651. this.logining = false;
  2652. this.$message({
  2653. message: error,
  2654. type: "error"
  2655. });
  2656. });
  2657. },
  2658. //撤回日报
  2659. cancel(item) {
  2660. this.logining = true;
  2661. var ids = '';
  2662. var data = item.data;
  2663. data.forEach(element => {
  2664. ids +=(element.id+',');
  2665. });
  2666. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  2667. res => {
  2668. this.logining = false;
  2669. if (res.code == "ok") {
  2670. this.$message({
  2671. message:"撤回成功",
  2672. type: "success"
  2673. });
  2674. this.getReportList();
  2675. this.getDepartment();
  2676. } else {
  2677. this.$message({
  2678. message: res.msg,
  2679. type: "error"
  2680. });
  2681. }
  2682. },
  2683. error => {
  2684. this.logining = false;
  2685. this.$message({
  2686. message: error,
  2687. type: "error"
  2688. });
  2689. });
  2690. },
  2691. showDenyDialog(id,i, item) {
  2692. this.denyReasonDialog = true;
  2693. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2694. var ids = '';
  2695. var data = item.data;
  2696. data.forEach(element => {
  2697. ids +=(element.id+',');
  2698. });
  2699. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  2700. },
  2701. // 未通过日报
  2702. deny() {
  2703. this.logining = true;
  2704. this.http.post( this.port.report.deny, this.denyForm,
  2705. res => {
  2706. this.logining = false;
  2707. if (res.code == "ok") {
  2708. this.$message({
  2709. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  2710. type: "success"
  2711. });
  2712. this.getReportList();
  2713. this.getDepartment();
  2714. this.denyReasonDialog = false;
  2715. } else {
  2716. this.$message({
  2717. message: res.msg,
  2718. type: "error"
  2719. });
  2720. }
  2721. },
  2722. error => {
  2723. this.logining = false;
  2724. this.$message({
  2725. message: error,
  2726. type: "error"
  2727. });
  2728. });
  2729. }
  2730. },
  2731. created() {
  2732. let height = window.innerHeight;
  2733. this.tableHeight = height - 178;
  2734. const that = this;
  2735. window.onresize = function temp() {
  2736. that.tableHeight = window.innerHeight - 178;
  2737. };
  2738. },
  2739. mounted() {
  2740. var now = new Date();
  2741. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2742. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2743. this.exportParam.dateRange = [startStr,t];
  2744. this.getAllDate();
  2745. this.getReportList();
  2746. this.getProjectList();
  2747. this.getTimeType();
  2748. this.getDepartment();
  2749. this.scrollFunction()
  2750. this.userssHu()
  2751. }
  2752. };
  2753. </script>
  2754. <style lang="scss" scoped>
  2755. .waiting {
  2756. color:orange;
  2757. }
  2758. .filledReportStyle {
  2759. color:#32CD32;
  2760. }
  2761. .RejectStyle {
  2762. color:red;
  2763. }
  2764. .allDaily {
  2765. width:82%;
  2766. }
  2767. .report_title {
  2768. padding:10px 0;
  2769. color:#666;
  2770. }
  2771. .clearfix {
  2772. overflow-x: auto;
  2773. white-space: nowrap;
  2774. padding: 15px 0;
  2775. // overflow-y: hidden;
  2776. .date_item {
  2777. padding: 0 3px;
  2778. cursor: pointer;
  2779. }
  2780. .chooseDate {
  2781. color: #20a0ff;
  2782. }
  2783. }
  2784. .one_daily {
  2785. i {
  2786. color: #9ed0ff;
  2787. margin-right: 5px;
  2788. }
  2789. .one_daily_body {
  2790. padding: 15px 0px;
  2791. p {
  2792. margin: 0;
  2793. line-height: 30px;
  2794. }
  2795. }
  2796. ul {
  2797. padding: 0;
  2798. }
  2799. }
  2800. .checkbtn {
  2801. float: right;
  2802. margin-top: -10px;
  2803. }
  2804. </style>
  2805. <style lang="scss">
  2806. .daily {
  2807. .el-card__body {
  2808. height: 80%;
  2809. overflow-y: auto;
  2810. }
  2811. .el-card__header {
  2812. padding: 0 20px;
  2813. }
  2814. }
  2815. </style>
  2816. <style scoped>
  2817. /* 项目标签的样式 */
  2818. .el-tag + .el-tag {
  2819. margin-left: 10px;
  2820. }
  2821. .button-new-tag {
  2822. margin-left: 10px;
  2823. height: 32px;
  2824. line-height: 30px;
  2825. padding-top: 0;
  2826. padding-bottom: 0;
  2827. }
  2828. .input-new-tag {
  2829. width: 90px;
  2830. margin-left: 10px;
  2831. vertical-align: bottom;
  2832. }
  2833. </style>
  2834. <style lang="scss" scoped>
  2835. // 加班样式
  2836. .overtime {
  2837. display: inline-block;
  2838. margin-left: 20px;
  2839. input {
  2840. display: inline-block;
  2841. margin-top: 5px;
  2842. }
  2843. }
  2844. .plus {
  2845. display: inline-block;
  2846. }
  2847. // .tages {
  2848. // float: right;
  2849. // }
  2850. .overtime {
  2851. display: inline-block;
  2852. margin-left: 30px;
  2853. }
  2854. .bloks {
  2855. display: inline-block;
  2856. width: 380px;
  2857. }
  2858. </style>