personnel.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <view class="box">
  3. <view class="boxtop">
  4. <view class="boxtopa">
  5. <input placeholder="请输入人员姓名查询" v-model="userName"/>
  6. <view @click="getSearch">查询</view>
  7. </view>
  8. <view class="boxtopb">
  9. <!-- 日期选择器 -->
  10. <view class="approva_header">
  11. <picker mode="date" :value="selectDate" fields="month" @change="bindDateChange">
  12. <view class="flexc">
  13. <image :src="timg"></image>
  14. <text class="uni-calendar__header-text">{{selectDate||'选择日期'}}</text>
  15. <image :src="uimg"></image>
  16. </view>
  17. </picker>
  18. </view>
  19. </view>
  20. </view>
  21. <card-list :datainfo="prolist" type='count' @getdetail='goDetail'></card-list>
  22. <!-- <view class="exele" style="padding-top: 0;display: none;">
  23. <table @change="change">
  24. <tr class="tr_one">
  25. <th style="width: 100upx; text-align: center;">姓名</th>
  26. <th style="width: 125upx; text-align: center;">部门</th>
  27. <th style="width: 100upx; text-align: center;">外勤</th>
  28. <th style="width:100upx; text-align: center;">迟到</th>
  29. <th style="width: 100upx; text-align: center;">早退</th>
  30. <th style="width: 100upx; text-align: center;">缺卡</th>
  31. <th style="width: 125upx; text-align: center;">打卡详情</th>
  32. </tr>
  33. <scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40"
  34. @scrolltolower="bot_btn">
  35. <tr v-for="(item,index) in prolist" :key="index"
  36. :class=" [index%2 ==0 ? 'two_tr two_trtwo':'two_tr']" @click="chakn(item)">
  37. <td style="width: 100upx; text-align: center;">
  38. {{ item.userName == null ? '暂无信息' : item.userName}}</td>
  39. <td style="width: 125upx; text-align: center;">
  40. {{ item.deptName == null ? '暂无信息' : item.deptName}}</td>
  41. <td style="width: 100upx; text-align: center;">
  42. {{item.外勤 == null? '暂无信息' : item.外勤 }}</td>
  43. <td style="width: 100upx; text-align: center;">
  44. {{item.迟到 == null? '暂无信息' : item.迟到 }}</td>
  45. <td style="width: 100upx; text-align: center;">
  46. {{item.早退 == null? '暂无信息' : item.早退 }}</td>
  47. <td style="width: 100upx; text-align: center;">
  48. {{item.缺卡 == null? '暂无信息' : item.缺卡 }}</td>
  49. <td style="width: 125upx; color: #1678FF;text-align: center;text-decoration: underline;" @click.stop="goDetail(item)">查看详情</td>
  50. </tr>
  51. <div class="shax" v-if="prolist.length>0">
  52. {{wtdt}}
  53. </div>
  54. <div class="zanwu " v-else><span>暂无数据</span></div>
  55. </scroll-view>
  56. </table>
  57. </view> -->
  58. </view>
  59. </template>
  60. <script>
  61. import {getClockCountall} from "@/api/work/check.js"
  62. import selectPicker from '@/components/selectPicker.vue'
  63. import cardList from "@/work/components/clock/cardlist.vue"
  64. // import {selectDictLabel} from '@/utils/common.js'
  65. export default {
  66. data() {
  67. return {
  68. timg:require("@/static/images/time.png"),
  69. uimg:require("@/static/images/up.png"),
  70. buimg: require("@/static/images/chosebm.png"),
  71. addimg: require("@/static/images/addry.png"),
  72. upimg: require("@/static/images/up.png"),
  73. closeimg:require("@/static/images/close.png"),
  74. rimg:require("@/static/images/right.png"),
  75. prolist: [],
  76. wtdt: '',
  77. userName:'',
  78. listite:{
  79. "roleName":'',
  80. "roleId":''
  81. },
  82. rolelist:[],
  83. role:'',
  84. deptId:this.$store.state.user.deptId,
  85. roindex:-1,
  86. roleId:'',
  87. rangekey:"label",
  88. pageNum: 1,
  89. pageSize: 10,
  90. reachflag:true,
  91. deptName:'',
  92. kaYear:'',
  93. kaMonth:'',
  94. selectDate: '',
  95. }
  96. },
  97. components:{
  98. selectPicker,cardList
  99. },
  100. onLoad() {
  101. this.selectDate = this.formatDateTime();
  102. this.getsubordinateList()
  103. },
  104. onReachBottom() {
  105. if (this.reachflag) {
  106. this.pageNum++
  107. this.getsubordinateList()
  108. }
  109. },
  110. methods:{
  111. formatDateTime() {
  112. var date=new Date()
  113. let y = date.getFullYear();
  114. let m = date.getMonth() + 1;
  115. m = m < 10 ? "0" + m : m;
  116. let d = date.getDate();
  117. d = d < 10 ? "0" + d : d;
  118. const time = y + "-" + m ;
  119. this.kaYear=y;
  120. this.kaMonth=m;
  121. return `${y}-${m}`;
  122. },
  123. bindDateChange(e) {
  124. this.selectDate = e.detail.value
  125. var val=e.detail.value.split('-')
  126. this.pageNum=1;
  127. this.prolist=[];
  128. this.kaYear=val[0];
  129. this.kaMonth=val[1]
  130. this.reachflag=true;
  131. this.getsubordinateList()
  132. },
  133. getSearch(){
  134. this.pageNum=1;
  135. this.prolist=[];
  136. this.reachflag=true;
  137. this.getsubordinateList()
  138. },
  139. goDetail(e){
  140. var obj={
  141. userId:e.userId,
  142. recordDate:this.selectDate+'-01'
  143. }
  144. // var obj={
  145. // userId:3,
  146. // recordDate:'2024-10-20'
  147. // }
  148. this.$tab.navigateTo('/work/pages/record/detail?data='+encodeURIComponent(JSON.stringify(obj)))
  149. },
  150. getsubordinateList(){
  151. var that = this;
  152. var params={
  153. // "ancestors":this.$store.state.user.ancestors,
  154. // "kaYear":this.kaYear,
  155. // "kaMonth":this.kaMonth,
  156. // name:this.userName,
  157. pageSize: this.pageSize,
  158. pageNum: this.pageNum,
  159. // deptId:this.$store.state.user.deptId
  160. recordDate:this.selectDate
  161. }
  162. if(this.userName){
  163. params.name=this.userName
  164. }
  165. getClockCountall(params).then(res => {
  166. if (res.code == 200) {
  167. if (res.rows.length < this.pageSize) {
  168. this.reachflag = false
  169. this.wtdt = '到底了~';
  170. } else {
  171. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  172. if (num < res.total) {
  173. this.reachflag = true
  174. this.wtdt = '上拉加载更多'
  175. } else {
  176. this.reachflag = false
  177. this.wtdt = '到底了~';
  178. }
  179. }
  180. if (this.pageNum == 1) {
  181. this.prolist = res.rows;
  182. } else {
  183. this.prolist = this.prolist.concat(res.rows)
  184. }
  185. } else {
  186. this.$toast(res.msg)
  187. }
  188. })
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang="scss" scoped>
  194. .box{height: 100vh;display: flex;flex-direction: column;padding-top: 188rpx;box-sizing: border-box;background-color: #f2f2f2;}
  195. .boxtop{
  196. flex: 0 0 auto;position: fixed;left:0;right: 0;top: 0;z-index: 5;background-color: #FFFFFF;
  197. // padding: 0 34rpx;
  198. .boxtopa{
  199. padding: 14rpx 34rpx;display: flex;align-items: center;box-shadow: 0px 6rpx 12rpx 0px rgba(210,210,210,0.35);
  200. input{height: 64rpx;background: #E6E6E6;border-radius: 28rpx;flex: 1;background: #E6E6E6;padding: 0 30rpx;line-height: 64rpx;
  201. border-radius: 28rpx;font-size: 28rpx;}
  202. view{width: 120rpx;height: 64rpx;background: #1678FF;border-radius: 28rpx;font-size: 28rpx;color: #FFFFFF;margin-left: 8rpx;flex: 0 0 auto;text-align: center;line-height: 64rpx;}
  203. }
  204. .boxtopb{
  205. display: flex;align-items: center;justify-content: space-between;padding: 12rpx 0;
  206. .boxflex{display: flex;align-items: center;
  207. .boxtopba{width: 26rpx;height: 24rpx;margin-right: 16rpx;}
  208. .boxtopbb{font-size: 28rpx;color:#1678FF;margin-right: 16rpx;}
  209. .boxtopbc{width: 14rpx;height: 14rpx;}
  210. .boxtopbd{width: 28rpx;height: 28rpx;margin-right: 16rpx;}
  211. .boxtopbe{font-size: 28rpx;color:#6CBC0A;}
  212. }
  213. }
  214. }
  215. .tab {
  216. .tabs {
  217. .one_tab {
  218. color: #1678FF !important;
  219. }
  220. .one_tabqie {
  221. border-bottom: 8rpx solid #1678FF;
  222. }
  223. }
  224. }
  225. .exele {
  226. flex: 1;display: flex;flex-direction: column;overflow: hidden;
  227. table{border-spacing: 0rpx;height: 100%;display: flex;flex-direction: column;}
  228. .tr_one {
  229. display: flex;
  230. flex: 0 0 auto;
  231. // padding: 0 20rpx;
  232. box-sizing: border-box;
  233. justify-content: space-between;
  234. th {
  235. font-size: 30rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #000000;
  239. overflow: hidden;
  240. text-overflow: ellipsis;
  241. white-space: nowrap;
  242. line-height: 78rpx;
  243. height: 78rpx;
  244. box-sizing: border-box;
  245. }
  246. }
  247. .two_tr {
  248. display: flex;
  249. // padding: 0 20rpx;
  250. box-sizing: border-box;
  251. justify-content: space-between;
  252. td {
  253. font-size: 30rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. color: #343434;
  257. min-height: 82rpx;
  258. padding: 20rpx 0;
  259. box-sizing: border-box;
  260. display: flex;
  261. align-items: center;
  262. justify-content: center;
  263. }
  264. // .tdse {
  265. // color: #E60012 !important;
  266. // }
  267. // .apply_span_xl{
  268. // color: #32B16C !important;
  269. // }
  270. // .apply_span_xltwo{
  271. // color: #ffa200 !important;
  272. // }
  273. // .apply_span_xlfive{
  274. // color: #4c4b4b !important;
  275. // }
  276. // .apply_span_xlthreo{
  277. // color: #f00404 !important;
  278. // }
  279. // .apply_span_xlforu{
  280. // color: #aaaaaa !important;
  281. // }
  282. // .coiu {
  283. // color: #EC1717;
  284. // }
  285. }
  286. .two_trtwo {
  287. background-color: #F2F2F2;
  288. }
  289. .scroll-view{flex: 1;overflow-y: auto;}
  290. }
  291. .zanwu {text-align: center;
  292. padding-top: 20upx;
  293. span {
  294. font-size: 30upx;
  295. }}
  296. // 搜索条件width: 562rpx;
  297. .bgbox{position: fixed;left: 0;right: 0;top: 0;bottom: 0;z-index: 19;
  298. background: rgba(0,0,0,0.5);}
  299. .sfixed{min-height: 760rpx;background: #FFFFFF;border-radius: 14rpx;padding: 40rpx 34rpx;box-sizing: border-box;position: fixed;left: 60rpx;right: 60rpx;top: 50%;transform: translateY(-50%);
  300. z-index: 29;max-height: calc(100vh - 280rpx);overflow-y: auto;
  301. .sfixed_tit{font-size: 28rpx;font-weight: bold;color: #343434;line-height: 44rpx;text-align: center;}
  302. .sfixed_clo{width: 20rpx;height: 20rpx;position: absolute;left: 34rpx;top: 44rpx;}
  303. .sfixed_box{
  304. padding-top: 20rpx;
  305. margin-bottom: 80rpx;
  306. .sfixed_inp{width: 100%;height: 76rpx;background:#F2F2F2;padding: 0 34rpx;box-sizing: border-box;font-size: 34rpx;color: #333333;margin-top: 30rpx;}
  307. }
  308. .sfixed_btn{width: 100%;height: 76rpx;border: 0px solid #00B034;border-radius: 6rpx;font-size: 28rpx;
  309. color: #FFFFFF;text-align: center;line-height: 76rpx;
  310. &.btn1{background: #1678FF;color: #FFFFFF;}
  311. &.btn2{border: 2rpx solid #F02828;color: #F02828;margin-top: 28rpx;}
  312. }
  313. }
  314. .address{
  315. display: flex;align-items: center;
  316. padding: 24rpx 0;
  317. .addtita{flex: 0 0 auto;font-size: 28rpx;font-weight: bold;
  318. color: #343434;}
  319. .addressa{
  320. display: flex;align-items: center;
  321. flex: 1;
  322. display: flex;align-items: center;justify-content: flex-end;
  323. overflow: hidden;
  324. .addsa{font-size: 28rpx;color: #333333;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
  325. flex: 1;text-align: right;
  326. }
  327. .addsimg{width: 10rpx;height: 18rpx;margin-left: 10rpx;flex: 0 0 auto;}
  328. // .adds{
  329. // display: flex;align-items: center;justify-content: flex-start;padding:10rpx 20rpx;min-width: 220rpx;box-sizing: border-box;}
  330. }
  331. .addclear{color: #EA2929;font-size: 28rpx;flex: 0 0 auto;height: 60rpx;line-height: 60rpx;width: 128rpx;text-align:center}
  332. }
  333. .approva_header {
  334. height: 80rpx;
  335. picker {
  336. padding: 0 34rpx;
  337. display: flex;
  338. align-items: center;
  339. height: 40px;
  340. image:nth-child(1) {
  341. width: 26rpx;
  342. height: 26rpx;
  343. }
  344. image:nth-child(3) {
  345. width: 14rpx;
  346. height: 14rpx;
  347. }
  348. text {
  349. font-size: 30rpx;
  350. font-family: PingFang SC;
  351. font-weight: 400;
  352. color: #1678FF;
  353. margin: 0 14rpx;
  354. }
  355. }
  356. }
  357. </style>