积分规则
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="{row,$index}">
|
||||
<template slot-scope="{ $index }">
|
||||
<el-button type="text" @click="handleDelete($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -145,8 +145,8 @@ export default {
|
||||
search: {status: "", eventType: null},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
colConfigs: [
|
||||
{prop: "event", label: "事件", dict: "integralRuleEvent"},
|
||||
{prop: "type", label: "类型", dict: "integralRuleEventType"},
|
||||
{prop: "event", label: "事件", dict: "partyIntegralRuleEvent"},
|
||||
{prop: "type", label: "类型", dict: "integralRuleEvent4"},
|
||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
||||
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
||||
|
||||
@@ -16,25 +16,6 @@
|
||||
<b class="color-26f" v-text="detail.integral||0"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
<!-- <ai-card hideTitle class="staCard fill">
|
||||
<template #content>
|
||||
<div class="color-999" v-text="`学习强国`"/>
|
||||
<el-button type="text" @click="handleEditLearningIntergral(detail.id)">编辑</el-button>
|
||||
<b class="color-26f" v-text="detail.learningIntegral||0"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card hideTitle class="staCard fill">
|
||||
<template slot="content">
|
||||
<div class="color-999" v-text="`个人积分`"/>
|
||||
<b class="color-26f" v-text="detail.integral||0"/>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card hideTitle class="staCard fill">
|
||||
<template #content>
|
||||
<div class="color-999" v-text="`家庭积分`"/>
|
||||
<b class="color-26f" v-text="detail.familySurplusIntegral||0"/>
|
||||
</template>
|
||||
</ai-card> -->
|
||||
</el-row>
|
||||
<ai-card title="余额变动明细">
|
||||
<template #content>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<ai-list>
|
||||
<ai-list class="AppScoreRules">
|
||||
<template slot="title">
|
||||
<ai-title title="积分维护" :isShowBottomBorder="false" :instance="instance" :isShowArea="false" v-model="areaId"
|
||||
<ai-title title="积分规则" :isShowBottomBorder="false" :instance="instance" :isShowArea="false" v-model="areaId"
|
||||
@change="changeArea"></ai-title>
|
||||
</template>
|
||||
<template slot="tabs">
|
||||
@@ -21,7 +21,7 @@ import automaticallyAddCent from "./components/automaticallyAddCent.vue";
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppScoreManage',
|
||||
name: 'AppScoreRules',
|
||||
label: "积分规则(三涧溪)",
|
||||
components: { applyForIntegral, automaticallyAddCent},
|
||||
props: {
|
||||
@@ -71,4 +71,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AppScoreRules {}
|
||||
</style>
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
</ai-select>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input size="small" placeholder="事件名称" v-model="search.partyName" clearable
|
||||
@change="page.current=1,getTableData()" suffix-icon="iconfont iconSearch"/>
|
||||
<el-input size="small" placeholder="事件名称" v-model="search.eventName" clearable
|
||||
@change="page.current=1, getList()" suffix-icon="iconfont iconSearch"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<el-row type="flex" justify="space-between">
|
||||
<div></div>
|
||||
<el-button v-if="form.ruleType==1" type="text" icon="iconfont iconAdd"
|
||||
@click="form.ladderIntegral.push({ viewCount: null, integral: null })">添加
|
||||
@click="addIntegral">添加
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-table v-if="form.ruleType==1" :data="form.ladderIntegral" size="mini" border stripe>
|
||||
@@ -120,9 +120,6 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ai-dialog>
|
||||
</section>
|
||||
</template>
|
||||
@@ -162,13 +159,15 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {status: "", eventType: null},
|
||||
search: {status: "", eventName: ""},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
colConfigs: [
|
||||
{prop: "event", label: "事件名称", dict: "integralRuleEvent"},
|
||||
{prop: "type", label: "简介", dict: "integralRuleEventType"},
|
||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
||||
// {prop: "event", label: "事件", dict: "integralRuleEvent", align: "center"},
|
||||
// {prop: "type", label: "类型", dict: "integralRuleEventType", align: "center"},
|
||||
{prop: "eventName", label: "事件名称", dict: "integralRuleEvent", align: "center"},
|
||||
{prop: "eventDesc", label: "简介", dict: "integralRuleEventType", align: "center"},
|
||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType", align: "center"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle", align: "center"},
|
||||
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
@@ -180,6 +179,7 @@ export default {
|
||||
tableData: [],
|
||||
dialog: false,
|
||||
form: {
|
||||
classify: 0,
|
||||
eventName: '',
|
||||
eventDesc: '',
|
||||
ruleType: 0,
|
||||
@@ -218,7 +218,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
|
||||
this.instance.post(`/app/apppartyintegralrule/list?classify=0`, null, {
|
||||
params: {...this.search, ...this.page},
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
@@ -227,32 +227,29 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
toEdit(row) {
|
||||
this.form = this.$copy(row)
|
||||
let {ladderRule, event, type} = this.form,
|
||||
dict = 'integralRuleEvent' + event
|
||||
this.dict.load(dict).then(() => {
|
||||
this.form.eventType = [event, type]
|
||||
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||
if (e.dictValue == event) {
|
||||
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||
}
|
||||
return e
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.dialog = true
|
||||
})
|
||||
})
|
||||
addIntegral() {
|
||||
this.form.ladderIntegral.push({ viewCount: null, integral: null })
|
||||
},
|
||||
// 保存
|
||||
save() {
|
||||
this.$refs.innerForm.validate((valid)=>{
|
||||
if (valid) {
|
||||
this.innerData.push(this.table)
|
||||
}
|
||||
this.innerVisible = false
|
||||
})
|
||||
toEdit(row) {
|
||||
console.log(row);
|
||||
this.form = { ...row }
|
||||
this.form.ruleType = row.ruleType
|
||||
this.dialog = true
|
||||
// let {ladderRule, event, type} = this.form,
|
||||
// dict = 'integralRuleEvent' + event
|
||||
// this.dict.load(dict).then(() => {
|
||||
// this.form.eventType = [event, type]
|
||||
// this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||
// this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||
// if (e.dictValue == event) {
|
||||
// e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||
// }
|
||||
// return e
|
||||
// })
|
||||
// this.$nextTick(() => {
|
||||
// this.dialog = true
|
||||
// })
|
||||
// })
|
||||
},
|
||||
|
||||
close() {
|
||||
@@ -292,7 +289,7 @@ export default {
|
||||
type: 'error'
|
||||
}).then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/delete?ids=${id}`)
|
||||
.post(`/app/apppartyintegralrule/delete?ids=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
@@ -319,7 +316,7 @@ export default {
|
||||
this.search.ruleStatus = ""
|
||||
this.getList();
|
||||
},
|
||||
onConfirm() {
|
||||
onConfirm(id) {
|
||||
this.$refs.DialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.integralMin = this.form.integralArr[0]
|
||||
@@ -328,11 +325,12 @@ export default {
|
||||
|
||||
this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: id || ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
||||
this.onReset()
|
||||
this.dialog = false;
|
||||
this.getList()
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<template>
|
||||
<div class="">
|
||||
<template>
|
||||
<ai-search-bar style="margin-top: 16px;">
|
||||
<div class="automaticallyAddCent">
|
||||
<ai-list>
|
||||
<template #content>
|
||||
<ai-search-bar bottomBorder style="margin-top: 16px">
|
||||
<template #left>
|
||||
<el-cascader size="small" v-model="search.eventType" placeholder="请选择事件/类型" clearable
|
||||
:props="{...etOps,checkStrictly:true}" @change="handleTypeSearch" ref="eventTypeSearch"/>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="page.current = 1, getList()"
|
||||
placeholder="请选择状态"
|
||||
:selectList="dict.getDict('integralRuleStatus')">
|
||||
</ai-select>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
|
||||
</template>
|
||||
<template #content>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
@@ -29,21 +40,46 @@
|
||||
停用
|
||||
</el-button>
|
||||
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 1)" v-else>启用</el-button>
|
||||
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row)">编辑</el-button>
|
||||
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row.id)">编辑</el-button>
|
||||
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_del')" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
</template>
|
||||
</ai-list>
|
||||
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="close" width="800px">
|
||||
<div class="form_div">
|
||||
<el-form ref="DialogForm" :model="form" :rules="formRules" size="small" label-suffix=":" label-width="100px">
|
||||
|
||||
<el-form-item label="事件/类型" prop="eventType" width="100%">
|
||||
<el-cascader v-model="form.eventType" :props="etOps" clearable placeholder="请选择" @change="handleTypeForm"
|
||||
:options="cacheOps" style="width: 100%"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="规则">
|
||||
<span>常规</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="周期范围" prop="scoringCycle">
|
||||
<ai-select v-model="form.scoringCycle" :selectList="dict.getDict('integralRuleScoringCycle')"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="奖励次数">
|
||||
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/>
|
||||
</el-form-item>
|
||||
<!-- 常规 -->
|
||||
<el-form-item label="积分分值" prop="integral" v-if="form.ruleType == 0">
|
||||
<el-input placeholder="请输入" v-model="form.integral" clearable/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "applyForIntegral",
|
||||
name: "automaticallyAddCent",
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
@@ -51,49 +87,145 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: { status: ""},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
tableData: [],
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
colConfigs: [
|
||||
{prop: "event", label: "事件名称", dict: "integralRuleEvent"},
|
||||
{prop: "type", label: "简介", dict: "integralRuleEventType"},
|
||||
{prop: "event", label: "事件", dict: "integralRuleEvent", align: "center"},
|
||||
{prop: "type", label: "类型", dict: "integralRuleEventType", align: "center"},
|
||||
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
|
||||
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle", align: "center"},
|
||||
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
|
||||
{slot: "options", label: "操作", align: "center"},
|
||||
],
|
||||
formRules: {
|
||||
eventType: [{required: true, message: "请选择事件类型" }],
|
||||
scoringCycle: [{required: true, message: "请选择周期范围" }],
|
||||
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
|
||||
numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}],
|
||||
},
|
||||
form: {
|
||||
classify: 1,
|
||||
eventType: '',
|
||||
event: '',
|
||||
type: '',
|
||||
ruleType: 0,
|
||||
scoringCycle: '',
|
||||
integral: '', // 常规
|
||||
integralArr: [],
|
||||
},
|
||||
dialog: false,
|
||||
cacheOps: [],
|
||||
isEdit: false,
|
||||
flag: false,
|
||||
}
|
||||
},
|
||||
create() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
|
||||
},
|
||||
toEdit(row) {
|
||||
this.form = this.$copy(row)
|
||||
let {ladderRule, event, type} = this.form,
|
||||
dict = 'integralRuleEvent' + event
|
||||
this.dict.load(dict).then(() => {
|
||||
this.form.eventType = [event, type]
|
||||
this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||
created() {
|
||||
this.dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType','partyIntegralRuleEvent','integralRuleEvent4').then(() => {
|
||||
this.getList();
|
||||
this.cacheOps = this.$dict.getDict('partyIntegralRuleEvent').map(e => {
|
||||
if (e.dictValue == event) {
|
||||
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||
}
|
||||
return e
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.dialog = true
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
dialogTitle() {
|
||||
return this.isEdit ? "编辑积分规则" : "添加积分规则"
|
||||
},
|
||||
etOps() {
|
||||
return {
|
||||
lazy: true,
|
||||
value: "dictValue",
|
||||
label: "dictName",
|
||||
lazyLoad: (node, resolve) => {
|
||||
if (node.level == 0) resolve(this.dict.getDict('partyIntegralRuleEvent'))
|
||||
else if (node.level == 1) {
|
||||
let dict = 'integralRuleEvent4' + node.value
|
||||
this.dict.load(dict).then(() => {
|
||||
let nodes = this.dict.getDict(dict).map(e => ({...e, leaf: true}))
|
||||
resolve(nodes)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/apppartyintegralrule/list?classify=1`, null, {
|
||||
params: {...this.search, ...this.page},
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.tableData = res.data.records;
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleTypeSearch(v) {
|
||||
this.search.event = v?.[0]
|
||||
this.search.type = v?.[1]
|
||||
this.page.current = 1
|
||||
this.$refs.eventTypeSearch.dropDownVisible = false
|
||||
this.getList()
|
||||
},
|
||||
handleTypeForm(v) {
|
||||
if (this.dialog) {
|
||||
this.form.event = v?.[0]
|
||||
this.form.type = v?.[1]
|
||||
this.form.ruleType = !this.form.event ? null : this.form.event == 3 ? 1 : 0
|
||||
}
|
||||
},
|
||||
close() {
|
||||
|
||||
},
|
||||
onConfirm(id) {
|
||||
this.$refs.DialogForm.validate((valid) => {
|
||||
this.flag = true
|
||||
if (valid) {
|
||||
this.instance.post(`/app/apppartyintegralrule/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: id || ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
|
||||
this.dialog = false;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.flag = false;
|
||||
})
|
||||
} else {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
toEdit(row) {
|
||||
// this.form = this.$copy(row)
|
||||
// let {ladderRule, event, type} = this.form,
|
||||
// dict = 'integralRuleEvent' + event
|
||||
// this.dict.load(dict).then(() => {
|
||||
// this.form.eventType = [event, type]
|
||||
// this.form.ladderRule = JSON.parse(ladderRule || "[]")
|
||||
// this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
|
||||
// if (e.dictValue == event) {
|
||||
// e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
|
||||
// }
|
||||
// return e
|
||||
// })
|
||||
// this.$nextTick(() => {
|
||||
// this.dialog = true
|
||||
// })
|
||||
// })
|
||||
},
|
||||
remove(id) {
|
||||
this.$confirm("删除后不可恢复,是否要删除该事项?", {
|
||||
type: 'error'
|
||||
}).then(() => {
|
||||
this.instance
|
||||
.post(`/app/appvillagerintegralrule/delete?ids=${id}`)
|
||||
.post(`/app/apppartyintegralrule/delete?ids=${id}`)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
@@ -118,5 +250,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
.automaticallyAddCent {}
|
||||
</style>
|
||||
Reference in New Issue
Block a user