1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<template>
<el-dialog :visible.sync="newIntegral.show" width="800px" center title="积分变更">
<el-form label-width="150px">
<el-form-item label="用户ID">
<el-row :gutter="20">
<el-col :span="14"><el-input v-model="newIntegral.user_id"/></el-col>
<el-col :span="6"><el-button @click="showUserList">查询</el-button></el-col>
</el-row>
</el-form-item>
<el-form-item label="积分类型">
<el-row :gutter="20">
<el-col :span="20">
<el-select v-model="newIntegral.is_add">
<el-option
v-for="(data,index) in is_addOption"
:key="index"
:label="data.value"
:value="data.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="积分值">
<el-row :gutter="20">
<el-col :span="20">
<el-input-number v-model="newIntegral.value"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="描述【用户可见】">
<el-row :gutter="20">
<el-col :span="20">
<el-input v-model="newIntegral.desc"/>
</el-col>
</el-row>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="newIntegral.show = false">取 消</el-button>
<el-button type="primary" @click="onAdd">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import {INTEGRALTYPE} from "../../util/wordbook";
export default {
name: "newIntegral",
props:['newIntegral'],
data(){
let is_addOption = [];
for(let k in INTEGRALTYPE){
is_addOption.push({id:k,value:INTEGRALTYPE[k]})
}
return {
is_addOption:is_addOption
}
},
methods:{
onAdd(){
if(!this.newIntegral.user_id || this.newIntegral.user_id === ''){
this.$message('请填写用户ID')
}else if(!this.newIntegral.is_add || this.newIntegral.is_add === ''){
this.$message('请选择积分类型')
}else if(!this.newIntegral.value || this.newIntegral.value === ''){
this.$message('请填写积分值')
}else if(!this.newIntegral.desc || this.newIntegral.desc === ''){
this.$message('请填写描述')
}else{
this.$emit('subAdd')
}
},
showUserList(){
this.$emit('showUserList')
}
}
}
</script>
<style scoped>
</style>