Pārlūkot izejas kodu

Merge branch '修改/订货单添加重复商品' into lsa测试

xiaohaizhao 1 gadu atpakaļ
vecāks
revīzija
beef5f7bb5
1 mainītis faili ar 14 papildinājumiem un 10 dzēšanām
  1. 14 10
      packageA/orderForm/modules/product/index.js

+ 14 - 10
packageA/orderForm/modules/product/index.js

@@ -204,19 +204,23 @@ Component({
                     icon: "none"
                 });
 
-                if (!res.data.isrepeat) return handle()
                 if (res.data.items.length) {
-                    wx.showModal({
-                        title: '提示',
-                        content: `本单已存在【${res.data.items[0].itemname}】商品,确认继续添加吗?`,
-                        complete: (res) => {
-                            if (res.cancel) {
-
+                    if (res.data.isrepeat) {
+                        wx.showModal({
+                            title: '提示',
+                            content: `本单已存在【${res.data.items[0].itemname}】商品,确认继续添加吗?`,
+                            complete: (res) => {
+                                if (res.confirm) handle()
                             }
+                        })
+                    } else {
+                        wx.showModal({
+                            title: '提示',
+                            content: `本单已存在【${res.data.items[0].itemname}】商品,禁止重复添加!`,
+                            showCancel: false
+                        })
+                    }
 
-                            if (res.confirm) handle()
-                        }
-                    })
                 } else {
                     handle()
                 }