Index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view class="container">
  3. <view class="headerBox">
  4. <image class="headerImg" src="/pagesCare/static/img/Employ/areaIcon.png"></image>
  5. <view class="headerTxt">
  6. <text>所属区域:</text>
  7. <text style="color: #000;">{{areaName}}</text>
  8. </view>
  9. </view>
  10. <view class="contentBox">
  11. <view class="userBox">
  12. <view class="userItemBox" v-for="(item, index) in areaUserData" :key="index">
  13. <view class="userItem" @tap="toChoose(item)">
  14. <image :src="objChoose.id == item.id ? '/pagesCare/static/img/Employ/userBg_sel.png' : '/pagesCare/static/img/Employ/userBg.png'" class="userItemBGImg" mode="widthFix"></image>
  15. <text class="userItemText" :class="objChoose.id == item.id ? 'userItemTextActive' : ''">{{item.name}}</text>
  16. </view>
  17. </view>
  18. <view class="noneTips" v-show="areaUserData.length == 0">暂无数据</view>
  19. </view>
  20. </view>
  21. <view class="fway-btnBox" v-show="areaUserData.length > 0">
  22. <button class="fway-btn" @tap="onConfirm">确定</button>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. var that;
  28. export default {
  29. data() {
  30. return {
  31. areaID: '',
  32. areaName: '',
  33. areaUserData: [],
  34. objChoose: null,
  35. }
  36. },
  37. onLoad(options) {
  38. that = this;
  39. that.areaID = decodeURIComponent(options.areaID);
  40. that.areaName = decodeURIComponent(options.areaName);
  41. that.onGetAreaUserData()
  42. },
  43. methods: {
  44. onGetAreaUserData(fun) {
  45. that.$admin.reqDirect({
  46. method: 'GET',
  47. url: '/api/v1/Snapshot/practitioner?AreaId=' + that.areaID
  48. }).then(res => {
  49. if (res && res.length > 0) {
  50. that.areaUserData = res;
  51. }
  52. typeof fun === 'function' && fun();
  53. }, err => {
  54. that.$util.msg(err);
  55. })
  56. },
  57. toChoose(obj){
  58. that.objChoose = obj;
  59. },
  60. onConfirm(){
  61. if (that.objChoose){
  62. that.$admin.reqDirect({
  63. method: 'GET',
  64. url: '/api/v1/Snapshot/practitioner/' + that.objChoose.id
  65. }).then(res => {
  66. if (res) {
  67. let str = JSON.stringify(res);
  68. that.objChoose = null;
  69. uni.navigateTo({
  70. url: '/pagesCare/Employ/View?obj=' + encodeURIComponent(str)
  71. })
  72. }
  73. typeof fun === 'function' && fun();
  74. }, err => {
  75. that.$util.msg(err);
  76. })
  77. }else {
  78. that.$util.msg("请选择您要查看的人员");
  79. }
  80. }
  81. }
  82. }
  83. </script>
  84. <style>
  85. .container {
  86. background-color: #f3f3f3;
  87. }
  88. .headerBox{
  89. margin: 30rpx;
  90. display: flex;
  91. justify-content: left;
  92. align-items: center;
  93. }
  94. .headerImg{
  95. width: 40rpx;
  96. height: 40rpx;
  97. margin-right: 20rpx;
  98. }
  99. .headerTxt{
  100. font-size: 40rpx;
  101. color: #555;
  102. }
  103. .contentBox{
  104. height: calc(100% - 260rpx);
  105. overflow-y: auto;
  106. }
  107. .userBox{
  108. padding: 20rpx 0;
  109. margin: 0 30rpx;
  110. background-color: #fff;
  111. border-radius: 20rpx;
  112. border-top: 2rpx #3e6ffd solid;
  113. }
  114. .userItemBox{
  115. display: inline-block;
  116. vertical-align: middle;
  117. width: calc(50% - 60rpx);
  118. margin: 20rpx 30rpx;
  119. }
  120. .userItem{
  121. position: relative;
  122. }
  123. .userItemBGImg{
  124. width: 100%;
  125. height: 100%;
  126. }
  127. .userItemText{
  128. position: absolute;
  129. bottom: 35%;
  130. left: 0rpx;
  131. width: calc(100% - 40rpx);
  132. padding: 0 20rpx;
  133. text-align: center;
  134. font-size: 40rpx;
  135. line-height: 42rpx;
  136. color: #000;
  137. }
  138. .userItemTextActive{
  139. color: #fff;
  140. }
  141. .fway-btnBox{
  142. padding: 40rpx 0 20rpx;
  143. }
  144. .fway-btn{
  145. height: 90rpx;
  146. line-height: 90rpx;
  147. border-radius: 30rpx;
  148. width: calc(100% - 60rpx);
  149. font-size: 40rpx;
  150. }
  151. .noneTips{
  152. text-align: center;
  153. color: #555;
  154. font-size: 36rpx;
  155. padding: 50rpx 0;
  156. }
  157. </style>