list.vue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048
  1. <template>
  2. <section id="section">
  3. <div class="sidebars" ref="sidebars" :style="'width: 180px;display: block;overflow:hidden;background: #fff;height:'+hubs+ 'px'">
  4. <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>请假管理</h3>
  5. <el-divider ></el-divider>
  6. <el-col :span="12">
  7. <el-menu :default-active="isDingding ? '7' : '1'" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
  8. <!-- <el-submenu index="1">
  9. <template slot="title">
  10. <i class="iconfont firerock-icontianbao"></i>
  11. <span>员工请假填报</span>
  12. </template>
  13. <el-menu-item index="1-1"><p @click="ssl(0)">请事假</p></el-menu-item>
  14. <el-menu-item index="1-2"><p @click="ssl(1)">请病假</p></el-menu-item>
  15. <el-menu-item index="1-3"><p @click="ssl(2)">请年假</p></el-menu-item>
  16. <el-menu-item index="1-4"><p @click="ssl(3)">请产假</p></el-menu-item>
  17. </el-submenu> -->
  18. <template v-if="!isDingding">
  19. <el-menu-item index="1" v-if="permissions.leaveFil">
  20. <i class="iconfont firerock-icontianbao"></i>
  21. <span slot="title">员工请假填报</span>
  22. </el-menu-item>
  23. <el-submenu index="2" v-if="permissions.leaveAll">
  24. <template slot="title">
  25. <i class="iconfont firerock-iconbaoxiaodan"></i>
  26. <span>{{"请假单列表"}}</span>
  27. </template>
  28. <el-menu-item index="2-1" ><p @click="bills(false, 2)" v-if="permissions.leaveAll">全部</p></el-menu-item>
  29. <el-menu-item index="2-2" ><p @click="bills(true, 1)" v-if="permissions.leaveAudit">待审核</p></el-menu-item>
  30. </el-submenu>
  31. <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="!permissions.leaveAll">
  32. <i class="iconfont firerock-iconbaoxiaodan"></i>
  33. <span slot="title">我的请假单</span>
  34. </el-menu-item>
  35. <el-menu-item index="4" v-if="permissions.leaveStatistical">
  36. <template slot="title">
  37. <i class="iconfont firerock-icontianbao"></i>
  38. <span slot="title">请假统计</span>
  39. </template>
  40. </el-menu-item>
  41. <el-menu-item index="5" v-if="permissions.leaveProcess">
  42. <template slot="title">
  43. <i class="iconfont firerock-iconliucheng"></i>
  44. <span slot="title">请假审批流程</span>
  45. </template>
  46. </el-menu-item>
  47. <el-menu-item index="6" v-if="permissions.leaveAnnual">
  48. <template slot="title">
  49. <i class="iconfont firerock-icontianbao"></i>
  50. <span slot="title">年假管理</span>
  51. </template>
  52. </el-menu-item>
  53. </template>
  54. <!-- 钉钉环境对接 -->
  55. <template v-if="isDingding">
  56. <el-menu-item index="7" v-if="permissions.leaveAll">
  57. <template slot="title">
  58. <i class="iconfont firerock-iconbaoxiaodan"></i>
  59. <span slot="title">请假单列表</span>
  60. </template>
  61. </el-menu-item>
  62. <el-menu-item index="8" v-if="permissions.leaveAll">
  63. <template slot="title">
  64. <i class="iconfont firerock-iconbaoxiaodan"></i>
  65. <span slot="title">假期剩余表</span>
  66. </template>
  67. </el-menu-item>
  68. </template>
  69. </el-menu>
  70. </el-col>
  71. </div>
  72. <!-- 侧边栏点击事件 -->
  73. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  74. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  75. </div> -->
  76. <!-- 内容主体区域 -->
  77. <div class="contents">
  78. <div v-if="!displayTable && !isDingding" class="headine" ref="headine">
  79. <h3 ref="headHe" style="padding-left: 220px">请假填报</h3>
  80. <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
  81. </div>
  82. <!-- 上面部分 -->
  83. <div v-if="!displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  84. <!-- 公共 -->
  85. <div class="ctons" style="width: 98%">
  86. <!-- 表单 -->
  87. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  88. <!-- 请假类型 -->
  89. <el-form-item label="请假类型" prop="leaveType" style="width: 100%">
  90. <!--普通员工只能自己填报自己的 -->
  91. <el-select v-model="addForm.leaveType" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假类型" style="width: 240px">
  92. <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
  93. </el-select>
  94. <template v-if="addForm.leaveType == 6">
  95. <span style="margin-left:18px;color:#777;">剩余可调休 {{addForm.ownerId != '' ? txselnum : '~'}} 天</span>
  96. <el-tooltip effect="dark" content="加班时长可用于调休抵扣" placement="top-start">
  97. <i class="el-icon-question" style="color:#606266;"></i>
  98. </el-tooltip>
  99. </template>
  100. </el-form-item>
  101. <!-- 请假人 -->
  102. <el-form-item label="请假人" prop="ownerId" style="width: 300px">
  103. <!--普通员工只能自己填报自己的 -->
  104. <el-select v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假人" style="width: 240px" :disabled="true" filterable="true">
  105. <span v-for="(item, index) in users" :key="index">
  106. <el-option :label="item.name" :value="item.id"></el-option>
  107. </span>
  108. </el-select>
  109. </el-form-item>
  110. <!-- 电话 -->
  111. <el-form-item label="电话" prop="tel" style="margin-right:300px">
  112. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px"></el-input>
  113. </el-form-item>
  114. <!-- 单选 -->
  115. <el-form-item style="display: inline-block;width:300px" label="时长单位">
  116. <el-radio-group v-model="addForm.timeType" @change="chanRadio()" style="display:inline-block;width:240px">
  117. <el-radio label="0">按天请假</el-radio>
  118. <el-radio label="1" v-if="addForm.leaveType != 6">按小时请假</el-radio>
  119. </el-radio-group>
  120. </el-form-item>
  121. <!-- 选择审批人 -->
  122. <el-form-item label="审批人" style="width:300px" prop="projectAuditorJson">
  123. <el-select style="display:inline-block;width:250px;" multiple v-model="addForm.projectAuditorJson" placeholder="请选择">
  124. <el-option
  125. v-for="item in approverList"
  126. :key="item.id"
  127. :label="item.name"
  128. :value="item.id"
  129. ></el-option>
  130. </el-select>
  131. </el-form-item>
  132. <!-- 时间选择 -->
  133. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 100%;">
  134. <el-col style="display: inline-block; width: 240px">
  135. <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  136. <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  137. </el-col>
  138. <el-col class="line" v-if="flg" style="display: inline-block; width: 50px">-</el-col>
  139. <el-col style="display: inline-block; width: 240px">
  140. <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  141. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  142. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  143. </el-select> -->
  144. </el-col>
  145. </el-form-item>
  146. <!-- 请假天数 -->
  147. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  148. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  149. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  150. <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;" type="number" :step="0.5"></el-input> 天</div>
  151. <div v-else>
  152. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;"></el-input> 小时
  153. </div>
  154. </el-form-item>
  155. <!-- 备注 -->
  156. <el-form-item label="备注" style="width: 100%">
  157. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 550px" maxlength="100" show-word-limit></el-input>
  158. </el-form-item>
  159. </el-form>
  160. <div>
  161. <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini" :disabled="txselnum == 0 && addForm.leaveType == 6 && addForm.ownerId != '' ? true : false">提交</el-button></p>
  162. </div>
  163. </div>
  164. </div>
  165. <!-- 下面部分 -->
  166. <div v-if="displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  167. <!-- 公共 -->
  168. <div class="ctons" style="width: 98%;">
  169. <div class="flex">
  170. <div>
  171. <el-select v-model="ownerIds" placeholder="请选择请假人" clearable @change="chufas()" style="width: 160px" size="small" v-show="permissions.leaveAll" filterable="true">
  172. <span v-for="(item, index) in users" :key="index">
  173. <el-option :label="item.name" :value="item.id"></el-option>
  174. </span>
  175. </el-select>
  176. </div>
  177. <div>
  178. <span style="color: #606266">请假类型</span>
  179. <el-select v-model="type" placeholder="请选择请假类型" clearable @change="chufas()" style="width: 160px;" size="small" filterable="true">
  180. <span v-for="(item, index) in typess" :key="index">
  181. <el-option :label="item.name" :value="item.id"></el-option>
  182. </span>
  183. </el-select>
  184. </div>
  185. <div>
  186. <span style="color: #606266">请假状态</span>
  187. <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" clearable @change="chufas()" size="small" style="width: 160px" filterable="true">
  188. <span v-for="(item, index) in statuss" :key="index">
  189. <el-option :label="item.name" :value="item.id"></el-option>
  190. </span>
  191. </el-select>
  192. <el-select v-if="falg == 1" disabled v-model="code" placeholder="请选择请假类型" clearable @change="chufas()" size="small" style="width: 160px" filterable="true">
  193. <span v-for="(item, index) in statuss" :key="index">
  194. <el-option :label="item.name" :value="item.id"></el-option>
  195. </span>
  196. </el-select>
  197. </div>
  198. <div>
  199. <!-- <span style="color: #606266">请假时间</span>
  200. <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker> -->
  201. <span style="color: #606266">时间段</span>
  202. <el-date-picker v-model="createDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable style="width:280px"></el-date-picker>
  203. </div>
  204. </div>
  205. <el-table v-loading="loading" :data="tableData" style="width: 100%" height="94%">
  206. <el-table-column prop="ownerName" :label="'请假人12' + page" min-width="120" fixed="left"></el-table-column>
  207. <el-table-column prop="tel" label="电话" min-width="120"></el-table-column>
  208. <el-table-column prop="leaveType" label="请假类型" min-width="120">
  209. <template slot-scope="scope">
  210. <!-- <div v-if="scope.row.leaveType == 0">事假</div>
  211. <div v-if="scope.row.leaveType == 1">病假</div>
  212. <div v-if="scope.row.leaveType == 2">年假</div>
  213. <div v-if="scope.row.leaveType == 3">产假</div> -->
  214. {{qjType[scope.row.leaveType].name}}
  215. </template>
  216. </el-table-column>
  217. <el-table-column prop="startDate" label="请假开始时间" min-width="150"></el-table-column>
  218. <el-table-column prop="endDate" label="请假结束时间" min-width="150"></el-table-column>
  219. <el-table-column label="请假天数" min-width="120">
  220. <template slot-scope="scope">
  221. <div v-if="scope.row.timeType == '1'">/</div>
  222. <div v-else>{{scope.row.timeDays}}天</div>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="请假时长" min-width="120" v-if="!user.timeType.syncDingding">
  226. <template slot-scope="scope">
  227. <div>{{scope.row.timeHours}}小时</div>
  228. </template>
  229. </el-table-column>
  230. <el-table-column prop="status" label="状态" min-width="100">
  231. <template slot-scope="scope">
  232. <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
  233. <div v-if="scope.row.status == 0" >审核通过</div>
  234. <div v-if="scope.row.status == 1" style="color: orange">待审核</div>
  235. <div v-if="scope.row.status == 2" style="color: red">驳回</div>
  236. <div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
  237. </div>
  238. <div v-else>
  239. <span>暂无请假单</span>
  240. </div>
  241. </template>
  242. </el-table-column>
  243. <el-table-column prop="remark" label="备注" min-width="200" header-align="center">
  244. <template slot-scope="scope">
  245. <!-- <div class="apls">{{scope.row.remark}}</div> -->
  246. <el-popover placement="top-start" title="标题" width="200" trigger="hover" :content="scope.row.remark">
  247. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  248. </el-popover>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="操作" min-width="180" fixed="right" v-if="isAuditList && !isDingding">
  252. <template slot-scope="scope">
  253. <div>
  254. <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
  255. <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
  256. </div>
  257. </template>
  258. </el-table-column>
  259. <el-table-column label="操作" min-width="180" fixed="right" v-if="!isAuditList && !isDingding">
  260. <template slot-scope="scope">
  261. <div v-if="(scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.leaveAll">
  262. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)" ></el-button>
  263. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
  264. </div>
  265. <!-- <div>
  266. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)"></el-button>
  267. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
  268. </div> -->
  269. </template>
  270. </el-table-column>
  271. </el-table>
  272. <div class="poss">
  273. <!-- <el-pagination
  274. @size-change="handleSizeChange"
  275. @current-change="handleCurrentChange"
  276. :current-page="currentPage4"
  277. :page-sizes="[20, 50, 100, 200]"
  278. :page-size="20"
  279. layout="total, sizes, prev, pager, next"
  280. :total="total">
  281. </el-pagination> -->
  282. <el-pagination
  283. @size-change="handleSizeChange"
  284. @current-change="handleCurrentChange"
  285. :current-page="page"
  286. :page-sizes="[20, 50, 100, 200]"
  287. :page-size="20"
  288. layout="total, sizes, prev, pager, next"
  289. :total="total">
  290. </el-pagination>
  291. </div>
  292. </div>
  293. </div>
  294. <!-- 统计部分 -->
  295. <div v-if="displayTable && apk && apk2 == 4" class="tops" :style="'height:' +hubs+'px'">
  296. <!-- 公共 -->
  297. <div class="ctons" style="width: 98%;">
  298. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  299. <div style="display: inline-block;width: 350px">
  300. <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  301. <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
  302. </el-input>
  303. </div>
  304. <div style="display: inline-block;width: 340px">
  305. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">开始日期</span>
  306. <el-date-picker
  307. v-model="statData"
  308. type="date"
  309. placeholder="选择日期"
  310. size="small"
  311. @change="statistical()"
  312. clearable="false"
  313. value-format="yyyy-MM-dd"
  314. :picker-options="pickerOptionsStarts">
  315. </el-date-picker>
  316. </div>
  317. <div style="display: inline-block;width: 350px">
  318. <span style="display: inline-block;margin: 0 15px 0 0;color: rgb(96, 98, 102);">结束日期</span>
  319. <el-date-picker
  320. v-model="endData"
  321. type="date"
  322. placeholder="选择日期"
  323. size="small"
  324. @change="statistical()"
  325. clearable="fasle"
  326. value-format="yyyy-MM-dd"
  327. :picker-options="pickerOptionsEnds">
  328. </el-date-picker>
  329. </div>
  330. </div>
  331. <!-- <div style="margin-top: 30px"> -->
  332. <div>
  333. <el-table key="apk2is4" v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
  334. <el-table-column prop="ownerName" label="姓名" width="300">
  335. <template slot-scope="scope">
  336. <div v-if="scope.row.ownerName">
  337. {{scope.row.ownerName}}
  338. </div>
  339. <div v-else>
  340. <span>暂无请假统计</span>
  341. </div>
  342. </template>
  343. </el-table-column>
  344. <el-table-column prop="timeDays" label="请假总天数" width="300">
  345. <template slot-scope="scope">
  346. {{scope.row.timeDays}}/天
  347. </template>
  348. </el-table-column>
  349. <el-table-column prop="timeHours" label="请假总时长">
  350. <template slot-scope="scope">
  351. {{scope.row.timeHours}}/小时
  352. </template>
  353. </el-table-column>
  354. </el-table>
  355. </div>
  356. </div>
  357. </div>
  358. <!-- 审批流 -->
  359. <div v-if="displayTable && apk && apk2 == 5" class="tops" :style="'height:' +hubs+'px'">
  360. <div class="ctons" style="width: 98%;">
  361. <el-col :span="6" >
  362. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
  363. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  364. <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
  365. </div>
  366. </el-scrollbar>
  367. </el-col>
  368. <el-col :span="18" >
  369. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
  370. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  371. <div style="padding:5px;color:#333;" v-if="depData != null">设置 &lt;<span style="color:#20a0ff;">{{depData.label}}&gt;</span> 直属人员请假审批流程
  372. <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
  373. <i class="el-icon-question"></i>
  374. </el-tooltip>
  375. </div>
  376. <div style="padding:5px;" v-if="depData == null">请选择部门</div>
  377. <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
  378. <span>员工填报</span>
  379. <icon class="iconfont firerock-iconright"></icon>
  380. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
  381. <icon class="iconfont firerock-iconright"></icon>
  382. <span v-for="(item, index) in dataArray" :key="item.seq" >
  383. <el-button type="primary" v-if="item.auditorType == 1" @click="editNodeDialog(index, item)">{{item.auditDeptName}}</el-button>
  384. <el-button type="primary" v-if="item.auditorType == 2" @click="editNodeDialog(index, item)">{{item.userName}}</el-button>
  385. <template v-if="item.auditorType == 1 || item.auditorType == 2">
  386. <icon class="iconfont firerock-iconright"></icon>
  387. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
  388. <icon class="iconfont firerock-iconright"></icon>
  389. </template>
  390. </span>
  391. <!--结束点 -->
  392. <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
  393. 审批完成
  394. </div>
  395. <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
  396. <el-button type="primary" @click="submitInsert" :loading="addLoading">保存</el-button>
  397. </div>
  398. </div>
  399. </el-scrollbar>
  400. </el-col>
  401. </div>
  402. <!--部门选择列表 -->
  403. <el-dialog title="请选择审批人" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
  404. <el-form label-width="140px">
  405. <el-form-item label="选择部门/指定人员" >
  406. <el-cascader filterable ref="deptCascader" v-model="curDeptId" placeholder="请选择部门/指定人员" style="width: 100%" @change="chooseDept"
  407. :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  408. </el-form-item>
  409. </el-form>
  410. <div slot="footer" class="dialog-footer">
  411. <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">删除</el-button>
  412. <el-button type="primary" @click="addNode" >确定</el-button>
  413. </div>
  414. </el-dialog>
  415. </div>
  416. <!-- 年假管理 -->
  417. <div v-if="displayTable && apk && apk2 == 6" class="tops" :style="'height:' +hubs+'px'">
  418. <div class="ctons" style="width: 98%;">
  419. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  420. <div style="display: inline-block;width: 18%;margin-left:1%">
  421. <el-button size="small" @click="changeAltime(0)">批量设置</el-button>
  422. </div>
  423. <div style="display: inline-block;width: 26%">
  424. <el-input style="float:left;" v-model="keywordAl" class="input-with-select" placeholder="请输入人员姓名搜索" clearable="true" size="small" @clear="clearsearchAl()">
  425. <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
  426. </el-input>
  427. </div>
  428. <div style="display: inline-block;width: 32%;margin-left:12%">
  429. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">按部门筛选</span>
  430. <el-cascader
  431. ref="selectAl"
  432. filterable
  433. v-model="NcurDeptId"
  434. placeholder="请选择部门"
  435. size="small"
  436. style="width: 60%"
  437. @change="selAl()"
  438. clearable
  439. :options="Nsdata"
  440. :props="{ checkStrictly: true, expandTrigger: 'hover' }"
  441. :show-all-levels="false">
  442. </el-cascader>
  443. </div>
  444. </div>
  445. <div>
  446. <el-table key="apk2is6" v-loading="loading" :data="iAlDataS" height="480" style="width: 99%;" @selection-change="selPchg">
  447. <el-table-column type="selection"></el-table-column>
  448. <el-table-column prop="userName" label="姓名" width="200">
  449. <template slot-scope="scope">
  450. <div v-if="scope.row.userName">
  451. {{scope.row.userName}}
  452. </div>
  453. </template>
  454. </el-table-column>
  455. <el-table-column prop="department" label="所在部门" width="200">
  456. <template slot-scope="scope">
  457. {{scope.row.department}}
  458. </template>
  459. </el-table-column>
  460. <el-table-column prop="yearDays" label="每年年假天数" width="200">
  461. <template slot-scope="scope">
  462. {{scope.row.yearDays != null ? scope.row.yearDays + "天" : "-"}}
  463. </template>
  464. </el-table-column>
  465. <el-table-column prop="leftdays" label="剩余年假天数" width="200">
  466. <template slot-scope="scope">
  467. {{scope.row.yearDays != null ? scope.row.yearDays - scope.row.alreadyDays + "天" : "-"}}
  468. </template>
  469. </el-table-column>
  470. <el-table-column prop="id" label="修改年假天数">
  471. <template slot-scope="scope">
  472. <el-button size="small" @click="changeAltime(scope.row)">设置</el-button>
  473. </template>
  474. </el-table-column>
  475. </el-table>
  476. </div>
  477. </div>
  478. <el-dialog title="请设置年假时限" v-if="Alshow" :visible.sync="Alshow" @close="delAltime()" width="500px">
  479. <el-form label-width="8rem">
  480. <el-form-item label="设置每年年假天数" >
  481. <el-input v-model="Alchange.yearDays" type="number" min="0" placeholder="请输入天数"></el-input>
  482. </el-form-item>
  483. </el-form>
  484. <div slot="footer" class="dialog-footer">
  485. <el-button type="default" @click="delAltime()">取消</el-button>
  486. <el-button type="primary" @click="chgAltime()">确定</el-button>
  487. </div>
  488. </el-dialog>
  489. </div>
  490. <div v-if="displayTable && apk && apk2 == 8" class="tops" :style="'height:' +hubs+'px'">
  491. <!-- 公共 -->
  492. <div class="ctons" style="width: 98%;">
  493. <div class="flex">
  494. <div>
  495. <span>请假类型</span>
  496. <el-select v-model="leaveTypeItem" placeholder="请选择请假类型" @change="leaveTypeChange()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
  497. <span v-for="item in leaveTypeList" :key="item.leaveCode">
  498. <el-option :label="item.leaveName" :value="item.leaveCode"></el-option>
  499. </span>
  500. </el-select>
  501. </div>
  502. <div>
  503. <span>部门筛选</span>
  504. <el-cascader
  505. size="small"
  506. @change="departmentOptionsChg"
  507. v-model="departmentSel"
  508. :options="departmentOptions"
  509. placeholder="请选择部门"
  510. :show-all-levels="false"
  511. :props="{ checkStrictly: true }"
  512. clearable></el-cascader>
  513. </div>
  514. <div>
  515. <span>人员筛选</span>
  516. <el-select v-model="userSelId" placeholder="请选择请假人" clearable @change="userChg()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
  517. <span v-for="(item, index) in users" :key="index">
  518. <el-option :label="item.name" :value="item.id"></el-option>
  519. </span>
  520. </el-select>
  521. </div>
  522. <div style="margin:0 10px 0 40px">
  523. <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">从钉钉同步</el-button>
  524. </div>
  525. </div>
  526. <el-table key="apk2is8" v-loading="loading" :data="vacationList" style="width: 100%" height="94%">
  527. <el-table-column prop="name" label="员工姓名" min-width="120" fixed="left"></el-table-column>
  528. <el-table-column label="有效期" min-width="250" align="center">
  529. <template slot-scope="scope">
  530. <span>{{scope.row.startTime == null && scope.row.endTime == null ? '~ ~' : (scope.row.startTime + '\u3000~\u3000' + scope.row.endTime)}}</span>
  531. </template>
  532. </el-table-column>
  533. <el-table-column label="总额度" min-width="100" align="center">
  534. <template slot-scope="scope">
  535. <span>{{scope.row.quotaInDays == null && scope.row.quotaInHours == null ? '-' : (scope.row.quotaInDays == null ? scope.row.quotaInHours + '小时' : scope.row.quotaInDays + '天')}}</span>
  536. </template>
  537. </el-table-column>
  538. <el-table-column label="已使用" min-width="100" align="center">
  539. <template slot-scope="scope">
  540. <span>{{scope.row.usedInDays == null && scope.row.usedInHours == null ? '-' : (scope.row.usedInDays == null ? scope.row.usedInHours + '小时' : scope.row.usedInDays + '天')}}</span>
  541. </template>
  542. </el-table-column>
  543. <el-table-column label="剩余额度" min-width="100" align="center">
  544. <template slot-scope="scope">
  545. <span>{{scope.row.leftInDays == null && scope.row.leftInHours == null ? '-' : (scope.row.leftInDays == null ? scope.row.leftInHours + '小时' : scope.row.leftInDays + '天')}}</span>
  546. </template>
  547. </el-table-column>
  548. </el-table>
  549. <div class="poss">
  550. <el-pagination
  551. @size-change="vacationSizeChange"
  552. @current-change="vacationCurrentChange"
  553. :current-page="page"
  554. :page-sizes="[50]"
  555. :page-size="50"
  556. layout="total, sizes, prev, pager, next"
  557. :total="total">
  558. </el-pagination>
  559. </div>
  560. </div>
  561. </div>
  562. <!-- --------- -->
  563. </div>
  564. <!-- 请假单详情 -->
  565. <el-dialog title="请假单详情" :visible.sync="dialog" width="1000px" @close="bangd()">
  566. <!-- 表单 -->
  567. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  568. <!-- 请假人 -->
  569. <el-form-item label="请假人" prop="ownerId" style="width: 300px;display: inline-block;">
  570. <!--普通员工只能自己填报自己的 -->
  571. <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="true" filterable="true">
  572. <span v-for="(item, index) in users" :key="index">
  573. <el-option :label="item.name" :value="item.id"></el-option>
  574. </span>
  575. </el-select>
  576. </el-form-item>
  577. <!-- 电话 -->
  578. <el-form-item label="电话" prop="tel" style="width: 300px;display: inline-block;">
  579. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px;"></el-input>
  580. </el-form-item>
  581. <!-- 单选 -->
  582. <el-form-item style="display: block" label="时长单位">
  583. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  584. <el-radio label="0">按天请假</el-radio>
  585. <el-radio label="1">按小时请假</el-radio>
  586. </el-radio-group>
  587. </el-form-item>
  588. <!-- 时间选择 -->
  589. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 74%;margin-right:500px">
  590. <el-col :span="9">
  591. <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  592. <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  593. </el-col>
  594. <el-col class="line" v-if="flg" :span="2">-</el-col>
  595. <el-col :span="9">
  596. <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  597. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  598. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  599. </el-select> -->
  600. </el-col>
  601. </el-form-item>
  602. <!-- 请假天数 -->
  603. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  604. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  605. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  606. <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 天</div>
  607. <div v-else>
  608. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
  609. </div>
  610. </el-form-item>
  611. <!-- 备注 -->
  612. <el-form-item label="备注" style="width: 100%">
  613. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 62%" maxlength="100" show-word-limit></el-input>
  614. </el-form-item>
  615. </el-form>
  616. <span slot="footer" class="dialog-footer">
  617. <el-button @click="dialog = false">取 消</el-button>
  618. <el-button type="primary" @click="determine()">确 定</el-button>
  619. </span>
  620. </el-dialog>
  621. </section>
  622. </template>
  623. <script>
  624. import { config, error } from 'dingtalk-jsapi';
  625. export default {
  626. name: "expense",
  627. components: {},
  628. props: {},
  629. data() {
  630. //验证手机号
  631. var checkTel = (rule, value, callback) =>{
  632. if (!value) {
  633. return callback(new Error('手机号不能为空'));
  634. } else {
  635. const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
  636. if (reg.test(value)) {
  637. callback();
  638. } else {
  639. return callback(new Error('请输入正确的手机号'));
  640. }
  641. }
  642. };
  643. var checks = (rule, value, callback) => {
  644. if (!value) {
  645. return callback(new Error('请假天数不能为空'));
  646. } else {
  647. if (value > this.timeChoose) {
  648. return callback(new Error('超过当前选择日期的天数'));
  649. } else {
  650. callback();
  651. }
  652. }
  653. };
  654. return {
  655. addFormRules: {
  656. ownerId: [{ required: true, message: "请选择请假人", trigger: "blur" }],
  657. tel: [{required: true, validator: checkTel, trigger: 'blur'}],
  658. timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  659. leaveType: [{ required: true, message: "请选择请假类型", trigger: "blur" }],
  660. projectAuditorJson: [{ required: true, message: "请选择审批人", trigger: "blur" }]
  661. },
  662. user: JSON.parse(sessionStorage.getItem("user")),
  663. shuz: ['事假填报', '病假填报', '年假填报', '产假填报'],
  664. ins: 0,
  665. addForm: {
  666. timeType: '0',
  667. startDate: this.getCurrentTime(),
  668. endDate: this.getCurrentTime(),
  669. timeDays: 1,
  670. leaveType: 0,
  671. ownerId: '',
  672. // indate: this.getCurrentTime(),
  673. timeHours: 8,
  674. tel: '',
  675. remark: '',
  676. projectAuditorJson: ''
  677. },
  678. displayTable: false,
  679. users: [], // 人员信息
  680. flg: true,
  681. createDate: [],
  682. pickerOptionsEnd: {
  683. disabledDate: (time) => {
  684. if (this.addForm.startDate) {
  685. return time.getTime() < new Date(this.addForm.startDate).getTime() - 86400000;
  686. }
  687. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  688. },
  689. },
  690. pickerOptionsEnds: {
  691. disabledDate: (time) => {
  692. if (this.statData) {
  693. return time.getTime() < new Date(this.statData).getTime() - 86400000;
  694. }
  695. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  696. },
  697. },
  698. options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
  699. tableData: [],
  700. page: 1,
  701. size: 20,
  702. isAuditList: '',
  703. total:0,
  704. apk: false,
  705. keyword: '',
  706. statData: this.getCurrentTimes(),
  707. endData: this.getCurrentTime(),
  708. statisticalList: [],
  709. loading: false,
  710. timeChoose: 1,
  711. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  712. typess: [{name: '事假',id: 0},{name: '病假',id: 1},{name: '年假',id: 2},{name: '产假',id: 3},{name: '婚假',id: 4},{name: '丧假',id: 5},{name: '调休假',id: 6},{name: '陪产假',id: 7},{name: '其他', id: 8}],
  713. statuss: [{
  714. name: '审核通过',
  715. id: 0
  716. },{
  717. name: '待审核',
  718. id: 1
  719. },{
  720. name: '驳回',
  721. id: 2
  722. },{
  723. name: '已撤销',
  724. id: 3
  725. }],
  726. createDatelis: '',
  727. ownerIds: '',
  728. type: '',
  729. code: '',
  730. falg: 0,
  731. dialog: false,
  732. adform: {},
  733. affId: '',
  734. qjType: [
  735. {name: '事假', id: 0},
  736. {name: '病假', id: 1},
  737. {name: '年假', id: 2},
  738. {name: '产假', id: 3},
  739. {name: '婚假', id: 4},
  740. {name: '丧假', id: 5},
  741. {name: '调休假', id: 6},
  742. {name: '陪产假', id: 7},
  743. {name: '其他', id: 8}
  744. ],
  745. //
  746. apk2: false,
  747. sdata:[],
  748. dataArray:[],
  749. sdefaultProps: {
  750. children: 'children',
  751. label: 'label'
  752. },
  753. depData: null,
  754. isAdd : false,
  755. sindex : 0,
  756. curDeptId : null,
  757. curUserId : null,
  758. dialogVisible: false,
  759. soption : null,
  760. Alshow: false,
  761. Alchange: {yearDays:null,userId:null},
  762. AlchangeP: [],
  763. susers: [],
  764. keywordAl: '',
  765. NcurDeptId:[],
  766. Nsdata : [],
  767. AlData : [],
  768. iAlDataS: [],
  769. iAlData : [],
  770. // ---------
  771. txselnum: 0,
  772. approverList: [],
  773. isDingding: 0,
  774. vacationList: [],
  775. leaveTypeList: [],
  776. leaveTypeItem: '',
  777. departmentOptions: [],
  778. departmentSel: [],
  779. userSelId: '',
  780. synchronizeLoading: false,
  781. kuanBl: 0,
  782. hubs: 0
  783. };
  784. },
  785. computed: {},
  786. watch: {},
  787. created() {
  788. let widTHBul = document.documentElement.clientWidth - 440
  789. this.kuanBl = widTHBul
  790. this.hubs = (document.documentElement.clientHeight || document.body.clientHeight) - 70
  791. let height = window.innerHeight;
  792. this.tableHeight = height - 195;
  793. const that = this;
  794. window.onresize = function temp() {
  795. that.tableHeight = window.innerHeight - 195;
  796. };
  797. // console.log('user',this.user);
  798. this.isDingding = this.user.timeType.syncDingding
  799. },
  800. mounted() {
  801. if(this.isDingding){
  802. this.bills(false,2)
  803. this.staffs(7,['7'])
  804. this.getUsers()
  805. }else{
  806. this.getUsers() // 获取人员信息
  807. this.getDepartment();
  808. this.getAl();
  809. this.getApproverList()
  810. }
  811. },
  812. filters: {},
  813. methods: {
  814. // 从钉钉同步假期剩余表
  815. listSynchronize(){
  816. this.synchronizeLoading = true
  817. this.http.post('/dingding/syncLeaveQuotaData',{
  818. companyId: this.user.companyId
  819. },res => {
  820. if(res.code == 'ok'){
  821. this.synchronizeLoading = false
  822. this.$message({
  823. message: '同步成功',
  824. type: 'success'
  825. })
  826. this.getVacationList()
  827. this.page = 1
  828. this.departmentSel = []
  829. this.userSelId = ''
  830. }else {
  831. this.synchronizeLoading = false
  832. this.$message({
  833. message: res.msg,
  834. type: 'error'
  835. })
  836. }
  837. },err => {
  838. this.synchronizeLoading = false
  839. this.$message({
  840. message: err,
  841. type: 'error'
  842. })
  843. })
  844. },
  845. // 获取部门列表
  846. getDepartmentOptions(){
  847. this.http.post(this.port.manage.depList,{
  848. },res =>{
  849. if(res.code == 'ok'){
  850. // console.log('getDepartment',res.data);
  851. this.departmentOptions = this.changeArr(res.data)
  852. }else {
  853. this.$message({
  854. message: res.msg,
  855. type: 'error'
  856. })
  857. }
  858. },err => {
  859. this.$message({
  860. message: err,
  861. type: 'error'
  862. })
  863. })
  864. },
  865. departmentOptionsChg(){
  866. // console.log(this.departmentSel);
  867. this.page = 1
  868. this.getVacationList(1)
  869. },
  870. userChg(){
  871. // console.log(this.userSelId);
  872. this.page = 1
  873. this.getVacationList(1)
  874. },
  875. // 获取剩余假期信息列表
  876. getVacationList(e){
  877. this.loading = true
  878. let item = {}
  879. if(e){
  880. item = {
  881. companyId: this.user.companyId,
  882. pageIndex: this.page,
  883. leaveCode: this.leaveTypeItem
  884. }
  885. if(this.departmentSel.length != 0){
  886. item.departmentId = this.departmentSel[this.departmentSel.length - 1]
  887. }
  888. if(this.userSelId != ''){
  889. item.userId = this.userSelId
  890. }
  891. // if()
  892. }else{
  893. item = {
  894. companyId: this.user.companyId,
  895. // leaveCode: '',
  896. // userId: '',
  897. pageIndex: this.page,
  898. // departmentId: ''
  899. }
  900. }
  901. this.http.post('/user-yearleave-setting/getDingDingLeaveQt',item,
  902. res => {
  903. if(res.code == 'ok'){
  904. this.vacationList = res.data.records
  905. this.total = res.data.total
  906. if(!e){
  907. this.leaveTypeList = res.data.leaveTypeList
  908. this.leaveTypeItem = res.data.defaultLeaveType.leaveCode
  909. }
  910. this.loading = false
  911. }else {
  912. this.loading = false
  913. this.$message({
  914. message: res.msg,
  915. type: 'error'
  916. })
  917. }
  918. },err => {
  919. this.loading = false
  920. this.$message({
  921. message: err,
  922. type: 'error'
  923. })
  924. })
  925. },
  926. leaveTypeChange(){
  927. // console.log(this.leaveTypeItem);
  928. this.page = 1
  929. this.getVacationList(1)
  930. },
  931. getApproverList(){
  932. this.http.post('/project/getMyParticiPMList',{
  933. },res => {
  934. if(res.code == 'ok'){
  935. this.approverList = res.data
  936. if(this.approverList.length == 0){
  937. this.$message({
  938. message: '当前无审批人,请联系管理员配置审批人',
  939. type: 'warning'
  940. })
  941. }
  942. // console.log('list',res.data);
  943. }else {
  944. this.$message({
  945. message: res.msg,
  946. type: 'error'
  947. })
  948. }
  949. },error => {
  950. this.$message({
  951. message: error,
  952. type: 'error'
  953. })
  954. })
  955. },
  956. changeAltime(e){
  957. if(e == 0 && this.AlchangeP.length == 0){
  958. this.$message('请选择要批量设置的项')
  959. return
  960. }else if(e != 0){
  961. this.Alchange = JSON.parse(JSON.stringify(e))
  962. }
  963. this.Alshow = true
  964. },
  965. selPchg(e){
  966. this.AlchangeP = e
  967. },
  968. searchAl(){
  969. this.iAlDataS = []
  970. for (let i = 0; i < this.iAlData.length; i++) {
  971. if (this.iAlData[i].userName.indexOf(this.keywordAl) != -1) {
  972. this.iAlDataS.push(this.iAlData[i])
  973. }
  974. }
  975. },
  976. clearsearchAl(){
  977. this.iAlDataS = this.iAlData
  978. },
  979. delAltime(){
  980. this.Alshow = false
  981. this.Alchange = {yearDays:null,userId:null}
  982. },
  983. chgAltime(){
  984. let chgPar = {}
  985. let userids = ''
  986. let Alpost = ''
  987. if(this.Alchange.userId == null && this.AlchangeP != []){
  988. Alpost = "/user-yearleave-setting/saveBatch"
  989. for (let i = 0; i < this.AlchangeP.length; i++) {
  990. userids = userids + "," + this.AlchangeP[i].userId
  991. }
  992. chgPar = {userIds: userids.slice(1), companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  993. }else {
  994. Alpost = "/user-yearleave-setting/save"
  995. userids = this.Alchange.userId
  996. chgPar = {userId: userids, companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  997. }
  998. this.http.post(Alpost,chgPar,
  999. res => {
  1000. if(res.code == "ok"){
  1001. this.Alshow = false,
  1002. this.Alchange = {yearDays:null,userId:null},
  1003. this.AlchangeP = []
  1004. this.getAl()
  1005. }else{
  1006. this.$message({
  1007. message: res.msg,
  1008. type: "error"
  1009. })
  1010. }
  1011. },
  1012. error => {
  1013. this.Alshow = false
  1014. this.$message({
  1015. message: error,
  1016. type: "error"
  1017. })
  1018. }
  1019. )
  1020. },
  1021. getAl(){
  1022. this.http.get('/user-yearleave-setting/list',
  1023. res => {
  1024. if(res.code == "ok"){
  1025. this.iAlData = res.data
  1026. this.iAlDataS = this.iAlData
  1027. if(this.apk2 == 6){
  1028. this.selAl()
  1029. }
  1030. } else {
  1031. this.$message({
  1032. message: res.msg,
  1033. type: "error"
  1034. })
  1035. }
  1036. },
  1037. error => {
  1038. this.Alshow = false
  1039. this.$message({
  1040. message: error,
  1041. type: "error"
  1042. })
  1043. }
  1044. )
  1045. },
  1046. selAl(){
  1047. let e = this.$refs.selectAl.getCheckedNodes()[0]
  1048. if(e == undefined){
  1049. this.iAlDataS = this.iAlData
  1050. }else{
  1051. this.iAlDataS = []
  1052. for (let i = 0; i < this.iAlData.length; i++) {
  1053. if (e.label == this.iAlData[i].department) {
  1054. this.iAlDataS.push(this.iAlData[i])
  1055. }
  1056. }
  1057. }
  1058. },
  1059. // ---------
  1060. handleNodeClick(data) {
  1061. if(this.depData == null || data.id != this.depData.id) {
  1062. this.depData = data;
  1063. // console.log("depdata",this.depData);
  1064. this.getSettings();
  1065. }
  1066. },
  1067. getSettings() {
  1068. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 1},
  1069. res => {
  1070. this.listLoading = false;
  1071. if (res.code == "ok") {
  1072. this.dataArray = res.data;
  1073. // console.log("请求1",res.data);
  1074. } else {
  1075. this.$message({
  1076. message: res.msg,
  1077. type: "error"
  1078. });
  1079. }
  1080. },
  1081. error => {
  1082. this.listLoading = false;
  1083. this.$message({
  1084. message: error,
  1085. type: "error"
  1086. });
  1087. }
  1088. );
  1089. },
  1090. // 获取部门列表
  1091. getDepartment() {
  1092. this.http.post( this.port.manage.depList, {},
  1093. res => {
  1094. if (res.code == "ok") {
  1095. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1096. this.sdata = list;
  1097. this.soption = [
  1098. {value: 1 , label : "部门" , children : this.changeArr(list1)},
  1099. {value: 2 , label : "指定人员",children : this.susers}
  1100. ]
  1101. this.Nsdata = list1
  1102. } else {
  1103. this.$message({
  1104. message: res.msg,
  1105. type: "error"
  1106. });
  1107. }
  1108. },
  1109. error => {
  1110. this.$message({
  1111. message: error,
  1112. type: "error"
  1113. });
  1114. });
  1115. },
  1116. changeArr(arr) {
  1117. for (var i = 0; i < arr.length; i++) {
  1118. if(arr[i].id != -1 && arr[i].id != 0) {
  1119. if (arr[i].children != null && arr[i].children.length>0) {
  1120. arr[i].children = this.changeArr(arr[i].children);
  1121. }
  1122. arr[i].id && (arr[i].value = arr[i].id);
  1123. delete arr[i].id;
  1124. }
  1125. }
  1126. for(var i in arr) {
  1127. if(arr[i].id == -1 || arr[i].id == 0) {
  1128. arr.splice(i,1)
  1129. }
  1130. }
  1131. return arr;
  1132. },
  1133. showNodeDialog(index) {
  1134. this.isAdd = true;
  1135. this.sindex = index;
  1136. this.curDeptId = null;
  1137. this.curUserId = null;
  1138. this.dialogVisible = true;
  1139. },
  1140. editNodeDialog(index, item) {
  1141. //检查是否可编辑
  1142. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 1},
  1143. res => {
  1144. this.listLoading = false;
  1145. if (res.code == "ok") {
  1146. this.isAdd = false;
  1147. this.sindex = index;
  1148. this.curUserId = item.userId;
  1149. this.dialogVisible = true;
  1150. this.curDeptId = item.auditDeptId;
  1151. } else {
  1152. this.$message({
  1153. message: res.msg,
  1154. type: "error"
  1155. });
  1156. }
  1157. },
  1158. error => {
  1159. this.listLoading = false;
  1160. this.$message({
  1161. message: error,
  1162. type: "error"
  1163. });
  1164. }
  1165. );
  1166. },
  1167. addNode() {
  1168. this.dialogVisible = false;
  1169. if (this.curDeptId == null) return;
  1170. var node = this.$refs.deptCascader.getCheckedNodes()[0];
  1171. // console.log("node",node);
  1172. if (this.isAdd) {
  1173. if(node.path[0] == 1){
  1174. var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1175. }else if(node.path[0] == 2){
  1176. var node = {userId: node.value, userName: node.label, auditorType: 2};
  1177. }
  1178. this.dataArray.splice(this.sindex, 0, node);
  1179. } else {
  1180. //编辑
  1181. this.dataArray[this.sindex].auditDeptId = node.value;
  1182. this.dataArray[this.sindex].auditDeptName = node.label;
  1183. }
  1184. },
  1185. deleteNode() {
  1186. this.dialogVisible = false;
  1187. this.dataArray.splice(this.sindex, 1);
  1188. },
  1189. submitInsert() {
  1190. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
  1191. res => {
  1192. this.listLoading = false;
  1193. if (res.code == "ok") {
  1194. this.$message({
  1195. message: '保存成功',
  1196. type: "success"
  1197. });
  1198. } else {
  1199. this.$message({
  1200. message: res.msg,
  1201. type: "error"
  1202. });
  1203. }
  1204. },
  1205. error => {
  1206. this.listLoading = false;
  1207. this.$message({
  1208. message: error,
  1209. type: "error"
  1210. });
  1211. }
  1212. );
  1213. },
  1214. //
  1215. approve(item) {
  1216. //审核通过
  1217. this.http.post('/leave-sheet/approve', {id:item.id
  1218. },
  1219. res => {
  1220. if (res.code == "ok") {
  1221. this.bills(true);
  1222. } else {
  1223. this.$message({
  1224. message: res.msg,
  1225. type: "error"
  1226. });
  1227. }
  1228. },
  1229. error => {
  1230. this.$message({
  1231. message: error,
  1232. type: "error"
  1233. });
  1234. });
  1235. },
  1236. deny(item) {
  1237. //审核驳回
  1238. this.http.post('/leave-sheet/deny', {id:item.id
  1239. },
  1240. res => {
  1241. if (res.code == "ok") {
  1242. this.bills(true);
  1243. } else {
  1244. this.$message({
  1245. message: res.msg,
  1246. type: "error"
  1247. });
  1248. }
  1249. },
  1250. error => {
  1251. this.$message({
  1252. message: error,
  1253. type: "error"
  1254. });
  1255. });
  1256. },
  1257. getUsers() {
  1258. this.http.post(this.port.manage.list, {
  1259. departmentId: -1,
  1260. pageIndex: 1,
  1261. // pageSize: 99999
  1262. pageSize: -1
  1263. },
  1264. res => {
  1265. if (res.code == "ok") {
  1266. this.users = res.data.records;
  1267. for (let i = 0; i < this.users.length; i++) {
  1268. this.susers.push({value:this.users[i].id,label:this.users[i].name})
  1269. }
  1270. //只能自己填报自己的请假单
  1271. this.addForm.ownerId = this.user.id;
  1272. this.addForm.status = 1;
  1273. this.addForm.tel = this.user.phone
  1274. } else {
  1275. this.$message({
  1276. message: res.msg,
  1277. type: "error"
  1278. });
  1279. }
  1280. },
  1281. error => {
  1282. this.$message({
  1283. message: error,
  1284. type: "error"
  1285. });
  1286. });
  1287. },
  1288. // 员工请假填报点击事件
  1289. ssl(index) {
  1290. this.ins = index;
  1291. this.addForm.leaveType = index
  1292. },
  1293. staffs(key, keyPath) {
  1294. // console.log("keypath",key,keyPath)
  1295. if (keyPath[0] == '1') {
  1296. this.displayTable = false;
  1297. this.apk = false
  1298. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1299. this.displayTable = true;
  1300. this.apk = false
  1301. } else if(keyPath[0] == '4'){
  1302. this.displayTable = true;
  1303. this.apk = true
  1304. this.apk2 = 4
  1305. this.statistical()
  1306. } else if(keyPath[0] == '5'){
  1307. this.displayTable = true;
  1308. this.apk2 = 5
  1309. this.apk = true
  1310. } else if(keyPath[0] == '6'){
  1311. this.NcurDeptId = []
  1312. this.displayTable = true;
  1313. this.apk2 = 6
  1314. this.apk = true
  1315. this.getAl()
  1316. } else if(keyPath[0] == '7'){
  1317. this.displayTable = true;
  1318. this.apk = false
  1319. this.bills(false,2)
  1320. } else if(keyPath[0] == '8'){
  1321. this.apk2 = 8
  1322. this.displayTable = true
  1323. this.apk = true
  1324. this.userSelId = ''
  1325. this.page = 1
  1326. this.departmentSel = []
  1327. this.getVacationList()
  1328. this.getDepartmentOptions()
  1329. }
  1330. },
  1331. bills(audit, tr){
  1332. if(tr) {
  1333. this.code = ''
  1334. this.createDate = []
  1335. // this.ownerIds = ''
  1336. this.type = ''
  1337. if(tr == 1) {
  1338. this.falg = 1
  1339. this.code = 1
  1340. } else if(tr == 2) {
  1341. this.code = ''
  1342. this.falg = 0
  1343. } else {
  1344. this.falg = 0
  1345. }
  1346. } else {
  1347. this.falg = false
  1348. }
  1349. this.tableData = []
  1350. this.displayTable = true;
  1351. this.isAuditList = audit;
  1352. this.loading = true
  1353. this.page = '1'
  1354. var param = { pageIndex: this.page,
  1355. pageSize: this.size,
  1356. status: this.code,
  1357. // createDate: this.createDate,
  1358. startDate: this.createDate == null ? '' : this.createDate[0],
  1359. endDate: this.createDate == null ? '' : this.createDate[1],
  1360. ownerId: this.ownerIds,
  1361. leaveType: this.type,
  1362. };
  1363. if (this.isAuditList) {
  1364. param.status = 1;
  1365. }
  1366. this.list = [];
  1367. // this.total = 0;
  1368. this.http.post('/leave-sheet/list', param,
  1369. res => {
  1370. if (res.code == "ok") {
  1371. this.tableData = res.data.records
  1372. this.total = res.data.total
  1373. this.loading = false
  1374. } else {
  1375. this.loading = false
  1376. this.$message({
  1377. message: res.msg,
  1378. type: "error"
  1379. });
  1380. }
  1381. },
  1382. error => {
  1383. this.loading = false
  1384. this.$message({
  1385. message: error,
  1386. type: "error"
  1387. });
  1388. });
  1389. },
  1390. billss() {
  1391. this.page = 1
  1392. var param = {pageIndex: this.page,
  1393. pageSize: this.size,
  1394. status: this.code,
  1395. // startDate: this.createDate,
  1396. startDate: this.createDate == null ? '' : this.createDate[0],
  1397. endDate: this.createDate == null ? '' : this.createDate[1],
  1398. ownerId: this.ownerIds,
  1399. leaveType: this.type,
  1400. };
  1401. this.http.post('/leave-sheet/list', param,
  1402. res => {
  1403. if (res.code == "ok") {
  1404. this.tableData = res.data.records
  1405. this.total = res.data.total
  1406. this.loading = false
  1407. } else {
  1408. this.loading = false
  1409. this.$message({
  1410. message: res.msg,
  1411. type: "error"
  1412. });
  1413. }
  1414. },
  1415. error => {
  1416. this.loading = false
  1417. this.$message({
  1418. message: error,
  1419. type: "error"
  1420. });
  1421. });
  1422. },
  1423. // 判断日期是否补零了
  1424. buling(das) {
  1425. var rqi = das.split('-')
  1426. rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
  1427. rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
  1428. var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
  1429. return zong
  1430. },
  1431. submits(){
  1432. // console.log(this.addForm)
  1433. // return
  1434. this.$refs.addForm.validate(valid => {
  1435. this.addForm.endDate = this.buling(this.addForm.endDate)
  1436. this.addForm.startDate = this.buling(this.addForm.startDate)
  1437. // this.addForm.projectAuditorJson = JSON.stringify(this.addForm.projectAuditorJson)
  1438. if (valid) {
  1439. this.http.post('/leave-sheet/add', this.addForm,
  1440. res => {
  1441. if (res.code == "ok") {
  1442. this.$message({
  1443. message: '填报成功',
  1444. type: "success"
  1445. });
  1446. this.addForm.timeType = '0'
  1447. this.addForm.startDate = this.getCurrentTime()
  1448. this.addForm.endDate = this.getCurrentTime()
  1449. this.addForm.timeDays = 1
  1450. this.addForm.leaveType = 0
  1451. this.addForm.timeHours = 8
  1452. this.addForm.remark = ''
  1453. this.addForm.projectAuditorJson = ''
  1454. // this.addForm = {
  1455. // timeType: '0',
  1456. // startDate: this.getCurrentTime(),
  1457. // endDate: this.getCurrentTime(),
  1458. // timeDays: 1,
  1459. // leaveType: 0,
  1460. // ownerId: '',
  1461. // // indate: this.getCurrentTime(),
  1462. // timeHours: 8,
  1463. // tel: '',
  1464. // remark: '',
  1465. // projectAuditorJson: ''
  1466. // }
  1467. this.flg = true
  1468. } else {
  1469. this.$message({
  1470. message: res.msg,
  1471. type: "error"
  1472. });
  1473. }
  1474. },
  1475. error => {
  1476. this.$message({
  1477. message: error,
  1478. type: "error"
  1479. });
  1480. });
  1481. } else {
  1482. return false;
  1483. }
  1484. });
  1485. },
  1486. txselts(a,b){
  1487. this.selts()
  1488. // console.log('txselts',this.addForm.ownerId);
  1489. if(a == 6 && this.addForm.ownerId != ''){
  1490. this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
  1491. res => {
  1492. if(res.code == "ok") {
  1493. // console.log('post',res.data);
  1494. if(res.data < 0.5){
  1495. this.txselnum = 0
  1496. }else{
  1497. this.txselnum = res.data.toFixed(1)
  1498. }
  1499. } else {
  1500. this.$message({
  1501. message: res.msg,
  1502. type: "error"
  1503. });
  1504. }
  1505. },
  1506. error => {
  1507. this.$message({
  1508. message: error,
  1509. type: "error"
  1510. });
  1511. })
  1512. }
  1513. },
  1514. selts() {
  1515. for(var i in this.users) {
  1516. if(this.users[i].id == this.addForm.ownerId) {
  1517. this.addForm.tel = this.users[i].phone
  1518. }
  1519. }
  1520. },
  1521. chanRadio() {
  1522. // console.log(this.addForm.timeType)
  1523. if(this.addForm.timeType == '0') {
  1524. this.flg = true
  1525. this.addForm.startDate = this.getCurrentTime()
  1526. this.addForm.endDate = this.getCurrentTime()
  1527. this.addForm.timeType = '0'
  1528. this.addForm.timeDays = '1'
  1529. this.addForm.timeHours = '8'
  1530. } else {
  1531. this.flg = false
  1532. this.addForm.startDate = this.getCurrentTime()
  1533. this.addForm.endDate = this.getCurrentTime()
  1534. this.addForm.timeType = '1'
  1535. this.addForm.timeHours = 1,
  1536. this.addForm.timeDays = 1
  1537. }
  1538. },
  1539. // 计算日期
  1540. datas() {
  1541. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  1542. if(this.addForm.startDate > this.addForm.endDate) {
  1543. this.addForm.endDate = this.addForm.startDate
  1544. }
  1545. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  1546. this.timeChoose = this.addForm.timeDays
  1547. this.addForm.timeHours = this.addForm.timeDays * 8
  1548. },
  1549. datasss() {
  1550. // console.log(123)
  1551. this.addForm.endDate = this.addForm.startDate
  1552. },
  1553. DateDiff(sDate1, sDate2){
  1554. var aDate, oDate1, oDate2, iDays
  1555. aDate = sDate1.split("-")
  1556. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1557. aDate = sDate2.split("-")
  1558. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1559. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  1560. return iDays + 1
  1561. },
  1562. stringToDate(dateString){
  1563. dateString = dateString.split('-');
  1564. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  1565. },
  1566. countWorkDay(date1, date2){
  1567. date1 = this.stringToDate(date1);
  1568. date2 = this.stringToDate(date2);
  1569. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  1570. var weeks = 0;
  1571. for(var i = 0; i < delta; i++){
  1572. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  1573. date1 = date1.valueOf();
  1574. date1 += 1000 * 60 * 60 * 24;
  1575. date1 = new Date(date1);
  1576. }
  1577. return delta - weeks;
  1578. },
  1579. chufas() {
  1580. this.billss()
  1581. },
  1582. // 时间
  1583. getTadeTime() {
  1584. var time = new Date();
  1585. return time.getHours() +':00:00'
  1586. },
  1587. // 日期
  1588. getCurrentTime() {
  1589. var _this = this;
  1590.   let yy = new Date().getFullYear();
  1591.   let mm = new Date().getMonth()+1;
  1592.   let dd = new Date().getDate();
  1593.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  1594.   return _this.gettime
  1595. },
  1596. getCurrentTimes() {
  1597. var _this = this;
  1598.   let yy = new Date().getFullYear();
  1599.   let mm = new Date().getMonth()+1;
  1600.   let dd = new Date().getDate();
  1601.   _this.gettime = yy+'-'+mm+'-'+'01';
  1602.   return _this.gettime
  1603. },
  1604. chanSele() {
  1605. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  1606. },
  1607. handleSizeChange(val){
  1608. this.size = val;
  1609. this.bills()
  1610. },
  1611. handleCurrentChange(val) {
  1612. // console.log(val, 1, '1')
  1613. this.page = val;
  1614. this.bills()
  1615. },
  1616. vacationSizeChange(val){
  1617. this.size = val
  1618. this.getVacationList(1)
  1619. },
  1620. vacationCurrentChange(val){
  1621. this.page = val
  1622. this.getVacationList(1)
  1623. },
  1624. statistical() {
  1625. this.loading = true
  1626. this.http.post('/leave-sheet/summaryData', {
  1627. keyword: this.keyword,
  1628. startDate: this.statData,
  1629. endDate: this.endData
  1630. },
  1631. res => {
  1632. if (res.code == "ok") {
  1633. this.statisticalList = res.data
  1634. this.loading = false
  1635. } else {
  1636. this.loading = false
  1637. this.$message({
  1638. message: res.msg,
  1639. type: "error"
  1640. });
  1641. }
  1642. },
  1643. error => {
  1644. this.$message({
  1645. message: error,
  1646. type: "error"
  1647. });
  1648. });
  1649. },
  1650. //
  1651. inputs() {
  1652. var str = this.addForm.timeDays + ''
  1653. if(str.indexOf('.') != '-1') {
  1654. var s = str.split('.')[0]
  1655. var st = str.split('.')[1]
  1656. var sts = st.split('')
  1657. this.addForm.timeDays = s + '.' + sts[0]
  1658. }
  1659. },
  1660. inputss() {
  1661. if(this.addForm.timeHours <= 0) {
  1662. this.addForm.timeHours = 1
  1663. } else if(this.addForm.timeHours > 8) {
  1664. this.addForm.timeHours = 8
  1665. } else {
  1666. if(this.addForm.timeHours.indexOf('.') != '-1') {
  1667. var str = this.addForm.timeHours
  1668. // console.log(str)
  1669. if(str.indexOf('.') != '-1') {
  1670. var s = str.split('.')[0]
  1671. var st = str.split('.')[1]
  1672. var sts = st.split('')
  1673. this.addForm.timeHours = s + '.' + sts[0]
  1674. }
  1675. }
  1676. }
  1677. // console.log(this.addForm)
  1678. },
  1679. deletes(e) {
  1680. this.$confirm("确认要删除吗?", "提示", {
  1681. //type: 'warning'
  1682. }).then(() => {
  1683. this.http.post('/leave-sheet/delete', {id:e.id},
  1684. res => {
  1685. if (res.code == "ok") {
  1686. this.bills();
  1687. this.$message({
  1688. message: '删除成功',
  1689. type: "success"
  1690. });
  1691. } else {
  1692. this.$message({
  1693. message: res.msg,
  1694. type: "error"
  1695. });
  1696. }
  1697. },
  1698. error => {
  1699. this.$message({
  1700. message: error,
  1701. type: "error"
  1702. });
  1703. });
  1704. });
  1705. },
  1706. editor(items) {
  1707. this.dialog = true
  1708. this.addForm.ownerId = items.ownerId
  1709. this.addForm.tel = items.tel
  1710. this.addForm.timeType = items.timeType + ''
  1711. this.addForm.startDate = items.startDate
  1712. this.addForm.endDate = items.endDate
  1713. this.addForm.timeDays = items.timeDays
  1714. this.addForm.timeHours = items.timeHours
  1715. this.addForm.remark = items.remark
  1716. this.affId = items.id
  1717. },
  1718. determine () {
  1719. var adl = this.addForm
  1720. adl.id = this.affId
  1721. this.http.post('/leave-sheet/add', adl,
  1722. res => {
  1723. if (res.code == "ok") {
  1724. this.dialog = false
  1725. this.bills();
  1726. this.addForm = {
  1727. timeType: '0',
  1728. startDate: this.getCurrentTime(),
  1729. endDate: this.getCurrentTime(),
  1730. timeDays: 1,
  1731. leaveType: 0,
  1732. timeHours: '8',
  1733. tel: '',
  1734. remark: ''
  1735. }
  1736. this.getUsers()
  1737. } else {
  1738. this.$message({
  1739. message: res.msg,
  1740. type: "error"
  1741. });
  1742. }
  1743. },
  1744. error => {
  1745. this.$message({
  1746. message: error,
  1747. type: "error"
  1748. });
  1749. });
  1750. },
  1751. bangd() {
  1752. this.addForm = {
  1753. timeType: '0',
  1754. startDate: this.getCurrentTime(),
  1755. endDate: this.getCurrentTime(),
  1756. timeDays: 1,
  1757. leaveType: 0,
  1758. timeHours: '8',
  1759. tel: '',
  1760. remark: ''
  1761. }
  1762. this.getUsers()
  1763. }
  1764. }
  1765. };
  1766. </script>
  1767. <style scoped>
  1768. .addNode {
  1769. cursor:pointer;
  1770. }
  1771. .addNode:hover {
  1772. color:#20a0ff;
  1773. }
  1774. .apls {
  1775. width: 200px;
  1776. white-space:nowrap;
  1777. overflow:hidden;
  1778. text-overflow:ellipsis;
  1779. }
  1780. .tups {
  1781. width: 100%;
  1782. height: 25px;
  1783. position: relative;
  1784. z-index: 99;
  1785. overflow: hidden;
  1786. }
  1787. .tups img {
  1788. height: 25px !important;
  1789. position: relative;
  1790. z-index: 99;
  1791. }
  1792. .viewer-canvas {
  1793. position: absolute;
  1794. z-index: 9 !important;
  1795. }
  1796. .icl {
  1797. margin-top: -25px !important;
  1798. }
  1799. /* 费用报销标题 */
  1800. .headine {
  1801. width: 100%;
  1802. height: 46.4px;
  1803. line-height: 46.4px;
  1804. background: #fff;
  1805. box-sizing: border-box;
  1806. }
  1807. .headine h3 {
  1808. margin: 0;
  1809. display: inline-block;
  1810. box-sizing: border-box;
  1811. color: #999;
  1812. }
  1813. .headine p {
  1814. display: inline-block;
  1815. margin: 0;
  1816. }
  1817. /* /费用报销标题 */
  1818. .sidebars {
  1819. height: 100%;
  1820. position: absolute;
  1821. border-right: 1px solid #E6E6E6;
  1822. z-index: 2;
  1823. top: 0;
  1824. }
  1825. .sidebars h3 {
  1826. margin: 0;
  1827. line-height: 45px;
  1828. background: #ffffff;
  1829. font-weight: normal;
  1830. color: #666;
  1831. padding-left: 20px;
  1832. }
  1833. .sidebars .el-col-12 {
  1834. width: 100%
  1835. }
  1836. .public {
  1837. height: 230px;
  1838. border-bottom: 1px solid #ddd;
  1839. }
  1840. .public .el-form-item {
  1841. display: inline-block;
  1842. }
  1843. .pu_button {
  1844. text-align: right;
  1845. width: 100%;
  1846. padding: 24px 30px;
  1847. box-sizing: border-box;
  1848. }
  1849. .pu_bu_x .pu_bu_t {
  1850. display: inline-block;
  1851. }
  1852. .pu_bu_x {
  1853. margin-right: 20px;
  1854. color: #20A0F7;
  1855. cursor: pointer;
  1856. }
  1857. .pu_bu_t {
  1858. color: #20A0F7;
  1859. cursor: pointer;
  1860. display: block;
  1861. float: right;
  1862. position:
  1863. relative;
  1864. top: -20px;
  1865. right: 63px;
  1866. }
  1867. .pu_table {
  1868. margin-left: 10px;
  1869. }
  1870. .pu_bu_t:hover {
  1871. color: #7bbcff;
  1872. }
  1873. .pu_bu_x:hover {
  1874. color: #7bbcff;
  1875. }
  1876. /* 我的单据报销凭证 */
  1877. .staff{
  1878. border-left: 1px solid #fff;
  1879. border-top: 1px solid #fff;
  1880. border-right: 1px solid #fff;
  1881. background: #fff;
  1882. }
  1883. /* */
  1884. .sdat{
  1885. display: inline-block;
  1886. width: 260px;
  1887. margin-left: 13px;
  1888. }
  1889. .messages .el-form-item{
  1890. display: inline-block;
  1891. }
  1892. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1893. width: 190px;
  1894. }
  1895. /* 我的报销单据 */
  1896. .search {
  1897. position: relative;
  1898. top: 20px;
  1899. left: 20px;
  1900. }
  1901. .tables {
  1902. margin-top: 50px;
  1903. box-sizing: border-box;
  1904. padding: 10px;
  1905. }
  1906. .informant .el-form-item {
  1907. display: inline-block;
  1908. }
  1909. /* 侧边栏收索 */
  1910. .side {
  1911. position: absolute;
  1912. z-index: 2;
  1913. border-right: 2px solid #DDDDDD;
  1914. height: 100%;
  1915. top: 0;
  1916. width: 0;
  1917. }
  1918. .side .spans {
  1919. width: 20px;
  1920. height: 30px;
  1921. border: 1px solid #DDDDDD;
  1922. box-sizing: border-box;
  1923. position: absolute;
  1924. top: 50%;
  1925. margin-top: -50%;
  1926. text-align: center;
  1927. z-index: 1;
  1928. background: #fff;
  1929. }
  1930. .side .spans i{
  1931. margin-top: 7px;
  1932. color: #C0BFBF
  1933. }
  1934. .side:hover {
  1935. border-right: 2px solid #20A0FF;
  1936. }
  1937. .side:hover .spans {
  1938. border: 1px solid #20A0FF;
  1939. background: #20A0FF;
  1940. }
  1941. .side:hover .spans i{
  1942. color: #fff;
  1943. }
  1944. /* 右边整体页面 */
  1945. .contents {
  1946. height: 100%;
  1947. /* padding: 30px; */
  1948. background: #F7F7F7;
  1949. /* position: absolute; */
  1950. }
  1951. .submits {
  1952. margin-left: 50%;
  1953. }
  1954. .waiting {
  1955. color:orange;
  1956. }
  1957. .rejected {
  1958. color:red;
  1959. }
  1960. /* 请假模块 */
  1961. .tops {
  1962. width: 100%;
  1963. position: relative;
  1964. background: #f7f7f7;
  1965. box-sizing: border-box;
  1966. padding: 20px 0 0 200px;
  1967. }
  1968. .ctons {
  1969. /* width: 86%; */
  1970. height: 92%;
  1971. overflow: hidden;
  1972. background: #fff;
  1973. padding: 30px 40px;
  1974. box-sizing: border-box;
  1975. }
  1976. .ctons .el-form-item {
  1977. display: inline-block;
  1978. }
  1979. .line {
  1980. text-align: center;
  1981. margin: 0 6px
  1982. }
  1983. .poss {
  1984. position: fixed;
  1985. bottom: 4px;
  1986. right: 1%;
  1987. box-sizing: border-box;
  1988. }
  1989. .flex {
  1990. display: flex;
  1991. padding: 0 0 20px 0;
  1992. border-bottom: 1px solid #f2f2f2;
  1993. }
  1994. .flex span {
  1995. color: #606266;
  1996. display: inline-block;
  1997. margin: 0 10px 0 20px;
  1998. }
  1999. </style>