Browse Source

Merge branch 'moss_bug' into develop

* moss_bug:
  feat:商品添加规格型号时,限制内容必填

# Conflicts:
#	src/views/mallManagement/goods/goods_add/index.vue
Moss 1 year ago
parent
commit
8682ae11c1
1 changed files with 25 additions and 10 deletions
  1. 25 10
      src/views/mallManagement/goods/goods_add/index.vue

+ 25 - 10
src/views/mallManagement/goods/goods_add/index.vue

@@ -163,7 +163,7 @@
             highlight-current-row
             highlight-current-row
             stripe
             stripe
             style="margin-bottom: 20px">
             style="margin-bottom: 20px">
-            <el-table-column align="center" label="大类" prop="mainId" min-width="120">
+            <el-table-column align="center" label="*大类" prop="mainId" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-select
                 <el-select
                   size="small"
                   size="small"
@@ -181,7 +181,7 @@
                 </el-select>
                 </el-select>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="小类" prop="smallId" min-width="120">
+            <el-table-column align="center" label="*小类" prop="smallId" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-select
                 <el-select
                   size="small"
                   size="small"
@@ -199,7 +199,7 @@
                 </el-select>
                 </el-select>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="商品名称" prop="specValue" min-width="180">
+            <el-table-column align="center" label="*规格名称" prop="specValue" min-width="180">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.specValue" :disabled="scope.row.goodsCode != ''"></el-input>
                 <el-input size="small" v-model="scope.row.specValue" :disabled="scope.row.goodsCode != ''"></el-input>
               </template>
               </template>
@@ -227,12 +227,12 @@
                 {{scope.row.unit | unitFilter}}
                 {{scope.row.unit | unitFilter}}
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="销售价格" prop="price" min-width="120">
+            <el-table-column align="center" label="*销售价格" prop="price" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.price"></el-input>
                 <el-input size="small" v-model="scope.row.price"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="划线价格" prop="orgPrice" min-width="120">
+            <el-table-column align="center" label="*划线价格" prop="orgPrice" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.orgPrice"></el-input>
                 <el-input size="small" v-model="scope.row.orgPrice"></el-input>
               </template>
               </template>
@@ -242,17 +242,17 @@
                 {{scope.row.costAmount}}
                 {{scope.row.costAmount}}
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="佣金" prop="shareAmount" min-width="120">
+            <el-table-column align="center" label="*佣金" prop="shareAmount" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.shareAmount"></el-input>
                 <el-input size="small" v-model="scope.row.shareAmount"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="内部佣金" prop="innerShareAmount" min-width="120">
+            <el-table-column align="center" label="*内部佣金" prop="innerShareAmount" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.innerShareAmount"></el-input>
                 <el-input size="small" v-model="scope.row.innerShareAmount"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="上架库存" prop="stockNum" min-width="120">
+            <el-table-column align="center" label="*上架库存" prop="stockNum" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.stockNum"></el-input>
                 <el-input size="small" v-model="scope.row.stockNum"></el-input>
               </template>
               </template>
@@ -262,7 +262,7 @@
                 {{scope.row.stockQty}}
                 {{scope.row.stockQty}}
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column align="center" label="规格图片" prop="imgUrl" min-width="120">
+            <el-table-column align="center" label="*规格图片" prop="imgUrl" min-width="120">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-image
                 <el-image
                   v-if="scope.row.imgUrl"
                   v-if="scope.row.imgUrl"
@@ -767,7 +767,7 @@ export default {
       this.specList[index].mainName = item.mainName || '';
       this.specList[index].mainName = item.mainName || '';
       this.specList[index].smallId = item.smallId || '';
       this.specList[index].smallId = item.smallId || '';
       this.specList[index].smallName = item.smallName || '';
       this.specList[index].smallName = item.smallName || '';
-      this.specList[index].specValue = item.goodsName || '';
+      this.specList[index].specValue = item.specsName || '';
       this.specList[index].specsName = item.specsName || '';
       this.specList[index].specsName = item.specsName || '';
       this.specList[index].unit = item.unit || '';
       this.specList[index].unit = item.unit || '';
       this.specList[index].costAmount = item.costAmount || '';
       this.specList[index].costAmount = item.costAmount || '';
@@ -782,6 +782,21 @@ export default {
           // 验证第二步
           // 验证第二步
           this.$refs.step2Form.validate((valid) => {
           this.$refs.step2Form.validate((valid) => {
             if (valid) {
             if (valid) {
+
+              if(this.specList.length < 1) return this.$errorMsg('请添加规格类型')
+
+              for(let i=0; i<this.specList.length; i++) {
+                if(!this.specList[i].mainId)  return this.$errorMsg('请选择大类')
+                if(!this.specList[i].smallId)  return this.$errorMsg('请选择小类')
+                if(!this.specList[i].specValue)  return this.$errorMsg('请填写规格名称')
+                if(!this.specList[i].price)  return this.$errorMsg('请填写销售价格')
+                if(!this.specList[i].orgPrice)  return this.$errorMsg('请填写划线价格')
+                if(!this.specList[i].shareAmount)  return this.$errorMsg('请填写佣金')
+                if(!this.specList[i].innerShareAmount)  return this.$errorMsg('请填写内部佣金')
+                if(!this.specList[i].stockNum)  return this.$errorMsg('请填写商品库存')
+                if(!this.specList[i].imgUrl)  return this.$errorMsg('请上传规格图片')
+              }
+
               // 验证第三步
               // 验证第三步
               this.$refs.step3Form.validate((valid) => {
               this.$refs.step3Form.validate((valid) => {
                 if (valid) {
                 if (valid) {