StaffList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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">
  9. <div class="staff-head">
  10. <span class="inline-block" :class="{'active': switchType === 'info'}" @click="setSwitchType('info')">员工信息</span>
  11. <span v-show="isAdmin" class="inline-block" :class="{'active': switchType === 'Audit'}" @click="setSwitchType('Audit')">审核绑定</span>
  12. </div>
  13. <div class="staff-record" v-if="switchType === 'info'">
  14. <div class="search-content clearfix">
  15. <div class="search">
  16. <!--<input type="text" placeholder="卖家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">-->
  17. <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" class="staff-search">
  18. <!--<span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>-->
  19. <span><i class="iconfont icon-sousuo"></i></span>
  20. </div>
  21. <div class="search-filter">
  22. <div class="select-wrap">全部角色<i class="iconfont icon-arrow-down"></i></div>
  23. <ul class="select-list" v-if="false">
  24. <li>全部角色</li>
  25. <li>管理员</li>
  26. <li>店长</li>
  27. <li>普通用户</li>
  28. <li>销售员</li>
  29. <li>任意测试</li>
  30. </ul>
  31. </div>
  32. </div>
  33. <div class="list-content">
  34. <div class="bg" v-for="item in staffData">
  35. <div class="staff-list">
  36. <div class="list-item"><span>UU账号:</span><span v-text="item.userUU">100000721</span></div>
  37. <div class="list-item"><span>姓名:</span><span v-text="item.userName">张洪别</span></div>
  38. <div class="list-item"><span>性别:</span><span v-text="item.userSex === 'F' ? '女' : item.userSex === 'M' ? '男' : '-'">男</span></div>
  39. <div class="list-item"><span>手机号:</span><span v-text="item.userTel">12345678901</span></div>
  40. <div class="list-item"><span>邮箱:</span><span v-text="item.userEmail">12345678901</span></div>
  41. <div class="list-item"><span>角色:</span><span class="role" v-for="role in item.roles" v-text="role.desc ? role.desc.slice(0,2) : ''" v-bind:class="'bg' + role.color">普通</span></div>
  42. </div>
  43. <div class="list-footer">
  44. <nuxt-link tag="div" :to="'/mobile/user/staff/edit'" class="edit handle" v-bind:class="{'no-allow': (item.userUU === userInfo.userUU)}"><i class="iconfont icon-edit"></i><span>编辑</span></nuxt-link>
  45. <div class="delete handle" v-bind:class="{'no-allow': (item.userUU === userInfo.userUU)}"><i class="iconfont icon-lajitong"></i><span>删除</span></div>
  46. </div>
  47. </div>
  48. </div>
  49. <nuxt-link class="staff-add" :to="'/mobile/user/staff/add'"><i class="iconfont icon-add"></i>新增用户</nuxt-link>
  50. </div>
  51. <div class="staff-record" v-if="switchType === 'Audit'">
  52. <div class="search-content">
  53. <!--<input type="text" placeholder="卖家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">-->
  54. <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" v-model="auditSearch">
  55. <!--<span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>-->
  56. <span><i class="iconfont icon-sousuo"></i></span>
  57. </div>
  58. <div class="list-content">
  59. <div class="bg" v-for="item in auditBind">
  60. <div class="staff-list">
  61. <div class="list-item"><span>用户名:</span><span>{{item}}}</span></div>
  62. <div class="list-item"><span>UU账号:</span><span>100000721</span></div>
  63. <div class="list-item"><span>手机号:</span><span>12345678901</span></div>
  64. <div class="list-item"><span>邮箱:</span><span>12345678901</span></div>
  65. </div>
  66. <div class="list-footer">
  67. <div class="edit handle"><i class="iconfont icon-check-circle"></i><span>同意</span></div>
  68. <div class="handle delete"><i class="iconfont icon-close-circle"></i><span>拒绝</span></div>
  69. </div>
  70. </div>
  71. </div>
  72. <div>{{auditBind}}</div>
  73. </div>
  74. <!--<seek-list :keyword="remindKeyword" :isSearch="isSearch" :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData"></seek-list>-->
  75. <!--<pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>-->
  76. </div>
  77. </div>
  78. </template>
  79. <script>
  80. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  81. import { BaseFilter } from '~components/mobile/base'
  82. export default {
  83. layout: 'mobile',
  84. data () {
  85. return {
  86. remindText: '',
  87. timeoutCount: '',
  88. page: 1,
  89. count: 10,
  90. auditSearch: '',
  91. switchType: 'info'
  92. }
  93. },
  94. components: {
  95. RemindBox,
  96. PullUp,
  97. EmptyStatus,
  98. BaseFilter
  99. },
  100. watch: {
  101. // 'buyerAccount': {
  102. // handler: function (val) {
  103. // if (val && val.content) {
  104. // if (this.isChange) {
  105. // this.accountList = []
  106. // this.isChange = false
  107. // }
  108. // this.accountList = [...this.accountList, ...val.content]
  109. // }
  110. // }
  111. },
  112. computed: {
  113. staffData () {
  114. return this.$store.state.staff.infoList.info.data.content
  115. },
  116. auditBind () {
  117. console.log(this.$store.state.staff.infoList.audit.data, '13')
  118. return this.$store.state.staff.infoList.audit.data.content
  119. },
  120. userInfo () {
  121. return this.$store.state.option.user.data
  122. }
  123. },
  124. fetch ({ store }) {
  125. return Promise.all([
  126. store.dispatch('staff/bindAudit', {size: this.count, page: this.page, speaceUU: this.user.userUU, status: 311, keyword: this.auditSearch})
  127. ])
  128. },
  129. methods: {
  130. setSwitchType (type) {
  131. this.switchType = type
  132. this.$http.get('/api/userspace/apply/info/mall?count=10&page=1&speaceUU=10049698&status=311')
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss">
  138. $base-color: #3f84f6;
  139. #mobile-staff-center {
  140. .staff-head {
  141. height: .82rem;
  142. line-height: .82rem;
  143. text-align: center;
  144. background: #fff;
  145. span {
  146. font-size: .29rem;
  147. &:first-child {
  148. margin-right: 2.6rem;
  149. }
  150. &.active {
  151. color: $base-color;
  152. border-bottom: 1px solid $base-color;
  153. }
  154. }
  155. }
  156. .staff-record {
  157. .search-content {
  158. padding: .25rem 0;
  159. text-align: center;
  160. input {
  161. width: 6.9rem;
  162. border: 1px solid #376ff3;
  163. }
  164. .staff-search {
  165. width: 5.31rem;
  166. }
  167. .search {
  168. float: left;
  169. }
  170. .search-filter {
  171. float: left;
  172. margin-left: .35rem;
  173. position: relative;
  174. .select-wrap {
  175. width: 1.45rem;
  176. height: .58rem;
  177. line-height: .58rem;
  178. background-color: #ffffff;
  179. border-radius: .06rem;
  180. border: solid 1px #b4b4b4;
  181. i{
  182. font-size: .1rem;
  183. font-weight: bold;
  184. color: $base-color;
  185. }
  186. }
  187. ul.select-list{
  188. width: 1.45rem;
  189. position: absolute;
  190. left: 0rem;
  191. top: .59rem;
  192. border: solid 1px #b4b4b4;
  193. border-top: none;
  194. -webkit-box-shadow: 0 1px 5px 0 #aaa;
  195. box-shadow: 0 1px 5px 0 #aaa;
  196. border-radius: .04rem;
  197. li{
  198. background: #fff;
  199. text-align: left;
  200. padding: 0 .13rem;
  201. font-size: .28rem;
  202. height: .53rem;
  203. line-height: .53rem;
  204. }
  205. }
  206. }
  207. }
  208. .list-content{
  209. margin: 0 auto;
  210. padding: 0 .20rem;
  211. div.bg{
  212. padding: .32rem .24rem 0 .24rem;
  213. margin-bottom: .25rem;
  214. width: 7.1rem;
  215. background: #fff;
  216. border-radius: .05rem;
  217. }
  218. .staff-list {
  219. width: 100%;
  220. .list-item {
  221. margin-bottom: .24rem;
  222. &:last-child{
  223. padding-bottom: 0;
  224. }
  225. span {
  226. display: inline-block;
  227. font-size: .28rem;
  228. &:first-child {
  229. width: 1.3rem;
  230. text-align: right;
  231. color: #3f84f6;
  232. }
  233. &:last-child {
  234. color: #666;
  235. }
  236. }
  237. span.role{
  238. display: inline-block;
  239. padding: 0 .05rem;
  240. height: .25rem;
  241. line-height: .25rem;
  242. text-align: center;
  243. font-size: .24rem;
  244. color: #fff;
  245. border-radius: .04rem;
  246. }
  247. span.role.bg1{
  248. background-color: #89aefa;
  249. }
  250. span.role.bg2{
  251. background-color: #01d9ce;
  252. }
  253. span.role.bg3{
  254. background-color: #01d9ce;
  255. }
  256. span.role.bg4{
  257. background-color: #ff6769;
  258. }
  259. span.role.bg5{
  260. background-color: #ff8050;
  261. }
  262. }
  263. }
  264. .list-footer {
  265. width: 100%;
  266. height: .8rem;
  267. line-height: .8rem;
  268. background: #fff;
  269. border-top: 1px solid #d9d9d9;
  270. div.handle{
  271. float: left;
  272. width: 50%;
  273. margin: 0 auto;
  274. text-align: center;
  275. span{
  276. font-size: .26rem;
  277. color: #333;
  278. }
  279. i.iconfont {
  280. margin-right: .06rem;
  281. font-size: .36rem;
  282. color: #333;
  283. }
  284. }
  285. div.edit{
  286. border-right: 1px solid #d9d9d9;
  287. }
  288. div.no-allow {
  289. color: #606168;
  290. cursor: not-allowed;
  291. }
  292. }
  293. }
  294. .staff-add {
  295. display: inline-block;
  296. position: fixed;
  297. bottom: 1.2rem;
  298. left: 50%;
  299. margin-left: -3.29rem;
  300. width: 6.59rem;
  301. height: .77rem;
  302. line-height: .77rem;
  303. text-align: center;
  304. font-size: .32rem;
  305. color: #fff;
  306. background-color: #3f84f6;
  307. border-radius: 0.08rem;
  308. i{
  309. margin-right: .1rem;
  310. font-size: .32rem;
  311. color: #fff;
  312. }
  313. }
  314. }
  315. }
  316. </style>