list.vue 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050
  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="'请假人'" 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. this.http.post('/user/getSimpleActiveUserList', {},
  1265. res => {
  1266. if (res.code == "ok") {
  1267. // this.users = res.data.records;
  1268. this.users = res.data;
  1269. for (let i = 0; i < this.users.length; i++) {
  1270. this.susers.push({value:this.users[i].id,label:this.users[i].name})
  1271. }
  1272. //只能自己填报自己的请假单
  1273. this.addForm.ownerId = this.user.id;
  1274. this.addForm.status = 1;
  1275. this.addForm.tel = this.user.phone
  1276. } else {
  1277. this.$message({
  1278. message: res.msg,
  1279. type: "error"
  1280. });
  1281. }
  1282. },
  1283. error => {
  1284. this.$message({
  1285. message: error,
  1286. type: "error"
  1287. });
  1288. });
  1289. },
  1290. // 员工请假填报点击事件
  1291. ssl(index) {
  1292. this.ins = index;
  1293. this.addForm.leaveType = index
  1294. },
  1295. staffs(key, keyPath) {
  1296. // console.log("keypath",key,keyPath)
  1297. if (keyPath[0] == '1') {
  1298. this.displayTable = false;
  1299. this.apk = false
  1300. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1301. this.displayTable = true;
  1302. this.apk = false
  1303. } else if(keyPath[0] == '4'){
  1304. this.displayTable = true;
  1305. this.apk = true
  1306. this.apk2 = 4
  1307. this.statistical()
  1308. } else if(keyPath[0] == '5'){
  1309. this.displayTable = true;
  1310. this.apk2 = 5
  1311. this.apk = true
  1312. } else if(keyPath[0] == '6'){
  1313. this.NcurDeptId = []
  1314. this.displayTable = true;
  1315. this.apk2 = 6
  1316. this.apk = true
  1317. this.getAl()
  1318. } else if(keyPath[0] == '7'){
  1319. this.displayTable = true;
  1320. this.apk = false
  1321. this.bills(false,2)
  1322. } else if(keyPath[0] == '8'){
  1323. this.apk2 = 8
  1324. this.displayTable = true
  1325. this.apk = true
  1326. this.userSelId = ''
  1327. this.page = 1
  1328. this.departmentSel = []
  1329. this.getVacationList()
  1330. this.getDepartmentOptions()
  1331. }
  1332. },
  1333. bills(audit, tr){
  1334. if(tr) {
  1335. this.code = ''
  1336. this.createDate = []
  1337. // this.ownerIds = ''
  1338. this.type = ''
  1339. if(tr == 1) {
  1340. this.falg = 1
  1341. this.code = 1
  1342. } else if(tr == 2) {
  1343. this.code = ''
  1344. this.falg = 0
  1345. } else {
  1346. this.falg = 0
  1347. }
  1348. } else {
  1349. this.falg = false
  1350. }
  1351. this.tableData = []
  1352. this.displayTable = true;
  1353. this.isAuditList = audit;
  1354. this.loading = true
  1355. this.page = '1'
  1356. var param = { pageIndex: this.page,
  1357. pageSize: this.size,
  1358. status: this.code,
  1359. // createDate: this.createDate,
  1360. startDate: this.createDate == null ? '' : this.createDate[0],
  1361. endDate: this.createDate == null ? '' : this.createDate[1],
  1362. ownerId: this.ownerIds,
  1363. leaveType: this.type,
  1364. };
  1365. if (this.isAuditList) {
  1366. param.status = 1;
  1367. }
  1368. this.list = [];
  1369. // this.total = 0;
  1370. this.http.post('/leave-sheet/list', param,
  1371. res => {
  1372. if (res.code == "ok") {
  1373. this.tableData = res.data.records
  1374. this.total = res.data.total
  1375. this.loading = false
  1376. } else {
  1377. this.loading = false
  1378. this.$message({
  1379. message: res.msg,
  1380. type: "error"
  1381. });
  1382. }
  1383. },
  1384. error => {
  1385. this.loading = false
  1386. this.$message({
  1387. message: error,
  1388. type: "error"
  1389. });
  1390. });
  1391. },
  1392. billss() {
  1393. this.page = 1
  1394. var param = {pageIndex: this.page,
  1395. pageSize: this.size,
  1396. status: this.code,
  1397. // startDate: this.createDate,
  1398. startDate: this.createDate == null ? '' : this.createDate[0],
  1399. endDate: this.createDate == null ? '' : this.createDate[1],
  1400. ownerId: this.ownerIds,
  1401. leaveType: this.type,
  1402. };
  1403. this.http.post('/leave-sheet/list', param,
  1404. res => {
  1405. if (res.code == "ok") {
  1406. this.tableData = res.data.records
  1407. this.total = res.data.total
  1408. this.loading = false
  1409. } else {
  1410. this.loading = false
  1411. this.$message({
  1412. message: res.msg,
  1413. type: "error"
  1414. });
  1415. }
  1416. },
  1417. error => {
  1418. this.loading = false
  1419. this.$message({
  1420. message: error,
  1421. type: "error"
  1422. });
  1423. });
  1424. },
  1425. // 判断日期是否补零了
  1426. buling(das) {
  1427. var rqi = das.split('-')
  1428. rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
  1429. rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
  1430. var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
  1431. return zong
  1432. },
  1433. submits(){
  1434. // console.log(this.addForm)
  1435. // return
  1436. this.$refs.addForm.validate(valid => {
  1437. this.addForm.endDate = this.buling(this.addForm.endDate)
  1438. this.addForm.startDate = this.buling(this.addForm.startDate)
  1439. // this.addForm.projectAuditorJson = JSON.stringify(this.addForm.projectAuditorJson)
  1440. if (valid) {
  1441. this.http.post('/leave-sheet/add', this.addForm,
  1442. res => {
  1443. if (res.code == "ok") {
  1444. this.$message({
  1445. message: '填报成功',
  1446. type: "success"
  1447. });
  1448. this.addForm.timeType = '0'
  1449. this.addForm.startDate = this.getCurrentTime()
  1450. this.addForm.endDate = this.getCurrentTime()
  1451. this.addForm.timeDays = 1
  1452. this.addForm.leaveType = 0
  1453. this.addForm.timeHours = 8
  1454. this.addForm.remark = ''
  1455. this.addForm.projectAuditorJson = ''
  1456. // this.addForm = {
  1457. // timeType: '0',
  1458. // startDate: this.getCurrentTime(),
  1459. // endDate: this.getCurrentTime(),
  1460. // timeDays: 1,
  1461. // leaveType: 0,
  1462. // ownerId: '',
  1463. // // indate: this.getCurrentTime(),
  1464. // timeHours: 8,
  1465. // tel: '',
  1466. // remark: '',
  1467. // projectAuditorJson: ''
  1468. // }
  1469. this.flg = true
  1470. } else {
  1471. this.$message({
  1472. message: res.msg,
  1473. type: "error"
  1474. });
  1475. }
  1476. },
  1477. error => {
  1478. this.$message({
  1479. message: error,
  1480. type: "error"
  1481. });
  1482. });
  1483. } else {
  1484. return false;
  1485. }
  1486. });
  1487. },
  1488. txselts(a,b){
  1489. this.selts()
  1490. // console.log('txselts',this.addForm.ownerId);
  1491. if(a == 6 && this.addForm.ownerId != ''){
  1492. this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
  1493. res => {
  1494. if(res.code == "ok") {
  1495. // console.log('post',res.data);
  1496. if(res.data < 0.5){
  1497. this.txselnum = 0
  1498. }else{
  1499. this.txselnum = res.data.toFixed(1)
  1500. }
  1501. } else {
  1502. this.$message({
  1503. message: res.msg,
  1504. type: "error"
  1505. });
  1506. }
  1507. },
  1508. error => {
  1509. this.$message({
  1510. message: error,
  1511. type: "error"
  1512. });
  1513. })
  1514. }
  1515. },
  1516. selts() {
  1517. for(var i in this.users) {
  1518. if(this.users[i].id == this.addForm.ownerId) {
  1519. this.addForm.tel = this.users[i].phone
  1520. }
  1521. }
  1522. },
  1523. chanRadio() {
  1524. // console.log(this.addForm.timeType)
  1525. if(this.addForm.timeType == '0') {
  1526. this.flg = true
  1527. this.addForm.startDate = this.getCurrentTime()
  1528. this.addForm.endDate = this.getCurrentTime()
  1529. this.addForm.timeType = '0'
  1530. this.addForm.timeDays = '1'
  1531. this.addForm.timeHours = '8'
  1532. } else {
  1533. this.flg = false
  1534. this.addForm.startDate = this.getCurrentTime()
  1535. this.addForm.endDate = this.getCurrentTime()
  1536. this.addForm.timeType = '1'
  1537. this.addForm.timeHours = 1,
  1538. this.addForm.timeDays = 1
  1539. }
  1540. },
  1541. // 计算日期
  1542. datas() {
  1543. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  1544. if(this.addForm.startDate > this.addForm.endDate) {
  1545. this.addForm.endDate = this.addForm.startDate
  1546. }
  1547. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  1548. this.timeChoose = this.addForm.timeDays
  1549. this.addForm.timeHours = this.addForm.timeDays * 8
  1550. },
  1551. datasss() {
  1552. // console.log(123)
  1553. this.addForm.endDate = this.addForm.startDate
  1554. },
  1555. DateDiff(sDate1, sDate2){
  1556. var aDate, oDate1, oDate2, iDays
  1557. aDate = sDate1.split("-")
  1558. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1559. aDate = sDate2.split("-")
  1560. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1561. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  1562. return iDays + 1
  1563. },
  1564. stringToDate(dateString){
  1565. dateString = dateString.split('-');
  1566. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  1567. },
  1568. countWorkDay(date1, date2){
  1569. date1 = this.stringToDate(date1);
  1570. date2 = this.stringToDate(date2);
  1571. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  1572. var weeks = 0;
  1573. for(var i = 0; i < delta; i++){
  1574. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  1575. date1 = date1.valueOf();
  1576. date1 += 1000 * 60 * 60 * 24;
  1577. date1 = new Date(date1);
  1578. }
  1579. return delta - weeks;
  1580. },
  1581. chufas() {
  1582. this.billss()
  1583. },
  1584. // 时间
  1585. getTadeTime() {
  1586. var time = new Date();
  1587. return time.getHours() +':00:00'
  1588. },
  1589. // 日期
  1590. getCurrentTime() {
  1591. var _this = this;
  1592.   let yy = new Date().getFullYear();
  1593.   let mm = new Date().getMonth()+1;
  1594.   let dd = new Date().getDate();
  1595.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  1596.   return _this.gettime
  1597. },
  1598. getCurrentTimes() {
  1599. var _this = this;
  1600.   let yy = new Date().getFullYear();
  1601.   let mm = new Date().getMonth()+1;
  1602.   let dd = new Date().getDate();
  1603.   _this.gettime = yy+'-'+mm+'-'+'01';
  1604.   return _this.gettime
  1605. },
  1606. chanSele() {
  1607. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  1608. },
  1609. handleSizeChange(val){
  1610. this.size = val;
  1611. this.bills()
  1612. },
  1613. handleCurrentChange(val) {
  1614. // console.log(val, 1, '1')
  1615. this.page = val;
  1616. this.bills()
  1617. },
  1618. vacationSizeChange(val){
  1619. this.size = val
  1620. this.getVacationList(1)
  1621. },
  1622. vacationCurrentChange(val){
  1623. this.page = val
  1624. this.getVacationList(1)
  1625. },
  1626. statistical() {
  1627. this.loading = true
  1628. this.http.post('/leave-sheet/summaryData', {
  1629. keyword: this.keyword,
  1630. startDate: this.statData,
  1631. endDate: this.endData
  1632. },
  1633. res => {
  1634. if (res.code == "ok") {
  1635. this.statisticalList = res.data
  1636. this.loading = false
  1637. } else {
  1638. this.loading = false
  1639. this.$message({
  1640. message: res.msg,
  1641. type: "error"
  1642. });
  1643. }
  1644. },
  1645. error => {
  1646. this.$message({
  1647. message: error,
  1648. type: "error"
  1649. });
  1650. });
  1651. },
  1652. //
  1653. inputs() {
  1654. var str = this.addForm.timeDays + ''
  1655. if(str.indexOf('.') != '-1') {
  1656. var s = str.split('.')[0]
  1657. var st = str.split('.')[1]
  1658. var sts = st.split('')
  1659. this.addForm.timeDays = s + '.' + sts[0]
  1660. }
  1661. },
  1662. inputss() {
  1663. if(this.addForm.timeHours <= 0) {
  1664. this.addForm.timeHours = 1
  1665. } else if(this.addForm.timeHours > 8) {
  1666. this.addForm.timeHours = 8
  1667. } else {
  1668. if(this.addForm.timeHours.indexOf('.') != '-1') {
  1669. var str = this.addForm.timeHours
  1670. // console.log(str)
  1671. if(str.indexOf('.') != '-1') {
  1672. var s = str.split('.')[0]
  1673. var st = str.split('.')[1]
  1674. var sts = st.split('')
  1675. this.addForm.timeHours = s + '.' + sts[0]
  1676. }
  1677. }
  1678. }
  1679. // console.log(this.addForm)
  1680. },
  1681. deletes(e) {
  1682. this.$confirm("确认要删除吗?", "提示", {
  1683. //type: 'warning'
  1684. }).then(() => {
  1685. this.http.post('/leave-sheet/delete', {id:e.id},
  1686. res => {
  1687. if (res.code == "ok") {
  1688. this.bills();
  1689. this.$message({
  1690. message: '删除成功',
  1691. type: "success"
  1692. });
  1693. } else {
  1694. this.$message({
  1695. message: res.msg,
  1696. type: "error"
  1697. });
  1698. }
  1699. },
  1700. error => {
  1701. this.$message({
  1702. message: error,
  1703. type: "error"
  1704. });
  1705. });
  1706. });
  1707. },
  1708. editor(items) {
  1709. this.dialog = true
  1710. this.addForm.ownerId = items.ownerId
  1711. this.addForm.tel = items.tel
  1712. this.addForm.timeType = items.timeType + ''
  1713. this.addForm.startDate = items.startDate
  1714. this.addForm.endDate = items.endDate
  1715. this.addForm.timeDays = items.timeDays
  1716. this.addForm.timeHours = items.timeHours
  1717. this.addForm.remark = items.remark
  1718. this.affId = items.id
  1719. },
  1720. determine () {
  1721. var adl = this.addForm
  1722. adl.id = this.affId
  1723. this.http.post('/leave-sheet/add', adl,
  1724. res => {
  1725. if (res.code == "ok") {
  1726. this.dialog = false
  1727. this.bills();
  1728. this.addForm = {
  1729. timeType: '0',
  1730. startDate: this.getCurrentTime(),
  1731. endDate: this.getCurrentTime(),
  1732. timeDays: 1,
  1733. leaveType: 0,
  1734. timeHours: '8',
  1735. tel: '',
  1736. remark: ''
  1737. }
  1738. this.getUsers()
  1739. } else {
  1740. this.$message({
  1741. message: res.msg,
  1742. type: "error"
  1743. });
  1744. }
  1745. },
  1746. error => {
  1747. this.$message({
  1748. message: error,
  1749. type: "error"
  1750. });
  1751. });
  1752. },
  1753. bangd() {
  1754. this.addForm = {
  1755. timeType: '0',
  1756. startDate: this.getCurrentTime(),
  1757. endDate: this.getCurrentTime(),
  1758. timeDays: 1,
  1759. leaveType: 0,
  1760. timeHours: '8',
  1761. tel: '',
  1762. remark: ''
  1763. }
  1764. this.getUsers()
  1765. }
  1766. }
  1767. };
  1768. </script>
  1769. <style scoped>
  1770. .addNode {
  1771. cursor:pointer;
  1772. }
  1773. .addNode:hover {
  1774. color:#20a0ff;
  1775. }
  1776. .apls {
  1777. width: 200px;
  1778. white-space:nowrap;
  1779. overflow:hidden;
  1780. text-overflow:ellipsis;
  1781. }
  1782. .tups {
  1783. width: 100%;
  1784. height: 25px;
  1785. position: relative;
  1786. z-index: 99;
  1787. overflow: hidden;
  1788. }
  1789. .tups img {
  1790. height: 25px !important;
  1791. position: relative;
  1792. z-index: 99;
  1793. }
  1794. .viewer-canvas {
  1795. position: absolute;
  1796. z-index: 9 !important;
  1797. }
  1798. .icl {
  1799. margin-top: -25px !important;
  1800. }
  1801. /* 费用报销标题 */
  1802. .headine {
  1803. width: 100%;
  1804. height: 46.4px;
  1805. line-height: 46.4px;
  1806. background: #fff;
  1807. box-sizing: border-box;
  1808. }
  1809. .headine h3 {
  1810. margin: 0;
  1811. display: inline-block;
  1812. box-sizing: border-box;
  1813. color: #999;
  1814. }
  1815. .headine p {
  1816. display: inline-block;
  1817. margin: 0;
  1818. }
  1819. /* /费用报销标题 */
  1820. .sidebars {
  1821. height: 100%;
  1822. position: absolute;
  1823. border-right: 1px solid #E6E6E6;
  1824. z-index: 2;
  1825. top: 0;
  1826. }
  1827. .sidebars h3 {
  1828. margin: 0;
  1829. line-height: 45px;
  1830. background: #ffffff;
  1831. font-weight: normal;
  1832. color: #666;
  1833. padding-left: 20px;
  1834. }
  1835. .sidebars .el-col-12 {
  1836. width: 100%
  1837. }
  1838. .public {
  1839. height: 230px;
  1840. border-bottom: 1px solid #ddd;
  1841. }
  1842. .public .el-form-item {
  1843. display: inline-block;
  1844. }
  1845. .pu_button {
  1846. text-align: right;
  1847. width: 100%;
  1848. padding: 24px 30px;
  1849. box-sizing: border-box;
  1850. }
  1851. .pu_bu_x .pu_bu_t {
  1852. display: inline-block;
  1853. }
  1854. .pu_bu_x {
  1855. margin-right: 20px;
  1856. color: #20A0F7;
  1857. cursor: pointer;
  1858. }
  1859. .pu_bu_t {
  1860. color: #20A0F7;
  1861. cursor: pointer;
  1862. display: block;
  1863. float: right;
  1864. position:
  1865. relative;
  1866. top: -20px;
  1867. right: 63px;
  1868. }
  1869. .pu_table {
  1870. margin-left: 10px;
  1871. }
  1872. .pu_bu_t:hover {
  1873. color: #7bbcff;
  1874. }
  1875. .pu_bu_x:hover {
  1876. color: #7bbcff;
  1877. }
  1878. /* 我的单据报销凭证 */
  1879. .staff{
  1880. border-left: 1px solid #fff;
  1881. border-top: 1px solid #fff;
  1882. border-right: 1px solid #fff;
  1883. background: #fff;
  1884. }
  1885. /* */
  1886. .sdat{
  1887. display: inline-block;
  1888. width: 260px;
  1889. margin-left: 13px;
  1890. }
  1891. .messages .el-form-item{
  1892. display: inline-block;
  1893. }
  1894. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1895. width: 190px;
  1896. }
  1897. /* 我的报销单据 */
  1898. .search {
  1899. position: relative;
  1900. top: 20px;
  1901. left: 20px;
  1902. }
  1903. .tables {
  1904. margin-top: 50px;
  1905. box-sizing: border-box;
  1906. padding: 10px;
  1907. }
  1908. .informant .el-form-item {
  1909. display: inline-block;
  1910. }
  1911. /* 侧边栏收索 */
  1912. .side {
  1913. position: absolute;
  1914. z-index: 2;
  1915. border-right: 2px solid #DDDDDD;
  1916. height: 100%;
  1917. top: 0;
  1918. width: 0;
  1919. }
  1920. .side .spans {
  1921. width: 20px;
  1922. height: 30px;
  1923. border: 1px solid #DDDDDD;
  1924. box-sizing: border-box;
  1925. position: absolute;
  1926. top: 50%;
  1927. margin-top: -50%;
  1928. text-align: center;
  1929. z-index: 1;
  1930. background: #fff;
  1931. }
  1932. .side .spans i{
  1933. margin-top: 7px;
  1934. color: #C0BFBF
  1935. }
  1936. .side:hover {
  1937. border-right: 2px solid #20A0FF;
  1938. }
  1939. .side:hover .spans {
  1940. border: 1px solid #20A0FF;
  1941. background: #20A0FF;
  1942. }
  1943. .side:hover .spans i{
  1944. color: #fff;
  1945. }
  1946. /* 右边整体页面 */
  1947. .contents {
  1948. height: 100%;
  1949. /* padding: 30px; */
  1950. background: #F7F7F7;
  1951. /* position: absolute; */
  1952. }
  1953. .submits {
  1954. margin-left: 50%;
  1955. }
  1956. .waiting {
  1957. color:orange;
  1958. }
  1959. .rejected {
  1960. color:red;
  1961. }
  1962. /* 请假模块 */
  1963. .tops {
  1964. width: 100%;
  1965. position: relative;
  1966. background: #f7f7f7;
  1967. box-sizing: border-box;
  1968. padding: 20px 0 0 200px;
  1969. }
  1970. .ctons {
  1971. /* width: 86%; */
  1972. height: 92%;
  1973. overflow: hidden;
  1974. background: #fff;
  1975. padding: 30px 40px;
  1976. box-sizing: border-box;
  1977. }
  1978. .ctons .el-form-item {
  1979. display: inline-block;
  1980. }
  1981. .line {
  1982. text-align: center;
  1983. margin: 0 6px
  1984. }
  1985. .poss {
  1986. position: fixed;
  1987. bottom: 4px;
  1988. right: 1%;
  1989. box-sizing: border-box;
  1990. }
  1991. .flex {
  1992. display: flex;
  1993. padding: 0 0 20px 0;
  1994. border-bottom: 1px solid #f2f2f2;
  1995. }
  1996. .flex span {
  1997. color: #606266;
  1998. display: inline-block;
  1999. margin: 0 10px 0 20px;
  2000. }
  2001. </style>