yangc 7 years ago
parent
commit
ca88e5436d

+ 63 - 30
components/applyPurchase/ApplyInfo.vue

@@ -51,10 +51,10 @@
           </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>联系买家</a>
+            <a @click="setLinkBoxIndex(index)">联系买家</a>
             <a v-if="purchaseMan.remainingTime > 0 && (!purchaseMan.quoted || purchaseMan.quoted != 1)" @click="sayPrice(purchaseMan, index)">我要报价</a>
             <div class="is-say-price" v-if="purchaseMan.remainingTime > 0 && purchaseMan.quoted == 1">已报价 <img src="/images/applyPurchase/green-check.png" alt="">
-              <div class="say-price-history">
+              <!--<div class="say-price-history">
                 <p class="price-title">历史报价</p>
                 <div>
                   <div>
@@ -82,7 +82,7 @@
                     </li>
                   </ul>
                 </div>
-              </div>
+              </div>-->
             </div>
           </div>
           <div class="expand-content">
@@ -140,17 +140,17 @@
               <!-- -
               <input type="text" class="form-control" placeholder="天数">-->
             </div>
-            <div class="form-item form-upload">
+            <!--<div class="form-item form-upload">
               <label>
                 <span><i>+</i>添加附件</span>
                 <input type="file">
               </label>
-              <!--<div>
+              &lt;!&ndash;<div>
                 <span>我是Excel的名字111</span>
                 <i class="fa fa-times-circle"></i>
                 <a href="">更换</a>
-              </div>-->
-            </div>
+              </div>&ndash;&gt;
+            </div>-->
           </div>
           <div class="content-line" v-for="(reply, index) in sayPriceObj.replies">
             <div class="form-item form-left">
@@ -176,6 +176,18 @@
     <page :total="totalCount" :page-size="pageSize"
           :current="nowPage" v-on:childEvent="listenPage"></page>
     <loading v-show="showLoading"></loading>
+    <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>
@@ -224,7 +236,8 @@
         keyWord: '',
         sorting: {},
         showLoading: false,
-        currentSayPriceIndex: -1
+        currentSayPriceIndex: -1,
+        linkBoxIndex: -1
       }
     },
     components: {
@@ -306,7 +319,7 @@
                 }
               }, error => {
                 console.log(error)
-                this.$message.error('系统错误')
+                this.$message.error('请检查报价信息是否填写正确')
                 this.showLoading = false
               })
             } else {
@@ -383,18 +396,13 @@
       },
       onReplyPriceBlur: function (index) {
         let price = this.sayPriceObj.replies[index].price
-        let limitDownObj = this.getLimitDownPrice()
-        if (!price || price <= 0) {
+        if (!price) {
           this.sayPriceObj.replies[index].price = ''
-          this.$message.error('输入值必须为正整数')
+          this.$message.error('价格不能为空')
           this.validSayPrice.repliesPrice = false
-        } else if (limitDownObj.index !== index && limitDownObj.price > price) {
-          this.$message.error('输入值必须大于#该梯度的下限#')
-          this.sayPriceObj.replies[index].price = ''
-          this.validSayPrice.repliesPrice = false
-        } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].price >= price) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].price <= price)) {
-          this.$message.error('输入值会导致梯度重叠,请重新修改')
+        } else if (price <= 0) {
           this.sayPriceObj.replies[index].price = ''
+          this.$message.error('输入值必须为正整数')
           this.validSayPrice.repliesPrice = false
         } else {
           this.validSayPrice.repliesPrice = true
@@ -411,7 +419,7 @@
           this.$message.error('输入值必须大于#该梯度的下限#')
           this.sayPriceObj.replies[index].lapQty = ''
           this.validSayPrice.repliesLapQty = false
-        } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].lapQty >= lapQty) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].lapQty <= lapQty)) {
+        } 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
@@ -430,17 +438,6 @@
         }
         return {index: -1}
       },
-      getLimitDownPrice: function () {
-        for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
-          if (this.sayPriceObj.replies[i].price) {
-            return {
-              price: this.sayPriceObj.replies[i].price,
-              index: i
-            }
-          }
-        }
-        return {index: -1}
-      },
       checkValid: function () {
         return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
       },
@@ -543,6 +540,9 @@
         } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
           this.sayPriceObj.replies.splice(index, 1)
         }
+      },
+      setLinkBoxIndex: function (index) {
+        this.linkBoxIndex = index
       }
     }
   }
@@ -1125,5 +1125,38 @@
         }
       }
     }
+    .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>

+ 1 - 1
components/applyPurchase/BatchPublish.vue

@@ -586,7 +586,7 @@
         if (type === 'code') {
           this.bomList.content[index].code = param
           this.requestModify(this.bomList.content[index])
-        } else if (type === 'code') {
+        } else if (type === 'brand') {
           this.bomList.content[index].brand = param
           this.requestModify(this.bomList.content[index])
         } else {

+ 24 - 0
components/applyPurchase/PublishApply.vue

@@ -172,6 +172,29 @@
     }
     return str
   }
+  let formatDate = function (date, fmt) {
+    if (typeof date === 'string') {
+      date = new Date(date)
+    }
+    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 {
@@ -351,6 +374,7 @@
         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 () {