kaorules.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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' @getDelFn="getDelFn"></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,getXiuconfigDel} 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. getDelFn(data){
  136. var that=this;
  137. getXiuconfigDel(data).then(res=>{
  138. if(res.code==200){
  139. this.$toast("删除成功")
  140. setTimeout(function() {
  141. that.getSearch()
  142. }, 1500);
  143. }
  144. })
  145. },
  146. getSearch() {
  147. this.pageNum = 1;
  148. this.prolist = [];
  149. this.reachflag=true;
  150. this.clocklist()
  151. },
  152. getChoseFn() {
  153. this.$refs.picker.open().then(function() {
  154. console.log('picker打开');
  155. });
  156. // this.$tab.navigateTo("/work/pages/lock")
  157. },
  158. change(){
  159. },
  160. vacRolChange(e) {
  161. // this.params.houseType=e[0].label;
  162. },
  163. goDetail(e) {
  164. this.$tab.navigateTo("/work/pages/clock/setswork?id="+e)
  165. },
  166. getAddFn() {
  167. this.$tab.navigateTo("/work/pages/clock/setswork?fromurl=rule")
  168. },
  169. pickerCallback(e) {
  170. const _this = this;
  171. let result = '';
  172. e.data.forEach(function(item, index) {
  173. if (index == 0) {
  174. result += item.label;
  175. } else {
  176. result += '/' + item.label;
  177. }
  178. });
  179. var len = e.data.length - 1
  180. if (_this.uplatflag) {
  181. _this.deptName = e.data[len].label;
  182. _this.deptId = e.data[len].id;
  183. } else {
  184. _this.role = result;
  185. this.deptId = e.data[len].id;
  186. this.pageNum = 1;
  187. this.prolist = [];
  188. this.reachflag=true;
  189. this.clocklist()
  190. }
  191. },
  192. clocklist() {
  193. var that = this;
  194. var params = {
  195. // nickName: this.nickName,
  196. // deptId: this.deptId,
  197. pageSize: this.pageSize,
  198. pageNum: this.pageNum,
  199. }
  200. clocklist(params).then(res => {
  201. if (res.code == 200) {
  202. if (res.rows.length < this.pageSize) {
  203. this.reachflag = false
  204. this.wtdt = '到底了~';
  205. } else {
  206. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  207. 1)
  208. if (num < res.total) {
  209. this.reachflag = true
  210. this.wtdt = '上拉加载更多'
  211. } else {
  212. this.reachflag = false
  213. this.wtdt = '到底了~';
  214. }
  215. }
  216. if (this.pageNum == 1) {
  217. this.prolist = res.rows;
  218. } else {
  219. this.prolist = this.prolist.concat(res.rows)
  220. }
  221. } else {
  222. this.$toast(res.msg)
  223. }
  224. })
  225. },
  226. getdeptTreeNow() {
  227. getdeptTreeNow().then(res => {
  228. if (res.code == 200) {
  229. this.auiPicker.data = res.data
  230. } else {
  231. this.$toast(res.msg)
  232. }
  233. })
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang="scss" scoped>
  239. .box {
  240. padding-top: 100rpx;background-color: #F2F2F2;min-height: 100vh;box-sizing: border-box;
  241. }
  242. .boxtop {
  243. padding: 0 34rpx;
  244. position: fixed;left:0;right:0;top: 0;z-index: 5;background-color: #FFFFFF;
  245. .boxtopa {
  246. padding: 14rpx 0;
  247. display: flex;
  248. align-items: center;
  249. input {
  250. height: 64rpx;
  251. background: #E6E6E6;
  252. border-radius: 28rpx;
  253. flex: 1;
  254. background: #E6E6E6;
  255. padding: 0 30rpx;
  256. line-height: 64rpx;
  257. border-radius: 28rpx;
  258. font-size: 32rpx;
  259. }
  260. view {
  261. width: 120rpx;
  262. height: 64rpx;
  263. background: #1678FF;
  264. border-radius: 28rpx;
  265. font-size: 32rpx;
  266. color: #FFFFFF;
  267. margin-left: 8rpx;
  268. flex: 0 0 auto;
  269. text-align: center;
  270. line-height: 64rpx;
  271. }
  272. }
  273. .boxtopb {
  274. display: flex;
  275. align-items: center;
  276. justify-content: space-between;
  277. padding: 32rpx 0;
  278. .boxflex {
  279. display: flex;
  280. align-items: center;
  281. .boxtopba {
  282. width: 26rpx;
  283. height: 24rpx;
  284. margin-right: 16rpx;
  285. }
  286. .boxtopbb {
  287. font-size: 32rpx;
  288. color: #1678FF;
  289. margin-right: 16rpx;
  290. }
  291. .boxtopbc {
  292. width: 14rpx;
  293. height: 14rpx;
  294. }
  295. .boxtopbd {
  296. width: 28rpx;
  297. height: 28rpx;
  298. margin-right: 16rpx;
  299. }
  300. .boxtopbe {
  301. font-size: 30rpx;
  302. color: #6CBC0A;
  303. }
  304. }
  305. }
  306. }
  307. .tab {
  308. .tabs {
  309. .one_tab {
  310. color: #1678FF !important;
  311. }
  312. .one_tabqie {
  313. border-bottom: 8rpx solid #1678FF;
  314. }
  315. }
  316. }
  317. .exele {
  318. .box {
  319. table {
  320. border-spacing: 0rpx;
  321. }
  322. .tr_one {
  323. display: flex;
  324. // padding: 0 20rpx;
  325. box-sizing: border-box;
  326. justify-content: space-between;
  327. th {
  328. font-size: 30rpx;
  329. font-family: PingFang SC;
  330. font-weight: 500;
  331. color: #000000;
  332. overflow: hidden;
  333. text-overflow: ellipsis;
  334. white-space: nowrap;
  335. line-height: 78rpx;
  336. height: 78rpx;
  337. box-sizing: border-box;
  338. }
  339. }
  340. .two_tr {
  341. display: flex;
  342. // padding: 0 20rpx;
  343. box-sizing: border-box;
  344. justify-content: space-between;
  345. td {
  346. font-size: 30rpx;
  347. font-family: PingFang SC;
  348. font-weight: 500;
  349. color: #343434;
  350. min-height: 82rpx;
  351. padding: 20rpx 0;
  352. box-sizing: border-box;
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. }
  357. // .tdse {
  358. // color: #E60012 !important;
  359. // }
  360. // .apply_span_xl{
  361. // color: #32B16C !important;
  362. // }
  363. // .apply_span_xltwo{
  364. // color: #ffa200 !important;
  365. // }
  366. // .apply_span_xlfive{
  367. // color: #4c4b4b !important;
  368. // }
  369. // .apply_span_xlthreo{
  370. // color: #f00404 !important;
  371. // }
  372. // .apply_span_xlforu{
  373. // color: #aaaaaa !important;
  374. // }
  375. // .coiu {
  376. // color: #EC1717;
  377. // }
  378. }
  379. .two_trtwo {
  380. background-color: #F2F2F2;
  381. }
  382. }
  383. }
  384. .zanwu {
  385. text-align: center;
  386. padding-top: 20upx;
  387. span {
  388. font-size: 30upx;
  389. }
  390. }
  391. // 搜索条件width: 562rpx;
  392. .bgbox {
  393. position: fixed;
  394. left: 0;
  395. right: 0;
  396. top: 0;
  397. bottom: 0;
  398. z-index: 19;
  399. background: rgba(0, 0, 0, 0.5);
  400. }
  401. .sfixed {
  402. min-height: 760rpx;
  403. background: #FFFFFF;
  404. border-radius: 14rpx;
  405. padding: 40rpx 34rpx;
  406. box-sizing: border-box;
  407. position: fixed;
  408. left: 60rpx;
  409. right: 60rpx;
  410. top: 50%;
  411. transform: translateY(-50%);
  412. z-index: 29;
  413. max-height: calc(100vh - 280rpx);
  414. overflow-y: auto;
  415. .sfixed_tit {
  416. font-size: 32rpx;
  417. font-weight: bold;
  418. color: #343434;
  419. line-height: 44rpx;
  420. text-align: center;
  421. }
  422. .sfixed_clo {
  423. width: 20rpx;
  424. height: 20rpx;
  425. position: absolute;
  426. left: 34rpx;
  427. top: 44rpx;
  428. }
  429. .sfixed_box {
  430. padding-top: 20rpx;
  431. margin-bottom: 80rpx;
  432. .sfixed_inp {
  433. width: 100%;
  434. height: 76rpx;
  435. background: #F2F2F2;
  436. padding: 0 34rpx;
  437. box-sizing: border-box;
  438. font-size: 32rpx;
  439. color: #333333;
  440. margin-top: 30rpx;
  441. }
  442. }
  443. .sfixed_btn {
  444. width: 100%;
  445. height: 76rpx;
  446. border: 0px solid #00B034;
  447. border-radius: 6rpx;
  448. font-size: 34rpx;
  449. color: #FFFFFF;
  450. text-align: center;
  451. line-height: 76rpx;
  452. &.btn1 {
  453. background: #1678FF;
  454. color: #FFFFFF;
  455. }
  456. &.btn2 {
  457. border: 2rpx solid #F02828;
  458. color: #F02828;
  459. margin-top: 28rpx;
  460. }
  461. }
  462. }
  463. .address {
  464. display: flex;
  465. align-items: center;
  466. padding: 24rpx 0;
  467. .addtita {
  468. flex: 0 0 auto;
  469. font-size: 34rpx;
  470. font-weight: bold;
  471. color: #343434;
  472. }
  473. .addressa {
  474. display: flex;
  475. align-items: center;
  476. flex: 1;
  477. display: flex;
  478. align-items: center;
  479. justify-content: flex-end;
  480. overflow: hidden;
  481. .addsa {
  482. font-size: 30rpx;
  483. color: #333333;
  484. overflow: hidden;
  485. white-space: nowrap;
  486. text-overflow: ellipsis;
  487. flex: 1;
  488. text-align: right;
  489. }
  490. .addsimg {
  491. width: 10rpx;
  492. height: 18rpx;
  493. margin-left: 10rpx;
  494. flex: 0 0 auto;
  495. }
  496. // .adds{
  497. // display: flex;align-items: center;justify-content: flex-start;padding:10rpx 20rpx;min-width: 220rpx;box-sizing: border-box;}
  498. }
  499. .addclear {
  500. color: #EA2929;
  501. font-size: 32rpx;
  502. flex: 0 0 auto;
  503. height: 60rpx;
  504. line-height: 60rpx;
  505. width: 128rpx;
  506. text-align: center
  507. }
  508. }
  509. .delbox {
  510. width: 580rpx;
  511. background: #FFFFFF;
  512. border-radius: 14px;
  513. position: fixed;
  514. top: 50%;
  515. left: 80rpx;
  516. right: 80rpx;
  517. padding: 48rpx 34rpx 72rpx;
  518. box-sizing: border-box;
  519. z-index: 5;
  520. margin-top: -210rpx;
  521. .deltit {
  522. font-size: 34rpx;
  523. font-weight: bold;
  524. color: #343434;
  525. text-align: center;
  526. line-height: 40rpx;
  527. }
  528. .del_img {
  529. width: 34rpx;
  530. height: 34rpx;
  531. position: absolute;
  532. right: 34rpx;
  533. top: 44rpx;
  534. }
  535. .del_btn {
  536. width: 100%;
  537. height: 76rpx;
  538. background: #00B034;
  539. border-radius: 6rpx;
  540. font-size: 34rpx;
  541. font-weight: bold;
  542. color: #FFFFFF;
  543. text-align: center;
  544. line-height: 76rpx;
  545. }
  546. .del_list {
  547. display: flex;
  548. padding: 60rpx 0 40rpx;
  549. flex-wrap: wrap;
  550. .del_lista {
  551. width: 116rpx;
  552. height: 64rpx;
  553. background: #CACACA;
  554. border-radius: 32rpx;
  555. font-size: 32rpx;
  556. font-weight: 500;
  557. color: #FFFFFF;
  558. text-align: center;
  559. line-height: 64rpx;
  560. margin: 0 10rpx 20rpx 0;
  561. &.act {
  562. background-color: #019FE8;
  563. }
  564. }
  565. }
  566. }
  567. </style>