kaorules.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <template>
  2. <view class="box">
  3. <view class="boxtop">
  4. <view class="boxtopb">
  5. <!-- <view class="boxflex" @click="getChoseFn">
  6. <image :src="buimg" class="boxtopba"></image>
  7. <view class="boxtopbb" :style="role?'':'color:#AAAAAA;'">{{role||'选择部门'}}</view>
  8. <image :src="upimg" class="boxtopbc"></image>
  9. </view> -->
  10. <view class="boxflex" @click="getAddFn" v-if="checkPermi(['system:schedule:add'])">
  11. <image :src="rulesimg" class="boxtopbd"></image>
  12. <view class="boxtopbe">添加考勤设置</view>
  13. </view>
  14. </view>
  15. </view>
  16. <card-list :datainfo="prolist" type='rule' :wtdt="wtdt" @getdetail='goDetail'></card-list>
  17. <view>
  18. <view class="exele">
  19. <view class="box" style="padding-top: 0;display: none;">
  20. <table @change="change">
  21. <tr class="tr_one">
  22. <th style="width: 120upx; text-align: center;">部门</th>
  23. <th style="width: 280upx; text-align: center;">打卡距离</th>
  24. <th style="width: 240upx; text-align: center;">打卡次数</th>
  25. <th style="width: 110upx; text-align: center;">操作</th>
  26. </tr>
  27. <scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40"
  28. @scrolltolower="bot_btn">
  29. <tr v-for="(item,index) in prolist" :key="index"
  30. :class=" [index%2 ==0 ? 'two_tr two_trtwo':'two_tr']" @click="chakn(item)">
  31. <td style="width: 120upx; text-align: center;">
  32. {{ item.deptName == null ? '暂无信息' : item.deptName}}
  33. </td>
  34. <td style="width: 280upx; text-align: center;">
  35. <!-- {{ item.dept&&item.dept.deptName == null ? '暂无信息' : item.dept.deptName}}</td> -->
  36. {{ item.kaRadius==null ? '暂无信息' : item.kaRadius}}
  37. </td>
  38. <!-- <td style="width: 40upx; text-align: center;">{{item.gender == null? '暂无信息' : item.gender }}</td> -->
  39. <td style="width: 240upx; text-align: center;">
  40. {{item.kaNum == null? '暂无信息' : item.kaNum }}
  41. </td>
  42. <td style="width: 110upx; color: #1678FF;text-align: center;text-decoration: underline;"
  43. @click.stop="goDetail(item.kaoqinId)">详情</td>
  44. </tr>
  45. <view class="shax" v-if="prolist.length>0">
  46. {{wtdt}}
  47. </view>
  48. <view class="zanwu " v-else><text>暂无数据</text></view>
  49. </scroll-view>
  50. </table>
  51. </view>
  52. </view>
  53. </view>
  54. <!-- 部门 -->
  55. <selectMorePicker ref="picker" :title="auiPicker.title" :layer="auiPicker.layer" :titflag='auiPicker.titflag'
  56. :data="auiPicker.data" @callback="pickerCallback"></selectMorePicker>
  57. </view>
  58. </template>
  59. <script>
  60. import {getdeptTreeNow,clocklist} from "@/api/work/check.js"
  61. import selectMorePicker from "@/components/selectMorePicker.vue"
  62. import selectPicker from '@/components/selectPicker.vue'
  63. import {
  64. selectDictLabel
  65. } from '@/utils/common.js'
  66. import cardList from "@/work/components/clock/cardlist.vue"
  67. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  68. export default {
  69. data() {
  70. return {
  71. rulesimg: require("@/work/static/clock/krules.png"),
  72. buimg: require("@/work/static/clock/chosebm.png"),
  73. addimg: require("@/work/static/clock/addry.png"),
  74. upimg: require("@/work/static/clock/up.png"),
  75. closeimg: require("@/work/static/clock/close.png"),
  76. rimg: require("@/work/static/clock/right.png"),
  77. prolist: [{deptName:'人事部',kaTimeAmIn:'08:00',kaTimePmOut:'19:00'}],
  78. wtdt: '',
  79. nickName: '',
  80. auiPicker: {
  81. title: '选择部门',
  82. layer: null,
  83. titflag: true,
  84. data: []
  85. },
  86. uplatflag: false,
  87. listite: {
  88. "roleName": '',
  89. "roleId": ''
  90. },
  91. rolelist: [],
  92. role: '',
  93. deptId: this.$store.state.user.deptId,
  94. roleId: '',
  95. rangekey: "dictLabel",
  96. pageNum: 1,
  97. pageSize: 10,
  98. reachflag: true,
  99. deptName: '',
  100. rolefalg: true,
  101. rolevalue:[]
  102. }
  103. },
  104. components: {
  105. selectMorePicker,
  106. selectPicker,
  107. cardList
  108. },
  109. onShow() {
  110. },
  111. onLoad() {
  112. uni.$on('reashlist',(res)=>{
  113. this.pageNum = 1;
  114. this.prolist = [];
  115. this.reachflag=true;
  116. this.clocklist()
  117. })
  118. this.clocklist()
  119. // this.getdeptTreeNow();
  120. },
  121. onUnload() {
  122. uni.$off('reashlist')
  123. },
  124. onReachBottom() {
  125. if (this.reachflag) {
  126. this.pageNum++
  127. this.clocklist()
  128. }
  129. },
  130. methods: {
  131. checkPermi,checkRole,
  132. getClose() {
  133. this.uplatflag = false;
  134. },
  135. getSearch() {
  136. this.pageNum = 1;
  137. this.prolist = [];
  138. this.reachflag=true;
  139. this.clocklist()
  140. },
  141. getChoseFn() {
  142. this.$refs.picker.open().then(function() {
  143. console.log('picker打开');
  144. });
  145. // this.$tab.navigateTo("/work/pages/lock")
  146. },
  147. change(){
  148. },
  149. vacRolChange(e) {
  150. // this.params.houseType=e[0].label;
  151. },
  152. goDetail(e) {
  153. this.$tab.navigateTo("/work/pages/clock/setswork?id="+e)
  154. },
  155. getAddFn() {
  156. this.$tab.navigateTo("/work/pages/clock/setswork?fromurl=rule")
  157. },
  158. pickerCallback(e) {
  159. const _this = this;
  160. let result = '';
  161. e.data.forEach(function(item, index) {
  162. if (index == 0) {
  163. result += item.label;
  164. } else {
  165. result += '/' + item.label;
  166. }
  167. });
  168. var len = e.data.length - 1
  169. if (_this.uplatflag) {
  170. _this.deptName = e.data[len].label;
  171. _this.deptId = e.data[len].id;
  172. } else {
  173. _this.role = result;
  174. this.deptId = e.data[len].id;
  175. this.pageNum = 1;
  176. this.prolist = [];
  177. this.reachflag=true;
  178. this.clocklist()
  179. }
  180. },
  181. clocklist() {
  182. var that = this;
  183. var params = {
  184. // nickName: this.nickName,
  185. // deptId: this.deptId,
  186. pageSize: this.pageSize,
  187. pageNum: this.pageNum,
  188. }
  189. clocklist(params).then(res => {
  190. if (res.code == 200) {
  191. if (res.rows.length < this.pageSize) {
  192. this.reachflag = false
  193. this.wtdt = '到底了~';
  194. } else {
  195. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  196. 1)
  197. if (num < res.total) {
  198. this.reachflag = true
  199. this.wtdt = '上拉加载更多'
  200. } else {
  201. this.reachflag = false
  202. this.wtdt = '到底了~';
  203. }
  204. }
  205. if (this.pageNum == 1) {
  206. this.prolist = res.rows;
  207. } else {
  208. this.prolist = this.prolist.concat(res.rows)
  209. }
  210. } else {
  211. this.$toast(res.msg)
  212. }
  213. })
  214. },
  215. getdeptTreeNow() {
  216. getdeptTreeNow().then(res => {
  217. if (res.code == 200) {
  218. this.auiPicker.data = res.data
  219. } else {
  220. this.$toast(res.msg)
  221. }
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. .box {
  229. padding-top: 100rpx;background-color: #F2F2F2;min-height: 100vh;box-sizing: border-box;
  230. }
  231. .boxtop {
  232. padding: 0 34rpx;
  233. position: fixed;left:0;right:0;top: 0;z-index: 5;background-color: #FFFFFF;
  234. .boxtopa {
  235. padding: 14rpx 0;
  236. display: flex;
  237. align-items: center;
  238. input {
  239. height: 64rpx;
  240. background: #E6E6E6;
  241. border-radius: 28rpx;
  242. flex: 1;
  243. background: #E6E6E6;
  244. padding: 0 30rpx;
  245. line-height: 64rpx;
  246. border-radius: 28rpx;
  247. font-size: 32rpx;
  248. }
  249. view {
  250. width: 120rpx;
  251. height: 64rpx;
  252. background: #1678FF;
  253. border-radius: 28rpx;
  254. font-size: 32rpx;
  255. color: #FFFFFF;
  256. margin-left: 8rpx;
  257. flex: 0 0 auto;
  258. text-align: center;
  259. line-height: 64rpx;
  260. }
  261. }
  262. .boxtopb {
  263. display: flex;
  264. align-items: center;
  265. justify-content: space-between;
  266. padding: 32rpx 0;
  267. .boxflex {
  268. display: flex;
  269. align-items: center;
  270. .boxtopba {
  271. width: 26rpx;
  272. height: 24rpx;
  273. margin-right: 16rpx;
  274. }
  275. .boxtopbb {
  276. font-size: 32rpx;
  277. color: #1678FF;
  278. margin-right: 16rpx;
  279. }
  280. .boxtopbc {
  281. width: 14rpx;
  282. height: 14rpx;
  283. }
  284. .boxtopbd {
  285. width: 28rpx;
  286. height: 28rpx;
  287. margin-right: 16rpx;
  288. }
  289. .boxtopbe {
  290. font-size: 30rpx;
  291. color: #6CBC0A;
  292. }
  293. }
  294. }
  295. }
  296. .tab {
  297. .tabs {
  298. .one_tab {
  299. color: #1678FF !important;
  300. }
  301. .one_tabqie {
  302. border-bottom: 8rpx solid #1678FF;
  303. }
  304. }
  305. }
  306. .exele {
  307. .box {
  308. table {
  309. border-spacing: 0rpx;
  310. }
  311. .tr_one {
  312. display: flex;
  313. // padding: 0 20rpx;
  314. box-sizing: border-box;
  315. justify-content: space-between;
  316. th {
  317. font-size: 30rpx;
  318. font-family: PingFang SC;
  319. font-weight: 500;
  320. color: #000000;
  321. overflow: hidden;
  322. text-overflow: ellipsis;
  323. white-space: nowrap;
  324. line-height: 78rpx;
  325. height: 78rpx;
  326. box-sizing: border-box;
  327. }
  328. }
  329. .two_tr {
  330. display: flex;
  331. // padding: 0 20rpx;
  332. box-sizing: border-box;
  333. justify-content: space-between;
  334. td {
  335. font-size: 30rpx;
  336. font-family: PingFang SC;
  337. font-weight: 500;
  338. color: #343434;
  339. min-height: 82rpx;
  340. padding: 20rpx 0;
  341. box-sizing: border-box;
  342. display: flex;
  343. align-items: center;
  344. justify-content: center;
  345. }
  346. // .tdse {
  347. // color: #E60012 !important;
  348. // }
  349. // .apply_span_xl{
  350. // color: #32B16C !important;
  351. // }
  352. // .apply_span_xltwo{
  353. // color: #ffa200 !important;
  354. // }
  355. // .apply_span_xlfive{
  356. // color: #4c4b4b !important;
  357. // }
  358. // .apply_span_xlthreo{
  359. // color: #f00404 !important;
  360. // }
  361. // .apply_span_xlforu{
  362. // color: #aaaaaa !important;
  363. // }
  364. // .coiu {
  365. // color: #EC1717;
  366. // }
  367. }
  368. .two_trtwo {
  369. background-color: #F2F2F2;
  370. }
  371. }
  372. }
  373. .zanwu {
  374. text-align: center;
  375. padding-top: 20upx;
  376. span {
  377. font-size: 30upx;
  378. }
  379. }
  380. // 搜索条件width: 562rpx;
  381. .bgbox {
  382. position: fixed;
  383. left: 0;
  384. right: 0;
  385. top: 0;
  386. bottom: 0;
  387. z-index: 19;
  388. background: rgba(0, 0, 0, 0.5);
  389. }
  390. .sfixed {
  391. min-height: 760rpx;
  392. background: #FFFFFF;
  393. border-radius: 14rpx;
  394. padding: 40rpx 34rpx;
  395. box-sizing: border-box;
  396. position: fixed;
  397. left: 60rpx;
  398. right: 60rpx;
  399. top: 50%;
  400. transform: translateY(-50%);
  401. z-index: 29;
  402. max-height: calc(100vh - 280rpx);
  403. overflow-y: auto;
  404. .sfixed_tit {
  405. font-size: 32rpx;
  406. font-weight: bold;
  407. color: #343434;
  408. line-height: 44rpx;
  409. text-align: center;
  410. }
  411. .sfixed_clo {
  412. width: 20rpx;
  413. height: 20rpx;
  414. position: absolute;
  415. left: 34rpx;
  416. top: 44rpx;
  417. }
  418. .sfixed_box {
  419. padding-top: 20rpx;
  420. margin-bottom: 80rpx;
  421. .sfixed_inp {
  422. width: 100%;
  423. height: 76rpx;
  424. background: #F2F2F2;
  425. padding: 0 34rpx;
  426. box-sizing: border-box;
  427. font-size: 32rpx;
  428. color: #333333;
  429. margin-top: 30rpx;
  430. }
  431. }
  432. .sfixed_btn {
  433. width: 100%;
  434. height: 76rpx;
  435. border: 0px solid #00B034;
  436. border-radius: 6rpx;
  437. font-size: 34rpx;
  438. color: #FFFFFF;
  439. text-align: center;
  440. line-height: 76rpx;
  441. &.btn1 {
  442. background: #1678FF;
  443. color: #FFFFFF;
  444. }
  445. &.btn2 {
  446. border: 2rpx solid #F02828;
  447. color: #F02828;
  448. margin-top: 28rpx;
  449. }
  450. }
  451. }
  452. .address {
  453. display: flex;
  454. align-items: center;
  455. padding: 24rpx 0;
  456. .addtita {
  457. flex: 0 0 auto;
  458. font-size: 34rpx;
  459. font-weight: bold;
  460. color: #343434;
  461. }
  462. .addressa {
  463. display: flex;
  464. align-items: center;
  465. flex: 1;
  466. display: flex;
  467. align-items: center;
  468. justify-content: flex-end;
  469. overflow: hidden;
  470. .addsa {
  471. font-size: 30rpx;
  472. color: #333333;
  473. overflow: hidden;
  474. white-space: nowrap;
  475. text-overflow: ellipsis;
  476. flex: 1;
  477. text-align: right;
  478. }
  479. .addsimg {
  480. width: 10rpx;
  481. height: 18rpx;
  482. margin-left: 10rpx;
  483. flex: 0 0 auto;
  484. }
  485. // .adds{
  486. // display: flex;align-items: center;justify-content: flex-start;padding:10rpx 20rpx;min-width: 220rpx;box-sizing: border-box;}
  487. }
  488. .addclear {
  489. color: #EA2929;
  490. font-size: 32rpx;
  491. flex: 0 0 auto;
  492. height: 60rpx;
  493. line-height: 60rpx;
  494. width: 128rpx;
  495. text-align: center
  496. }
  497. }
  498. .delbox {
  499. width: 580rpx;
  500. background: #FFFFFF;
  501. border-radius: 14px;
  502. position: fixed;
  503. top: 50%;
  504. left: 80rpx;
  505. right: 80rpx;
  506. padding: 48rpx 34rpx 72rpx;
  507. box-sizing: border-box;
  508. z-index: 5;
  509. margin-top: -210rpx;
  510. .deltit {
  511. font-size: 34rpx;
  512. font-weight: bold;
  513. color: #343434;
  514. text-align: center;
  515. line-height: 40rpx;
  516. }
  517. .del_img {
  518. width: 34rpx;
  519. height: 34rpx;
  520. position: absolute;
  521. right: 34rpx;
  522. top: 44rpx;
  523. }
  524. .del_btn {
  525. width: 100%;
  526. height: 76rpx;
  527. background: #00B034;
  528. border-radius: 6rpx;
  529. font-size: 34rpx;
  530. font-weight: bold;
  531. color: #FFFFFF;
  532. text-align: center;
  533. line-height: 76rpx;
  534. }
  535. .del_list {
  536. display: flex;
  537. padding: 60rpx 0 40rpx;
  538. flex-wrap: wrap;
  539. .del_lista {
  540. width: 116rpx;
  541. height: 64rpx;
  542. background: #CACACA;
  543. border-radius: 32rpx;
  544. font-size: 32rpx;
  545. font-weight: 500;
  546. color: #FFFFFF;
  547. text-align: center;
  548. line-height: 64rpx;
  549. margin: 0 10rpx 20rpx 0;
  550. &.act {
  551. background-color: #019FE8;
  552. }
  553. }
  554. }
  555. }
  556. </style>