Browse Source

Merge remote-tracking branch 'origin/release-201821-wangcz' into release-201821-wangcz

shenjj 7 years ago
parent
commit
b11024d0c0

+ 2 - 2
assets/scss/mobileCommon.scss

@@ -327,9 +327,9 @@ html {
 //}
 
 /*loading优先级*/
-.loading {
+/*.loading {
   z-index: 100000 !important;
-}
+}*/
 
 .mobile-content {
   padding-top: .88rem !important;

+ 5 - 2
components/common/loading/Loading.vue

@@ -1,5 +1,5 @@
 <template lang="html">
-  <div class="loading" v-show="loading" id="loading">
+  <div class="loading" :class="{'mobile': isMobile}" v-show="loading" id="loading">
     <!--<img src="/images/all/loading.gif" alt="">-->
     <div class="wrap">
       <div class="outer"></div>
@@ -21,7 +21,7 @@
     }
   }
 </script>
-<style scoped>
+<style scoped lang="scss">
   @keyframes spin {
     0%   { transform: rotate(360deg); }
     100% { transform: rotate(0deg); }
@@ -39,6 +39,9 @@
     height: 100%;
     z-index: 1000;
     text-align: center;
+    &.mobile {
+      z-index: 100000 !important;
+     }
   }
 
   .loading img {

+ 6 - 1
components/main/Nav.vue

@@ -41,7 +41,7 @@
       <nuxt-link to="/product/brand/brandList/A" class="item">
         <span>品牌墙</span>
       </nuxt-link>
-      <nuxt-link :to="'/store/' + process.env.pcbId" class="item">
+      <nuxt-link :to="'/store/' + pcbId" class="item">
         <span>PCB专区</span>
       </nuxt-link>
       <nuxt-link to="/news" class="item">
@@ -54,6 +54,11 @@
   import { KindCategory } from '~components/home'
   export default {
     name: 'navView',
+    data () {
+      return {
+        pcbId: process.env.pcbId
+      }
+    },
     components: {
       KindCategory
     },

+ 185 - 67
components/mobile/staffManagement/StaffList.vue

@@ -13,25 +13,19 @@
       <div class="staff-record" v-if="switchType === 'info'">
         <div class="search-content clearfix">
           <div class="search">
-            <!--<input type="text" placeholder="卖家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">-->
-            <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" class="staff-search">
-            <!--<span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>-->
-            <span><i class="iconfont icon-sousuo"></i></span>
+            <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" v-model="staffSearch" class="staff-search" @keyup.13="staffRecord()">
+            <span @click="staffRecord()"><i class="iconfont icon-sousuo"></i></span>
           </div>
           <div class="search-filter">
-            <div class="select-wrap">全部角色<i class="iconfont icon-arrow-down"></i></div>
-            <ul class="select-list" v-if="false">
-              <li>全部角色</li>
-              <li>管理员</li>
-              <li>店长</li>
-              <li>普通用户</li>
-              <li>销售员</li>
-              <li>任意测试</li>
+            <div class="select-wrap" @click="showRoleEvent($event)"><strong v-text="role"></strong><i class="iconfont icon-arrow-down"></i></div>
+            <ul class="select-list" v-if="showRole">
+              <li @click="rolesEvent()">全部角色</li>
+              <li v-for="item in roles" v-text="item.desc" @click="rolesEvent(item)">全部角色</li>
             </ul>
           </div>
         </div>
-        <div class="list-content">
-          <div class="bg" v-for="item in staffData">
+        <div class="list-content" v-if="staffDataList && staffDataList.length">
+          <div class="bg" v-for="item in staffDataList">
             <div class="staff-list">
               <div class="list-item"><span>UU账号:</span><span v-text="item.userUU">100000721</span></div>
               <div class="list-item"><span>姓名:</span><span v-text="item.userName">张洪别</span></div>
@@ -46,34 +40,32 @@
             </div>
           </div>
         </div>
+        <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>
+        <pull-up :fixId="'mobile-staff-center'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
         <nuxt-link class="staff-add" :to="'/mobile/user/staff/add'"><i class="iconfont icon-add"></i>新增用户</nuxt-link>
       </div>
       <div class="staff-record" v-if="switchType === 'Audit'">
         <div class="search-content">
-          <!--<input type="text" placeholder="卖家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">-->
-          <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" v-model="auditSearch">
-          <!--<span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>-->
-          <span><i class="iconfont icon-sousuo"></i></span>
+          <input type="text" placeholder="人员姓名、电话号码、邮箱或UU" v-model="auditSearch" @keyup.13="auditRecord()">
+          <span @click="auditRecord()"><i class="iconfont icon-sousuo"></i></span>
         </div>
-        <div class="list-content">
-          <div class="bg">
+        <div class="list-content" v-if="AuditList && AuditList.length">
+          <div class="bg" v-for="item in AuditList">
             <div class="staff-list">
-              <div class="list-item"><span>用户名:</span><span>{item}</span></div>
-              <div class="list-item"><span>UU账号:</span><span>100000721</span></div>
-              <div class="list-item"><span>手机号:</span><span>12345678901</span></div>
-              <div class="list-item"><span>邮箱:</span><span>12345678901</span></div>
+              <div class="list-item"><span>用户名:</span><span v-text="item.user.vipName"></span></div>
+              <div class="list-item"><span>UU账号:</span><span v-text="item.user.userUU">100000721</span></div>
+              <div class="list-item"><span>手机号:</span><span v-text="item.user.mobile">12345678901</span></div>
+              <div class="list-item"><span>邮箱:</span><span v-text="item.user.email">12345678901</span></div>
             </div>
             <div class="list-footer">
-              <div class="edit handle"><i class="iconfont icon-check-circle"></i><span>同意</span></div>
-              <div class="handle delete"><i class="iconfont icon-close-circle"></i><span>拒绝</span></div>
+              <div class="edit handle" @click="agreeEvent(item, '1')"><i class="iconfont icon-check-circle"></i><span>同意</span></div>
+              <div class="handle delete" @click="agreeEvent(item, '0')"><i class="iconfont icon-close-circle"></i><span>拒绝</span></div>
             </div>
           </div>
         </div>
-        <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'"></empty-status>
+        <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>
+        <pull-up :fixId="'mobile-staff-center'" :searchMore="fetch" :allPage="allPageAudit" :page="page" @pullUpAction="onPullUpAudit"></pull-up>
       </div>
-      <!--<seek-list :keyword="remindKeyword" :isSearch="isSearch" :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData"></seek-list>-->
-      <!--<pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>-->
-      <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
     </div>
     <!--删除员工-->
     <div class="deleteKuang" v-if="showDelete">
@@ -86,6 +78,7 @@
         </div>
       </div>
     </div>
+    <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>
 </template>
 <script>
@@ -99,10 +92,18 @@
         timeoutCount: 0,
         page: 1,
         count: 10,
+        staffSearch: '',
+        staffDataList: [],
         auditSearch: '',
+        AuditList: [],
+        isChange: false,
+        hasChange: false,
         switchType: 'info',
         showDelete: false,
-        currentObject: ''
+        currentObject: '',
+        role: '全部角色',
+        roles: [],
+        showRole: false
       }
     },
     components: {
@@ -111,69 +112,179 @@
       EmptyStatus,
       BaseFilter
     },
+    created () {
+      this.auditRecord()
+    },
+    mounted () {
+      // 获取角色
+      this.$nextTick(() => {
+        this.getRoles()
+      })
+      let _this = this
+      _this.$nextTick(function () {
+        window.addEventListener('scroll', function () {
+          _this.scroll()
+        }, false)
+        document.body.onclick = () => {
+          this.showRole = false
+        }
+      })
+    },
     watch: {
-      // 'buyerAccount': {
-      //   handler: function (val) {
-      //     if (val && val.content) {
-      //       if (this.isChange) {
-      //         this.accountList = []
-      //         this.isChange = false
-      //       }
-      //       this.accountList = [...this.accountList, ...val.content]
-      //     }
-      //   }
+      'staffData': {
+        handler: function (val) {
+          if (this.isChange) {
+            this.staffDataList = val.content
+            this.isChange = false
+          } else {
+            this.staffDataList = [...this.staffDataList, ...val.content]
+          }
+        },
+        immediate: true
+      },
+      'auditBind': {
+        handler: function (val) {
+          if (this.hasChange) {
+            this.AuditList = val.content
+            this.hasChange = false
+          } else {
+            this.AuditList = [...this.AuditList, ...val.content]
+          }
+        },
+        immediate: true
+      }
     },
     computed: {
       staffData () {
-        return this.$store.state.staff.infoList.info.data.content
+        return this.$store.state.staff.infoList.info.data
+      },
+      fetching () {
+        return this.$store.state.staff.infoList.info.fetching
+      },
+      allPage () {
+        return Math.floor(this.staffData.totalElements / this.staffData.size) + Math.floor(this.staffData.totalElements % this.staffData.size > 0 ? 1 : 0)
+      },
+      auditBind () {
+        console.log(this.$store.state.staff.infoList.audit.data, '213')
+        return this.$store.state.staff.infoList.audit.data ? this.$store.state.staff.infoList.audit.data.content : {content: []}
+      },
+      fetch () {
+        return this.$store.state.staff.infoList.audit.fetching
+      },
+      allPageAudit () {
+        return Math.floor(this.auditBind.totalElements / this.auditBind.size) + Math.floor(this.auditBind.totalElements % this.auditBind.size > 0 ? 1 : 0)
       },
       userInfo () {
         return this.$store.state.option.user.data
       }
     },
     methods: {
-      goEdit (item) {
-        this.$store.commit('staff/infoList/EDIT_DATA_SUCCESS', item)
-        this.$router.push('/mobile/user/staff/edit')
+      onRemind: function (str) {
+        this.remindText = str
+        this.timeoutCount++
       },
       setSwitchType (type) {
         this.switchType = type
-        this.$http({
-          method: 'get',
-          baseURL: process.env.ssoUrl,
-          url: `/api/userspace/apply/info/mall`,
-          data: {
-            count: 10,
-            page: 1,
-            speaceUU: 10049698,
-            status: 311
-          }
-        }).then(res => {
-            console.log('1', res.data)
-          }, err => {
-            console.log('12', err)
+        this.page = 1
+        if ( type === 'info') {
+          this.staffRecord()
+        } else {
+          this.auditRecord()
+        }
+      },
+      // 获取角色信息
+      getRoles () {
+        this.$http.get('/account/role')
+          .then(response => {
+            if (response.data) {
+              this.roles = response.data
+            }
           })
+          .catch(err => {
+            console.log(err)
+        })
+      },
+      staffList () {
+        this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.userInfo.enterprise.uu})
+      },
+      onPullUpAction: function () {
+        this.page++
+        this.staffList()
+      },
+      goEdit (item) {
+        this.$store.commit('staff/infoList/EDIT_DATA_SUCCESS', item)
+        this.$router.push('/mobile/user/staff/edit')
       },
       // 删除员工
       openDelete (item) {
         this.currentObject = item
         this.showDelete = true
       },
+      // 员工搜索
+      staffRecord () {
+        this.role = '全部角色'
+        this.showRole = false
+        this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.user.data.enterprise.uu, keyword: this.staffSearch})
+      },
+      // 打开选择
+      showRoleEvent (e) {
+        if (e) {
+          e.stopPropagation()
+        }
+        this.showRole = !this.showRole
+      },
+      // 选择性搜索
+      rolesEvent (type) {
+        this.showRole = !this.showRole
+        this.page = 1
+        if (type) {
+          this.role = type.desc
+          let params = {
+            count: this.count,
+            page: this.page,
+            enuu: this.user.data.enterprise.uu,
+            keyword: this.staffSearch,
+            roleId: type.id
+          }
+          this.$store.commit('infoList/REQUEST_INFO_LIST')
+          this.$http.get('/basic/user/enterprise/keywordinfo', {params})
+            .then(response => {
+              this.$store.commit('staff/infoList/GET_INFO_LIST_SUCCESS', response.data ? response.data : {})
+            }, err => {
+              this.$store.commit('staff/infoList/GET_INFO_LIST_FAILURE', err)
+            })
+        } else {
+          this.role = '全部角色'
+          this.staffRecord()
+        }
+      },
       sureDelete () {
         this.$http.delete('/basic/user/' + this.currentObject.userUU)
           .then(response => {
-            console.log(response)
+            console.log(response.data)
             this.showDelete = false
             this.onRemind('用户' + this.currentObject.userUU + '删除成功')
             this.staffData()
           }).catch(data => {
-            this.showDelete = false
-            this.onRemind(data.response.data)
-          })
+          this.showDelete = false
+          this.onRemind(data.response.data)
+        })
       },
-      onRemind: function (str) {
-        this.remindText = str
-        this.timeoutCount ++
+      // 申请绑定搜索
+      auditRecord () {
+        this.$store.dispatch('staff/loadBindAudit', {count: this.count, page: this.page, speaceUU: this.user.data.enterprise.uu, status: 311, keyword: this.auditSearch})
+      },
+      // 绑定下拉
+      onPullUpAudit () {
+        this.page++
+        this.auditRecord()
+      },
+      // 申请绑定操作事件 (同意和拒绝)
+      agreeEvent (type, flag) {
+        this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
+        this.auditSearch = null
+        this.page = 1
+        this.auditRecord()
       }
     }
   }
@@ -222,7 +333,12 @@
             background-color: #ffffff;
             border-radius: .06rem;
             border: solid 1px #b4b4b4;
+            strong{
+              font-weight: normal;
+            }
             i{
+              float:right;
+              display:inline-block;
               font-size: .1rem;
               font-weight: bold;
               color: $base-color;
@@ -252,6 +368,7 @@
       .list-content{
         margin: 0 auto;
         padding: 0 .20rem;
+        margin-bottom:1.2rem;
         div.bg{
           padding: .32rem .24rem 0 .24rem;
           margin-bottom: .25rem;
@@ -262,7 +379,7 @@
         .staff-list {
           width: 100%;
           .list-item {
-            margin-bottom: .24rem;
+            margin-bottom: .14rem;
             &:last-child{
               padding-bottom: 0;
             }
@@ -280,6 +397,7 @@
             }
             span.role{
               display: inline-block;
+              margin-right: .1rem;
               padding: 0 .05rem;
               height: .25rem;
               line-height: .25rem;

+ 4 - 3
components/store/home/EnterpriseInfo.vue

@@ -4,7 +4,7 @@
       <ul class="main-list clearfix">
         <li>
           <div>
-            <div class="list" v-if="$route.params.uuid !== process.env.pcbId">
+            <div class="list" v-if="$route.params.uuid !== pcbId">
               <div class="information-list">
                 <div>主营产品&nbsp;:</div>
                 <div v-if="storeInfo.description" :title="storeInfo.description">{{storeInfo.description | introduceFilter}}</div>
@@ -47,8 +47,8 @@
               <!--<qualification-certificate></qualification-certificate>-->
             </div>
             <div class="product-show">
-              <recommend-list v-if="$route.params.uuid !== process.env.pcbId"></recommend-list>
-              <recommend-pcb v-if="$route.params.uuid === process.env.pcbId"></recommend-pcb>
+              <recommend-list v-if="$route.params.uuid !== pcbId"></recommend-list>
+              <recommend-pcb v-if="$route.params.uuid === pcbId"></recommend-pcb>
             </div>
           </div>
         </li>
@@ -110,6 +110,7 @@
     name: 'product-recommend-self',
     data () {
       return {
+        pcbId: process.env.pcbId,
         dialogVisible: false,
         dialogCertificate: false,
         showMore: false,

+ 1 - 1
components/store/home/RecommendPcb.vue

@@ -305,7 +305,7 @@
   .recommend-fragment {
     background: #fff;
     .empty-show{
-      height: 381px;
+      height: 530px;
       padding-top: 140px;
       &:hover{
          box-shadow: 0px 0px 0px transparent;

+ 2 - 1
components/store/home/StoreBanner.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="container" id="title-fragment">
-    <div class="container" v-if="$route.params.uuid === process.env.pcbId">
+    <div class="container" v-if="$route.params.uuid === pcbId">
       <div class="shop-pcb">
         <ul class="pk-list">
           <li class="pk-item" v-for="kind in kinds">
@@ -89,6 +89,7 @@ export default {
   name: 'store-banner',
   data () {
     return {
+      pcbId: process.env.pcbId,
       dialogVisible: false,
       dialogInvisible: false,
       showShare: false,

+ 1 - 1
nuxt.config.js

@@ -101,8 +101,8 @@ module.exports = {
     materialUrl,
     cmsUrl,
     messageUrl,
-    ssoUrl,
     uasUrl,
+    ssoUrl,
     pcbId
   },
   plugins: [

+ 1 - 0
pages/mobile/user/staff/index.vue

@@ -13,6 +13,7 @@
     },
     fetch ({ store }) {
       return Promise.all([
+        store.dispatch('staff/loadBindAudit', {count: 10, page: 1, speaceUU: store.state.option.user.data.enterprise.uu, status: 311}),
         store.dispatch('staff/loadStaffList', {count: 10, page: 1, enuu: store.state.option.user.data.enterprise.uu})
       ])
     }

+ 10 - 0
store/staff.js

@@ -10,5 +10,15 @@ export const actions = {
       }, err => {
         commit('infoList/GET_INFO_LIST_FAILURE', err)
       })
+  },
+  // 审核绑定列表
+  loadBindAudit ({ commit }, params = {}) {
+    commit('infoList/REQUEST_BIND_AUDIT')
+    return axios.get(`/api/userspace/apply/info/mall`, {params})
+      .then(res => {
+        commit('infoList/GET_BIND_AUDIT_SUCCESS', res.data)
+      }, err => {
+        commit('infoList/GET_BIND_AUDIT_FAILURE', err)
+      })
   }
 }

+ 14 - 0
store/staff/infoList.js

@@ -3,6 +3,10 @@ export const state = () => ({
     fetching: false,
     data: []
   },
+  audit: {
+    fetching: false,
+    data: []
+  },
   edit: {
     fetching: false,
     data: []
@@ -22,5 +26,15 @@ export const mutations = {
   GET_INFO_LIST_SUCCESS (state, result) {
     state.info.fetching = false
     state.info.data = result
+  },
+  REQUEST_BIND_AUDIT (state) {
+    state.audit.fetching = true
+  },
+  GET_BIND_AUDIT_FAILURE (state) {
+    state.audit.fetching = false
+  },
+  GET_BIND_AUDIT_SUCCESS (state, result) {
+    state.audit.fetching = false
+    state.audit.data = result
   }
 }