等级配置
This commit is contained in:
@@ -15,10 +15,26 @@
|
||||
</el-table-column>
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" @click.native="toAdd(row.id)">调整积分</el-button>
|
||||
<el-button type="text" @click.native="changeIntegral(row)">调整积分</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<ai-dialog
|
||||
title="调整积分"
|
||||
:visible.sync="dialog"
|
||||
:destroyOnClose="true"
|
||||
width="720px"
|
||||
@onConfirm="onConfirm"
|
||||
@closed="form={}">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="类型" prop="integralCalcType">
|
||||
<ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="积分" prop="integral">
|
||||
<el-input v-model.trim="form.integral" placeholder="请输入正数" size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-list>
|
||||
</section>
|
||||
@@ -43,10 +59,15 @@ export default {
|
||||
total: 0,
|
||||
},
|
||||
tableData: [],
|
||||
dialog: false,
|
||||
form: {
|
||||
integralCalcType: "",
|
||||
integral: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.$dict.load('electionStatus', 'electionMethod').then(()=> {
|
||||
this.$dict.load('integralCalcType', 'electionMethod').then(()=> {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
@@ -59,10 +80,18 @@ export default {
|
||||
{prop: "chooseNumber", label: "积分数量", align: "center", sortable: "custom"},
|
||||
{slot: "options", },
|
||||
]
|
||||
}
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
integralCalcType: [{required: true, message: '请选择类型', trigger: 'change'}],
|
||||
integral: [{required: true, message: '请输入积分', trigger: 'blur' },
|
||||
{pattern: /^([1-9]\d*|0)(\.\d{1,2})?$/, message: '请输入正数且最多只能保留两位小数'}],
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
sortChange(col) {
|
||||
console.log(col.order)
|
||||
if(col.prop === 'chooseNumber') { // 剩余积分
|
||||
// this.search.sortFiled = 0
|
||||
// if(col.order === 'ascending') {
|
||||
@@ -74,6 +103,35 @@ export default {
|
||||
// }
|
||||
}
|
||||
},
|
||||
changeIntegral(row) {
|
||||
this.dialog = true
|
||||
},
|
||||
onConfirm() {
|
||||
this.$refs.form.validate((valid)=> {
|
||||
if(valid) {
|
||||
this.flag = true
|
||||
this.instance.post(`/app/appintegraluser/changeIntegral`,{
|
||||
ids: this.form.ids,
|
||||
eventDesc: this.form.eventDesc,
|
||||
enclosure: this.form.enclosure, // 附件
|
||||
integralCalcType: this.form.integralCalcType,
|
||||
integral: this.form.integral,
|
||||
}).then(res => {
|
||||
if(res?.code == 0) {
|
||||
this.$message.success('调整积分成功')
|
||||
setTimeout(() =>{
|
||||
this.dialog = false
|
||||
this.getTableData()
|
||||
this.flag = false
|
||||
}, 600)
|
||||
} else {
|
||||
this.flag = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
getList() {
|
||||
this.instance.post(`/app/appgeneralelectioninfo/list`,null,{
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user