Browse Source

空值处理

yangc 8 years ago
parent
commit
40b490c830
2 changed files with 94 additions and 94 deletions
  1. 6 91
      components/applyPurchase/ApplyInfo.vue
  2. 88 3
      components/applyPurchase/PublishApply.vue

+ 6 - 91
components/applyPurchase/ApplyInfo.vue

@@ -33,16 +33,16 @@
           </span>
           <div class="expand-content">
             <div>
-              生产日期:{{purchaseMan.produceDate}}
+              生产日期:{{purchaseMan.produceDate || '-'}}
             </div>
             <div>
-              封装:{{purchaseMan.encapsulation}}
+              封装:{{purchaseMan.encapsulation || '-'}}
             </div>
             <div>
-              采购数量:<span>{{purchaseMan.amount}}</span>个
+              采购数量:<span>{{purchaseMan.amount || '-'}}</span><span v-if="purchaseMan.amount"></span>
             </div>
             <div>
-              单价预算:<span>{{purchaseMan.unitPrice}}</span>
+              单价预算:<span>{{purchaseMan.unitPrice ? purchaseMan.currency == 'RMB' ? '¥' : '&' + purchaseMan.unitPrice : '-'}}</span>
             </div>
           </div>
           <div class="say-price">
@@ -70,22 +70,6 @@
         </li>
       </ul>
     </div>
-    <!--提示框-->
-    <div class="com-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="javascript:void(0)">前往我的求购</a>
-        </div>
-      </div>
-    </div>
     <page :total="totalCount" :page-size="pageSize"
           :current="nowPage" v-on:childEvent="listenPage"></page>
   </div>
@@ -104,8 +88,7 @@
           maxDay: '',
           produceDate: '',
           spId: ''
-        },
-        showRemindBox: false
+        }
       }
     },
     components: {
@@ -156,8 +139,7 @@
         if (valid) {
           this.sayPriceObj.spId = purchaseMan.id
           this.$http.post('/seek/offer/saveOffer', this.sayPriceObj).then(response => {
-//            this.$message.success('发布成功')
-            this.showRemindBox = true
+            this.$message.success('发布成功')
             this.nowPage = 1
             this.resetSayPrice()
             this.resetList()
@@ -500,72 +482,5 @@
       text-align: right;
       float: none;
     }
-    .com-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;
-            }
-          }
-        }
-      }
-    }
   }
 </style>

+ 88 - 3
components/applyPurchase/PublishApply.vue

@@ -100,6 +100,22 @@
         </tbody>
       </table>
     </div>
+    <!--提示框-->
+    <div class="com-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="javascript:void(0)">前往我的求购</a>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 <script>
@@ -123,14 +139,15 @@
 //          encapsulation: true,
 //          produceDate: true,
           amount: true
-//          deadline: 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
       }
     },
     computed: {
@@ -154,7 +171,8 @@
         if (this.checkAll()) {
           this.$http.post('/seek/saveOneSeekPurchase', this.applyObj)
             .then(response => {
-              this.$message.success('发布成功')
+//              this.$message.success('发布成功')
+              this.showRemindBox = true
               this.emptyForm()
               this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: 1, count: 10})
             }, error => {
@@ -428,6 +446,73 @@
         }
       }
     }
+    .com-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;