kaorules.vue 12 KB

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