935090232@qq.com
2021-06-03 10f78f85875f539590a757f7c17992c6c0ae0773
业绩规则2
1 files deleted
2 files modified
349 ■■■■ changed files
zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java 13 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html 86 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/hive/products/achieverule-list.html 250 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hiveErp/action/AchieveRuleAction.java
@@ -15,7 +15,6 @@
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.AchieveRule;
import com.matrix.system.hive.dao.AchieveRuleDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hiveErp.pojo.AchieveRuleItem;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
@@ -46,11 +45,8 @@
    @PostMapping("/add")
    public AjaxResult add(@RequestBody @Validated AchieveRule achieveRule) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
        if(CollectionUtils.isEmpty(achieveRule.getRuleItemList())){
            return AjaxResult.buildFailInstance("规则设置不能为空");
        }
        String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList());
        achieveRule.setRules(rules);
@@ -72,14 +68,11 @@
     */
    @PostMapping("/update")
    public AjaxResult update(@RequestBody @Validated AchieveRule achieveRule) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
        if (achieveRule.getId() == null) {
            return AjaxResult.buildFailInstance("id不能为空");
        }
        if(CollectionUtils.isEmpty(achieveRule.getRuleItemList())){
            return AjaxResult.buildFailInstance("规则设置不能为空");
        }
        String rules = JSONUtil.toJsonStr(achieveRule.getRuleItemList());
        achieveRule.setRules(rules);
@@ -111,7 +104,7 @@
     */
    @PostMapping("/selectList")
    public AjaxResult selectList(@RequestBody BasePageQueryDto pageDto) {
        WebUtil.setSessionAttribute(MatrixConstance.LOGIN_KEY,sysUsersDao.selectById(2L));
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        Page<AchieveRule> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize());
        LambdaQueryWrapper<AchieveRule> lambdaQueryWrapper = new LambdaQueryWrapper<AchieveRule>()
zq-erp/src/main/resources/templates/views/admin/hive-erp/products/achieverule-list.html
@@ -18,17 +18,20 @@
        .panel-body{
            overflow: hidden;
        }
        .buttonPanel{
            background: #ffffff;
            padding: 10px 10px ;
            margin: 0px 0px 10px 0px;
        }
        .rowPanel{
            background: #ffffff;
            padding: 0px 10px ;
            padding-top: 10px;
            margin: 0px 0px 10px 0px;
        }
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
@@ -41,7 +44,7 @@
<div class="panel-body" id="app">
    <el-row class="buttonPanel">
            <el-button @click="dialogVisible = true" type="primary" >新增</el-button>
        <el-button @click="openAdd" type="primary">新增</el-button>
    </el-row>
    <el-row class="rowPanel"  >
@@ -88,6 +91,7 @@
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button type="text" @click="openModify(scope.$index, scope.row)" size="small">修改</el-button>
                    <el-button type="text" @click="remove(scope.$index, scope.row)" size="small">删除</el-button>
                </template>
            </el-table-column>
@@ -106,9 +110,9 @@
    </el-row>
    <el-dialog
            title="提示"
            title="title"
            :visible.sync="dialogVisible"
            width="30%"
            width="60%"
            :before-close="handleClose">
        <span>这是一段信息</span>
        <span slot="footer" class="dialog-footer">
@@ -139,19 +143,41 @@
                currentPage:1,
            },
            form:{
                name:null,
                datetimeArr:'',
                payMethod:'',
                flowType:'',
                orderNo:'',
                oprationMan:'',
                queryKey:'',
                order:'',
                sort:''
                queryKey: null,
            },
            height:'calc(100vh - 240px)',
            dialogVisible:false,
            title: '',
            formData: {
                name: '',
                ruleItemList: [this.defaultRuleItem]
            },
            defaultRuleItem: {
                achieveType: 1,
                calculationType: 1,
                Lower: '',
                upper: '',
                achieve: '',
            },
            type: '',
            achieveTypeList: [{
                label: '本金消耗',
                value: 1
            }
                , {
                    label: '赠送消耗',
                    value: 2
                }],
            calculationTypeList: [
                {
                label: '固定值',
                value: 1
                }
                , {
                    label: '百分比',
                    value: 2
                }]
        },
        created: function () {
           this.loadData();
@@ -198,7 +224,7 @@
            getRequestParam(){
                let _this = this;
                return   {
                    name:_this.form.name,
                    queryKey: _this.form.queryKey,
                }
            },
            search:function(){
@@ -211,7 +237,7 @@
                }
            },
            del(index,row){
            remove(index, row) {
                let _this=this;
                this.$confirm('确认删除该规则吗?', '提示', {
                    confirmButtonText: '确定',
@@ -220,12 +246,14 @@
                }).then(() => {
                    AjaxProxy.requst({
                        app: _this,
                        type: 'GET',
                        url: basePath + "/admin/achieveRule/removeById/"+row.id,
                        callback: function (data) {
                            _this.$message({
                                type: 'success',
                                message: '删除成功!'
                                message: data.info,
                            });
                            debugger
                            _this.loadData();
                        }
                    });
@@ -236,12 +264,32 @@
                    });
                });
            },
            //导出
          add(){
            //开启表单弹窗
            openForm(type, data) {
                if (type == 'add') {
                    this.title = '新增规则';
                    this.$refs['formName'].resetFields();
                } else {
                    this.title = '修改规则';
                    this.formData = data;
                }
                this.type = type;
                this.dialogVisible = true;
            },
            //提交表单
            submit() {
                let url = basePath + "/admin/achieveRule/add";
                if (this.type == 'modify') {
                    url = basePath + "/admin/achieveRule/update";
                }
            },
            }
        }
    });
zq-erp/src/main/resources/templates/views/admin/hive/products/achieverule-list.html
File was deleted