积分规则

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>
</template>
</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 }">
<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-else>启用</el-button>
<el-button type="text" @click="set(row)" v-if="row.type == 11 || row.type == 12 || row.type == 13 ">配置</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</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> -->
</section>
</template>
@@ -78,6 +104,11 @@ export default {
{slot: "options", label: "操作", align: "center", width: 100},
],
tableData: [],
dialog: false,
setInfo: {},
isSetEdit: false,
chooseUserList: [],
personList: []
};
},
created() {
@@ -87,14 +118,12 @@ export default {
},
methods: {
getList() {
this.instance
.post(`/app/appscorerule/list`, null, {
this.instance.post(`/app/appscorerule/list`, null, {
params: {
...this.search,
...this.page,
},
})
.then((res) => {
}).then((res) => {
if (res?.data) {
this.tableData = res.data.records;
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>