党员积分

This commit is contained in:
liuye
2022-04-18 16:47:07 +08:00
parent 40700d72c0
commit 133e87ee61
4 changed files with 270 additions and 32 deletions

View File

@@ -5,8 +5,9 @@
<span class="tips">*</span>党员信息
</div>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#ddd" size="28"></u-icon>
<AiPagePicker type="party" @select="handlePartySelect" single>
<AiMore v-model="form.partyName" placeholder="请选择"/>
</AiPagePicker>
</div>
</div>
<div class="flex mar-b16">
@@ -14,8 +15,7 @@
<span class="tips">*</span>积分操作
</div>
<div class="value">
<span class="color-999">请选择</span>
<u-icon name="arrow-right" color="#ddd" size="28"></u-icon>
<AiSelect dict="partyIntegralType" v-model="form.integralType"></AiSelect>
</div>
</div>
<div class="flex mar-b16">
@@ -23,7 +23,7 @@
<span class="tips">*</span>积分分值
</div>
<div class="value">
<u-input v-model="value" type="number" maxlength="6" placeholder="请输入" placeholder-style="font-size:16px;" input-align="right"/>
<u-input v-model="form.integral" type="number" maxlength="6" placeholder="请输入" placeholder-style="font-size:16px;" :height="32" input-align="right"/>
</div>
</div>
<div class="flex">
@@ -32,10 +32,10 @@
</div>
</div>
<div class="text-area">
<u-input v-model="value" type="textarea" :height="150" :auto-height="true" maxlength="500" placeholder="请输入调整说明" placeholder-style="font-size:16px;" />
<div class="hint">{{ value.length }}/500</div>
<u-input v-model="form.remark" type="textarea" :height="150" :auto-height="true" maxlength="500" placeholder="请输入调整说明" placeholder-style="font-size:16px;" />
<div class="hint">{{ form.remark.length }}/500</div>
</div>
<div class="footer">
<div class="footer" @click="confirm">
<div class="btn">确认提交</div>
</div>
</div>
@@ -48,22 +48,58 @@ export default {
name: 'Add',
data() {
return {
value: ''
form: {
partyName: '',
partyId: '',
integralType: '',
integral: '',
remark: '',
},
}
},
computed: {
...mapState(['user']),
},
created() {
this.$dict.load('appSpecialTypeFive')
this.$dict.load('partyIntegralType')
},
onShow() {
document.title = '积分调整'
},
methods: {
rules() {
return {
partyId: '请选择党员信息',
integralType: '请选择积分操作',
integral: '请输入积分分值',
remark: '请输入调整说明',
}
},
confirm() {
const rules = this.rules()
for (let v of Object.keys(rules)) {
if (!this.form[v]) {
return this.$u.toast(rules[v])
}
}
this.$http.post('/app/apppartyintegralinfo/add', {
partyIntegralList: [{...this.form}],
}).then(res => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('reload')
uni.navigateBack({
delta: 1
})
}
}).catch((err) => {
this.$u.toast(err)
})
},
handlePartySelect(e) {
this.form.partyId = e[0].id
this.form.partyName = e[0].name
}
},
}
</script>