From 1f9d05fd255fbd21356dad37527c7d33fda4fb8b Mon Sep 17 00:00:00 2001
From: liujie <liujie>
Date: 星期五, 04 八月 2023 17:03:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js |   37 +++++++++++++++++++++++--------------
 1 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
index e10bcba..76ed00a 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -241,6 +241,9 @@
  * 提交
  */
 couponInfoDlg.addSubmit = function () {
+
+    var resultData = {};
+    // 用户权限
     var userType = $('#userType').val();
     // 优惠券名称
     var couponName = $('#name').val;
@@ -253,7 +256,8 @@
     // 所需积分
     var requiredPoints = $('#requiredPoints').val();
     // 用户人群
-    var userGroup = $('#userGroup').val();
+    let userGroup = $(':radio[name="userGroup"]:checked').val();
+
     // 发放数量
     var quantityIssued = $('#quantityIssued').val();
     // 限领数量
@@ -263,7 +267,9 @@
 
     if (userType === '1'){
         // 平台管理员
-        var exchangeMethod = $('#exchangeMethod').val;
+        // 兑换方式:积分+现金
+        let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val();
+
         if (exchangeMethod === 1){
 
         }
@@ -276,10 +282,8 @@
         }
         var goodImg = this.goodsCover;
         var goodImgs = this.goodsPicArray;
-        var company = $('#company').val;
-        if (company === 1){
-
-        }
+        // 适用范围 全国+指定城市+指定门店
+        let company = $(':radio[name="company"]:checked').val()
         if (company === 2){
 
         }
@@ -287,7 +291,7 @@
 
         }
 
-
+        commitAJAX(resultData);
     }
     if (userType === '2'){
         // 城市管理员
@@ -296,15 +300,20 @@
     }
 
 
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
-    var couponName = $('#name').val;
+}
 
+function commitAJAX(obj){
 
+    //提交信息
+    var ajax = new $ax(Feng.ctxPath + "/tCouponManage/commitData", function (data) {
+        Feng.success("添加成功!");
+        window.parent.TCoupon.table.refresh();
+        couponInfoDlg.close();
+    }, function (data) {
+        Feng.error("添加失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("dataResult", JSON.parse(obj));
+    ajax.start();
 }
 
 /**

--
Gitblit v1.7.1