Browse Source

Merge branch 'feature-201836-wangcz' into dev

wangcz 7 years ago
parent
commit
818a428b30

+ 2 - 0
components/mobile/MobileHeader.vue

@@ -241,6 +241,8 @@
         } else if (this.startWith(val, '/mobile/order/logistics')) {
           this.showSearchIcon = false
           title = '物流信息'
+        } else if (this.startWith(val, '/mobile/order/b2border')) {
+          title = '采购订单'
         } else if (this.startWith(val, '/mobile/order')) {
           this.showSearchIcon = false
           if (query.type === 'buyer') {

+ 36 - 23
components/mobile/applyPurchase/SeekList.vue

@@ -14,19 +14,19 @@
             </div>
             <div class="content">
               品牌:
-              <span>{{item.inbrand || '-'}}</span>
+              <span>{{item.inbrand || item.brand ||'-'}}</span>
             </div>
             <div class="content">
               物料名称:
-              <span>{{item.title || item.prodTitle || '-'}}</span>
+              <span>{{item.title || item.prodTitle || (item.product && item.product.title) || '-'}}</span>
             </div>
             <div class="content">
               型号:
-              <span>{{item.cmpCode || '-'}}</span>
+              <span>{{item.cmpCode || (item.product && item.product.code) || '-'}}</span>
             </div>
             <div class="content">
               规格:
-              <span>{{item.spec || '-'}}</span>
+              <span>{{item.spec || (item.product && item.product.spec) ||'-'}}</span>
             </div>
             <div class="content">
               采购数量(PCS):
@@ -34,7 +34,7 @@
             </div>
             <div class="content">
               截止日期:
-              <span class="date">{{item.endDate | date}}</span>
+              <span class="date">{{(item.endDate || item.inquiry.endDate) | date}}</span>
             </div>
             <!--<template v-if="item.quotation">
               <p class="remain-time" v-if="item.remainingTime > 0">剩余&nbsp;:
@@ -51,11 +51,11 @@
               <div class="content" v-if="userType === 'buyer'">
                 <span>{{item.quotation.vendName || '-'}}</span>
               </div>
-              <div class="content">
+              <div class="content" v-if="seekType !== 'enquiry'">
                 报价人:
                 <span>{{item.quotation.user ? item.quotation.user.userName : '-'}}</span>
               </div>
-              <div class="content">
+              <div class="content" v-if="seekType !== 'enquiry'">
                 电话:
                 <span>{{item.quotation.user ? item.quotation.user.userTel : '-'}}</span>
               </div>
@@ -77,21 +77,31 @@
                 </tr>
                 </tbody>
               </table>
-              <button class="more-btn" @click="goSayPriceInfo(item.newId || item.quteId || item.id, item.agreed, index)">查看更多</button>
+              <button v-if="seekType !== 'enquiry'" class="more-btn" @click="goSayPriceInfo(item.newId || item.quteId || item.id, item.agreed, index)">查看更多</button>
+              <button v-if="seekType === 'enquiry'" class="more-btn" @click="goBtobDetails(item.id)">查看更多</button>
             </template>
             <template v-else>
-              <p class="remain-time" v-if="item.remainingTime > 0">剩余&nbsp;:
-                <span v-if="getDay(item.remainingTime) > 0" v-text="getDay(item.remainingTime)"></span>
-                <i v-if="getDay(item.remainingTime) > 0">&nbsp;天&nbsp;</i>
-                <span v-if="getDay(item.remainingTime) <= 0" v-text="getHours(item.remainingTime)"></span>
-                <i v-if="getDay(item.remainingTime) <= 0">&nbsp;小时</i>
-              </p>
-              <p class="remain-time" v-else><span>已截止</span></p>
-              <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
-              <a v-if="isSelfSeek(item)" class="self-publish" @click="setRemindText('此为贵公司的求购')">我要报价</a>
-              <a v-if="canSayPrice(item)" @click="goSayPrice(item.itemId || item.id, index)">我要报价</a>
-              <!--<a v-if="item.newId" class="self-publish" @click="setRemindText('您已报价')">我要报价</a>-->
-              <a v-if="canSeeInfo(item)" @click="goSayPriceInfo(item.newId || item.quteId || item.id, item.agreed, index)">查看报价</a>
+              <div v-if="seekType === 'enquiry'">
+                <p class="remain-time" v-if="(seekType === 'enquiry') && (item.status === 201 && item.invalid === 0 && item.overdue === 0 && !item.agreed)"><span>已报价</span></p>
+                <p class="remain-time" v-if="(seekType === 'enquiry') && (item.invalid === 1 || item.status === 314 || (item.inquiry.check || item.inquiry.check === 1) || item.overdue === 1)"><span>已失效</span></p>
+                <p class="remain-time" v-if="(seekType === 'enquiry') && (item.agreed === 1 && item.status === 201 && item.invalid === 0 && item.overdue === 0)"><span>已采纳</span></p>
+                <a class="remain-time" style="margin-top:1.5rem;" v-if="(seekType === 'enquiry') && (item.status===200 && item.invalid!==1 && item.overdue !== 1 && (!item.inquiry.check || item.inquiry.check === 0))" @click="goBtobDetails(item.id)">我要报价</a>
+                <a v-else @click="goBtobDetails(item.id)">查看更多</a>
+              </div>
+              <div v-else>
+                <p class="remain-time" v-if="item.remainingTime > 0">剩余&nbsp;:
+                  <span v-if="getDay(item.remainingTime) > 0" v-text="getDay(item.remainingTime)"></span>
+                  <i v-if="getDay(item.remainingTime) > 0">&nbsp;天&nbsp;</i>
+                  <span v-if="getDay(item.remainingTime) <= 0" v-text="getHours(item.remainingTime)"></span>
+                  <i v-if="getDay(item.remainingTime) <= 0">&nbsp;小时</i>
+                </p>
+                <p class="remain-time" v-else><span>已截止</span></p>
+                <!--<a v-if="!userType && item.quoted == 1">已报价</a>-->
+                <a v-if="isSelfSeek(item)" class="self-publish" @click="setRemindText('此为贵公司的求购')">我要报价</a>
+                <a v-if="canSayPrice(item)" @click="goSayPrice(item.itemId || item.id, index)">我要报价</a>
+                <!--<a v-if="item.newId" class="self-publish" @click="setRemindText('您已报价')">我要报价</a>-->
+                <a v-if="canSeeInfo(item)" @click="goSayPriceInfo(item.newId || item.quteId || item.id, item.agreed, index)">查看报价</a>
+              </div>
             </template>
           </div>
         </div>
@@ -128,7 +138,7 @@ export default {
     SayPriceInfo,
     EmptyStatus
   },
-  props: ['userType', 'seekType', 'purchaseManList', 'isDataChange', 'isSearch', 'keyword'],
+  props: ['userType', 'seekType', 'activeType', 'purchaseManList', 'isDataChange', 'isSearch', 'keyword'],
   filters: {
     date: function(date) {
       if (date) {
@@ -188,6 +198,9 @@ export default {
     }
   },
   methods: {
+    goBtobDetails (type) {
+      this.$router.push(`/mobile/center/vendor/seek_btob_details?id=${type}&active=${this.activeType}`)
+    },
     getDay: function(timeStamp) {
       return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
     },
@@ -271,10 +284,10 @@ export default {
       return !this.userType && item.remainingTime > 0 && (!item.quoted || item.quoted !== 1) && (this.user.logged && ((item.inquiry && item.inquiry.enterprise && this.user.data.enterprise && (item.inquiry.enterprise.uu === this.user.data.enterprise.uu)) || (!this.user.data.enterprise.uu && item.userUU === this.user.data.userUU && !item.inquiry.enterprise)))
     },
     canSayPrice: function (item) {
-      return !item.newId && (!(this.userType === 'saler' && this.seekType && this.seekType !== 'wait') && (item.remainingTime > 0 && (!item.quoted || item.quoted !== 1) && !(this.user.logged && ((item.inquiry && item.inquiry.enterprise && this.user.data.enterprise && (item.inquiry.enterprise.uu === this.user.data.enterprise.uu)) || (!this.user.data.enterprise.uu && item.userUU === this.user.data.userUU)))))
+      return !item.newId && (!(this.userType === 'saler' && this.activeType && this.activeType !== 'todo') && (item.remainingTime > 0 && (!item.quoted || item.quoted !== 1) && !(this.user.logged && ((item.inquiry && item.inquiry.enterprise && this.user.data.enterprise && (item.inquiry.enterprise.uu === this.user.data.enterprise.uu)) || (!this.user.data.enterprise.uu && item.userUU === this.user.data.userUU)))))
     },
     canSeeInfo: function (item) {
-      return ((!this.userType || this.userType === 'buyer') && (this.seekType && this.seekType !== 'wait')) || (this.userType === 'saler' && this.seekType && this.seekType !== 'wait') || item.quoted === 1 || item.newId
+      return ((!this.userType || this.userType === 'buyer') && (this.activeType && this.activeType !== 'wait')) || (this.userType === 'saler' && this.activeType && this.activeType !== 'todo') || item.quoted === 1 || item.newId
     }
   }
 }

+ 66 - 17
components/mobile/center/Seek.vue

@@ -1,5 +1,6 @@
 <template>
-  <div class="seek">
+  <!--  -->
+  <!--<div class="seek">
     <div class="com-mobile-header mobile-center-header">
       <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
       <p>{{seekTitle}}</p>
@@ -25,6 +26,39 @@
       <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>
     </div>
+  </div>-->
+  <div class="seek">
+    <div class="com-mobile-header mobile-center-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p>{{seekTitle}}</p>
+      <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
+    </div>
+    <div class="mobile-fix-content mobile-centerfix-content" id="mobileFixContent">
+      <div class="seek-title com-switch-item" v-if="userType == 'saler' && seekType == 'enterprise'">
+        <span class="mobile-switch-btn" :class="{'active': activeType=='todo'}" @click="switchActiveType('todo')"><b>待报价</b></span>
+        <span class="mobile-switch-btn" :class="{'active': activeType=='done'}" @click="switchActiveType('done')"><b>已报价</b></span>
+      </div>
+      <div class="seek-title com-switch-item" v-if="userType == 'saler' && seekType == 'personage'">
+        <span class="mobile-switch-btn" :class="{'active': activeType=='todo'}" @click="switchActiveType('todo')"><b>待报价</b></span>
+        <span class="mobile-switch-btn" :class="{'active': activeType=='done'}" @click="switchActiveType('done')"><b>已报价</b></span>
+      </div>
+      <div class="seek-title com-switch-item" v-if="userType == 'saler' && seekType == 'enquiry'">
+        <span class="mobile-switch-btn fours" :class="{'active': activeType=='todo'}" @click="switchActiveType('todo')"><b>待报价</b></span>
+        <span class="mobile-switch-btn fours" :class="{'active': activeType=='done'}" @click="switchActiveType('done')"><b>已报价</b></span>
+        <span class="mobile-switch-btn fours" :class="{'active': activeType=='agreed'}" @click="switchActiveType('agreed')"><b>已采纳</b></span>
+        <span class="mobile-switch-btn fours" :class="{'active': activeType=='invalid'}" @click="switchActiveType('invalid')"><b>已失效</b></span>
+      </div>
+      <div class="product-switch-item" v-if="userType == 'buyer' && seekType !== 'done'">
+        <span :class="overdue==='attention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('attention')">未截止</span>
+        <span :class="overdue==='isattention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('isattention')">已截止</span>
+      </div>
+      <div class="search-content">
+        <input type="text" v-model="seekKeyword" :placeholder="userType == 'buyer' ? '品牌/型号' : '品牌/物料名称/型号/规格/公司'" @keyup.13="onSearch">
+        <span @click="onSearch"><i class="iconfont icon-sousuo"></i></span>
+      </div>
+      <seek-list :keyword="remindKeyword" :isSearch="isSearch" :userType="userType" :seekType="seekType" :activeType="activeType" :purchaseManList="purchaseManListData"></seek-list>
+      <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
+    </div>
   </div>
 </template>
 <script>
@@ -42,7 +76,7 @@
         isChange: false,
         isSearch: false,
         remindKeyword: '',
-        activeType: 'all',
+        activeType: 'todo',
         overdue: 'attention'
       }
     },
@@ -56,7 +90,7 @@
       'purchase.data': {
         handler: function (val) {
           let list = this.baseUtils.deepCopy(val.content || [])
-          if (this.seekType === 'done' && this.userType === 'saler') {
+          if (this.activeType === 'done' && this.userType === 'saler') {
             list.map(val => {
               val.quotation = {
                 replies: val.replies,
@@ -90,16 +124,16 @@
         return Math.floor(this.purchase.data.totalElements / this.purchase.data.size) + Math.floor(this.purchase.data.totalElements % this.purchase.data.size > 0 ? 1 : 0)
       },
       seekTitle () {
-        if (this.seekType === 'wait') {
-          if (this.userType === 'saler') {
-            return '商机管理'
-          } else {
-            return '待报价'
-          }
-        } else if (this.seekType === 'done') {
-          return '已报价'
+        let title = ''
+        switch (this.seekType) {
+          case 'todo': title = '待报价'; break
+          case 'done': title = '已报价'; break
+          case 'personage': title = '我的商机'; break
+          case 'enterprise': title = '公司商机'; break
+          case 'enquiry': title = '定向询价'; break
+          default: title = '已报价'
         }
-        return '已报价'
+        return title
       }
     },
     mounted () {
@@ -141,9 +175,9 @@
       },
       myActiveType: function () {
         if (this.$store.state.option.messageType) {
-          this.activeType = 'self'
+          this.activeType = 'done'
         } else {
-          this.activeType = 'all'
+          this.activeType = 'todo'
         }
       }
     }
@@ -192,9 +226,24 @@
      /* height: $seekTitleLine;
       line-height: $seekTitleLine;*/
       font-size: .28rem;
-      /*&.active {
-        border-bottom-width: .07rem;
-      }*/
+      &.active {
+        b{
+          border-bottom: .04rem solid #3f84f6;
+        }
+        border-bottom:none;
+      }
+      width:50%;
+      b{
+        display:inline-block;
+         font-weight: normal;
+        line-height: .64rem;
+       }
+      &:first-child{
+        margin:0;
+      }
+      &.fours{
+        width:25%;
+      }
     }
   }
 </style>

+ 8 - 4
components/store/home/StoreBanner.vue

@@ -22,9 +22,7 @@
         <div class="logo" v-else-if="storeInfo.type == 'DISTRIBUTION'">经销商</div>
         <div class="shop-logo">
           <img class="logo-img" :src="storeInfo.logoUrl || '/images/store/common/default.png'" />
-         <!-- <p id="shop-title" v-if="storeInfo.storeShortName" v-text="storeInfo.storeShortName">店铺名称</p>-->
-          <p class="shop-name" v-if="storeInfo.storeName" :title="storeInfo.storeName">{{storeInfo.storeName | nameFilter}}</p>
-          <p class="shop-name" v-else></p>
+          <input type="text" readonly class="form-control shop-name" :value="storeInfo.storeName">
           <div class="enter-store">
             <a v-if="isFocus === 'false'" @click="focusStore(storeInfo, $event)">关注店铺</a>
             <a v-else class="focus" @click="focusStore(storeInfo, $event)">已关注</a>
@@ -395,10 +393,16 @@ export default {
     position: relative;
     background: #fff;
     .shop-name{
+      display:block;
       height: 40px;
       line-height: 40px;
+      margin: 0 auto;
       margin-top: -105px;
-      width: 100%;
+      text-align: center;
+      width: 95%;
+      border: none;
+      background: none;
+      box-shadow: none;
     }
     .enter-store {
       width: 100%;

+ 25 - 0
layouts/mobileActivity.vue

@@ -0,0 +1,25 @@
+<template>
+  <div id="mobile">
+    <nuxt/>
+  </div>
+</template>
+<script>
+  export default {
+    name: 'mobileActivity',
+    head () {
+      return {
+        meta: [
+          { name: 'apple-mobile-web-app-capable', content: 'yes' },
+          { name: 'MobileOptimized', content: '320' },
+          { name: 'HandheldFriendly', content: 'true' },
+          { name: 'viewport', content: 'width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no' },
+          { 'http-equiv': 'Cache-Control', content: 'no-siteapp' },
+          { name: 'format-detection', content: 'telephone=no, email=no' }
+        ]
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  @import '~assets/scss/mobileCommon';
+</style>

+ 5 - 1
nuxt.config.js

@@ -208,6 +208,10 @@ module.exports = {
     // 代办事项
     '/adminToDo/**': baseUrl,
     // 账户中心获取申请绑定列表接口
-    '/api/userspace/apply/**': ssoUrl
+    '/api/userspace/apply/**': ssoUrl,
+    // B2B服务接口 uasUrl
+    '/sale/inquiry/**': uasUrl,
+    '/sale/orders/**': uasUrl,
+    '/token**': uasUrl
   }
 }

+ 10 - 6
pages/mobile/center/vendor/index.vue

@@ -29,13 +29,17 @@
       <div class="block-wrap seek-operation">
         <p><i></i>商机管理</p>
         <ul>
-          <nuxt-link to="/mobile/center/vendor/seek?seekType=wait" tag="li">
+          <nuxt-link to="/mobile/center/vendor/seek?seekType=enterprise" tag="li">
             <img src="/images/mobile/center/vendor/all.png" alt="">
             <p>公司商机</p>
           </nuxt-link>
-          <nuxt-link to="/mobile/center/vendor/seek?seekType=done" tag="li">
+          <nuxt-link to="/mobile/center/vendor/seek?seekType=personage" tag="li">
             <img src="/images/mobile/center/vendor/seek-done.png" alt="">
-            <p>已报价</p>
+            <p>我的商机</p>
+          </nuxt-link>
+          <nuxt-link to="/mobile/center/vendor/seek?seekType=enquiry" tag="li">
+            <img src="/images/mobile/center/vendor/seek-enquiry.png" alt="">
+            <p>定向询价</p>
           </nuxt-link>
           <nuxt-link to="/mobile/center/vendor/attentionBus" tag="li">
             <img src="/images/mobile/center/vendor/attention-bu.png" alt="">
@@ -46,7 +50,7 @@
       <div class="block-wrap seek-operation">
         <p><i></i>更多服务</p>
         <ul>
-          <nuxt-link tag="li" to="/mobile/order?type=saler">
+          <nuxt-link tag="li" to="/mobile/order/orderbtob">
             <img src="/images/mobile/center/user/order.jpg" alt="">
             <p>销售订单</p>
           </nuxt-link>
@@ -85,9 +89,9 @@
       }
     },
     fetch ({ store }) {
-       let user = store.state.option.user.data
+      // let user = store.state.option.user.data
       return Promise.all([
-        store.dispatch('loadStoreStatus', { op: 'check' }),
+        store.dispatch('loadStoreStatus', { op: 'check' })
         // store.dispatch('messageShow/loadMessageCount', {receiverUu: user.userUU, receiverEnuu: user.enterprise.uu, consumerApp: 'MALL', isRead: 0})
       ])
     },

+ 78 - 41
pages/mobile/center/vendor/seek.vue

@@ -6,35 +6,38 @@
   export default {
     layout: 'mobileNoHeader',
     middleware: 'authenticated',
-    data () {
-      return {
-        activeType: 'all'
-      }
-    },
     fetch ({ store, query }) {
       let user = store.state.option.user.data
-      let params = {
-        pageNumber: 1,
-        pageSize: 10
-      }
-      if (query.seekType === 'wait') {
+      let params = {}
+      if (query.seekType === 'enterprise') {
         params.enuu = user.enterprise.uu
         params.useruu = user.userUU
         params.enableOffer = 1
         return Promise.all([
-          store.dispatch('applyPurchase/loadVendorEnPushList', params)
+          store.dispatch(`applyPurchase/loadVendorEnPushList`, params)
+        ])
+      } else if (query.seekType === 'personage') {
+        params.enuu = user.enterprise.uu
+        params.useruu = user.userUU
+        params.enableOffer = 1
+        return Promise.all([
+          store.dispatch(`applyPurchase/loadVendorPushList`, params)
         ])
       } else {
-        params._state = 'done'
-        params.filter = {
-          vendUU: user.enterprise.uu,
-          fromDate: null,
-          endDate: null,
-          keyword: null
+        params.page = 1
+        params.count = 10
+        params._state = 'todo'
+        params.searchFilter = {
+          'fromDate': null,
+          'endDate': null
+        }
+        params.sorting = {
+          'inquiry.date': 'desc',
+          'inquiry.enterprise.enName': 'asc',
+          'inquiry.code': 'asc'
         }
-        params.overdue = 1
         return Promise.all([
-          store.dispatch('applyPurchase/loadVendorPurchaseManList', params)
+          store.dispatch(`applyPurchase/loadVendorEnquiryList`, params)
         ])
       }
     },
@@ -42,34 +45,68 @@
       Seek
     },
     methods: {
-      reloadData: function (page = 1, count = 10, keyword, seekType, activeType = 'all') {
+      reloadData: function (page = 1, count = 10, keyword, seekType, activeType = 'done') {
         let store = this.$store
         let user = store.state.option.user.data
-        let params = {
-          pageNumber: page,
-          pageSize: count
-        }
-        if (seekType === 'wait') {
-          params.enuu = user.enterprise.uu
-          params.useruu = user.userUU
-          params.keyword = keyword
-          params.enableOffer = 1
+        let params = {}
+        if (seekType === 'enquiry' && !keyword) {
+          params.page = page
+          params.count = count
+          params._state = activeType
+          params.searchFilter = {
+              'fromDate': null,
+              'endDate': null
+            }
+          params.sorting = {
+            'inquiry.date': 'desc',
+            'inquiry.enterprise.enName': 'asc',
+            'inquiry.code': 'asc'
+          }
           return Promise.all([
-            store.dispatch(`applyPurchase/${activeType === 'all' ? 'loadVendorEnPushList' : 'loadVendorPushList'}`, params)
+            store.dispatch(`applyPurchase/loadVendorEnquiryList`, params)
           ])
+        } else if (seekType === 'enquiry' && keyword) {
+            params.page = page
+            params.count = count
+            params._state = activeType
+            params.searchFilter = {
+              'keyword': keyword,
+              'fromDate': null,
+              'endDate': null
+            }
+            params.sorting = {
+              'inquiry.date': 'desc',
+              'inquiry.enterprise.enName': 'asc',
+              'inquiry.code': 'asc'
+            }
+            return Promise.all([
+              store.dispatch(`applyPurchase/loadVendorEnquirySearchList`, params)
+            ])
         } else {
-          params._state = 'done'
-          params.filter = {
-            userUU: activeType === 'self' ? user.userUU : null,
-            vendUU: user.enterprise.uu,
-            fromDate: null,
-            endDate: null,
-            keyword: keyword
+          params.pageNumber = page
+          params.pageSize = count
+          if (activeType !== 'done') {
+            params.enuu = user.enterprise.uu
+            params.useruu = user.userUU
+            params.keyword = keyword
+            params.enableOffer = 1
+            return Promise.all([
+              store.dispatch(`applyPurchase/${seekType === 'enterprise' ? 'loadVendorEnPushList' : 'loadVendorPushList'}`, params)
+            ])
+          } else {
+            params._state = 'done'
+            params.filter = {
+              userUU: seekType === 'personage' ? user.userUU : null,
+              vendUU: user.enterprise.uu,
+              fromDate: null,
+              endDate: null,
+              keyword: keyword
+            }
+            params.overdue = 1
+            return Promise.all([
+              store.dispatch('applyPurchase/loadVendorPurchaseManList', params)
+            ])
           }
-          params.overdue = 1
-          return Promise.all([
-            store.dispatch('applyPurchase/loadVendorPurchaseManList', params)
-          ])
         }
       }
     }

+ 391 - 0
pages/mobile/center/vendor/seek_btob_details.vue

@@ -0,0 +1,391 @@
+<template>
+  <div class="orderbtob_details_wrapper">
+    <div class="mobile-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p v-if="active === 'done'">已报价</p>
+      <p v-if="active === 'invalid'">已失效</p>
+      <p v-if="active === 'agreed'">已采纳</p>
+      <p v-if="active === 'todo'">我要报价</p>
+    </div>
+    <div class="orderbtob_details_content">
+      <div class="orderbtob_details_top">
+        <div class="item">
+          <span class="name">客户:</span>
+          {{listInfo.inquiry.enterprise && listInfo.inquiry.enterprise.enName}}
+        </div>
+        <div class="item clearfix">
+          <span class="name fl">收货地址:</span>
+          <span class="fl" style="width: 5.2rem">{{listInfo.inquiry.ship}}</span>
+        </div>
+        <div class="item">
+          <span class="name">订单号:</span>
+          {{listInfo.inquiry.code}}
+        </div>
+        <div class="item">
+          <span class="name">单据时间:</span>
+          {{listInfo.inquiry.date | time}}
+        </div>
+        <div class="item">
+          <span class="name">备注:</span>
+          {{listInfo.remark || '无'}}
+        </div>
+        <div class="item">
+          <span class="name">币别:</span>
+          {{listInfo.currency}}
+        </div>
+        <!--<div class="item">-->
+          <!--<span class="name">金额:</span>-->
+          <!--{{listInfo.sum}}-->
+        <!--</div>-->
+      </div>
+      <div class="orderbtob_details_middle">
+        <div class="list">
+          <template v-if="listInfo.status === 200">
+            <div class="item clearfix">
+              <span class="name">交货周期:</span>
+              <input type="number" class="dateinput" v-model="listInfo.leadtime" >天
+            </div>
+            <div class="item clearfix">
+              <span class="name">最小起订:</span>
+              <input type="number" class="dateinput" v-model="listInfo.minOrderQty" >PCS
+            </div>
+            <div class="item clearfix">
+              <span class="name">最小包装:</span>
+              <input type="number" class="dateinput" v-model="listInfo.minPackQty">PCS
+            </div>
+          </template>
+          <template v-else>
+            <div class="item clearfix">
+              <span class="name">交货周期:</span>
+              <span>{{listInfo.leadtime}}天</span>
+            </div>
+            <div class="item clearfix">
+              <span class="name">最小起订:</span>
+              <span>{{listInfo.minOrderQty}}PCS</span>
+            </div>
+            <div class="item clearfix">
+              <span class="name">最小包装:</span>
+              <span>{{listInfo.minPackQty}}PCS</span>
+            </div>
+          </template>
+          <div class="item clearfix" style="position: relative">
+            <span class="fl name">分段报价:</span>
+            <ul class="fl table">
+              <li class="li_title clearfix">
+                <div class="fl fisrt">段数</div>
+                <div class="fl">分段数量</div>
+                <div class="fl" >分段单价</div>
+              </li>
+              <li class="li_content clearfix" v-for="(item, index) in listInfo.replies">
+                <div class="fl fisrt">{{index + 1}}</div>
+                <div class="fl" v-if="index === 0">
+                  <input type="number" value="0" disabled readonly />
+                </div>
+                <div class="fl" v-if="index !== 0">
+                  <input type="number" value="item.lapQty" />
+                </div>
+                <div class="fl" >
+                  <input type="number" v-model="item.price" readonly="listInfo.status !== 200"/>
+                </div>
+              </li>
+              <div class="posixicon">
+                <i class="iconfont icon-add" @click="addItem()"></i>
+                <i class="iconfont icon-minus" @click="deleteItem()"></i>
+              </div>
+            </ul>
+            <div style="clear:both"></div>
+            <div class="replayBtn" @click="Replay(item)" v-if="listInfo.status === 200">
+              报价
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+
+<script>
+  import { RemindBox } from '~components/mobile/common'
+  export default {
+    name: 'seek_btob_details',
+    layout: 'mobileActivity',
+    middleware: 'authenticated',
+    data() {
+      return {
+        active: this.$route.query.active,
+        listInfo: {
+          inquiry: {
+
+          },
+          replies: [{
+            lapQty: 0,
+            price: ''
+          }]
+        },
+        token: '',
+        collectResult: '',
+        timeoutCount: 0
+      }
+    },
+    created() {
+      this.getInitInfo()
+      this._getToken()
+    },
+    methods: {
+      addItem() {
+        this.listInfo.replies.push({
+          lapQty: '',
+          price: ''
+        })
+      },
+      deleteItem() {
+        if (this.listInfo.replies.length === 1) {
+          return
+        }
+        this.listInfo.replies.splice(this.listInfo.replies.length - 1, 1)
+      },
+      Replay() {
+        if (this.listInfo.leadtime === '') {
+          this._iniFo('交货周期不能为空')
+          return
+        } else if (this.listInfo.minOrderQty === '') {
+          this._iniFo('最小起订量不能为空')
+          return
+        } else if (this.listInfo.minPackQty === '') {
+          this._iniFo('最小包装不能为空')
+          return
+        }
+        let replies = []
+        // 判断分段数是否合法
+        let valid = true
+        let validLapQty = 0
+        this.listInfo.replies.forEach(function (r, i) {
+          if ((i > 0 ? r.lapQty : 1) || r.price) {
+            replies.push(r)
+          }
+          // 直接比较是字符串比较,需要先转换再比较  2017年9月7日 15:05:51
+          if (i > 0 && parseInt(r.lapQty) <= parseInt(this.listInfo.replies.replies[i - 1].lapQty) || r.lapQty == null) {
+            valid = false
+            validLapQty = r.lapQty
+          }
+        })
+        if (!valid) {
+          if (validLapQty) {
+            this._iniFo('分段' + validLapQty + '小于等于了上一分段数,不能保存!')
+          } else {
+            this._iniFo('分段数量不合法,不能保存!')
+          }
+          return
+        }
+        this.listInfo.replies = replies
+        this.$http.post(`/sale/inquiry/items/${this.$route.query.id}/reply?token=${this.token}`, this.listInfo).then(res => {
+          this._iniFo('报价成功')
+          this.getInitInfo()
+        })
+      },
+      _iniFo(str) {
+        this.collectResult = str
+        this.timeoutCount++
+      },
+      getInitInfo() {
+        this.$http.get(`/sale/inquiry/${this.$route.query.id}/info/mobile`).then(res => {
+          if (!res.data.replies[0].price || res.data.replies[0].price === '') {
+            res.data.replies[0].price = ''
+          }
+          this.listInfo = res.data
+        })
+      },
+      _getToken() {
+        this.$http.get('/token?userType=sale').then(res => {
+          this.token = res.data.token
+        })
+      }
+    },
+    components: {
+      RemindBox
+    },
+    filters: {
+      time: function(time) {
+        if (typeof time === 'number') {
+          if (!time) {
+            return '无'
+          } else {
+            let d = new Date(time)
+            let year = d.getFullYear()
+            let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : '' + (d.getMonth() + 1)
+            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+            return year + '-' + month + '-' + day
+          }
+        }
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .orderbtob_details_wrapper {
+    background: #f5f5f5;
+    .mobile-header{
+      position: fixed;
+      top: 0;
+      z-index: 10;
+      width:100%;
+      height:.88rem;
+      line-height: .88rem;
+      /*border-bottom:.01rem solid #ccc;*/
+      background: #3e82f5;
+      padding:0 .2rem 0 .1rem;
+      color:#fff;
+    }
+    .mobile-header p{
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+      font-size:.36rem;
+      text-align: center;
+      margin: 0;
+      width: 6rem;
+      padding-left: 1rem;
+    }
+    .mobile-header a{
+      font-size:.28rem;
+      color:#fff;
+      position: absolute;
+    }
+    .mobile-header a i{
+      font-size: .48rem;
+      margin-right: -.1rem;
+    }
+    .orderbtob_details_content {
+      margin-top: 0.9rem;
+      padding: 0.2rem;
+      .orderbtob_details_top {
+        background: #3f84f6;
+        border-radius: 0.07rem;
+        border: solid 0.01rem #e3e5e8;
+        padding: 0.24rem 0.2rem 0.14rem;
+        .item {
+          color: #fff;
+          font-size: 0.28rem;
+          margin-bottom: 0.1rem;
+        }
+      }
+      .orderbtob_details_middle {
+        margin-top: 0.2rem;
+        .list {
+          border: solid 1px #e3e5e8;
+          border-radius: 0.07rem;
+          overflow: hidden;
+          color: #333;
+          font-size: 0.28rem;
+          padding: 0.24rem 0.2rem;
+          margin-bottom: 0.2rem;
+          background: #fff;
+          .item {
+            margin-bottom: 0.1rem;
+            line-height: 0.5rem;
+          }
+          .ovrflow {
+            width: 5.2rem;
+            line-height: 0.5rem
+          }
+          .name {
+            color: #666;
+            width: 1.4rem;
+            display: inline-block;
+          }
+          .dateinput {
+            width: 3.49rem;
+            height: .5rem;
+            line-height: .5rem;
+            border: 1px solid #aeaeae;
+            font-size: .26rem;
+            vertical-align: middle;
+            background: #fff;
+            border-radius: 0;
+            margin-right: 0.05rem;
+          }
+        }
+        .replayBtn {
+          width: 6.59rem;
+          height: 0.77rem;
+          background-color: #3f84f6;
+          border-radius: 0.08rem;
+          font-size: 0.28rem;
+          line-height: 0.77rem;
+          color: #ffffff;
+          overflow: hidden;
+          text-align: center;
+          margin-top: 0.2rem
+        }
+        .table {
+          width: 4.52rem;
+          background-color: #f3f3f3;
+          color: #333333;
+          font-size: 0.28rem;
+          .li_title {
+            border: 1px solid #c5c5c5;
+            div {
+              width: 1.87rem;
+              text-align: center;
+              border-right: 1px solid #c5c5c5;
+              &:last-child {
+                border-right: 0
+              }
+            }
+            .fisrt {
+              width: 0.74rem;
+            }
+          }
+          .li_content {
+            border: 1px solid #c5c5c5;
+            background: #fff;
+            border-top: 0px;
+            div {
+              width: 1.87rem;
+              text-align: center;
+              border-right: 1px solid #c5c5c5;
+              &:last-child {
+                border-right: 0
+              }
+              input {
+                text-align: center;
+                width: 100%;
+                height: 0.5rem;
+                border: 0;
+              }
+            }
+            .fisrt {
+              width: 0.74rem;
+            }
+          }
+        }
+      }
+      .bottom {
+        font-size: 0.2rem;
+        color: #999;
+        border-top: 1px solid #aeaeae;
+        padding-top: 0.1rem;
+      }
+      .noborder{
+        border: 0
+      }
+    }
+    .icon-add {
+      color: #00d300;
+      font-size: 0.4rem
+    }
+    .icon-minus {
+      color: #cacaca;
+      font-size: 0.4rem;
+      display: block;
+    }
+    .posixicon {
+      position: absolute;
+      right: 0.3rem;
+      width: 0.4rem;
+      top: 0;
+    }
+  }
+</style>

+ 530 - 496
pages/mobile/order/index.vue

@@ -1,5 +1,13 @@
 <template>
   <div class="order-wrapper">
+    <div class="order-tab" v-if="vendorType === 'saler'">
+      <div class="order-tab-wrapper clearfix">
+        <nuxt-link class="fl tab" to="/mobile/order/orderbtob" tag="div" >
+          B2B
+        </nuxt-link>
+        <div class="fl active tab">商城</div>
+      </div>
+    </div>
     <div class="order-nav">
       <div :class="activeType === '' ? 'active': ''" @click="ChangeList('')"><span>全部</span></div>
       <div :class="activeType === 'tobeconfirmed' ? 'active' : ''" @click="ChangeList('tobeconfirmed')"><span>待付款</span></div>
@@ -18,7 +26,7 @@
           <i class="iconfont icon-sousuo"></i>
       </span>
     </div>
-    <ul class="order-list-wrap"  id="order-wrapper" v-show="orderList.length > 0">
+    <ul class="order-list-wrap" :class="vendorType === 'saler' ? 'order-list-wrap2' : ''"  id="order-wrapper" v-show="orderList.length > 0">
       <li class="clearfix" v-for="item in orderList">
         <div class="orderNumber clearfix">
           <div class="pull-left">订单号:<span>{{item.orderid}}</span></div>
@@ -270,7 +278,7 @@
              :allPage="allPage"
              :page="page"
              @pullUpAction="getMoreSearch"></pull-up>
-  </div>
+    </div>
 </template>
 
 <script>
@@ -914,572 +922,598 @@
     height: $value;
     line-height: $value;
   }
-.order-wrapper {
-  background: #f1f3f6;
-  margin: 1.26rem 0 0.98rem 0;
-  height: calc(100vh - 1.26rem - 0.98rem);
-  /*padding-bottom: 0.96rem;*/
-  .order-nav {
-    background: #fff;
-    div {
-      height: 0.82rem;
-      line-height: 0.82rem;
-      display: inline-block;
-      width: 25%;
-      text-align: center;
-      font-size: .28rem;
-      color: #666;
-      &.active span{
-        color: #3f84f6;
-        border-bottom: 0.04rem solid #3f84f6;
-        padding-bottom: 0.2rem;
+  .order-wrapper {
+    background: #f1f3f6;
+    margin: 1.26rem 0 0.98rem 0;
+    height: calc(100vh - 1.26rem - 0.98rem);
+    /*padding-bottom: 0.96rem;*/
+    .order-tab {
+      background: #3f84f6;
+      padding-bottom: 0.2rem;
+      .order-tab-wrapper {
+        border: solid 1px #ffffff;
+        width: 7.06rem;
+        margin: 0 auto;
+        border-radius: 0.04rem;
+        line-height: 0.72rem;
+        height: 0.72rem;
+        overflow: hidden;
+        div {
+          color: #ffffff;
+          font-size: 0.28rem;
+          text-align: center;
+          width: 50%;
+          &.active {
+            background-color: #ffffff;
+            color: #3f84f6;
+          }
+        }
       }
     }
-  }
-  .search-content2 {
-    text-align: center;
-    padding: .25rem 0 0 0;
-    margin-top: 0 !important;
-    input {
-      width: 7.1rem;
-      border: 1px solid #376ff3;
-    }
-    span {
-      /*height: .46rem;*/
-      /*line-height: .46rem;*/
+    .order-nav {
+      background: #fff;
+      div {
+        height: 0.82rem;
+        line-height: 0.82rem;
+        display: inline-block;
+        width: 25%;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        &.active span{
+          color: #3f84f6;
+          border-bottom: 0.04rem solid #3f84f6;
+          padding-bottom: 0.2rem;
+        }
+      }
     }
-  }
-  .order-list-wrap {
-    height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem);
-    overflow-y: scroll;
-    li {
-      margin-bottom: 0.2rem;
+    .search-content2 {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      margin-top: 0 !important;
+      input {
+        width: 7.1rem;
+        border: 1px solid #376ff3;
+      }
+      span {
+        /*height: .46rem;*/
+        /*line-height: .46rem;*/
+      }
     }
-    .list-wrap-title{
-       padding: 0 0.2rem;
-       background: #fff;
-       @include lineHeight(0.67rem);
-       font-size: 0.28rem;
-       color: #333;
-       border-bottom: 1px solid #e4e4e4;
-       .pull-left {
-         width: 5rem;
-         @include overFlowHidden();
-         span {
-           max-width: 3rem;
+    .order-list-wrap {
+      height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem);
+      overflow-y: scroll;
+      li {
+        margin-bottom: 0.2rem;
+      }
+      .list-wrap-title{
+         padding: 0 0.2rem;
+         background: #fff;
+         @include lineHeight(0.67rem);
+         font-size: 0.28rem;
+         color: #333;
+         border-bottom: 1px solid #e4e4e4;
+         .pull-left {
+           width: 5rem;
            @include overFlowHidden();
-           display: inline-block;
-         }
-         img {
-           width: 0.18rem;
-           height: 0.32rem;
-           vertical-align: top;
-           margin-top: 0.18rem;
-           margin-left: 0.1rem;
+           span {
+             max-width: 3rem;
+             @include overFlowHidden();
+             display: inline-block;
+           }
+           img {
+             width: 0.18rem;
+             height: 0.32rem;
+             vertical-align: top;
+             margin-top: 0.18rem;
+             margin-left: 0.1rem;
+           }
          }
-       }
-       .pull-right {
-         .red {
-           color: #f21c1c;
+         .pull-right {
+           .red {
+             color: #f21c1c;
+           }
          }
-       }
-    }
-    .list-wrap-content {
-      background: #f9f9f8;
-      padding: 0.3rem 0.2rem;
-      padding-right: 0.32rem;
-      border-bottom: 1px solid #e4e4e4;
-      .list-item {
-        font-size: 0.28rem;
-        color: #333;
-        /*line-height: 0.5rem;*/
-        margin-top: 0.22rem;
-        &:nth-child(1) {
-          margin-top: 0px;
-        }
-        .list-wrap-content-brand {
-          @include overFlowHidden();
-          .spec {
-            width: 3.1rem;
+      }
+      .list-wrap-content {
+        background: #f9f9f8;
+        padding: 0.3rem 0.2rem;
+        padding-right: 0.32rem;
+        border-bottom: 1px solid #e4e4e4;
+        .list-item {
+          font-size: 0.28rem;
+          color: #333;
+          /*line-height: 0.5rem;*/
+          margin-top: 0.22rem;
+          &:nth-child(1) {
+            margin-top: 0px;
+          }
+          .list-wrap-content-brand {
             @include overFlowHidden();
-            margin-right: 0.2rem;
-            &.noMargin {
-              margin-right: 0;
-              width: 1.5rem;
+            .spec {
+              width: 3.1rem;
+              @include overFlowHidden();
+              margin-right: 0.2rem;
+              &.noMargin {
+                margin-right: 0;
+                width: 1.5rem;
+              }
             }
           }
+          .name {
+            color: #666;
+          }
+          .lab {
+            color: #999;
+            font-size: 0.24rem;
+            max-width: 2.1rem;
+            @include overFlowHidden();
+            span {
+              font-size: 0.16rem;
+            }
+          }
+          .pri {
+            font-size: 0.28rem;
+            color: #f43938;
+            @include overFlowHidden();
+            width: 2.4rem;
+          }
         }
-        .name {
-          color: #666;
-        }
-        .lab {
-          color: #999;
-          font-size: 0.24rem;
-          max-width: 2.1rem;
+      }
+      .orderNumber {
+        font-size: 0.27rem;
+        color: #666;
+        border-bottom: 1px solid #e4e4e4;
+        @include lineHeight(0.88rem);
+        background: #fff;
+        padding: 0 0.2rem;
+        .pull-left {
+          width: 5rem;
           @include overFlowHidden();
           span {
-            font-size: 0.16rem;
+            color: #3f84f6
           }
         }
-        .pri {
-          font-size: 0.28rem;
-          color: #f43938;
-          @include overFlowHidden();
-          width: 2.4rem;
-        }
       }
-    }
-    .orderNumber {
-      font-size: 0.27rem;
-      color: #666;
-      border-bottom: 1px solid #e4e4e4;
-      @include lineHeight(0.88rem);
-      background: #fff;
-      padding: 0 0.2rem;
-      .pull-left {
-        width: 5rem;
+      .list-all-info{
+        text-align: right;
+        background: #fff;
+        padding: 0 0.2rem;
         @include overFlowHidden();
-        span {
-          color: #3f84f6
-        }
-      }
-    }
-    .list-all-info{
-      text-align: right;
-      background: #fff;
-      padding: 0 0.2rem;
-      @include overFlowHidden();
-      line-height: 0.66rem;
-      font-size: 0.26rem;
-      color: #333;
-      border-bottom: 1px solid #e4e4e4;
-      .pri {
-        font-size: 0.32rem;
-        color: #f43938;
-      }
-      .red {
-        color: #f43938;
-        font-size: 0.24rem;
-      }
-      .lab {
-        color: #999;
-        font-size: 0.24rem;
-      }
-    }
-    .list-btn {
-      background: #fff;
-      @include lineHeight(0.8rem);
-      padding: 0 0.2rem;
-      div {
-        display: inline-block;
-        width: 1.5rem;
-        @include lineHeight(0.56rem);
-        border: 1px solid #333;
+        line-height: 0.66rem;
         font-size: 0.26rem;
         color: #333;
-        text-align: center;
-        margin-top: 0.11rem;
-        margin-left: 0.2rem;
-        border-radius: 3px;
-        &.sendGoods {
+        border-bottom: 1px solid #e4e4e4;
+        .pri {
+          font-size: 0.32rem;
           color: #f43938;
-          border: 1px solid #f43938;
         }
-        &.cancat {
-          height: 0.56rem;
-          line-height: 0.56rem;
-          border: 1px solid #3f84f6;
-          color: #3f84f6;
+        .red {
+          color: #f43938;
+          font-size: 0.24rem;
+        }
+        .lab {
+          color: #999;
+          font-size: 0.24rem;
+        }
+      }
+      .list-btn {
+        background: #fff;
+        @include lineHeight(0.8rem);
+        padding: 0 0.2rem;
+        div {
+          display: inline-block;
+          width: 1.5rem;
+          @include lineHeight(0.56rem);
+          border: 1px solid #333;
           font-size: 0.26rem;
+          color: #333;
           text-align: center;
+          margin-top: 0.11rem;
+          margin-left: 0.2rem;
           border-radius: 3px;
-          padding: 0 0.1rem;
-          overflow: hidden;
-          width: auto;
-          i {
+          &.sendGoods {
+            color: #f43938;
+            border: 1px solid #f43938;
+          }
+          &.cancat {
+            height: 0.56rem;
+            line-height: 0.56rem;
+            border: 1px solid #3f84f6;
+            color: #3f84f6;
             font-size: 0.26rem;
+            text-align: center;
+            border-radius: 3px;
+            padding: 0 0.1rem;
+            overflow: hidden;
+            width: auto;
+            i {
+              font-size: 0.26rem;
+            }
           }
         }
       }
-    }
-    .lookMorePro {
-      background: #fff;
-      font-size: 0.28rem;
-      color: #999;
-      text-align: center;
-      border-bottom: 1px solid #e4e4e4;
-      @include lineHeight(0.67rem);
-      img {
-        transform: rotate(90deg);
-        width: 0.16rem;
-        height: 0.26rem;
-        vertical-align: top;
-        margin-top: 0.23rem;
-        margin-left: 0.1rem;
-      }
-    }
-  }
-  .sendGoods_Alert {
-    background: #fff;
-    position: fixed;
-    bottom: 0.98rem;
-    left: 0;
-    width: 100%;
-    border-top-left-radius: 5px;
-    border-top-right-radius: 5px;
-    overflow: hidden;
-    .sendGoods_title {
-      color: #333;
-      font-size: 0.42rem;
-      text-align: center;
-      line-height: 1rem;
-      font-weight: 600;
-      position: relative;
-      i {
-        position: absolute;
-        font-size: 16px;
-        right: 0.2rem;
-      }
-    }
-    .sendGoods_buyer {
-      padding: 0.3rem 0.2rem;
-      border-bottom: 1px solid #d9d9d9;
-      border-top: 1px solid #d9d9d9;
-      .sendGoods_buyer_top {
-        color: #333;
-        font-size: 0.3rem;
-        font-weight: bold;
-        .name {
-          margin-right: 0.3rem;
-          margin-left: 0.32rem;
-        }
-      }
-      .sendGoods_buyer_bottom {
-        color: #333;
-        font-size: 0.26rem;
-        margin-top: 0.2rem;
-        img {
-          width: 0.22rem;
-          height: 0.29rem;
-          margin-right: 0.1rem;
-          margin-top: -0.1rem;
-        }
-      }
-    }
-    .sendGoods_list {
-      padding: 0 0.2rem;
-      @include lineHeight(0.8rem);
-      border-bottom: 1px solid #d9d9d9;
-      font-size: 0.32rem;
-      color: #333;
-      /*.ti {*/
-        /*font-weight: bold;*/
-      /*}*/
-      .pull-right {
+      .lookMorePro {
+        background: #fff;
         font-size: 0.28rem;
         color: #999;
+        text-align: center;
+        border-bottom: 1px solid #e4e4e4;
+        @include lineHeight(0.67rem);
         img {
-          width: 0.14rem;
-          height: 0.24rem;
-          vertical-align: middle;
-          margin-top: -0.02rem;
+          transform: rotate(90deg);
+          width: 0.16rem;
+          height: 0.26rem;
+          vertical-align: top;
+          margin-top: 0.23rem;
           margin-left: 0.1rem;
         }
       }
-      input {
-        width: 4rem;
-        text-align: right;
-        color: #333;
-      }
     }
-    .sendGoods_Btn {
-      @include lineHeight(1rem);
-      text-align: center;
-      color: #fff;
-      font-size: 0.36rem;
-      background: #3f84f6;
+    .order-list-wrap2 {
+      height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem - 0.92rem);
     }
-  }
-  .search-content {
-    margin-top: 0.88rem;
-    margin-bottom: 0.2rem;
-    text-align: center;
-    padding: .25rem 0 0 0;
-    input {
-      border: 1px solid #376ff3;
-    }
-    span {
-      /*height: .46rem;*/
-      /*line-height: .46rem;*/
-    }
-  }
-  .peisong_Alert {
-    background: #f1f3f6;
-    position: fixed;
-    bottom: 0.98rem;
-    left: 0;
-    right: 0;
-    top: 0;
-    z-index: 11111;
-    ul {
-      height: calc(100vh - 1.2rem - 1.7rem - 1rem);
-      overflow-y: scroll;
-      li {
-        line-height: 1rem;
-        background: #fff;
-        padding: 0 0.2rem;
-        font-size: 0.28rem;
-        color: #333;
-        border-bottom: 1px solid #e0e1e2;
-        div.name {
-          @include overFlowHidden();
-        }
-        div.target {
-          width: 0.36rem;
-          height: 0.36rem;
-          border-radius: 50%;
-          overflow: hidden;
-          border: 1px solid #a4a4a4;
-          margin-top: 0.3rem;
-          &.active {
-            background-image: url('/images/order/getChoose_icon.png');
-            background-size: 100% 100%;
-            border: 0px;
-          }
-        }
-      }
-    }
-    .sendGoods_Btn {
-      @include lineHeight(1rem);
-      text-align: center;
-      color: #fff;
-      font-size: 0.36rem;
-      background: #3f84f6;
-    }
-  }
-  .deleteKuang {
-    position: fixed;
-    background: rgba(0,0,0,0.5);
-    top: 0;
-    left: 0;
-    right: 0;
-    bottom: 0;
-    z-index: 9999;
-    .kuangContent {
-      border-radius: 5px;
+    .sendGoods_Alert {
       background: #fff;
-      width: 5rem;
-      position: absolute;
-      left: 50%;
-      top: 50%;
-      transform: translate3d(-50%, -50%, 0);
+      position: fixed;
+      bottom: 0.98rem;
+      left: 0;
+      width: 100%;
+      border-top-left-radius: 5px;
+      border-top-right-radius: 5px;
       overflow: hidden;
-      .titleinfo {
-        font-size: .3rem;
-        color: #666;
-        text-align: center;
-        margin-top: 0.5rem;
-        margin-bottom: 0.1rem;
-      }
-      .title {
-        background: #5078cb;
-        height: .7rem;
-        line-height: .7rem;
-        font-size: .3rem;
-        color: #fff;
-        text-align: center;
-      }
-      .info {
-        color: #f00;
+      .sendGoods_title {
+        color: #333;
+        font-size: 0.42rem;
         text-align: center;
-      }
-      .K_btn {
-        margin-top: 0.4rem;
-        line-height: 0.7rem;
-        height: 0.7rem;
-        &::after{
-          clear: both;
-          display: block;
-          content: ' ';
-          visibility: hidden;
-          zoom: 1;
+        line-height: 1rem;
+        font-weight: 600;
+        position: relative;
+        i {
+          position: absolute;
+          font-size: 16px;
+          right: 0.2rem;
         }
-        div {
-          float: left;
-          width: 50%;
+      }
+      .sendGoods_buyer {
+        padding: 0.3rem 0.2rem;
+        border-bottom: 1px solid #d9d9d9;
+        border-top: 1px solid #d9d9d9;
+        .sendGoods_buyer_top {
+          color: #333;
           font-size: 0.3rem;
-          text-align: center;
-          &.cancelBtn {
-            background: #b4b5b9;
-            color: #333;
+          font-weight: bold;
+          .name {
+            margin-right: 0.3rem;
+            margin-left: 0.32rem;
           }
-          &.answerBtn {
-            background: #5078cb;
-            color: #fff;
+        }
+        .sendGoods_buyer_bottom {
+          color: #333;
+          font-size: 0.26rem;
+          margin-top: 0.2rem;
+          img {
+            width: 0.22rem;
+            height: 0.29rem;
+            margin-right: 0.1rem;
+            margin-top: -0.1rem;
           }
         }
       }
-    }
-    i {
-      font-size: .6rem;
-      position: absolute;
-      right: -0.3rem;
-      top: -0.35rem;
-      color: #fff;
-      &::after{
-        position: absolute;
-        top: -0.1rem;
-        left: -0.1rem;
-        right: -0.1rem;
-        bottom: -0.1rem;
-        content: ' '
+      .sendGoods_list {
+        padding: 0 0.2rem;
+        @include lineHeight(0.8rem);
+        border-bottom: 1px solid #d9d9d9;
+        font-size: 0.32rem;
+        color: #333;
+        /*.ti {*/
+          /*font-weight: bold;*/
+        /*}*/
+        .pull-right {
+          font-size: 0.28rem;
+          color: #999;
+          img {
+            width: 0.14rem;
+            height: 0.24rem;
+            vertical-align: middle;
+            margin-top: -0.02rem;
+            margin-left: 0.1rem;
+          }
+        }
+        input {
+          width: 4rem;
+          text-align: right;
+          color: #333;
+        }
+      }
+      .sendGoods_Btn {
+        @include lineHeight(1rem);
+        text-align: center;
+        color: #fff;
+        font-size: 0.36rem;
+        background: #3f84f6;
       }
     }
-    .title {
-      background: #3f84f6;
-      height: 0.7rem;
-      line-height: 0.7rem;
-      color: #fff;
+    .search-content {
+      margin-top: 0.88rem;
+      margin-bottom: 0.2rem;
       text-align: center;
-      font-size: 0.3rem;
-      position: relative;
-    }
-    .Kuang {
-      max-height: 10rem;
-      width: 6.7rem;
-      position: absolute;
-      left: 50%;
-      top: 50%;
-      transform: translate3d(-50%, -50%, 0);
-      background: #ececec;
-      border-radius: 5px;
+      padding: .25rem 0 0 0;
+      input {
+        border: 1px solid #376ff3;
+      }
+      span {
+        /*height: .46rem;*/
+        /*line-height: .46rem;*/
+      }
     }
-    .content {
-      overflow-y: scroll;
-      max-height: 9.3rem;
-      .infob {
-        background: #e3edfd;
-        padding: 0.2rem;
-        .info {
+    .peisong_Alert {
+      background: #f1f3f6;
+      position: fixed;
+      bottom: 0.98rem;
+      left: 0;
+      right: 0;
+      top: 0;
+      z-index: 11111;
+      ul {
+        height: calc(100vh - 1.2rem - 1.7rem - 1rem);
+        overflow-y: scroll;
+        li {
+          line-height: 1rem;
+          background: #fff;
+          padding: 0 0.2rem;
+          font-size: 0.28rem;
           color: #333;
-          font-size: 0.3rem;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          white-space: nowrap;
-          margin-bottom: 0.18rem;
-          .name {
-            color: #666;
+          border-bottom: 1px solid #e0e1e2;
+          div.name {
+            @include overFlowHidden();
           }
-          div {
-            display: inline-block;
+          div.target {
+            width: 0.36rem;
+            height: 0.36rem;
+            border-radius: 50%;
+            overflow: hidden;
+            border: 1px solid #a4a4a4;
+            margin-top: 0.3rem;
+            &.active {
+              background-image: url('/images/order/getChoose_icon.png');
+              background-size: 100% 100%;
+              border: 0px;
+            }
           }
         }
       }
-      .content_sq {
-        width: 6.4rem;
-        margin: 0.1rem auto;
+      .sendGoods_Btn {
+        @include lineHeight(1rem);
+        text-align: center;
+        color: #fff;
+        font-size: 0.36rem;
+        background: #3f84f6;
+      }
+    }
+    .deleteKuang {
+      position: fixed;
+      background: rgba(0,0,0,0.5);
+      top: 0;
+      left: 0;
+      right: 0;
+      bottom: 0;
+      z-index: 9999;
+      .kuangContent {
+        border-radius: 5px;
         background: #fff;
-        padding: 0.2rem 0rem;
-        .list {
-          margin-bottom: 0.18rem;
+        width: 5rem;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate3d(-50%, -50%, 0);
+        overflow: hidden;
+        .titleinfo {
+          font-size: .3rem;
+          color: #666;
+          text-align: center;
+          margin-top: 0.5rem;
+          margin-bottom: 0.1rem;
         }
-        .fl {
-          width: 3.2rem;
+        .title {
+          background: #5078cb;
+          height: .7rem;
+          line-height: .7rem;
+          font-size: .3rem;
+          color: #fff;
+          text-align: center;
         }
-        .table {
-          width: 4.2rem;
-          margin-top: -0.1rem;
+        .info {
+          color: #f00;
+          text-align: center;
         }
-        .labelinfo {
-          background-image: url('/images/mobile/@2x/labelTop.png');
-          background-repeat: no-repeat;
-          width: 6.29rem;
-          height: 0.64rem;
-          line-height: 0.64rem;
-          background-size: 100%;
-          margin-top: 0rem;
-          margin-right: 0rem;
-          background-color: rgba(0, 0, 0, 0);
-          color: #666;
+        .K_btn {
+          margin-top: 0.4rem;
+          line-height: 0.7rem;
+          height: 0.7rem;
+          &::after{
+            clear: both;
+            display: block;
+            content: ' ';
+            visibility: hidden;
+            zoom: 1;
+          }
+          div {
+            float: left;
+            width: 50%;
+            font-size: 0.3rem;
+            text-align: center;
+            &.cancelBtn {
+              background: #b4b5b9;
+              color: #333;
+            }
+            &.answerBtn {
+              background: #5078cb;
+              color: #fff;
+            }
+          }
         }
       }
-    }
-  }
-  .cancelOrder {
-    background: #fff;
-    position: absolute;
-    bottom: 0.98rem;
-    left: 0;
-    width: 100%;
-    border-top-left-radius: 5px;
-    border-top-right-radius: 5px;
-    overflow: hidden;
-    .sendGoods_title {
-      color: #333;
-      font-size: 0.42rem;
-      text-align: center;
-      line-height: 1rem;
-      font-weight: 600;
-      position: relative;
       i {
+        font-size: .6rem;
         position: absolute;
-        font-size: 16px;
-        right: 0.2rem;
+        right: -0.3rem;
+        top: -0.35rem;
+        color: #fff;
+        &::after{
+          position: absolute;
+          top: -0.1rem;
+          left: -0.1rem;
+          right: -0.1rem;
+          bottom: -0.1rem;
+          content: ' '
+        }
+      }
+      .title {
+        background: #3f84f6;
+        height: 0.7rem;
+        line-height: 0.7rem;
+        color: #fff;
+        text-align: center;
+        font-size: 0.3rem;
+        position: relative;
+      }
+      .Kuang {
+        max-height: 10rem;
+        width: 6.7rem;
+        position: absolute;
+        left: 50%;
+        top: 50%;
+        transform: translate3d(-50%, -50%, 0);
+        background: #ececec;
+        border-radius: 5px;
+      }
+      .content {
+        overflow-y: scroll;
+        max-height: 9.3rem;
+        .infob {
+          background: #e3edfd;
+          padding: 0.2rem;
+          .info {
+            color: #333;
+            font-size: 0.3rem;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            margin-bottom: 0.18rem;
+            .name {
+              color: #666;
+            }
+            div {
+              display: inline-block;
+            }
+          }
+        }
+        .content_sq {
+          width: 6.4rem;
+          margin: 0.1rem auto;
+          background: #fff;
+          padding: 0.2rem 0rem;
+          .list {
+            margin-bottom: 0.18rem;
+          }
+          .fl {
+            width: 3.2rem;
+          }
+          .table {
+            width: 4.2rem;
+            margin-top: -0.1rem;
+          }
+          .labelinfo {
+            background-image: url('/images/mobile/@2x/labelTop.png');
+            background-repeat: no-repeat;
+            width: 6.29rem;
+            height: 0.64rem;
+            line-height: 0.64rem;
+            background-size: 100%;
+            margin-top: 0rem;
+            margin-right: 0rem;
+            background-color: rgba(0, 0, 0, 0);
+            color: #666;
+          }
+        }
       }
     }
-    .cancelOrder_title {
-      font-size: 0.36rem;
-      color: #333;
-      border-bottom: 1px solid #d9d9d9;
-      font-weight: bold;
-      padding: 0 0.2rem;
-      line-height: 0.6rem;
-    }
-    ul {
-      li {
+    .cancelOrder {
+      background: #fff;
+      position: absolute;
+      bottom: 0.98rem;
+      left: 0;
+      width: 100%;
+      border-top-left-radius: 5px;
+      border-top-right-radius: 5px;
+      overflow: hidden;
+      .sendGoods_title {
+        color: #333;
+        font-size: 0.42rem;
+        text-align: center;
         line-height: 1rem;
-        background: #fff;
-        padding: 0 0.2rem;
-        font-size: 0.32rem;
+        font-weight: 600;
+        position: relative;
+        i {
+          position: absolute;
+          font-size: 16px;
+          right: 0.2rem;
+        }
+      }
+      .cancelOrder_title {
+        font-size: 0.36rem;
         color: #333;
         border-bottom: 1px solid #d9d9d9;
-        div.name {
-          @include overFlowHidden();
-        }
-        div.target {
-          margin-right: 0.2rem;
-          width: 0.36rem;
-          height: 0.36rem;
-          border-radius: 50%;
-          overflow: hidden;
-          border: 1px solid #a4a4a4;
-          margin-top: 0.3rem;
-          &.active {
-            background-image: url('/images/order/getChoose_icon.png');
-            background-size: 100% 100%;
-            border: 0px;
+        font-weight: bold;
+        padding: 0 0.2rem;
+        line-height: 0.6rem;
+      }
+      ul {
+        li {
+          line-height: 1rem;
+          background: #fff;
+          padding: 0 0.2rem;
+          font-size: 0.32rem;
+          color: #333;
+          border-bottom: 1px solid #d9d9d9;
+          div.name {
+            @include overFlowHidden();
+          }
+          div.target {
+            margin-right: 0.2rem;
+            width: 0.36rem;
+            height: 0.36rem;
+            border-radius: 50%;
+            overflow: hidden;
+            border: 1px solid #a4a4a4;
+            margin-top: 0.3rem;
+            &.active {
+              background-image: url('/images/order/getChoose_icon.png');
+              background-size: 100% 100%;
+              border: 0px;
+            }
           }
         }
       }
+      .sendGoods_Btn {
+        @include lineHeight(1rem);
+        text-align: center;
+        color: #fff;
+        font-size: 0.36rem;
+        background: #3f84f6;
+      }
     }
-    .sendGoods_Btn {
-      @include lineHeight(1rem);
-      text-align: center;
+    .labelInfo_ForItem {
       color: #fff;
-      font-size: 0.36rem;
-      background: #3f84f6;
+      font-size: 0.24rem;
+      padding: 0.05rem 0.1rem;
+      background: #15b262;
+      margin-right: 0.1rem;
+      border-radius: 3px;
+    }
+    .com-none-state{
+      background: #f1f3f6
     }
   }
-  .labelInfo_ForItem {
-    color: #fff;
-    font-size: 0.24rem;
-    padding: 0.05rem 0.1rem;
-    background: #15b262;
-    margin-right: 0.1rem;
-    border-radius: 3px;
-  }
-  .com-none-state{
-    background: #f1f3f6
-  }
-}
 </style>

+ 287 - 0
pages/mobile/order/orderbtob.vue

@@ -0,0 +1,287 @@
+<template>
+  <div class="order-wrapper">
+    <div class="order-tab">
+      <div class="order-tab-wrapper clearfix">
+        <div class="fl active tab">B2B</div>
+        <nuxt-link class="fl tab" to="/mobile/order?type=saler" tag="div" >
+          商城
+        </nuxt-link>
+      </div>
+    </div>
+    <div class="order-nav">
+      <div :class="activeType === 'todo' ? 'active': ''" @click="ChangeList('todo')"><span>待回复</span></div>
+      <div :class="activeType === 'done' ? 'active' : ''" @click="ChangeList('done')"><span>已回复</span></div>
+      <div :class="activeType === 'end' ? 'active' : ''" @click="ChangeList('end')"><span>已结案</span></div>
+    </div>
+    <div class="search-content search-content2">
+      <input type="text" placeholder="单据编号/客户名称/物料名称" v-model="keyword" @keyup.13="searchOrderlist">
+      <span @click="searchOrderlist">
+          <i class="iconfont icon-sousuo"></i>
+      </span>
+    </div>
+    <ul class="order-list-wrap" id="b2border-wrapper" v-show="orderList.length > 0">
+      <li v-for="item in orderList" @click="goDetails(item)">
+        <div class="list-title">{{item.enName}}</div>
+        <div class="clearfix list-content">
+          <div class="fl left">
+            <div class="item">
+              <span>单号:</span>
+              <label v-html="item.code" style="color: #333"></label>
+            </div>
+            <div class="item">
+              <span>币别:</span>{{item.currency}}
+            </div>
+            <div class="item pric">
+              <span>金额:</span>{{item.sum}}
+            </div>
+            <div class="item">
+              <span>时间:</span>{{item.date | time}}
+            </div>
+          </div>
+          <div class="fr right">
+            <div v-if="activeType === 'todo'" class="todo">
+              待回复
+            </div>
+            <div v-else-if="activeType === 'done'" class="done">
+              已回复
+            </div>
+            <div v-else-if="activeType === 'end'" class="end">
+              已结案
+            </div>
+          </div>
+        </div>
+      </li>
+    </ul>
+    <div v-if="orderList.length === 0" class="com-none-state">
+      <img src="/images/mobile/@2x/search-empty.png">
+      <p>抱歉,暂无订单消息</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
+    <pull-up :fixId="'b2border-wrapper'"
+             :allPage="allPage"
+             :page="page"
+             :FixedEl="true"
+             @pullUpAction="getMoreSearch"></pull-up>
+  </div>
+</template>
+
+<script>
+  import { RemindBox, PullUp } from '~components/mobile/common'
+  export default {
+    name: 'orderbtob',
+    layout: 'mobile',
+    middleware: 'authenticated',
+    data() {
+      return {
+        activeType: 'todo',
+        page: 1,
+        // isSearchSearchingMore: false,
+        orderList: [],
+        keyword: '',
+        allPage: 0
+      }
+    },
+    created() {
+      this.getResource()
+    },
+    methods: {
+      goDetails(item) {
+        this.$router.push('/mobile/order/orderbtob_details?id=' + item.id)
+      },
+      getResource(Reset) {
+        // this.isSearchSearchingMore = false
+        this.$http.get('/sale/orders/info/nosearch', {params: {
+          _state: this.activeType,
+          count: 10,
+          page: this.page,
+          searchFilter: {'fromDate': 1293811200000, 'endDate': new Date().getTime(), 'keyword': this.keyword},
+          sorting: {date: 'desc', id: 'desc'}
+        }}).then(res => {
+          if (Reset) {
+            this.orderList = []
+          }
+          res.data.content.forEach(item => {
+            item.sum = 0
+            item.orderItems.forEach(order => {
+              item.sum += order.qty * order.price
+            })
+          })
+          this.orderList.push(...res.data.content)
+          this.allPage = Math.floor(res.data.totalElement / 10)
+          // this.isSearchSearchingMore = true
+          console.log(this.orderList)
+        })
+      },
+      ChangeList(_tp) {
+        this.activeType = _tp
+        this.getResource(true)
+      },
+      getMoreSearch() {
+        this.page++
+        this.getResource()
+      },
+      searchOrderlist() {
+        this.page = 1
+        this.getResource(true)
+      }
+    },
+    components: {
+      RemindBox, PullUp
+    },
+    filters: {
+      time: function(time) {
+        if (typeof time === 'number') {
+          if (!time) {
+            return '无'
+          } else {
+            let d = new Date(time)
+            let year = d.getFullYear()
+            let month = d.getMonth() + 1
+            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+            return year + '-' + month + '-' + day
+          }
+        }
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  @mixin overFlowHidden {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  @mixin lineHeight($value) {
+    height: $value;
+    line-height: $value;
+  }
+
+  .order-wrapper {
+    background: #f1f3f6;
+    margin: 1.26rem 0 0.98rem 0;
+    height: calc(100vh - 1.26rem - 0.98rem);
+    /*padding-bottom: 0.96rem;*/
+    .order-tab {
+      background: #3f84f6;
+      padding-bottom: 0.2rem;
+      .order-tab-wrapper {
+        border: solid 1px #ffffff;
+        width: 7.06rem;
+        margin: 0 auto;
+        border-radius: 0.04rem;
+        line-height: 0.72rem;
+        height: 0.72rem;
+        overflow: hidden;
+        div {
+          color: #ffffff;
+          font-size: 0.28rem;
+          text-align: center;
+          width: 50%;
+          &.active {
+            background-color: #ffffff;
+            color: #3f84f6;
+          }
+        }
+      }
+    }
+    .order-nav {
+      background: #fff;
+      div {
+        height: 0.82rem;
+        line-height: 0.82rem;
+        display: inline-block;
+        width: 33.3%;
+        text-align: center;
+        font-size: .28rem;
+        color: #666;
+        &.active span{
+          color: #3f84f6;
+          border-bottom: 0.04rem solid #3f84f6;
+          padding-bottom: 0.2rem;
+        }
+      }
+    }
+    .search-content2 {
+      text-align: center;
+      padding: .25rem 0 0 0;
+      margin-top: 0 !important;
+      input {
+        width: 7.1rem;
+        border: 1px solid #376ff3;
+      }
+      span {
+        /*height: .46rem;*/
+        /*line-height: .46rem;*/
+      }
+    }
+    .order-list-wrap {
+      height: calc(100vh - 1.26rem - 0.96rem - 0.84rem - 1rem - 0.92rem);
+      overflow-y: scroll;
+      margin-top: 0.2rem;
+      li {
+        background: #fff;
+        width: 7.1rem;
+        margin: 0 auto 0.2rem;
+        border-radius: 0.04rem;
+        border: 1px solid #e4e4e4;
+        padding: 0 0.24rem;
+        .list-title {
+          @include lineHeight(0.91rem);
+          @include overFlowHidden();
+          font-size: 0.28rem;
+          color: #3a3a3a;
+          border-bottom: 1px solid #d3d3d3;
+        }
+        .list-content {
+          margin-top: 0.23rem;
+          padding-bottom: 0.28rem;
+          .left {
+            border-right: dashed 1px #9f9f9f;
+            width: 4.6rem;
+            .item {
+              font-size: 0.28rem;
+              color: #333;
+              @include overFlowHidden();
+              margin-bottom: 0.15rem;
+              span {
+                color: #666;
+              }
+              &.pric {
+                color: #e6353d;
+              }
+            }
+          }
+          .right {
+            div {
+              width: 1.7rem;
+              height: 0.47rem;
+              line-height: 0.47rem;
+              font-size: 0.28rem;
+              text-align: center;
+              border-radius: 0.04rem;
+              margin-top: 0.7rem;
+              &.todo {
+                border: 1px solid #3e82f5;
+                background: #3e82f5;
+                color: #fff;
+              }
+              &.done {
+                border: 1px solid #3e82f5;
+                color: #3e82f5;
+              }
+              &.end {
+                background: #cccccc;
+                border: 1px solid #cccccc;
+                color: #fff;
+              }
+            }
+          }
+        }
+      }
+    }
+    .com-none-state{
+      background: #f1f3f6
+    }
+  }
+</style>

+ 281 - 0
pages/mobile/order/orderbtob_details.vue

@@ -0,0 +1,281 @@
+<template>
+  <div class="orderbtob_details_wrapper">
+    <div class="mobile-header">
+      <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
+      <p>订单详情</p>
+    </div>
+    <div class="orderbtob_details_content">
+      <div class="orderbtob_details_top">
+        <div class="item">
+          <span class="name">客户:</span>
+          {{listInfo.enterprise.enName}}
+        </div>
+        <div class="item">
+          <span class="name">收货地址:</span>
+          {{listInfo.enterprise.enAddress}}
+        </div>
+        <div class="item">
+          <span class="name">订单号:</span>
+          {{listInfo.code}}
+        </div>
+        <div class="item">
+          <span class="name">单据时间:</span>
+          {{listInfo.date | time}}
+        </div>
+        <div class="item">
+          <span class="name">备注:</span>
+          {{listInfo.remark || '无'}}
+        </div>
+        <div class="item">
+          <span class="name">币别:</span>
+          {{listInfo.currency}}
+        </div>
+        <div class="item">
+          <span class="name">金额:</span>
+          {{listInfo.sum}}
+        </div>
+      </div>
+      <div class="orderbtob_details_middle">
+        <div class="list" v-for="(item, index) in listInfo.orderItems">
+          <div class="item">
+            <span class="name">编号:</span>{{item.product.code}}
+          </div>
+          <div class="item">
+            <span class="name">产品:</span>{{item.product.title}}
+          </div>
+          <div class="item clearfix">
+            <div class="name fl">规格型号:</div>
+            <div class="fl ovrflow">{{item.product.spec}}</div>
+          </div>
+          <div class="item">
+            <span class="name">购买数量:</span>{{item.qty}}
+          </div>
+          <ul class="bottom" v-if="item.replayList.length > 0">
+            <li v-for="ls in item.replayList">
+              <span style="margin-right:0.1rem"> <strong>{{ls.date | time}}</strong></span>
+              <span style="margin-right:0.1rem">{{ls.recorder}}回复数量:</span>
+              <span>{{ls.qty}}</span>
+            </li>
+          </ul>
+          <div v-if="!item.replyQty || item.replyQty < item.qty">
+            <div class="item clearfix">
+              <span class="name">回复数量:</span>
+              <input type="number" class="dateinput" v-model="count">
+            </div>
+            <div class="item clearfix">
+              <span class="name">交货日期:</span>
+              <input type="date" :min="item.delivery | time" class="dateinput" v-model="date">
+            </div>
+            <div class="item clearfix">
+              <span class="name">备注:</span>
+              <input type="text" class="dateinput" v-model="remank">
+            </div>
+            <div class="replayBtn" @click="Replay(item)">
+              回复
+            </div>
+          </div>
+          <div v-if="item.replyQty >= item.qty && item.replayList.length === 0" class="replayBtn" @click="LookReplay(item)">
+            查看回复
+          </div>
+        </div>
+      </div>
+
+    </div>
+    <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
+  </div>
+</template>
+
+<script>
+  import { RemindBox } from '~components/mobile/common'
+  export default {
+    name: 'orderbtob_details',
+    layout: 'mobileActivity',
+    middleware: 'authenticated',
+    data() {
+      return {
+        listInfo: {
+          enterprise: {}
+        },
+        date: '',
+        count: '',
+        remank: '',
+        collectResult: '',
+        timeoutCount: 0,
+        token: ''
+      }
+    },
+    created() {
+      this.getInitInfo()
+      this._getToken()
+    },
+    methods: {
+      Replay(item) {
+        if (this.count === '') {
+          this._iniFo('数量不能为空')
+        } else if (Number(this.count) > Number(item.qty)) {
+          this._iniFo('回复数量不能大于订单数量')
+        } else {
+          this.$http.post(`/sale/orders/items/${item.id}/reply?token=${this.token}`, {
+            delivery: new Date().getTime(),
+            qty: this.count,
+            remark: this.remank
+          }).then(res => {
+            this.remank = ''
+            this.count = ''
+            this._iniFo('回复成功')
+            this.getInitInfo()
+          })
+        }
+      },
+      LookReplay(item) {
+        this.$http.get(`/sale/orders/items/${item.id}/reply/all`).then(res => {
+          item.replayList = res.data
+        })
+      },
+      _iniFo(str) {
+        this.collectResult = str
+        this.timeoutCount++
+      },
+      _getToken() {
+        this.$http.get('/token?userType=sale').then(res => {
+          this.token = res.data.token
+        })
+      },
+      getInitInfo() {
+        this.$http.get(`/sale/orders/${this.$route.query.id}/info`).then(res => {
+          res.data.sum = 0
+          res.data.orderItems.forEach(item => {
+            res.data.sum += item.qty * item.price
+            item.replayList = []
+            item.showReplay = false
+          })
+          this.listInfo = res.data
+        })
+      }
+    },
+    filters: {
+      time: function(time) {
+        if (typeof time === 'number') {
+          if (!time) {
+            return '无'
+          } else {
+            let d = new Date(time)
+            let year = d.getFullYear()
+            let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : '' + (d.getMonth() + 1)
+            let day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+            return year + '-' + month + '-' + day
+          }
+        }
+      }
+    },
+    components: {
+      RemindBox
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+.orderbtob_details_wrapper {
+  background: #f5f5f5;
+  .mobile-header{
+    position: fixed;
+    top: 0;
+    z-index: 10;
+    width:100%;
+    height:.88rem;
+    line-height: .88rem;
+    /*border-bottom:.01rem solid #ccc;*/
+    background: #3e82f5;
+    padding:0 .2rem 0 .1rem;
+    color:#fff;
+  }
+  .mobile-header p{
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    font-size:.36rem;
+    text-align: center;
+    margin: 0;
+    width: 6rem;
+    padding-left: 1rem;
+  }
+  .mobile-header a{
+    font-size:.28rem;
+    color:#fff;
+    position: absolute;
+  }
+  .mobile-header a i{
+    font-size: .48rem;
+    margin-right: -.1rem;
+  }
+  .orderbtob_details_content {
+    margin-top: 0.9rem;
+    padding: 0.2rem;
+    .orderbtob_details_top {
+      background: #3f84f6;
+      border-radius: 0.07rem;
+      border: solid 0.01rem #e3e5e8;
+      padding: 0.24rem 0.2rem 0.14rem;
+      .item {
+        color: #fff;
+        font-size: 0.28rem;
+        margin-bottom: 0.1rem;
+      }
+    }
+    .orderbtob_details_middle {
+      margin-top: 0.2rem;
+      .list {
+        border: solid 1px #e3e5e8;
+        border-radius: 0.07rem;
+        overflow: hidden;
+        color: #333;
+        font-size: 0.28rem;
+        padding: 0.24rem 0.2rem;
+        margin-bottom: 0.2rem;
+        background: #fff;
+        .item {
+          margin-bottom: 0.1rem;
+          line-height: 0.5rem;
+        }
+        .ovrflow {
+          width: 5.2rem;
+          line-height: 0.5rem
+        }
+        .name {
+          color: #666;
+          width: 1.4rem;
+          display: inline-block;
+        }
+        .dateinput {
+          width: 3.49rem;
+          height: .5rem;
+          line-height: .5rem;
+          border: 1px solid #aeaeae;
+          font-size: .26rem;
+          vertical-align: middle;
+          background: #fff;
+          border-radius: 0;
+        }
+      }
+      .replayBtn {
+        width: 6.59rem;
+        height: 0.77rem;
+        background-color: #3f84f6;
+        border-radius: 0.08rem;
+        font-size: 0.28rem;
+        line-height: 0.77rem;
+        color: #ffffff;
+        overflow: hidden;
+        text-align: center;
+        margin-top: 0.2rem
+      }
+    }
+    .bottom {
+      font-size: 0.2rem;
+      color: #999;
+      border-top: 1px solid #aeaeae;
+      padding-top: 0.1rem;
+    }
+  }
+}
+</style>

BIN
static/images/mobile/center/vendor/seek-enquiry.png


+ 29 - 0
store/applyPurchase.js

@@ -113,6 +113,7 @@ export const actions = {
         commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
       })
   },
+  // 已报价数据接口
   loadVendorPurchaseManList ({ commit }, params = {}) {
     commit('purchaseManList/REQUEST_PURCHASEMAN')
     return axios.get('/inquiry/public/quotation/list', {params})
@@ -142,6 +143,34 @@ export const actions = {
           commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
         })
     },
+  // B2b客户采购询价接口
+  loadVendorEnquiryList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/sale/inquiry/info/nosearch', {params})
+      .then(response => {
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
+  // B2b客户采购询价搜索接口接口
+  loadVendorEnquirySearchList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/sale/inquiry/info/search', {params})
+      .then(response => {
+        let obj = {}
+        obj.first = response.data.first
+        obj.last = response.data.last
+        obj.number = response.data.page
+        obj.numberOfElements = response.data.totalPage
+        obj.size = response.data.size
+        obj.totalElements = response.data.totalElement
+        obj.content = JSON.parse(JSON.stringify(response.data.content))
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', obj)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
   // 求购排行榜
   loadPurchaseApplyRank ({ commit }, params = {}) {
     commit('purchaseApplyRank/REQUEST_PURCHASERANK', params)