Browse Source

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

shenjj 7 years ago
parent
commit
e3f4b6c999

+ 10 - 1
components/home/KindCategory.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="kind-category" @mouseleave="hideChildrenLayout()">
+  <div class="kind-category" ref="kindCategory" @mouseleave="hideChildrenLayout()">
     <ul class="kind-main list-unstyled">
       <li v-for="kind in kindsToShow" class="kind-main-item" :class="{active: kind.id==activeKindId}"
         @mouseenter="showChildrenLayout(kind)">
@@ -66,6 +66,15 @@
         this.activeKindId = null
       }
     },
+    watch: {
+      '$route.path': {
+        handler: function (path) {
+          if (path !== '/') {
+            this.$refs.kindCategory.style.display = 'none'
+          }
+        }
+      }
+    },
 //    mounted () {
 //      this.$http.get(`/api/product/kind/0/children_all`)
 //        .then(response => {

+ 2 - 2
components/mobile/staffManagement/StaffAdd.vue

@@ -243,8 +243,8 @@
       background: #fff;
       span {
         font-size: .29rem;
-        &:first-child {
-          margin-right: 2.6rem;
+        &:last-child {
+          margin-left: 2.6rem;
         }
         &.active {
           color: $base-color;

+ 23 - 28
components/mobile/staffManagement/StaffList.vue

@@ -8,7 +8,7 @@
     <!--列表-->
     <div class="mobile-fix-content mobile-centerfix-content" id="mobile-staff-center">
       <!--列表-->
-      <div v-if="activeTab == 0">
+      <div v-if="activeTab === 0">
         <div class="staff-head">
           <span class="inline-block" :class="{'active': switchType === 'info'}" @click="setSwitchType('info')">员工信息</span>
           <span v-show="isAdmin" class="inline-block" :class="{'active': switchType === 'Audit'}" @click="setSwitchType('Audit')">审核绑定</span>
@@ -73,7 +73,7 @@
         </div>
       </div>
       <!--编辑角色-->
-      <div v-if="activeTab == 1">
+      <div v-if="activeTab === 1">
         <div v-for="(role, index) in rolesList">
           <div class="staff-role">
             <div class="staff-header"><span :class="'active_0' + role.color"><b></b>{{role.desc}}</span></div>
@@ -173,34 +173,26 @@
       'staffData': {
         handler: function (val) {
           if (this.isChange) {
-            this.staffDataList = val.content
+            this.staffDataList = []
             this.isChange = false
-          } else {
-            this.staffDataList = [...this.staffDataList, ...val.content]
           }
+          this.staffDataList = [...this.staffDataList, ...val.content]
         },
         immediate: true
       },
       'auditBind': {
         handler: function (val) {
           if (this.hasChange) {
-            this.AuditList = val.content
+            this.AuditList = []
             this.hasChange = false
-          } else {
-            this.AuditList = [...this.AuditList, ...val.content]
           }
+          this.AuditList = [...this.AuditList, ...val.content]
         }
       }
     },
-    mounted () {
-      // 获取角色
-      this.$nextTick(() => {
-        this.getRoles()
-      })
-    },
     computed: {
       staffData () {
-        return this.$store.state.staff.infoList.info.data
+        return this.$store.state.staff.infoList.info.data.content ? this.$store.state.staff.infoList.info.data : {content:[]}
       },
       fetching () {
         return this.staffData.fetching
@@ -209,7 +201,7 @@
         return Math.floor(this.staffData.totalElements / this.staffData.size) + Math.floor(this.staffData.totalElements % this.staffData.size > 0 ? 1 : 0)
       },
       auditBind () {
-        return this.$store.state.staff.infoList.audit.data || {content:[]}
+        return this.$store.state.staff.infoList.audit.data.content ? this.$store.state.staff.infoList.audit.data : {content:[]}
       },
       fetch () {
         return this.$store.state.staff.infoList.audit.fetching
@@ -227,6 +219,8 @@
         this.timeoutCount++
       },
       setSwitchType (type) {
+        this.staffSearch = ''
+        this.auditSearch = ''
         this.switchType = type
         this.page = 1
         if ( type === 'info') {
@@ -246,9 +240,8 @@
       },
       // 员工列表搜索
       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})
+        this.rolesEvent()
       },
       // 员工列表删除员工
       openDelete (item) {
@@ -279,27 +272,28 @@
       },
       // 选择性搜索
       rolesEvent (type) {
+        this.isChange = true
         this.showRole = !this.showRole
+        this.role = type ? type.desc : '全部角色'
         this.page = 1
-        if (type) {
-          this.role = type.desc
+        if (!type && !this.staffSearch) {
+          this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.user.data.enterprise.uu, keyword: this.staffSearch})
+        } else {
           let params = {
             count: this.count,
             page: this.page,
             enuu: this.user.data.enterprise.uu,
             keyword: this.staffSearch,
-            roleId: type.id
+            roleId: type ? type.id : null
           }
-          this.$store.commit('infoList/REQUEST_INFO_LIST')
+          this.isChange = true
+          this.$store.commit('staff/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()
         }
       },
       // 获取角色
@@ -353,10 +347,10 @@
       },
       // 申请绑定搜索
       auditRecord () {
-        console.log(this.user.data.enterprise.uu)
+        this.hasChange = true
         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()
@@ -364,7 +358,8 @@
       // 申请绑定操作事件 (同意和拒绝)
       agreeEvent (type, flag) {
         this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
-        this.auditSearch = null
+        this.onRemind('操作成功!')
+        this.auditSearch = ''
         this.page = 1
         this.auditRecord()
       }

+ 4 - 4
pages/mobile/center/vendor/payCenter.vue

@@ -93,7 +93,7 @@
         <span class="content">已收总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalMoney}}</span></span>
         <!--<span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
         <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>-->
-        <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalMoney}} (共计{{recordList.length || 0}}笔交易)</p>
+        <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalMoney}} (共计{{recordData.data.data.data.totalElements || 0}}笔交易)</p>
       </div>
     </div>
     <!-- 交易记录end -->
@@ -230,7 +230,7 @@
               val: 'PAIDTOVENDOR'
             }, {
               key: '平台代付',
-              val: 'PAIDTOPLATFORM'
+              val: 'PLATFORMPAIDTOVENDOR'
             }],
             defaultVal: null
           },
@@ -312,7 +312,7 @@
               this.isChange = false
               this.totalRecordPrice = 0
             }
-            this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
+//            this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
             this.recordList = [...this.recordList, ...val.content]
           }
         },
@@ -344,7 +344,7 @@
       payTypeFilter: function (type) {
         if (type === 'PAIDTOVENDOR') {
           return '买家付款'
-        } else if (type === 'PAIDTOPLATFORM') {
+        } else if (type === 'PLATFORMPAIDTOVENDOR') {
           return '平台代付'
         } else {
           return '其他'

+ 1 - 1
store/staff.js

@@ -16,7 +16,7 @@ export const actions = {
     commit('infoList/REQUEST_BIND_AUDIT')
     return axios.get(`/api/userspace/apply/info/mall`, {params})
       .then(res => {
-        commit('infoList/GET_BIND_AUDIT_SUCCESS', res.data.content)
+        commit('infoList/GET_BIND_AUDIT_SUCCESS', res.data.content || {})
       }, err => {
         commit('infoList/GET_BIND_AUDIT_FAILURE', err)
       })

+ 2 - 2
store/staff/infoList.js

@@ -1,11 +1,11 @@
 export const state = () => ({
   info: {
     fetching: false,
-    data: []
+    data: {}
   },
   audit: {
     fetching: false,
-    data: []
+    data: {}
   },
   edit: {
     fetching: false,