StaffList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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">
  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. <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'"></empty-status>
  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. userInfo () {
  117. return this.$store.state.option.user.data
  118. }
  119. },
  120. // fetch ({ store }) {
  121. // return Promise.all([
  122. // store.dispatch('staff/bindAudit', {size: this.count, page: this.page, speaceUU: this.user.userUU, status: 311, keyword: this.auditSearch})
  123. // ])
  124. // },
  125. methods: {
  126. setSwitchType (type) {
  127. this.switchType = type
  128. this.$http({
  129. method: 'get',
  130. baseURL: process.env.ssoUrl,
  131. url: `/api/userspace/apply/info/mall`,
  132. data: {
  133. count: 10,
  134. page: 1,
  135. speaceUU: 10049698,
  136. status: 311
  137. }
  138. }).then(res => {
  139. console.log('1', res.data)
  140. }, err => {
  141. console.log('12', err)
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style lang="scss">
  148. $base-color: #3f84f6;
  149. #mobile-staff-center {
  150. .staff-head {
  151. height: .82rem;
  152. line-height: .82rem;
  153. text-align: center;
  154. background: #fff;
  155. span {
  156. font-size: .29rem;
  157. &:first-child {
  158. margin-right: 2.6rem;
  159. }
  160. &.active {
  161. color: $base-color;
  162. border-bottom: 1px solid $base-color;
  163. }
  164. }
  165. }
  166. .staff-record {
  167. .search-content {
  168. padding: .25rem 0;
  169. text-align: center;
  170. input {
  171. width: 6.9rem;
  172. border: 1px solid #376ff3;
  173. }
  174. .staff-search {
  175. width: 5.31rem;
  176. }
  177. .search {
  178. float: left;
  179. }
  180. .search-filter {
  181. float: left;
  182. margin-left: .35rem;
  183. position: relative;
  184. .select-wrap {
  185. width: 1.45rem;
  186. height: .58rem;
  187. line-height: .58rem;
  188. background-color: #ffffff;
  189. border-radius: .06rem;
  190. border: solid 1px #b4b4b4;
  191. i{
  192. font-size: .1rem;
  193. font-weight: bold;
  194. color: $base-color;
  195. }
  196. }
  197. ul.select-list{
  198. width: 1.45rem;
  199. position: absolute;
  200. left: 0rem;
  201. top: .59rem;
  202. border: solid 1px #b4b4b4;
  203. border-top: none;
  204. -webkit-box-shadow: 0 1px 5px 0 #aaa;
  205. box-shadow: 0 1px 5px 0 #aaa;
  206. border-radius: .04rem;
  207. li{
  208. background: #fff;
  209. text-align: left;
  210. padding: 0 .13rem;
  211. font-size: .28rem;
  212. height: .53rem;
  213. line-height: .53rem;
  214. }
  215. }
  216. }
  217. }
  218. .list-content{
  219. margin: 0 auto;
  220. padding: 0 .20rem;
  221. div.bg{
  222. padding: .32rem .24rem 0 .24rem;
  223. margin-bottom: .25rem;
  224. width: 7.1rem;
  225. background: #fff;
  226. border-radius: .05rem;
  227. }
  228. .staff-list {
  229. width: 100%;
  230. .list-item {
  231. margin-bottom: .24rem;
  232. &:last-child{
  233. padding-bottom: 0;
  234. }
  235. span {
  236. display: inline-block;
  237. font-size: .28rem;
  238. &:first-child {
  239. width: 1.3rem;
  240. text-align: right;
  241. color: #3f84f6;
  242. }
  243. &:last-child {
  244. color: #666;
  245. }
  246. }
  247. span.role{
  248. display: inline-block;
  249. padding: 0 .05rem;
  250. height: .25rem;
  251. line-height: .25rem;
  252. text-align: center;
  253. font-size: .24rem;
  254. color: #fff;
  255. border-radius: .04rem;
  256. }
  257. span.role.bg1{
  258. background-color: #89aefa;
  259. }
  260. span.role.bg2{
  261. background-color: #01d9ce;
  262. }
  263. span.role.bg3{
  264. background-color: #01d9ce;
  265. }
  266. span.role.bg4{
  267. background-color: #ff6769;
  268. }
  269. span.role.bg5{
  270. background-color: #ff8050;
  271. }
  272. }
  273. }
  274. .list-footer {
  275. width: 100%;
  276. height: .8rem;
  277. line-height: .8rem;
  278. background: #fff;
  279. border-top: 1px solid #d9d9d9;
  280. div.handle{
  281. float: left;
  282. width: 50%;
  283. margin: 0 auto;
  284. text-align: center;
  285. span{
  286. font-size: .26rem;
  287. color: #333;
  288. }
  289. i.iconfont {
  290. margin-right: .06rem;
  291. font-size: .36rem;
  292. color: #333;
  293. }
  294. }
  295. div.edit{
  296. border-right: 1px solid #d9d9d9;
  297. }
  298. div.no-allow {
  299. color: #606168;
  300. cursor: not-allowed;
  301. }
  302. }
  303. }
  304. .staff-add {
  305. display: inline-block;
  306. position: fixed;
  307. bottom: 1.2rem;
  308. left: 50%;
  309. margin-left: -3.29rem;
  310. width: 6.59rem;
  311. height: .77rem;
  312. line-height: .77rem;
  313. text-align: center;
  314. font-size: .32rem;
  315. color: #fff;
  316. background-color: #3f84f6;
  317. border-radius: 0.08rem;
  318. i{
  319. margin-right: .1rem;
  320. font-size: .32rem;
  321. color: #fff;
  322. }
  323. }
  324. }
  325. }
  326. </style>