Browse Source

海控问题修复

zyh 3 years ago
parent
commit
da45ef0fb1

+ 12 - 2
kmall-admin/src/main/java/com/kmall/admin/controller/vip/Mall2PointsRulesController.java

@@ -122,8 +122,18 @@ public class Mall2PointsRulesController {
             e.printStackTrace();
             return R.error("导入失败!");
         }
-        mall2PointsRulesService.rulesUploadDetil(mall2RulesDtoList,mkaId);
-        return R.ok();
+
+        return mall2PointsRulesService.rulesUploadDetil(mall2RulesDtoList,mkaId);
+    }
+
+    /**
+     * 积分赠送规则查询积分类型
+     */
+    @RequestMapping("/getRulesDetilId")
+    @ResponseBody
+    public R getRulesDetilId(Long mkaId) {
+        Integer rulesDetilId = mall2PointsRulesService.getRulesDetilId(mkaId);
+        return R.ok(rulesDetilId.toString());
     }
 
     /**

+ 2 - 6
kmall-admin/src/main/java/com/kmall/admin/controller/vip/Mall2PointsRulesDetilController.java

@@ -64,9 +64,7 @@ public class Mall2PointsRulesDetilController {
 //    @RequiresPermissions("mall2pointsrulesdetil:save")
     @ResponseBody
     public R save(@RequestBody Mall2RulesDto mall2RulesDto) {
-        mall2PointsRulesDetilService.save(mall2RulesDto);
-
-        return R.ok();
+        return mall2PointsRulesDetilService.save(mall2RulesDto);
     }
 
     /**
@@ -76,9 +74,7 @@ public class Mall2PointsRulesDetilController {
 //    @RequiresPermissions("mall2pointsrulesdetil:update")
     @ResponseBody
     public R update(@RequestBody Mall2RulesDto mall2RulesDto) {
-        mall2PointsRulesDetilService.update(mall2RulesDto);
-
-        return R.ok();
+        return mall2PointsRulesDetilService.update(mall2RulesDto);
     }
 
     /**

+ 4 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/vip/Mall2PointsRulesDetilServiceImpl.java

@@ -5,6 +5,7 @@ import com.kmall.admin.dto.Mall2RulesDto;
 import com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity;
 import com.kmall.admin.service.vip.Mall2PointsRulesDetilService;
 import com.kmall.admin.service.vip.Mall2PointsRulesService;
+import com.kmall.common.utils.R;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -45,16 +46,16 @@ public class Mall2PointsRulesDetilServiceImpl implements Mall2PointsRulesDetilSe
     }
 
     @Override
-    public int save(Mall2RulesDto mall2RulesDto) {
+    public R save(Mall2RulesDto mall2RulesDto) {
         Integer rulesType = mall2PointsRulesService.getRulesDetilId(mall2RulesDto.getMkaId());
         mall2RulesDto.setRulesType(Integer.toString(rulesType));
         List<Mall2RulesDto> mall2RulesDtos = new ArrayList<>();
         mall2RulesDtos.add(mall2RulesDto);
-        return mall2PointsRulesService.rulesUploadDetil(mall2RulesDtos,mall2RulesDto.getMkaId());
+        return mall2PointsRulesService.rulesUploadDetil(mall2RulesDtos, mall2RulesDto.getMkaId());
     }
 
     @Override
-    public int update(Mall2RulesDto mall2RulesDto) {
+    public R update(Mall2RulesDto mall2RulesDto) {
         Integer rulesType = mall2PointsRulesService.getRulesDetilId(mall2RulesDto.getMkaId());
         mall2RulesDto.setRulesType(Integer.toString(rulesType));
         List<Mall2RulesDto> mall2RulesDtos = new ArrayList<>();

+ 65 - 20
kmall-admin/src/main/java/com/kmall/admin/service/impl/vip/Mall2PointsRulesServiceImpl.java

@@ -15,10 +15,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 import com.kmall.admin.dao.vip.Mall2PointsRulesDao;
 import com.kmall.admin.entity.vip.Mall2PointsRulesEntity;
@@ -87,7 +84,8 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService {
      * @param mkaId
      */
     @Override
-    public Integer rulesUploadDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId) {
+    public R rulesUploadDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId) {
+        StringBuilder stringBuilder = new StringBuilder();
         Integer pointsType = mall2PointsRulesDao.queryRulesDetilId(mkaId);
         if(pointsRulesList.size()>0){
             for(Mall2RulesDto mall2RulesDto : pointsRulesList) {
@@ -99,72 +97,119 @@ public class Mall2PointsRulesServiceImpl implements Mall2PointsRulesService {
                 switch (pointsType) {
                     //门店
                     case 0:
-                        mall2RulesDto.setRulesId(storeDao.queryObjectRulesByName(mall2RulesDto.getPointsRulesName().trim()) + "");
+                        Long store = storeDao.queryObjectRulesByName(mall2RulesDto.getPointsRulesName().trim());
+                        if (Objects.isNull(store)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的门店名称不存在请确认再添加,");
+//                            return R.error("门店名称不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId(store+"");
                         break;
                     //商品类别
                     case 1:
-                        mall2RulesDto.setRulesId(categoryDao.queryObjectCategoryByName(mall2RulesDto.getPointsRulesName().trim()) + "");
+                        Long category = categoryDao.queryObjectCategoryByName(mall2RulesDto.getPointsRulesName().trim());
+                        if (Objects.isNull(category)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的类别名称不存在请确认再添加,");
+//                            return R.error("类别名称不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId( category+ "");
                         break;
                     //商品
                     case 2:
-                        mall2RulesDto.setRulesId(productStoreRelaDao.queryproductStoreByName(mall2RulesDto.getPointsRulesName().trim(), id));
+                        String s = productStoreRelaDao.queryproductStoreByName(mall2RulesDto.getPointsRulesName().trim(), id);
+                        if (Objects.isNull(s)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的商品条码不存在请确认再添加,");
+//                            return R.error("商品条码不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId(mall2RulesDto.getPointsRulesName().trim());
+                        mall2RulesDto.setPointsRulesName(s);
                         break;
                     default:
                         break;
                 }
-
                 mall2RulesDto.setMkaId(mkaId);
                 mall2RulesDto.setPointsRulesType(pointsType);
                 mall2RulesDto.setPointsRulesName(mall2RulesDto.getPointsRulesName().trim());
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("pointsDetilNameId",mall2RulesDto.getRulesId());
+                map.put("storeName",mall2RulesDto.getStoreName());
+                map.put("mkaId",mkaId);
+                Query query = new Query(map);
 
+                List<Mall2RulesDto> mall2RulesDtos = mall2PointsRulesDao.querymall2PointsRulesDetil(query);
+                if (!mall2RulesDtos.isEmpty()){
+                    stringBuilder.append("已存在,无法添加,请进行修改操作");
+                }
+            }
+            if (stringBuilder.length()>0){
+                return R.error(stringBuilder.toString());
             }
+
             if(pointsRulesList.size()>0){
                 log.debug("积分规则明细导入数据:{}", JacksonUtil.toJson(pointsRulesList));
-                return mall2PointsRulesDao.saveMall2PointsRulesDetil(pointsRulesList);
+                mall2PointsRulesDao.saveMall2PointsRulesDetil(pointsRulesList);
             }
         }
-        return 0;
-
+        return R.ok();
     }
 
     @Override
-    public Integer updateRulesDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId) {
+    public R updateRulesDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId) {
+        StringBuilder stringBuilder = new StringBuilder();
         Integer pointsType = mall2PointsRulesDao.queryRulesDetilId(mkaId);
         if(pointsRulesList.size()>0){
             for(Mall2RulesDto mall2RulesDto : pointsRulesList) {
                 //校验参数
                 checkMsg(pointsType,mall2RulesDto);
                 //获取门店ID
-                Long id = storeDao.queryObjectRulesByName(mall2RulesDto.getStoreName().trim());
+                Long id = storeDao.queryObjectRulesByName(Objects.isNull(mall2RulesDto.getStoreName()) ? "": mall2RulesDto.getStoreName().trim());
+
                 mall2RulesDto.setStoreId(id);
                 switch (pointsType) {
                     //门店
                     case 0:
-                        mall2RulesDto.setRulesId(storeDao.queryObjectRulesByName(mall2RulesDto.getPointsRulesName().trim()) + "");
+                        Long store = storeDao.queryObjectRulesByName(mall2RulesDto.getPointsRulesName().trim());
+                        if (Objects.isNull(store)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的门店名称不存在请确认再修改,");
+//                            return R.error("门店名称不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId(store+"");
                         break;
                     //商品类别
                     case 1:
-                        mall2RulesDto.setRulesId(categoryDao.queryObjectCategoryByName(mall2RulesDto.getPointsRulesName().trim()) + "");
+                        Long category = categoryDao.queryObjectCategoryByName(mall2RulesDto.getPointsRulesName().trim());
+                        if (Objects.isNull(category)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的类别名称不存在请确认再修改,");
+//                            return R.error("类别名称不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId( category+ "");
                         break;
                     //商品
                     case 2:
-                        mall2RulesDto.setRulesId(productStoreRelaDao.queryproductStoreByName(mall2RulesDto.getPointsRulesName().trim(), id));
+                        String s = productStoreRelaDao.queryproductStoreByName(mall2RulesDto.getPointsRulesName().trim(), id);
+                        if (Objects.isNull(s)){
+                            stringBuilder.append(mall2RulesDto.getPointsRulesName()+"的商品条码不存在请确认再修改,");
+//                            return R.error("商品条码不存在请确认再添加");
+                        }
+                        mall2RulesDto.setRulesId(mall2RulesDto.getPointsRulesName().trim());
+                        mall2RulesDto.setPointsRulesName(s);
                         break;
                     default:
                         break;
                 }
-
                 mall2RulesDto.setMkaId(mkaId);
                 mall2RulesDto.setPointsRulesType(pointsType);
                 mall2RulesDto.setPointsRulesName(mall2RulesDto.getPointsRulesName().trim());
 
             }
+            if (stringBuilder.length()>0){
+                return R.error(stringBuilder.toString());
+            }
             if(pointsRulesList.size()>0){
                 log.debug("积分规则明细修改数据:{}", JacksonUtil.toJson(pointsRulesList));
-                return mall2PointsRulesDao.updateMall2PointsRulesDetil(pointsRulesList);
+                mall2PointsRulesDao.updateMall2PointsRulesDetil(pointsRulesList);
             }
         }
-        return 0;
+        return R.ok();
     }
 
     @Override

+ 3 - 2
kmall-admin/src/main/java/com/kmall/admin/service/vip/Mall2PointsRulesDetilService.java

@@ -2,6 +2,7 @@ package com.kmall.admin.service.vip;
 
 import com.kmall.admin.dto.Mall2RulesDto;
 import com.kmall.admin.entity.vip.Mall2PointsRulesDetilEntity;
+import com.kmall.common.utils.R;
 
 import java.util.List;
 import java.util.Map;
@@ -45,7 +46,7 @@ public interface Mall2PointsRulesDetilService {
      * @param Mall2RulesDto 实体
      * @return 保存条数
      */
-    int save(Mall2RulesDto Mall2RulesDto);
+    R save(Mall2RulesDto Mall2RulesDto);
 
     /**
      * 根据主键更新实体
@@ -53,7 +54,7 @@ public interface Mall2PointsRulesDetilService {
      * @param mall2RulesDto 实体
      * @return 更新条数
      */
-    int update(Mall2RulesDto mall2RulesDto);
+    R update(Mall2RulesDto mall2RulesDto);
 
     /**
      * 根据主键删除

+ 3 - 2
kmall-admin/src/main/java/com/kmall/admin/service/vip/Mall2PointsRulesService.java

@@ -5,6 +5,7 @@ import com.kmall.admin.entity.vip.Mall2PointsRulesEntity;
 import com.kmall.admin.dto.Mall2PointsRulesDto;
 import com.kmall.admin.haikong.vo.PointsRulesAndDetailVO;
 import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
 
 import java.util.Date;
 import java.util.List;
@@ -75,9 +76,9 @@ public interface Mall2PointsRulesService {
      */
     int deleteBatch(Integer[] mprIds);
 
-    Integer rulesUploadDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId);
+    R rulesUploadDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId);
 
-    Integer updateRulesDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId);
+    R updateRulesDetil(List<Mall2RulesDto> pointsRulesList, Long mkaId);
 
     Integer getRulesDetilId(Long mkaId);
     /**

+ 4 - 1
kmall-admin/src/main/resources/mybatis/mapper/vip/Mall2PointsRulesDao.xml

@@ -212,8 +212,8 @@
 			(
 			#{item.mkaId},
 			#{item.pointsRulesType},
-			#{item.rulesId},
 			#{item.pointsRulesName},
+			#{item.rulesId},
 			#{item.storeName},
 			#{item.storeId}
 			)
@@ -264,6 +264,9 @@
 		<if test="pointsDetilName !=null and pointsDetilName !=''">
 			and points_detil_name=#{pointsDetilName}
 		</if>
+		<if test="storeName !=null and storeName !=''">
+			and points_store_name=#{storeName}
+		</if>
 		<if test="offset != null and limit != null">
 			limit #{offset}, #{limit}
 		</if>

+ 21 - 9
kmall-admin/src/main/webapp/WEB-INF/page/mk/mall2RulesDetil.html

@@ -55,15 +55,27 @@
 <!--                    <i-option :value="2" :key="2">门店商品</i-option>-->
 <!--                </i-select>-->
 <!--            </Form-item>-->
-
-            <Form-item label="对应的商品条码/门店/类别名称" prop="goodsSn">
-                <i-input v-model="mall2PointsRulesDetil.pointsRulesName" placeholder="对应的商品条码/门店/类别名称"/>
-            </Form-item>
-
-            <Form-item label="对应的商品门店" prop="goodsSn">
-                <i-input v-model="mall2PointsRulesDetil.storeName" placeholder="对应的商品门店"/>
-            </Form-item>
-
+            <div v-show="pointsType==0">
+                <Form-item label="门店名称" prop="goodsSn">
+                    <i-input v-model="mall2PointsRulesDetil.pointsRulesName" placeholder="门店名称"/>
+                </Form-item>
+            </div>
+            <div v-show="pointsType==1">
+                <Form-item label="类别名称" prop="goodsSn">
+                    <i-input v-model="mall2PointsRulesDetil.pointsRulesName" placeholder="类别名称"/>
+                </Form-item>
+                <Form-item label="对应的商品门店" prop="goodsSn">
+                    <i-input v-model="mall2PointsRulesDetil.storeName" placeholder="门店名称"/>
+                </Form-item>
+            </div>
+            <div v-show="pointsType==2">
+                <Form-item label="商品条码" prop="goodsSn">
+                    <i-input v-model="mall2PointsRulesDetil.pointsRulesName" placeholder="商品条码"/>
+                </Form-item>
+                <Form-item label="对应的商品门店" prop="goodsSn">
+                    <i-input v-model="mall2PointsRulesDetil.storeName" placeholder="门店名称"/>
+                </Form-item>
+            </div>
             <Form-item>
                 <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>

+ 10 - 19
kmall-admin/src/main/webapp/WEB-INF/page/mk/mkactivitiespresentintegral.html

@@ -25,6 +25,7 @@
                 #if($shiro.hasPermission("mkactivitiespresentintegral:delete"))
                 <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                 #end
+                <i-button type="warning" @click="reloadMkactivities" v-show="!isMkactivitiesShow">返回营销方式页</i-button>
             </div>
         </Row>
 	    <table id="jqGrid"></table>
@@ -38,14 +39,19 @@
                 <i-input v-model="mkActivitiesPresentIntegral.productName" placeholder="产品中文名"/>
             </Form-item>
             <Form-item label="赠送方式- 1 :固定值 2:倍率" prop="activityGiveType">
-                <i-input v-model="mkActivitiesPresentIntegral.activityGiveType" placeholder="赠送方式- 1 :固定值 2:倍率"/>
+                <i-select v-model="mkActivitiesPresentIntegral.activityGiveType" filterable placeholder="赠送方式-1 :固定值 2:倍率" label-in-value>
+                    <i-option v-for="activityGiveType in activityGiveTypes" :value="activityGiveType.id" :key="activityGiveType.id">{{activityGiveType.name}}</i-option>
+                </i-select>
             </Form-item>
+            <Form-item label="赠送方式" prop="activityGiveType" >
+                <i-select v-model="mkActivitiesPresentIntegral.activityGiveType" filterable placeholder="赠送方式" label-in-value>
+                    <i-option v-for="activityGiveType in activityGiveTypes" :value="activityGiveType.id" :key="activityGiveType.id">{{activityGiveType.name}}</i-option>
+                </i-select>
+            </Form-item>
+
             <Form-item label="赠送数值" prop="activityGiveNum">
                 <i-input v-model="mkActivitiesPresentIntegral.activityGiveNum" placeholder="赠送数值"/>
             </Form-item>
-            <Form-item label="门店编号" prop="shopSn">
-                <i-input v-model="mkActivitiesPresentIntegral.shopSn" placeholder="门店编号"/>
-            </Form-item>
             <Form-item label="商品sku" prop="sku">
                 <i-input v-model="mkActivitiesPresentIntegral.sku" placeholder="商品sku"/>
             </Form-item>
@@ -58,27 +64,12 @@
             <Form-item label="商品系列" prop="productSeries">
                 <i-input v-model="mkActivitiesPresentIntegral.productSeries" placeholder="商品系列"/>
             </Form-item>
-            <Form-item label="营销活动编号" prop="mkaId">
-                <i-input v-model="mkActivitiesPresentIntegral.mkaId" placeholder="营销活动编号"/>
-            </Form-item>
             <Form-item label="是否与积分抵扣互斥,0:不互斥 1:互斥" prop="rejectScore">
                 <i-input v-model="mkActivitiesPresentIntegral.rejectScore" placeholder="是否与积分抵扣互斥,0:不互斥 1:互斥"/>
             </Form-item>
             <Form-item label="截止日期" prop="deadline">
                 <i-input v-model="mkActivitiesPresentIntegral.deadline" placeholder="截止日期"/>
             </Form-item>
-            <Form-item label="创建时间" prop="createTime">
-                <i-input v-model="mkActivitiesPresentIntegral.createTime" placeholder="创建时间"/>
-            </Form-item>
-            <Form-item label="创建人编号" prop="createrSn">
-                <i-input v-model="mkActivitiesPresentIntegral.createrSn" placeholder="创建人编号"/>
-            </Form-item>
-            <Form-item label="修改人编号" prop="moderSn">
-                <i-input v-model="mkActivitiesPresentIntegral.moderSn" placeholder="修改人编号"/>
-            </Form-item>
-            <Form-item label="修改时间" prop="updateTime">
-                <i-input v-model="mkActivitiesPresentIntegral.updateTime" placeholder="修改时间"/>
-            </Form-item>
             <Form-item>
                 <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                 <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>

+ 73 - 47
kmall-admin/src/main/webapp/js/mk/mall2RulesDetil.js

@@ -4,55 +4,80 @@ $(function () {
 	if(mkaId){
 		vm.mkaId = mkaId;
 	}
+	$.ajax({
+		type: "POST",
+		url: "../mall2pointsrules/getRulesDetilId/?mkaId="+vm.mkaId,
+		contentType: "application/json",
+		success: function (r) {
+			if (r.code == 0) {
+				var pointsType = r.msg;
+				vm.pointsType=r.msg;
+				var rulesId,pointsRulesName;
+				if (pointsType == 0){
+					rulesId="门店";
+					pointsRulesName="门店ID";
+				}else if(pointsType == 1){
+					rulesId="分类名称";
+					pointsRulesName="商品分类ID";
+				}else if (pointsType == 2){
+					rulesId="商品";
+					pointsRulesName="商品sku";
+				}
 
-    $("#jqGrid").jqGrid({
-        url: '../mall2pointsrules/detilList',
-        datatype: "json",
-        colModel: [
-			{label: 'ID', name: 'id', index: 'id', width: 30, align: 'center'},
-			{
-				label: '积分类型', name: 'rulesType', index: 'points_rules_type', width: 80,align: 'center', formatter: function (value) {
-					if (value === '0' || value === 0) {
-						return '门店';
-					}
-					if (value == '1' || value === 1) {
-						return '商品类别';
-					}
-					if (value == '2' || value === 2) {
-						return '门店商品';
+				$("#jqGrid").jqGrid({
+					url: '../mall2pointsrules/detilList',
+					datatype: "json",
+					colModel: [
+						{label: 'ID', name: 'id', index: 'id', width: 30, align: 'center'},
+						{
+							label: '积分类型', name: 'rulesType', index: 'points_rules_type', width: 80,align: 'center', formatter: function (value) {
+								if (value === '0' || value === 0) {
+									return '门店';
+								}
+								if (value == '1' || value === 1) {
+									return '商品类别';
+								}
+								if (value == '2' || value === 2) {
+									return '门店商品';
+								}
+
+							}
+						},
+						{label: rulesId, name: 'pointsRulesName', index: 'points_detil_name', width: 80, align: 'center'},
+						{label: pointsRulesName, name: 'rulesId', index: 'points_detil_name_id', width: 80, align: 'center'},
+						{label: '对应的商品门店名称', name: 'storeName', index: 'points_store_name', width: 80, align: 'center'},
+						{label: '备注', name: 'remark', index: 'remark', width: 80, align: 'center'},],
+					viewrecords: true,
+					postData: {'mkaId': vm.mkaId},
+					height: 550,
+					rowNum: 10,
+					rowList: [10, 30, 50],
+					rownumbers: true,
+					rownumWidth: 25,
+					autowidth: true,
+					multiselect: true,
+					pager: "#jqGridPager",
+					jsonReader: {
+						root: "page.list",
+						page: "page.currPage",
+						total: "page.totalPage",
+						records: "page.totalCount"
+					},
+					prmNames: {
+						page: "page",
+						rows: "limit",
+						order: "order"
+					},
+					gridComplete: function () {
+						$("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
 					}
+				});
 
-				}
-			},
-			{label: '商品/门店/分类名称', name: 'pointsRulesName', index: 'points_detil_name', width: 80, align: 'center'},
-			{label: '门店ID/商品sku/商品分类ID', name: 'rulesId', index: 'points_detil_name_id', width: 80, align: 'center'},
-			{label: '对应的商品门店名称', name: 'storeName', index: 'points_store_name', width: 80, align: 'center'},
-			{label: '备注', name: 'remark', index: 'remark', width: 80, align: 'center'},],
-		viewrecords: true,
-		postData: {'mkaId': vm.mkaId},
-        height: 550,
-        rowNum: 10,
-        rowList: [10, 30, 50],
-        rownumbers: true,
-        rownumWidth: 25,
-        autowidth: true,
-        multiselect: true,
-        pager: "#jqGridPager",
-        jsonReader: {
-            root: "page.list",
-            page: "page.currPage",
-            total: "page.totalPage",
-            records: "page.totalCount"
-        },
-        prmNames: {
-            page: "page",
-            rows: "limit",
-            order: "order"
-        },
-        gridComplete: function () {
-            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
-        }
-    });
+			} else {
+				alert(r.msg);
+			}
+		}
+	});
 
 
 });
@@ -80,7 +105,8 @@ let vm = new Vue({
 		uploadData:[],
 		storeId : '',
 		mkaId : '',
-		mall2PointsRulesDetil:{}
+		mall2PointsRulesDetil:{},
+		pointsType:""
 	},
 	methods: {
 		query: function () {

+ 36 - 2
kmall-admin/src/main/webapp/js/mk/mkactivitiespresentintegral.js

@@ -1,4 +1,23 @@
 $(function () {
+	let flag = getQueryString("flag");
+	if(flag != null && flag == "false"){
+		vm.isMkactivitiesShow = false;
+	}
+	let mkCode = getQueryString("mkCode");
+	if(mkCode){
+		vm.mkCode = mkCode;
+	}
+
+	let storeId = getQueryString("storeId");
+	if(storeId){
+		vm.storeId = storeId;
+	}
+	let mkaId = getQueryString("mkaId");
+	if(mkaId){
+		vm.mkaId = mkaId;
+	}
+
+
     $("#jqGrid").jqGrid({
         url: '../mkactivitiespresentintegral/list',
         datatype: "json",
@@ -58,7 +77,13 @@ let vm = new Vue({
 		},
 		q: {
 		    name: ''
-		}
+		},
+		isMkactivitiesShow: true,
+		mkCode: '',
+		uploadData:[],
+		storeId : '',
+		mkaId : '',
+		activityGiveTypes:{}
 	},
 	methods: {
 		query: function () {
@@ -148,6 +173,15 @@ let vm = new Vue({
         },
         handleReset: function (name) {
             handleResetForm(this, name);
-        }
+        },
+		//返回营销方式页
+		reloadMkactivities: function () {
+			window.location.href = "/mk/mkactivityform.html?mkCode="+vm.mkCode;
+		},
+	},
+	mounted() {
+		$.get("../sys/macro/queryMacrosByValue?value=activityGiveType", function (r) {
+			vm.activityGiveTypes = r.list;
+		});
 	}
 });

+ 8 - 1
kmall-admin/src/main/webapp/js/mk/mkactivityform.js

@@ -52,7 +52,7 @@ $(function () {
     $("#jqGrid").jqGrid("setFrozenColumns");
 
     var marketing =
-        {'lscx': '临时促销','jfdk': '积分抵扣'/*'yhq': '优惠券','rchd': '日常活动','mysy': '买N送一',/*'mj': '满减', 'mz': '满赠','dz': '打折','zhjsp': '组合价商品','drjbj':'第二件半价'*/};
+        {'lscx': '临时促销','jfdk': '积分抵扣','zsjf':'赠送积分'/*'yhq': '优惠券','rchd': '日常活动','mysy': '买N送一',/*'mj': '满减', 'mz': '满赠','dz': '打折','zhjsp': '组合价商品','drjbj':'第二件半价'*/};
 
 
     let mkCode = getQueryString("mkCode");
@@ -95,6 +95,8 @@ $(function () {
                         mkaTopicName = marketing.drjbj;
                     else if(value === 'jfdk')
                         mkaTopicName = marketing.jfdk;
+                    else if(value === 'zsjf')
+                        mkaTopicName = marketing.zsjf;
                     return mkaTopicName == null? value : mkaTopicName;
                 }},
             {label: '营销活动名称', name: 'mkaName', width: 200, align: 'center'},
@@ -202,6 +204,9 @@ let vm = new Vue({
             }, {
                 id: 'jfdk',
                 name: '积分抵扣'
+            },{
+                id: 'zsjf',
+                name: '赠送积分'
             }
             /*, {
                 id: 'yhq',
@@ -544,6 +549,8 @@ let vm = new Vue({
                 url = "/mk/mkactivitiescombinationprice.html";
             else if(mkaTopic === 'drjbj')
                 url = "/mk/mkactivitieshalfprice.html"
+            else if(mkaTopic === 'zsjf')
+                url = "/mk/mkactivitiespresentintegral.html"
             window.location.href =  url+"?flag=false&mkCode="+vm.mkCode+"&mkaId="+mkaId+"&storeId="+storeId;
         }
 	}

+ 15 - 15
kmall-admin/src/main/webapp/userLogin.html

@@ -91,20 +91,20 @@
         beforeMount: function(){
             // TODO 调用接口获取机器码
 
-                // $.ajax({
-                //     url:"http://127.0.0.1:21600/api/reg/gen",
-                //     success:function(r){
-                //         if(r.code == "0"){
-                //             vm.machineCode = r.rows[0].data.code;
-                //             console.log(vm.machineCode);
-                //             vm.machineCode = vm.machineCode.replace("+","%2B");
-                //             sessionStorage.setItem("machineCode",vm.machineCode);
-                //         }
-                //     },
-                //     error:function(XMLHttpRequest, textStatus, errorThrown){
-                //         alert("获取机器码失败,请联系管理员");
-                //     }
-                // })
+                $.ajax({
+                    url:"http://127.0.0.1:21600/api/reg/gen",
+                    success:function(r){
+                        if(r.code == "0"){
+                            vm.machineCode = r.rows[0].data.code;
+                            console.log(vm.machineCode);
+                            vm.machineCode = vm.machineCode.replace("+","%2B");
+                            sessionStorage.setItem("machineCode",vm.machineCode);
+                        }
+                    },
+                    error:function(XMLHttpRequest, textStatus, errorThrown){
+                        alert("获取机器码失败,请联系管理员");
+                    }
+                })
                 // 本地调试的时候打开下面的注释代码
                 // vm.machineCode = "0z4kBPFEve0=";
                 // sessionStorage.setItem("machineCode","0z4kBPFEve0=");
@@ -129,7 +129,7 @@
             },
             beforeLogin:function (){
                 //登录前 用户在点击登录时再请求机器码
-                vm.machineCode = sessionStorage.getItem("machineCode");
+                // vm.machineCode = sessionStorage.getItem("machineCode");
                 console.log("登录")
                 console.log(!vm.machineCode)
                 if (!vm.machineCode){