Эх сурвалжийг харах

Merge remote-tracking branch 'origin/feature-201819-wangcz' into feature-201819-wangcz

shenjj 7 жил өмнө
parent
commit
d9372566cb

+ 222 - 0
components/applyPurchase/SeekProduct.vue

@@ -0,0 +1,222 @@
+<template>
+  <div class="seek-product">
+    <el-dialog
+      title="我要询价"
+      :visible.sync="showObj.show">
+      <div class="form_dialog">
+        <ul class="list-inline">
+          <li class="form-item">
+            <span>品牌:</span>
+            <p>123123123123</p>
+          </li>
+          <li class="form-item">
+            <span>物料名称(类目):</span>
+            <p>1123132123</p>
+          </li>
+          <li class="form-item">
+            <span>型号:</span>
+            <p>3123123123123123123123123</p>
+          </li>
+          <li class="form-item">
+            <span>规格:</span>
+            <p>3</p>
+          </li>
+          <li class="form-item">
+            <span><i>*</i>截止日期:</span>
+            <el-date-picker
+              :class="{'error': !validObj.deadline}"
+              v-model="applyObj.deadline"
+              type="date"
+              :picker-options="pickerOptions"
+              @change="setDeadLineValid"
+              :editable="false"
+              :clearable="true"
+              size="mini">
+            </el-date-picker>
+          </li>
+          <li class="form-item">
+            <span>封装:</span>
+            <input type="text" class="form-control" v-model="applyObj.encapsulation"/>
+          </li>
+          <!--<li class="form-item">-->
+          <!--<span>单价预算:</span>-->
+          <!--<select v-model="applyObj.currency" class="form-control" style="width:40px;">-->
+          <!--<option value="RMB">¥</option>-->
+          <!--<option value="USD">$</option>-->
+          <!--</select>-->
+          <!--<input type="number" v-model="applyObj.unitPrice" class="form-control" :class="{'error': !validObj.unitPrice}"/>-->
+          <!--</li>-->
+          <!--<li class="form-item">-->
+          <!--<span>生产日期:</span>-->
+          <!--<input type="text" class="form-control" v-model="applyObj.produceDate"/>-->
+          <!--</li>-->
+          <li class="form-item">
+            <span>采购数量(PCS):</span>
+            <input type="number" class="form-control" v-model="applyObj.amount" :class="{'error': !validObj.amount}"/>
+          </li>
+        </ul>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <button @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)">询价提交</button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import { seekProduct } from '~utils/mixin'
+  export default {
+    mixins: [seekProduct],
+    props: {
+      showObj: {
+        type: Object,
+        default: function () {
+          return {show: false}
+        }
+      },
+      /*
+      *  spec: '',
+       prodName: '',
+       brand: '',
+       cmpCode: ''
+      * */
+      productItem: {
+        type: Object,
+        default: {}
+      }
+    }
+  }
+</script>
+<style lang="scss">
+  .seek-product {
+    .el-dialog{
+      width: 680px!important;
+      .el-dialog__header{
+        background: #4290f7;
+        line-height: 40px;
+        padding: 0 20px 0;
+        display:block;
+        .el-dialog__title{
+          color:#fff;
+        }
+        .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
+          color:#fff;
+        }
+      }
+      .el-dialog__body{
+        padding: 10px 20px;
+      }
+      .el-dialog__footer{
+        text-align: center;
+        button{
+          display:inline-block;
+          border:0;
+          box-shadow: none;
+          background: #3c7cf5;
+          color:#fff;
+          font-size: 14px;
+          line-height: 30px;
+          height:30px;
+          padding:0 10px;
+          border-radius:5px;
+        }
+      }
+    }
+    .form_dialog{
+      .el-date-editor--date {
+        width: 230px;
+        &.error {
+          input {
+            border: 1px solid #f4645f !important;
+          }
+        }
+      }
+      ul{
+        li{
+          width:50%;
+          font-size: 14px;
+          color:#666;
+          vertical-align: top;
+          margin-bottom:15px;
+          &.form-item {
+            position: relative;
+            p{
+              margin:0;
+              margin-left:112px;
+              word-break: break-all;
+              word-wrap: break-word;
+            }
+            span {
+              float:left;
+              width: 112px;
+              text-align: right;
+              display: inline-block;
+              color:#3c7cf5;
+              i {
+                position: relative;
+                top: 2px;
+                right: 5px;
+                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: 40px;
+              position: absolute;
+              height: 20px;
+              background: url('/images/applyPurchase/select.png')no-repeat right;
+              background-position-x: 23px;
+              padding: 0 0 0 7px;
+              border-radius: 0;
+              & + input {
+                padding-left: 45px;
+              }
+            }
+            .el-input {
+              width: 198px;
+            }
+            input {
+              font-size: 14px;
+              width: 198px;
+              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;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 2 - 1
components/applyPurchase/index.js

@@ -7,5 +7,6 @@ import ArticleOne from './articleOne'
 import ArticleTwo from './articleTwo'
 import ArticleThree from './articleThree'
 import ArticleFour from './articleFour'
+import SeekProduct from './SeekProduct.vue'
 
-export { ApplyInfo, PublishApply, ApplyFooter, BusinessOpportunities, BatchPublish, ArticleOne, ArticleTwo, ArticleThree, ArticleFour }
+export { ApplyInfo, PublishApply, ApplyFooter, BusinessOpportunities, BatchPublish, ArticleOne, ArticleTwo, ArticleThree, ArticleFour, SeekProduct }

+ 62 - 10
components/main/Search.vue

@@ -1,13 +1,19 @@
 <template>
-  <div class="search-box" :class="{'search-box2': !SelectItem}">
+  <div class="search-box"><!-- :class="{'search-box2': !SelectItem}"-->
     <div class="input-group">
       <template v-if="!isPcb">
-        <select v-model="searchType" class="form-control select-type select-adder" v-if="SelectItem">
+        <div class="type">
+          <span class="type-item" :class="{active: newSearchType == 'code'}" @click="setNewSearchType('code')">型号</span>
+          <span class="type-item" :class="{active: newSearchType == 'kind'}" @click="setNewSearchType('kind')">物料名称</span>
+          <span class="type-item" :class="{active: newSearchType == 'store'}" @click="setNewSearchType('store')">卖家</span>
+          <span class="type-item" :class="{active: newSearchType == 'brand'}" @click="setNewSearchType('brand')">品牌</span>
+        </div>
+        <!--<select v-model="searchType" class="form-control select-type select-adder" v-if="SelectItem">
           <option value="product">产品</option>
           <option value="store">店铺</option>
-        </select>
+        </select>-->
         <input v-model="keyword" type="text" class="search-input form-control input-primary"
-               :placeholder="searchType === 'product' ? '品牌/物料名称/型号' : '店铺名称'"
+               :placeholder="placeholderByType"
                @focus.stop.prevent="onFocus()"
                @blur.stop.prevent="onBlur()"
                @keyup.40="onSelectChange(1)"
@@ -31,10 +37,14 @@
     </div>
     <ul class="association"
         :class="{'association2': !SelectItem, 'pcb-asso': isPcb}"
-        v-show="showAssociate && searchType == 'product'"
+        v-show="showAssociate"
         @mouseenter="associate.focus=true"
         @mouseleave="associate.focus=false">
-      <li v-if="similarKeywords.data.brand && similarKeywords.data.brand.length > 0" class="similar-title">品牌:</li>
+      <li v-for="(k, index) in similarKeywords.data.all" class="item"
+          :class="{'active': index==associate.activeIndex}"
+          @click.stop.prevent="onAssociateClick(k)">{{k}}
+      </li>
+     <!-- <li v-if="similarKeywords.data.brand && similarKeywords.data.brand.length > 0" class="similar-title">品牌:</li>
       <li v-for="(k, index) in similarKeywords.data.brand" class="item"
           :class="{'active': index==associate.activeIndex}"
           @click.stop.prevent="onAssociateClick(isCnStart() ? k.nameCn : k.nameEn)">{{ isCnStart() ? k.nameCn : k.nameEn }}
@@ -48,7 +58,7 @@
       <li v-for="(k, index) in similarKeywords.data.component" class="item"
           :class="{'active': index==associate.activeIndex}"
           @click.stop.prevent="onAssociateClick(k.code)">{{ k.code }}
-      </li>
+      </li>-->
     </ul>
     <div class="search-hot" v-if="SelectItem">
       <ul class="list-untyled">
@@ -88,7 +98,9 @@
           activeIndex: null
         },
         click_flag: false,
-        searchType: 'product'
+        searchType: 'product',
+        // 新版搜索控制变量
+        newSearchType: 'code'
       }
     },
     computed: {
@@ -134,6 +146,26 @@
           return tmp || true
         }
         return true
+      },
+      placeholderByType () {
+        let type
+        switch (this.newSearchType) {
+          case 'code':
+            type = '型号'
+            break
+          case 'brand':
+            type = '品牌'
+            break
+          case 'kind':
+            type = '物料名称'
+            break
+          case 'store':
+            type = '卖家名称'
+            break
+          default:
+            type = '型号'
+        }
+        return `请输入${type}`
       }
     },
     watch: {
@@ -222,6 +254,9 @@
         if (this.keyword && this.keyword.length > 0) {
           return this.keyword.charCodeAt(0) > 255
         }
+      },
+      setNewSearchType (type) {
+        this.newSearchType = type
       }
     },
     created () {
@@ -239,7 +274,7 @@
     height: 40px;
     position: relative;
     .search-input{
-      width: 372px;
+      width: 441px;
       float: left;
     }
     .search-input, .search-btn {
@@ -309,7 +344,7 @@
 
     .association {
       position: absolute;
-      left: 69px;
+      left: 0;
       top: 100%;
       right: 81px;
       background: $white;
@@ -345,6 +380,23 @@
       left: 2px;
       right: 71px
     }
+
+    .input-group {
+      .type {
+        position: absolute;
+        top: -21px;
+        .type-item {
+          padding: 4px 12px;
+          color: #5078cb;
+          font-size: 14px;
+          cursor: pointer;
+          &.active, &:hover {
+            background: #4071c6;
+            color: #fff;
+          }
+        }
+      }
+    }
   }
 
   .search-box2 {

+ 141 - 0
components/search/ForwardGoodsList.vue

@@ -0,0 +1,141 @@
+<template>
+  <div class="forward-goods-list">
+    <table>
+      <thead>
+        <tr>
+          <th width="25%">型号/品牌</th>
+          <th width="25%">卖家名称</th>
+          <th width="25%">物料名称(类目)/单位</th>
+          <th width="15%">规格</th>
+          <th width="15%"></th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>
+            <div class="line">
+              <span class="title inline-block">原厂型号</span>
+              <span class="content inline-block">asdasdad</span>
+            </div>
+            <div class="line">
+              <span class="title inline-block">品牌</span>
+              <span class="content inline-block">asdasdad</span>
+            </div>
+          </td>
+          <td class="single">
+            <div class="line">
+              <span class="title inline-block">卖家</span>
+              <span class="content inline-block">asdasdad</span>
+            </div>
+          </td>
+          <td>
+            <div class="line">
+              <span class="title inline-block">物料名称(类目)</span>
+              <span class="content inline-block">asdasdad</span>
+            </div>
+            <div class="line">
+              <span class="title inline-block">单位</span>
+              <span class="content inline-block">asdasdad</span>
+            </div>
+          </td>
+          <td class="single">
+            <div class="line">
+              <span class="title inline-block">规格</span>
+              <span class="content inline-block text-ellipse">asdasdad</span>
+            </div>
+          </td>
+          <td><button @click="goSeek()">立即询价</button></td>
+        </tr>
+      </tbody>
+    </table>
+    <seek-product :productItem="productItem" :showObj="showSeekObj"></seek-product>
+  </div>
+</template>
+<script>
+  import { SeekProduct } from '~components/applyPurchase'
+  export default {
+    data () {
+      return {
+        showSeekObj: {
+          show: false
+        },
+        productItem: {}
+      }
+    },
+    components: {
+      SeekProduct
+    },
+    methods: {
+      goSeek: function () {
+        this.showSeekObj.show = true
+      }
+    }
+  }
+</script>
+<style lang="scss" scoped>
+  .forward-goods-list {
+    table {
+      width: 100%;
+      margin: 10px 0 50px;
+      thead tr {
+        background: #f7f7f7;
+        font-size: 14px;
+        color: #333;
+        height: 40px;
+        th {
+          text-align: center;
+        }
+      }
+      tbody tr {
+        &:hover {
+          background: #ecf2fd;
+        }
+        border: 1px solid #e8e8e8;
+        border-bottom: none;
+        &:last-child {
+          border-bottom: 1px solid #e8e8e8;
+        }
+        td {
+          padding: 24px 0;
+          font-size: 12px;
+          &.single {
+            float: left;
+            width: 100%;
+            height: 100%;
+          }
+          .line {
+            margin-top: 24px;
+            &:first-child {
+              margin-top: 0;
+            }
+            .title {
+              color: #2496f1;
+              width: 27%;
+              text-align: right;
+              vertical-align: top;
+            }
+            .content {
+              width: 73%;
+              padding-left: 10px;
+              vertical-align: top;
+              word-break: break-all;
+              color: #666;
+              height: 30px;
+              overflow: hidden;
+            }
+          }
+          button {
+            width: 80px;
+            text-align: center;
+            border-radius: 3px;
+            height: 30px;
+            color: #fff;
+            background: #2e91f0;
+            border: none;
+            outline: none;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 1 - 1
components/search/GoodList.vue

@@ -41,7 +41,7 @@
           <thead>
           <tr style="height: 40px;">
             <!--<th width="80"></th>-->
-            <th width="140">品牌/物料名称(类目)/型号/规格</th>
+            <th width="200">品牌/物料名称(类目)/型号/规格</th>
             <th width="100">包装/生产日期</th>
             <th width="110">卖家名称</th>
             <th width="140">库存</th>

+ 17 - 14
components/search/ResultTitle.vue

@@ -1,8 +1,10 @@
 <template>
   <div class="result-title text-muted">
-    搜索"<span class="text-inverse" >{{keyword}}</span>"<span v-if="status != 1">暂无此型号</span>
-    <span v-if="status != 3">,为您找到
-    <span class="text-num" v-text="good_list.total"></span> 个<span v-if="status == 2">相关</span>产品</span>:
+    搜索"<span class="text-inverse" >{{keyword}}</span>"
+    <!--<span v-if="status != 1">暂无此型号</span>-->
+    <span>,为您找到
+    <span class="text-num" v-text="good_list.total"></span> 个<span v-if="status == 2">相关</span>信息
+    </span>:
   </div>
 </template>
 <script>
@@ -18,17 +20,17 @@
         return this.$store.state.searchData.searchList.lists
       },
       good_list () {
-        if (this.page === 1) {
-          if (this.good_lists.data.components && this.good_lists.data.components.length > 0) {
-            if (this.keyword.toUpperCase() === this.good_lists.data.components[0].code.toUpperCase()) {
-              this.status = 1
-            } else {
-              this.status = 2
-            }
-          } else {
-            this.status = 3
-          }
-        }
+//        if (this.page === 1) {
+//          if (this.good_lists.data.components && this.good_lists.data.components.length > 0) {
+//            if (this.keyword.toUpperCase() === this.good_lists.data.components[0].code.toUpperCase()) {
+//              this.status = 1
+//            } else {
+//              this.status = 2
+//            }
+//          } else {
+//            this.status = 3
+//          }
+//        }
         return this.good_lists.data
       }
     }
@@ -49,5 +51,6 @@
   .text-num {
     font-style: normal;
     font-family: verdana;
+    color: #0b7bef;
   }
 </style>

+ 2 - 1
components/search/index.js

@@ -1,5 +1,6 @@
 import GoodList from './GoodList.vue'
 import Kind from './Kind.vue'
 import ResultTitle from './ResultTitle.vue'
+import ForwardGoodsList from './ForwardGoodsList.vue'
 
-export { GoodList, Kind, ResultTitle }
+export { GoodList, Kind, ResultTitle, ForwardGoodsList }

+ 3 - 3
components/store/home/EnterpriseInfo.vue

@@ -158,9 +158,9 @@
       // 店铺简介
       getIntro (text) {
         let realLength = this.baseUtils.getRealLen(text)
-        if (realLength > 495) {
+        if (realLength > 494) {
           this.showMore = true
-          text = this.baseUtils.cutOutString(text, 495) + '...'
+          text = this.baseUtils.cutOutString(text, 494) + '...'
         } else {
           this.showMore = false
         }
@@ -351,7 +351,7 @@
             .information-list {
               font-size: 12px;
               color: #333;
-              margin-bottom: 3px;
+              margin-bottom: 2px;
               /*background: #fff;*/
             &:first-child{
                /*padding-top: 10px;*/

+ 48 - 13
pages/search/_keyword.vue

@@ -1,23 +1,31 @@
 <template>
 <div class="container" id="searchResult">
-  <detail-brand></detail-brand>
+  <!--<detail-brand></detail-brand>-->
   <result-title :keyword="key" :page="nowPage"></result-title>
-    <kind @kindFilterEvent="listenKindFilter"
+  <!--  <kind @kindFilterEvent="listenKindFilter"
           @brandFilterEvent="listenBrandFilter"
           @typeFilterEvent="listenTypeFilter"
           @crnameFilterEvent="listenCrnameFilter"
           @crnameFlagEvent="listenCrnameFlag"
-    ></kind>
-  <good-list @pageEvent="listenPage"
-             @sortEvent="listenSort"
-             @filterPriceEvent="listenPriceFilter"
-             :crname_click_flag="crname_click_flag"
-  ></good-list>
+    ></kind>-->
+  <div class="search-result-type">
+    <span class="inline-block" :class="{active: resultType == 'current'}" @click="setResultType('current')">现货(5条)</span>
+    <span class="inline-block" :class="{active: resultType == 'forward'}" @click="setResultType('forward')">期货(5条)</span>
+  </div>
+  <template v-if="searchType == 'code'">
+    <good-list v-if="resultType === 'current'"
+               @pageEvent="listenPage"
+               @sortEvent="listenSort"
+               @filterPriceEvent="listenPriceFilter"
+               :crname_click_flag="crname_click_flag"
+    ></good-list>
+    <forward-goods-list v-else></forward-goods-list>
+  </template>
 </div>
 </template>
 <script>
-  import { GoodList, Kind, ResultTitle } from '~components/search'
-  import DetailBrand from '~components/search/DetailBrand.vue'
+  import { GoodList, ResultTitle, ForwardGoodsList } from '~components/search'
+//  import DetailBrand from '~components/search/DetailBrand.vue'
   export default{
     layout: 'main',
     data () {
@@ -31,7 +39,9 @@
         crname_click_flag: {
           rmb_click_flag: false,
           usd_click_flag: false
-        }
+        },
+        // 现货:current, 期货:forward
+        resultType: 'current'
       }
     },
     fetch ({store, route}) {
@@ -45,9 +55,9 @@
     },
     components: {
       ResultTitle,
-      Kind,
       GoodList,
-      DetailBrand
+      ForwardGoodsList
+//      DetailBrand
     },
     watch: {
       '$route.query.w': {
@@ -58,6 +68,11 @@
         immediate: false
       }
     },
+    computed: {
+      searchType () {
+        return this.$route.query.searchType || 'code'
+      }
+    },
     methods: {
       reloadAll: function () {
         this.filter = {}
@@ -198,8 +213,28 @@
           this.crname_click_flag.rmb_click_flag = obj.rmb_click_flag
           this.crname_click_flag.usd_click_flag = obj.usd_click_flag
         }
+      },
+      setResultType: function (resultType) {
+        this.resultType = resultType
       }
     }
   }
 </script>
+<style lang="scss" scoped>
+  .search-result-type {
+    border-bottom: 2px solid #2e91f0;
+    span {
+      padding: 12px 37px;
+      color: #666;
+      font-size: 14px;
+      border: 1px solid #ccc;
+      cursor: pointer;
+      &.active {
+        color: #fff;
+        background: #2e91f0;
+        border-color: #2e91f0;
+      }
+    }
+  }
+</style>
 

+ 122 - 0
utils/mixin.js

@@ -231,3 +231,125 @@ export const goodsPurchaseOperate = {
     }
   }
 }
+
+/*
+* 根据产品发布询价
+* */
+export const seekProduct = {
+  data () {
+    return {
+      applyObj: {
+        unitPrice: '',
+        currency: 'RMB',
+        encapsulation: '',
+        produceDate: '',
+        amount: '',
+        deadline: ''
+      },
+      validObj: {
+        unitPrice: 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
+        }
+      },
+      hasDialog: false
+    }
+  },
+  methods: {
+    // 时间格式化
+    setDeadLineValid: function () {
+      this.applyObj.deadline = this.baseUtils.formatDate(this.applyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
+      this.validObj.deadline = true
+    },
+    // 检查单价预算
+    checkUnitPrice () {
+      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 () {
+      this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 1000000000
+      return this.validObj.amount
+    },
+    // 检查时间是否有输入
+    checkDeadline () {
+      this.validObj.deadline = Boolean(this.applyObj.deadline)
+      return this.validObj.deadline
+    },
+    // 检查各个字段输入正常数据
+    checkAll () {
+      return this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
+    },
+    emptyForm () {
+      for (let attr in this.applyObj) {
+        this.applyObj[attr] = attr === 'currency' ? 'RMB' : ''
+      }
+    },
+    // 请求询价信息
+    goPublish () {
+      // let _this = this
+      // this.isClick = true
+      // setTimeout(function () {
+      //   _this.isClick = false
+      // }, 1000)
+      if (this.checkAll()) {
+        let inquiry = {}
+        let inquiryItem = {}
+        if (this.user.data.enterprise) {
+          inquiry.enUU = this.user.data.enterprise.uu
+        }
+        let date = new Date()
+        let currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+        inquiry.recorderUU = this.user.data.userUU
+        inquiry.code = 'MALL' + date.getTime()
+        inquiry.date = date
+        inquiry.recorder = this.user.data.userName
+        inquiry.endDate = this.applyObj.deadline
+        inquiry.sourceapp = 'MALL'
+        inquiry.amount = 1
+        inquiryItem.userUU = this.user.data.userUU
+        inquiryItem.source = 'MALL'
+        inquiryItem.userName = this.user.data.userName
+        inquiryItem.userTel = this.user.data.userTel
+        inquiryItem.needquantity = this.applyObj.amount
+        inquiryItem.inbrand = this.productItem.brand
+        inquiryItem.currency = currency
+        inquiryItem.cmpCode = this.productItem.cmpCode.toUpperCase()
+        inquiryItem.unitPrice = this.applyObj.unitPrice
+        inquiryItem.produceDate = this.applyObj.produceDate
+        inquiryItem.date = date
+        inquiryItem.endDate = this.applyObj.deadline
+        inquiryItem.encapsulation = this.applyObj.encapsulation
+        inquiryItem.spec = this.productItem.spec
+        inquiryItem.prodTitle = this.productItem.prodName
+        let inquiryItems = []
+        inquiryItems.push(inquiryItem)
+        inquiry.inquiryItems = inquiryItems
+        inquiry.currency = this.applyObj.unitPrice ? this.applyObj.currency : null
+        this.$http.post('/inquiry/buyer/save', inquiry)
+          .then(res => {
+            this.$message.success('发布成功')
+            this.hasDialog = false
+            this.emptyForm()
+          }, error => {
+            console.log(error)
+            this.$message.error('发布失败')
+          })
+      } else {
+        if (!this.validObj.deadline) {
+          this.$message.error('截止日期不能为空')
+        } else if (!this.validObj.amount) {
+          this.$message.error('请输入正确的数值')
+        }
+      }
+    }
+  }
+}