Переглянути джерело

线下销售订单-新增时商品信息判空提示

Moss 1 рік тому
батько
коміт
00c5d38ca0

+ 1 - 1
src/styles/order-list.scss

@@ -107,7 +107,7 @@
             }
             .main {
               width: 70%;
-              height: 80px;
+              // height: 80px;
               display: flex;
               flex-direction: column;
               .spec {

+ 11 - 0
src/views/mallManagement/order/offline_order_list/index.vue

@@ -942,6 +942,17 @@ export default {
             if(this.oldList.length < 1) return this.$errorMsg('以旧换新需要添加旧机信息');
           }
 
+          for(let i = 0; i < this.goodsList.length; i++) {
+            if(this.goodsList[i].flag == 1) {
+              if(!this.goodsList[i].goodsId) return this.$errorMsg('请完善商品信息-商品名称');
+              if(!this.goodsList[i].goodsSpecId) return this.$errorMsg('请完善商品信息-规格型号');
+            } else {
+              if(!this.goodsList[i].goodsMaterialId) return this.$errorMsg('请完善商品信息-商品名称/规格型号');
+            }
+            if(!this.goodsList[i].num) return this.$errorMsg('请完善商品信息-订单数量');
+            if(!this.goodsList[i].price) return this.$errorMsg('请完善商品信息-单价');
+          }
+
           let orderSmallTypeText = this.orderTypeList.find(o => o.id == this.formData.orderSmallType).orderSmallTypeText;
           let oldList = this.oldList.map(item => {
             return {