允许积分设置负值@陈锐
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
<el-input placeholder="请输入三类" size="small" v-model="form.classThree"></el-input>
|
<el-input placeholder="请输入三类" size="small" v-model="form.classThree"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="分值" prop="integral" style="width: 100%;" :rules="[{required: true, message: '请输入分值', trigger: 'change'}]">
|
<el-form-item label="分值" prop="integral" style="width: 100%;" :rules="[{required: true, message: '请输入分值', trigger: 'change'}]">
|
||||||
<el-input-number v-model="form.integral" :min="0"></el-input-number>
|
<el-input-number v-model="form.integral"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -41,98 +41,98 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
export default {
|
||||||
export default {
|
name: 'Add',
|
||||||
name: 'Add',
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
dict: Object,
|
dict: Object,
|
||||||
params: Object
|
params: Object
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
classOne: '',
|
classOne: '',
|
||||||
classThree: '',
|
classThree: '',
|
||||||
classTwo: '',
|
classTwo: '',
|
||||||
girdId: '',
|
girdId: '',
|
||||||
girdName: '',
|
girdName: '',
|
||||||
integral: ''
|
integral: ''
|
||||||
},
|
},
|
||||||
id: ''
|
id: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created() {
|
||||||
if (this.params && this.params.id) {
|
if (this.params && this.params.id) {
|
||||||
this.id = this.params.id
|
this.id = this.params.id
|
||||||
this.getInfo(this.params.id)
|
this.getInfo(this.params.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getInfo (id) {
|
getInfo(id) {
|
||||||
this.instance.post(`/app/appintegralpublicityinfo/queryDetailById?id=${id}`).then(res => {
|
this.instance.post(`/app/appintegralpublicityinfo/queryDetailById?id=${id}`).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.form = {
|
this.form = {
|
||||||
...res.data,
|
...res.data,
|
||||||
girdId: [res.data.girdId]
|
girdId: [res.data.girdId]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
|
||||||
this.$refs.form.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.isFlag = true
|
|
||||||
this.instance.post(`/app/appintegralpublicityinfo/addOrUpdate`, {
|
|
||||||
...this.form,
|
|
||||||
girdId: this.form.girdId[0]
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success('提交成功')
|
|
||||||
setTimeout(() => {
|
|
||||||
this.cancel(true)
|
|
||||||
}, 600)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
cancel (isRefresh) {
|
|
||||||
this.$emit('change', {
|
|
||||||
type: 'List',
|
|
||||||
isRefresh: !!isRefresh
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
onUserChange (e) {
|
|
||||||
if (e.length) {
|
|
||||||
this.form.girdName = e[0].girdName
|
|
||||||
} else {
|
|
||||||
this.form.girdId = []
|
|
||||||
this.form.girdName = ''
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
confirm() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.isFlag = true
|
||||||
|
this.instance.post(`/app/appintegralpublicityinfo/addOrUpdate`, {
|
||||||
|
...this.form,
|
||||||
|
girdId: this.form.girdId[0]
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('提交成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.cancel(true)
|
||||||
|
}, 600)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel(isRefresh) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'List',
|
||||||
|
isRefresh: !!isRefresh
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onUserChange(e) {
|
||||||
|
if (e.length) {
|
||||||
|
this.form.girdName = e[0].girdName
|
||||||
|
} else {
|
||||||
|
this.form.girdId = []
|
||||||
|
this.form.girdName = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.time-select {
|
.time-select {
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
line-height: 36px;
|
||||||
|
border: 1px solid #d0d4dc;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.el-icon-arrow-down {
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
border: 1px solid #d0d4dc;
|
|
||||||
border-radius: 4px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
cursor: pointer;
|
|
||||||
.el-icon-arrow-down {
|
|
||||||
line-height: 36px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user