cardlist.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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">
  131. <view class="flexc">
  132. <view class="tit flex1">{{ite.locations}}</view>
  133. <view class="clistr" @click="getDetail(ite.dutyId)">
  134. <image :src="updataimg"></image>
  135. </view>
  136. </view>
  137. <view class="flex clista">
  138. <view class="flex0">考勤规则:</view>
  139. <view class="flex1 clistat">
  140. <view>上班时间{{ite.startWorkTime}}</view>
  141. <!-- <view v-if="ite.kaNum==4">下班时间{{ite.kaTimeAmOut}}</view>
  142. <view v-if="ite.kaNum==4">上班时间{{ite.kaTimePmIn}}</view> -->
  143. <view>下班时间{{ite.endWorkTime}}</view>
  144. </view>
  145. </view>
  146. </view>
  147. </block>
  148. <!-- 打卡详情 -->
  149. <block v-if="type==6">
  150. <view class="cardb" v-for="(ite,idx) in datainfo" :key="idx">
  151. <view class="flexc">
  152. <view class="cardb_ta">{{ite.kaTime}}</view>
  153. <view class="line"></view>
  154. <view class="cardb_tb">{{weeks[ite.kaWeek]}}</view>
  155. </view>
  156. <view class="flex clista">
  157. <view class="flex0">打卡时间:</view>
  158. <view class="flex1 clistat">
  159. <view>
  160. <text class="time">{{ite.kaTimeAmIn||'上班'}}</text>
  161. <block v-if="ite.kaTypeAmIn==2"><text class="cor2">迟到</text></block>
  162. <block v-else-if="ite.kaTypeAmIn==3"><text class="cor3">外勤</text></block>
  163. <block v-else-if="ite.kaTypeAmIn==4"><text class="cor4">早退</text></block>
  164. <text v-else-if="ite.kaTypeAmIn==5" class="cor5">未打卡</text>
  165. <text v-else class="cor5">未打卡</text>
  166. </view>
  167. <view><text class="time">{{ite.kaTimeAmOut||'下班'}}</text>
  168. <block v-if="ite.kaTypeAmOut==2"><text class="cor2">迟到</text></block>
  169. <block v-else-if="ite.kaTypeAmOut==3"><text class="cor3">外勤</text></block>
  170. <block v-else-if="ite.kaTypeAmOut==4"><text class="cor4">早退</text></block>
  171. <text v-else-if="ite.kaTypeAmOut==5" class="cor5">未打卡</text>
  172. <text v-else class="cor5">未打卡</text>
  173. </view>
  174. <view><text class="time">{{ite.kaTimePmIn||'上班'}}</text>
  175. <block v-if="ite.kaTypePmIn==2"><text class="cor2">迟到</text></block>
  176. <block v-else-if="ite.kaTypePmIn==3"><text class="cor3">外勤</text></block>
  177. <block v-else-if="ite.kaTypePmIn==4"><text class="cor4">早退</text></block>
  178. <text v-else-if="ite.kaTypePmIn==5" class="cor5">未打卡</text>
  179. <text v-else class="cor5">未打卡</text></view>
  180. <view><text class="time">{{ite.kaTimePmOut||'下班'}}</text>
  181. <block v-if="ite.kaTypePmOut==2"><text class="cor2">迟到</text></block>
  182. <block v-else-if="ite.kaTypePmOut==3"><text class="cor3">外勤</text></block>
  183. <block v-else-if="ite.kaTypePmOut==4"><text class="cor4">早退</text></block>
  184. <text v-else-if="ite.kaTypePmOut==5" class="cor5">未打卡</text>
  185. <text v-else class="cor5">未打卡</text>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </block>
  191. <!-- 角色管理 -->
  192. <!-- <block v-if="type==7">
  193. <view class=" flexc mb10 rolebox" :class="checkflag?'roleboxtrans':''" v-for="(ite,idx) in datainfo" :key="idx" @click="getChose(idx)">
  194. <view class="datachek flex0" v-if="checkflag">
  195. <image :src="choseimg" v-if="ite.check"></image>
  196. <image :src="chosenimg" v-else></image>
  197. </view>
  198. <view class="clist flex" style="margin-bottom: 0;width: 682rpx;flex: 1 0 auto;">
  199. <view class="flex1">
  200. <view class="flex mb16">
  201. <view class="tit">{{ite.roleName}}</view>
  202. </view>
  203. <view class="txt">角色编号:{{ite.roleId}}</view>
  204. <view class="txt">角色权限:{{ite.roleKey}}</view>
  205. <view class="txt">状态:{{ite.status == null? '' : ite.status=='0'?'正常':'停用' }}
  206. </view>
  207. </view>
  208. <view class="clistr" @click.stop="getDetail(ite)">
  209. <image :src="updataimg"></image>
  210. </view>
  211. </view>
  212. </view>
  213. </block> -->
  214. <view class="shax">{{wtdt}}</view>
  215. </block>
  216. <!-- 无数据 -->
  217. <view class="nodata" v-else>
  218. <image :src="noiconpimg"></image>
  219. <view>
  220. 暂无数据
  221. </view>
  222. </view>
  223. </view>
  224. </template>
  225. <script>
  226. export default{
  227. props:{
  228. datainfo: {
  229. type: Array,
  230. default () {
  231. return []
  232. }
  233. },
  234. rolelist:{ //角色
  235. type: Array,
  236. default () {
  237. return []
  238. }
  239. },
  240. wtdt:{
  241. type:String,
  242. default () {
  243. return ''
  244. }
  245. },
  246. type:{
  247. type:String,
  248. default () {
  249. return 0
  250. }
  251. },
  252. checkflag:{
  253. type:Boolean,
  254. default () {
  255. return false
  256. }
  257. }
  258. },
  259. data(){
  260. return{
  261. headimg:require("@/work/static/clock/nhead.png"),
  262. updataimg:require("@/work/static/clock/upimg.png"),
  263. noiconpimg:require("@/work/static/clock/noiconp.png"),
  264. supdataimg:require("@/work/static/clock/updata.png"),
  265. upimg:require("@/work/static/clock/upe.png"),
  266. downimg:require("@/work/static/clock/down.png"),
  267. foldidx:-1,
  268. list:[{tit:'董事会',children:[{tit:'行政部'},{tit:'行政部1'}]},{tit:'董事会1',children:[{tit:'行政部'},{tit:'行政部1'}]}],
  269. weeks: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
  270. }
  271. },
  272. mounted() {
  273. console.log(this.datainfo)
  274. },
  275. methods:{
  276. getDetail(e){
  277. this.$emit('getdetail',e)
  278. },
  279. getFold(idx){
  280. if(this.foldidx==idx){
  281. this.foldidx=-1
  282. }else{
  283. this.foldidx=idx
  284. }
  285. },
  286. getChose(idx){
  287. this.datainfo[idx].check=!this.datainfo[idx].check;
  288. var newKarr=[]
  289. var newArr=this.datainfo;
  290. newArr.forEach((ite,idx)=>{
  291. if(ite.check){
  292. newKarr.push(ite.roleId)
  293. }
  294. })
  295. this.$emit("getChose",newKarr)
  296. }
  297. }
  298. }
  299. </script>
  300. <style lang="scss" scoped>
  301. .cardbox{padding:32rpx 34rpx 0;}
  302. .flex{display: flex;}
  303. .flexc{display: flex;align-items: center;}
  304. .mb10{margin-bottom: 20rpx;}
  305. .clist{background: #FFFFFF;
  306. box-shadow: 0px 4rpx 6rpx 0px rgba(189,189,189,0.35);margin-bottom: 20rpx;
  307. border-radius: 10rpx;padding: 32rpx 24rpx 20rpx 36rpx;
  308. .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;}
  309. .mb16{margin-bottom: 32rpx;}
  310. .mb14{margin-bottom: 28rpx;}
  311. .tit{font-size: 30rpx;font-weight: bold;color: #343434;}
  312. .trole{margin-left: 20rpx;height: 38rpx;background: #E9EFFD;font-size: 30rpx;font-weight: 500;color: #667087;padding: 0 12rpx;line-height: 38rpx;}
  313. .txt{font-size: 30rpx;color: #343434;line-height: 32rpx;margin-bottom: 16rpx;}
  314. .clistr{width: 48rpx;height: 48rpx;display: flex;justify-content: center;
  315. image{width: 8rpx;height: 32rpx;}
  316. }
  317. }
  318. .clista{padding:20rpx 0 12rpx;
  319. .clistat{display: flex;flex-wrap: wrap;
  320. view{width: 50%;}
  321. }
  322. view{font-size: 30rpx;color: #343434;line-height: 48rpx;}
  323. }
  324. .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;
  325. .cardb_ta{font-weight: bold;color: #343434;font-size: 32rpx;}
  326. .line{margin: 0 22rpx;width: 2rpx;height: 26rpx;background-color: #CDCDCD;}
  327. .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;}
  328. .cardb_b{display: flex;flex-wrap: wrap;
  329. view{padding: 10rpx 0;font-size: 30rpx;color: #343434;width: 50%;}
  330. .cor4{color: $uni-katype4;}
  331. .cor3{color: $uni-katype3;}
  332. .cor2{color: $uni-katype2;}
  333. .cor5{color: $uni-katype5;}
  334. .cor34{color: #343434;}
  335. .time{display: inline-block;}
  336. }
  337. }
  338. .cardc{
  339. .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;
  340. &.nextb{background: #D6E2F2;}
  341. .cardc_tb{font-weight: 500;font-size: 34rpx;color: #343434;margin-right: 6rpx;
  342. &.nexta{padding-left: 20rpx;font-weight: 500;}
  343. }
  344. .cardc_tc{width: 48rpx;height: 48rpx;display: flex;justify-content: center;align-items: center;
  345. .cardc_timg{width: 28rpx;height: 28rpx;}
  346. .cardc_timga{width: 24rpx;height: 16rpx; transform: rotate(180deg);
  347. transition: all .5s;}
  348. .cardc_timgb{width: 10rpx;height: 38rpx;}
  349. }
  350. }
  351. .cardc_td{height: 0rpx;overflow: hidden;}
  352. }
  353. .cont_tflex{padding:20rpx 0 14rpx;justify-content: center;
  354. .cont_tftit{font-size: 28rpx;color: #666666;margin-bottom: 20rpx;}
  355. .cont_tftxt{font-size: 34rpx;
  356. &.cor1{color:$uni-katype1;}
  357. &.cor2{color:$uni-katype2;}
  358. &.cor3{color:$uni-katype3;}
  359. &.cor4{color:$uni-katype4;}
  360. &.cor5{color:$uni-katype5;}
  361. }
  362. }
  363. .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;
  364. image{width: 40rpx;height: 40rpx;}
  365. }
  366. .rolebox{transition: all .5s;margin-left: 0rpx;position: relative;}
  367. .roleboxtrans{margin-left: 60rpx;}
  368. // 无数据
  369. .nodata{
  370. padding-top: 200rpx;display: flex;flex-direction: column;align-items: center;
  371. image{width: 472rpx;height: 308rpx;margin-bottom: 48rpx;}
  372. view{font-size: 30rpx;color: #343434;font-weight: bold;}
  373. }
  374. </style>