feat: 评分任务

This commit is contained in:
wanglei
2024-06-27 09:38:47 +08:00
parent 236404c5ba
commit 53bf64712e
3 changed files with 62 additions and 21 deletions

View File

@@ -147,10 +147,8 @@ export default {
this.$refs['formRef'].validate(async valid=>{
if(valid){
try {
const {code} = await this.instance.post('/app/apptaskmanage/addOrUpdate',null,{
params:{
...form
}
const {code} = await this.instance.post('/app/apptaskmanage/addOrUpdate',{
...this.form
})
if(code===0){
this.$message.success('保存成功')
@@ -192,7 +190,9 @@ export default {
async getList(){
try {
const {code,data} = await this.instance.post('/app/apptaskmanage/list')
const {code,data} = await this.instance.post('/app/apptaskmanage/list',{
...this.search
})
if(code===0){
this.tableData = data.records
this.total = data.total

View File

@@ -13,13 +13,13 @@
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
<ai-select
v-model="search.type"
@change="(search.current = 1), getList()"
v-model="search.genre"
@change="onChange"
placeholder="请选择事件类型"
:selectList="$dict.getDict('shopScoreType')">
</ai-select>
<ai-select
v-model="search.applyItemId"
v-model="search.type"
@change="(search.current = 1), getList()"
placeholder="请选择自定义事件"
:selectList="dictList">
@@ -78,12 +78,8 @@
:selectList="$dict.getDict('shopScoreType')">
</ai-select>
</el-form-item>
<el-form-item label="自定义事件:">
<ai-select
v-model="form.status"
placeholder="请选择自定义事件"
:selectList="$dict.getDict('shopScoreEvent')">
</ai-select>
<el-form-item label="自定义事件:" prop="listType">
<el-input v-model="form.listType" :disabled="form.type === '' || form.type === null || form.type === undefined" placeholder="请输入自定义事件" size="small"></el-input>
</el-form-item>
<el-form-item label="规则:">常规</el-form-item>
<el-form-item label="分值:" prop="score">
@@ -106,6 +102,7 @@ export default {
data() {
return {
search:{
genre:'',
type:'',
status:'',
current: 1,
@@ -137,8 +134,10 @@ export default {
total: 10,
colConfigs: [
{type: "selection"},
{ prop: 'type', label: '类型', align: 'center' },
{ prop: 'areaName', label: '事件', align: 'center' },
{ prop: 'type', label: '类型', align: 'center' ,render:(h,{row})=>{
return h('span',null,this.dict.getLabel('shopScoreType',row.type))
}},
{ prop: 'listType', label: '事件', align: 'center' },
{ prop: 'rule', label: '规则', align: 'center' },
{ slot: 'score' },
{ slot: 'status'},
@@ -147,12 +146,15 @@ export default {
dialog:false,
form:{
id:null,
listType:'',
type:'',
score:''
score:'',
rule:'常规'
},
rules:{
type:[{ required: true, message: '请选择事件类型', trigger: 'change' },],
score:[{ required: true, message: '请输入分值', trigger: 'blur' },],
listType:[{ required: true, message: '请输入自定义事件', trigger: 'blur' },],
score:[{ required: true, message: '请输入分值', trigger: 'change' },],
}
}
},
@@ -165,13 +167,45 @@ export default {
},
methods: {
onChange(e){
if(e){
this.queryListTypeByType(e)
}else {
this.search.type = ''
this.dictList = []
this.search.current = 1
this.getList()
}
},
async queryListTypeByType(type){
try {
const {code,data} = await this.instance.post('/app/appscorerules/queryListTypeByType',null,{
params:{
type
}
})
if(code===0){
this.dictList = data?.map(item=>{
return {
dictName:item.listType,
dictValue:item.id
}
})
}
}catch (e) {
console.log(e)
}
},
onConfirm(){
this.$refs['formRef'].validate(async valid=>{
if(valid){
try {
const {code} = await this.instance.post('/app/appscorerules/addOrUpdate')
const {code} = await this.instance.post('/app/appscorerules/addOrUpdate',{...this.form})
if(code===0){
this.$message.success('保存成功')
this.dialog = false
this.getList()
this.getStatic()
}
@@ -247,7 +281,11 @@ export default {
async getList(){
try {
const {code,data} = await this.instance.post('/app/appscorerules/list')
const {code,data} = await this.instance.post('/app/appscorerules/list',null,{
params:{
...this.search
}
})
if(code===0){
this.tableData = data.records
this.total = data.total