Browse Source

手机退出,pc发询价带类目,供应商列表样式

yangc 7 years ago
parent
commit
508fbc57e0

+ 55 - 43
components/applyPurchase/PublishApply.vue

@@ -232,53 +232,65 @@
       getRankBg: function (index) {
         return index === 0 ? 1 : index < 3 ? 2 : 3
       },
+      getMaterialKind: function (code, brand) {
+        return this.$http.get('/productuser/match/getKind', {params: {cmpCode: code, brand: brand}})
+      },
+      startPublish: function (prodTitle) {
+        let inquiry = {}
+        let inquiryItem = {}
+        if (this.user.data.enterprise) {
+          inquiry.enUU = this.user.data.enterprise.uu
+        }
+        let date = new Date()
+        let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+        inquiry.recorderUU = this.user.data.userUU
+        inquiry.code = 'MALL' + date.getTime()
+        inquiry.date = date
+        inquiry.recorder = this.user.data.userName
+        inquiry.endDate = this.applyObj.deadline
+        inquiry.sourceapp = 'MALL'
+        inquiry.amount = 1
+        inquiryItem.userUU = this.user.data.userUU
+        inquiryItem.source = 'MALL'
+        inquiryItem.userName = this.user.data.userName
+        inquiryItem.userTel = this.user.data.userTel
+        inquiryItem.needquantity = this.applyObj.amount
+        inquiryItem.inbrand = this.applyObj.brand
+        inquiryItem.currency = currency
+        inquiryItem.cmpCode = this.applyObj.code.trim().toUpperCase()
+        inquiryItem.unitPrice = this.applyObj.unitPrice
+        inquiryItem.produceDate = this.applyObj.produceDate
+        inquiryItem.date = date
+        inquiryItem.endDate = this.applyObj.deadline
+        inquiryItem.encapsulation = this.applyObj.encapsulation
+        inquiryItem.spec = this.applyObj.spec
+        inquiryItem.prodTitle = prodTitle || this.applyObj.prodTitle || '其他'
+        let inquiryItems = []
+        inquiryItems.push(inquiryItem)
+        inquiry.inquiryItems = inquiryItems
+        inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+        this.$http.post('/inquiry/buyer/save', inquiry)
+          .then(response => {
+            this.$message.success('发布成功')
+//                this.showRemindBox = true
+            this.emptyForm()
+//                this.validObj.deadline = true
+            this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+          }, error => {
+            console.log(error)
+            this.$message.error('发布失败')
+          })
+      },
       goPublish: function () {
         if (this.user.logged) {
           if (this.checkAll()) {
-            let inquiry = {}
-            let inquiryItem = {}
-            if (this.user.data.enterprise) {
-              inquiry.enUU = this.user.data.enterprise.uu
-            }
-            let date = new Date()
-            let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
-            inquiry.recorderUU = this.user.data.userUU
-            inquiry.code = 'MALL' + date.getTime()
-            inquiry.date = date
-            inquiry.recorder = this.user.data.userName
-            inquiry.endDate = this.applyObj.deadline
-            inquiry.sourceapp = 'MALL'
-            inquiry.amount = 1
-            inquiryItem.userUU = this.user.data.userUU
-            inquiryItem.source = 'MALL'
-            inquiryItem.userName = this.user.data.userName
-            inquiryItem.userTel = this.user.data.userTel
-            inquiryItem.needquantity = this.applyObj.amount
-            inquiryItem.inbrand = this.applyObj.brand
-            inquiryItem.currency = currency
-            inquiryItem.cmpCode = this.applyObj.code.trim().toUpperCase()
-            inquiryItem.unitPrice = this.applyObj.unitPrice
-            inquiryItem.produceDate = this.applyObj.produceDate
-            inquiryItem.date = date
-            inquiryItem.endDate = this.applyObj.deadline
-            inquiryItem.encapsulation = this.applyObj.encapsulation
-            inquiryItem.spec = this.applyObj.spec
-            inquiryItem.prodTitle = this.applyObj.prodTitle
-            let inquiryItems = []
-            inquiryItems.push(inquiryItem)
-            inquiry.inquiryItems = inquiryItems
-            inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
-            this.$http.post('/inquiry/buyer/save', inquiry)
-              .then(response => {
-                this.$message.success('发布成功')
-//                this.showRemindBox = true
-                this.emptyForm()
-//                this.validObj.deadline = true
-                this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
-              }, error => {
-                console.log(error)
-                this.$message.error('发布失败')
+            if (!this.applyObj.prodTitle || this.applyObj.prodTitle.length === 0) {
+              this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
+                this.startPublish(response.data && response.data.length ? response.data : '其他')
               })
+            } else {
+              this.startPublish()
+            }
           } else {
             if (!this.validObj.deadline) {
               this.$message.error('截止日期不能为空')

+ 4 - 6
components/mobile/supplier/List.vue

@@ -12,11 +12,10 @@
     <ul>
       <!--<li v-for="item in listData">-->
       <nuxt-link v-bind:key="item.id" v-for="item in listData" tag="li" :to="`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`">
-        <nuxt-link :to="`/mobile/supplier/detail/${item.enUU}?isStore=${item.isStore}`">
         <img v-if="item.isStore == 1" class="open" src="/images/mobile/supplier/is-open.png" alt="">
         <span>{{item.enName}}</span>
-        <img class="tag" src="/images/mobile/supplier/tag.png" alt="">
-        </nuxt-link>
+        <!--<img class="tag" src="/images/mobile/supplier/tag.png" alt="">-->
+        <i class="tag iconfont icon-xiangyou"></i>
       </nuxt-link>
       <!--</li>-->
     </ul>
@@ -148,10 +147,9 @@
             left: -.1rem;
           }
           .tag {
-            width: 1.08rem;
             position: absolute;
-            right: -.1rem;
-            top: .16rem;
+            right: .35rem;
+            color: #3f84f6;
           }
           span {
             color: #333;

+ 30 - 2
pages/mobile/user/index.vue

@@ -4,7 +4,12 @@
       <img src="/images/component/default.png"/>
       <div class="user-info">
         <p v-text="userInfo.data.userName"></p>
-        <p>{{enterpriseInfo.enName}}<a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a></p>
+        <p>
+          <span class="en-name">{{enterpriseInfo.enName}}</span>
+          <a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a>
+          <span class="vir">|</span>
+          <a class="exit" @click="logout">退出</a>
+        </p>
         <ul class="en-list" v-show="showEnterpriseToggle">
           <li class="menu-item"
               v-for="en in sortEnterprises"
@@ -342,7 +347,7 @@
   import PageLoading from '~components/common/loading/PageLoading.vue'
   export default {
     layout: 'mobile',
-    middleware: 'authenticated',
+//    middleware: 'authenticated',
     data () {
       return {
         userName: '',
@@ -707,6 +712,13 @@
       },
       closeMoreinfo: function() {
         this.showMoreinfn = false
+      },
+      logout () {
+        this.$http.get('/logout/crossBefore', {params: {returnUrl: window.location.protocol + '//' + window.location.host}}).then(response => {
+          if (response.data) {
+            window.location.href = response.data.logoutUrl + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)
+          }
+        })
       }
     },
     computed: {
@@ -870,10 +882,26 @@
             position: relative;
             margin-top: .2rem;
             padding-right: .7rem;
+            overflow: unset;
+            max-width: unset;
+            .en-name {
+              overflow: hidden;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+              max-width: 3.22rem;
+              display: inline-block;
+            }
             a {
               position: absolute;
               right: 0;
             }
+            .exit {
+              right: -.8rem;
+            }
+            .vir {
+              position: absolute;
+              right: -.14rem;
+            }
           }
         }
         .en-list {