党员积分

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>

View File

@@ -1,25 +1,19 @@
<template>
<div class="AppPartyPoints">
<AiTopFixed>
<u-search placeholder="搜索党员" :show-action="false" search-icon-color="#ccc" v-model="search.title"
@search="isMore = false, search.current = 1, getList()"/>
<u-search placeholder="搜索党员" :show-action="false" search-icon-color="#ccc" v-model="partyName"
@search="getListInit()" @clear="getListInit()" />
</AiTopFixed>
<div class="list-content">
<div class="item" >
<div class="list-content" v-if="list.length">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="left">
<p>刘宝华:参与环保宣传</p>
<div>2022-03-18 13:45:36</div>
<p>{{item.partyName}}:{{item.remark}}</p>
<div>{{item.createTime}}</div>
</div>
<div class="right status0">20</div>
</div>
<div class="item" >
<div class="left">
<p>刘宝华:参与环保宣传</p>
<div>2022-03-18 13:45:36</div>
</div>
<div class="right status0">20</div>
<div class="right" :class="'status'+item.integralType">{{item.residualIntegral}}</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
<div class="height-144"></div>
<div class="footer" @click="toAdd">
<div class="btn">积分调整</div>
@@ -35,25 +29,48 @@ export default {
appName: '党员积分',
data() {
return {
search: {title: ''},
partyName: '',
current: 1,
list: []
}
},
computed: {
...mapState(['user']),
},
created() {
this.$dict.load('appSpecialTypeFive')
this.getList()
},
onShow() {
document.title = '党员积分'
},
methods: {
getList() {
this.$http.post('/app/apppartyintegralinfo/list', null, {
params: {
size: 20,
current: this.current,
partyName: this.partyName
},
})
.then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
getListInit() {
this.current = 1
this.datas = []
this.getList()
},
toAdd() {
uni.navigateTo({url: './Add'})
},
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>

View File

@@ -27,7 +27,8 @@ export default {
return {
configList: {
resident: {url: "/components/pages/selectResident", label: "name"},
gird: {url: "/components/pages/selectGird", label: "girdName"}
gird: {url: "/components/pages/selectGird", label: "girdName"},
party: {url: "/components/pages/selectParty", label: "name"}
},
}
},

View File

@@ -0,0 +1,184 @@
<template>
<div class="selectParty">
<AiTopFixed>
<u-search placeholder="搜索" v-model="name" :show-action="false" @change="getList"></u-search>
</AiTopFixed>
<div class="user-list">
<template v-if="list.length>0">
<div class="item" v-for="(item, index) in list" :key="index">
<div class="select-img" @click="checkClick(index)">
<img :src="item.isCheck ? checkIcon : cirIcon" alt="">
</div>
<div class="user-info">
<img :src="item.photo" alt="" v-if="item.photo">
<img src="./img/user-img.png" alt="" v-else>{{ item.name }}
</div>
</div>
</template>
<template v-else>
<AiEmpty />
<div class="pad-b118"/>
</template>
</div>
<div class="pad-b118"/>
<div class="footer">
<div class="btn" @click="confirm">确定选择</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: "selectParty",
appName: "人员选择器(党员)",
data() {
return {
current: 1,
name: '',
list: [],
cirIcon: require('./img/xz.png'),
checkIcon: require('./img/xzh.png'),
selected: []
}
},
computed: {
...mapState(['user']),
isSingle() {
return this.$route.query.single
}
},
onLoad(query) {
if (query.selected) {
this.selected = query.selected?.split(",") || []
}
this.getList()
},
methods: {
getList() {
this.$http.post(`/app/appparty/list`, null, {
params: {
current: this.current,
size: 20,
areaId: this.user.areaId,
con: this.name
}
}).then(res => {
if (res?.data) {
res.data.records.forEach(e => {
e.isCheck = this.selected.includes(e.idNumber)
})
if (this.current > 1 && this.current > res.data.pages) {
return
}
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
checkClick(index) {
if (this.isSingle) {
this.list.map((e, i) => {
e.isCheck = i == index;
})
} else this.list[index].isCheck = !this.list[index].isCheck
},
confirm() {
let checkList = []
this.list.map((item) => {
if (item.isCheck) {
checkList.push(item)
}
})
if (!checkList.length) {
return this.$u.toast('请先选择人员')
} else {
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:party", checkList)
}
})
}
}
},
onReachBottom() {
this.current++
this.getList()
},
}
</script>
<style lang="scss" scoped>
.selectParty {
::v-deep .AiTopFixed .u-search {
margin-bottom: 0 !important;
}
.pad-b118 {
padding-bottom: 118px;
}
.user-list {
background-color: #fff;
.item {
.select-img {
display: inline-block;
img {
width: 48px;
height: 48px;
margin: 12px 36px 12px 30px;
vertical-align: middle;
}
}
.user-info {
display: inline-block;
padding: 20px 0 20px 0;
width: calc(100% - 114px);
height: 100%;
border-bottom: 1px solid #E4E5E6;
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 74px;
img {
width: 74px;
height: 74px;
border-radius: 8px;
margin-right: 34px;
vertical-align: bottom;
}
}
}
}
.footer {
width: 100%;
height: 118px;
background: #F4F8FB;
position: fixed;
left: 0;
bottom: 0;
text-align: right;
.btn {
display: inline-block;
width: 192px;
height: 80px;
line-height: 80px;
background: #1365DD;
border-radius: 4px;
text-align: center;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FFF;
margin: 20px 34px 0 0;
}
}
}
</style>