Browse Source

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

wangcz 7 years ago
parent
commit
86831810c4

+ 15 - 13
components/applyPurchase/BatchPublish.vue

@@ -468,19 +468,19 @@
 //          _this.modifyObj[attr] = _this.bomList.content[index][attr]
         }
 //        this.modifyObj = this.bomList.content[index]
-        this.modifyObj.deadline = this.bomList.content[index].deadline ? this.getDate(this.bomList.content[index].deadline) : ''
+        this.modifyObj.deadline = this.bomList.content[index].deadline ? this.bomList.content[index].deadline : ''
       },
       cancelModify: function (index) {
         this.bomList.content[index].active = false
       },
-      getDate: function (input) {
-        const d = new Date(input)
-        const year = d.getFullYear()
-        const monthTemp = d.getMonth() + 1
-        const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
-        const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
-        return year + '-' + month + '-' + day
-      },
+//      getDate: function (input) {
+//        const d = new Date(input)
+//        const year = d.getFullYear()
+//        const monthTemp = d.getMonth() + 1
+//        const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+//        const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+//        return year + '-' + month + '-' + day
+//      },
 //      validDate: function (timestamp) {
 //        let now = new Date().getTime()
 //        return timestamp - now <= 1000 * 60 * 60 * 24 * 90 && timestamp - now > 0
@@ -563,11 +563,13 @@
         return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
       },
       isValidDate: function (date) {
-        date = this.baseUtils.formatDate(date, 'yyyy-MM-dd hh:mm:ss')
-        this.modifyObj.deadline = date
+        console.log(date)
+        let dateTmp = new Date(this.baseUtils.formatDate(new Date(dateTmp), 'yyyy-MM-dd')).getTime()
+//        this.modifyObj.deadline = date
+//        console.log(date)
         let now = this.baseUtils.getClearDay(this.baseUtils.formatDate(new Date(), 'yyyy-MM-dd'))
-        let time = new Date(date).getTime()
-        return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
+//        let time = new Date(date).getTime()
+        return !dateTmp || (dateTmp >= now && dateTmp <= now + 1000 * 60 * 60 * 24 * 91)
       },
       getSimilarCode: function () {
         if (this.modifyObj.code) {

+ 37 - 36
components/mobile/staffManagement/StaffList.vue

@@ -45,7 +45,7 @@
           </div>
           <empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>
           <pull-up :fixId="'mobile-staff-center'" :isValid="activeTab == 0 && switchType === 'info'" :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">
@@ -90,6 +90,7 @@
         </div>
       </div>
     </div>
+    <nuxt-link v-if="activeTab === 0 && switchType === 'info'" class="staff-add" :to="'/mobile/user/staff/add'"><i class="iconfont icon-add"></i>新增用户</nuxt-link>
     <!--删除员工弹框-->
     <div class="deleteKuang" v-if="showDelete">
       <div class="kuangContent">
@@ -203,7 +204,7 @@
       }
     },
     methods: {
-      onRemind: function (str) {
+      setRemindText: function (str) {
         this.remindText = str
         this.timeoutCount++
       },
@@ -237,13 +238,13 @@
       openDelete (item) {
         if (this.isAdmin) {
           if (item.userUU === this.userInfo.userUU) {
-            this.onRemind('自己不可修改自己')
+            this.setRemindText('自己不可修改自己')
           } else {
             this.currentObject = item
             this.showDelete = true
           }
         } else {
-          this.onRemind('您不是管理员不可修改')
+          this.setRemindText('您不是管理员不可修改')
         }
       },
       // 员工列表确认删除
@@ -252,13 +253,13 @@
           .then(response => {
             // console.log(response)
             this.showDelete = false
-            this.onRemind('用户' + this.currentObject.userUU + '删除成功')
+            this.setRemindText('用户' + this.currentObject.userUU + '删除成功')
             this.page = 1
             this.isChange = true
             this.staffList()
           }).catch(data => {
             this.showDelete = false
-            this.onRemind(data.response.data)
+            this.setRemindText(data.response.data)
           })
       },
       // 打开选择
@@ -305,16 +306,16 @@
       },
       // 员工列表当前选中对象
       goEdit (item) {
-        if (this.isAdmin) {
-          if (item.userUU === this.userInfo.userUU) {
-            this.onRemind('自己不可修改自己')
-          } else {
+        if (item.userUU === this.userInfo.userUU) {
+          this.setRemindText('自己不可修改自己')
+        } else {
+          this.authorityInterceptor('/basic/user/updaterole', () => {
             let currentData = item
             this.currentStaff = this.baseUtils.deepCopy(currentData)
             this.activeTab = 1
             for (let j = 0; j < this.rolesList.length; j++) {
               for (let i = 0; i < this.currentStaff.roles.length; i++) {
-                //判断已绑定角色
+                // 判断已绑定角色
                 if (this.currentStaff.roles[i].id === this.rolesList[j].id) {
                   this.rolesList[j].checked = true
                   break
@@ -323,9 +324,7 @@
                 }
               }
             }
-          }
-        } else {
-          this.onRemind('您不是管理员不可修改')
+          })
         }
       },
       // 员工列表选择角色
@@ -346,7 +345,7 @@
         }
         this.$http.put(`/basic/user/updaterole`, this.currentStaff)
           .then(() => {
-            this.onRemind('角色编辑成功')
+            this.setRemindText('角色编辑成功')
             this.activeTab = 0
             this.page = 1
             this.isChange = true
@@ -371,7 +370,7 @@
       agreeEvent (type, flag) {
         this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
           .then(() => {
-            this.onRemind('操作成功!')
+            this.setRemindText('操作成功!')
             this.auditSearch = ''
             this.page = 1
             this.searchAudit()
@@ -549,27 +548,9 @@
           }
         }
       }
-      .staff-add {
-        display: inline-block;
-        position: fixed;
-        bottom: 1.2rem;
-        left: 50%;
-        margin-left: -3.29rem;
-        width: 6.59rem;
-        height: .77rem;
-        line-height: .77rem;
-        text-align: center;
-        font-size: .32rem;
-        color: #fff;
-        background-color: #3f84f6;
-        border-radius: 0.08rem;
-        i{
-          margin-right: .1rem;
-          font-size: .32rem;
-          color: #fff;
-        }
-      }
+
     }
+
     /*编辑角色*/
     .staff-role{
       margin: .2rem auto 0;
@@ -672,6 +653,26 @@
       }
     }
   }
+  .staff-add {
+    display: inline-block;
+    position: fixed;
+    bottom: 1.2rem;
+    left: 50%;
+    margin-left: -3.29rem;
+    width: 6.59rem;
+    height: .77rem;
+    line-height: .77rem;
+    text-align: center;
+    font-size: .32rem;
+    color: #fff;
+    background-color: #3f84f6;
+    border-radius: 0.08rem;
+    i{
+      margin-right: .1rem;
+      font-size: .32rem;
+      color: #fff;
+    }
+  }
   /*删除弹框*/
   .deleteKuang {
     position: fixed;

+ 12 - 11
pages/mobile/center/user/collect/store.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="mobile-center">
     <div class="com-mobile-header mobile-center-header">
-      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <a @click="goBack()"><i class="iconfont icon-fanhui"></i></a>
       <p>店铺关注</p>
       <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
     </div>
@@ -129,17 +129,21 @@
       SearchHeader
     },
     methods: {
+      async goBack() {
+        if (this.searchShow === true) {
+          //这里 是测试语句
+          this.searchShow = false
+          this.keyword = ''
+          let { data } = await this.$http.get(`/trade/storeFocus/page`, {params: { count: 10, page: 1 }})
+          this.storeList = data
+        } else {
+          this.goLastPage()
+        }
+      },
       onSearch(keyObj) {
         if (keyObj.keyword === '') {
           this.onRemind('请输入搜索关键字')
           return
-          if (this.searchShow === true) {
-            this.searchShow = false
-            this.storeList = {}
-            this.page = 1
-            this.reloadList()
-          }
-          return
         }
         this.searchShow = true
         this.keyword = keyObj.keyword
@@ -201,8 +205,6 @@
       async reloadList() {
         if (this.searchShow) {
           let { data } = await this.$http.get('/api/store-service/stores', {params: { page: this.page, count: this.count, type: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: this.keyword || null, field: this.field, op: 'similar' }})
-
-
           let _pull = []
           for (let i = 0; i < data.content.length; i++) {
             _pull.push(findStoreFocusInMobil({id: data.content[i].id}))
@@ -216,7 +218,6 @@
               }
             })
           this.storeList.content = [...this.storeList.content, ...data.content]
-
         } else {
           let { data } = await axios.get(`/trade/storeFocus/page`, {params: {count: 10, page: this.page}})
           this.storeList.content = [...this.storeList.content, ...data.content]

+ 8 - 7
pages/mobile/center/vendor/attentionBus.vue

@@ -51,7 +51,7 @@
       //   ])
       // },
       async asyncData({store}) {
-        let {data} = await axios.get('/produce/kindConcern/kindList', { params: {keyword: '', count: 20, page: 1, type: 'yes', enUU: store.state.option.user.data.enterprise.uu} })
+        let {data} = await axios.get('/produce/kindConcern/kindList', { params: {keyword: '', count: 20, page: 1, enUU: store.state.option.user.data.enterprise.uu} })
         return {
           attentionList: data
         }
@@ -84,7 +84,7 @@
       // },
       computed: {
         allPage() {
-          return Math.ceil(this.attentionList.totalElements / 10)
+          return Math.ceil(this.attentionList.totalElements / 20)
         },
         getkindConcernList() {
           return this.$store.state.product.component.collectCode
@@ -98,10 +98,10 @@
           this.keyword = ''
           this.getAttentionListArray(this.page)
         },
-        searchSeek() {
-          this.page = 0
-          this.attentionList = []
-          this.getMoreSearch()
+        async searchSeek() {
+          this.page = 1
+          let {data} = await this.$http.get('/produce/kindConcern/kindList', { params: {keyword: this.keyword, count: 20, page: 1, enUU: this.$store.state.option.user.data.enterprise.uu} })
+          this.attentionList = data
         },
         attentionFn(kindConcern, index) {
           let param = {
@@ -140,8 +140,9 @@
         },
        async getAttentionListArray(page) {
           this.isSearchSearchingMore = true
-          let {data} = await axios.get('/produce/kindConcern/kindList', { params: {keyword: '', count: 20, page: page, type: 'yes', enUU: this.$store.state.option.user.data.enterprise.uu} })
+          let {data} = await axios.get('/produce/kindConcern/kindList', { params: {keyword: '', count: 20, page: page, enUU: this.$store.state.option.user.data.enterprise.uu} })
           this.attentionList.content = [...this.attentionList.content, ...data.content]
+          this.isSearchSearchingMore = false
           // if (this.activeType === 'attention') {
           //   this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, enUU: this.$store.state.option.user.data.enterprise.uu})
           // } else {