积分规则

This commit is contained in:
liuye
2023-01-04 11:12:50 +08:00
parent 377c48d4a0
commit 4ff8f5c9e1
3 changed files with 78 additions and 15 deletions

View File

@@ -22,17 +22,43 @@
<span>{{ row.integral > 0 ? "+" : "" }}{{ row.integral }}</span> <span>{{ row.integral > 0 ? "+" : "" }}{{ row.integral }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column slot="options" label="操作" align="center" fixed="right" width="100"> <el-table-column slot="options" label="操作" align="center" fixed="right" width="160">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="table-options"> <div class="table-options">
<el-button type="text" @click="changeStatus(row.id, row.status)" v-if="row.status == 1">停用</el-button> <el-button type="text" @click="changeStatus(row.id, row.status)" v-if="row.status == 1">停用</el-button>
<el-button type="text" @click="changeStatus(row.id, row.status)" v-else>启用</el-button> <el-button type="text" @click="changeStatus(row.id, row.status)" v-else>启用</el-button>
<el-button type="text" @click="set(row)" v-if="row.type == 11 || row.type == 12 || row.type == 13 ">配置</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</ai-table> </ai-table>
</template> </template>
</ai-list> </ai-list>
<ai-dialog title="配置成员" :visible.sync="dialog" :destroyOnClose="true" customFooter width="720px">
<ai-wrapper label-width="120px" v-if="!isSetEdit">
<ai-info-item label="成员" isLine>
<span v-for="(item, index) in chooseUserList" :key="index">
<span>{{item.name}}</span>
<span v-if="index < chooseUserList.length-1">,</span>
</span>
</ai-info-item>
</ai-wrapper>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-else>
<el-form-item label="选择人员" prop="ids">
<ai-person-select :instance="instance" :customClicker="true" :chooseUserList="chooseUserList"
url="/app/wxcp/wxuser/list" headerTitle="人员列表"
:isMultiple="true" dialogTitle="选择" @selectPerson="selectPerson" class="aipersonselect">
<template name="option" v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.name }}</span>
</template>
</ai-person-select>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="isSetEdit=true" v-if="!isSetEdit">编辑</el-button>
<el-button type="primary" @click="setConfirm" v-else>保存</el-button>
</template>
</ai-dialog>
<!-- <ai-empty v-else>暂无应用权限</ai-empty> --> <!-- <ai-empty v-else>暂无应用权限</ai-empty> -->
</section> </section>
</template> </template>
@@ -78,6 +104,11 @@ export default {
{slot: "options", label: "操作", align: "center", width: 100}, {slot: "options", label: "操作", align: "center", width: 100},
], ],
tableData: [], tableData: [],
dialog: false,
setInfo: {},
isSetEdit: false,
chooseUserList: [],
personList: []
}; };
}, },
created() { created() {
@@ -87,14 +118,12 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
this.instance this.instance.post(`/app/appscorerule/list`, null, {
.post(`/app/appscorerule/list`, null, {
params: { params: {
...this.search, ...this.search,
...this.page, ...this.page,
}, },
}) }).then((res) => {
.then((res) => {
if (res?.data) { if (res?.data) {
this.tableData = res.data.records; this.tableData = res.data.records;
this.page.total = res.data.total; this.page.total = res.data.total;
@@ -112,6 +141,42 @@ export default {
}); });
}); });
}, },
set(row) {
this.chooseUserList = []
this.instance.post(`/app/appscorerule/queryDetailById?id=${row.id}`).then((res) => {
if (res?.data) {
if(res.data.massSendingConfigs && res.data.massSendingConfigs.length) {
this.chooseUserList = res.data.massSendingConfigs
}
}
});
this.dialog = true
this.setInfo = {...row}
},
selectPerson(val) {
console.log(val)
if (val) {
this.personList = val
} else {
this.personList = this.chooseUserList
}
},
setConfirm() {
if(!this.personList.length) {
return this.$message.error("请选择成员!")
}
var params = {
id: this.setInfo.id,
massSendingConfigs: this.personList,
}
this.instance.post(`/app/appscorerule/editMassSendingConfig`, params).then((res) => {
if (res.code == 0) {
this.dialog = false
this.$message.success(`配置成功!`);
this.getList();
}
});
}
}, },
}; };
</script> </script>

View File

@@ -111,9 +111,9 @@ export default {
methods: { methods: {
// 详情 // 详情
getDetail() { getDetail() {
this.instance.post(`/app/appscoredetail/queryDetailById`, null, { this.instance.post(`/app/appscoredetail/userInfo`, null, {
params: { params: {
id: this.params.id sysUserId: this.params.id
} }
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
@@ -128,10 +128,9 @@ export default {
getEventSummary() { getEventSummary() {
this.instance.post(`/app/appscoredetail/detailTypeStatistics`, null, { this.instance.post(`/app/appscoredetail/detailTypeStatistics`, null, {
params: { params: {
id: this.params.id,
startTime: this.startTime, startTime: this.startTime,
endTime: this.endTime, endTime: this.endTime,
sysUserId: this.data.sysUserId sysUserId: this.data.id
} }
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
@@ -148,8 +147,7 @@ export default {
params: { params: {
...this.search, //积分类型 ...this.search, //积分类型
total: this.total, total: this.total,
id: this.params.id, sysUserId: this.data.id
sysUserId: this.data.sysUserId
} }
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {

View File

@@ -125,9 +125,9 @@ export default {
return [ return [
{ prop: "name", label: '姓名', align: "left"}, { prop: "name", label: '姓名', align: "left"},
{ prop: "departName", label: '所属部门' }, { prop: "departName", label: '所属部门' },
{ prop: "nowScore", label: '积分余额', align: "center" }, { prop: "score", label: '积分余额', align: "center" },
// { prop: "totalIntegral", label: '累计积分', align: "center", sortable: "custom" }, // { prop: "totalIntegral", label: '累计积分', align: "center", sortable: "custom" },
{ prop: "usedIntegral", label: '已用积分', align: "center" }, { prop: "usedScore", label: '已用积分', align: "center" },
{ slot: "options" }, { slot: "options" },
] ]
}, },
@@ -143,7 +143,7 @@ export default {
}, },
methods: { methods: {
getTableData() { getTableData() {
this.instance.post(`/app/appscoredetail/list`,null,{ this.instance.post(`/app/appscoredetail/userList`,null,{
params: { params: {
...this.search, ...this.search,
current: this.current, current: this.current,
@@ -172,7 +172,7 @@ export default {
this.dialog = true this.dialog = true
} else if(type ==1) { } else if(type ==1) {
this.chooseUserList = [{ this.chooseUserList = [{
sysUserId: row.sysUserId, sysUserId: row.id,
name: row.name name: row.name
}] }]
this.form.ids = this.chooseUserList.map(e => e.sysUserId) this.form.ids = this.chooseUserList.map(e => e.sysUserId)