teamuser2.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  5. <block slot="backText">返回</block>
  6. <block slot="content">用户详情</block>
  7. </cu-custom>
  8. <!-- list列表 -->
  9. <view class="cu-list menu">
  10. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  11. <view class="content">
  12. <text class="text-grey">头像</text>
  13. </view>
  14. <view class="action">
  15. <view class="cu-avatar round sm" :style="{backgroundImage: 'url(' + personalMsg.avatar + ')'}"></view>
  16. </view>
  17. </view>
  18. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
  19. <view class="content">
  20. <text class="text-grey">账号</text>
  21. </view>
  22. <view class="action">
  23. <text class="text-grey">{{personalMsg.username}}</text>
  24. </view>
  25. </view>
  26. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.3s'}]">
  27. <view class="content">
  28. <text class="text-grey">工号</text>
  29. </view>
  30. <view class="action">
  31. <text class="text-grey">{{personalMsg.workNo}}</text>
  32. </view>
  33. </view>
  34. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.4s'}]">
  35. <view class="content">
  36. <text class="text-grey">姓名</text>
  37. </view>
  38. <view class="action">
  39. <text class="text-grey">{{personalMsg.realname}}</text>
  40. </view>
  41. </view>
  42. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
  43. <view class="content">
  44. <text class="text-grey">性别</text>
  45. </view>
  46. <view class="action">
  47. <text class="text-grey">{{personalMsg.sex}}</text>
  48. </view>
  49. </view>
  50. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.6s'}]">
  51. <view class="content">
  52. <text class="text-grey">英文名</text>
  53. </view>
  54. <view class="action">
  55. <text class="text-grey">{{personalMsg.egName}}</text>
  56. </view>
  57. </view>
  58. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.7s'}]">
  59. <view class="content">
  60. <text class="text-grey">职位</text>
  61. </view>
  62. <view class="action">
  63. <text class="text-grey">{{personalMsg.post}}</text>
  64. </view>
  65. </view>
  66. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.8s'}]">
  67. <view class="content">
  68. <text class="text-grey">部门</text>
  69. </view>
  70. <view class="action">
  71. <text class="text-grey">{{personalMsg.orgCodeTxt}}</text>
  72. </view>
  73. </view>
  74. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.9s'}]">
  75. <view class="content">
  76. <text class="text-grey">邮箱</text>
  77. </view>
  78. <view class="action">
  79. <text class="text-grey">{{personalMsg.email}}</text>
  80. </view>
  81. </view>
  82. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1s'}]">
  83. <view class="content">
  84. <text class="text-grey">手机号码</text>
  85. </view>
  86. <view class="action">
  87. <text class="text-grey">{{personalMsg.phone}}</text>
  88. </view>
  89. </view>
  90. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.1s'}]">
  91. <view class="content">
  92. <text class="text-grey">出生日期</text>
  93. </view>
  94. <view class="action">
  95. <text class="text-grey">{{personalMsg.birthday}}</text>
  96. </view>
  97. </view>
  98. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.2s'}]">
  99. <view class="content">
  100. <text class="text-grey">入职日期</text>
  101. </view>
  102. <view class="action">
  103. <text class="text-grey">{{personalMsg.entryDate}}</text>
  104. </view>
  105. </view>
  106. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.3s'}]">
  107. <view class="content">
  108. <text class="text-grey">紧急联系人</text>
  109. </view>
  110. <view class="action">
  111. <text class="text-grey">{{personalMsg.urgentName}}</text>
  112. </view>
  113. </view>
  114. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.4s'}]">
  115. <view class="content">
  116. <text class="text-grey">联系人电话</text>
  117. </view>
  118. <view class="action">
  119. <text class="text-grey">{{personalMsg.urgentPhone}}</text>
  120. </view>
  121. </view>
  122. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.5s'}]">
  123. <view class="content">
  124. <text class="text-grey">当前可用年假</text>
  125. </view>
  126. <view class="action">
  127. <text class="text-grey">{{personalMsg.availableDay/24}}天</text>
  128. </view>
  129. </view>
  130. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.6s'}]">
  131. <view class="content">
  132. <text class="text-grey">当前剩余调休</text>
  133. </view>
  134. <view class="action">
  135. <text class="text-grey">{{personalMsg.leaveDate}}小时</text>
  136. </view>
  137. </view>
  138. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '1.7s'}]">
  139. <view class="content">
  140. <text class="text-grey">考勤记录</text>
  141. </view>
  142. <view class="action">
  143. <span style="float: right;" v-if='personalMsg.sum=="2"' @click="sign()">本月无异常</span>
  144. <span style="float: right;color: red;" v-if='personalMsg.sum=="1"' @click="sign()">
  145. 本月有异常
  146. </span>
  147. </view>
  148. </view>
  149. </view>
  150. </scroll-view>
  151. </view>
  152. </template>
  153. <script>
  154. import api from '@/api/api'
  155. export default {
  156. data() {
  157. return {
  158. personalMsg:{
  159. avatar:'',
  160. realname:'',
  161. username:'',
  162. post:'',
  163. depart:'',
  164. phone:'',
  165. workNo:'',
  166. birthday:'',
  167. email:'',
  168. sex:'',
  169. egName:'',
  170. birthDate:'',
  171. entryDate:'',
  172. urgentName:'',
  173. urgentPhone:'',
  174. availableDay:'',
  175. orgCodeTxt:'',
  176. leaveDate:'',
  177. sum:''
  178. },
  179. userUrl:'/sys/user/queryById',
  180. positionUrl:'/sys/position/list',
  181. departUrl:'/sys/user/userDepartList'
  182. };
  183. },
  184. created() {
  185. this.loadinfo();
  186. },methods:{
  187. getSubStringText(text,len){
  188. if(!text || text.length==0){
  189. return ''
  190. }
  191. if(text.length<len){
  192. return text;
  193. }
  194. return text.substr(0,len)+"..."
  195. },
  196. rightClick(){
  197. this.$Router.push({name:'useredit', params:this.personalMsg})
  198. /* uni.navigateTo({
  199. url: '/pages/user/useredit?item='+item
  200. }); */
  201. },loadinfo(){
  202. this.$http.get(this.userUrl,{params:{id:this.$store.getters.tmsUserId}}).then(res=> {
  203. console.log("用户",res)
  204. if (res.statusCode==200) {
  205. let result = res.data.data
  206. let avatar=(result.avatar && result.avatar.length > 0)? api.getFileAccessHttpUrl(result.avatar):'/static/avatar_boy.png'
  207. this.personalMsg.avatar = avatar
  208. this.personalMsg.realname = result.realname
  209. this.personalMsg.username = result.username
  210. this.personalMsg.post = result.post
  211. this.personalMsg.depart = result.departIds
  212. this.personalMsg.phone=result.phone
  213. this.personalMsg.workNo=result.workNo
  214. this.personalMsg.birthday=result.birthday
  215. this.personalMsg.email=result.email
  216. if(result.sex==1){
  217. this.personalMsg.sex='男';
  218. }else{
  219. this.personalMsg.sex='女';
  220. }
  221. this.personalMsg.egName=result.egName
  222. this.personalMsg.birthDate=result.birthDate
  223. this.personalMsg.entryDate=result.entryDate
  224. this.personalMsg.urgentName=result.urgentName
  225. this.personalMsg.urgentPhone=result.urgentPhone
  226. if(res.data.sign!="" &&res.data.sign!=undefined){
  227. this.personalMsg.availableDay=res.data.sign.availableDay
  228. this.personalMsg.leaveDate=res.data.sign.leaveDate
  229. }
  230. this.personalMsg.orgCodeTxt=result.orgCodeTxt
  231. this.personalMsg.sum=res.data.sum
  232. }
  233. }).catch(e=>{
  234. console.log("请求错误",e)
  235. })
  236. },
  237. /* queryshow(){
  238. var orgCode=this.$store.getters.orgCode;
  239. if(orgCode=="A01B92")
  240. this.isshow=true;
  241. }, */
  242. /* load(){
  243. this.$http.get(this.userUrl,{params:{id:this.$store.getters.tmsUserId}}).then(res=>{
  244. console.log("res",res)
  245. let perArr = res.data.data;
  246. let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
  247. this.personalList.avatar =avatar
  248. this.personalList.realname = perArr.realname
  249. this.personalList.username = perArr.username
  250. this.personalList.post = perArr.post
  251. this.personalList.depart = perArr.departIds
  252. this.personalList.phone=perArr.phone
  253. this.personalList.workNo=perArr.workNo
  254. this.personalList.birthday=perArr.birthday
  255. this.personalList.email=perArr.email
  256. this.personalList.sex=perArr.sex
  257. this.personalList.egName=perArr.egName
  258. this.personalList.birthDate=perArr.birthDate
  259. this.personalList.entryDate=perArr.entryDate
  260. this.personalList.urgentName=perArr.urgentName
  261. this.personalList.urgentPhone=perArr.urgentPhone
  262. this.personalList.id=perArr.id
  263. if(res.data.sign.length>0&&res.data.sign[0].availableDay!=null){
  264. this.personalList.availableDay=res.data.sign[0].availableDay
  265. }
  266. if(res.data.sign.length>0&&res.data.sign[0].leaveDate!=null){
  267. this.personalList.leaveDate=res.data.sign[0].leaveDate
  268. }
  269. this.personalList.orgCodeTxt=perArr.orgCodeTxt
  270. this.personalList.sum=res.data.sum
  271. }).catch(err => {
  272. console.log(err);
  273. });
  274. },
  275. ret(){
  276. this.$Router.push({name:'teames'})
  277. }, */
  278. sign(s){
  279. this.$store.commit('SET_NPMUSER',{id:s,date:''});
  280. this.$Router.push({name:'teamusersign'})
  281. }
  282. }
  283. }
  284. </script>
  285. <style>
  286. .panl{
  287. }
  288. .card{
  289. background-color: #FFFFFF;
  290. width: 95%;
  291. height: 100px;
  292. margin: 0 auto;
  293. border-radius:5px 5px 5px 5px;
  294. box-shadow:0 4px 8px 0 rgba(255, 255, 255, 0.2),0 6px 20px 0 rgba(255, 255, 255, 0.2);
  295. }
  296. .imgs{
  297. width: 60px;
  298. height: 60px;
  299. border-radius:50%;
  300. }
  301. .fontColr{
  302. color: #0081FF;
  303. font-size: 13px;
  304. }
  305. .s{
  306. list-style-type:none;
  307. margin-left: -20px;
  308. }
  309. .fontColrs{
  310. color: #A3A7B1;
  311. }
  312. .ic{
  313. width: 20px;
  314. height: 20px;
  315. margin-left: 10px;
  316. }
  317. .top{
  318. background-color: #5677AC;
  319. width: 100%;
  320. height: 40px;
  321. }
  322. </style>