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

@@ -17,6 +17,7 @@
v-model="search.storeLevel" v-model="search.storeLevel"
@change="(search.current = 1), getList()" @change="(search.current = 1), getList()"
placeholder="门店等级" placeholder="门店等级"
multiple
:selectList="$dict.getDict('storeLevel')"> :selectList="$dict.getDict('storeLevel')">
</ai-select> </ai-select>
<ai-search label="录入时间"> <ai-search label="录入时间">
@@ -167,6 +168,7 @@ export default {
size: 10, size: 10,
girdCode:'', girdCode:'',
girdName:'', girdName:'',
storeLevel:[],
girdInfoList:[] girdInfoList:[]
}, },
ids: [], ids: [],
@@ -295,7 +297,8 @@ export default {
getList() { getList() {
this.instance.post(`/app/appshoparchives/list`, null, { this.instance.post(`/app/appshoparchives/list`, null, {
params: { params: {
...this.search ...this.search,
storeLevel:this.search.storeLevel.join(',')
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {

View File

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

View File

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