cardlist.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <view class="cardbox">
  3. <!-- 第一种样式 人员管理-->
  4. <block v-if="datainfo.length>0">
  5. <block v-if="type==1">
  6. <view class="clist flex" v-for="(ite,idx) in datainfo" :key="idx">
  7. <!-- <image :src="ite.avatar?ite.avatar:headimg" class="clist_head"></image> -->
  8. <view class="clist_head">
  9. {{ite.nickName.substring(0, 1)}}
  10. </view>
  11. <!-- <image :src="ite.avatar?ite.avatar:headimg" class="clist_head"></image> -->
  12. <view class="flex1">
  13. <view class="flex mb14">
  14. <view class="tit">{{ite.nickName}}</view>
  15. <!-- <view class="trole">普通用户</view> -->
  16. </view>
  17. <view class="txt">所在部门:<block v-if="ite.dept">{{ite.dept.deptName}}</block></view>
  18. <view class="txt">手机号码:{{ite.phonenumber}}</view>
  19. <view class="txt">角色:
  20. <text v-for="(it,ids) in ite.roles">
  21. {{it.roleName}}<block v-if="ids!=ite.roles.length-1">/</block>
  22. </text>
  23. </view>
  24. </view>
  25. <view class="clistr" @click="getDetail(ite.userId)">
  26. <image :src="updataimg"></image>
  27. </view>
  28. </view>
  29. </block>
  30. <!-- 考勤记录 -->
  31. <block v-if="type==2">
  32. <!-- 记录详情 -->
  33. <view class="cardb" v-for="(ite,idx) in datainfo" :key="idx" @click="getDetail(ite)">
  34. <view class="mb10 flexc">
  35. <view class="cardb_ta">{{ite.kaTime}}</view>
  36. <view class="line"></view>
  37. <view class="cardb_tb">{{weeks[ite.kaWeek]}}</view>
  38. </view>
  39. <view class="cardb_b">
  40. <view>
  41. <text class="time">{{ite.kaTimeAmIn||'上班'}}</text>
  42. <block v-if="ite.kaTypeAmIn==2"><text class="cor2">迟到</text>打卡</block>
  43. <block v-else-if="ite.kaTypeAmIn==3"><text class="cor3">外勤</text>打卡</block>
  44. <block v-else-if="ite.kaTypeAmIn==4"><text class="cor4">早退</text>打卡</block>
  45. <text v-else-if="ite.kaTypeAmIn==5" class="cor5">未打卡</text>
  46. <text v-else class="cor5">未打卡</text>
  47. </view>
  48. <view><text class="time">{{ite.kaTimeAmOut||'下班'}}</text>
  49. <block v-if="ite.kaTypeAmOut==2"><text class="cor2">迟到</text>打卡</block>
  50. <block v-else-if="ite.kaTypeAmOut==3"><text class="cor3">外勤</text>打卡</block>
  51. <block v-else-if="ite.kaTypeAmOut==4"><text class="cor4">早退</text>打卡</block>
  52. <text v-else-if="ite.kaTypeAmOut==5" class="cor5">未打卡</text>
  53. <text v-else class="cor5">未打卡</text>
  54. </view>
  55. <view><text class="time">{{ite.kaTimePmIn||'上班'}}</text>
  56. <block v-if="ite.kaTypePmIn==2"><text class="cor2">迟到</text>打卡</block>
  57. <block v-else-if="ite.kaTypePmIn==3"><text class="cor3">外勤</text>打卡</block>
  58. <block v-else-if="ite.kaTypePmIn==4"><text class="cor4">早退</text>打卡</block>
  59. <text v-else-if="ite.kaTypePmIn==5" class="cor5">未打卡</text>
  60. <text v-else class="cor5">未打卡</text></view>
  61. <view><text class="time">{{ite.kaTimePmOut||'下班'}}</text>
  62. <block v-if="ite.kaTypePmOut==2"><text class="cor2">迟到</text>打卡</block>
  63. <block v-else-if="ite.kaTypePmOut==3"><text class="cor3">外勤</text>打卡</block>
  64. <block v-else-if="ite.kaTypePmOut==4"><text class="cor4">早退</text>打卡</block>
  65. <text v-else-if="ite.kaTypePmOut==5" class="cor5">未打卡</text>
  66. <text v-else class="cor5">未打卡</text>
  67. </view>
  68. </view>
  69. </view>
  70. </block>
  71. <!-- 部门管理 -->
  72. <view class="cardc" v-if="type=='3'">
  73. <view v-for="(ite,idx) in datainfo">
  74. <view class="cardc_ta flexc">
  75. <view class="flexc flex1">
  76. <view class="cardc_tb">{{ite.deptName}}</view>
  77. <view class="cardc_tc" @click="getDetail(ite)">
  78. <image :src="supdataimg" class="cardc_timg"></image>
  79. </view>
  80. </view>
  81. <view class="cardc_tc" @click.stop="getFold(idx)">
  82. <image :src="upimg" class="cardc_timga" :style="foldidx==idx?'transform: rotate(0deg);':''"></image>
  83. </view>
  84. </view>
  85. <!-- 下级部门 -->
  86. <view class="cardc_td" :style="foldidx==idx?'height:auto':''">
  87. <view class="cardc_ta flexc nextb" v-for="(it,ix) in ite.children">
  88. <view class="cardc_tb nexta flex1">{{it.deptName}}</view>
  89. <view class="cardc_tc" @click="getDetail(it)">
  90. <image :src="updataimg" class="cardc_timgb"></image>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <!-- 打卡记录统计 -->
  97. <block v-if="type=='count'">
  98. <view class="clist" v-for="(ite,idx) in datainfo" style="padding-left: 28rpx;padding-right: 28rpx;">
  99. <view class="clistc flex">
  100. <view class="flex flex1">
  101. <view class="tit">{{ite.name}}</view>
  102. <!-- <view class="trole">普通用户</view> -->
  103. </view>
  104. <view class="clistr" @click="getDetail(ite)">
  105. <image :src="updataimg"></image>
  106. </view>
  107. </view>
  108. <view class="flexc">
  109. <view class="cont_tflex flex1" >
  110. <view class="cont_tftit tc">迟到</view>
  111. <view class="cont_tftxt tc">{{ite.cd||0}}</view>
  112. </view>
  113. <view class="cont_tflex flex1" >
  114. <view class="cont_tftit tc">早退</view>
  115. <view class="cont_tftxt tc">{{ite.zt||0}}</view>
  116. </view>
  117. <view class="cont_tflex flex1" >
  118. <view class="cont_tftit tc">外勤</view>
  119. <view class="cont_tftxt tc">{{ite.wq||0}}</view>
  120. </view>
  121. <view class="cont_tflex flex1" >
  122. <view class="cont_tftit tc">未打卡</view>
  123. <view class="cont_tftxt tc">{{ite.wdk||0}}</view>
  124. </view>
  125. </view>
  126. </view>
  127. </block>
  128. <!-- 考勤规则 -->
  129. <block v-if="type=='rule'">
  130. <view class="clist" v-for="(ite,idx) in datainfo" :key="idx" style="padding-left: 20rpx;padding-rignt:20rpx" @click="getDetail(ite.dutyId)">
  131. <view class="flexc">
  132. <view class="tit flex1" v-if="ite.isEquip=='Y'">打卡机使用</view>
  133. <view class="tit flex1" v-else>{{ite.locations}}</view>
  134. <view class="clistr" v-if="checkPermi(['system:schedule:remove'])" @click.stop="getDelFn(ite.dutyId)">
  135. <image :src="updataimg"></image>
  136. </view>
  137. </view>
  138. <view class="flex clista">
  139. <view class="flex0">考勤规则:</view>
  140. <view class="flex1 clistat">
  141. <view>上班时间{{ite.startWorkTime}}</view>
  142. <!-- <view v-if="ite.kaNum==4">下班时间{{ite.kaTimeAmOut}}</view>
  143. <view v-if="ite.kaNum==4">上班时间{{ite.kaTimePmIn}}</view> -->
  144. <view>下班时间{{ite.endWorkTime}}</view>
  145. </view>
  146. </view>
  147. </view>
  148. </block>
  149. <!-- 打卡详情 -->
  150. <block v-if="type==6">
  151. <view class="cardb" v-for="(ite,idx) in datainfo" :key="idx">
  152. <view class="flexc">
  153. <view class="cardb_ta">{{ite.kaTime}}</view>
  154. <view class="line"></view>
  155. <view class="cardb_tb">{{weeks[ite.kaWeek]}}</view>
  156. </view>
  157. <view class="flex clista">
  158. <view class="flex0">打卡时间:</view>
  159. <view class="flex1 clistat">
  160. <view>
  161. <text class="time">{{ite.kaTimeAmIn||'上班'}}</text>
  162. <block v-if="ite.kaTypeAmIn==2"><text class="cor2">迟到</text></block>
  163. <block v-else-if="ite.kaTypeAmIn==3"><text class="cor3">外勤</text></block>
  164. <block v-else-if="ite.kaTypeAmIn==4"><text class="cor4">早退</text></block>
  165. <text v-else-if="ite.kaTypeAmIn==5" class="cor5">未打卡</text>
  166. <text v-else class="cor5">未打卡</text>
  167. </view>
  168. <view><text class="time">{{ite.kaTimeAmOut||'下班'}}</text>
  169. <block v-if="ite.kaTypeAmOut==2"><text class="cor2">迟到</text></block>
  170. <block v-else-if="ite.kaTypeAmOut==3"><text class="cor3">外勤</text></block>
  171. <block v-else-if="ite.kaTypeAmOut==4"><text class="cor4">早退</text></block>
  172. <text v-else-if="ite.kaTypeAmOut==5" class="cor5">未打卡</text>
  173. <text v-else class="cor5">未打卡</text>
  174. </view>
  175. <view><text class="time">{{ite.kaTimePmIn||'上班'}}</text>
  176. <block v-if="ite.kaTypePmIn==2"><text class="cor2">迟到</text></block>
  177. <block v-else-if="ite.kaTypePmIn==3"><text class="cor3">外勤</text></block>
  178. <block v-else-if="ite.kaTypePmIn==4"><text class="cor4">早退</text></block>
  179. <text v-else-if="ite.kaTypePmIn==5" class="cor5">未打卡</text>
  180. <text v-else class="cor5">未打卡</text></view>
  181. <view><text class="time">{{ite.kaTimePmOut||'下班'}}</text>
  182. <block v-if="ite.kaTypePmOut==2"><text class="cor2">迟到</text></block>
  183. <block v-else-if="ite.kaTypePmOut==3"><text class="cor3">外勤</text></block>
  184. <block v-else-if="ite.kaTypePmOut==4"><text class="cor4">早退</text></block>
  185. <text v-else-if="ite.kaTypePmOut==5" class="cor5">未打卡</text>
  186. <text v-else class="cor5">未打卡</text>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </block>
  192. <!-- 角色管理 -->
  193. <!-- <block v-if="type==7">
  194. <view class=" flexc mb10 rolebox" :class="checkflag?'roleboxtrans':''" v-for="(ite,idx) in datainfo" :key="idx" @click="getChose(idx)">
  195. <view class="datachek flex0" v-if="checkflag">
  196. <image :src="choseimg" v-if="ite.check"></image>
  197. <image :src="chosenimg" v-else></image>
  198. </view>
  199. <view class="clist flex" style="margin-bottom: 0;width: 682rpx;flex: 1 0 auto;">
  200. <view class="flex1">
  201. <view class="flex mb16">
  202. <view class="tit">{{ite.roleName}}</view>
  203. </view>
  204. <view class="txt">角色编号:{{ite.roleId}}</view>
  205. <view class="txt">角色权限:{{ite.roleKey}}</view>
  206. <view class="txt">状态:{{ite.status == null? '' : ite.status=='0'?'正常':'停用' }}
  207. </view>
  208. </view>
  209. <view class="clistr" @click.stop="getDetail(ite)">
  210. <image :src="updataimg"></image>
  211. </view>
  212. </view>
  213. </view>
  214. </block> -->
  215. <view class="shax">{{wtdt}}</view>
  216. </block>
  217. <!-- 无数据 -->
  218. <view class="nodata" v-else>
  219. <image :src="noiconpimg"></image>
  220. <view>
  221. 暂无数据
  222. </view>
  223. </view>
  224. </view>
  225. </template>
  226. <script>
  227. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  228. export default{
  229. props:{
  230. datainfo: {
  231. type: Array,
  232. default () {
  233. return []
  234. }
  235. },
  236. rolelist:{ //角色
  237. type: Array,
  238. default () {
  239. return []
  240. }
  241. },
  242. wtdt:{
  243. type:String,
  244. default () {
  245. return ''
  246. }
  247. },
  248. type:{
  249. type:String,
  250. default () {
  251. return 0
  252. }
  253. },
  254. checkflag:{
  255. type:Boolean,
  256. default () {
  257. return false
  258. }
  259. }
  260. },
  261. data(){
  262. return{
  263. headimg:require("@/work/static/clock/nhead.png"),
  264. updataimg:require("@/work/static/clock/upimg.png"),
  265. noiconpimg:require("@/work/static/clock/noiconp.png"),
  266. supdataimg:require("@/work/static/clock/updata.png"),
  267. upimg:require("@/work/static/clock/upe.png"),
  268. downimg:require("@/work/static/clock/down.png"),
  269. foldidx:-1,
  270. list:[{tit:'董事会',children:[{tit:'行政部'},{tit:'行政部1'}]},{tit:'董事会1',children:[{tit:'行政部'},{tit:'行政部1'}]}],
  271. weeks: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  272. }
  273. },
  274. mounted() {
  275. // console.log(this.datainfo)
  276. },
  277. methods:{
  278. checkPermi, checkRole,
  279. getDetail(e){
  280. this.$emit('getdetail',e)
  281. },
  282. getDelFn(id){
  283. var that=this;
  284. uni.showModal({
  285. title: '确认删除',
  286. content: "是否确认删除该考勤设置",
  287. cancelText: '取消',
  288. confirmText: '确认',
  289. success: function(res) {
  290. if (res.confirm) {
  291. that.$emit("getDelFn",id)
  292. } else if (res.cancel) {
  293. // console.log('用户点击取消');
  294. }
  295. }
  296. });
  297. },
  298. getFold(idx){
  299. if(this.foldidx==idx){
  300. this.foldidx=-1
  301. }else{
  302. this.foldidx=idx
  303. }
  304. },
  305. getChose(idx){
  306. this.datainfo[idx].check=!this.datainfo[idx].check;
  307. var newKarr=[]
  308. var newArr=this.datainfo;
  309. newArr.forEach((ite,idx)=>{
  310. if(ite.check){
  311. newKarr.push(ite.roleId)
  312. }
  313. })
  314. this.$emit("getChose",newKarr)
  315. }
  316. }
  317. }
  318. </script>
  319. <style lang="scss" scoped>
  320. .cardbox{padding:32rpx 34rpx 0;}
  321. .flex{display: flex;}
  322. .flexc{display: flex;align-items: center;}
  323. .mb10{margin-bottom: 20rpx;}
  324. .clist{background: #FFFFFF;
  325. box-shadow: 0px 4rpx 6rpx 0px rgba(189,189,189,0.35);margin-bottom: 20rpx;
  326. border-radius: 10rpx;padding: 32rpx 24rpx 20rpx 36rpx;
  327. .clist_head{width: 56rpx;height: 56rpx;margin-right: 26rpx;flex: 0 0 auto;background: #1678FF;display: flex;align-items: center;justify-content: center;font-size: 32rpx;color: #FFFFFF;border-radius: 12rpx;}
  328. .mb16{margin-bottom: 32rpx;}
  329. .mb14{margin-bottom: 28rpx;}
  330. .tit{font-size: 30rpx;font-weight: bold;color: #343434;}
  331. .trole{margin-left: 20rpx;height: 38rpx;background: #E9EFFD;font-size: 30rpx;font-weight: 500;color: #667087;padding: 0 12rpx;line-height: 38rpx;}
  332. .txt{font-size: 30rpx;color: #343434;line-height: 32rpx;margin-bottom: 16rpx;}
  333. .clistr{width: 48rpx;height: 48rpx;display: flex;justify-content: center;
  334. image{width: 8rpx;height: 32rpx;}
  335. }
  336. }
  337. .clista{padding:20rpx 0 12rpx;
  338. .clistat{display: flex;flex-wrap: wrap;
  339. view{width: 50%;}
  340. }
  341. view{font-size: 30rpx;color: #343434;line-height: 48rpx;}
  342. }
  343. .cardb{background: #FFFFFF;box-shadow: 0px 4rpx 6rpx 0px rgba(189,189,189,0.35);border-radius: 10rpx;padding:36rpx 30rpx 20rpx;margin-bottom: 20rpx;
  344. .cardb_ta{font-weight: bold;color: #343434;font-size: 32rpx;}
  345. .line{margin: 0 22rpx;width: 2rpx;height: 26rpx;background-color: #CDCDCD;}
  346. .cardb_tb{height: 38rpx;background: #00B034;border-radius: 6rpx;min-width: 98rpx;padding: 0 12rpx;box-sizing: border-box;font-size: 32rpx;color: #FFFFFF;line-height: 38rpx;}
  347. .cardb_b{display: flex;flex-wrap: wrap;
  348. view{padding: 10rpx 0;font-size: 30rpx;color: #343434;width: 50%;}
  349. .cor4{color: $uni-katype4;}
  350. .cor3{color: $uni-katype3;}
  351. .cor2{color: $uni-katype2;}
  352. .cor5{color: $uni-katype5;}
  353. .cor34{color: #343434;}
  354. .time{display: inline-block;}
  355. }
  356. }
  357. .cardc{
  358. .cardc_ta{background: #FFFFFF;box-shadow: 0px 4rpx 6rpx 0px rgba(189,189,189,0.35);border-radius: 10rpx;padding: 0 24rpx 0 36rpx;min-height: 84rpx;box-sizing: border-box;margin-bottom: 24rpx;
  359. &.nextb{background: #D6E2F2;}
  360. .cardc_tb{font-weight: 500;font-size: 34rpx;color: #343434;margin-right: 6rpx;
  361. &.nexta{padding-left: 20rpx;font-weight: 500;}
  362. }
  363. .cardc_tc{width: 48rpx;height: 48rpx;display: flex;justify-content: center;align-items: center;
  364. .cardc_timg{width: 28rpx;height: 28rpx;}
  365. .cardc_timga{width: 24rpx;height: 16rpx; transform: rotate(180deg);
  366. transition: all .5s;}
  367. .cardc_timgb{width: 10rpx;height: 38rpx;}
  368. }
  369. }
  370. .cardc_td{height: 0rpx;overflow: hidden;}
  371. }
  372. .cont_tflex{padding:20rpx 0 14rpx;justify-content: center;
  373. .cont_tftit{font-size: 28rpx;color: #666666;margin-bottom: 20rpx;}
  374. .cont_tftxt{font-size: 34rpx;
  375. &.cor1{color:$uni-katype1;}
  376. &.cor2{color:$uni-katype2;}
  377. &.cor3{color:$uni-katype3;}
  378. &.cor4{color:$uni-katype4;}
  379. &.cor5{color:$uni-katype5;}
  380. }
  381. }
  382. .datachek{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 32rpx;position: absolute;left: -60rpx;top:50%;margin-top: -20rpx;
  383. image{width: 40rpx;height: 40rpx;}
  384. }
  385. .rolebox{transition: all .5s;margin-left: 0rpx;position: relative;}
  386. .roleboxtrans{margin-left: 60rpx;}
  387. // 无数据
  388. .nodata{
  389. padding-top: 200rpx;display: flex;flex-direction: column;align-items: center;
  390. image{width: 472rpx;height: 308rpx;margin-bottom: 48rpx;}
  391. view{font-size: 30rpx;color: #343434;font-weight: bold;}
  392. }
  393. </style>