list.vue 74 KB

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