StaffEdit.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <!--<template>-->
  2. <!--<div class="seek">-->
  3. <!--<div class="com-mobile-header mobile-center-header">-->
  4. <!--<a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>-->
  5. <!--<p>编辑角色</p>-->
  6. <!--<p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>-->
  7. <!--</div>-->
  8. <!--<div class="mobile-fix-content mobile-centerfix-content" id="mobile-staff-center" v-if="roles">-->
  9. <!--<div v-for="(role, index) in roles">-->
  10. <!--<div class="staff-role">-->
  11. <!--<div class="staff-header"><span :class="'active_0' + role.color"><b></b>{{role.desc}}</span></div>-->
  12. <!--<div class="staff-content">-->
  13. <!--<label class="radio-label clearfix" @click.stop="checkRole(role, index)">-->
  14. <!--<input type="checkbox" :id="role.id" :checked="role.checked"/>-->
  15. <!--<label :for="role.id" v-bind:class="{'margin0': role.color === '4' || role.color === '2'}"></label>-->
  16. <!--<p class="staff-des">{{role.duty}}</p>-->
  17. <!--</label>-->
  18. <!--</div>-->
  19. <!--</div>-->
  20. <!--</div>-->
  21. <!--<div class="staff-footer" v-if="roles || roles.length > 0">-->
  22. <!--<div class="cancel handle" @click="cancelBind">取消</div>-->
  23. <!--<div class="agree handle" @click="sureEdit">确定</div>-->
  24. <!--</div>-->
  25. <!--</div>-->
  26. <!--<remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>-->
  27. <!--</div>-->
  28. <!--</template>-->
  29. <!--<script>-->
  30. <!--import { RemindBox } from '~components/mobile/common'-->
  31. <!--export default {-->
  32. <!--data () {-->
  33. <!--return {-->
  34. <!--checked: false,-->
  35. <!--roles: [],-->
  36. <!--remindText: '',-->
  37. <!--timeoutCount: 0-->
  38. <!--}-->
  39. <!--},-->
  40. <!--components: {-->
  41. <!--RemindBox-->
  42. <!--},-->
  43. <!--computed: {-->
  44. <!--currentData () {-->
  45. <!--return this.baseUtils.deepCopy(this.$store.state.staff.infoList.edit.data) || []-->
  46. <!--}-->
  47. <!--},-->
  48. <!--mounted () {-->
  49. <!--// 获取角色-->
  50. <!--this.$nextTick(() => {-->
  51. <!--this.getRoles()-->
  52. <!--})-->
  53. <!--},-->
  54. <!--methods: {-->
  55. <!--// 获取角色-->
  56. <!--getRoles () {-->
  57. <!--this.$http.get('/account/role')-->
  58. <!--.then(response => {-->
  59. <!--if (response.data) {-->
  60. <!--this.roles = response.data-->
  61. <!--for (let i = 0; i < this.currentData.roles.length; i++) {-->
  62. <!--for (let j = 0; j < this.roles.length; j++) {-->
  63. <!--//判断已绑定角色-->
  64. <!--if (this.currentData.roles[i].id === this.roles[j].id) {-->
  65. <!--this.roles[j].checked = true-->
  66. <!--}-->
  67. <!--}-->
  68. <!--}-->
  69. <!--}-->
  70. <!--})-->
  71. <!--},-->
  72. <!--// 选择角色-->
  73. <!--checkRole (role, index) {-->
  74. <!--role.checked = !role.checked-->
  75. <!--for (let i = 0; i < this.currentData.roles.length; i++) {-->
  76. <!--if (role.checked) {-->
  77. <!--console.log('1')-->
  78. <!--this.currentData.roles.push(role)-->
  79. <!--} else {-->
  80. <!--console.log('0')-->
  81. <!--this.currentData.roles.splice(index,1)-->
  82. <!--}-->
  83. <!--}-->
  84. <!--},-->
  85. <!--// 取消编辑-->
  86. <!--cancelBind () {-->
  87. <!--this.$router.push('/mobile/user/staff')-->
  88. <!--},-->
  89. <!--// 确定编辑-->
  90. <!--sureEdit () {-->
  91. <!--this.$http.put(`/basic/user/updaterole`, this.currentData)-->
  92. <!--.then(() => {-->
  93. <!--this.onRemind('角色编辑成功')-->
  94. <!--this.$router.push('/mobile/user/staff')-->
  95. <!--})-->
  96. <!--},-->
  97. <!--onRemind: function (str) {-->
  98. <!--this.remindText = str-->
  99. <!--this.timeoutCount ++-->
  100. <!--}-->
  101. <!--}-->
  102. <!--}-->
  103. <!--</script>-->
  104. <!--<style lang="scss">-->
  105. <!--$base-color: #3f84f6;-->
  106. <!--#mobile-staff-center {-->
  107. <!--padding-bottom: .5rem;-->
  108. <!--margin: 0 auto;-->
  109. <!--.staff-role{-->
  110. <!--margin: .2rem auto 0;-->
  111. <!--padding: 0 .24rem;-->
  112. <!--width: 7.1rem;-->
  113. <!--height: 1.72rem;-->
  114. <!--background-color: #fff;-->
  115. <!--border-radius: .05rem;-->
  116. <!--.staff-header {-->
  117. <!--height: .5rem;-->
  118. <!--line-height: .5rem;-->
  119. <!--text-align: left;-->
  120. <!--border-bottom: 1px solid #d9d9d9;-->
  121. <!--span {-->
  122. <!--font-size: .28rem;-->
  123. <!--color: #333;-->
  124. <!--b{-->
  125. <!--display: inline-block;-->
  126. <!--margin-right: .05rem;-->
  127. <!--width: .05rem;-->
  128. <!--height: .18rem;-->
  129. <!--background-color: #3f84f6;-->
  130. <!--}-->
  131. <!--}-->
  132. <!--span.active_02 b{-->
  133. <!--background-color: #8aaefc;-->
  134. <!--}-->
  135. <!--span.active_03 b{-->
  136. <!--background-color: #09d7cd;-->
  137. <!--}-->
  138. <!--span.active_04 b{-->
  139. <!--background-color: #ff676a;-->
  140. <!--}-->
  141. <!--span.active_05 b{-->
  142. <!--background-color: #fc9b68;-->
  143. <!--}-->
  144. <!--}-->
  145. <!--.staff-content {-->
  146. <!--padding-top: .25rem;-->
  147. <!--.radio-label {-->
  148. <!--background-size: contain;-->
  149. <!--vertical-align: middle;-->
  150. <!--input{-->
  151. <!--float: left;-->
  152. <!--display: none;-->
  153. <!--margin: .18rem .1rem 0 0;-->
  154. <!--width: .36rem;-->
  155. <!--height: .36rem;-->
  156. <!--border: solid 2px #999999;-->
  157. <!--}-->
  158. <!--label {-->
  159. <!--float: left;-->
  160. <!--margin: .18rem .1rem 0 0;-->
  161. <!--width: .36rem;-->
  162. <!--height: .36rem;-->
  163. <!--border-radius: 50%;-->
  164. <!--background: url(/images/mobile/center/user/car-noChecked.png) no-repeat;-->
  165. <!--background-size: contain;-->
  166. <!--vertical-align: middle;-->
  167. <!--}-->
  168. <!--label.margin0 {-->
  169. <!--margin: 0.05rem .1rem 0 0;-->
  170. <!--}-->
  171. <!--input:checked + label {-->
  172. <!--background-image: url(/images/mobile/center/user/car-checked.png);-->
  173. <!--}-->
  174. <!--input.checked + label {-->
  175. <!--background-image: url(/images/mobile/center/user/car-checked.png);-->
  176. <!--}-->
  177. <!--}-->
  178. <!--.staff-des{-->
  179. <!--float: left;-->
  180. <!--width: 6rem;-->
  181. <!--line-height: .42rem;-->
  182. <!--font-weight: normal;-->
  183. <!--font-size: .28rem;-->
  184. <!--color: #666666;-->
  185. <!--}-->
  186. <!--}-->
  187. <!--}-->
  188. <!--.staff-footer{-->
  189. <!--overflow: hidden;-->
  190. <!--margin-top: .6rem;-->
  191. <!--div.handle{-->
  192. <!--float: left;-->
  193. <!--width: 3.24rem;-->
  194. <!--height: .77rem;-->
  195. <!--line-height: .77rem;-->
  196. <!--font-size: .32rem;-->
  197. <!--color: #fff;-->
  198. <!--text-align: center;-->
  199. <!--border-radius: .08rem;-->
  200. <!--&:first-child{-->
  201. <!--margin: 0 .28rem 0 .35rem;-->
  202. <!--background-color: #acaaab;-->
  203. <!--}-->
  204. <!--&:last-child{-->
  205. <!--background-color: #3f84f6;-->
  206. <!--}-->
  207. <!--}-->
  208. <!--}-->
  209. <!--}-->
  210. <!--</style>-->