Ver código fonte

商铺总数限制

dingxin 5 anos atrás
pai
commit
678682559b
1 arquivos alterados com 7 adições e 3 exclusões
  1. 7
    3
      src/pages/integralMall/editGoods.jsx

+ 7
- 3
src/pages/integralMall/editGoods.jsx Ver arquivo

119
     },
119
     },
120
   ]
120
   ]
121
 
121
 
122
-   
123
-  const handleSubmit = (values) => {
124
-    if(goodsId){
122
+  const handleSubmit = values => {
123
+    if (values.inventory > values.totalNum) {
124
+      message.error('商品剩余数量不能大于商品总数量')
125
+      return
126
+  }
127
+
128
+    if (goodsId) {
125
       values.goodsId = goodsId
129
       values.goodsId = goodsId
126
       request({ ...apis.integralMall.updateTaGoods, data: values,}).then((data) => {
130
       request({ ...apis.integralMall.updateTaGoods, data: values,}).then((data) => {
127
         cancelPage()
131
         cancelPage()