Ver Fonte

Merge remote-tracking branch 'origin/master'

wangdy há 8 anos atrás
pai
commit
a4309cba89
72 ficheiros alterados com 4125 adições e 228 exclusões
  1. 31 2
      assets/scss/common.scss
  2. 1 178
      assets/scss/commonComponent.css
  3. 269 0
      components/applyPurchase/ApplyFooter.vue
  4. 749 0
      components/applyPurchase/ApplyInfo.vue
  5. 976 0
      components/applyPurchase/BatchPublish.vue
  6. 855 0
      components/applyPurchase/PublishApply.vue
  7. 465 0
      components/applyPurchase/SayPrice.vue
  8. 6 0
      components/applyPurchase/index.js
  9. 21 0
      components/common/loading/PageLoading.vue
  10. 1 1
      components/common/upload/upload.vue
  11. 20 0
      components/default/Footer.vue
  12. 3 3
      components/default/Header.vue
  13. 9 9
      components/default/RightBar.vue
  14. 1 1
      components/help/helpHeader.vue
  15. 6 1
      components/help/left.vue
  16. 271 3
      components/home/floor/FloorList.vue
  17. 4 0
      components/main/Nav.vue
  18. 1 1
      components/product/ComponentGoods.vue
  19. 1 1
      components/product/component/StoreInfo.vue
  20. 1 1
      components/search/GoodList.vue
  21. 1 1
      components/store/CommodityInfo.vue
  22. 1 1
      components/store/CommodityList.vue
  23. 3 3
      components/store/RecommendProduct.vue
  24. 12 7
      layouts/shop.vue
  25. 7 3
      nuxt.config.js
  26. 19 0
      pages/applyPurchase/_id.vue
  27. 30 0
      pages/applyPurchase/index.vue
  28. 145 0
      pages/applyPurchase/result.vue
  29. 3 1
      pages/help/helpDetail/_id.vue
  30. 3 1
      pages/help/helpList/_id.vue
  31. 3 1
      pages/help/home.vue
  32. 2 1
      pages/index.vue
  33. 1 1
      pages/mobile/search/_keycode.vue
  34. 5 1
      plugins/axios.js
  35. 2 1
      plugins/element-ui.js
  36. 1 0
      run.sh
  37. 5 5
      server.js
  38. BIN
      static/images/all/banner-cuxiao01.jpg
  39. BIN
      static/images/all/banner-cuxiao01.png
  40. BIN
      static/images/all/banner-cuxiao02.png
  41. BIN
      static/images/all/banner-cuxiao03.jpg
  42. BIN
      static/images/applyPurchase/apply-footer-bg.png
  43. BIN
      static/images/applyPurchase/arrow-down.png
  44. BIN
      static/images/applyPurchase/banner.png
  45. BIN
      static/images/applyPurchase/batch-error.png
  46. BIN
      static/images/applyPurchase/batch-success.png
  47. BIN
      static/images/applyPurchase/check.png
  48. BIN
      static/images/applyPurchase/download.png
  49. BIN
      static/images/applyPurchase/good-purchaser-title.png
  50. BIN
      static/images/applyPurchase/green-check.png
  51. BIN
      static/images/applyPurchase/hot-fire.png
  52. BIN
      static/images/applyPurchase/level-1.png
  53. BIN
      static/images/applyPurchase/level-2.png
  54. BIN
      static/images/applyPurchase/level-3.png
  55. BIN
      static/images/applyPurchase/nav-brand.png
  56. BIN
      static/images/applyPurchase/nav-kind.png
  57. BIN
      static/images/applyPurchase/nav-open.png
  58. BIN
      static/images/applyPurchase/nav-order.png
  59. BIN
      static/images/applyPurchase/publish-apply-bg.png
  60. BIN
      static/images/applyPurchase/publish-apply.png
  61. BIN
      static/images/applyPurchase/rank-title.png
  62. BIN
      static/images/applyPurchase/say-price.png
  63. BIN
      static/images/applyPurchase/select.png
  64. BIN
      static/images/applyPurchase/sort-arrow.png
  65. BIN
      static/images/applyPurchase/test-logo.png
  66. BIN
      static/images/applyPurchase/upload.png
  67. 89 0
      store/applyPurchase.js
  68. 34 0
      store/applyPurchase/bomMaterial.js
  69. 20 0
      store/applyPurchase/goodPurchaseMan.js
  70. 20 0
      store/applyPurchase/purchaseApplyRank.js
  71. 20 0
      store/applyPurchase/purchaseManList.js
  72. 8 0
      store/index.js

+ 31 - 2
assets/scss/common.scss

@@ -639,17 +639,28 @@ a {
 .select-adder {
   background:url("../../static/images/all/xiala.png") right no-repeat #fff !important;
   background-position-x: 100% !important;
+
+}
+select {
   /*将默认的select选择框样式清除*/
   appearance:none;
   -moz-appearance:none;
   -webkit-appearance:none;
   -ms-appearance:none;
-
 }
-.select-adder::-ms-expand {
+select::-ms-expand {
   display: none;
 }
 
+/*input number 箭头*/
+input::-webkit-outer-spin-button,
+input::-webkit-inner-spin-button {
+  -webkit-appearance: none;
+}
+input[type="number"]{
+  -moz-appearance: textfield;
+}
+
 .banner-img {
   display: block;
   margin: 10px auto;
@@ -662,3 +673,21 @@ a {
 .fr {
   float: right;
 }
+/*new 标签*/
+@keyframes newAnimate {
+  0% {
+    transform: translate(0px, 0px);
+  }
+  50% {
+    transform: translate(0px, -3px);
+  }
+  100% {
+    transform: translate(0px, 0px);
+  }
+}
+
+img.new-animate{
+  position: relative;
+  top: -7px;
+  animation: newAnimate 1s infinite;
+}

+ 1 - 178
assets/scss/commonComponent.css

@@ -21,6 +21,7 @@
     background-color: white;
     width: 310px;
     -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+    -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
     box-shadow: 0 5px 15px rgba(0,0,0,.5);
     margin: -155px 0 0 -75px;
     top: 55%;
@@ -447,184 +448,6 @@ div.tip{
     background: #5078cb;
 }
 /*-------------------------下拉选框 end--------------------*/
-/*-------------------------分页 start--------------------*/
-/*主要分页table(使用tableParams即可)*/
-
-/*主要分页非table代码示例*/
-/*
-<div class="ng-cloak ng-table-pager com-sup-pager">
-    <ul class="pagination ng-table-pagination">
-        <li ng-class="{'disabled': !page.active && !page.current, 'active': page.current}" ng-repeat="page in pages" ng-switch="page.type">
-            <a ng-switch-when="prev" ng-click="setPage(page.type, -1)" href="">&laquo;</a>
-            <a ng-switch-when="first" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-            <a ng-switch-when="page" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-            <a ng-switch-when="more" ng-click="setPage(page.type, -1)" href="">&#8230;</a>
-            <a ng-switch-when="last" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-            <a ng-switch-when="next" ng-click="setPage(page.type, -1)" href="">&raquo;</a>
-        </li>
-    </ul>
-    <div class="page-go-block">
-        <input class="page-number" type="text" ng-model="param.currentPage" ng-keydown="listenEnter()"/>
-        <a class="page-a" ng-click="setPage('page', param.currentPage)">GO</a>
-    </div>
-</div>
-*/
-.com-sup-pager .pagination{
-    margin-bottom: 0;
-}
-.com-sup-pager .pagination.ng-table-pagination > li > a > span {
-    height: 17px;
-    line-height: 17px;
-}
-.com-sup-pager .pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover{
-    z-index: 2;
-    color: #fff;
-    cursor: default;
-    background-color: #5078cb;
-    border-color: #5078cb;
-}
-.com-sup-pager .pagination.ng-table-pagination > li > a{
-    font-size: 12px;
-}
-.com-sup-pager.ng-table-pager  input.page-number {
-    vertical-align: inherit;
-    display: inline-block;
-    width: 40px;
-    height: 31px;
-    padding: 6px 6px;
-    font-size: 14px;
-    line-height: 1.42857143;
-    color: #9B9792;
-    text-align: center;
-    background-color: #F6F5F4;
-    background-image: none;
-    border: 1px solid #ccc;
-    border-top-left-radius: 4px;
-    border-bottom-left-radius: 4px;
-    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-}
-.com-sup-pager.ng-table-pager{
-    margin-right: 0 !important;
-    background: #fff;
-}
-.com-sup-pager.ng-table-pager a.page-a {
-    color: #fff;
-    cursor: pointer;
-    background-color: #5078cb;
-    border-color: #5078cb;
-    padding: 7px 6px;
-    font-size: 14px;
-    border-top-right-radius: 4px;
-    border-bottom-right-radius: 4px;
-    text-decoration: none;
-    height: 31px;
-}
-
-.com-sup-pager.ng-table-pager div.page-go-block {
-    float: right;
-    margin-left: 20px;
-    font-size: 0px;
-    height: 31px;
-    line-height: 31px;
-}
-
-/*次要分页代码示例*/
-/*
- <div class="ng-cloak ng-table-pager com-sub-pager text-center">
-        <ul class="pagination ng-table-pagination">
-            <li ng-class="{'disabled': !page.active && !page.current, 'active': params.page == page.number}" ng-repeat="page in pages" ng-switch="page.type">
-                <a ng-switch-when="prev" ng-click="setPage(page.type, -1)">&laquo;</a>
-                <a ng-switch-when="first" ng-click="setPage(page.type, page.number)"><span ng-bind="page.number"></span></a>
-                <a ng-switch-when="page" ng-click="setPage(page.type, page.number)"><span ng-bind="page.number"></span></a>
-                <a ng-switch-when="more" ng-click="setPage(page.type, -1)">&#8230;</a>
-                <a ng-switch-when="last" ng-click="setPage(page.type, page.number)"><span ng-bind="page.number"></span></a>
-                <a ng-switch-when="next" ng-click="setPage(page.type, -1)">&raquo;</a>
-            </li>
-        </ul>
-        <div class="page-go-block" ng-if="rolesData.length>6">
-            <input class="page-number" type="text" ng-model="params.currentPage" ng-keydown="listenEnter()"/>
-            <a class="page-a" ng-click="setPage('page', params.currentPage)">GO</a>
-        </div>
-    </div>
-*/
-.com-sub-pager .ng-table-pagination a {
-    border: none;
-    font-size: 12px;
-    cursor: pointer;
-}
-.com-sub-pager .pagination li:first-child a, .com-sub-pager .pagination li:last-child a{
-    font-size: 20px;
-}
-.com-sub-pager ul.pagination.ng-table-pagination > li > a > span {
-    height: 17px;
-    line-height: 17px;
-    color: #666;
-}
-.com-sub-pager.ng-table-pager {
-    background: #f4f4f4;
-    margin: 0!important;
-    padding-right: 29px;
-}
-.com-sub-pager.ng-table-pager  input.page-number {
-    vertical-align: inherit;
-    display: inline-block;
-    width: 37px;
-    height: 28px;
-    padding: 6px 6px;
-    font-size: 12px;
-    line-height: 1.42857143;
-    color: #9B9792;
-    text-align: center;
-    background-color: #F6F5F4;
-    background-image: none;
-    border: 1px solid #ccc;
-    border-top-left-radius: 4px;
-    border-bottom-left-radius: 4px;
-    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-}
-
-.com-sub-pager.ng-table-pager a.page-a {
-    color: #fff;
-    cursor: pointer;
-    padding: 5.55px 6px;
-    font-size: 12px;
-    border-top-right-radius: 4px;
-    border-bottom-right-radius: 4px;
-    text-decoration: none;
-    height: 31px;
-}
-
-.com-sub-pager.ng-table-pager .page-go-block {
-    float: right;
-    font-size: 0px;
-    height: 31px;
-    margin-top: 20px;
-    line-height: 31px;
-}
-.com-sub-pager.ng-table-pager .ng-table-pagination{
-    text-align: center;
-    max-width: 460px;
-    margin: 0;
-}
-.com-sub-pager.ng-table-pager .ng-table-pagination a{
-    height: 29px;
-    line-height: 13px;
-}
-.com-sub-pager .pagination li.active a span{
-    color: white !important;
-}
-.com-sub-pager.ng-table-pager .ng-table-pagination li.active a {
-    background: none!important;
-}
-.com-sub-pager.ng-table-pager .ng-table-pagination li a {
-    background: none!important;
-}
-.com-sub-pager.ng-table-pager .ng-table-pagination li.active a span {
-    color: #5078cb!important;
-}
-/*-------------------------分页 end--------------------*/
 
 /*----------遮罩层 start-------------*/
 .modal-wrap {

+ 269 - 0
components/applyPurchase/ApplyFooter.vue

@@ -0,0 +1,269 @@
+<template>
+  <div class="apply-footer">
+    <div class="good-provider">
+      <h1>优秀供应商</h1>
+      <p>海量求购&nbsp;一网打尽</p>
+      <div class="provider-list">
+        <div class="provider-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">123333333333333333333333333333333333333333</div>
+        </div>
+        <div class="provider-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">123333333333333333333333333333333333333333</div>
+        </div>
+        <div class="provider-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">123333333333333333333333333333333333333333</div>
+        </div>
+      </div>
+    </div>
+    <div class="turnover-exap">
+      <h1>成交案例</h1>
+      <p>海量求购&nbsp;一网打尽</p>
+      <div class="exap-list">
+        <div class="exap-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">
+            收到供应商报价:<span class="red-text">103</span>条
+          </div>
+          <div class="desc-wrap">
+            已完成采购:<span class="red-text">103</span>条
+          </div>
+        </div>
+        <div class="exap-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">
+            收到供应商报价:<span class="red-text">103</span>条
+          </div>
+          <div class="desc-wrap">
+            已完成采购:<span class="red-text">103</span>条
+          </div>
+        </div>
+        <div class="exap-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">
+            收到供应商报价:<span class="red-text">103</span>条
+          </div>
+          <div class="desc-wrap">
+            已完成采购:<span class="red-text">103</span>条
+          </div>
+        </div>
+        <div class="exap-item">
+          <div class="logo-wrap">
+            <img src="/images/applyPurchase/test-logo.png" alt="">
+          </div>
+          <div class="desc-wrap">
+            收到供应商报价:<span class="red-text">103</span>条
+          </div>
+          <div class="desc-wrap">
+            已完成采购:<span class="red-text">103</span>条
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="footer-nav">
+      <div class="nav-wrap">
+        <div @click="openUrl('order')">
+          <img src="/images/applyPurchase/nav-order.png" alt="">
+          <p>订单查询</p>
+        </div>
+        <div @click="openUrl('kind')">
+          <img src="/images/applyPurchase/nav-kind.png" alt="">
+          <p>器件选型</p>
+        </div>
+        <div @click="openUrl('openStore')">
+          <img src="/images/applyPurchase/nav-open.png" alt="">
+          <p>立即入驻</p>
+        </div>
+        <div @click="openUrl('brand')">
+          <img src="/images/applyPurchase/nav-brand.png" alt="">
+          <p>品牌百科</p>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    computed: {
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      login: function () {
+        this.$router.push('/auth/login')
+      },
+      openUrl: function (type) {
+        if (type === 'order') {
+          if (this.user.logged) {
+            this.$http.get('/basic/vendor/transactionInfo').then(response => {
+              if (response.data.isOpenStore) {
+                window.open('/vendor#/order/center')
+              } else {
+                window.open('/user#/order')
+              }
+            }, err => {
+              window.open('/user#/order')
+              console.log(err)
+            })
+          } else {
+            this.login()
+          }
+        } else if (type === 'kind') {
+          window.location.href = '/product/kind/home'
+        } else if (type === 'openStore') {
+          if (this.user.logged) {
+            this.$http.get('/basic/vendor/transactionInfo').then(response => {
+              if (response.data.isOpenStore) {
+                window.location.href = '/vendor#/store/maintain'
+              } else {
+                window.location.href = '/vendor#/store-apply'
+              }
+            }, err => {
+              this.$message.error('该账户未开通卖家中心')
+              console.log(err)
+            })
+          } else {
+            this.login()
+          }
+        } else if (type === 'brand') {
+          window.location.href = '/product/brand/brandList/ABC'
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .apply-footer {
+    position: absolute;
+    width: 100%;
+    top: 1600px;
+    .good-provider {
+      height: 330px;
+      text-align: center;
+      background: url('/images/applyPurchase/apply-footer-bg.png') no-repeat;
+      color: #fff;
+      padding-top: 24px;
+      background-size: cover;
+      h1 {
+        margin: 0 0 7px 0;
+        font-size: 36px;
+      }
+      p {
+        font-size: 14px;
+      }
+      .provider-list {
+        margin-top: 37px;
+        .provider-item {
+          width: 312px;
+          height: 183px;
+          background: #fff;
+          display: inline-block;
+          .logo-wrap {
+            height: 131px;
+            line-height: 131px;
+            background: #fff;
+            text-align: center;
+            img {
+              max-width: 310px;
+              max-height: 181px;
+            }
+          }
+          .desc-wrap {
+            height: 52px;
+            line-height: 16px;
+            background: rgba(0, 0, 0, .65);
+            word-break: break-all;
+            text-align: left;
+            padding: 11px 10px;
+          }
+          &:nth-child(2) {
+            margin: 0 74px;
+          }
+        }
+      }
+    }
+    .turnover-exap {
+      height: 312px;
+      text-align: center;
+      h1 {
+        margin: 27px 0 7px 0;
+        font-size: 36px;
+        color: #5392f9;
+      }
+      p {
+        font-size: 14px;
+        color: #999;
+      }
+      .exap-list {
+        margin-top: 43px;
+        .exap-item {
+          width: 224px;
+          display: inline-block;
+          margin-right: 94px;
+          &:last-child {
+            margin-right: 0;
+          }
+          .logo-wrap {
+            background: #fff;
+            border: 1px solid #d9d9d9;
+            height: 86px;
+            line-height: 86px;
+            margin-bottom: 16px;
+            img {
+              max-width: 222px;
+              max-height: 84px;
+            }
+          }
+          .desc-wrap {
+            color: #3c3c3c;
+            line-height: 18px;
+            .red-text {
+              color: #e60012;
+            }
+            &:last-child {
+              margin-top: 9px;
+            }
+          }
+        }
+      }
+    }
+    .footer-nav {
+      background: #f7f7f7;
+      .nav-wrap {
+        height: 133px;
+        text-align: center;
+        padding-top: 27px;
+        width: 1190px;
+        margin: 0 auto;
+        border-bottom: 1px solid rgba(153, 153, 153, .3);
+        div {
+          display: inline-block;
+          margin-right: 230px;
+          cursor: pointer;
+          &:last-child {
+            margin-right: 0;
+          }
+          p {
+            margin: 5px 0 0 0;
+            font-size: 18px;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 749 - 0
components/applyPurchase/ApplyInfo.vue

@@ -0,0 +1,749 @@
+<template>
+  <div class="apply-info">
+    <div class="apply-info-title">
+      <p>最新求购信息</p>
+      <span>海量求购,一网打尽</span>
+      <div>
+        <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" placeholder="型号/品牌" />
+        <span @click="searchList">查询</span>
+      </div>
+    </div>
+    <div class="apply-info-list">
+      <p>
+        <span>发布时间
+          <a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
+            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.releaseDate == 'ASC'}"></i>-->
+            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.releaseDate == 'DESC'}"></i>-->
+          </a>
+        </span>
+        <span>买家</span>
+        <span>型号</span>
+        <span>品牌</span>
+        <span>截止时间
+          <a href="javascript:void(0)" @click="sortListByParam('deadline')">
+            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.deadline == 'ASC'}"></i>-->
+            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.deadline == 'DESC'}"></i>-->
+          </a>
+        </span>
+        <span>已报价
+          <a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
+            <!--<i class=" fa fa-long-arrow-up" :class="{active: sorting.offerAmount == 'ASC'}"></i>-->
+            <!--<i class=" fa fa-long-arrow-down" :class="{active: sorting.offerAmount == 'DESC'}"></i>-->
+          </a>
+        </span>
+        <span>操作</span>
+      </p>
+      <ul v-if="purchaseManList.content && purchaseManList.content.length">
+        <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}">
+          <div>{{purchaseMan.date| date}}</div>
+          <div v-if="purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</div>
+          <div v-else>{{purchaseMan.userName | userNameFilter}}</div>
+          <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode || '-'}}</div>
+          <div :title="purchaseMan.inbrand">{{purchaseMan.inbrand || '-'}}</div>
+          <div class="date-content">
+            <div v-if="purchaseMan.remainingTime > 0">
+              <span>剩余&nbsp;</span>
+              <span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span>
+              <i v-if="getDay(purchaseMan.remainingTime) > 0">&nbsp;天&nbsp;</i>
+              <span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span>
+              <i v-if="getDay(purchaseMan.remainingTime) <= 0" >&nbsp;小时</i>
+            </div>
+            <span v-if="!purchaseMan.remainingTime || purchaseMan.remainingTime <= 0">已截止</span>
+          </div>
+          <div class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</div>
+          <div class="btn-content">
+            <!--<a @click="setLinkBoxIndex(index)">联系买家</a>-->
+            <!--判断该求购是自己的-->
+            <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
+            <div v-else>
+              <a title="此为贵公司的求购" v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" style="background: #cccbcb;">我要报价</a>
+              <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && !(user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" @click="sayPrice(purchaseMan, index)">我要报价</a>
+            </div>
+          </div>
+          <div class="expand-content">
+            <div>
+              封装:{{purchaseMan.encapsulation || '-'}}
+            </div>
+            <div>
+              采购数量:<span>{{purchaseMan.needquantity || '-'}}</span><span v-if="purchaseMan.needquantity">个</span>
+            </div>
+            <div>
+              单价预算:<span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</span>
+            </div>
+            <div>
+              生产日期:{{purchaseMan.produceDate || '-'}}
+            </div>
+          </div>
+          <!--<div class="say-price">
+            <div>报价</div>
+            <div>
+              <i>*</i>单价
+              <select v-if="!purchaseMan.currency" v-model="sayPriceObj.currency">
+                <option value="RMB">¥</option>
+                <option value="USD">$</option>
+              </select>
+              <div v-if="purchaseMan.currency" v-text="purchaseMan.currency == 'RMB' ? '¥' : '$'"></div>
+              <input type="number" v-model="sayPriceObj.unitPrice" class="form-control" @blur="onUnitPriceBlur" @input="onUnitPriceChange">
+            </div>
+            <div>
+              <i>*</i>交期&nbsp;
+              <input type="number" v-model="sayPriceObj.minDay" @blur="onMinDayInput" @input="onMinDayChange" class="form-control">&nbsp;-&nbsp;<input type="number" v-model="sayPriceObj.maxDay" @blur="onMaxDayInput" @input="onMaxDayChange" class="form-control">&nbsp;天
+            </div>
+            <div>
+              生产日期&nbsp;<input v-model="sayPriceObj.produceDate" @input="onProduceDateChange" type="text" class="form-control">
+            </div>
+            <div>
+              <span @click="cancelSayPrice(purchaseMan)">取消</span>
+              <span @click="commitSayPrice(purchaseMan)">提交</span>
+            </div>
+          </div>-->
+        </li>
+      </ul>
+      <div class="empty" v-else>
+        <img src="/images/all/empty-cart.png">
+        <span>暂无搜索结果</span>
+      </div>
+    </div>
+    <say-price :current="currentSayPriceIndex"
+               :purchase="purchaseManList"
+               @cancelSayPriceAction="cancelSayPrice"
+               @resetListAction="resetList"
+               @sayPriceIndexAction="setIndex(index)"
+    ></say-price>
+    <page :total="totalCount" :page-size="pageSize"
+          :current="nowPage" v-on:childEvent="listenPage"></page>
+    <div class="com-del-box link-saler-box" v-if="linkBoxIndex > -1">
+      <div class="title">
+        <i @click="setLinkBoxIndex(-1)"></i>
+      </div>
+      <div class="content">
+        <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
+        <p>买家联系电话:<span v-text="purchaseManList.content[linkBoxIndex].userTel"></span></p>
+        <div>
+          <a @click="setLinkBoxIndex(-1)">我知道了</a>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import Page from '~components/common/page/pageComponent.vue'
+  import SayPrice from './SayPrice.vue'
+  export default {
+    data () {
+      return {
+        pageSize: 10,
+        nowPage: 1,
+        keyWord: '',
+        sorting: {},
+        currentSayPriceIndex: -1,
+        linkBoxIndex: -1
+      }
+    },
+    components: {
+      Page,
+      SayPrice
+    },
+    filters: {
+      date: function (date) {
+        const d = new Date(Number(date))
+        const year = d.getFullYear()
+        const monthTemp = d.getMonth() + 1
+        const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+        const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
+        const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes() + ' '
+        const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
+        return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
+      },
+      phone: function (str) {
+        return str.substring(0, 3) + '****' + str.substring(7, 11)
+      },
+      enterpriseFilter (str) {
+        return str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str
+      },
+      userNameFilter (str) {
+        return str.substring(0, 1) + '**'
+      }
+    },
+    computed: {
+      purchaseManList () {
+        return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+      },
+      totalCount () {
+        return this.purchaseManList.totalElements
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      setIndex: function (index) {
+        this.currentSayPriceIndex = index
+      },
+      getDay: function (timeStamp) {
+        return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
+      },
+      getHours: function (timeStamp) {
+        return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
+      },
+      listenPage: function (page) {
+        this.nowPage = page
+        this.resetList()
+      },
+      sayPrice: function (purchaseMan, index) {
+//        let _this = this
+//        for (let i = 0; i < this.purchaseManList.content.length; i++) {
+//          _this.purchaseManList.content[i].active = false
+//        }
+        if (this.user.logged) {
+          if (this.user.data.enterprise.uu) {
+            if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
+//              this.resetSayPrice()
+              purchaseMan.active = true
+              this.currentSayPriceIndex = index
+            } else {
+              this.$message.error('抱歉,您需开通卖家功能才可报价')
+            }
+          } else {
+            this.$message.error('个人账户暂不可报价')
+          }
+        } else {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        }
+      },
+      cancelSayPrice: function () {
+        this.purchaseManList.content[this.currentSayPriceIndex].active = false
+        this.currentSayPriceIndex = -1
+      },
+      resetList: function () {
+        this.currentSayPriceIndex = -1
+        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.nowPage, pageSize: this.pageSize, keyword: this.keyWord, sorting: !this.sorting || JSON.stringify(this.sorting) === '{}' ? {releaseDate: 'DESC'} : this.sorting, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+      },
+      searchList: function () {
+        this.nowPage = 1
+        this.resetList()
+      },
+      sortListByParam: function (param) {
+        if (this.sorting[param]) {
+          if (this.sorting[param] === 'ASC') {
+            this.$set(this.sorting, param, 'DESC')
+          } else {
+            this.$delete(this.sorting, param)
+          }
+        } else {
+          this.sorting = {}
+          this.$set(this.sorting, param, 'ASC')
+        }
+        this.nowPage = 1
+        this.resetList()
+      },
+      setLinkBoxIndex: function (index) {
+        if (!this.user.logged) {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        } else {
+          this.linkBoxIndex = index
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .apply-info {
+    width: 1190px;
+    margin: 0 auto;
+    .apply-info-title {
+      border-bottom: 1px solid #3975f4;
+      >p {
+        display: inline-block;
+        width: 156px;
+        height: 33px;
+        line-height: 33px;
+        color: #fff;
+        background: #3975f4;
+        font-size: 18px;
+        text-align: center;
+        border: {
+          top-left-radius: 3px;
+          top-right-radius: 3px;
+        }
+        margin: 0;
+      }
+      >span {
+        color: #999;
+        margin-left: 16px;
+      }
+      >div {
+        float: right;
+        height: 32px;
+        line-height: 32px;
+        >input {
+          width: 241px;
+          height: 32px;
+          line-height: 32px;
+          font-size: 13px;
+          border: {
+            top-right-radius: 0;
+            bottom-right-radius: 0;
+          }
+        }
+        >span {
+          display: inline-block;
+          width: 69px;
+          color: #fff;
+          background: #3975f4;
+          text-align: center;
+          margin: 0 6px 0 -1px;
+          vertical-align: middle;
+          border: {
+            top-right-radius: 3px;
+            bottom-right-radius: 3px;
+          }
+          cursor: pointer;
+        }
+        >a {
+          background: #ffa200;
+          color: #fff;
+          width: 79px;
+          border-radius: 3px;
+          text-align: center;
+          display: inline-block;
+        }
+      }
+    }
+    .apply-info-list {
+      >p {
+        background: #ededed;
+        height: 40px;
+        line-height: 40px;
+        margin: 9px 0 0 0;
+        span {
+          display: inline-block;
+          text-align: center;
+          a {
+            i {
+              color: #333;
+              &.active {
+                color: #5078cb;
+              }
+            }
+          }
+          &:nth-child(1) {
+            width: 186px;
+          }
+          &:nth-child(2) {
+            width: 106px;
+          }
+          &:nth-child(3) {
+            width: 200px;
+          }
+          &:nth-child(4) {
+            width: 174px;
+          }
+          &:nth-child(5) {
+            width: 152px;
+          }
+          &:nth-child(6) {
+            width: 158px;
+          }
+          &:nth-child(7) {
+            width: 180px;
+            margin-left: 30px;
+          }
+        }
+      }
+      >ul {
+        margin-bottom: 29px;
+        > li {
+          position: relative;
+          min-height: 61px;
+          line-height: 61px;
+          border: 1px solid #ededed;
+          >div {
+            overflow-x: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            display: inline-block;
+            text-align: center;
+            color: #3c3c3c;
+            vertical-align: middle;
+            &:nth-child(1) {
+              width: 186px;
+            }
+            &:nth-child(2) {
+              width: 106px;
+            }
+            &:nth-child(3) {
+              width: 200px;
+            }
+            &:nth-child(4) {
+              width: 174px;
+            }
+            &:nth-child(5) {
+              width: 152px;
+            }
+            &:nth-child(6) {
+              width: 158px;
+            }
+            &:nth-child(7) {
+              width: 180px;
+              margin-left: 32px;
+              float: right;
+            }
+            &.date-content {
+              span {
+                &:first-child {
+                  font-size: 12px;
+                  color: #666;
+                }
+                color: #f71026;
+              }
+              i {
+                font-style: normal;
+              }
+            }
+            &.number-content {
+              span {
+                color: #5392f9;
+                &.active {
+                  color: #ff9a00;
+                }
+              }
+              >img {
+                margin-bottom: 5px;
+                margin-right: 2px;
+              }
+            }
+            &.btn-content {
+              >div a {
+                display: inline-block;
+                width: 71px;
+                height: 28px;
+                line-height: 28px;
+                color: #fff;
+                background: #3c7cf5;
+                border-radius: 3px;
+                cursor: pointer;
+              /*  &:first-child {
+                  background: #ffa200;
+                  float: left;
+                  margin-top: 19px;
+                }*/
+              }
+              .is-say-price {
+                display: inline-block;
+                color: #39ae05;
+                margin-left: 11px;
+                img {
+                  margin-bottom: 2px;
+                }
+                .say-price-history {
+                  position: absolute;
+                  top: 53px;
+                  right: 11px;
+                  line-height: normal;
+                  width: 198px;
+                  height: 0;
+                  background: #fff;
+                  border: 1px solid #fab89a;
+                  z-index: 1;
+                  overflow: hidden;
+                  transition: height 1s;
+                  -moz-transition: height 1s; /* Firefox 4 */
+                  -webkit-transition: height 1s; /* Safari 和 Chrome */
+                  -o-transition: height 1s; /* Opera */
+                  opacity: 0;
+                  p {
+                    color: #020202;
+                    font-weight: bold;
+                    margin: 0;
+                    &.price-title {
+                      background: #fee6db;
+                      height: 28px;
+                      line-height: 28px;
+                    }
+                    &.price-level {
+                      margin: 6px 0;
+                      text-align: left;
+                    }
+                  }
+                  > div {
+                    padding: 9px 12px;
+                    > div {
+                      display: inline-block;
+                      text-align: left;
+                      &:nth-child(1) {
+                        float: left;
+                      }
+                      &:nth-child(2) {
+                        margin-left: 32px;
+                      }
+                      span {
+                        color: #020202;
+                        margin: 0;
+                        &.red-text {
+                          color: #f62d37;
+                        }
+                      }
+                      &.pre-line {
+                        display: block;
+                        padding: 13px 0;
+                        border-bottom: 1px dashed #fee6db;
+                      }
+                    }
+                    ul {
+                      li {
+                        color: #333;
+                        height: 22px;
+                        line-height: 22px;
+                        padding: 0 6px;
+                        &:nth-child(odd) {
+                          background: #f6f5f4;
+                        }
+                        span {
+                          color: #333;
+                          display: inline-block;
+                          text-align: left;
+                          width: 50%;
+                          margin: 0;
+                        }
+                        &:last-child {
+                          span {
+                            color: #4290f7;
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+                &:hover {
+                  .say-price-history {
+                    opacity: 1;
+                    /* animation: expand 1s infinite;
+                     -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
+                     animation-iteration-count: 1;
+                     -webkit-animation-iteration-count: 1;*/
+                    height: 210px;
+                  }
+                }
+                /* @keyframes expand {
+                   from {bottom: 58px}
+                   to {bottom: auto}
+                 }
+                 @-webkit-keyframes expand {
+                   from {bottom: 58px}
+                   to {bottom: auto}
+                 }*/
+              }
+            }
+          }
+          .expand-content {
+            display: none;
+            position: absolute;
+            top: 67px;
+            justify-content: space-between;
+            padding: 0 236px 0 36px;
+            background: #fffbf0;
+            height: 45px;
+            line-height: 45px;
+            color: #020202;
+            div {
+              display: inline-block;
+              span {
+                color: #f71026;
+              }
+            }
+          }
+          &:hover {
+            border-top: 1px solid #4290f7;
+            border-left: 1px solid #4290f7;
+            border-right: 1px solid #4290f7;
+            .expand-content {
+              display: flex;
+              width: 1190px;
+              z-index: 1;
+              border-bottom: 1px solid #4290f7;
+              border-left: 1px solid #4290f7;
+              border-right: 1px solid #4290f7;
+              left: -1px;
+            }
+          }
+          .say-price {
+            background-color: #e7eef9;
+            height: 64px;
+            line-height: 64px;
+            display: none;
+            >div {
+              display: inline-block;
+              position: relative;
+              height: 64px;
+              line-height: 64px;
+              input {
+                border-radius: 3px;
+              }
+              &:nth-child(1) {
+                width: 282px;
+                background: url('/images/applyPurchase/say-price.png')no-repeat;
+                text-align: center;
+                margin-right: 44px;
+              }
+              &:nth-child(2) {
+                margin-right: 39px;
+                input {
+                  width: 118px;
+                  height: 26px;
+                  border: 1px solid #5392f9;
+                }
+                select {
+                  position: absolute;
+                  top: 19px;
+                  width: 32px;
+                  height: 26px;
+                  background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
+                  -webkit-box-shadow: none;
+                  -moz-box-shadow: none;
+                  box-shadow: none;
+                  border: {
+                    left: none;
+                    top: none;
+                    bottom: none;
+                    right: 1px solid #5392f9;
+                    bottom-left-radius: 4px;
+                    top-left-radius: 4px;
+                  }
+                  color: #5392f9;
+                  font: small-caption;
+                  padding-left: 8px;
+                  & + input {
+                    padding-left: 34px;
+                  }
+                }
+                div {
+                  position: absolute;
+                  top: 19px;
+                  left: 38px;
+                  width: 32px;
+                  height: 26px;
+                  line-height: 26px;
+                  text-align: center;
+                  border: {
+                    left: none;
+                    top: none;
+                    bottom: none;
+                    right: 1px solid #5392f9;
+                    bottom-left-radius: 4px;
+                    top-left-radius: 4px;
+                  }
+                  color: #5392f9;
+                  & + input {
+                    padding-left: 34px;
+                  }
+                }
+              }
+              &:nth-child(3) {
+                margin-right: 37px;
+                input {
+                  width: 32px;
+                  height: 26px;
+                  padding: 0 0 0 6px;
+                }
+              }
+              &:nth-child(4) {
+                margin-right: 132px;
+                input {
+                  width: 118px;
+                  height: 26px;
+                }
+              }
+              &:nth-child(5) {
+                span {
+                  width: 71px;
+                  height: 28px;
+                  line-height: 28px;
+                  text-align: center;
+                  display: inline-block;
+                  cursor: pointer;
+                  &:first-child {
+                    background: #dedddd;
+                    margin-right: 10px;
+                  }
+                  &:last-child {
+                    background: #fa4701;
+                    color: #fff;
+                  }
+                }
+              }
+              i {
+                color: #e41515;
+                position: relative;
+                top: 2px;
+                right: 3px;
+              }
+            }
+          }
+          &.active {
+            border: 1px solid #4290f7;
+            .expand-content {
+              display: flex;
+              width: 1190px;
+              z-index: 1;
+              border: 1px solid #4290f7;
+              left: -1px;
+              border-top: none;
+            }
+            /*.say-price {*/
+              /*display: block;*/
+            /*}*/
+          }
+        }
+      }
+      .empty{
+        text-align: center;
+        height: 200px;
+        line-height: 200px;
+        border: 1px solid #e8e8e8;
+        margin-bottom: 10px;
+        span {
+          color: #999;
+          margin-left: 10px;
+        }
+      }
+    }
+    .page-wrap {
+      text-align: right;
+      float: none;
+    }
+    .link-saler-box {
+      width: 289px;
+      height: auto;
+      min-height: auto;
+      border-radius: 2px;
+      .title {
+        background-color: #4290f7;
+        height: 22px;
+        line-height: 22px;
+        margin-bottom: 20px;
+      }
+      .content {
+        p {
+          line-height: 20px;
+          padding-top: 0;
+          i {
+            color: #4290f7;
+            margin-right: 4px;
+          }
+          span {
+            color: #f62d37;
+          }
+        }
+        div {
+          a {
+            width: 78px;
+            background: #4290f7;
+            margin: 18px 0 13px 0;
+            border-radius: 2px;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 976 - 0
components/applyPurchase/BatchPublish.vue

@@ -0,0 +1,976 @@
+<template>
+  <div class="batch-publish">
+    <p>共上传<b class="red-text">{{bomNumber.successImport || 0}}</b>个产品<br/>其中<span class="red-text">{{bomNumber.nullField || 0}}</span>个产品的必填项缺失,请在当前页完善信息</p>
+    <table v-if="bomList.content.length">
+      <thead>
+        <tr>
+          <!--<th width="60">-->
+            <!--<label class="com-check-box">-->
+              <!--<input type="checkbox" id="all" @change="onCheck()" v-model="isCheckAll">-->
+              <!--<label for="all"></label>-->
+            <!--</label>全选-->
+          <!--</th>-->
+          <th width="190"><i class="red-text">*</i>型号</th>
+          <th width="162"><i class="red-text">*</i>品牌</th>
+          <th width="100">采购数量</th>
+          <th width="128">单价预算</th>
+          <th width="76">封装</th>
+          <th width="102">生产日期</th>
+          <th width="144"><i class="red-text">*</i>截止时间</th>
+          <th width="92">操作</th>
+        </tr>
+      </thead>
+      <tbody v-for="(item, index) in bomList.content">
+      <tr v-if="!item.active">
+        <!--<td>
+          <label class="com-check-box">
+            <input type="checkbox" @change="onCheck(index)" v-model="item.checked" :id="index">
+            <label :for="index"></label>
+          </label>
+        </td>-->
+        <td>
+          <div v-if="item.code && (!item.codeWord || item.codeWord.length == 0)" :title="item.code">{{item.code}}</div>
+          <span class="red-text" v-if="!item.code">请完善信息</span>
+          <div class="similar-select" v-if="item.codeWord && item.codeWord.length > 0" @click="setShowCodeWord(index, $event)">{{item.code}}</div>
+          <ul v-show="item.showCodeWord">
+            <li v-for="code in item.codeWord" @click="modifyItemByWord(index, code.code, 'code')" :title="code.code">{{code.code}}</li>
+          </ul>
+        </td>
+        <td>
+          <div v-if="item.brand && (!item.brandWord || item.brandWord.length == 0)" :title="item.brand">{{item.brand}}</div>
+          <span class="red-text" v-if="!item.brand">请完善信息</span>
+          <div class="similar-select" v-if="item.brandWord && item.brandWord.length > 0" @click="setShowBrandWord(index, $event)">{{item.brand}}</div>
+          <ul v-show="item.showBrandWord" class="brand-word-list">
+            <li v-for="brand in item.brandWord" @click="modifyItemByWord(index, brand.nameEn, 'brand')" :title="brand.nameEn">{{brand.nameEn}}</li>
+          </ul>
+        </td>
+        <td>
+          <div :title="item.amount">{{item.amount || '-'}}</div>
+        </td>
+        <td class="blue-text">
+          <div>
+            <span v-if="item.unitPrice">{{(item.currency === 'RMB' ? '¥' : '$') + item.unitPrice}}</span>
+            <span v-if="!item.unitPrice">-</span>
+          </div>
+        </td>
+        <td>
+          <div :title="item.encapsulation">
+            {{item.encapsulation || '-'}}
+          </div>
+        </td>
+        <td>
+          <div :title="item.produceDate">
+            {{item.produceDate || '-'}}
+          </div>
+        </td>
+        <td>
+          <span v-if="item.deadline">{{item.deadline | date}}</span>
+          <span class="red-text" v-if="!item.deadline">请完善信息</span>
+          <div class="red-text" v-if="!isValidTime(item.deadline)">默认≤90天</div>
+        </td>
+        <td class="operate">
+          <a class="delete-btn" @click="modifyItem(index)">编辑</a>
+          <a class="modify-btn" @click="deleteItem(index)">删除</a>
+        </td>
+      </tr>
+      <tr class="modify-row" v-if="item.active">
+       <!-- <td>
+          <label class="com-check-box">
+            <input type="checkbox" @change="onCheck(index)" v-model="item.checked" :id="index">
+            <label :for="index"></label>
+          </label>
+        </td>-->
+        <td>
+          <input type="text" class="form-control" v-model="modifyObj.code" :class="{'error': !validObj.code}" @blur="checkCode" @input="onCodeChange" >
+          <ul v-show="showSimilarCodeList">
+            <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
+          </ul>
+        </td>
+        <td>
+          <input type="text" class="form-control" v-model="modifyObj.brand" :class="{'error': !validObj.brand}" @blur="checkBrand" @input="onBrandChange">
+          <ul class="brand-similar-list" v-show="showSimilarBrandList">
+            <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
+          </ul>
+        </td>
+        <td>
+          <input type="text" class="form-control" v-model="modifyObj.amount" :class="{'error': !validObj.amount}" @blur="checkAmount" @input="onAmountInput">
+        </td>
+        <td>
+          <select class="form-control" v-model="modifyObj.currency">
+            <option value="RMB">¥</option>
+            <option value="USD">$</option>
+          </select>
+          <input class="form-control" type="number" v-model="modifyObj.unitPrice" :class="{'error': !validObj.unitPrice}" @blur="checkUnitPrice" @input="onUnitPriceInput">
+        </td>
+        <td>
+          <input type="text" class="form-control" v-model="modifyObj.encapsulation" @input="onEncapsulationChange">
+        </td>
+        <td>
+          <input type="text" class="form-control" v-model="modifyObj.produceDate" @input="onProduceDateChange">
+        </td>
+        <td>
+          <el-date-picker
+            v-model="modifyObj.deadline"
+            type="date"
+            :picker-options="pickerOptions"
+            :editable="false"
+            :class="{'error': !validObj.deadline}"
+            @change="getDate1()"
+            size="mini">
+          </el-date-picker>
+          <!--<input type="text" class="form-control" v-model="modifyObj.deadline">-->
+        </td>
+        <td class="operate">
+          <a class="submit-btn" @click="submitModify(index)">确认</a>
+          <a class="cancel-btn" @click="cancelModify(index)">取消</a>
+        </td>
+      </tr>
+      </tbody>
+    </table>
+    <page :total="bomList.totalElements" :page-size="pageSize"
+          :current="nowPage" @childEvent="listenPage"></page>
+    <div class="submit-area" v-if="bomList.content.length">
+    <!--  <a class="modify-btn" @click="deleteItem()">删除</a>-->
+      <a class="modify-btn delete-btn" @click="submitBOM">确认发布</a>
+    </div>
+    <!--提示框-->
+    <!--<div class="modal-wrap" v-if="showRemindBox">
+      <div class="apply-del-box">
+        <div class="title">
+          &lt;!&ndash;<a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>&ndash;&gt;
+        </div>
+        <div class="content">
+          &lt;!&ndash;<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>&ndash;&gt;
+          &lt;!&ndash;<p style="line-height: 20px;">前往<a @click="goBrandApply()"  target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>&ndash;&gt;
+          <p><img src="/images/applyPurchase/check.png" alt="">成功发布{{successResult.successAmount || 0}}个</p>
+          <p v-if="successResult.goodsAmount && successResult.goodsAmount > 0 ">其中<span>{{successResult.goodsAmount || 0}}</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
+          <div>
+            &lt;!&ndash;<a @click="showRemindBox = false">继续发布</a>&ndash;&gt;
+            <a href="/user#/seekPurchase" target="_blank">前往我的求购</a>
+          </div>
+        </div>
+      </div>
+    </div>-->
+  </div>
+</template>
+<script>
+  let getRealLen = function (str) {
+    let len = 0
+    for (let i = 0; i < str.length; i++) {
+      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+        len += 2
+      } else {
+        len++
+      }
+    }
+    return len
+  }
+  let cutOutString = function (str, length) {
+    for (let i = 1; i <= str.length; i++) {
+      if (getRealLen(str.substr(0, i)) > length) {
+        str = str.substr(0, i - 1)
+        break
+      }
+    }
+    return str
+  }
+  let formatDate = function (date, fmt) {
+    if (!date) {
+      return null
+    }
+    if (typeof date === 'string') {
+      date = new Date(Date.parse(date.replace(/-/g, '/')))
+    }
+    let o = {
+      'M+': date.getMonth() + 1, // 月份
+      'd+': date.getDate(), // 日
+      'h+': 23, // 小时
+      'm+': 59, // 分
+      's+': 59, // 秒
+      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+      'S': date.getMilliseconds() // 毫秒
+    }
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt
+  }
+  import Page from '~components/common/page/pageComponent.vue'
+  export default {
+    data () {
+      return {
+        pageSize: 10,
+        nowPage: 1,
+        isCheckAll: false,
+//        showRemindBox: false,
+        modifyObj: {
+          code: '',
+          brand: '',
+          unitPrice: '',
+          currency: 'RMB',
+          encapsulation: '',
+          produceDate: '',
+          amount: '',
+          deadline: ''
+        },
+        pickerOptions: {
+          disabledDate (time) {
+            // 大于等于今天 小于三个月后
+            return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
+          }
+        },
+        similarCode: [],
+        similarBrand: [],
+        validObj: {
+          code: true,
+          brand: true,
+          unitPrice: true,
+//          encapsulation: true,
+//          produceDate: true,
+          amount: true,
+          deadline: true
+        },
+//        successResult: 0,
+        showSimilarCodeList: false,
+        showSimilarBrandList: false
+      }
+    },
+    components: {
+      Page
+    },
+    computed: {
+      bomList () {
+        let _this = this
+        let list = this.$store.state.applyPurchase.bomMaterial.bomList.data
+        for (let i = 0; i < list.content.length; i++) {
+          _this.$set(list.content[i], 'checked', false)
+          _this.$set(list.content[i], 'active', false)
+          _this.$set(list.content[i], 'showCodeWord', false)
+          _this.$set(list.content[i], 'showBrandWord', false)
+//          list.content[i].checked = false
+//          list.content[i].active = false
+//          if (!list.content[i].code || list.content[i].brand || !list.content[i].deadline || !this.isValidDate(list.content[i].deadline)) {
+//            _this.validList = false
+//          }
+        }
+        return list
+      },
+      bomNumber () {
+        return this.$store.state.applyPurchase.bomMaterial.bomNumber.data
+      }
+    },
+    mounted () {
+      let _this = this
+      document.body.onclick = function () {
+        _this.showSimilarCodeList = false
+        _this.showSimilarBrandList = false
+        for (let i = 0; i < _this.bomList.content.length; i++) {
+          _this.bomList.content[i].showCodeWord = false
+          _this.bomList.content[i].showBrandWord = false
+        }
+      }
+    },
+    filters: {
+      date: function (input) {
+        if (input) {
+          const d = new Date(input)
+          const year = d.getFullYear()
+          const monthTemp = d.getMonth() + 1
+          const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+          const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+          return year + '-' + month + '-' + day
+        } else {
+          return null
+        }
+      }
+    },
+    methods: {
+      getDate1: function () {
+        this.modifyObj.deadline = formatDate(this.modifyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+      },
+      initModifyObj: function () {
+        this.modifyObj = {
+          code: '',
+          brand: '',
+          unitPrice: '',
+          currency: 'RMB',
+          encapsulation: '',
+          produceDate: '',
+          amount: '',
+          deadline: ''
+        }
+      },
+      initValidObj: function () {
+        this.validObj = {
+          code: true,
+          brand: true,
+          unitPrice: true,
+          amount: true,
+          deadline: true
+        }
+      },
+      listenPage: function (page) {
+        this.nowPage = page
+        this.reloadData()
+      },
+      reloadData: function () {
+        this.$store.dispatch('applyPurchase/loadBOMMaterialList', {bomId: this.$route.params.id, page: this.nowPage, count: this.pageSize})
+      },
+      submitBOM: function () {
+        let str = ''
+//        let _this = this
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          if (this.bomList.content[i].checked) {
+            if (!this.getSingleValidInfo(this.bomList.content[i])) {
+              this.$message.error('请选择信息完善的产品发布求购')
+              return
+            }
+            str += this.bomList.content[i].id + ','
+          }
+        }
+        let param = {'bomId': Number(this.$route.params.id)}
+        if (str.length) {
+          str = str.substring(0, str.length - 1)
+          param.spIds = str
+        }
+        this.$http.post('/seek/confirmBom', param)
+          .then(response => {
+            if (response.data.success) {
+//              this.showRemindBox = true
+//              this.successResult = response.data.data
+//              this.listenPage(1)
+//              this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
+              if (response.data.data.successAmount) {
+                this.$router.push('/applyPurchase/result?status=success&count=' + response.data.data.successAmount)
+              } else {
+                this.$message.error('发布失败,请完善信息')
+              }
+            } else {
+//              this.$message.error(response.data.message)
+              this.$router.push('/applyPurchase/result?status=error')
+            }
+          }, err => {
+            console.log(err)
+            this.$message.error('系统错误')
+          })
+      },
+      onCheck: function (index) {
+        if (typeof index === 'undefined') {
+          let isCheckedAll = true
+          for (let i = 0; i < this.bomList.content.length; i++) {
+            if (!this.bomList.content[i].checked) {
+              isCheckedAll = false
+              break
+            }
+          }
+          this.setAllCheck(!isCheckedAll)
+          this.isCheckAll = !isCheckedAll
+        }
+      },
+      setAllCheck: function (flag) {
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          this.bomList.content[i].checked = flag
+        }
+      },
+      modifyItem: function (index) {
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          this.bomList.content[i].active = false
+        }
+//        this.$set(this.bomList.content[index], 'active', true)
+        this.bomList.content[index].active = true
+        let _this = this
+        this.initModifyObj()
+        this.initValidObj()
+        for (let attr in this.bomList.content[index]) {
+//          console.log(attr + ':' + _this.bomList.content[index][attr])
+          _this.$set(_this.modifyObj, attr, _this.bomList.content[index][attr])
+//          _this.modifyObj[attr] = _this.bomList.content[index][attr]
+        }
+//        this.modifyObj = this.bomList.content[index]
+        this.modifyObj.deadline = this.bomList.content[index].deadline ? this.getDate(this.bomList.content[index].deadline) : ''
+      },
+      cancelModify: function (index) {
+        this.bomList.content[index].active = false
+      },
+      getDate: function (input) {
+        const d = new Date(input)
+        const year = d.getFullYear()
+        const monthTemp = d.getMonth() + 1
+        const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
+        const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
+        return year + '-' + month + '-' + day
+      },
+//      validDate: function (timestamp) {
+//        let now = new Date().getTime()
+//        return timestamp - now <= 1000 * 60 * 60 * 24 * 90 && timestamp - now > 0
+//      },
+      submitModify: function (index) {
+        let checkValid = this.checkAll()
+        if (this.getSingleValidInfo(this.modifyObj) && checkValid) {
+          if (!this.modifyObj.unitPrice) {
+            this.modifyObj.currency = null
+          }
+          this.$http.put('/seek/updateSeekPurchaseByBatch', this.modifyObj)
+            .then(response => {
+              if (response.data.success) {
+                this.reloadData()
+                this.$message.success('修改成功')
+//                this.bomList.content[index].active = false
+              } else {
+                this.$message.error('修改失败')
+              }
+            }, err => {
+              console.log(err)
+              this.$message.error('系统错误')
+            })
+        } else {
+          if (!checkValid) {
+            if (!this.validObj.code) {
+              this.$message.error('型号不能为空')
+            } else if (!this.validObj.brand) {
+              this.$message.error('品牌不能为空')
+            } else if (!this.validObj.deadline) {
+              if (!this.isValidDate(this.modifyObj.deadline)) {
+                this.$message.error('截止日期需在90天以内')
+              } else {
+                this.$message.error('截止日期不能为空')
+              }
+            } else if (!this.validObj.amount || !this.validObj.unitPrice) {
+              this.$message.error('请输入正确的数值')
+            }
+          } else {
+            this.$message.error('请完善信息')
+          }
+        }
+      },
+      deleteItem: function (index) {
+        if (!index && index !== 0) {
+          let str = ''
+          for (let i = 0; i < this.bomList.content.length; i++) {
+            if (this.bomList.content[i].checked) {
+              str += this.bomList.content[i].id + ','
+            }
+          }
+          let param = {}
+          if (str.length) {
+            str = str.substring(0, str.length - 1)
+            param.spIds = str
+            this.doDelete(param)
+          } else {
+            this.$message.error('请勾选')
+            return
+          }
+        } else {
+          this.doDelete({spIds: this.bomList.content[index].id})
+        }
+      },
+      doDelete: function (param) {
+        this.$http.put('/seek/deleteSeekPurchaseByBatch', param)
+          .then(response => {
+            if (response.data.success) {
+              this.listenPage(1)
+              this.$message.success('删除成功')
+            } else {
+              this.$message.error('删除失败')
+            }
+          }, err => {
+            console.log(err)
+            this.$message.error('系统错误')
+          })
+      },
+      isValidTime: function (time) {
+        let now = new Date().getTime()
+        return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
+      },
+      isValidDate: function (date) {
+        date = formatDate(date, 'yyyy-MM-dd hh:mm:ss')
+        this.modifyObj.deadline = date
+        let now = new Date().getTime()
+        let time = new Date(date).getTime()
+        return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
+      },
+      getSimilarCode: function () {
+        this.$http.get('/search/similarComponents', {params: {keyword: this.modifyObj.code}})
+          .then(response => {
+            this.similarCode = response.data
+            if (response.data.length) {
+              this.showSimilarCodeList = true
+            }
+          })
+      },
+      getSimilarBrand: function () {
+        this.$http.get('/search/similarBrands', {params: {keyword: this.modifyObj.brand}})
+          .then(response => {
+            this.similarBrand = response.data
+            if (response.data.length) {
+              this.showSimilarBrandList = true
+            }
+          })
+      },
+      getSingleValidInfo: function (item) {
+        return item.code && item.brand && item.deadline && this.isValidDate(item.deadline)
+      },
+      checkCode: function () {
+        this.validObj.code = this.modifyObj.code && this.modifyObj.code !== ''
+        return this.validObj.code
+      },
+      checkBrand: function () {
+        this.validObj.brand = this.modifyObj.brand && this.modifyObj.brand !== ''
+        return this.validObj.brand
+      },
+      checkUnitPrice: function () {
+        this.validObj.unitPrice = (!this.modifyObj.unitPrice || this.modifyObj.unitPrice === '') ? true : this.modifyObj.unitPrice > 0 && this.modifyObj.unitPrice < 100000000
+        return this.validObj.unitPrice
+      },
+      checkAmount: function () {
+        this.validObj.amount = (!this.modifyObj.amount || this.modifyObj.amount === '') ? true : this.modifyObj.amount > 0 && this.modifyObj.amount < 1000000000
+        return this.validObj.amount
+      },
+      checkAll: function () {
+        return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+      },
+      checkDeadline: function () {
+        this.validObj.deadline = this.modifyObj.deadline && this.modifyObj.deadline !== '' && this.isValidDate(this.modifyObj.deadline)
+        return this.validObj.deadline
+      },
+      onUnitPriceInput: function () {
+        let price = this.modifyObj.unitPrice
+        if (price >= 10000) {
+          this.modifyObj.unitPrice = price.substring(0, 4)
+        } else if (price.indexOf('.') > -1) {
+          let arr = price.split('.')
+          if (arr[0].length > 4) {
+            this.modifyObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
+          } else if (arr[1].length > 6) {
+            this.modifyObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
+          }
+        }
+      },
+      onProduceDateChange: function () {
+        if (this.modifyObj.produceDate && getRealLen(this.modifyObj.produceDate) > 12) {
+          this.modifyObj.produceDate = cutOutString(this.modifyObj.produceDate, 12)
+        }
+      },
+      onEncapsulationChange: function () {
+        if (this.modifyObj.encapsulation && getRealLen(this.modifyObj.encapsulation) > 20) {
+          this.modifyObj.encapsulation = cutOutString(this.modifyObj.encapsulation, 20)
+        }
+      },
+      onCodeChange: function () {
+        this.modifyObj.code = this.modifyObj.code.trim()
+        if ((/[^\x00-\xff]/g).test(this.modifyObj.code)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.modifyObj.code.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.modifyObj.code.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.modifyObj.code = cutOutString(this.modifyObj.code, chineseIndex)
+        } else if (this.modifyObj.code && getRealLen(this.modifyObj.code) > 100) {
+          this.modifyObj.code = cutOutString(this.modifyObj.code, 100)
+        } else {
+          this.getSimilarCode()
+        }
+      },
+      onBrandChange: function () {
+        this.modifyObj.brand = this.modifyObj.brand.trim()
+        if ((/[^\x00-\xff]/g).test(this.modifyObj.brand)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.modifyObj.brand.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.modifyObj.brand.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.modifyObj.brand = cutOutString(this.modifyObj.brand, chineseIndex)
+        } else if (this.modifyObj.brand && getRealLen(this.modifyObj.brand) > 50) {
+          this.modifyObj.brand = cutOutString(this.modifyObj.brand, 50)
+        } else {
+          this.getSimilarBrand()
+        }
+      },
+      onAmountInput: function () {
+        if (!(/^[0-9]*$/).test(this.modifyObj.amount)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.modifyObj.amount.length; i++) {
+            if (!(/^[0-9]*$/).test(this.modifyObj.amount.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.modifyObj.amount = cutOutString(this.modifyObj.amount, chineseIndex)
+        } else if (this.modifyObj.amount.length > 9) {
+          this.modifyObj.amount = cutOutString(this.modifyObj.amount, 9)
+        }
+      },
+      setCode: function (code) {
+        this.modifyObj.code = code
+        this.showSimilarCodeList = false
+      },
+      setBrand: function (brand) {
+        this.modifyObj.brand = brand
+        this.showSimilarBrandList = false
+      },
+      setShowCodeWord: function (index, event) {
+        event.stopPropagation()
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          if (i !== index) {
+            this.bomList.content[i].showCodeWord = false
+          }
+          this.bomList.content[i].showBrandWord = false
+        }
+        this.bomList.content[index].showCodeWord = !this.bomList.content[index].showCodeWord
+      },
+      setShowBrandWord: function (index, event) {
+        event.stopPropagation()
+        for (let i = 0; i < this.bomList.content.length; i++) {
+          if (i !== index) {
+            this.bomList.content[i].showBrandWord = false
+          }
+          this.bomList.content[i].showCodeWord = false
+        }
+        this.bomList.content[index].showBrandWord = !this.bomList.content[index].showBrandWord
+      },
+      modifyItemByWord: function (index, param, type) {
+        if (type === 'code') {
+          this.bomList.content[index].code = param
+          this.requestModify(this.bomList.content[index])
+        } else if (type === 'brand') {
+          this.bomList.content[index].brand = param
+          this.requestModify(this.bomList.content[index])
+        } else {
+          this.$message.error('修改失败')
+        }
+      },
+      requestModify: function (item) {
+        this.$http.put('/seek/updateSeekPurchaseByBatch', item)
+          .then(response => {
+            if (response.data.success) {
+              this.$message.success('修改成功')
+            } else {
+              this.$message.error('修改失败')
+            }
+            this.reloadData()
+          }, err => {
+            console.log(err)
+            this.$message.error('系统错误')
+            this.reloadData()
+          })
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  .batch-publish {
+    margin: 0 auto;
+    width: 998px;
+    .red-text {
+      color: #ff0000;
+    }
+    .blue-text {
+      color: #3c7cf5;
+    }
+    > p {
+      margin: 59px 0 42px;
+      font-size: 16px;
+    }
+    table {
+      width: 100%;
+      table-layout: fixed;
+      thead {
+        tr {
+          th {
+            background: #b8b8b8;
+            color: #fff;
+            font-weight: normal;
+            height: 50px;
+            line-height: 50px;
+            text-align: center;
+            .com-check-box {
+              margin-right: 2px;
+            }
+            i {
+              margin-right: 3px;
+            }
+          }
+        }
+      }
+      tbody {
+        tr {
+          height: 85px;
+          line-height: 85px;
+          text-align: center;
+          border : {
+            bottom: 1px solid #d9d9d9;
+            left: 1px solid #d9d9d9;
+            right: 1px solid #d9d9d9;
+          }
+          &:hover {
+            background: #f3f3f3;
+          }
+          td {
+            position: relative;
+            font-size: 12px;
+            > ul {
+              line-height: normal;
+              position: absolute;
+              top: 52px;
+              left: 24px;
+              background: #fff;
+              border: 1px solid #b5b5b5;
+              z-index: 1;
+              max-height: 120px;
+              overflow-y: auto;
+              overflow-x: hidden;
+              border-radius: 3px;
+              width: 114px;
+              li {
+                height: 24px;
+                line-height: 24px;
+                cursor: pointer;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                padding: 0 5px;
+                &:hover {
+                  background: #ddd;
+                }
+              }
+              &.brand-similar-list {
+                left: 20px;
+                width: 94px;
+              }
+            }
+            > div {
+              overflow: hidden;
+              overflow-y: unset;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+              &.similar-select {
+                width: 109px;
+                margin: 0 auto;
+                border: 1px solid #b5b5b5;
+                height: 18px;
+                line-height: 18px;
+                overflow-y: hidden;
+                padding: 0 22px 0 5px;
+                background: url('/images/applyPurchase/select.png') no-repeat;
+                background-position: 91px 0;
+                cursor: default;
+                border-radius: 3px;
+                & + ul {
+                  width: 110px;
+                  top: 52px;
+                  left: 40px;
+                  &.brand-word-list {
+                    left: 27px;
+                  }
+                }
+              }
+            }
+            div.red-text {
+              line-height: normal;
+              position: absolute;
+              left: 42px;
+              top: 49px;
+            }
+            &.operate {
+              a {
+                display: block;
+                width: 64px;
+                height: 24px;
+                line-height: 22px;
+                text-align: center;
+                border-radius: 3px;
+                margin: 0 auto 4px;
+                font-size: 14px;
+                &.submit-btn {
+                  border: 1px solid #f64900;
+                  color: #fff;
+                  background: #f64900;
+                }
+                &.cancel-btn {
+                  border: 1px solid #bbb;
+                  color: #fff;
+                  background: #bbb;
+                }
+              }
+            }
+          }
+          &.modify-row {
+            td {
+              position: relative;
+              input, select {
+                height: 20px;
+                border-radius: 3px;
+                background: #f4f4f4;
+                border: 1px solid #b5b5b5;
+                text-align: center;
+                padding: 0 5px;
+                &.error {
+                  border-color: #f4645f !important;
+                }
+              }
+              &:nth-child(1) {
+                input {
+                  width: 113px;
+                }
+              }
+              &:nth-child(2) {
+                input {
+                  width: 93px;
+                }
+              }
+              &:nth-child(3) {
+                input {
+                  width: 71px;
+                }
+               }
+              &:nth-child(4) {
+                input {
+                  width: 65px;
+                  padding: 0 5px 0 30px;
+                }
+                select {
+                  width: 25px;
+                  padding: 0 0 0 2px;
+                  background: url(/images/applyPurchase/select.png) no-repeat right;
+                  background-size: 12px 19px;
+                  background-position: 13px 0;
+                  position: absolute;
+                  top: 33px;
+                  border-bottom: none;
+                  border-top: none;
+                  border-left: 0;
+                }
+              }
+              &:nth-child(5) {
+                input {
+                  width: 54px;
+                }
+              }
+              &:nth-child(6) {
+                input {
+                  width: 72px;
+                }
+              }
+              &:nth-child(7) {
+                div {
+                  width: 101px;
+                  overflow: unset;
+                  input {
+                    width: 101px;
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+    .modify-btn {
+      border: 1px solid #3c7cf5;
+      color: #3c7cf5;
+      background: #fff;
+    }
+    .delete-btn {
+      border: 1px solid #3c7cf5;
+      color: #fff;
+      background: #3c7cf5;
+    }
+    .submit-area {
+      margin: 51px auto 60px;
+      text-align: center;
+      clear: both;
+      a {
+        display: inline-block;
+        width: 64px;
+        height: 24px;
+        line-height: 22px;
+        text-align: center;
+        border-radius: 3px;
+        &.modify-btn {
+          width: 90px;
+          margin-left: 14px;
+        }
+      }
+    }
+    .apply-del-box{
+      position: fixed;
+      z-index: 1000;
+      height: auto;
+      opacity: 1;
+      background-color: white;
+      width: 310px;
+      /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+      /*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+      /*-o-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+      /*box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+      margin: -155px 0 0 -75px;
+      top: 55%;
+      left: 43%;
+      .title{
+        height: 24px;
+        background-color: #007aff;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 24px;
+        a{
+          color: white;
+          font-size: 12px;
+        }
+      }
+      .content{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+        p{
+          padding: 12px 31px;
+          margin: 0;
+          &:nth-child(2) {
+            font-size: 12px;
+            padding-top: 0;
+          }
+          i{
+            color: #5078cb;
+            font-size: 16px;
+            margin-right: 10px;
+          }
+          span {
+            color: #007aff;
+          }
+          &:last-child {
+            font-size: 12px;
+          }
+        }
+        div{
+          width: 100%;
+          text-align: center;
+          margin: 0 auto 20px;
+          a{
+            padding: 0 19px;
+            height: 26px;
+            line-height: 26px;
+            display: inline-block;
+            text-align: center;
+            font-size: 14px;
+            color: #fff;
+            &:first-child{
+              background: #c8c6c6;
+              margin-right: 10px;
+            }
+            &:last-child{
+              background: #007aff;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 855 - 0
components/applyPurchase/PublishApply.vue

@@ -0,0 +1,855 @@
+<template>
+  <div class="publish-apply">
+    <div class="good-purchaser">
+      <p class="good-purchaser-title">
+        <img src="/images/applyPurchase/good-purchaser-title.png" alt="">
+      </p>
+      <ul>
+        <li v-for="(goodMan, index) in goodPurchaseMan.content">
+          <i v-text="index + 1" :style="'background: url(/images/applyPurchase/level-' + getRankBg(index)  + '.png) center no-repeat;'"></i>
+          <span v-text="goodMan.name"></span>
+        </li>
+      </ul>
+    </div>
+    <div class="publish-area">
+      <div class="publish-form-area">
+        <p>单个发布</p>
+        <div>
+          <div class="form-item">
+            <span>
+              <i>*</i>型号:
+            </span>
+            <input type="text" class="form-control" :class="{'error': !validObj.code}" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号"/>
+            <ul v-show="showSimilarCodeList && applyObj.code">
+              <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
+            </ul>
+          </div>
+          <div class="form-item">
+            <span>
+              <i>*</i>品牌:
+            </span>
+            <input type="text" class="form-control" :class="{'error': !validObj.brand}" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号" />
+            <ul class="brand-similar-list" v-show="showSimilarBrandList && applyObj.brand">
+              <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
+            </ul>
+          </div>
+          <div class="form-item">
+            <span>
+              <i>*</i>截止日期:
+            </span>
+            <!--<input type="text" class="form-control" readonly :class="{'error': !validObj.deadline}" v-model="applyObj.deadline" @blur="checkDeadline" />-->
+            <el-date-picker
+              v-model="applyObj.deadline"
+              type="date"
+              :picker-options="pickerOptions"
+              :class="{'error': !validObj.deadline}"
+              @change="setDeadLineValid"
+              :editable="false"
+              :clearable="true"
+              size="mini">
+            </el-date-picker>
+          </div>
+          <div class="form-item">
+            <span>
+              单价预算:
+            </span>
+            <select v-model="applyObj.currency" class="form-control">
+              <option value="RMB">¥</option>
+              <option value="USD">$</option>
+            </select>
+            <input type="number" class="form-control" :class="{'error': !validObj.unitPrice}" v-model="applyObj.unitPrice" @blur="checkUnitPrice" @input="onUnitPriceInput" />
+          </div>
+          <div class="form-item">
+           <span>
+              封装:
+            </span>
+            <input type="text" class="form-control" v-model="applyObj.encapsulation" @input="onEncapsulationChange" />
+          </div>
+          <div class="form-item">
+            <span>
+              采购数量:
+            </span>
+            <input type="text" class="form-control" :class="{'error': !validObj.amount}" v-model="applyObj.amount" @blur="checkAmount" @input="onAmountInput" />
+          </div>
+          <div class="form-item">
+            <span>
+              生产日期:
+            </span>
+            <input type="text" class="form-control" v-model="applyObj.produceDate" @input="onProduceDateChange" />
+          </div>
+        </div>
+        <a @click="goPublish()">发布求购</a>
+      </div>
+      <div class="publish-upload">
+        <h1>批量发布</h1>
+        <h2>3秒一键配单采购</h2>
+        <label>
+          <img src="/images/applyPurchase/upload.png" alt="" />
+          <!--<input type="file" accept="*.xls, *.xlsx" @change="upload">-->
+          <el-upload
+            drag
+            action="/seek/importBom"
+            accept="*.xls, *.xlsx"
+            :show-file-list="false"
+            :on-success="onSuccess"
+            :on-error="onError">
+          </el-upload>
+        </label>
+        <h3>把Excel格式的BOM拖放到框中</h3>
+        <img @click="downloadTemplate()" class="download-line" src="/images/applyPurchase/download.png" alt="">
+        <img class="apply-logo" src="/images/applyPurchase/publish-apply.png" alt="">
+      </div>
+    </div>
+    <div class="apply-rank">
+      <table>
+        <thead>
+          <tr>
+            <th width="62">排名</th>
+            <th width="160">型号</th>
+            <th width="92">求购次数</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr v-for="(rank, index) in purchaseRank">
+            <td><div>NO.<span>{{index + 1}}</span><i>|</i></div></td>
+            <td>
+              <div>
+                <span v-if="rank.id_cmpcode" :title="rank.id_cmpcode">{{rank.id_cmpcode}}</span>
+                <span v-if="!rank.id_cmpcode">-</span>
+                <i>|</i>
+              </div>
+            </td>
+            <td><div>{{rank.seekAmount || 0}}</div></td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <!--提示框-->
+    <div class="apply-del-box" v-if="showRemindBox">
+      <div class="title">
+        <a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>
+      </div>
+      <div class="content">
+        <!--<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>-->
+        <!--<p style="line-height: 20px;">前往<a @click="goBrandApply()"  target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>-->
+        <p><img src="/images/applyPurchase/check.png" alt="">发布成功</p>
+        <p>其中 <span>100</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
+        <div>
+          <a @click="showRemindBox = false">我知道了</a>
+          <a href="/user#/seekPurchase">前往我的求购</a>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  let getRealLen = function (str) {
+    let len = 0
+    for (let i = 0; i < str.length; i++) {
+      if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
+        len += 2
+      } else {
+        len++
+      }
+    }
+    return len
+  }
+  let cutOutString = function (str, length) {
+    for (let i = 1; i <= str.length; i++) {
+      if (getRealLen(str.substr(0, i)) > length) {
+        str = str.substr(0, i - 1)
+        break
+      }
+    }
+    return str
+  }
+  let formatDate = function (date, fmt) {
+    if (typeof date === 'string') {
+      date = new Date(Date.parse(date.replace(/-/g, '/')))
+    }
+    let o = {
+      'M+': date.getMonth() + 1, // 月份
+      'd+': date.getDate(), // 日
+      'h+': 23, // 小时
+      'm+': 59, // 分
+      's+': 59, // 秒
+      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+      'S': date.getMilliseconds() // 毫秒
+    }
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt
+  }
+  export default {
+    data () {
+      return {
+        applyObj: {
+          code: '',
+          brand: '',
+          unitPrice: '',
+          currency: 'RMB',
+          encapsulation: '',
+          produceDate: '',
+          amount: '',
+          deadline: ''
+        },
+        validObj: {
+          code: true,
+          brand: true,
+          unitPrice: true,
+//          encapsulation: true,
+//          produceDate: true,
+          amount: true,
+          deadline: true
+        },
+        pickerOptions: {
+          disabledDate (time) {
+            // 大于等于今天 小于三个月后
+            return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
+          }
+        },
+        showRemindBox: false,
+        showSimilarCodeList: false,
+        showSimilarBrandList: false,
+        similarCode: [],
+        similarBrand: []
+      }
+    },
+    computed: {
+      goodPurchaseMan () {
+        return this.$store.state.applyPurchase.goodPurchaseMan.goodPurchaseMan.data
+      },
+      purchaseRank () {
+        return this.$store.state.applyPurchase.purchaseApplyRank.purchaseApplyRank.data
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    filters: {
+      enterpriseFilter (str) {
+        return str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str
+      },
+      userNameFilter (str) {
+        return str.substring(0, 1) + '**'
+      }
+    },
+    mounted () {
+      document.getElementsByClassName('el-upload-dragger')[0].onclick = function (event) {
+        event.stopPropagation()
+      }
+      let _this = this
+      document.body.onclick = function () {
+        _this.showSimilarCodeList = false
+        _this.showSimilarBrandList = false
+      }
+    },
+    methods: {
+      emptyForm: function () {
+        for (let attr in this.applyObj) {
+          this.applyObj[attr] = attr === 'currency' ? 'RMB' : ''
+        }
+      },
+      getRankBg: function (index) {
+        return index === 0 ? 1 : index < 3 ? 2 : 3
+      },
+      goPublish: function () {
+        if (this.user.logged) {
+          if (this.checkAll()) {
+            let inquiry = {}
+            let inquiryItem = {}
+            if (this.user.data.enterprise) {
+              inquiry.enUU = this.user.data.enterprise.uu
+            }
+            let date = new Date()
+            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.prodTitle = this.applyObj.code
+            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 = this.applyObj.unitPrice ? this.applyObj.currency : null
+            inquiryItem.cmpCode = (this.applyObj.code).toUpperCase()
+            inquiryItem.unitPrice = this.applyObj.unitPrice
+            inquiryItem.produceDate = this.applyObj.produceDate
+            inquiryItem.date = date
+            inquiryItem.endDate = this.applyObj.deadline
+            inquiryItem.encapsulation = this.applyObj.encapsulation
+            let inquiryItems = []
+            inquiryItems.push(inquiryItem)
+            inquiry.inquiryItems = inquiryItems
+            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('发布失败')
+              })
+          } else {
+            if (!this.validObj.code) {
+              this.$message.error('型号不能为空')
+            } else if (!this.validObj.brand) {
+              this.$message.error('品牌不能为空')
+            } else if (!this.validObj.deadline) {
+              this.$message.error('截止日期不能为空')
+            } else if (!this.validObj.amount) {
+              this.$message.error('请输入正确的数值')
+            }
+          }
+        } else {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        }
+      },
+      getSimilarCode: function () {
+        this.$http.get('/search/similarComponents', {params: {keyword: this.applyObj.code}})
+          .then(response => {
+            this.similarCode = response.data
+            this.showSimilarCodeList = response.data.length > 0
+          })
+      },
+      getSimilarBrand: function () {
+        this.$http.get('/search/similarBrands', {params: {keyword: this.applyObj.brand}})
+          .then(response => {
+            this.similarBrand = response.data
+            this.showSimilarBrandList = response.data.length > 0
+          })
+      },
+      checkCode: function () {
+        this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
+        if (!this.validObj.code) {
+          this.$message.error('型号不能为空')
+        }
+        return this.validObj.code
+      },
+      checkBrand: function () {
+        this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
+        if (!this.validObj.brand) {
+          this.$message.error('品牌不能为空')
+        }
+        return this.validObj.brand
+      },
+      checkUnitPrice: function () {
+        this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
+        if (!this.validObj.unitPrice && this.applyObj.unitPrice <= 0) {
+          this.$message.error('单价必须是大于0的数字')
+        }
+        return this.validObj.unitPrice
+      },
+      checkAmount: function () {
+        this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
+        return this.validObj.amount
+      },
+      checkAll: function () {
+        return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+      },
+      checkDeadline: function () {
+        this.validObj.deadline = Boolean(this.applyObj.deadline)
+        return this.validObj.deadline
+      },
+      setDeadLineValid: function () {
+        this.applyObj.deadline = formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+        this.validObj.deadline = true
+      },
+      onUnitPriceInput: function () {
+        let price = this.applyObj.unitPrice
+        if (price >= 10000) {
+          this.applyObj.unitPrice = price.substring(0, 4)
+        } else if (price.indexOf('.') > -1) {
+          let arr = price.split('.')
+          if (arr[0].length > 4) {
+            this.applyObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
+          } else if (arr[1].length > 6) {
+            this.applyObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
+          }
+        }
+      },
+      onProduceDateChange: function () {
+        if (this.applyObj.produceDate && getRealLen(this.applyObj.produceDate) > 12) {
+          this.applyObj.produceDate = cutOutString(this.applyObj.produceDate, 12)
+        }
+      },
+      onEncapsulationChange: function () {
+        if (this.applyObj.encapsulation && getRealLen(this.applyObj.encapsulation) > 20) {
+          this.applyObj.encapsulation = cutOutString(this.applyObj.encapsulation, 20)
+        }
+      },
+      onCodeChange: function () {
+        this.applyObj.code = this.applyObj.code.trim()
+        if ((/[^\x00-\xff]/g).test(this.applyObj.code)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.code.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.applyObj.code.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.applyObj.code = cutOutString(this.applyObj.code, chineseIndex)
+        } else if (this.applyObj.code && getRealLen(this.applyObj.code) > 100) {
+          this.applyObj.code = cutOutString(this.applyObj.code, 100)
+        } else {
+          this.getSimilarCode()
+        }
+      },
+      onBrandChange: function () {
+        this.applyObj.brand = this.applyObj.brand.trim()
+        if ((/[^\x00-\xff]/g).test(this.applyObj.brand)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.brand.length; i++) {
+            if ((/[^\x00-\xff]/g).test(this.applyObj.brand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(this.applyObj.brand.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          if (chineseIndex > -1) {
+            this.applyObj.brand = this.applyObj.brand.substring(0, chineseIndex)
+          }
+        } else if (this.applyObj.brand && getRealLen(this.applyObj.brand) > 50) {
+          this.applyObj.brand = cutOutString(this.applyObj.brand, 50)
+        } else {
+          this.getSimilarBrand()
+        }
+      },
+      onAmountInput: function () {
+        if (!(/^[0-9]*$/).test(this.applyObj.amount)) {
+          let chineseIndex = -1
+          for (let i = 0; i < this.applyObj.amount.length; i++) {
+            if (!(/^[0-9]*$/).test(this.applyObj.amount.charAt(i))) {
+              chineseIndex = i
+              break
+            }
+          }
+          this.applyObj.amount = cutOutString(this.applyObj.amount, chineseIndex)
+        } else if (this.applyObj.amount.length > 9) {
+          this.applyObj.amount = cutOutString(this.applyObj.amount, 9)
+        }
+      },
+      onSuccess: function (data) {
+        if (data.success) {
+          window.open('/applyPurchase/' + data.data)
+        } else {
+          this.$message.error(data.message)
+        }
+      },
+      onError: function () {
+        if (!this.user.logged) {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        } else {
+          this.$message.error('上传失败, 系统错误')
+        }
+      },
+      downloadTemplate: function () {
+        window.location.href = '/seek/release/template'
+      },
+      setCode: function (code) {
+        this.applyObj.code = code
+        this.showSimilarCodeList = false
+      },
+      setBrand: function (brand) {
+        this.applyObj.brand = brand
+        this.showSimilarBrandList = false
+      }
+//      upload: function (e) {
+//        let file = e.target.files[0]
+//        let param = new FormData()
+//        param.append('file', file, file.name)
+//        let config = {
+//          headers: {'Content-Type': file.type}
+//        }
+//        this.$http.post('/seek/importBom', param, config).then(response => {
+//          if (response.data.success) {
+//            window.open('/applyPurchase/' + response.data.data)
+//          } else {
+//            this.$message.error('上传失败')
+//          }
+//        }, err => {
+//          console.log(err)
+//          this.$message.error('系统错误')
+//        })
+//      }
+    }
+  }
+</script>
+<style lang="scss">
+  .publish-apply {
+    background: url('/images/applyPurchase/banner.png') center center/cover no-repeat;
+    height: 583px;
+    padding-top: 290px;
+    width: 1190px;
+    margin: 0 auto;
+    padding-left: 44px;
+    >div {
+      display: inline-block;
+      border: 1px solid #3975f4;
+      height: 267px;
+      margin-right: 6px;
+      vertical-align: middle;
+      background: #fff;
+      float: left;
+      text-align: center;
+    }
+    .good-purchaser {
+      width: 225px;
+      .good-purchaser-title {
+        height: 55px;
+        line-height: 55px;
+        background: #3975f4;
+        margin: 0;
+      }
+      ul {
+        padding: 0 22px 0 10px;
+        li {
+          line-height: 42px;
+          span {
+            float: right;
+            display: inline-block;
+            width: 152px;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            white-space: nowrap;
+            text-align: left;
+          }
+          i {
+            display: inline-block;
+            float: left;
+            width: 25px;
+            color: #fff;
+            font-size: 16px;
+            font-style: normal;
+          }
+        }
+      }
+    }
+    .publish-area {
+      width: 549px;
+      text-align: center;
+      .publish-form-area {
+        width: 243px;
+        float: left;
+        height: 100%;
+        p {
+          padding-top: 18px;
+          font-size: 26px;
+          color: #3975f4;
+          margin-bottom: 7px;
+        }
+        >div {
+          text-align: left;
+          margin-left: 14px;
+          .form-item {
+            margin-bottom: 5px;
+            position: relative;
+            span {
+              width: 80px;
+              text-align: right;
+              display: inline-block;
+              i {
+                position: relative;
+                top: 2px;
+                right: 3px;
+                color: #e41515;
+              }
+            }
+            ul {
+              line-height: normal;
+              position: absolute;
+              top: 19px;
+              left: 79px;
+              background: #fff;
+              border: 1px solid #b5b5b5;
+              z-index: 1;
+              max-height: 120px;
+              overflow-y: auto;
+              overflow-x: hidden;
+              border-radius: 3px;
+              width: 114px;
+              font-size: 12px;
+              li {
+                height: 24px;
+                line-height: 24px;
+                cursor: pointer;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                padding: 0 5px;
+                &:hover {
+                  background: #ddd;
+                }
+              }
+            }
+            select {
+              width: 32px;
+              position: absolute;
+              height: 20px;
+              background: url('/images/applyPurchase/select.png')no-repeat right;
+              background-position-x: 15px;
+              padding: 0 0 0 3px;
+              border-radius: 0;
+              & + input {
+                padding-left: 34px;
+              }
+            }
+            .el-input {
+              width: 111px;
+              .el-input__inner {
+              }
+            }
+            input {
+              font-size: 12px;
+              width: 111px;
+              height: 20px;
+              line-height: 20px;
+              border-radius: 2px;
+              padding: 0 3px;
+              box-shadow: none;
+              -webkit-box-shadow: none;
+              -moz-box-shadow: none;
+              &.error {
+                border-color: #f4645f!important;
+              }
+            }
+          }
+        }
+        >a {
+          width: 90px;
+          height: 25px;
+          line-height: 25px;
+          background: #3975f4;
+          color: #fefefe;
+          font-size: 16px;
+          display: block;
+          margin: 0 auto;
+          border-radius: 3px;
+          cursor: pointer;
+        }
+      }
+      .publish-upload {
+        background: url('/images/applyPurchase/publish-apply-bg.png')no-repeat;
+        background-size: cover;
+        width: 304px;
+        height: 100%;
+        padding-left: 22px;
+        float: right;
+        color: #fff;
+        position: relative;
+        h1 {
+          font-size: 26px;
+          margin: 22px 0 0 0;
+        }
+        h2 {
+          font-size: 16px;
+          margin: 10px 0 23px 0;
+        }
+        h3 {
+          font-size: 16px;
+          margin: 20px 0 13px 0;
+        }
+        label {
+          position: relative;
+          /*input {
+            display: none;
+          }*/
+          > div {
+            position: absolute;
+            .el-upload {
+              input {
+                display: none;
+              }
+              .el-upload-dragger {
+                width: 247px;
+                height: 216px;
+                position: absolute;
+                bottom: -37px;
+                right: -166px;
+                opacity: 0;
+              }
+            }
+          }
+        }
+        .download-line {
+          cursor: pointer;
+        }
+        .apply-logo {
+          position: absolute;
+          left: -20px;
+          top: 86px;
+        }
+      }
+    }
+    .apply-rank {
+      width: 317px;
+      margin-right: 0;
+      background: url('/images/applyPurchase/rank-title.png') no-repeat;
+      background-color: #fff;
+      background-size: 319px 74px;
+      background-position: -3px -2px;
+      table {
+        margin: 76px auto 0;
+        width: 98%;
+        thead {
+          background: #e0e0e0;
+          height: 26px;
+          line-height: 26px;
+          border-radius: 3px;
+          tr {
+            th {
+              font-size: 16px;
+              font-weight: bold;
+              text-align: center;
+            }
+          }
+        }
+        tbody {
+          tr {
+            height: 25px;
+            line-height: 25px;
+            &:first-child {
+              td {
+                padding-top: 10px;
+              }
+            }
+            td {
+              color: #666;
+              &:nth-child(1) {
+                color: #f6682f;
+                font-size: 12px;
+                >div {
+                  width: 62px;
+                  span {
+                    font-size: 16px;
+                  }
+                }
+              }
+              &:nth-child(2) {
+                >div {
+                  width: 160px;
+                }
+              }
+              &:nth-child(3) {
+                >div {
+                  width: 92px;
+                }
+              }
+              >div {
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+                padding: 0 8px;
+                position: relative;
+                height: 30px;
+                i {
+                  font-style: normal;
+                  float: right;
+                  color: #8b8b8b;
+                  font-size: 14px;
+                  position: absolute;
+                  right: 0;
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+    .apply-del-box{
+      position: fixed;
+      z-index: 1000;
+      height: auto;
+      opacity: 1;
+      background-color: white;
+      width: 310px;
+      -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+      -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+      -o-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+      box-shadow: 0 5px 15px rgba(0,0,0,.5);
+      margin: -155px 0 0 -75px;
+      top: 55%;
+      left: 43%;
+      .title{
+        height: 24px;
+        background-color: #007aff;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 24px;
+        a{
+          color: white;
+          font-size: 12px;
+        }
+      }
+      .content{
+        width: 100%;
+        text-align: center;
+        margin: 0 auto;
+        p{
+          padding: 12px 31px;
+          margin: 0;
+          i{
+            color: #5078cb;
+            font-size: 16px;
+            margin-right: 10px;
+          }
+          span {
+            color: #007aff;
+          }
+          &:last-child {
+            font-size: 12px;
+          }
+        }
+        div{
+          width: 100%;
+          text-align: center;
+          margin: 0 auto 20px;
+          a{
+            padding: 0 19px;
+            height: 26px;
+            line-height: 26px;
+            display: inline-block;
+            text-align: center;
+            font-size: 14px;
+            color: #fff;
+            &:first-child{
+              background: #c8c6c6;
+              margin-right: 10px;
+            }
+            &:last-child{
+              background: #007aff;
+            }
+          }
+        }
+      }
+    }
+  }
+  .el-date-editor--date{
+    width: 110px;
+    &.error {
+      input {
+        border: 1px solid #f4645f !important;
+      }
+    }
+  }
+  .el-icon-date {
+    display: none;
+  }
+  .el-input__inner {
+    height: 20px;
+    border-radius: 0;
+    border: 1px solid #c9c9c9;
+  }
+</style>

+ 465 - 0
components/applyPurchase/SayPrice.vue

@@ -0,0 +1,465 @@
+<template>
+  <div>
+    <div class="modal-wrap" v-if="currentSayPriceIndex > -1">
+      <div class="say-price-box" >
+        <div class="title">
+          <!--<div>型号:<span :title="purchaseManList.content[currentSayPriceIndex].cmpCode">{{purchaseManList.content[currentSayPriceIndex].cmpCode}}</span></div>-->
+          <!--<div>品牌:<span :title="purchaseManList.content[currentSayPriceIndex].inbrand">{{purchaseManList.content[currentSayPriceIndex].inbrand}}</span></div>-->
+          <div>我要报价</div>
+          <i class="fa fa-close" @click="cancelSayPrice"></i>
+        </div>
+        <div class="content">
+          <div class="content-line">
+            <div class="form-item form-left text-line">
+              <span>型号:</span><span class="text" :title="purchaseManList.content[currentSayPriceIndex].cmpCode">{{purchaseManList.content[currentSayPriceIndex].cmpCode}}</span>
+            </div>
+          </div>
+          <div class="content-line">
+            <div class="form-item form-left text-line">
+              <span>品牌:</span><span class="text"  :title="purchaseManList.content[currentSayPriceIndex].inbrand">{{purchaseManList.content[currentSayPriceIndex].inbrand}}</span>
+            </div>
+          </div>
+          <div class="content-line">
+            <div class="form-item form-left">
+              <span><i>*</i>交期:</span>
+              <input type="number" class="form-control" placeholder="天数" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime">
+              <!-- -
+              <input type="text" class="form-control" placeholder="天数">-->
+            </div>
+            <!--<div class="form-item form-upload">
+              <label>
+                <span><i>+</i>添加附件</span>
+                <input type="file">
+              </label>
+              &lt;!&ndash;<div>
+                <span>我是Excel的名字111</span>
+                <i class="fa fa-times-circle"></i>
+                <a href="">更换</a>
+              </div>&ndash;&gt;
+            </div>-->
+          </div>
+          <div class="content-line" v-for="(reply, index) in sayPriceObj.replies">
+            <div class="form-item form-left">
+              <span><i>*</i>价格梯度:</span>
+              <input type="number" class="form-control" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty" placeholder="数量">
+              <!-- -
+               <input type="text" class="form-control" placeholder="数量">-->
+            </div>
+            <div class="form-item form-right">
+              <span><i>*</i>单价<span v-if="purchaseManList.content[currentSayPriceIndex].currency" v-text="purchaseManList.content[currentSayPriceIndex].currency == 'USD' ? '($)' : '(¥)'"></span>:</span>
+              <!--{{purchaseManList.content[currentSayPriceIndex].currency == 'USD' ? '$' : '¥'}})-->
+              <select v-if="!purchaseManList.content[currentSayPriceIndex].currency" v-model="sayPriceObj.currency">
+                <option value="RMB">¥</option>
+                <option value="USD">$</option>
+              </select>
+              <input type="number" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="单价" v-model="reply.price">
+              <i class="fa fa-minus-circle" v-if="sayPriceObj.replies.length > 1" @click="setReplies('sub', index)"></i>
+              <i class="fa fa-plus-circle" v-if="sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
+            </div>
+          </div>
+        </div>
+        <div class="operate">
+          <span @click="commitSayPrice">确定</span>
+          <span @click="cancelSayPrice">取消</span>
+        </div>
+      </div>
+    </div>
+    <loading v-show="showLoading"></loading>
+  </div>
+</template>
+<script>
+  import Loading from '~components/common/loading/PageLoading.vue'
+  export default {
+    props: {
+      purchase: Object,
+      current: Number
+    },
+    data () {
+      return {
+        sayPriceObj: {
+          currency: 'RMB',
+          leadtime: '',
+          replies: [
+            {
+              lapQty: '',
+              price: ''
+            }
+          ]
+        },
+        validSayPrice: {
+          leadtime: false,
+          repliesPrice: false,
+          repliesLapQty: false
+        },
+        showLoading: false
+      }
+    },
+    components: {
+      Loading
+    },
+    computed: {
+      purchaseManList () {
+        return this.purchase || []
+      },
+      currentSayPriceIndex () {
+        this.resetSayPrice()
+        return this.current
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      setIndex: function (index) {
+        this.$emit('sayPriceIndexAction', index)
+      },
+      sayPrice: function (purchaseMan, index) {
+        if (this.user.logged) {
+          if (this.user.data.enterprise.uu) {
+            if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
+              this.resetSayPrice()
+              purchaseMan.active = true
+              this.setIndex(index)
+            } else {
+              this.$message.error('抱歉,您需开通卖家功能才可报价')
+            }
+          } else {
+            this.$message.error('个人账户暂不可报价')
+          }
+        } else {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        }
+      },
+      cancelSayPrice: function () {
+        this.$emit('cancelSayPriceAction')
+      },
+      commitSayPrice: function () {
+        if (this.checkValid()) {
+          let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
+          this.showLoading = true
+          purchaseMan.leadtime = this.sayPriceObj.leadtime
+          purchaseMan.replies = this.sayPriceObj.replies
+          purchaseMan.vendUU = this.user.data.enterprise.uu
+          purchaseMan.vendorUserUU = this.user.data.userUU
+          purchaseMan.qutoApp = 'MALL'
+          if (!purchaseMan.currency) {
+            purchaseMan.currency = this.sayPriceObj.currency
+          }
+          this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
+            this.showLoading = false
+            if (response.data.success === false) {
+              this.$message.error(response.data.message)
+            } else {
+              this.$message.success('报价成功')
+              this.resetSayPrice()
+              this.resetList()
+            }
+          }, error => {
+            console.log(error)
+            this.$message.error('请勿重复报价或报价自己的求购')
+            this.showLoading = false
+          })
+        } else {
+          this.$message.error('请输入正确的报价信息')
+        }
+      },
+      resetList: function () {
+        this.$emit('resetListAction')
+      },
+      resetSayPrice: function () {
+        this.sayPriceObj = {
+          currency: 'RMB',
+          leadtime: '',
+          replies: [
+            {
+              lapQty: '',
+              price: ''
+            }
+          ]
+        }
+      },
+      onLeadtimeInput: function () {
+        if (this.sayPriceObj.leadtime.length > 3) {
+          this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 3)
+        }
+      },
+      onLeadtimeBlur: function () {
+        if (!this.sayPriceObj.leadtime || this.sayPriceObj.leadtime < 1 || this.sayPriceObj.leadtime >= 1000 || this.sayPriceObj.leadtime.toString().indexOf('.') !== -1) {
+          this.validSayPrice.leadtime = false
+          this.$message.error('交期请填写1-999之间的正整数')
+        } else {
+          this.validSayPrice.leadtime = true
+        }
+      },
+      onReplyPriceInput: function (index) {
+        let price = this.sayPriceObj.replies[index].price
+        if (price >= 10000) {
+          this.sayPriceObj.replies[index].price = price.substring(0, 4)
+        } else if (price.indexOf('.') > -1) {
+          let arr = price.split('.')
+          if (arr[0].length > 4) {
+            this.sayPriceObj.replies[index].price = Number(arr[0].substring(0, 4) + '.' + arr[1])
+          } else if (arr[1].length > 6) {
+            this.sayPriceObj.replies[index].price = Number(arr[0] + '.' + arr[1].substring(0, 6))
+          }
+        }
+      },
+      onReplyPriceBlur: function (index) {
+        let price = this.sayPriceObj.replies[index].price
+        if (!price) {
+          this.sayPriceObj.replies[index].price = ''
+          this.$message.error('价格不能为空')
+          this.validSayPrice.repliesPrice = false
+        } else if (price <= 0) {
+          this.sayPriceObj.replies[index].price = ''
+          this.$message.error('输入值必须为正整数')
+          this.validSayPrice.repliesPrice = false
+        } else {
+          this.validSayPrice.repliesPrice = true
+        }
+      },
+      onReplyLapQtyBlur: function (index) {
+        let lapQty = this.sayPriceObj.replies[index].lapQty
+        let limitDownObj = this.getLimitDownQty()
+        if (!lapQty || lapQty < 1) {
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.$message.error('输入值必须为正整数')
+          this.validSayPrice.repliesLapQty = false
+        } else if (limitDownObj.index !== index && limitDownObj.lapQty > lapQty) {
+          this.$message.error('输入值必须大于#该梯度的下限#')
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.validSayPrice.repliesLapQty = false
+        } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].lapQty && this.sayPriceObj.replies[index - 1].lapQty >= lapQty) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].lapQty && this.sayPriceObj.replies[index + 1].lapQty <= lapQty)) {
+          this.$message.error('输入值会导致梯度重叠,请重新修改')
+          this.sayPriceObj.replies[index].lapQty = ''
+          this.validSayPrice.repliesLapQty = false
+        } else {
+          this.validSayPrice.repliesLapQty = true
+        }
+      },
+      onReplyLapQtyInput: function (index) {
+        let lapQty = this.sayPriceObj.replies[index].lapQty
+        if (lapQty.length > 9) {
+          this.sayPriceObj.replies[index].lapQty = lapQty.substring(0, 9)
+        }
+      },
+      getLimitDownQty: function () {
+        for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
+          if (this.sayPriceObj.replies[i].lapQty) {
+            return {
+              lapQty: this.sayPriceObj.replies[i].lapQty,
+              index: i
+            }
+          }
+        }
+        return {index: -1}
+      },
+      checkValid: function () {
+        for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
+          if (!this.sayPriceObj.replies[i].lapQty || !this.sayPriceObj.replies[i].price) {
+            return false
+          }
+        }
+        return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
+      },
+      setReplies: function (type, index) {
+        if (type === 'add' && this.sayPriceObj.replies.length < 5) {
+          if (this.sayPriceObj.replies[index].lapQty && this.sayPriceObj.replies[index].price) {
+            this.sayPriceObj.replies.splice(index + 1, 0, {
+              lapQty: '',
+              price: ''
+            })
+          } else {
+            this.$message.error('请填完整信息')
+          }
+        } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
+          this.sayPriceObj.replies.splice(index, 1)
+        }
+      }
+    }
+  }
+</script>
+<style scoped lang="scss">
+  .say-price-box {
+    position: fixed;
+    width: 476px;
+    top: 30%;
+    left: 33%;
+    /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+    /*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+    /*box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
+    z-index: 1;
+    .title {
+      position: relative;
+      height: 38px;
+      background: #4290f7;
+      line-height: 38px;
+      color: #fff;
+      border: {
+        top-right-radius: 5px;
+        top-left-radius: 5px;
+      }
+      padding-left: 20px;
+      font-weight: bold;
+      /*> div {*/
+        /*display: inline-block;*/
+        /*padding-left: 57px;*/
+        /*width: 47%;*/
+        /*overflow: hidden;*/
+        /*text-overflow: ellipsis;*/
+        /*white-space: nowrap;*/
+      /*}*/
+      i {
+        position: absolute;
+        right: 10px;
+        top: 8px;
+        cursor: pointer;
+      }
+    }
+    .content {
+      padding: 9px 0 0 0;
+      background: #fff;
+      .content-line {
+        padding: 0 0 14px 0;
+        .form-item {
+          display: inline-block;
+          width: 49%;
+          > span {
+            i {
+              color: #fd2637;
+              margin-right: 4px;
+            }
+          }
+          input {
+            border: 1px solid #bfbfbf;
+            border-radius: 2px;
+            height: 28px;
+            padding: 0 8px;
+          }
+          &.form-left {
+            span {
+              display: inline-block;
+              width: 104px;
+              text-align: right;
+            }
+            input {
+              width: 104px;
+              padding: 0 8px;
+            }
+            &.text-line {
+              width: 100%;
+              span {
+                &.text {
+                  width: 300px;
+                  text-align: left;
+                  color: #4290f7;
+                }
+              }
+            }
+          }
+          &.form-upload {
+            text-align: center;
+            label {
+              margin-bottom: 0;
+              cursor: pointer;
+              input {
+                display: none;
+              }
+              span {
+                display: block;
+                width: 94px;
+                height: 23px;
+                line-height: 18px;
+                font-weight: normal;
+                color: #4290f7;
+                text-align: center;
+                border: 1px dashed #4290f7;
+                border-radius: 11px;
+                i {
+                  font-weight: bold;
+                  font-style: normal;
+                  font-size: 18px;
+                  margin-right: 5px;
+                }
+              }
+            }
+            div {
+              i {
+                cursor: pointer;
+                color: #eb222c;
+                font-size: 16px;
+                margin-right: 10px;
+              }
+              span {
+                display: inline-block;
+                max-width: 128px;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                white-space: nowrap;
+              }
+            }
+          }
+          &.form-right {
+            position: relative;
+            input {
+              width: 104px;
+              padding: 0 8px;
+            }
+            select {
+              position: absolute;
+              top: 0;
+              width: 32px;
+              height: 28px;
+              background: url(/images/applyPurchase/arrow-down.png) no-repeat right center;
+              border: {
+                left: none;
+                top: none;
+                bottom: none;
+                right: 1px solid #bfbfbf;
+                bottom-left-radius: 4px;
+                top-left-radius: 4px;
+              }
+              color: #5392f9;
+              font: small-caption;
+              padding-left: 8px;
+              outline: none;
+              & + input {
+                padding-left: 36px;
+                width: 133px;
+              }
+            }
+            > i {
+              margin-left: 4px;
+            }
+          }
+        }
+      }
+    }
+    .operate {
+      background: #fff;
+      height: 52px;
+      text-align: center;
+      padding-top: 12px;
+      border: {
+        top: 1px solid #e4e5e6;
+        bottom-left-radius: 5px;
+        bottom-right-radius: 5px;
+      }
+      span {
+        display: inline-block;
+        width: 64px;
+        height: 28px;
+        line-height: 28px;
+        text-align: center;
+        background: #4290f7;
+        color: #fff;
+        cursor: pointer;
+        border-radius: 2px;
+        &:last-child {
+          margin-left: 15px;
+          background: #acabab;
+        }
+      }
+    }
+  }
+</style>

+ 6 - 0
components/applyPurchase/index.js

@@ -0,0 +1,6 @@
+import ApplyInfo from './ApplyInfo.vue'
+import PublishApply from './PublishApply.vue'
+import ApplyFooter from './ApplyFooter.vue'
+import BatchPublish from './BatchPublish.vue'
+
+export { ApplyInfo, PublishApply, ApplyFooter, BatchPublish }

+ 21 - 0
components/common/loading/PageLoading.vue

@@ -0,0 +1,21 @@
+<template>
+  <div class="loading">
+    <img src="/images/all/loading.gif" alt="">
+  </div>
+</template>
+<style scoped>
+  .loading {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    width:  100%;
+    height: 100%;
+    z-index: 1000;
+    text-align: center;
+  }
+  .loading img {
+    position: relative;
+    top: 40%;
+  }
+</style>

+ 1 - 1
components/common/upload/upload.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="preview">
-      <img :src="qualifications.url==''?'images/all/upload-apply.png': isPdf?'/images/all/timg.png':qualifications.url" class="previewImage"/>
+      <img :src="qualifications.url==''?'/images/all/upload-apply.png': isPdf?'/images/all/timg.png':qualifications.url" class="previewImage"/>
       <input type="file" v-if="!qualifications.url" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" />
     </div>
     <div class="hover-show" v-if="qualifications.url">

+ 20 - 0
components/default/Footer.vue

@@ -85,6 +85,26 @@
         }]
       }
     }
+//    watch: {
+//      $route: function (val, oldVal) {
+//        let footer = document.getElementsByClassName('footer')[0]
+//        if (this.$route.path === '/applyPurchase') {
+//          footer.style.position = 'absolute'
+//          footer.style.top = '2581px'
+//        } else {
+//          footer.style.position = 'initial'
+//        }
+//      }
+//    }
+//    mounted () {
+//      let footer = document.getElementsByClassName('footer')[0]
+//      if (this.$route.path === '/applyPurchase') {
+//        footer.style.position = 'absolute'
+//        footer.style.top = '2581px'
+//      } else {
+//        footer.style.position = 'initial'
+//      }
+//    }
   }
 </script>
 <style lang="scss" scoped>

+ 3 - 3
components/default/Header.vue

@@ -154,7 +154,7 @@
           if (tempEnterprise.isVendor === 313) {
             window.location.href = '/vendor#/index'
           } else {
-            window.location.href = '/register-saler'
+            window.location.href = '/register_saler'
           }
         }
       }
@@ -238,8 +238,8 @@
         .item {
           color: $grey;
           display: inline-block;
-          height: $nav-height;
-          line-height: $nav-height;
+          height: 35px;
+          line-height: 35px;
         }
 
         a {

+ 9 - 9
components/default/RightBar.vue

@@ -113,15 +113,15 @@
         return this.$store.state.chat.tab.tab.data
       }
     },
-    mounted () {
-      this.$nextTick(() => {
-        this.getChatCount()
-        // 刷新统计信息
-        setInterval(() => {
-          this.getChatCount()
-        }, 10000)
-      })
-    },
+//    mounted () {
+//      this.$nextTick(() => {
+//        this.getChatCount()
+//        // 刷新统计信息
+//        setInterval(() => {
+//          this.getChatCount()
+//        }, 10000)
+//      })
+//    },
     methods: {
       listenPage: function (p) {
         this.page = p

+ 1 - 1
components/help/helpHeader.vue

@@ -21,7 +21,7 @@
                     ng-click="onAssociateClick(as)"></li>
             </ul>
         </div>-->
-        <span class="help-title">帮助中心</span>
+        <nuxt-link to="/help/home" class="help-title">帮助中心</nuxt-link>
       </div>
       </div>
   </div>

+ 6 - 1
components/help/left.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="help-list">
-    <h2>帮助中心</h2>
+    <h2>
+      <nuxt-link to="/help/home">帮助中心</nuxt-link>
+    </h2>
     <!--<ul class="list-unstyled" style="margin-top: 10px;">
       <li v-for="nav01 in helps">
         <a :class="{'cur': nav01.isHide}" @click="toggleNav(nav01)"><span>{{nav01.item}}</span></a>
@@ -107,6 +109,9 @@
     text-align: center;
     margin: 0;
   }
+  .help-list h2 a {
+    color: #fff;
+  }
   .help-list ul{
     width: 200px;
     display: inline-block;

+ 271 - 3
components/home/floor/FloorList.vue

@@ -2,22 +2,69 @@
   <div class="floor-list">
     <div class="container">
       <floor-bar :floors="floors"></floor-bar>
-      <a href="/store/33069557578d44e69bd91ad12d28a8d4" target="_blank"><img src="/images/all/banner-cuxiao.png" alt=""></a>
+      <!--<a href="/store/33069557578d44e69bd91ad12d28a8d4" target="_blank"><img src="/images/all/banner-cuxiao.png" alt=""></a>-->
+      <div v-if="purchaseManListData && false"></div>
+      <div class="banner">
+        <ul class="seek-banner">
+          <li><a href="/store/33069557578d44e69bd91ad12d28a8d4" target="_blank"><img src="/images/all/banner-cuxiao01.png" alt=""></a></li>
+          <li>
+            <div class="banner-cuxiao">
+              <div class="wrap">
+                <p class="title"><span>最新求购</span><img class="new-animate" src="/images/all/banner-cuxiao03.jpg" alt="">
+                  <nuxt-link to="/applyPurchase">查看更多</nuxt-link>
+                </p>
+                <div class="list-head">
+                  <span>发布时间</span>
+                  <span>买家名称</span>
+                  <span>型号</span>
+                  <span>操作</span>
+                </div>
+                <ul>
+                  <li v-for="(purchaseMan, index) in purchaseManList.content" :style="'top: -' + 32 * timerIndex + 'px'">
+                    <div>{{purchaseMan.date | date}}</div>
+                    <div>
+                      <span v-if="purchaseMan.inquiry && purchaseMan.inquiry.enterprise && purchaseMan.inquiry.enterprise.enName">{{purchaseMan.inquiry.enterprise.enName | enterpriseFilter}}</span>
+                      <span v-else>{{purchaseMan.userName | userNameFilter}}</span>
+                    </div>
+                    <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode}}</div>
+                    <div>
+                      <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt=""></div>
+                      <div v-else>
+                        <a title="此为贵公司的求购" v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && (user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" class="is-same">我要报价</a>
+                        <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1) && !(user.logged && ((purchaseMan.inquiry.enterprise && user.data.enterprise && (purchaseMan.inquiry.enterprise.uu === user.data.enterprise.uu)) || (!user.data.enterprise.uu && purchaseMan.userUU == user.data.userUU  && !purchaseMan.inquiry.enterprise)))" @click="sayPrice(purchaseMan, index)">我要报价</a>
+                      </div>
+                    </div>
+                  </li>
+                </ul>
+              </div>
+              <nuxt-link to="/applyPurchase" class="purchase">我要求购</nuxt-link>
+            </div>
+          </li>
+        </ul>
+      </div>
       <floor :floor="defaultFloors[0]" :isDefault="true" v-if="!isEmpty"></floor>
       <floor :floor="defaultFloors[1]" :isDefault="true" v-if="!isEmpty"></floor>
       <floor v-for="(floor, index) in floors.data" :floor="floor" :isDefault="false" :key="index"></floor>
     </div>
     <span v-if="expandFloors && false">floor</span>
+    <say-price :current="currentSayPriceIndex"
+               :purchase="purchaseManList"
+               @cancelSayPriceAction="cancelSayPrice"
+               @resetListAction="resetList"
+               @sayPriceIndexAction="setIndex(index)"
+    ></say-price>
   </div>
 </template>
 <script>
   import Floor from './Floor.vue'
   import FloorBar from './FloorBar.vue'
+  import SayPrice from '~components/applyPurchase/SayPrice.vue'
   export default {
     name: 'floor-list',
     components: {
       Floor,
-      FloorBar
+      FloorBar,
+      SayPrice
     },
     data () {
       return {
@@ -44,7 +91,43 @@
               }
             ]
           }
-        ]
+        ],
+        timerIndex: 0,
+        pageSize: 50,
+        nowPage: 1,
+        currentSayPriceIndex: -1,
+        purchaseManList: {
+          content: []
+        },
+        listTemplate: []
+      }
+    },
+    mounted () {
+      setInterval(() => {
+        let _this = this
+        _this.timerIndex ++
+        if (_this.timerIndex % 45 === 0) {
+          for (let i = 0; i < _this.listTemplate.content.length; i++) {
+            this.purchaseManList.content.push(_this.listTemplate.content[i])
+          }
+        }
+      }, 3000)
+    },
+    filters: {
+      date: function (date) {
+        const now = new Date().getDate()
+        const day = (new Date(date).getDate() - now)
+        return day <= 0 ? '今天' : day + '天前'
+      },
+      enterpriseFilter (str) {
+        if (str) {
+          return str.length > 4 ? str.substring(0, 2) + '**' + str.substring(str.length - 2, str.length) : str
+        } else {
+          return '-'
+        }
+      },
+      userNameFilter (str) {
+        return str ? str.substring(0, 1) + '**' : '-'
       }
     },
     computed: {
@@ -93,6 +176,17 @@
           }
         }
         return false
+      },
+      purchaseManListData () {
+        let list = this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
+        for (let i = 0; i < list.content.length; i++) {
+          this.purchaseManList.content.push(list.content[i])
+        }
+        this.listTemplate = list
+        return list
+      },
+      user () {
+        return this.$store.state.option.user
       }
     },
     methods: {
@@ -102,6 +196,34 @@
             return currency === 'RMB' ? prices[i].rMBPrice : prices[i].uSDPrice
           }
         }
+      },
+      setIndex: function (index) {
+        this.currentSayPriceIndex = index
+      },
+      sayPrice: function (purchaseMan, index) {
+        if (this.user.logged) {
+          if (this.user.data.enterprise.uu) {
+            if (this.user.data.enterprise.isVendor && this.user.data.enterprise.isVendor !== '1690') {
+              purchaseMan.active = true
+              this.currentSayPriceIndex = index
+            } else {
+              this.$message.error('抱歉,您需开通卖家功能才可报价')
+            }
+          } else {
+            this.$message.error('个人账户暂不可报价')
+          }
+        } else {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+        }
+      },
+      resetList: function () {
+        this.currentSayPriceIndex = -1
+        this.timerIndex = 0
+        this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.nowPage, pageSize: this.pageSize, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
+      },
+      cancelSayPrice: function () {
+        this.purchaseManList.content[this.currentSayPriceIndex].active = false
+        this.currentSayPriceIndex = -1
       }
     }
   }
@@ -118,4 +240,150 @@
   .floor-list .container > a > img {
     margin-top: 30px;
   }
+  .banner{
+    width:1190px;
+    height: 253px;
+    margin-top: 20px;
+    .seek-banner {
+      > li{
+        float: left;
+        padding-left: 14px;
+        position: relative;
+        &:first-child{
+          padding-left: 0;
+        }
+      }
+    }
+    .banner-cuxiao {
+      width: 660px;
+      height: 253px;
+      background: url('/images/all/banner-cuxiao02.png') no-repeat;
+      .wrap {
+        width: 436px;
+        .title {
+          color: #f57a2e;
+          font-size: 20px;
+          font-weight: bold;
+          padding: 10px 30px;
+          margin: 0;
+          a {
+            font-size: 14px;
+            color: #f57a2e;
+            float: right;
+            margin-top: 7px;
+          }
+        }
+        .list-head {
+          height: 30px;
+          line-height: 30px;
+          color: #fff;
+          font-size: 14px;
+          background-color: #f57a2e;
+          text-align: center;
+          span {
+            display: inline-block;
+            &:nth-child(1) {
+              width: 70px;
+            }
+            &:nth-child(2) {
+              width: 144px;
+            }
+            &:nth-child(3) {
+              width: 106px;
+            }
+            &:nth-child(4) {
+              width: 115px;
+            }
+          }
+        }
+        ul {
+          max-height: 160px;
+          overflow: hidden;
+          position: relative;
+          li {
+            height: 32px;
+            line-height: 32px;
+            position: relative;
+            top: 0;
+            transition: top 1s;
+            -moz-transition: top 1s; /* Firefox 4 */
+            -webkit-transition: top 1s; /* Safari and Chrome */
+            -o-transition: top 1s; /* Opera */
+            > div {
+              overflow: hidden;
+              text-overflow: ellipsis;
+              white-space: nowrap;
+              display: inline-block;
+              text-align: center;
+              &:first-child {
+                color: #f57a2e;
+              }
+              &:nth-child(1) {
+                width: 70px;
+              }
+              &:nth-child(2) {
+                width: 144px;
+              }
+              &:nth-child(3) {
+                width: 106px;
+              }
+              &:nth-child(4) {
+                width: 115px;
+              }
+              a {
+                width: 64px;
+                height: 22px;
+                line-height: 22px;
+                text-align: center;
+                padding: 3px 5px;
+                color: #fd3904;
+                font-size: 12px;
+                border-radius: 2px;
+                border: 1px solid #fd3904;
+                &:hover {
+                  border: 1px solid #fd3904;
+                  background-color: #fd3904;
+                  color: #fff;
+                  -moz-box-shadow: 0 3px 5px #f57a2e; /* 老的 Firefox */
+                  box-shadow: 0 3px 10px #f57a2e;
+                }
+                &.is-same {
+                  background: #cccbcb;
+                  border: none;
+                  color: #fff;
+                  -webkit-box-shadow: none;
+                  -moz-box-shadow: none;
+                  box-shadow: none;
+                }
+              }
+              .is-say-price {
+                color: #39ae05;
+                img {
+                  margin-bottom: 2px;
+                }
+              }
+            }
+          }
+        }
+      }
+      .purchase {
+        position: absolute;
+        left: 515px;
+        top: 184px;
+        width: 100px;
+        height: 28px;
+        line-height: 28px;
+        background-color: #fff;
+        color: #f57a2e;
+        border-radius: 25px;
+        text-align: center;
+        font-weight: bold;
+        &:hover{
+          background-color: #FB6102;
+          color: #fff;
+          box-shadow: 0px 3px 10px #fd863d;
+        }
+      }
+    }
+  }
 </style>

+ 4 - 0
components/main/Nav.vue

@@ -25,6 +25,10 @@
       <nuxt-link to="/news" class="item">
         <span>优软快讯</span>
       </nuxt-link>
+      <nuxt-link to="/applyPurchase" class="item">
+        <span>求购询价</span>
+        <img class="new-animate" src="/images/all/banner-cuxiao03.jpg" alt="">
+      </nuxt-link>
     </div>
   </nav>
 </template>

+ 1 - 1
components/product/ComponentGoods.vue

@@ -54,7 +54,7 @@
           <!--<div class="multiple" v-if="compGoods.reserve > 0">
             倍数:<span>{{compGoods.minPackQty}}</span>
           </div>-->
-          <div class="can-div-sell" v-if="compGoods.reserve" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
+          <div class="can-div-sell" v-if="compGoods.reserve && compGoods.breakUp" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
         </td>
         <td>
           <div v-if="!compGoods.prices">

+ 1 - 1
components/product/component/StoreInfo.vue

@@ -71,7 +71,7 @@
                   <span>起拍:</span>
                   <span v-if="list.minBuyQty">{{list.minBuyQty}}</span>
                 </div>
-                <div class="can-div-sell" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
+                <div class="can-div-sell" v-if="list.breakUp" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
 
                 <!--<div>-->
                   <!--<span>倍数:</span>-->

+ 1 - 1
components/search/GoodList.vue

@@ -97,7 +97,7 @@
              <!-- <div class="multiple" v-if="item.reserve > 0">
                 倍数:<span v-text="item.minPackQty"></span>
               </div>-->
-              <div v-if="item.reserve" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
+              <div v-if="item.reserve && item.breakUp" v-text="item.breakUp?'可拆卖':'不可拆卖'"></div>
             </td>
             <td>
               <div v-show="!item.prices">

+ 1 - 1
components/store/CommodityInfo.vue

@@ -51,7 +51,7 @@
             <div class="com-info">
               <span class="name">库&nbsp;存</span>:<span v-text="commodity.reserve || 0"></span><em style="margin-left: 3px;">PCS</em>
               (<span v-text="commodity.minBuyQty || 1"></span>个起订)
-              <span :class="commodity.breakUp?'div-sell can-div-sell':'div-sell not-div-sell'" v-text="commodity.breakUp?'可拆卖':'不可拆卖'" ></span>
+              <span :class="commodity.breakUp?'div-sell can-div-sell':'div-sell not-div-sell'" v-if="commodity.breakUp">可拆卖</span>
             </div>
             <div class="com-info">
               <span class="name">交&nbsp;期</span>:

+ 1 - 1
components/store/CommodityList.vue

@@ -73,7 +73,7 @@
               <!--<div class="multiple">
                 倍数:<span>1</span>
               </div>-->
-              <div class="can-div-sell" v-if="commodity.reserve || commodity.status === 602" v-text="commodity.breakUp?'可拆卖':'不可拆卖'"></div>
+              <div class="can-div-sell" v-if="(commodity.reserve || commodity.status === 602) && commodity.breakUp">可拆卖</div>
             </td>
             <td>
               <div v-for="price in commodity.prices" v-text="price.start + '+'"></div>

+ 3 - 3
components/store/RecommendProduct.vue

@@ -15,14 +15,14 @@
             <p class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</p>
             <p class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</p>
           </div>
-          <div class="hover-show" :href="commodity.batchCode ? '/store/productDetail/'  + commodity.batchCode : ''">
-            <a :href="commodity.batchCode ? '/store/productDetail/' + commodity.batchCode : ''" class="href">
+          <div class="hover-show">
+            <nuxt-link :to="commodity.batchCode ? '/store/productDetail/' + commodity.batchCode : ''" class="href">
               <div class="title" v-text="commodity.comCode">MRFE6S9045NF001</div>
               <div class="type" v-text="commodity.brandNameCn">PANFAEFQ</div>
               <div class="hr"><span>抢购价</span></div>
               <div class="price" v-if="commodity.minPriceRMB">¥ {{commodity.minPriceRMB | currency}}</div>
               <div class="price" v-if="!commodity.minPriceRMB">$ {{commodity.minPriceUSD | currency}}</div>
-            </a>
+            </nuxt-link>
             <div class="by-cart"><button title="加入购物车" @click="buyNow(false, commodity)"><img src="/images/store/icon/cart-blue.png"/></button></div>
             <div class="buy-now"><button title="立即购买" @click="buyNow(true, commodity)">立即购买</button></div>
           </div>

+ 12 - 7
layouts/shop.vue

@@ -38,14 +38,19 @@
     },
     computed: {
       isInFrame () {
-        let cookies = this.$store.state.option.cookies
-        let cookieArr = cookies.split(';')
-        let cookieObj = {}
-        for (let i = 0; i < cookieArr.length; i++) {
-          let tmpArr = cookieArr[i].split('=')
-          cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+        if (this.$route.query.type === 'erp') {
+          this.$store.commit('option/ADD_COOKIES', 'type=erp;')
+          return true
+        } else {
+          let cookies = this.$store.state.option.cookies
+          let cookieArr = cookies.split(';')
+          let cookieObj = {}
+          for (let i = 0; i < cookieArr.length; i++) {
+            let tmpArr = cookieArr[i].split('=')
+            cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+          }
+          return cookieObj.type === 'erp'
         }
-        return cookieObj.type === 'erp'
       },
       title () {
         let path = this.$route.path

+ 7 - 3
nuxt.config.js

@@ -1,6 +1,7 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://192.168.253.121:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://192.168.253.60:9090/platform-b2c/' : 'http://10.1.51.90:8080/platform-b2c/')
+const commonUrl = process.env.COMMON_URL || (isProdMode ? 'https://api-inquiry.usoftmall.com/' : 'http://218.17.158.219:24000/')
 
 module.exports = {
   router: {
@@ -81,7 +82,8 @@ module.exports = {
   ],
   dev: !isProdMode,
   env: {
-    baseUrl
+    baseUrl,
+    commonUrl
   },
   plugins: [{
     src: '~plugins/axios.js'
@@ -147,6 +149,8 @@ module.exports = {
     '/keyword/**': baseUrl,
     '/tip/**': baseUrl,
     '/UASBatchPutOnProperty**': baseUrl,
-    '/UASBatchPutOnProperty/**': baseUrl
+    '/UASBatchPutOnProperty/**': baseUrl,
+    '/seek/**': baseUrl,
+    '/inquiry/**': commonUrl
   }
 }

+ 19 - 0
pages/applyPurchase/_id.vue

@@ -0,0 +1,19 @@
+<template>
+  <div>
+    <batch-publish></batch-publish>
+  </div>
+</template>
+<script>
+  import { BatchPublish } from '~components/applyPurchase'
+  export default {
+    components: {
+      BatchPublish
+    },
+    fetch ({store, route}) {
+      return Promise.all([
+        store.dispatch('applyPurchase/loadBOMMaterialList', {bomId: route.params.id, page: 1, count: 10}),
+        store.dispatch('applyPurchase/loadBOMNumber', {bomId: route.params.id})
+      ])
+    }
+  }
+</script>

+ 30 - 0
pages/applyPurchase/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="seek">
+    <publish-apply></publish-apply>
+    <apply-info></apply-info>
+    <!--<apply-footer></apply-footer>-->
+  </div>
+</template>
+<script>
+  import { ApplyInfo, PublishApply, ApplyFooter } from '~components/applyPurchase'
+  export default {
+    layout: 'main',
+    components: {
+      ApplyInfo,
+      PublishApply,
+      ApplyFooter
+    },
+    fetch ({store}) {
+      return Promise.all([
+        store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 10, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null}),
+        store.dispatch('applyPurchase/loadPurchaseApplyRank'),
+        store.dispatch('applyPurchase/loadGoodPurchaseManList')
+      ])
+    }
+  }
+</script>
+<style>
+  .seek {
+    position: relative;
+  }
+</style>

+ 145 - 0
pages/applyPurchase/result.vue

@@ -0,0 +1,145 @@
+<template>
+  <div class="result">
+    <div class="container" v-if="state == 'success'">
+      <p>发布求购</p>
+      <img src="/images/applyPurchase/batch-success.png" alt="">
+      <h1>发布成功</h1>
+      <h2>成功发布 <span>{{count}}</span> 条求购</h2>
+      <div class="footer1">前往 <a href="/user#/seekPurchase">买家中心-我的求购</a> <span>{{timer}}s</span></div>
+      <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
+    </div>
+    <div class="container" v-else>
+      <p>发布求购</p>
+      <img src="/images/applyPurchase/batch-error.png" alt="">
+      <h1>上传失败</h1>
+      <h2>请完善产品信息</h2>
+      <div class="footer1">立刻
+        <label>
+          <input type="file" @change="upload" accept="*.xls, *.xlsx">
+          <a>重新上传</a>
+        </label>
+      </div>
+      <div class="footer2">返回 <nuxt-link to="/">商城首页</nuxt-link> | <nuxt-link to="/applyPurchase">求购首页</nuxt-link></div>
+    </div>
+  </div>
+</template>
+<script>
+  export default {
+    data () {
+      return {
+        timer: 5
+      }
+    },
+    mounted () {
+      if (this.state === 'success') {
+        setInterval(() => {
+          this.timer--
+          if (this.timer === 0) {
+            window.location.href = '/user#/seekPurchase'
+          }
+        }, 1000)
+      }
+    },
+    computed: {
+      state () {
+        return this.$route.query.status
+      },
+      count () {
+        return this.$route.query.count || 0
+      },
+      user () {
+        return this.$store.state.option.user
+      }
+    },
+    methods: {
+      upload: function (e) {
+        let file = e.target.files[0]
+        if (file) {
+          let param = new FormData()
+          param.append('file', file, file.name)
+          param.append('chunk', '0')
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/seek/importBom', param, config)
+            .then(response => {
+              if (response.data.success) {
+                window.open('/applyPurchase/' + response.data.data)
+              } else {
+                this.$message.error(response.data.message)
+              }
+            }, err => {
+              console.log(err)
+              if (!this.user.logged) {
+                this.$router.push('/auth/login?returnUrl=' + window.location.href)
+              } else {
+                this.$message.error('上传失败, 系统错误')
+              }
+            })
+        }
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .result {
+    background: #f5f5f5;
+    padding: 20px 0 103px 0;
+    .container {
+      background: #fff;
+      text-align: center;
+      height: 400px;
+      > p {
+        height: 40px;
+        line-height: 40px;
+        background: #e5edfc;
+        margin: 0;
+        font-weight: bold;
+        font-size: 14px;
+        padding-left: 22px;
+        text-align: left;
+      }
+      > img {
+        margin: 61px 0 25px 0;
+      }
+      > h1 {
+        font-size: 18px;
+        color: #fd4e4e;
+        margin: 0 0 8px 0;
+      }
+      > h2 {
+        font-size: 14px;
+        margin: 0;
+        span {
+          color: #fd4e4e;
+        }
+      }
+      .footer1 {
+        margin-top: 38px;
+        font-size: 16px;
+        color: #666;
+        label {
+          input {
+            display: none;
+          }
+        }
+        a {
+          color: #007aff;
+          font-weight: normal;
+        }
+        span {
+          color: #fd4e4e;
+          margin-left: 10px;
+        }
+      }
+      .footer2 {
+        margin-top: 21px;
+        a {
+          &:first-child {
+            color: #4290f7;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 3 - 1
pages/help/helpDetail/_id.vue

@@ -9,7 +9,9 @@
         </div>
         <div class="right">
           <div class="help-center">
-            <div class="help-head"><img src="/images/help/help-title.png"></div>
+            <div class="help-head">
+              <nuxt-link to="/help/home"><img src="/images/help/help-title.png"></nuxt-link>
+            </div>
             <div class="help-center-title">
               <nuxt-link :to="'/help/home'" style="font-size: 14px">帮助中心首页<i class="fa fa-angle-right"></i></nuxt-link>
               <span>

+ 3 - 1
pages/help/helpList/_id.vue

@@ -9,7 +9,9 @@
         </div>
         <div class="right">
           <div class="help-center">
-            <div class="help-head"><img src="/images/help/help-title.png"></div>
+            <div class="help-head">
+              <nuxt-link to="/help/home"><img src="/images/help/help-title.png"></nuxt-link>
+            </div>
             <div class="help-center-title">
               <nuxt-link :to="'/help/home'" style="font-size: 14px">帮助中心首页<i class="fa fa-angle-right"></i></nuxt-link>
               <span>

+ 3 - 1
pages/help/home.vue

@@ -9,7 +9,9 @@
         </div>
         <div class="right">
           <div class="help-center">
-            <div class="help-head"><img src="/images/help/help-title.png"></div>
+            <div class="help-head">
+              <nuxt-link to="/help/home"><img src="/images/help/help-title.png"></nuxt-link>
+            </div>
             <div class="help-center-title">
               <nuxt-link style="font-size: 14px" :to="'/help/home'">帮助中心首页</nuxt-link>
             </div>

+ 2 - 1
pages/index.vue

@@ -99,7 +99,8 @@
             'BT2018012900002056',
             'BT2018012900002056',
             'BT2018012900002056']
-        })
+        }),
+        store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: 1, pageSize: 50, enUU: store.state.option.user.data.enterprise ? store.state.option.user.data.enterprise.uu : null})
       ]) : []
     },
     computed: {

+ 1 - 1
pages/mobile/search/_keycode.vue

@@ -32,7 +32,7 @@
 
     <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="searchLists.length > 0">
       <div class="brand-item" @click="goComponent(item.uuid)">
-        <p>店铺名称:<span>{{item.storeName || '-'}}</span></p>
+        <p>店铺:<span>{{item.storeName || '-'}}</span></p>
         <p>型号:<span>{{item.code || '-'}}</span></p>
         <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
         <p>产品描述:<span>{{item.description || '-'}}</span></p>

+ 5 - 1
plugins/axios.js

@@ -10,7 +10,11 @@ const service = axios.create({
 service.interceptors.request.use(config => {
   // is server render, use ${baseUrl} directly rather than ${proxyUrl}
   if (typeof window === 'undefined') {
-    config.url = process.env.baseUrl + config.url
+    if (config.url.indexOf('/inquiry') === 0) {
+      config.url = process.env.commonUrl + config.url
+    } else {
+      config.url = process.env.baseUrl + config.url
+    }
     config.headers.cookie = store.state.option.cookies + '; ' + store.state.option.sessionId
     config.headers['User-Agent'] = store.state.option.userAgent
   }

+ 2 - 1
plugins/element-ui.js

@@ -1,5 +1,5 @@
 import Vue from 'vue'
-import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog } from 'element-ui'
+import { Message, Breadcrumb, BreadcrumbItem, Tree, Pagination, Upload, Dialog, DatePicker } from 'element-ui'
 
 Vue.use(Breadcrumb)
 Vue.use(BreadcrumbItem)
@@ -7,5 +7,6 @@ Vue.use(Tree)
 Vue.use(Pagination)
 Vue.use(Upload)
 Vue.use(Dialog)
+Vue.use(DatePicker)
 
 Vue.prototype.$message = Message

+ 1 - 0
run.sh

@@ -2,6 +2,7 @@
 
 echo "NODE_ENV: $NODE_ENV"
 echo "BASE_URL: $BASE_URL"
+echo "COMMON_URL: $COMMON_URL"
 
 updateHost(){
   in_ip = ${1}

+ 5 - 5
server.js

@@ -5,7 +5,7 @@ const cookiejar = require('cookiejar')
 const host = process.env.HOST || '127.0.0.1'
 const port = process.env.PORT || 3000
 process.noDeprecation = true
-const url = require('url')
+// const url = require('url')
 
 app.set('port', port)
 
@@ -22,10 +22,10 @@ if (proxyTable) {
     res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE')
     res.header('Access-Control-Allow-Headers', 'Content-Type')
     res.header('Access-Control-Allow-Credentials', 'true')
-    const refer = res.req.headers.referer
-    if (refer && url.parse(refer, true).query.type === 'erp') {
-      res.cookie('type', 'erp')
-    }
+    // const refer = res.req.headers.referer
+    // if (refer && url.parse(refer, true).query.type === 'erp') {
+    //   res.cookie('type', 'erp')
+    // }
     next()
   })
   const defaultOptions = {

BIN
static/images/all/banner-cuxiao01.jpg


BIN
static/images/all/banner-cuxiao01.png


BIN
static/images/all/banner-cuxiao02.png


BIN
static/images/all/banner-cuxiao03.jpg


BIN
static/images/applyPurchase/apply-footer-bg.png


BIN
static/images/applyPurchase/arrow-down.png


BIN
static/images/applyPurchase/banner.png


BIN
static/images/applyPurchase/batch-error.png


BIN
static/images/applyPurchase/batch-success.png


BIN
static/images/applyPurchase/check.png


BIN
static/images/applyPurchase/download.png


BIN
static/images/applyPurchase/good-purchaser-title.png


BIN
static/images/applyPurchase/green-check.png


BIN
static/images/applyPurchase/hot-fire.png


BIN
static/images/applyPurchase/level-1.png


BIN
static/images/applyPurchase/level-2.png


BIN
static/images/applyPurchase/level-3.png


BIN
static/images/applyPurchase/nav-brand.png


BIN
static/images/applyPurchase/nav-kind.png


BIN
static/images/applyPurchase/nav-open.png


BIN
static/images/applyPurchase/nav-order.png


BIN
static/images/applyPurchase/publish-apply-bg.png


BIN
static/images/applyPurchase/publish-apply.png


BIN
static/images/applyPurchase/rank-title.png


BIN
static/images/applyPurchase/say-price.png


BIN
static/images/applyPurchase/select.png


BIN
static/images/applyPurchase/sort-arrow.png


BIN
static/images/applyPurchase/test-logo.png


BIN
static/images/applyPurchase/upload.png


+ 89 - 0
store/applyPurchase.js

@@ -0,0 +1,89 @@
+import axios from '~plugins/axios'
+
+// let findStoreInfoFromUuid = function ({ commit }, params = {}) {
+//   let str = ''
+//   let list = params.list
+//   for (let i = 0; i < list.content.length; i++) {
+//     str += list.content[i].id
+//     str += i !== list.content.length - 1 ? ',' : ''
+//   }
+//   return axios.get('/seek/offer/getSeekPurchaseOfferList', {params: {spIds: str}}).then(response => {
+//     for (let i = 0; i < list.content.length; i++) {
+//       if (response.data.length) {
+//         for (let j = 0; j < response.data.length; j++) {
+//           list.content[i].isOffer = list.content[i].id === response.data[j].spId
+//           if (list.content[i].isOffer) {
+//             break
+//           }
+//         }
+//       } else {
+//         list.content[i].isOffer = false
+//       }
+//     }
+//     commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', list)
+//   }, err => {
+//     console.log(err)
+//     commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', list)
+//   })
+// }
+
+export const actions = {
+// 采购商列表
+  loadPurchaseManList ({ commit }, params = {}) {
+    commit('purchaseManList/REQUEST_PURCHASEMAN')
+    return axios.get('/inquiry/public', {params})
+      .then(response => {
+        let list = response.data
+        for (let i = 0; i < list.content.length; i++) {
+          list.content[i].active = false
+        }
+        // return Promise.all([
+        //   findStoreInfoFromUuid({ commit }, {list: list})
+        // ])
+        commit('purchaseManList/GET_PURCHASEMAN_SUCCESS', list)
+      }, err => {
+        commit('purchaseManList/GET_PURCHASEMAN_FAILURE', err)
+      })
+  },
+  // 求购排行榜
+  loadPurchaseApplyRank ({ commit }, params = {}) {
+    commit('purchaseApplyRank/REQUEST_PURCHASERANK', params)
+    return axios.get(`/inquiry/public/findCodeRankingList`)
+      .then(response => {
+        commit('purchaseApplyRank/GET_PURCHASERANK_SUCCESS', response.data)
+      }, err => {
+        commit('purchaseApplyRank/GET_PURCHASERANK_FAILURE', err)
+      })
+  },
+  // 优质采购商列表
+  loadGoodPurchaseManList ({ commit }, params = {}) {
+    commit('goodPurchaseMan/REQUEST_GOODPURCHASE')
+    return axios.get('/seek/qualityBuyer/getBuyerPageInfo', params)
+      .then(response => {
+        commit('goodPurchaseMan/GET_GOODPURCHASE_SUCCESS', response.data)
+      }, err => {
+        commit('goodPurchaseMan/GET_GOODPURCHASE_FAILURE', err)
+      })
+  },
+  // 获取BOM物料列表
+  loadBOMMaterialList ({ commit }, params = {}) {
+    commit('bomMaterial/REQUEST_BOM_MATERIAL')
+    return axios.get('/seek/getSeekPurchaseByBatchPageInfo', {params: params})
+      .then(response => {
+        commit('bomMaterial/GET_BOM_MATERIAL_SUCCESS', response.data)
+      }, err => {
+        commit('bomMaterial/GET_BOM_MATERIAL_FAILURE', err)
+      })
+  },
+  // 获取BOM上传情况
+  loadBOMNumber ({ commit }, params = {}) {
+    commit('bomMaterial/REQUEST_BOM_INFO')
+    return axios.get('/seek/getImportBomInfo', {params: params})
+      .then(response => {
+        commit('bomMaterial/GET_BOM_INFO_SUCCESS', response.data)
+      }, err => {
+        commit('bomMaterial/GET_BOM_INFO_FAILURE', err)
+      })
+  }
+}
+

+ 34 - 0
store/applyPurchase/bomMaterial.js

@@ -0,0 +1,34 @@
+export const state = () => ({
+  bomList: {
+    fetching: false,
+    data: []
+  },
+  bomNumber: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_BOM_MATERIAL (state) {
+    state.bomList.fetching = true
+  },
+  GET_BOM_MATERIAL_FAILURE (state) {
+    state.bomList.fetching = false
+  },
+  GET_BOM_MATERIAL_SUCCESS (state, result) {
+    state.bomList.fetching = false
+    state.bomList.data = result
+  },
+  REQUEST_BOM_INFO (state) {
+    state.bomNumber.fetching = true
+  },
+  GET_BOM_INFO_FAILURE (state) {
+    state.bomNumber.fetching = false
+  },
+  GET_BOM_INFO_SUCCESS (state, result) {
+    state.bomNumber.fetching = false
+    state.bomNumber.data = result
+  }
+}
+

+ 20 - 0
store/applyPurchase/goodPurchaseMan.js

@@ -0,0 +1,20 @@
+export const state = () => ({
+  goodPurchaseMan: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_GOODPURCHASE (state) {
+    state.goodPurchaseMan.fetching = true
+  },
+  GET_GOODPURCHASE_FAILURE (state) {
+    state.goodPurchaseMan.fetching = false
+  },
+  GET_GOODPURCHASE_SUCCESS (state, result) {
+    state.goodPurchaseMan.fetching = false
+    state.goodPurchaseMan.data = result
+  }
+}
+

+ 20 - 0
store/applyPurchase/purchaseApplyRank.js

@@ -0,0 +1,20 @@
+export const state = () => ({
+  purchaseApplyRank: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_PURCHASERANK (state) {
+    state.purchaseApplyRank.fetching = true
+  },
+  GET_PURCHASERANK_FAILURE (state) {
+    state.purchaseApplyRank.fetching = false
+  },
+  GET_PURCHASERANK_SUCCESS (state, result) {
+    state.purchaseApplyRank.fetching = false
+    state.purchaseApplyRank.data = result
+  }
+}
+

+ 20 - 0
store/applyPurchase/purchaseManList.js

@@ -0,0 +1,20 @@
+export const state = () => ({
+  purchaseManList: {
+    fetching: false,
+    data: []
+  }
+})
+
+export const mutations = {
+  REQUEST_PURCHASEMAN (state) {
+    state.purchaseManList.fetching = true
+  },
+  GET_PURCHASEMAN_FAILURE (state) {
+    state.purchaseManList.fetching = false
+  },
+  GET_PURCHASEMAN_SUCCESS (state, result) {
+    state.purchaseManList.fetching = false
+    state.purchaseManList.data = result
+  }
+}
+

+ 8 - 0
store/index.js

@@ -52,6 +52,14 @@ export const actions = {
     commit('option/REQUEST_USER_INFO')
     return axios.get('/user/authentication')
       .then(response => {
+        if (response.data.userName) {
+          let ens = response.data.enterprises
+          if (ens && ens.length) {
+            response.data.enterprise = ens.find(item => item.current) || {enName: '个人账户'}
+          } else {
+            response.data.enterprise = {enName: '个人账户'}
+          }
+        }
         commit('option/REQUEST_USER_INFO_SUCCESS', response.data)
       }, err => {
         commit('option/REQUEST_USER_INFO_FAILURE', err)