ソースを参照

客户等级调整

jk-GitHub-coder 4 年 前
コミット
942649eccd

+ 12 - 9
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/controller/CustomerGradeSettingController.java

@@ -43,38 +43,41 @@ public class CustomerGradeSettingController extends BaseController
 
     /*
      * 新增成长规则
+     * @param jsonObject
      */
     @RequestMapping("/addGrouthRule")
+    @Log(title = "客户等级成长规则新增", businessType = BusinessType.INSERT)
     public AjaxResult addGrouthRule(@RequestBody  JSONObject jsonObject){
         Map<String, Object> params = new HashMap();
         params.put("grouthValueName", jsonObject.get("grouthValueName"));
         params.put("grouthValueConsume", jsonObject.get("grouthValueConsume"));
         params.put("grouthValue", jsonObject.get("grouthValue"));
-        int i = customerGradeSettingService.insertGrouthRule(params);
-        return toAjax(i);
+        return toAjax(customerGradeSettingService.insertGrouthRule(params));
     }
 
     /*
-     * 新增成长规则
+     * 编辑成长规则
+     * @param jsonObject
      */
     @RequestMapping("/editGrouthRule")
+    @Log(title = "客户等级成长编辑", businessType = BusinessType.UPDATE)
     public AjaxResult editGrouthRule(@RequestBody  JSONObject jsonObject){
         Map<String, Object> params = new HashMap();
         params.put("id", jsonObject.get("id"));
         params.put("grouthValueName", jsonObject.get("grouthValueName"));
         params.put("grouthValueConsume", jsonObject.get("grouthValueConsume"));
         params.put("grouthValue", jsonObject.get("grouthValue"));
-        int i = customerGradeSettingService.updateGrouthRule(params);
-        return toAjax(i);
+        return toAjax(customerGradeSettingService.updateGrouthRule(params));
     }
 
     /*
      * 删除成长规则
+     * @param id
      */
-    @RequestMapping("/delGrouthRule")
-    public AjaxResult delGrouthRule(@PathVariable Long[] ids){
-        int i = customerGradeSettingService.deleteGrouthRuleByIds(ids);
-        return toAjax(i);
+    @Log(title = "客户等级成长规则删除", businessType = BusinessType.DELETE)
+    @RequestMapping(value = "/delGrouthRule",method = RequestMethod.DELETE)
+    public AjaxResult delGrouthRule(Long[] id){
+        return toAjax(customerGradeSettingService.deleteGrouthRuleByIds(id));
     }
 
 

+ 1 - 1
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/mapper/CustomerGradeSettingMapper.java

@@ -35,7 +35,7 @@ public interface CustomerGradeSettingMapper
      * 根据ID删除成长规则
      * @return
      */
-    public int deleteGrouthRuleById(long id);
+    public int deleteGrouthRuleById(String id);
 
     /*
      * 批量删除成长规则

+ 1 - 1
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/service/ICustomerGradeSettingService.java

@@ -36,7 +36,7 @@ public interface ICustomerGradeSettingService
      * 根据ID删除成长规则
      * @return
      */
-    public int deleteGrouthRuleById(Long id);
+    public int deleteGrouthRuleById(String id);
 
     /*
      * 批量删除成长规则

+ 1 - 1
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/service/impl/CustomerGradeSettingServiceImpl.java

@@ -53,7 +53,7 @@ public class CustomerGradeSettingServiceImpl implements ICustomerGradeSettingSer
      * @return
      */
     @Override
-    public int deleteGrouthRuleById(Long id) {
+    public int deleteGrouthRuleById(String id) {
         return customerGradeSettingMapper.deleteGrouthRuleById(id);
     }
 

+ 1 - 1
Yijia-SaaS/yijia-customer/src/main/resources/mapper/customer/CustomerGradeSettingMapper.xml

@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <!--删除一条成长规则-->
-    <delete id="deleteGrouthRuleById" parameterType="Long">
+    <delete id="deleteGrouthRuleById" parameterType="String">
         DELETE
         FROM
             customer_grouth_rule

+ 2 - 2
Yijia-SaaS/yijia-ui/src/api/customer/setting.js

@@ -28,8 +28,8 @@ export function editGrouthRule(data) {
 //删除成长规则
 export function delGrouthRule(id) {
   return request({
-    url: '/customer/setting/delGrouthRule' + id,
-    method: 'post',
+    url: '/customer/setting/delGrouthRule?id=' + id,
+    method: 'delete'
   })
 }
 

+ 9 - 6
Yijia-SaaS/yijia-ui/src/views/customer/setting/index.vue

@@ -89,10 +89,10 @@
           <el-input v-model="formGrouthRule.grouthValueName" placeholder="请输入成长规则名称" />
         </el-form-item>
         <el-form-item label="消费值" prop="grouthValueConsume">
-          <el-input v-model="formGrouthRule.grouthValueConsume" placeholder="请输入消费值" />
+          <el-input v-model="formGrouthRule.grouthValueConsume" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入消费值" />
         </el-form-item>
         <el-form-item label="成长值" prop="grouthValue">
-          <el-input v-model="formGrouthRule.grouthValue" placeholder="请输入成长值" />
+          <el-input v-model="formGrouthRule.grouthValue" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入成长值" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -141,7 +141,7 @@
 <!--    </el-form>-->
 
     <!--动态等级-->
-    <p style="margin-left: 5px; margin-top: 25px;"><span class="textlineHeader">动态等级</span>
+    <p style="margin-left: 5px; margin-top: 25px; margin-bottom: 5px;"><span class="textlineHeader">动态等级</span>
       <el-button class="settingButton" icon="el-icon-plus" size="mini" @click="handleAddDT" v-hasPermi="['customer:setting:add']" >添加动态等级</el-button>
     </p>
     <div class="cutLine"></div>
@@ -376,7 +376,7 @@ export default {
     //查询成长规则列表
     getRuleList() {
       this.loading = true;
-      getGrouthRuleList(this.selectParams).then(response => {
+      getGrouthRuleList().then(response => {
         this.grouthRuleList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -385,9 +385,11 @@ export default {
 
     //打开新增成长规则窗口
     handleAddGrouthRules(){
-      this.reset();
+      //this.reset();
+      this.formGrouthRule = {};
       this.openGrouthRule = true;
       this.title = "添加成长规则";
+
     },
     //打开修改成长规则窗口
     grouthRuleUpdate(row){
@@ -434,7 +436,7 @@ export default {
     grouthRuleDelete(row){
       const ids = row.id || this.ids
         if(row.id !=null || this.ids != null){
-          this.$confirm('是否确认删除该成长规则的数据项?', "警告",{
+          this.$confirm('是否删除该成长规则的数据项?', "警告",{
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
@@ -442,6 +444,7 @@ export default {
             delGrouthRule(ids);
           }).then(() =>{
               this.msgSuccess("删除成功");
+              this.getRuleList();
           })
         }
     },