Browse Source

Merge remote-tracking branch 'origin/master'

shenjj 7 years ago
parent
commit
348369cb70

+ 55 - 43
components/applyPurchase/PublishApply.vue

@@ -232,53 +232,65 @@
       getRankBg: function (index) {
       getRankBg: function (index) {
         return index === 0 ? 1 : index < 3 ? 2 : 3
         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 () {
       goPublish: function () {
         if (this.user.logged) {
         if (this.user.logged) {
           if (this.checkAll()) {
           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 {
           } else {
             if (!this.validObj.deadline) {
             if (!this.validObj.deadline) {
               this.$message.error('截止日期不能为空')
               this.$message.error('截止日期不能为空')

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

@@ -12,11 +12,10 @@
     <ul>
     <ul>
       <!--<li v-for="item in listData">-->
       <!--<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 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="">
         <img v-if="item.isStore == 1" class="open" src="/images/mobile/supplier/is-open.png" alt="">
         <span>{{item.enName}}</span>
         <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>
       </nuxt-link>
       <!--</li>-->
       <!--</li>-->
     </ul>
     </ul>
@@ -148,10 +147,9 @@
             left: -.1rem;
             left: -.1rem;
           }
           }
           .tag {
           .tag {
-            width: 1.08rem;
             position: absolute;
             position: absolute;
-            right: -.1rem;
-            top: .16rem;
+            right: .35rem;
+            color: #3f84f6;
           }
           }
           span {
           span {
             color: #333;
             color: #333;

+ 2 - 0
components/supplier/merchant.vue

@@ -229,6 +229,8 @@
   }
   }
   .list_info{
   .list_info{
     padding: 0 10px;
     padding: 0 10px;
+    min-height:300px;
+    margin-bottom:100px;
     .empty{
     .empty{
       height:418px;
       height:418px;
       border:15px solid #c4e9f9;
       border:15px solid #c4e9f9;

+ 21 - 1
components/supplier/resource.vue

@@ -15,7 +15,7 @@
     <div class="user_info">
     <div class="user_info">
       <div class="user_title">
       <div class="user_title">
         <div class="user_name">
         <div class="user_name">
-          <span>{{enUser.enName}}&nbsp;&nbsp;<i class="fa fa-angle-down"></i></span>
+          <span>{{enUser.enName ? enUser.enName : '企业名称'}}&nbsp;&nbsp;<i class="fa fa-angle-down"></i></span>
           <a :href="/store/+ storeInfo.uuid" target="_blank" v-if="storeInfo.uuid">进入店铺</a>
           <a :href="/store/+ storeInfo.uuid" target="_blank" v-if="storeInfo.uuid">进入店铺</a>
         </div>
         </div>
         <div class="user_mes">
         <div class="user_mes">
@@ -91,6 +91,13 @@
           </tr>
           </tr>
         </tbody>
         </tbody>
       </table>
       </table>
+      <div class="empty" v-if="!list.content || list.content.length === 0">
+        <img src="/images/supplier/icon/empty.png">
+        <div class="info">
+          <p>暂无物料信息</p>
+          <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
+        </div>
+      </div>
       <div style="float: right;background: #ecf1f1;">
       <div style="float: right;background: #ecf1f1;">
         <page :total="list.totalElements" :page-size="pageParams.count"
         <page :total="list.totalElements" :page-size="pageParams.count"
               :current="pageParams.page" v-on:childEvent="handleCurrentChange">
               :current="pageParams.page" v-on:childEvent="handleCurrentChange">
@@ -621,6 +628,19 @@
   }
   }
   .info_list{
   .info_list{
     padding-bottom:200px;
     padding-bottom:200px;
+    .empty{
+      background: #ffffff;
+      text-align: center;
+      padding: 80px 0;
+      img{
+        vertical-align: top;
+        margin-right:15px;
+      }
+      .info{
+        display: inline-block;
+        padding-top:10px;
+      }
+    }
     table {
     table {
       table-layout: fixed;
       table-layout: fixed;
       thead{
       thead{

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

@@ -4,7 +4,12 @@
       <img src="/images/component/default.png"/>
       <img src="/images/component/default.png"/>
       <div class="user-info">
       <div class="user-info">
         <p v-text="userInfo.data.userName"></p>
         <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">
         <ul class="en-list" v-show="showEnterpriseToggle">
           <li class="menu-item"
           <li class="menu-item"
               v-for="en in sortEnterprises"
               v-for="en in sortEnterprises"
@@ -342,7 +347,7 @@
   import PageLoading from '~components/common/loading/PageLoading.vue'
   import PageLoading from '~components/common/loading/PageLoading.vue'
   export default {
   export default {
     layout: 'mobile',
     layout: 'mobile',
-    middleware: 'authenticated',
+//    middleware: 'authenticated',
     data () {
     data () {
       return {
       return {
         userName: '',
         userName: '',
@@ -707,6 +712,13 @@
       },
       },
       closeMoreinfo: function() {
       closeMoreinfo: function() {
         this.showMoreinfn = false
         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: {
     computed: {
@@ -870,10 +882,26 @@
             position: relative;
             position: relative;
             margin-top: .2rem;
             margin-top: .2rem;
             padding-right: .7rem;
             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 {
             a {
               position: absolute;
               position: absolute;
               right: 0;
               right: 0;
             }
             }
+            .exit {
+              right: -.8rem;
+            }
+            .vir {
+              position: absolute;
+              right: -.14rem;
+            }
           }
           }
         }
         }
         .en-list {
         .en-list {