list.vue 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  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="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. <el-menu-item index="1">
  19. <i class="iconfont firerock-icontianbao"></i>
  20. <span slot="title">员工请假填报</span>
  21. </el-menu-item>
  22. <el-submenu index="2" v-if="user.role != 0">
  23. <template slot="title">
  24. <i class="iconfont firerock-iconbaoxiaodan"></i>
  25. <span>{{user.role == 0?"我的请假单":"请假单列表"}}</span>
  26. </template>
  27. <el-menu-item index="2-1" ><p @click="bills(false, 2)" >全部</p></el-menu-item>
  28. <el-menu-item index="2-2" v-if="user.role != 6"><p @click="bills(true, 1)">待审核</p></el-menu-item>
  29. </el-submenu>
  30. <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="user.role == 0">
  31. <i class="iconfont firerock-iconbaoxiaodan"></i>
  32. <span slot="title">{{user.role == 0?"我的请假单":"请假单列表"}}</span>
  33. </el-menu-item>
  34. <el-menu-item index="4" v-if="user.role != 0">
  35. <template slot="title">
  36. <i class="iconfont firerock-icontianbao"></i>
  37. <span slot="title">请假统计</span>
  38. </template>
  39. </el-menu-item>
  40. <el-menu-item index="5" v-if="user.role != 0">
  41. <template slot="title">
  42. <i class="iconfont firerock-iconliucheng"></i>
  43. <span slot="title">请假审批流程</span>
  44. </template>
  45. </el-menu-item>
  46. </el-menu>
  47. </el-col>
  48. </div>
  49. <!-- 侧边栏点击事件 -->
  50. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  51. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  52. </div> -->
  53. <!-- 内容主体区域 -->
  54. <div class="contents">
  55. <div v-if="!displayTable" class="headine" ref="headine">
  56. <h3 ref="headHe" style="padding-left: 220px">请假填报</h3>
  57. <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
  58. </div>
  59. <!-- 上面部分 -->
  60. <div v-if="!displayTable && apk == false" class="tops">
  61. <!-- 公共 -->
  62. <div class="ctons">
  63. <!-- 表单 -->
  64. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  65. <!-- 请假类型 -->
  66. <el-form-item label="请假类型" prop="leaveType" style="width: 100%">
  67. <!--普通员工只能自己填报自己的 -->
  68. <el-select v-model="addForm.leaveType" @change="selts()" placeholder="请选择请假类型" style="width: 240px">
  69. <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
  70. </el-select>
  71. </el-form-item>
  72. <!-- 请假人 -->
  73. <el-form-item label="请假人" prop="ownerId" style="width: 300px">
  74. <!--普通员工只能自己填报自己的 -->
  75. <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="user.role == 0" filterable="true">
  76. <span v-for="(item, index) in users" :key="index">
  77. <el-option :label="item.name" :value="item.id"></el-option>
  78. </span>
  79. </el-select>
  80. </el-form-item>
  81. <!-- 电话 -->
  82. <el-form-item label="电话" prop="tel">
  83. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px"></el-input>
  84. </el-form-item>
  85. <!-- 单选 -->
  86. <el-form-item style="display: block" label="时长单位">
  87. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  88. <el-radio label="0">按天请假</el-radio>
  89. <el-radio label="1">按小时请假</el-radio>
  90. </el-radio-group>
  91. </el-form-item>
  92. <!-- 时间选择 -->
  93. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 100%;">
  94. <el-col style="display: inline-block; width: 240px">
  95. <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>
  96. <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>
  97. </el-col>
  98. <el-col class="line" v-if="flg" style="display: inline-block; width: 50px">-</el-col>
  99. <el-col style="display: inline-block; width: 240px">
  100. <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>
  101. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  102. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  103. </el-select> -->
  104. </el-col>
  105. </el-form-item>
  106. <!-- 请假天数 -->
  107. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  108. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  109. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  110. <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>
  111. <div v-else>
  112. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
  113. </div>
  114. </el-form-item>
  115. <!-- 备注 -->
  116. <el-form-item label="备注" style="width: 100%">
  117. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 550px" maxlength="100" show-word-limit></el-input>
  118. </el-form-item>
  119. </el-form>
  120. <div>
  121. <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- 下面部分 -->
  126. <div v-if="displayTable && apk == false" class="tops">
  127. <!-- 公共 -->
  128. <div class="ctons">
  129. <div class="flex">
  130. <div>
  131. <el-select v-model="ownerIds" placeholder="请选择请假人" clearable @change="chufas()" style="width: 180px" size="small" :disabled="user.role == 0" filterable="true">
  132. <span v-for="(item, index) in users" :key="index">
  133. <el-option :label="item.name" :value="item.id"></el-option>
  134. </span>
  135. </el-select>
  136. </div>
  137. <div>
  138. <span style="color: #606266">请假类型</span>
  139. <el-select v-model="type" placeholder="请选择请假类型" clearable @change="chufas()" style="width: 180px;" size="small" filterable="true">
  140. <span v-for="(item, index) in typess" :key="index">
  141. <el-option :label="item.name" :value="item.id"></el-option>
  142. </span>
  143. </el-select>
  144. </div>
  145. <div>
  146. <span style="color: #606266">请假状态</span>
  147. <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" clearable @change="chufas()" size="small" style="width: 180px" filterable="true">
  148. <span v-for="(item, index) in statuss" :key="index">
  149. <el-option :label="item.name" :value="item.id"></el-option>
  150. </span>
  151. </el-select>
  152. <el-select v-if="falg == 1" disabled v-model="code" placeholder="请选择请假类型" clearable @change="chufas()" size="small" style="width: 180px" filterable="true">
  153. <span v-for="(item, index) in statuss" :key="index">
  154. <el-option :label="item.name" :value="item.id"></el-option>
  155. </span>
  156. </el-select>
  157. </div>
  158. <div>
  159. <span style="color: #606266">请假时间</span>
  160. <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker>
  161. </div>
  162. </div>
  163. <el-table v-loading="loading" :data="tableData" style="width: 100%" height="90%">
  164. <el-table-column prop="ownerName" label="请假人" width="120"></el-table-column>
  165. <el-table-column prop="tel" label="电话" width="120"></el-table-column>
  166. <el-table-column prop="leaveType" label="请假类型" width="120">
  167. <template slot-scope="scope">
  168. <!-- <div v-if="scope.row.leaveType == 0">事假</div>
  169. <div v-if="scope.row.leaveType == 1">病假</div>
  170. <div v-if="scope.row.leaveType == 2">年假</div>
  171. <div v-if="scope.row.leaveType == 3">产假</div> -->
  172. {{qjType[scope.row.leaveType].name}}
  173. </template>
  174. </el-table-column>
  175. <el-table-column prop="startDate" label="请假开始时间" width="150"></el-table-column>
  176. <el-table-column prop="endDate" label="请假结束时间" width="150"></el-table-column>
  177. <el-table-column label="请假天数" width="120">
  178. <template slot-scope="scope">
  179. <div v-if="scope.row.timeType == '1'">/</div>
  180. <div v-else>{{scope.row.timeDays}}天</div>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="请假时长" width="120">
  184. <template slot-scope="scope">
  185. <div>{{scope.row.timeHours}}小时</div>
  186. </template>
  187. </el-table-column>
  188. <el-table-column prop="status" label="状态" width="100">
  189. <template slot-scope="scope">
  190. <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
  191. <div v-if="scope.row.status == 0" >审核通过</div>
  192. <div v-if="scope.row.status == 1" style="color: orange">待审核</div>
  193. <div v-if="scope.row.status == 2" style="color: red">驳回</div>
  194. <div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
  195. </div>
  196. <div v-else>
  197. <span>暂无请假单</span>
  198. </div>
  199. </template>
  200. </el-table-column>
  201. <el-table-column prop="remark" label="备注" width="200">
  202. <template slot-scope="scope">
  203. <!-- <div class="apls">{{scope.row.remark}}</div> -->
  204. <el-popover placement="top-start" title="标题" width="200" trigger="hover" :content="scope.row.remark">
  205. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  206. </el-popover>
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="操作" width="180" fixed="right" v-if="isAuditList">
  210. <template slot-scope="scope">
  211. <div v-if="user.role != 0">
  212. <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
  213. <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
  214. </div>
  215. <div v-else>
  216. <el-button type="danger" size="mini">撤销</el-button>
  217. </div>
  218. </template>
  219. </el-table-column>
  220. <el-table-column label="操作" width="180" fixed="right" v-if="!isAuditList && user.role != 6">
  221. <template slot-scope="scope">
  222. <div v-if="user.role == 0 ">
  223. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)" v-if="scope.row.status != 0"></el-button>
  224. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)" v-if="scope.row.status != 0"></el-button>
  225. </div>
  226. <div v-if="user.role != 0 ">
  227. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)"></el-button>
  228. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
  229. </div>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. <div class="poss">
  234. <el-pagination
  235. @size-change="handleSizeChange"
  236. @current-change="handleCurrentChange"
  237. :current-page="currentPage4"
  238. :page-sizes="[20, 50, 100, 200]"
  239. :page-size="20"
  240. layout="total, sizes, prev, pager, next"
  241. :total="total">
  242. </el-pagination>
  243. </div>
  244. </div>
  245. </div>
  246. <!-- 统计部分 -->
  247. <div v-if="displayTable && apk && apk2 == false" class="tops">
  248. <!-- 公共 -->
  249. <div class="ctons">
  250. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  251. <div style="display: inline-block;width: 350px">
  252. <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  253. <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
  254. </el-input>
  255. </div>
  256. <div style="display: inline-block;width: 340px">
  257. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">开始日期</span>
  258. <el-date-picker
  259. v-model="statData"
  260. type="date"
  261. placeholder="选择日期"
  262. size="small"
  263. @change="statistical()"
  264. clearable="false"
  265. value-format="yyyy-MM-dd"
  266. :picker-options="pickerOptionsStarts">
  267. </el-date-picker>
  268. </div>
  269. <div style="display: inline-block;width: 350px">
  270. <span style="display: inline-block;margin: 0 15px 0 0;color: rgb(96, 98, 102);">结束日期</span>
  271. <el-date-picker
  272. v-model="endData"
  273. type="date"
  274. placeholder="选择日期"
  275. size="small"
  276. @change="statistical()"
  277. clearable="fasle"
  278. value-format="yyyy-MM-dd"
  279. :picker-options="pickerOptionsEnds">
  280. </el-date-picker>
  281. </div>
  282. </div>
  283. <!-- <div style="margin-top: 30px"> -->
  284. <div>
  285. <el-table v-loading="loading" :data="statisticalList" height="780px" style="width: 100%">
  286. <el-table-column prop="ownerName" label="姓名" width="300">
  287. <template slot-scope="scope">
  288. <div v-if="scope.row.ownerName">
  289. {{scope.row.ownerName}}
  290. </div>
  291. <div v-else>
  292. <span>暂无请假统计</span>
  293. </div>
  294. </template>
  295. </el-table-column>
  296. <el-table-column prop="timeDays" label="请假总天数" width="300">
  297. <template slot-scope="scope">
  298. {{scope.row.timeDays}}/天
  299. </template>
  300. </el-table-column>
  301. <el-table-column prop="timeHours" label="请假总时长">
  302. <template slot-scope="scope">
  303. {{scope.row.timeHours}}/小时
  304. </template>
  305. </el-table-column>
  306. </el-table>
  307. </div>
  308. </div>
  309. </div>
  310. <div v-if="displayTable && apk && apk2" class="tops">
  311. <div class="ctons">
  312. <el-col :span="6" >
  313. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
  314. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  315. <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
  316. </div>
  317. </el-scrollbar>
  318. </el-col>
  319. <el-col :span="18" >
  320. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
  321. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  322. <div style="padding:5px;color:#333;" v-if="depData != null">设置 &lt;<span style="color:#20a0ff;">{{depData.label}}&gt;</span> 直属人员请假审批流程
  323. <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
  324. <i class="el-icon-question"></i>
  325. </el-tooltip>
  326. </div>
  327. <div style="padding:5px;" v-if="depData == null">请选择部门</div>
  328. <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
  329. <span>员工填报</span>
  330. <icon class="iconfont firerock-iconright"></icon>
  331. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
  332. <icon class="iconfont firerock-iconright"></icon>
  333. <span v-for="(item, index) in dataArray" :key="item.seq" >
  334. <el-button type="primary" v-if="item.auditorType == 1" @click="editNodeDialog(index, item)">{{item.auditDeptName}}</el-button>
  335. <el-button type="primary" v-if="item.auditorType == 0" >项目负责人</el-button>
  336. <el-button type="primary" v-if="item.auditorType == 2" @click="editNodeDialog(index, item)">{{item.userName}}</el-button>
  337. <icon class="iconfont firerock-iconright"></icon>
  338. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
  339. <icon class="iconfont firerock-iconright"></icon>
  340. </span>
  341. <!--结束点 -->
  342. <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
  343. 审批完成
  344. </div>
  345. <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
  346. <el-button type="primary" @click="submitInsert" :loading="addLoading">保存</el-button>
  347. </div>
  348. </div>
  349. </el-scrollbar>
  350. </el-col>
  351. </div>
  352. <!--部门选择列表 -->
  353. <el-dialog title="请选择审批人" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
  354. <el-form label-width="140px">
  355. <el-form-item label="选择部门/指定人员" >
  356. <el-cascader filterable ref="deptCascader" v-model="curDeptId" placeholder="请选择部门/指定人员" style="width: 100%" @change="chooseDept"
  357. :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  358. </el-form-item>
  359. </el-form>
  360. <div slot="footer" class="dialog-footer">
  361. <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">删除</el-button>
  362. <el-button type="primary" @click="addNode" >确定</el-button>
  363. </div>
  364. </el-dialog>
  365. </div>
  366. </div>
  367. <!-- 请假单详情 -->
  368. <el-dialog title="请假单详情" :visible.sync="dialog" width="1000px" @close="bangd()">
  369. <!-- 表单 -->
  370. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  371. <!-- 请假人 -->
  372. <el-form-item label="请假人" prop="ownerId" style="width: 300px;display: inline-block;">
  373. <!--普通员工只能自己填报自己的 -->
  374. <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="user.role == 0" filterable="true">
  375. <span v-for="(item, index) in users" :key="index">
  376. <el-option :label="item.name" :value="item.id"></el-option>
  377. </span>
  378. </el-select>
  379. </el-form-item>
  380. <!-- 电话 -->
  381. <el-form-item label="电话" prop="tel" style="width: 300px;display: inline-block;">
  382. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px;"></el-input>
  383. </el-form-item>
  384. <!-- 单选 -->
  385. <el-form-item style="display: block" label="时长单位">
  386. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  387. <el-radio label="0">按天请假</el-radio>
  388. <el-radio label="1">按小时请假</el-radio>
  389. </el-radio-group>
  390. </el-form-item>
  391. <!-- 时间选择 -->
  392. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 74%;margin-right:500px">
  393. <el-col :span="9">
  394. <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>
  395. <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>
  396. </el-col>
  397. <el-col class="line" v-if="flg" :span="2">-</el-col>
  398. <el-col :span="9">
  399. <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>
  400. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  401. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  402. </el-select> -->
  403. </el-col>
  404. </el-form-item>
  405. <!-- 请假天数 -->
  406. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  407. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  408. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  409. <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>
  410. <div v-else>
  411. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
  412. </div>
  413. </el-form-item>
  414. <!-- 备注 -->
  415. <el-form-item label="备注" style="width: 100%">
  416. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 62%" maxlength="100" show-word-limit></el-input>
  417. </el-form-item>
  418. </el-form>
  419. <span slot="footer" class="dialog-footer">
  420. <el-button @click="dialog = false">取 消</el-button>
  421. <el-button type="primary" @click="determine()">确 定</el-button>
  422. </span>
  423. </el-dialog>
  424. </section>
  425. </template>
  426. <script>
  427. import { config } from 'dingtalk-jsapi';
  428. export default {
  429. name: "expense",
  430. components: {},
  431. props: {},
  432. data() {
  433. //验证手机号
  434. var checkTel = (rule, value, callback) =>{
  435. if (!value) {
  436. return callback(new Error('手机号不能为空'));
  437. } else {
  438. const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
  439. if (reg.test(value)) {
  440. callback();
  441. } else {
  442. return callback(new Error('请输入正确的手机号'));
  443. }
  444. }
  445. };
  446. var checks = (rule, value, callback) => {
  447. if (!value) {
  448. return callback(new Error('请假天数不能为空'));
  449. } else {
  450. if (value > this.timeChoose) {
  451. return callback(new Error('超过当前选择日期的天数'));
  452. } else {
  453. callback();
  454. }
  455. }
  456. };
  457. return {
  458. addFormRules: {
  459. ownerId: [{ required: true, message: "请选择请假人", trigger: "blur" }],
  460. tel: [{required: true, validator: checkTel, trigger: 'blur'}],
  461. timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  462. leaveType: [{ required: true, message: "请选择请假类型", trigger: "blur" }]
  463. },
  464. user: JSON.parse(sessionStorage.getItem("user")),
  465. shuz: ['事假填报', '病假填报', '年假填报', '产假填报'],
  466. ins: 0,
  467. addForm: {
  468. timeType: '0',
  469. startDate: this.getCurrentTime(),
  470. endDate: this.getCurrentTime(),
  471. timeDays: 1,
  472. leaveType: 0,
  473. ownerId: '',
  474. // indate: this.getCurrentTime(),
  475. timeHours: 8,
  476. tel: '',
  477. remark: ''
  478. },
  479. displayTable: false,
  480. users: [], // 人员信息
  481. flg: true,
  482. createDate: '2020-01-01',
  483. // pickerOptionsStart: {
  484. // disabledDate: (time) => {
  485. // if (this.addForm.endDate) {
  486. // return time.getTime() > new Date(this.addForm.endDate).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  487. // }
  488. // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  489. // },
  490. // },
  491. pickerOptionsEnd: {
  492. disabledDate: (time) => {
  493. if (this.addForm.startDate) {
  494. return time.getTime() < new Date(this.addForm.startDate).getTime() - 86400000;
  495. }
  496. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  497. },
  498. },
  499. // pickerOptionsStarts: {
  500. // disabledDate: (time) => {
  501. // if (this.endData) {
  502. // return time.getTime() > new Date(this.endData).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  503. // }
  504. // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  505. // },
  506. // },
  507. pickerOptionsEnds: {
  508. disabledDate: (time) => {
  509. if (this.statData) {
  510. return time.getTime() < new Date(this.statData).getTime() - 86400000;
  511. }
  512. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  513. },
  514. },
  515. options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
  516. tableData: [],
  517. page: 1,
  518. size: 20,
  519. isAuditList: '',
  520. total:0,
  521. apk: false,
  522. keyword: '',
  523. statData: this.getCurrentTimes(),
  524. endData: this.getCurrentTime(),
  525. statisticalList: [],
  526. loading: false,
  527. timeChoose: 1,
  528. // typess: [{
  529. // name: '事假',
  530. // id: 0
  531. // },{
  532. // name: '病假',
  533. // id: 1
  534. // },{
  535. // name: '年假',
  536. // id: 2
  537. // },{
  538. // name: '产假',
  539. // id: 3
  540. // }],
  541. 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}],
  542. statuss: [{
  543. name: '审核通过',
  544. id: 0
  545. },{
  546. name: '待审核',
  547. id: 1
  548. },{
  549. name: '驳回',
  550. id: 2
  551. },{
  552. name: '已撤销',
  553. id: 3
  554. }],
  555. createDatelis: '',
  556. ownerIds: '',
  557. type: '',
  558. code: '',
  559. createDate: '',
  560. falg: 0,
  561. dialog: false,
  562. adform: {},
  563. affId: '',
  564. qjType: [{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}],
  565. //
  566. apk2: false,
  567. sdata:[],
  568. dataArray:[],
  569. sdefaultProps: {
  570. children: 'children',
  571. label: 'label'
  572. },
  573. depData: null,
  574. isAdd : false,
  575. sindex : 0,
  576. curDeptId : null,
  577. curUserId : null,
  578. dialogVisible: false,
  579. soption : null,
  580. susers: []
  581. //
  582. };
  583. },
  584. computed: {},
  585. watch: {},
  586. created() {
  587. let height = window.innerHeight;
  588. this.tableHeight = height - 195;
  589. const that = this;
  590. window.onresize = function temp() {
  591. that.tableHeight = window.innerHeight - 195;
  592. };
  593. },
  594. mounted() {
  595. this.getUsers() // 获取人员信息
  596. this.getDepartment();
  597. },
  598. filters: {},
  599. methods: {
  600. handleNodeClick(data) {
  601. if(this.depData == null || data.id != this.depData.id) {
  602. this.depData = data;
  603. console.log("depdata",this.depData);
  604. this.getSettings();
  605. }
  606. },
  607. getSettings() {
  608. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id},
  609. res => {
  610. this.listLoading = false;
  611. if (res.code == "ok") {
  612. this.dataArray = res.data;
  613. console.log("请求1",res.data);
  614. } else {
  615. this.$message({
  616. message: res.msg,
  617. type: "error"
  618. });
  619. }
  620. },
  621. error => {
  622. this.listLoading = false;
  623. this.$message({
  624. message: error,
  625. type: "error"
  626. });
  627. }
  628. );
  629. },
  630. // 获取部门列表
  631. getDepartment() {
  632. this.http.post( this.port.manage.depList, {},
  633. res => {
  634. if (res.code == "ok") {
  635. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  636. this.sdata = list;
  637. this.soption = [
  638. {value: 1 , label : "部门" , children : this.changeArr(list1)},
  639. {value: 2 , label : "指定人员",children : this.susers}
  640. ]
  641. console.log("列表",this.soption);
  642. } else {
  643. this.$message({
  644. message: res.msg,
  645. type: "error"
  646. });
  647. }
  648. },
  649. error => {
  650. this.$message({
  651. message: error,
  652. type: "error"
  653. });
  654. });
  655. },
  656. changeArr(arr) {
  657. for (var i = 0; i < arr.length; i++) {
  658. if(arr[i].id != -1 && arr[i].id != 0) {
  659. if (arr[i].children != null && arr[i].children.length>0) {
  660. arr[i].children = this.changeArr(arr[i].children);
  661. }
  662. arr[i].id && (arr[i].value = arr[i].id);
  663. delete arr[i].id;
  664. }
  665. }
  666. for(var i in arr) {
  667. if(arr[i].id == -1 || arr[i].id == 0) {
  668. arr.splice(i,1)
  669. }
  670. }
  671. return arr;
  672. },
  673. showNodeDialog(index) {
  674. this.isAdd = true;
  675. this.sindex = index;
  676. this.curDeptId = null;
  677. this.curUserId = null;
  678. this.dialogVisible = true;
  679. },
  680. editNodeDialog(index, item) {
  681. //检查是否可编辑
  682. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id},
  683. res => {
  684. this.listLoading = false;
  685. if (res.code == "ok") {
  686. this.isAdd = false;
  687. this.sindex = index;
  688. this.curUserId = item.userId;
  689. this.dialogVisible = true;
  690. this.curDeptId = item.auditDeptId;
  691. } else {
  692. this.$message({
  693. message: res.msg,
  694. type: "error"
  695. });
  696. }
  697. },
  698. error => {
  699. this.listLoading = false;
  700. this.$message({
  701. message: error,
  702. type: "error"
  703. });
  704. }
  705. );
  706. },
  707. addNode() {
  708. this.dialogVisible = false;
  709. if (this.curDeptId == null) return;
  710. var node = this.$refs.deptCascader.getCheckedNodes()[0];
  711. console.log("node",node);
  712. if (this.isAdd) {
  713. if(node.path[0] == 1){
  714. var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  715. }else if(node.path[0] == 2){
  716. var node = {userId: node.value, userName: node.label, auditorType: 2};
  717. }
  718. this.dataArray.splice(this.sindex, 0, node);
  719. } else {
  720. //编辑
  721. this.dataArray[this.sindex].auditDeptId = node.value;
  722. this.dataArray[this.sindex].auditDeptName = node.label;
  723. }
  724. },
  725. deleteNode() {
  726. this.dialogVisible = false;
  727. this.dataArray.splice(this.sindex, 1);
  728. },
  729. submitInsert() {
  730. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id},
  731. res => {
  732. this.listLoading = false;
  733. if (res.code == "ok") {
  734. this.$message({
  735. message: '保存成功',
  736. type: "success"
  737. });
  738. } else {
  739. this.$message({
  740. message: res.msg,
  741. type: "error"
  742. });
  743. }
  744. },
  745. error => {
  746. this.listLoading = false;
  747. this.$message({
  748. message: error,
  749. type: "error"
  750. });
  751. }
  752. );
  753. },
  754. //
  755. approve(item) {
  756. //审核通过
  757. this.http.post('/leave-sheet/approve', {id:item.id
  758. },
  759. res => {
  760. if (res.code == "ok") {
  761. this.bills(true);
  762. } else {
  763. this.$message({
  764. message: res.msg,
  765. type: "error"
  766. });
  767. }
  768. },
  769. error => {
  770. this.$message({
  771. message: error,
  772. type: "error"
  773. });
  774. });
  775. },
  776. deny(item) {
  777. //审核驳回
  778. this.http.post('/leave-sheet/deny', {id:item.id
  779. },
  780. res => {
  781. if (res.code == "ok") {
  782. this.bills(true);
  783. } else {
  784. this.$message({
  785. message: res.msg,
  786. type: "error"
  787. });
  788. }
  789. },
  790. error => {
  791. this.$message({
  792. message: error,
  793. type: "error"
  794. });
  795. });
  796. },
  797. getUsers() {
  798. this.http.post(this.port.manage.list, {
  799. departmentId: -1,
  800. pageIndex: 1,
  801. pageSize: 99999
  802. },
  803. res => {
  804. if (res.code == "ok") {
  805. this.users = res.data.records;
  806. for (let i = 0; i < this.users.length; i++) {
  807. this.susers.push({value:this.users[i].id,label:this.users[i].name})
  808. }
  809. if (this.user.role == 0) {
  810. this.addForm.ownerId = this.user.id;
  811. this.ownerIds = this.user.id
  812. this.addForm.status = 1;
  813. this.addForm.tel = this.user.phone
  814. }
  815. } else {
  816. this.$message({
  817. message: res.msg,
  818. type: "error"
  819. });
  820. }
  821. },
  822. error => {
  823. this.$message({
  824. message: error,
  825. type: "error"
  826. });
  827. });
  828. },
  829. // 员工请假填报点击事件
  830. ssl(index) {
  831. this.ins = index;
  832. this.addForm.leaveType = index
  833. },
  834. staffs(key, keyPath) {
  835. console.log("keypath",keyPath)
  836. if (keyPath[0] == '1') {
  837. this.displayTable = false;
  838. this.apk = false
  839. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  840. this.displayTable = true;
  841. this.apk = false
  842. } else if(keyPath[0] == '4'){
  843. this.displayTable = true;
  844. this.apk = true
  845. this.apk2 = false
  846. this.statistical()
  847. } else {
  848. this.displayTable = true;
  849. this.apk2 = true
  850. this.apk = true
  851. this.statistical()
  852. }
  853. },
  854. bills(audit, tr){
  855. if(tr) {
  856. this.code = ''
  857. this.createDate = ''
  858. // this.ownerIds = ''
  859. this.type = ''
  860. if(tr == 1) {
  861. this.falg = 1
  862. this.code = 1
  863. } else if(tr == 2) {
  864. this.code = ''
  865. this.falg = 0
  866. } else {
  867. this.falg = 0
  868. }
  869. } else {
  870. this.falg = false
  871. }
  872. this.tableData = []
  873. this.displayTable = true;
  874. this.isAuditList = audit;
  875. this.loading = true
  876. var param = {pageIndex: this.page,
  877. pageSize: this.size,
  878. status: this.code,
  879. createDate: this.createDate,
  880. ownerId: this.ownerIds,
  881. leaveType: this.type,
  882. };
  883. if (this.isAuditList) {
  884. param.status = 1;
  885. }
  886. this.list = [];
  887. // this.total = 0;
  888. this.http.post('/leave-sheet/list', param,
  889. res => {
  890. if (res.code == "ok") {
  891. this.tableData = res.data.records
  892. this.total = res.data.total
  893. this.loading = false
  894. } else {
  895. this.loading = false
  896. this.$message({
  897. message: res.msg,
  898. type: "error"
  899. });
  900. }
  901. },
  902. error => {
  903. this.loading = false
  904. this.$message({
  905. message: error,
  906. type: "error"
  907. });
  908. });
  909. },
  910. billss() {
  911. var param = {pageIndex: this.page,
  912. pageSize: this.size,
  913. status: this.code,
  914. startDate: this.createDate,
  915. ownerId: this.ownerIds,
  916. leaveType: this.type,
  917. };
  918. this.http.post('/leave-sheet/list', param,
  919. res => {
  920. if (res.code == "ok") {
  921. this.tableData = res.data.records
  922. this.total = res.data.total
  923. this.loading = false
  924. } else {
  925. this.loading = false
  926. this.$message({
  927. message: res.msg,
  928. type: "error"
  929. });
  930. }
  931. },
  932. error => {
  933. this.loading = false
  934. this.$message({
  935. message: error,
  936. type: "error"
  937. });
  938. });
  939. },
  940. // 判断日期是否补零了
  941. buling(das) {
  942. var rqi = das.split('-')
  943. rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
  944. rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
  945. var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
  946. return zong
  947. },
  948. submits(){
  949. console.log(this.addForm)
  950. // return
  951. this.$refs.addForm.validate(valid => {
  952. this.addForm.endDate = this.buling(this.addForm.endDate)
  953. this.addForm.startDate = this.buling(this.addForm.startDate)
  954. if (valid) {
  955. this.http.post('/leave-sheet/add', this.addForm,
  956. res => {
  957. if (res.code == "ok") {
  958. this.$message({
  959. message: '填报成功',
  960. type: "success"
  961. });
  962. this.addForm.timeType = '0'
  963. this.addForm.startDate = this.getCurrentTime()
  964. this.addForm.endDate = this.getCurrentTime()
  965. this.addForm.timeDays = 1
  966. this.addForm.leaveType = 0
  967. this.addForm.timeHours = 8
  968. this.addForm.remark = ''
  969. this.flg = true
  970. } else {
  971. this.$message({
  972. message: res.msg,
  973. type: "error"
  974. });
  975. }
  976. },
  977. error => {
  978. this.$message({
  979. message: error,
  980. type: "error"
  981. });
  982. });
  983. } else {
  984. return false;
  985. }
  986. });
  987. },
  988. selts() {
  989. for(var i in this.users) {
  990. if(this.users[i].id == this.addForm.ownerId) {
  991. this.addForm.tel = this.users[i].phone
  992. }
  993. }
  994. },
  995. chanRadio() {
  996. console.log(this.addForm.timeType)
  997. if(this.addForm.timeType == '0') {
  998. this.flg = true
  999. this.addForm.startDate = this.getCurrentTime()
  1000. this.addForm.endDate = this.getCurrentTime()
  1001. this.addForm.timeType = '0'
  1002. this.addForm.timeDays = '1'
  1003. this.addForm.timeHours = '8'
  1004. } else {
  1005. this.flg = false
  1006. this.addForm.startDate = this.getCurrentTime()
  1007. this.addForm.endDate = this.getCurrentTime()
  1008. this.addForm.timeType = '1'
  1009. this.addForm.timeHours = 1,
  1010. this.addForm.timeDays = 1
  1011. }
  1012. },
  1013. // 计算日期
  1014. datas() {
  1015. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  1016. if(this.addForm.startDate > this.addForm.endDate) {
  1017. this.addForm.endDate = this.addForm.startDate
  1018. }
  1019. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  1020. this.timeChoose = this.addForm.timeDays
  1021. this.addForm.timeHours = this.addForm.timeDays * 8
  1022. },
  1023. datasss() {
  1024. console.log(123)
  1025. this.addForm.endDate = this.addForm.startDate
  1026. },
  1027. DateDiff(sDate1, sDate2){
  1028. var aDate, oDate1, oDate2, iDays
  1029. aDate = sDate1.split("-")
  1030. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1031. aDate = sDate2.split("-")
  1032. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1033. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  1034. return iDays + 1
  1035. },
  1036. stringToDate(dateString){
  1037. dateString = dateString.split('-');
  1038. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  1039. },
  1040. countWorkDay(date1, date2){
  1041. date1 = this.stringToDate(date1);
  1042. date2 = this.stringToDate(date2);
  1043. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  1044. var weeks = 0;
  1045. for(var i = 0; i < delta; i++){
  1046. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  1047. date1 = date1.valueOf();
  1048. date1 += 1000 * 60 * 60 * 24;
  1049. date1 = new Date(date1);
  1050. }
  1051. return delta - weeks;
  1052. },
  1053. chufas() {
  1054. this.billss()
  1055. },
  1056. // 时间
  1057. getTadeTime() {
  1058. var time = new Date();
  1059. return time.getHours() +':00:00'
  1060. },
  1061. // 日期
  1062. getCurrentTime() {
  1063. var _this = this;
  1064.   let yy = new Date().getFullYear();
  1065.   let mm = new Date().getMonth()+1;
  1066.   let dd = new Date().getDate();
  1067.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  1068.   return _this.gettime
  1069. },
  1070. getCurrentTimes() {
  1071. var _this = this;
  1072.   let yy = new Date().getFullYear();
  1073.   let mm = new Date().getMonth()+1;
  1074.   let dd = new Date().getDate();
  1075.   _this.gettime = yy+'-'+mm+'-'+'01';
  1076.   return _this.gettime
  1077. },
  1078. chanSele() {
  1079. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  1080. },
  1081. handleSizeChange(val){
  1082. this.size = val;
  1083. this.bills()
  1084. },
  1085. handleCurrentChange(val) {
  1086. console.log(val, 1, '1')
  1087. this.page = val;
  1088. this.bills()
  1089. },
  1090. statistical() {
  1091. this.loading = true
  1092. this.http.post('/leave-sheet/summaryData', {
  1093. keyword: this.keyword,
  1094. startDate: this.statData,
  1095. endDate: this.endData
  1096. },
  1097. res => {
  1098. if (res.code == "ok") {
  1099. this.statisticalList = res.data
  1100. this.loading = false
  1101. } else {
  1102. this.loading = false
  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. //
  1117. inputs() {
  1118. var str = this.addForm.timeDays + ''
  1119. if(str.indexOf('.') != '-1') {
  1120. var s = str.split('.')[0]
  1121. var st = str.split('.')[1]
  1122. var sts = st.split('')
  1123. this.addForm.timeDays = s + '.' + sts[0]
  1124. }
  1125. },
  1126. inputss() {
  1127. if(this.addForm.timeHours <= 0) {
  1128. this.addForm.timeHours = 1
  1129. } else if(this.addForm.timeHours > 8) {
  1130. this.addForm.timeHours = 8
  1131. } else {
  1132. if(this.addForm.timeHours.indexOf('.') != '-1') {
  1133. var str = this.addForm.timeHours
  1134. console.log(str)
  1135. if(str.indexOf('.') != '-1') {
  1136. var s = str.split('.')[0]
  1137. var st = str.split('.')[1]
  1138. var sts = st.split('')
  1139. this.addForm.timeHours = s + '.' + sts[0]
  1140. }
  1141. }
  1142. }
  1143. console.log(this.addForm)
  1144. },
  1145. deletes(e) {
  1146. this.$confirm("确认要删除吗?", "提示", {
  1147. //type: 'warning'
  1148. }).then(() => {
  1149. this.http.post('/leave-sheet/delete', {id:e.id},
  1150. res => {
  1151. if (res.code == "ok") {
  1152. this.bills();
  1153. this.$message({
  1154. message: '删除成功',
  1155. type: "success"
  1156. });
  1157. } else {
  1158. this.$message({
  1159. message: res.msg,
  1160. type: "error"
  1161. });
  1162. }
  1163. },
  1164. error => {
  1165. this.$message({
  1166. message: error,
  1167. type: "error"
  1168. });
  1169. });
  1170. });
  1171. },
  1172. editor(items) {
  1173. this.dialog = true
  1174. this.addForm.ownerId = items.ownerId
  1175. this.addForm.tel = items.tel
  1176. this.addForm.timeType = items.timeType + ''
  1177. this.addForm.startDate = items.startDate
  1178. this.addForm.endDate = items.endDate
  1179. this.addForm.timeDays = items.timeDays
  1180. this.addForm.timeHours = items.timeHours
  1181. this.addForm.remark = items.remark
  1182. this.affId = items.id
  1183. },
  1184. determine () {
  1185. var adl = this.addForm
  1186. adl.id = this.affId
  1187. this.http.post('/leave-sheet/add', adl,
  1188. res => {
  1189. if (res.code == "ok") {
  1190. this.dialog = false
  1191. this.bills();
  1192. this.addForm = {
  1193. timeType: '0',
  1194. startDate: this.getCurrentTime(),
  1195. endDate: this.getCurrentTime(),
  1196. timeDays: 1,
  1197. leaveType: 0,
  1198. timeHours: '8',
  1199. tel: '',
  1200. remark: ''
  1201. }
  1202. this.getUsers()
  1203. } else {
  1204. this.$message({
  1205. message: res.msg,
  1206. type: "error"
  1207. });
  1208. }
  1209. },
  1210. error => {
  1211. this.$message({
  1212. message: error,
  1213. type: "error"
  1214. });
  1215. });
  1216. },
  1217. bangd() {
  1218. this.addForm = {
  1219. timeType: '0',
  1220. startDate: this.getCurrentTime(),
  1221. endDate: this.getCurrentTime(),
  1222. timeDays: 1,
  1223. leaveType: 0,
  1224. timeHours: '8',
  1225. tel: '',
  1226. remark: ''
  1227. }
  1228. this.getUsers()
  1229. }
  1230. }
  1231. };
  1232. </script>
  1233. <style scoped>
  1234. .addNode {
  1235. cursor:pointer;
  1236. }
  1237. .addNode:hover {
  1238. color:#20a0ff;
  1239. }
  1240. .apls {
  1241. width: 200px;
  1242. white-space:nowrap;
  1243. overflow:hidden;
  1244. text-overflow:ellipsis;
  1245. }
  1246. .tups {
  1247. width: 100%;
  1248. height: 25px;
  1249. position: relative;
  1250. z-index: 99;
  1251. overflow: hidden;
  1252. }
  1253. .tups img {
  1254. height: 25px !important;
  1255. position: relative;
  1256. z-index: 99;
  1257. }
  1258. .viewer-canvas {
  1259. position: absolute;
  1260. z-index: 9 !important;
  1261. }
  1262. .icl {
  1263. margin-top: -25px !important;
  1264. }
  1265. /* 费用报销标题 */
  1266. .headine {
  1267. width: 100%;
  1268. height: 46.4px;
  1269. line-height: 46.4px;
  1270. background: #fff;
  1271. box-sizing: border-box;
  1272. }
  1273. .headine h3 {
  1274. margin: 0;
  1275. display: inline-block;
  1276. box-sizing: border-box;
  1277. color: #999;
  1278. }
  1279. .headine p {
  1280. display: inline-block;
  1281. margin: 0;
  1282. }
  1283. /* /费用报销标题 */
  1284. .sidebars {
  1285. height: 100%;
  1286. position: absolute;
  1287. border-right: 1px solid #E6E6E6;
  1288. z-index: 2;
  1289. top: 0;
  1290. }
  1291. .sidebars h3 {
  1292. margin: 0;
  1293. line-height: 45px;
  1294. background: #ffffff;
  1295. font-weight: normal;
  1296. color: #666;
  1297. padding-left: 20px;
  1298. }
  1299. .sidebars .el-col-12 {
  1300. width: 100%
  1301. }
  1302. .public {
  1303. height: 230px;
  1304. border-bottom: 1px solid #ddd;
  1305. }
  1306. .public .el-form-item {
  1307. display: inline-block;
  1308. }
  1309. .pu_button {
  1310. text-align: right;
  1311. width: 100%;
  1312. padding: 24px 30px;
  1313. box-sizing: border-box;
  1314. }
  1315. .pu_bu_x .pu_bu_t {
  1316. display: inline-block;
  1317. }
  1318. .pu_bu_x {
  1319. margin-right: 20px;
  1320. color: #20A0F7;
  1321. cursor: pointer;
  1322. }
  1323. .pu_bu_t {
  1324. color: #20A0F7;
  1325. cursor: pointer;
  1326. display: block;
  1327. float: right;
  1328. position:
  1329. relative;
  1330. top: -20px;
  1331. right: 63px;
  1332. }
  1333. .pu_table {
  1334. margin-left: 10px;
  1335. }
  1336. .pu_bu_t:hover {
  1337. color: #7bbcff;
  1338. }
  1339. .pu_bu_x:hover {
  1340. color: #7bbcff;
  1341. }
  1342. /* 我的单据报销凭证 */
  1343. .staff{
  1344. border-left: 1px solid #fff;
  1345. border-top: 1px solid #fff;
  1346. border-right: 1px solid #fff;
  1347. background: #fff;
  1348. }
  1349. /* */
  1350. .sdat{
  1351. display: inline-block;
  1352. width: 260px;
  1353. margin-left: 13px;
  1354. }
  1355. .messages .el-form-item{
  1356. display: inline-block;
  1357. }
  1358. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1359. width: 190px;
  1360. }
  1361. /* 我的报销单据 */
  1362. .search {
  1363. position: relative;
  1364. top: 20px;
  1365. left: 20px;
  1366. }
  1367. .tables {
  1368. margin-top: 50px;
  1369. box-sizing: border-box;
  1370. padding: 10px;
  1371. }
  1372. .informant .el-form-item {
  1373. display: inline-block;
  1374. }
  1375. /* 侧边栏收索 */
  1376. .side {
  1377. position: absolute;
  1378. z-index: 2;
  1379. border-right: 2px solid #DDDDDD;
  1380. height: 100%;
  1381. top: 0;
  1382. width: 0;
  1383. }
  1384. .side .spans {
  1385. width: 20px;
  1386. height: 30px;
  1387. border: 1px solid #DDDDDD;
  1388. box-sizing: border-box;
  1389. position: absolute;
  1390. top: 50%;
  1391. margin-top: -50%;
  1392. text-align: center;
  1393. z-index: 1;
  1394. background: #fff;
  1395. }
  1396. .side .spans i{
  1397. margin-top: 7px;
  1398. color: #C0BFBF
  1399. }
  1400. .side:hover {
  1401. border-right: 2px solid #20A0FF;
  1402. }
  1403. .side:hover .spans {
  1404. border: 1px solid #20A0FF;
  1405. background: #20A0FF;
  1406. }
  1407. .side:hover .spans i{
  1408. color: #fff;
  1409. }
  1410. /* 右边整体页面 */
  1411. .contents {
  1412. height: 100%;
  1413. /* padding: 30px; */
  1414. background: #F7F7F7;
  1415. /* position: absolute; */
  1416. }
  1417. .submits {
  1418. margin-left: 50%;
  1419. }
  1420. .waiting {
  1421. color:orange;
  1422. }
  1423. .rejected {
  1424. color:red;
  1425. }
  1426. /* 请假模块 */
  1427. .tops {
  1428. width: 100%;
  1429. height:100%;
  1430. position: absolute;
  1431. background: #f7f7f7;
  1432. box-sizing: border-box;
  1433. padding: 20px 0 0 220px;
  1434. }
  1435. .ctons {
  1436. width: 86%;
  1437. height: 92%;
  1438. background: #fff;
  1439. padding: 30px 40px;
  1440. box-sizing: border-box;
  1441. }
  1442. .ctons .el-form-item {
  1443. display: inline-block;
  1444. }
  1445. .line {
  1446. text-align: center;
  1447. margin: 0 6px
  1448. }
  1449. .poss {
  1450. position: fixed;
  1451. bottom: 20px;
  1452. right: 1%;
  1453. box-sizing: border-box;
  1454. }
  1455. .flex {
  1456. display: flex;
  1457. padding: 0 0 20px 0;
  1458. border-bottom: 1px solid #f2f2f2;
  1459. }
  1460. .flex span {
  1461. display: inline-block;
  1462. margin: 0 10px 0 20px;
  1463. }
  1464. </style>