yangc 7 years ago
parent
commit
0d371cfc2a

+ 41 - 58
components/applyPurchase/ApplyInfo.vue

@@ -297,74 +297,54 @@
         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
+//        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) {
+            this.resetSayPrice()
+            purchaseMan.active = true
+            this.currentSayPriceIndex = index
+          } else {
+            this.$message.error('个人账户不可报价')
+          }
+        } else {
+          this.$router.push('/auth/login?returnUrl=' + window.location.href)
         }
-        this.resetSayPrice()
-        purchaseMan.active = true
-        this.currentSayPriceIndex = index
       },
       cancelSayPrice: function () {
         this.purchaseManList.content[this.currentSayPriceIndex].active = false
         this.currentSayPriceIndex = -1
       },
       commitSayPrice: function () {
-        if (this.user.logged) {
-          if (this.user.data.enterprise.uu) {
-            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
-              })
+        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.error('请输入正确的报价信息')
+              this.$message.success('报价成功')
+              this.resetSayPrice()
+              this.resetList()
             }
-          } else {
-            this.$message.error('个人账户不可报价')
-          }
-//          if (this.checkAllSayPrice()) {
-//          } else {
-//            if (!this.validSayPrice.unitPrice) {
-//              if (!this.sayPriceObj.unitPrice) {
-//                this.$message.error('单价不能为空')
-//              } else {
-//                this.$message.error('单价必须是大于0的数字')
-//              }
-//            } else if (!this.validSayPrice.minDay || !this.validSayPrice.maxDay) {
-//              if ((!this.sayPriceObj.minDay && this.sayPriceObj.minDay !== 0) || (!this.sayPriceObj.maxDay && this.sayPriceObj.maxDay !== 0)) {
-//                this.$message.error('交期不能为空')
-//              } else {
-//                if (this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
-//                  this.$message.error('交期只能填写1-31之间的整数值')
-//                } else {
-//                  this.$message.error('最短交期应小于等于最长交期')
-//                }
-//              }
-//            }
-//          }
+          }, error => {
+            console.log(error)
+            this.$message.error('请勿重复报价或报价自己的求购')
+            this.showLoading = false
+          })
         } else {
-          this.$router.push('/auth/login?returnUrl=' + window.location.href)
+          this.$message.error('请输入正确的报价信息')
         }
       },
       resetList: function () {
@@ -1065,6 +1045,7 @@
               border: 1px solid #bfbfbf;
               border-radius: 2px;
               height: 28px;
+              padding: 0 8px;
             }
             &.form-left {
               span {
@@ -1074,6 +1055,7 @@
               }
               input {
                 width: 64px;
+                padding: 0 8px;
               }
             }
             &.form-upload {
@@ -1123,6 +1105,7 @@
               position: relative;
               input {
                 width: 101px;
+                padding: 0 8px;
               }
               select {
                 position: absolute;

+ 18 - 16
components/applyPurchase/BatchPublish.vue

@@ -133,18 +133,20 @@
       <a class="modify-btn delete-btn" @click="submitBOM">确认发布</a>
     </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="">成功发布{{successResult.successAmount || 0}}个</p>
-        <p v-if="successResult.goodsAmount && successResult.goodsAmount > 0 ">其中<span>{{successResult.goodsAmount || 0}}</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
-        <div>
-          <a @click="showRemindBox = false">继续发布</a>
-          <a href="/user#/seekPurchase" target="_blank">前往我的求购</a>
+    <div class="modal-wrap" v-if="showRemindBox">
+      <div class="apply-del-box">
+        <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="">成功发布{{successResult.successAmount || 0}}个</p>
+          <p v-if="successResult.goodsAmount && successResult.goodsAmount > 0 ">其中<span>{{successResult.goodsAmount || 0}}</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
+          <div>
+            <a @click="showRemindBox = false">继续发布</a>
+            <a href="/user#/seekPurchase" target="_blank">前往我的求购</a>
+          </div>
         </div>
       </div>
     </div>
@@ -890,10 +892,10 @@
       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);
+      /*-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%;

+ 3 - 2
components/applyPurchase/PublishApply.vue

@@ -53,7 +53,7 @@
             <span>
               单价预算:
             </span>
-            <select v-model="applyObj.currency">
+            <select v-model="applyObj.currency" class="form-control">
               <option value="RMB">¥</option>
               <option value="USD">$</option>
             </select>
@@ -174,7 +174,7 @@
   }
   let formatDate = function (date, fmt) {
     if (typeof date === 'string') {
-      date = new Date(date)
+      date = new Date(Date.parse(date.replace(/-/g, '/')))
     }
     let o = {
       'M+': date.getMonth() + 1, // 月份
@@ -610,6 +610,7 @@
               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;
               }