list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867
  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-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-submenu index="2" v-if="user.role != 0">
  19. <template slot="title">
  20. <i class="iconfont firerock-iconbaoxiaodan"></i>
  21. <span>{{user.role == 0?"我的请假单":"请假单列表"}}</span>
  22. </template>
  23. <el-menu-item index="2-1" ><p @click="bills(false)" >全部</p></el-menu-item>
  24. <el-menu-item index="2-2" ><p @click="bills(true)">待核审</p></el-menu-item>
  25. </el-submenu>
  26. <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
  27. <i class="iconfont firerock-iconbaoxiaodan"></i>
  28. <span slot="title">{{user.role == 0?"我的请假单":"请假单列表"}}</span>
  29. </el-menu-item>
  30. <el-menu-item index="4">
  31. <template slot="title">
  32. <i class="iconfont firerock-icontianbao"></i>
  33. <span slot="title">请假统计</span>
  34. </template>
  35. </el-menu-item>
  36. </el-menu>
  37. </el-col>
  38. </div>
  39. <!-- 侧边栏点击事件 -->
  40. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  41. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  42. </div> -->
  43. <!-- 内容主体区域 -->
  44. <div class="contents">
  45. <div v-if="!displayTable" class="headine" ref="headine">
  46. <h3 ref="headHe" style="padding-left: 220px">{{shuz[ins]}}</h3>
  47. <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
  48. </div>
  49. <!-- 上面部分 -->
  50. <div v-if="!displayTable && apk == false" class="tops">
  51. <!-- 公共 -->
  52. <div class="ctons">
  53. <!-- 表单 -->
  54. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  55. <!-- 请假人 -->
  56. <el-form-item label="请假人" prop="ownerId" >
  57. <!--普通员工只能自己填报自己的 -->
  58. <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 150px" :disabled="user.role == 0" filterable="true">
  59. <span v-for="(item, index) in users" :key="index">
  60. <el-option :label="item.name" :value="item.id"></el-option>
  61. </span>
  62. </el-select>
  63. </el-form-item>
  64. <!-- 电话 -->
  65. <el-form-item label="电话" prop="tel">
  66. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px"></el-input>
  67. </el-form-item>
  68. <!-- 单选 -->
  69. <el-form-item>
  70. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  71. <el-radio label="0">按天请假</el-radio>
  72. <el-radio label="1">按小时请假</el-radio>
  73. </el-radio-group>
  74. </el-form-item>
  75. <!-- 时间选择 -->
  76. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 60%;margin-right:500px">
  77. <el-col :span="11">
  78. <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsStart" v-model="addForm.startDate" style="width: 100%;" @blur="datas()"></el-date-picker>
  79. <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 100%;" @change="datasss()"></el-date-picker>
  80. </el-col>
  81. <el-col class="line" :span="2">-</el-col>
  82. <el-col :span="11">
  83. <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 100%;" @blur="datas()"></el-date-picker>
  84. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  85. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  86. </el-select> -->
  87. </el-col>
  88. </el-form-item>
  89. <!-- 请假天数 -->
  90. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  91. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  92. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  93. <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>
  94. <div v-else>
  95. <!-- <el-select v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  96. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  97. </el-select>小时 -->
  98. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
  99. </div>
  100. </el-form-item>
  101. <!-- 备注 -->
  102. <el-form-item label="备注" style="width: 100%">
  103. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 50%"></el-input>
  104. </el-form-item>
  105. </el-form>
  106. <div>
  107. <p style="margin-left: 75px"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p>
  108. </div>
  109. </div>
  110. </div>
  111. <!-- 下面部分 -->
  112. <div v-if="displayTable && apk == false" class="tops">
  113. <!-- 公共 -->
  114. <div class="ctons">
  115. <el-table v-loading="loading" :data="tableData" style="width: 100%" height="100%">
  116. <el-table-column prop="ownerName" label="请假人" width="180"></el-table-column>
  117. <el-table-column prop="tel" label="电话" width="180"></el-table-column>
  118. <el-table-column prop="leaveType" label="请假类型" width="180">
  119. <template slot-scope="scope">
  120. <div v-if="scope.row.leaveType == 0">事假</div>
  121. <div v-if="scope.row.leaveType == 1">病假</div>
  122. <div v-if="scope.row.leaveType == 2">年假</div>
  123. <div v-if="scope.row.leaveType == 3">产假</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="startDate" label="请假开始时间" width="180"></el-table-column>
  127. <el-table-column prop="endDate" label="请假结束时间" width="180"></el-table-column>
  128. <el-table-column label="请假天数" width="120">
  129. <template slot-scope="scope">
  130. <div>{{scope.row.timeDays}}天</div>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="请假时长" width="120">
  134. <template slot-scope="scope">
  135. <div>{{scope.row.timeHours}}小时</div>
  136. </template>
  137. </el-table-column>
  138. <el-table-column prop="status" label="状态" width="100">
  139. <template slot-scope="scope">
  140. <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
  141. <div v-if="scope.row.status == 0" >核审通过</div>
  142. <div v-if="scope.row.status == 1" style="color: orange">待核审</div>
  143. <div v-if="scope.row.status == 2" style="color: red">驳回</div>
  144. <div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
  145. </div>
  146. <div v-else>
  147. <span>暂无请假单</span>
  148. </div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="remark" label="备注" width="200">
  152. <template slot-scope="scope">
  153. <!-- <div class="apls">{{scope.row.remark}}</div> -->
  154. <el-popover placement="top-start" title="标题" width="200" trigger="hover" :content="scope.row.remark">
  155. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  156. </el-popover>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="操作" width="180" fixed="right" v-if="isAuditList">
  160. <template slot-scope="scope">
  161. <div v-if="user.role != 0">
  162. <el-button type="primary" size="mini" @click.stop.native="approve(scope.row)">通过</el-button>
  163. <el-button type="danger" size="mini" @click.stop.native="deny(scope.row)">驳回</el-button>
  164. </div>
  165. <div v-else>
  166. <el-button type="danger" size="mini">撤销</el-button>
  167. </div>
  168. </template>
  169. </el-table-column>
  170. </el-table>
  171. <div class="poss">
  172. <el-pagination
  173. @size-change="handleSizeChange"
  174. @current-change="handleCurrentChange"
  175. :current-page="currentPage4"
  176. :page-sizes="[20, 50, 100, 200]"
  177. :page-size="20"
  178. layout="total, sizes, prev, pager, next"
  179. :total="total">
  180. </el-pagination>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 统计部分 -->
  185. <div v-if="displayTable && apk" class="tops">
  186. <!-- 公共 -->
  187. <div class="ctons">
  188. <div style="display: flex;align-items: center;">
  189. <div style="display: inline-block;width: 350px">
  190. <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true">
  191. <el-button slot="append" @click="statistical" icon="el-icon-search"></el-button>
  192. </el-input>
  193. </div>
  194. <div style="display: inline-block;width: 340px">
  195. <span style="display: inline-block;margin: 0 15px 0 20px">开始日期</span>
  196. <el-date-picker
  197. v-model="statData"
  198. type="date"
  199. placeholder="选择日期" >
  200. </el-date-picker>
  201. </div>
  202. <div style="display: inline-block;width: 350px">
  203. <span style="display: inline-block;margin: 0 15px 0 0">结束日期</span>
  204. <el-date-picker
  205. v-model="endData"
  206. type="date"
  207. placeholder="选择日期">
  208. </el-date-picker>
  209. </div>
  210. </div>
  211. <div style="margin-top: 30px">
  212. <el-table v-loading="loading" :data="statisticalList" height="780px" style="width: 100%">
  213. <el-table-column prop="ownerName" label="姓名" width="300">
  214. <template slot-scope="scope">
  215. <div v-if="scope.row.ownerName">
  216. {{scope.row.ownerName}}
  217. </div>
  218. <div v-else>
  219. <span>暂无请假统计</span>
  220. </div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column prop="timeDays" label="请假总天数" width="300">
  224. <template slot-scope="scope">
  225. {{scope.row.timeDays}}/天
  226. </template>
  227. </el-table-column>
  228. <el-table-column prop="timeHours" label="请假总时长">
  229. <template slot-scope="scope">
  230. {{scope.row.timeHours}}/小时
  231. </template>
  232. </el-table-column>
  233. </el-table>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. </section>
  239. </template>
  240. <script>
  241. import { config } from 'dingtalk-jsapi';
  242. export default {
  243. name: "expense",
  244. components: {},
  245. props: {},
  246. data() {
  247. //验证手机号
  248. var checkTel = (rule, value, callback) =>{
  249. if (!value) {
  250. return callback(new Error('手机号不能为空'));
  251. } else {
  252. const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
  253. if (reg.test(value)) {
  254. callback();
  255. } else {
  256. return callback(new Error('请输入正确的手机号'));
  257. }
  258. }
  259. };
  260. var checks = (rule, value, callback) => {
  261. if (!value) {
  262. return callback(new Error('请假天数不能为空'));
  263. } else {
  264. if (value > this.timeChoose) {
  265. return callback(new Error('不能超过当前选择的日期'));
  266. } else {
  267. callback();
  268. }
  269. }
  270. };
  271. return {
  272. addFormRules: {
  273. ownerId: [{ required: true, message: "请选择报销人", trigger: "blur" }],
  274. tel: [{required: true, validator: checkTel, trigger: 'blur'}],
  275. timeDays: [{required: true, validator: checks, trigger: 'blur'}]
  276. },
  277. user: JSON.parse(sessionStorage.getItem("user")),
  278. shuz: ['事假填报', '病假填报', '年假填报', '产假填报'],
  279. ins: 0,
  280. addForm: {
  281. timeType: '0',
  282. startDate: this.getCurrentTime(),
  283. endDate: this.getCurrentTime(),
  284. timeDays: 1,
  285. leaveType: 0,
  286. // indate: this.getCurrentTime(),
  287. timeHours: '8',
  288. tel: ''
  289. },
  290. displayTable: false,
  291. users: [], // 人员信息
  292. flg: true,
  293. createDate: '2020-01-01',
  294. pickerOptionsStart: {
  295. disabledDate: (time) => {
  296. if (this.addForm.endDate) {
  297. return time.getTime() > new Date(this.addForm.endDate).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  298. }
  299. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  300. },
  301. },
  302. pickerOptionsEnd: {
  303. disabledDate: (time) => {
  304. if (this.addForm.startDate) {
  305. return time.getTime() < new Date(this.addForm.startDate).getTime();
  306. }
  307. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  308. },
  309. },
  310. options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
  311. tableData: [],
  312. page: 1,
  313. size: 20,
  314. isAuditList: '',
  315. total:0,
  316. apk: false,
  317. keyword: '',
  318. statData: this.getCurrentTimes(),
  319. endData: this.getCurrentTime(),
  320. statisticalList: [],
  321. loading: false,
  322. timeChoose: 1,
  323. };
  324. },
  325. computed: {},
  326. watch: {},
  327. created() {},
  328. mounted() {
  329. this.getUsers() // 获取人员信息
  330. },
  331. filters: {},
  332. methods: {
  333. approve(item) {
  334. //审核通过
  335. this.http.post('/leave-sheet/approve', {id:item.id
  336. },
  337. res => {
  338. if (res.code == "ok") {
  339. this.bills(true);
  340. } else {
  341. this.$message({
  342. message: res.msg,
  343. type: "error"
  344. });
  345. }
  346. },
  347. error => {
  348. this.$message({
  349. message: error,
  350. type: "error"
  351. });
  352. });
  353. },
  354. deny(item) {
  355. //审核驳回
  356. this.http.post('/leave-sheet/deny', {id:item.id
  357. },
  358. res => {
  359. if (res.code == "ok") {
  360. this.bills(true);
  361. } else {
  362. this.$message({
  363. message: res.msg,
  364. type: "error"
  365. });
  366. }
  367. },
  368. error => {
  369. this.$message({
  370. message: error,
  371. type: "error"
  372. });
  373. });
  374. },
  375. getUsers() {
  376. this.http.post(this.port.manage.list, {
  377. departmentId: -1,
  378. pageIndex: 1,
  379. pageSize: 99999
  380. },
  381. res => {
  382. if (res.code == "ok") {
  383. this.users = res.data.records;
  384. if (this.user.role == 0) {
  385. this.addForm.ownerId = this.user.id;
  386. this.addForm.status = 1;
  387. this.addForm.tel = this.user.phone
  388. }
  389. } else {
  390. this.$message({
  391. message: res.msg,
  392. type: "error"
  393. });
  394. }
  395. },
  396. error => {
  397. this.$message({
  398. message: error,
  399. type: "error"
  400. });
  401. });
  402. },
  403. // 员工请假填报点击事件
  404. ssl(index) {
  405. this.ins = index;
  406. this.addForm.leaveType = index
  407. },
  408. staffs(key, keyPath) {
  409. if (keyPath[0] == '1') {
  410. this.displayTable = false;
  411. this.apk = false
  412. } else if(keyPath[0] == '2') {
  413. this.displayTable = true;
  414. this.apk = false
  415. } else {
  416. this.displayTable = true;
  417. this.apk = true
  418. this.statistical()
  419. }
  420. },
  421. bills(audit){
  422. this.tableData = []
  423. this.displayTable = true;
  424. this.isAuditList = audit;
  425. this.loading = true
  426. var param = {pageIndex: this.page,
  427. pageSize: this.size,
  428. code: '',
  429. createDate: '',
  430. ownerId:'',
  431. type:'',
  432. };
  433. if (this.isAuditList) {
  434. param.status = 1;
  435. }
  436. this.list = [];
  437. // this.total = 0;
  438. this.http.post('/leave-sheet/list', param,
  439. res => {
  440. if (res.code == "ok") {
  441. this.tableData = res.data.records
  442. this.total = res.data.total
  443. this.loading = false
  444. } else {
  445. this.loading = false
  446. this.$message({
  447. message: res.msg,
  448. type: "error"
  449. });
  450. }
  451. },
  452. error => {
  453. this.loading = false
  454. this.$message({
  455. message: error,
  456. type: "error"
  457. });
  458. });
  459. },
  460. submits(){
  461. this.$refs.addForm.validate(valid => {
  462. if (valid) {
  463. this.http.post('/leave-sheet/add', this.addForm,
  464. res => {
  465. if (res.code == "ok") {
  466. this.$message({
  467. message: '填报成功',
  468. type: "success"
  469. });
  470. } else {
  471. this.$message({
  472. message: res.msg,
  473. type: "error"
  474. });
  475. }
  476. },
  477. error => {
  478. this.$message({
  479. message: error,
  480. type: "error"
  481. });
  482. });
  483. } else {
  484. return false;
  485. }
  486. });
  487. },
  488. selts() {
  489. for(var i in this.users) {
  490. if(this.users[i].id == this.addForm.ownerId) {
  491. this.addForm.tel = this.users[i].phone
  492. }
  493. }
  494. },
  495. chanRadio() {
  496. console.log(1234)
  497. console.log(this.addForm.timeType)
  498. if(this.addForm.timeType == '0') {
  499. this.flg = true
  500. this.addForm.startDate = this.getCurrentTime()
  501. this.addForm.endDate = this.getCurrentTime()
  502. this.addForm.timeType = '0'
  503. this.addForm.timeDays = '1'
  504. this.addForm.timeHours = '8'
  505. } else {
  506. this.flg = false
  507. this.addForm.startDate = this.getCurrentTime()
  508. this.addForm.endDate = this.getCurrentTime()
  509. this.addForm.timeType = '1'
  510. this.addForm.timeHours = '1'
  511. }
  512. },
  513. // 计算日期
  514. datas() {
  515. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  516. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  517. this.timeChoose = this.addForm.timeDays
  518. this.addForm.timeHours = this.addForm.timeDays * 8
  519. },
  520. datasss() {
  521. console.log(123)
  522. this.addForm.endDate = this.addForm.startDate
  523. },
  524. DateDiff(sDate1, sDate2){
  525. var aDate, oDate1, oDate2, iDays
  526. aDate = sDate1.split("-")
  527. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  528. aDate = sDate2.split("-")
  529. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  530. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  531. return iDays + 1
  532. },
  533. stringToDate(dateString){
  534. dateString = dateString.split('-');
  535. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  536. },
  537. countWorkDay(date1, date2){
  538. date1 = this.stringToDate(date1);
  539. date2 = this.stringToDate(date2);
  540. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  541. var weeks = 0;
  542. for(var i = 0; i < delta; i++){
  543. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  544. date1 = date1.valueOf();
  545. date1 += 1000 * 60 * 60 * 24;
  546. date1 = new Date(date1);
  547. }
  548. return delta - weeks;
  549. },
  550. // 时间
  551. getTadeTime() {
  552. var time = new Date();
  553. return time.getHours() +':00:00'
  554. },
  555. // 日期
  556. getCurrentTime() {
  557. var _this = this;
  558.   let yy = new Date().getFullYear();
  559.   let mm = new Date().getMonth()+1;
  560.   let dd = new Date().getDate();
  561.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  562.   return _this.gettime
  563. },
  564. getCurrentTimes() {
  565. var _this = this;
  566.   let yy = new Date().getFullYear();
  567.   let mm = new Date().getMonth()+1;
  568.   let dd = new Date().getDate();
  569.   _this.gettime = yy+'-'+mm+'-'+'01';
  570.   return _this.gettime
  571. },
  572. chanSele() {
  573. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  574. },
  575. handleSizeChange(val){
  576. this.size = val;
  577. this.bills()
  578. },
  579. handleCurrentChange(val) {
  580. console.log(val, 1, '1')
  581. this.page = val;
  582. this.bills()
  583. },
  584. statistical() {
  585. this.loading = true
  586. this.http.post('/leave-sheet/summaryData', {
  587. keyword: this.keyword,
  588. startDate: this.statData,
  589. endDate: this.endData
  590. },
  591. res => {
  592. if (res.code == "ok") {
  593. this.statisticalList = res.data
  594. this.loading = false
  595. } else {
  596. this.loading = false
  597. this.$message({
  598. message: res.msg,
  599. type: "error"
  600. });
  601. }
  602. },
  603. error => {
  604. this.$message({
  605. message: error,
  606. type: "error"
  607. });
  608. });
  609. },
  610. //
  611. inputs() {
  612. var str = this.addForm.timeDays + ''
  613. if(str.indexOf('.') != '-1') {
  614. var s = str.split('.')[0]
  615. var st = str.split('.')[1]
  616. var sts = st.split('')
  617. this.addForm.timeDays = s + '.' + sts[0]
  618. }
  619. },
  620. inputss() {
  621. if(this.addForm.timeHours < 0) {
  622. this.addForm.timeHours = 1
  623. } else if(this.addForm.timeHours > 8) {
  624. this.addForm.timeHours = 8
  625. } else {
  626. var str = this.addForm.timeHours
  627. console.log(str)
  628. if(str.indexOf('.') != '-1') {
  629. var s = str.split('.')[0]
  630. var st = str.split('.')[1]
  631. var sts = st.split('')
  632. this.addForm.timeHours = s + '.' + sts[0]
  633. }
  634. }
  635. },
  636. }
  637. };
  638. </script>
  639. <style scoped>
  640. .apls {
  641. width: 200px;
  642. white-space:nowrap;
  643. overflow:hidden;
  644. text-overflow:ellipsis;
  645. }
  646. .tups {
  647. width: 100%;
  648. height: 25px;
  649. position: relative;
  650. z-index: 99;
  651. overflow: hidden;
  652. }
  653. .tups img {
  654. height: 25px !important;
  655. position: relative;
  656. z-index: 99;
  657. }
  658. .viewer-canvas {
  659. position: absolute;
  660. z-index: 9 !important;
  661. }
  662. .icl {
  663. margin-top: -25px !important;
  664. }
  665. /* 费用报销标题 */
  666. .headine {
  667. width: 100%;
  668. height: 46.4px;
  669. line-height: 46.4px;
  670. background: #fff;
  671. box-sizing: border-box;
  672. }
  673. .headine h3 {
  674. margin: 0;
  675. display: inline-block;
  676. box-sizing: border-box;
  677. color: #999;
  678. }
  679. .headine p {
  680. display: inline-block;
  681. margin: 0;
  682. }
  683. /* /费用报销标题 */
  684. .sidebars {
  685. height: 100%;
  686. position: absolute;
  687. border-right: 1px solid #E6E6E6;
  688. z-index: 2;
  689. top: 0;
  690. }
  691. .sidebars h3 {
  692. margin: 0;
  693. line-height: 45px;
  694. background: #ffffff;
  695. font-weight: normal;
  696. color: #666;
  697. padding-left: 20px;
  698. }
  699. .sidebars .el-col-12 {
  700. width: 100%
  701. }
  702. .public {
  703. height: 230px;
  704. border-bottom: 1px solid #ddd;
  705. }
  706. .public .el-form-item {
  707. display: inline-block;
  708. }
  709. .pu_button {
  710. text-align: right;
  711. width: 100%;
  712. padding: 24px 30px;
  713. box-sizing: border-box;
  714. }
  715. .pu_bu_x .pu_bu_t {
  716. display: inline-block;
  717. }
  718. .pu_bu_x {
  719. margin-right: 20px;
  720. color: #20A0F7;
  721. cursor: pointer;
  722. }
  723. .pu_bu_t {
  724. color: #20A0F7;
  725. cursor: pointer;
  726. display: block;
  727. float: right;
  728. position:
  729. relative;
  730. top: -20px;
  731. right: 63px;
  732. }
  733. .pu_table {
  734. margin-left: 10px;
  735. }
  736. .pu_bu_t:hover {
  737. color: #7bbcff;
  738. }
  739. .pu_bu_x:hover {
  740. color: #7bbcff;
  741. }
  742. /* 我的单据报销凭证 */
  743. .staff{
  744. border-left: 1px solid #fff;
  745. border-top: 1px solid #fff;
  746. border-right: 1px solid #fff;
  747. background: #fff;
  748. }
  749. /* */
  750. .sdat{
  751. display: inline-block;
  752. width: 260px;
  753. margin-left: 13px;
  754. }
  755. .messages .el-form-item{
  756. display: inline-block;
  757. }
  758. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  759. width: 190px;
  760. }
  761. /* 我的报销单据 */
  762. .search {
  763. position: relative;
  764. top: 20px;
  765. left: 20px;
  766. }
  767. .tables {
  768. margin-top: 50px;
  769. box-sizing: border-box;
  770. padding: 10px;
  771. }
  772. .informant .el-form-item {
  773. display: inline-block;
  774. }
  775. /* 侧边栏收索 */
  776. .side {
  777. position: absolute;
  778. z-index: 2;
  779. border-right: 2px solid #DDDDDD;
  780. height: 100%;
  781. top: 0;
  782. width: 0;
  783. }
  784. .side .spans {
  785. width: 20px;
  786. height: 30px;
  787. border: 1px solid #DDDDDD;
  788. box-sizing: border-box;
  789. position: absolute;
  790. top: 50%;
  791. margin-top: -50%;
  792. text-align: center;
  793. z-index: 1;
  794. background: #fff;
  795. }
  796. .side .spans i{
  797. margin-top: 7px;
  798. color: #C0BFBF
  799. }
  800. .side:hover {
  801. border-right: 2px solid #20A0FF;
  802. }
  803. .side:hover .spans {
  804. border: 1px solid #20A0FF;
  805. background: #20A0FF;
  806. }
  807. .side:hover .spans i{
  808. color: #fff;
  809. }
  810. /* 右边整体页面 */
  811. .contents {
  812. height: 100%;
  813. /* padding: 30px; */
  814. background: #F7F7F7;
  815. /* position: absolute; */
  816. }
  817. .submits {
  818. margin-left: 50%;
  819. }
  820. .waiting {
  821. color:orange;
  822. }
  823. .rejected {
  824. color:red;
  825. }
  826. /* 请假模块 */
  827. .tops {
  828. width: 100%;
  829. height:100%;
  830. position: absolute;
  831. background: #f7f7f7;
  832. box-sizing: border-box;
  833. padding: 20px 0 0 220px;
  834. }
  835. .ctons {
  836. width: 86%;
  837. height: 92%;
  838. background: #fff;
  839. padding: 30px 40px;
  840. box-sizing: border-box;
  841. }
  842. .ctons .el-form-item {
  843. display: inline-block;
  844. }
  845. .line {
  846. text-align: center;
  847. }
  848. .poss {
  849. position: fixed;
  850. bottom: 20px;
  851. right: 1%;
  852. box-sizing: border-box;
  853. }
  854. </style>