Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-12-28 09:35:53 +08:00
2 changed files with 22 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
<template> <template>
<div class="addPoints"> <div class="addPoints">
<div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">事件类型</span></div>
<AiSelect dict="integralApplyEventType" v-model="form.eventType"/>
</div>
<div class="item"> <div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">申请事项</span></div> <div class="item_left"><span class="red">*</span><span class="color-666">申请事项</span></div>
<div class="input"><u-input v-model="form.applyItem" type="text" placeholder="请输入" /></div> <div class="input"><u-input v-model="form.applyItem" type="text" placeholder="请输入" /></div>
@@ -7,7 +11,7 @@
<div class="item"> <div class="item">
<div class="item_left"><span class="red">*</span><span class="color-666">积分数量</span></div> <div class="item_left"><span class="red">*</span><span class="color-666">积分数量</span></div>
<div class="input"><u-input v-model="form.applyIntegral" type="number" placeholder="请输入"/></div> <div class="input"><u-input v-model="form.applyIntegral" type="number" disabled placeholder="请输入"/></div>
</div> </div>
<div class="items"> <div class="items">
@@ -28,6 +32,7 @@ export default {
return { return {
value: '', value: '',
form: { form: {
eventType: '',
applyItem: '', applyItem: '',
applyIntegral: '', applyIntegral: '',
voucherImageUrl: '', voucherImageUrl: '',
@@ -37,10 +42,20 @@ export default {
} }
}, },
onLoad(opt) { onLoad(opt) {
document.title = '积分申请'
if(opt) { if(opt) {
this.getDetail(opt.id) this.getDetail(opt.id)
} }
document.title = '积分申请' this.$dict.load('integralApplyEventType')
},
watch: {
'form.eventType'(val) {
if(val==0 || val == 1 || val == 5) {
this.form.applyIntegral = 2
} else if(val == 2 || val == 3 || val == 4) {
this.form.applyIntegral = 5
}
}
}, },
methods: { methods: {
getDetail(id) { getDetail(id) {
@@ -54,6 +69,10 @@ export default {
submit() { submit() {
if(this.flag) return if(this.flag) return
if(!this.form.eventType) {
return this.$u.toast('请选择事件类型')
}
if(!this.form.applyItem) { if(!this.form.applyItem) {
return this.$u.toast('请输入申请事项') return this.$u.toast('请输入申请事项')
} }

View File

@@ -92,7 +92,7 @@ export default {
}, },
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res?.data) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
} }
}) })