فهرست منبع

✨ feat(hangup): 添加挂单提示

陈雪 1 ماه پیش
والد
کامیت
d552e541a7
1فایلهای تغییر یافته به همراه31 افزوده شده و 18 حذف شده
  1. 31 18
      src/renderer/views/cashier/components/hangUpDialog.vue

+ 31 - 18
src/renderer/views/cashier/components/hangUpDialog.vue

@@ -117,28 +117,41 @@ export default {
         })
         return false
       }
-      let cartIds = []
-      app.cartList.forEach(function (cart) {
-        cartIds.push(cart.cartId)
+      this.$confirm('是否挂单?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
       })
-      const param = {
-        hangNo: hangNo,
-        userId: app.memberInfo ? app.memberInfo : '',
-        cartIds: cartIds.join(','),
-      }
-      doHangUp(param)
-        .then((response) => {
-          if (response) {
-            Message({
-              message: '挂单成功',
-              type: 'success',
-            })
-            app.getHangUpList()
-            app.$emit('doHangUp')
+        .then(() => {
+          let cartIds = []
+          app.cartList.forEach(function (cart) {
+            cartIds.push(cart.cartId)
+          })
+          const param = {
+            hangNo: hangNo,
+            userId: app.memberInfo ? app.memberInfo : '',
+            cartIds: cartIds.join(','),
           }
+          doHangUp(param)
+            .then((response) => {
+              if (response) {
+                Message({
+                  message: '挂单成功',
+                  type: 'success',
+                })
+                app.getHangUpList()
+                app.$emit('doHangUp')
+              }
+            })
+            .catch(() => {
+              // empty
+            })
         })
         .catch(() => {
-          // empty
+          this.$message({
+            type: 'info',
+            message: '已取消挂单',
+          })
         })
     },
     // 获取挂单列表