xuxueyang
2024-07-15 556a9021308af6cb7a39551ad3ab63f3bb2b4e5c
sub_pages/supplier/flower-manage/flower-add.vue
@@ -225,19 +225,25 @@
               bannerList: [], //str[]
               video: '',
               level: '', //FLOWER_LEVEL
               price: 0.00,
               stock: 0,
               price: '',
               stock: '',
               params: [], //id,value
            },
            requireFields: [{
               name: '商品分类',
               key: 'category'
            },{
            }, {
               name: '列表封面图',
               key: 'cover'
            },{
            }, {
               name: '商品等级',
               key: 'level'
            }, {
               name: '商品价格',
               key: 'price'
            }, {
               name: '商品库存',
               key: 'stock'
            }],
            show_select_category: false,
            show_select_level: false,
@@ -510,16 +516,33 @@
         },
         async submit() {
            if (!this.dto.price) {
               this.$message.showToast('商品价格未设置')
               return
            }
            if (this.dto.price <= 0) {
               this.$message.showToast('商品价格不能小于等于0')
               return
            }
            for (var field of this.requireFields) {
               if (!this.dto[field.key]) {
                  this.$message.showToast(`${field.name}信息未填写`)
                  return
               }
            }
            if(this.dto.params.length<1){
               this.$message.showToast('商品参数详情未设置')
               return
            }
            if (this.dto.params.length < 1) {
               this.$message.showToast('商品参数详情未设置')
               return
            } else {
               for (var item of this.dto.params) {
                  if (!item.value) {
                     this.$message.showToast('存在商品参数详情未设置')
                     return
                  }
               }
            }
            // if (!this.dto.applicationType) {
            //    this.$message.showToast('未选择类型')
            //    return