瀏覽代碼

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

shenjj 7 年之前
父節點
當前提交
ad31a86e8d
共有 1 個文件被更改,包括 15 次插入13 次删除
  1. 15 13
      components/applyPurchase/PublishApply.vue

+ 15 - 13
components/applyPurchase/PublishApply.vue

@@ -90,7 +90,7 @@
             <input type="text" class="form-control" v-model="applyObj.produceDate" @input="onProduceDateChange" />
           </div>-->
         </div>
-        <a @click="authorityInterceptor(baseUrls.userPublishSeek, goPublish)">发布求购</a>
+        <a @click="goPublish">发布求购</a>
       </div>
       <div class="publish-upload">
         <h1>批量发布</h1>
@@ -284,7 +284,8 @@
       },
       goPublish: function () {
         if (this.user.logged) {
-          if (this.checkAll()) {
+          this.authorityInterceptor(this.baseUrls.userPublishSeek, () => {
+            if (this.checkAll()) {
 //            if (!this.applyObj.prodTitle || this.applyObj.prodTitle.length === 0) {
 //              this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
 //                this.startPublish(response.data && response.data.length ? response.data : '其他')
@@ -292,18 +293,19 @@
 //            } else {
 //              this.startPublish()
 //            }
-            this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
-              this.startPublish(response.data && response.data.length ? response.data : this.applyObj.prodTitle)
-            })
-          } else {
-            if (!this.validObj.prodTitle) {
-              this.$message.error('类目不能为空')
-            } else if (!this.validObj.deadline) {
-              this.$message.error('截止日期不能为空')
-            } else if (!this.validObj.amount) {
-              this.$message.error('请输入正确的数值')
+              this.getMaterialKind(this.applyObj.code, this.applyObj.brand).then(response => {
+                this.startPublish(response.data && response.data.length ? response.data : this.applyObj.prodTitle)
+              })
+            } else {
+              if (!this.validObj.prodTitle) {
+                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)
         }