Browse Source

优化:添加商品时0库存商品无法保存改为可以保存

ZENGlei11350 1 year ago
parent
commit
dee8215da2
2 changed files with 3 additions and 3 deletions
  1. 1 1
      .vscode/settings.json
  2. 2 2
      src/views/mall/product/spu/form/BasicInfoForm.vue

+ 1 - 1
.vscode/settings.json

@@ -83,7 +83,7 @@
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   },
   "editor.codeActionsOnSave": {
-    "source.fixAll.eslint": true
+    "source.fixAll.eslint": "explicit"
   },
   "[vue]": {
     "editor.defaultFormatter": "rvest.vs-code-prettier-eslint"

+ 2 - 2
src/views/mall/product/spu/form/BasicInfoForm.vue

@@ -197,7 +197,7 @@ defineOptions({ name: 'ProductSpuBasicInfoForm' })
 const ruleConfig: RuleConfig[] = [
   {
     name: 'stock',
-    rule: (arg) => arg >= 1,
+    rule: (arg) => arg >= 0,
     message: '商品库存必须大于等于 1 !!!'
   },
   {
@@ -213,7 +213,7 @@ const ruleConfig: RuleConfig[] = [
   {
     name: 'costPrice',
     rule: (arg) => arg >= 0.01,
-    message: '商品成本价格必须大于等于 0.01 元!!!'
+    message: '商品成本价格必须大于等于 0.00 元!!!'
   }
 ]