personal.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view>
  3. <block>
  4. <view style="height: 10px;" />
  5. <user :list="[detail]" />
  6. </block>
  7. <displayCell :showList="showList" :detail="detail" />
  8. <view style="height: 70px;" />
  9. <view class="footer">
  10. <block v-if="userType == 1">
  11. <navigator class="insert" style="flex:1;margin-right: 0;" v-if="detail.iswechatbind == 0"
  12. :url="'/team/userCenter/wechatbind?id=' + detail.sys_enterprise_hrid + '&name=' + detail.name">
  13. 绑定微信
  14. </navigator>
  15. <view v-else class="invite" style="flex: 1;" @click="setStatus" hover-class="navigator-hover">
  16. {{ detail.status == '停用' ? '启用' : '停用' }}
  17. </view>
  18. </block>
  19. <block v-else>
  20. <navigator class="insert" v-if="detail.iswechatbind == 0"
  21. :url="'/team/userCenter/wechatbind?id=' + detail.sys_enterprise_hrid + '&name=' + detail.name">
  22. 绑定微信
  23. </navigator>
  24. <view class="invite" style="flex: 1;" @click="toEdit" hover-class="navigator-hover">
  25. 编辑
  26. </view>
  27. </block>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import user from "../../components/userList.vue"
  33. export default {
  34. components: { user },
  35. data() {
  36. return {
  37. sys_enterprise_hrid: 0,
  38. detail: {
  39. userid: 0
  40. },
  41. showList: [],
  42. userType: 0,
  43. }
  44. },
  45. onLoad(options) {
  46. console.log("options", options)
  47. this.userType = uni.getStorageSync('userMsg').usertype;
  48. this.sys_enterprise_hrid = options.id;
  49. uni.setNavigationBarTitle({
  50. title: '人员信息'
  51. });
  52. this.getDetail()
  53. },
  54. onUnload() {
  55. delete this.$Http.uploadUserDetail;
  56. },
  57. methods: {
  58. getDetail() {
  59. this.$Http.basic({
  60. "id": "20240411085402",
  61. "content": {
  62. "sys_enterprise_hrid": this.sys_enterprise_hrid
  63. }
  64. }).then(res => {
  65. console.log("门店人员信息", res)
  66. if (this.cutoff(res.msg)) return;
  67. this.detail = res.data;
  68. this.showList = [{
  69. label: "姓名",
  70. key: "name"
  71. }, {
  72. label: "手机号",
  73. key: "phonenumber"
  74. }, {
  75. label: "性别",
  76. key: "sex"
  77. }, {
  78. label: "生日",
  79. key: "birthday"
  80. }, {
  81. label: "邮箱",
  82. key: "email"
  83. }, {
  84. label: "店内职位",
  85. key: "position"
  86. }, {
  87. label: "角色",
  88. key: "rolenames"
  89. }, {
  90. label: "人员类型",
  91. value: res.isleader ? '主账号' : '子账号'
  92. }, {
  93. label: "所属门店",
  94. key: "storenames"
  95. }]
  96. })
  97. },
  98. toEdit() {
  99. this.$Http.uploadUserDetail = this.getDetail.bind(this);
  100. uni.navigateTo({
  101. url: '/team/userCenter/insert?title=编辑人员&data=' + JSON.stringify(this.detail)
  102. });
  103. },
  104. setStatus() {
  105. let detail = this.detail,
  106. that = this;
  107. uni.showModal({
  108. title: '提醒',
  109. content: `确定${detail.status == '停用' ? '启用' : '停用'}“${detail.name}”账号吗?`,
  110. success: ({ confirm }) => {
  111. if (confirm) that.$Http.basic({
  112. "id": "20240428091402",
  113. "content": {
  114. "enable": detail.status == '停用' ? 1 : 0,
  115. "userid": detail.userid
  116. }
  117. }).then(res => {
  118. if (that.cutoff(res.msg, (detail.status == '停用' ? '启用' : '停用') + '成功!')) return;
  119. that.getDetail()
  120. that.$Http.uploadUserList && that.$Http.uploadUserList();
  121. })
  122. },
  123. })
  124. }
  125. },
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. .footer {
  130. position: fixed;
  131. bottom: 0;
  132. display: flex;
  133. justify-content: space-between;
  134. width: 100vw;
  135. height: 65px;
  136. background: #FFFFFF;
  137. box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
  138. padding: 5px 10px;
  139. box-sizing: border-box;
  140. .insert {
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. width: 168px;
  145. height: 45px;
  146. background: #FFFFFF;
  147. border-radius: 5px;
  148. border: 1px solid #999999;
  149. font-family: PingFang SC, PingFang SC;
  150. font-size: 16px;
  151. color: #666666;
  152. box-sizing: border-box;
  153. margin-right: 10px;
  154. }
  155. .invite {
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. width: 177px;
  160. height: 45px;
  161. background: #C30D23;
  162. border-radius: 5px;
  163. font-family: PingFang SC, PingFang SC;
  164. font-weight: 500;
  165. font-size: 16px;
  166. color: #FFFFFF;
  167. }
  168. }
  169. </style>