积分管理

This commit is contained in:
shijingjing
2022-06-20 11:26:42 +08:00
parent 918b88e5e2
commit 387b25c678
9 changed files with 1597 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
<template>
<div class="AppHealthReport">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from './components/List.vue'
import Detail from './components/Detail.vue'
export default {
name: 'AppIntegralAudit',
label: '积分审核(三涧溪)',
components: {
List,
Detail
},
props: {
instance: Function,
dict: Object,
permissions: Function
},
data () {
return {
component: 'List',
params: {}
}
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.AppHealthReport {
height: 100%;
}
</style>

View File

@@ -0,0 +1,239 @@
<template>
<ai-detail class="audit">
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="申请人" :value="info.residentName"></ai-info-item>
<ai-info-item label="申请时间" :value="info.createTime"></ai-info-item>
<!-- <ai-info-item label="积分类型" :value="dict.getLabel('atWillReportType', info.applyIntegralType)"></ai-info-item> -->
<ai-info-item label="申请描述" :value="info.description" isLine></ai-info-item>
<ai-info-item label="联系电话" isLine :value="info.residentPhone"></ai-info-item>
<ai-info-item label="图片" isLine>
<ai-uploader v-model="info.applyFiles" disabled></ai-uploader>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="处理结果" v-if="info.auditStatus !== '0'">
<div slot="content" style="margin-top: 16px;margin-bottom:24px">
<ai-wrapper
label-width="120px">
<ai-info-item label="审核结果" :value="info.auditStatus === '1' ? '通过' : '拒绝'" isLine></ai-info-item>
<ai-info-item label="审核意见" v-if="info.auditStatus === '2'" isLine :value="info.auditOpinion"></ai-info-item>
<!-- <ai-info-item label="积分规则类别" v-if="info.auditStatus === '1'" :value="dict.getLabel('atWillReportType', info.auditIntegralType)"></ai-info-item>-->
<!-- <ai-info-item label="积分规则事项" v-if="info.auditStatus === '1'" :value="info.auditRuleName"></ai-info-item>-->
<ai-info-item label="积分调整" isLine v-if="info.auditStatus === '1'"
:value="(info.auditIntegral >= 0 ? info.auditIntegral : info.auditIntegral) + '分'"></ai-info-item>
<ai-info-item label="审核人" :value="info.auditUserName"></ai-info-item>
<ai-info-item label="审核时间" :value="info.auditTime"></ai-info-item>
</ai-wrapper>
</div>
</ai-card>
<ai-dialog
:visible.sync="isShow"
width="800px"
@close="onClose"
title="事件审核"
@onConfirm="onConfirm">
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
<el-form-item label="是否通过审核" prop="pass" style="width: 100%;" :rules="[{ required: true, message: '请选择是否通过审核' }]">
<el-radio-group v-model="form.pass" @change="onStatusChange">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.pass === '1'" label="积分调整" prop="auditIntegral" style="width: 100%;" :rules="[{ required: true, message: '请输入积分调整' }]">
<el-input v-model.number="form.auditIntegral" clearable placeholder="请输入积分调整" @keyup.native="form.auditIntegral=Math.abs(form.auditIntegral)"/>
</el-form-item>
<!-- <el-form-item v-if="form.pass === '1'" label="积分规则类别" prop="auditRuleId" style="width: 100%;" :rules="[{ required: true, message: '' }]">-->
<!-- <div class="flex-warpper">-->
<!-- <el-form-item label-width="0" prop="auditIntegralType" :rules="[{ required: true, message: '请选择积分规则类别' }]">-->
<!-- <ai-select-->
<!-- v-model="form.auditIntegralType"-->
<!-- clearable-->
<!-- style="width: 180px;"-->
<!-- placeholder="请选择积分规则类别"-->
<!-- :selectList="dict.getDict('atWillReportType')"-->
<!-- @change="onChange">-->
<!-- </ai-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item style="margin: 0 10px;" prop="auditRuleId" :rules="[{ required: true, message: '请选择积分规则事项' }]">-->
<!-- <ai-select-->
<!-- v-model="form.auditRuleId"-->
<!-- clearable-->
<!-- style="width: 180px;"-->
<!-- placeholder="请选择积分规则事项"-->
<!-- :selectList="ruleList">-->
<!-- </ai-select>-->
<!-- </el-form-item>-->
<!-- <span>{{ integralText }}</span>-->
<!-- </div>-->
<!-- </el-form-item>-->
<el-form-item label="审核意见" v-if="form.pass === '0'" prop="opinion" style="width: 100%;" :rules="[{ required: true, message: '请输入审核意见' }]">
<el-input type="textarea" :rows="5" :maxlength="200" v-model="form.opinion" clearable placeholder="请输入审核意见" show-word-limit></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="isShow = true" v-if="info.auditStatus === '0'">审核</el-button>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data() {
const validatorRules = function (rule, value, callback) {
if (value === '') {
callback(new Error('请输入联系方式'))
} else if (!/^1\d{10}$/.test(value)) {
callback(new Error('手机号格式错误'))
} else {
callback()
}
}
return {
total: 0,
info: {
auditStatus: '0'
},
id: '',
isShow: false,
form: {
auditIntegralType: '',
auditRuleId: '',
opinion: '',
pass: ''
},
ruleList: []
}
},
computed: {
integralText() {
if (!this.form.auditRuleId) {
return ''
}
const integral = this.ruleList.filter(v => v.dictValue === this.form.auditRuleId)[0].integral
return integral >= 0 ? `+${integral}` : `${integral}`
}
},
created() {
if (this.params && this.params.id) {
this.id = this.params.id
this.dict.load(['atWillReportType', 'auditStatus']).then(() => {
this.getInfo(this.params.id)
})
}
},
methods: {
getInfo(id) {
this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
onStatusChange() {
this.$refs.form.clearValidate()
},
onClose() {
this.form.auditIntegralType = ''
this.form.auditRuleId = ''
this.form.pass = ''
this.form.opinion = ''
this.id = ''
},
onConfirm() {
this.$refs.form.validate(v => {
if (v) {
this.instance.post('/app/appvillagerintegraldeclare/examine', null, {
params: {
...this.form,
id: this.params.id,
}
}).then(res => {
if (res.code == 0) {
this.isShow = false
this.getInfo(this.params.id)
this.$message.success('审核成功!')
}
})
}
})
},
onChange(e) {
this.form.auditRuleId = ''
this.instance.post(`/app/appvillagerintegralrule/list?size=1000&classification=${e}`).then(res => {
if (res?.code == 0) {
this.ruleList = res.data.records.filter(v => v.ruleStatus === '1').map(v => {
return {
dictName: v.ruleName,
dictValue: v.id,
ruleName: v.ruleName,
integral: v.integral
}
})
}
})
},
cancel(isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
.audit {
.flex-warpper {
display: flex;
align-items: center;
::v-deep .el-form-item .el-form-item__content {
margin-left: 0 !important;
}
::v-deep .ai-select {
margin: 0 !important;
}
::v-deep .el-form-item {
width: auto;
margin-bottom: 0;
&:last-child {
margin-right: 10px;
}
}
}
}
</style>

View File

@@ -0,0 +1,237 @@
<template>
<ai-list class="list">
<ai-title
slot="title"
title="积分审核"
v-if="search.areaId"
isShowBottomBorder
:instance="instance"
:disabledLevel="disabledLevel"
isShowArea
v-model="search.areaId"
@change="changeArea">
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<ai-select
v-model="search.applyIntegralType"
clearable
placeholder="请选择积分类型"
:selectList="dict.getDict('atWillReportType')"
@change="search.current = 1, getList()">
</ai-select>
<ai-select
v-model="search.auditStatus"
clearable
placeholder="请选择审核状态"
:selectList="dict.getDict('auditStatus')"
@change="search.current = 1, getList()">
</ai-select>
<el-date-picker
value-format="yyyy-MM-dd"
v-model="search.createTimeStart"
type="date"
size="small"
unlink-panels
placeholder="选择开始日期"
@change="search.current = 1, getList()" />
<el-date-picker
value-format="yyyy-MM-dd"
v-model="search.createTimeEnd"
type="date"
size="small"
unlink-panels
placeholder="选择结束日期"
@change="search.current = 1, getList()" />
</template>
<template #right>
<el-input
v-model="search.residentName"
size="small"
placeholder="请输入姓名"
clearable
v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, search.residentName = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
v-loading="loading"
style="margin-top: 8px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</div>
</template>
</ai-list>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data () {
return {
search: {
current: 1,
size: 10,
residentName: '',
applyIntegralType: '',
areaId: '',
auditStatus: '',
createTimeStart: '',
createTimeEnd: ''
},
dictList: [{
dictName: '否',
dictValue: '0'
}, {
dictName: '是',
dictValue: '1'
}],
info: {},
colConfigs: [
{ prop: 'residentName', label: '申请人' },
{ prop: 'residentPhone', align: 'center', label: '联系电话' },
{ prop: 'createTime', align: 'center', label: '申请时间' },
{ prop: 'applyIntegralType', align: 'center', label: '积分类型', formart: v => this.dict.getLabel('atWillReportType', v) },
{ prop: 'auditStatus', align: 'center', label: '状态', formart: v => v ? this.dict.getLabel('auditStatus', v) : '-' },
{ prop: 'auditUserName', align: 'center', label: '审批人' },
{ prop: 'auditTime', align: 'center', label: '审批时间' }
],
tableData: [],
total: 0,
loading: false,
disabledLevel: 0
}
},
computed: {
...mapState(['user']),
param () {
return {
}
}
},
created () {
this.disabledLevel = this.user.info.areaList.length - 1
this.search.areaId = this.user.info.areaId
this.loading = true
this.dict.load(['atWillReportType', 'auditStatus']).then(() => {
this.getList()
})
},
methods: {
getList () {
this.instance.post(`/app/appvillagerintegraldeclare/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
this.loading = false
} else {
this.loading = false
}
}).catch(() => {
this.loading = false
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
changeArea () {
this.search.current = 1
this.$nextTick(() => {
this.getList()
})
}
}
}
</script>
<style scoped lang="scss">
.list {
::v-deep .ai-list__content {
padding: 0!important;
.ai-list__content--right-wrapper {
background: transparent!important;
box-shadow: none!important;
margin: 0!important;
padding: 12px 16px 12px!important;
}
}
.statistics-top {
display: flex;
align-items: center;
margin-bottom: 20px;
& > div {
flex: 1;
height: 96px;
line-height: 1;
margin-right: 20px;
padding: 16px 24px;
background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.15);
border-radius: 4px;
&:last-child {
margin-right: 0;
}
h3 {
font-size: 24px;
}
span {
display: block;
margin-bottom: 16px;
color: #888888;
font-size: 16px;
}
}
}
.content {
padding: 16px;
background: #FFFFFF;
box-shadow: 0px 4px 6px -2px rgba(15, 15, 21, 0.15);
}
}
</style>

View File

@@ -0,0 +1,35 @@
<template>
<section class="AppPartyScore">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<script>
import PsList from "./psList";
import PsDetail from "./psDetail";
export default {
name: "AppPartyScore",
components: {PsDetail, PsList},
label: "党员积分(三涧溪)",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
return this.$route.query.id ? PsDetail : PsList
}
},
created() {
this.dict.load("partyIntegralType")
}
}
</script>
<style lang="scss" scoped>
.AppPartyScore {
height: 100%;
}
</style>

View File

@@ -0,0 +1,154 @@
<template>
<section class="psDetail">
<ai-detail>
<ai-title slot="title" title="积分详情" isShowBottomBorder isShowBack @onBackClick="back"/>
<template #content>
<el-row type="flex">
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`姓名`"/>
<b v-text="detail.name"/>
</template>
</ai-card>
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`学习强国`"/>
<el-button type="text" @click="handleEditLearningIntergral(detail.id)">编辑</el-button>
<b class="color-26f" v-text="detail.learningIntegral||0"/>
</template>
</ai-card>
<ai-card hideTitle class="staCard fill">
<template slot="content">
<div class="color-999" v-text="`个人积分`"/>
<b class="color-26f" v-text="detail.integral||0"/>
</template>
</ai-card>
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`家庭积分`"/>
<b class="color-26f" v-text="detail.familySurplusIntegral||0"/>
</template>
</ai-card>
</el-row>
<ai-card title="余额变动明细">
<template #content>
<ai-table :tableData="detail.integralInfoList" :isShowPagination="false" :col-configs="colConfigs"
:dict="dict"/>
</template>
</ai-card>
</template>
</ai-detail>
<ai-dialog :visible.sync="dialog" title="学习强国设置" width="500px" @close="form={}" @onConfirm="submit">
<el-form :model="form" size="small" ref="DialogForm" :rules="rules" label-width="110px">
<el-form-item label="学习强国积分" prop="learningIntegral">
<el-input v-model.number="form.learningIntegral" placeholder="请输入正整数" clearable/>
</el-form-item>
</el-form>
</ai-dialog>
</section>
</template>
<script>
export default {
name: "psDetail",
props: {
instance: Function,
dict: Object,
},
data() {
return {
detail: {},
colConfigs: [
{label: "时间", prop: "createTime"},
{label: "类型", prop: "integralType", align: 'center', dict: "partyIntegralType"},
{label: "变动积分", prop: "integral", align: 'center'},
{label: "剩余积分", prop: "residualIntegral", align: 'center'},
{label: "调整说明", prop: "remark"},
],
dialog: false,
form: {},
rules: {
learningIntegral: [
{required: true, message: "请输入学习强国积分"},
{pattern: /^\d+$/g, message: "请输入正整数"}
]
}
}
},
methods: {
getDetail() {
let {id} = this.$route.query
this.instance.post("/app/appparty/getPartyIntegralDetail", null, {
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
back() {
this.$router.push({})
},
submit() {
this.$refs.DialogForm.validate(v => {
if (v) {
this.instance.post("/app/appparty/editLearningIntegral", null,{
params:this.form
}).then(res => {
if (res?.code == 0) {
this.$message.success("提交成功!")
this.dialog = false
this.getDetail()
}
})
}
})
},
handleEditLearningIntergral(partyMemberId) {
this.dialog = true
this.form = {partyMemberId}
}
},
created() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.psDetail {
height: 100%;
.color-999 {
color: #999;
}
.color-26f {
color: #26f;
}
::v-deep.staCard {
font-size: 14px;
b {
font-size: 24px;
line-height: 40px;
}
& + .staCard {
margin-left: 16px;
}
.ai-card__body {
position: relative;
.el-button {
position: absolute;
right: 32px;
top: 6px;
}
}
}
}
</style>

View File

@@ -0,0 +1,380 @@
<template>
<section class="psList">
<ai-list>
<ai-title slot="title" title="党员积分" isShowBottomBorder/>
<template #left>
<div class="patyCode-left">
<div class="patyCode-left__title">
<h2>组织目录</h2>
</div>
<div class="organization-left__list">
<div class="organization-left__list--title">
<el-input
class="organization-left__list--search"
size="mini"
clearable
placeholder="请输入组织名称"
v-model="organizationName"
suffix-icon="iconfont iconSearch">
</el-input>
</div>
<el-tree
:filter-node-method="filterNode"
ref="tree"
:props="defaultProps"
node-key="id"
:data="organizationTree"
highlight-current
:current-node-key="search.organizationName"
:default-expanded-keys="defaultExpanded"
:default-checked-keys="defaultChecked"
@current-change="onTreeChange">
</el-tree>
</div>
</div>
</template>
<template #content>
<ai-search-bar>
<template #left>
<div>统计周期</div>
<el-date-picker type="daterange" placeholder="日期" size="small" clearable v-model="createTime"
@change="handleSearchTime" start-placeholder="开始时间" end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00','23:59:59']"/>
</template>
<template #right>
<ai-import :instance="instance" name="党员积分" title="导入党员积分"
suffixName="xlsx"
url="/app/apppartyintegralinfo/downloadTemplate"
importUrl="/app/apppartyintegralinfo/import"
@onSuccess="page.current=1,getTableData()"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<el-button type="text" @click="getFamilyByPartyId(row.idNumber)">家庭成员</el-button>
<el-button type="text" @click="showDetail(row.id)">详情</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog :visible.sync="dialog" title="家庭成员" :customFooter="true" width="780px" @close="familyList=[]">
<ai-table :tableData="familyList" :isShowPagination="false" :col-configs="familyCols" :dict="dict"/>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog=false"> </el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "psList",
props: {
instance: Function,
dict: Object,
},
computed: {
...mapState(['user']),
colConfigs() {
return [
{label: "姓名", prop: "name"},
{label: "个人积分", prop: "integral", align: "center"},
{label: "家庭积分", prop: "familySurplusIntegral", align: "center"},
{label: "学习强国", prop: "learningIntegral", align: "center"},
{slot: "options"}
]
},
familyCols() {
return [
{
label: '与户主关系', prop: 'householdRelation', align: 'center', width: 165,
render: (h, {row}) => h('p', this.dict.getLabel('householdRelation', row.householdRelation || "户主"))
},
{label: '类型', prop: 'residentType', align: 'center', dict: "residentType"},
{label: '姓名', prop: 'name', align: 'center'},
{label: '身份证号', render: (h, {row}) => h('p', this.idCardNoUtil.hideId(row.idNumber)), width: 165},
{label: '联系电话', prop: 'phone', align: 'center', width: 120}
]
}
},
data() {
return {
search: {},
page: {current: 1, size: 10, total: 0},
tableData: [],
dialog: false,
familyList: [],
organizationName: '',
organizationTree: [],
defaultExpanded: [],
defaultChecked: [],
areaTree: [],
defaultProps: {
children: 'children',
label: 'name'
},
createTime: '',
}
},
methods: {
back() {
this.$router.push({})
},
getTableData() {
this.instance.post("/app/appparty/listByPartyIntegral", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
getTree() {
this.instance.post(`/admin/area/queryAllArea?id=${this.user.info.areaId}`).then(res => {
if (res.code === 0) {
let parent = res.data.map(v => {
v.label = v.name
v.children = []
return v
}).filter(e => !e.parentid)[0]
this.defaultExpanded = [parent.id]
this.defaultChecked = [parent.id]
this.search.areaId = parent.id
this.addChild(parent, res.data)
this.organizationTree = [parent]
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(parent.id)
})
}
})
},
addChild(parent, list) {
for (let i = 0; i < list.length; i++) {
if (list[i].parentId === parent.id) {
parent.children.push(list[i])
}
}
if (list.length > 0) {
parent['children'].map(v => this.addChild(v, list))
}
},
onTreeChange(e) {
this.search.areaId = e.id
this.areaName = e.name
this.search.current = 1
this.$nextTick(() => {
this.getList()
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
handleSearchTime(v) {
// this.page.current = 1
// this.search.startTime = v?.[0]
// this.search.endTime = v?.[1]
// this.getTableData()
},
showDetail(id) {
this.$router.push({query: {id}})
},
getFamilyByPartyId(idNumber) {
this.instance.post("/app/appresident/queryHomeMember", null, {
params: {idNumber}
}).then(res => {
if (res?.data) {
this.familyList = res.data?.family || []
this.dialog = true
}
})
}
},
created() {
this.getTableData()
// this.getTree()
}
}
</script>
<style lang="scss" scoped>
.psList {
height: 100%;
.organization-left__list {
height: calc(100% - 40px);
padding: 8px 8px;
overflow: auto;
.organization-left__tags--item {
display: flex;
align-items: center;
justify-content: space-between;
height: 40px;
padding: 0 8px 0 16px;
color: #222222;
&.organization-left__tags--item-active, &:hover {
background: #E8EFFF;
color: #2266FF;
i, span {
color: #2266FF;
}
}
span {
font-size: 14px;
}
i {
cursor: pointer;
color: #8e9ebf;
font-size: 16px;
}
}
.organization-left__list--title {
display: flex;
align-items: center;
margin-bottom: 8px;
.organization-left__list--search {
flex: 1;
::v-deep input {
width: 100%;
}
}
.el-button {
width: 84px;
flex-shrink: 1;
margin-right: 8px;
}
}
span {
color: #222222;
font-size: 14px;
}
::v-deep .el-tree {
background: transparent;
.el-tree-node__expand-icon.is-leaf {
color: transparent !important;
}
.el-tree-node__content > .el-tree-node__expand-icon {
padding: 4px;
}
.el-tree-node__content {
height: 32px;
}
.el-tree__empty-text {
color: #222;
font-size: 14px;
}
.el-tree-node__children .el-tree-node__content {
height: 32px;
}
.el-tree-node__content:hover {
background: #E8EFFF;
color: #222222;
border-radius: 2px;
}
.is-current > .el-tree-node__content {
&:hover {
background: #2266FF;
color: #fff;
}
background: #2266FF;
span {
color: #fff;
}
}
}
}
::v-deep .ai-list__content--left {
margin-right: 2px;
}
.patyCode-left {
width: 100%;
height: auto;
background: #FAFAFB;
.patyCode-left__title {
display: flex;
align-items: center;
height: 40px;
padding: 0 16px;
background: #fff;
h2 {
color: #222;
font-size: 14px;
}
}
.patyCode-left__list {
height: calc(100% - 40px);
padding: 8px 0;
overflow: auto;
span {
display: block;
height: 40px;
line-height: 40px;
padding: 0 24px;
color: #222222;
font-size: 14px;
cursor: pointer;
border-right: 2px solid transparent;
background: transparent;
&:hover {
color: #2266FF;
background: #E8EFFF;
}
&.left-active {
color: #2266FF;
border-color: #2266FF;
background: #E8EFFF;
}
}
}
}
::v-deep .ai-list__content--right {
.ai-list__content--right-wrapper {
min-height: 100%;
}
}
}
</style>

View File

@@ -0,0 +1,34 @@
<template>
<section class="AppPartyScoreFlow">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<script>
import PsfList from "./psfList";
export default {
name: "AppPartyScoreFlow",
components: {PsfList},
label: "党员积分明细(三涧溪)",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
return PsfList
}
},
created() {
this.dict.load("partyIntegralType")
}
}
</script>
<style lang="scss" scoped>
.AppPartyScoreFlow {
height: 100%;
}
</style>

View File

@@ -0,0 +1,153 @@
<template>
<section class="psfList">
<ai-list>
<ai-title slot="title" title="党员积分明细" isShowBottomBorder/>
<template #content>
<ai-search-bar>
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
<el-date-picker type="daterange" placeholder="日期" size="small" clearable v-model="createTime"
@change="handleSearchTime" start-placeholder="开始时间" end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00','23:59:59']"/>
</template>
<template #right>
<el-input size="small" placeholder="搜索党员" v-model="search.partyName" clearable
@change="page.current=1,getTableData()" suffix-icon="iconfont iconSearch"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<el-button type="text" @click="showDetail(row)">详情</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog :visible.sync="dialog" title="积分对象" width="600px" @close="form={}" @onConfirm="submit"
:customFooter="!isAdd">
<el-form v-if="isAdd" :model="form" size="small" ref="DialogForm" :rules="rules" label-width="80px">
<el-form-item label="选择人员" prop="partyId">
<ai-select v-model="form.partyId" action="/app/appparty/list" :instance="instance"
:prop="{label:'name'}"/>
</el-form-item>
<el-form-item label="调整说明" prop="remark">
<el-input type="textarea" placeholder="请输入" v-model="form.remark" maxlength="100" show-word-limit rows="3"
clearable/>
</el-form-item>
<el-form-item label="类型" prop="integralType">
<ai-select v-model="form.integralType" :selectList="dict.getDict('partyIntegralType')"/>
</el-form-item>
<el-form-item label="积分" prop="integral">
<el-input v-model.number="form.integral" placeholder="请输入正整数" clearable/>
</el-form-item>
</el-form>
<ai-wrapper v-else>
<ai-info-item label="对象" :value="form.partyName"/>
<ai-info-item label="调整说明" :value="form.remark" isLine/>
<ai-info-item label="类型" :value="dict.getLabel('partyIntegralType',form.integralType)"/>
<ai-info-item label="积分" :value="form.integral"/>
</ai-wrapper>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "psfList",
props: {
instance: Function,
dict: Object,
},
computed: {
...mapState(['user']),
colConfigs() {
return [
{label: "对象", prop: "partyName"},
{label: "调整说明", prop: "remark", align: "center"},
{label: "时间", prop: "createTime"},
{label: "类型", prop: "integralType", align: "center", dict: "partyIntegralType"},
{label: "积分", prop: "integral", align: "center"},
{slot: "options"}
]
},
isAdd() {
return !this.form.id
}
},
data() {
return {
search: {},
page: {current: 1, size: 10, total: 0},
tableData: [],
dialog: false,
form: {},
rules: {
partyId: {required: true, message: "请选择人员"},
remark: {required: true, message: "请输入调整说明"},
integralType: {required: true, message: "请选择类型"},
integral: [
{required: true, message: "请输入分数"},
{pattern: /^\d+$/g, message: "请输入正整数"}
],
},
createTime: "",
}
},
methods: {
getTableData() {
this.instance.post("/app/apppartyintegralinfo/list", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data?.records?.map(e => ({
...e,
integral: (e.integralType == 0 ? "-" : '+') + e.integral
}))
this.page.total = res.data.total
}
})
},
showDetail(row) {
this.form = JSON.parse(JSON.stringify(row))
this.dialog = true
},
submit() {
this.$refs.DialogForm.validate(v => {
if (v) {
let loading = this.$loading({text: "提交中..."})
this.instance.post("/app/apppartyintegralinfo/addOrUpdate", this.form).then(res => {
loading.close()
if (res?.code == 0) {
this.$message.success("提交成功!")
this.dialog = false
this.getTableData()
}
}).catch(() => loading.close())
}
})
},
handleSearchTime(v) {
this.page.current = 1
this.search.startTime = v?.[0]
this.search.endTime = v?.[1]
this.getTableData()
}
},
created() {
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.psfList {
height: 100%;
}
</style>

View File

@@ -0,0 +1,303 @@
<template>
<section class="AppScoreRules">
<ai-list v-if="permissions('app_appvillagerintegralrule_detail')">
<template slot="title">
<ai-title title="积分规则" isShowBottomBorder></ai-title>
</template>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-cascader size="small" v-model="search.eventType" placeholder="请选择事件/类型" clearable
:props="{...etOps,checkStrictly:true}" @change="handleTypeSearch" ref="eventTypeSearch"/>
<ai-select
v-model="search.status"
@change="page.current = 1, getList()"
placeholder="请选择状态"
:selectList="dict.getDict('integralRuleStatus')">
</ai-select>
</template>
<template slot="right">
</template>
</ai-search-bar>
<ai-search-bar style="margin-top: 16px;">
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true">添加</el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total" :dict="dict"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
<el-table-column slot="integral" label="分值" align="center">
<template slot-scope="{ row }">
<span
v-if="row.integralValueType == 1">
{{ row.integralStart > 0 ? '+' + row.integralStart : row.integralStart }} ~ {{ row.integralEnd > 0 ? '+' + row.integralEnd : row.integralEnd }}
</span>
<span v-else>{{ row.integral > 0 ? '+' : '' }}{{ row.integral }}</span>
</template>
</el-table-column>
<el-table-column slot="options" label="操作" align="center" fixed="right" width="200">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 0)" v-if="row.status == 1">
停用
</el-button>
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="changeStatus(row.id, 1)" v-else>启用</el-button>
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_edit')" @click="toEdit(row)">编辑</el-button>
<el-button type="text" :disabled="!permissions('app_appvillagerintegralrule_del')" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-empty v-else>暂无应用权限</ai-empty>
<ai-dialog :title="dialogTitle" :visible.sync="dialog" @onConfirm="onConfirm" @closed="form={ladderRule: []}" width="700px">
<div class="form_div">
<el-form ref="DialogForm" :model="form" :rules="formRules" size="small" label-suffix="" label-width="100px">
<el-form-item label="事件/类型" prop="eventType">
<el-cascader v-model="form.eventType" :props="etOps" clearable placeholder="请选择" @change="handleTypeForm"
:options="cacheOps"/>
</el-form-item>
<el-form-item label="规则" prop="ruleType" v-if="form.ruleType>-1" required>
<el-row type="flex" justify="space-between">
<div v-text="dict.getLabel('integralRuleRuleType',form.ruleType)"/>
<el-button v-if="form.ruleType==1" type="text" icon="iconfont iconAdd"
@click="form.ladderRule.push({viewCount:null,integral:null})">添加
</el-button>
</el-row>
<el-table v-if="form.ruleType==1" :data="form.ladderRule" size="mini" border stripe>
<el-table-column label="查看人数(人)" align="center">
<template slot-scope="{row}">
<el-input class="tableInput" v-model.number="row.viewCount" clearable placeholder="请输入"/>
</template>
</el-table-column>
<el-table-column label="获得积分(分)" align="center">
<template slot-scope="{row}">
<el-input class="tableInput" v-model="row.integral" clearable placeholder="请输入" type="number"
@keyup.native="row.integral=checkIntegral(row.integral)"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{row,$index}">
<el-button type="text" @click="handleDelete($index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="周期范围" prop="scoringCycle">
<ai-select v-model="form.scoringCycle" :selectList="dict.getDict('integralRuleScoringCycle')"/>
</el-form-item>
<template v-if="form.ruleType==0">
<el-form-item label="奖励次数" prop="numberLimit">
<el-input placeholder="请输入,周期范围内,不填写表示不限制" v-model.number="form.numberLimit" clearable/>
</el-form-item>
<el-form-item label="积分分值" prop="integral">
<el-input placeholder="请输入" v-model="form.integral" clearable/>
</el-form-item>
</template>
</el-form>
</div>
</ai-dialog>
</section>
</template>
<script>
export default {
name: "AppScoreRules",
label: "积分规则(三涧溪)",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
isEdit() {
return !!this.form.id
},
dialogTitle() {
return this.isEdit ? "编辑积分规则" : "添加积分规则"
},
etOps() {
return {
lazy: true,
value: "dictValue",
label: "dictName",
lazyLoad: (node, resolve) => {
if (node.level == 0) resolve(this.dict.getDict('integralRuleEvent'))
else if (node.level == 1) {
let dict = 'integralRuleEvent' + node.value
this.dict.load(dict).then(() => {
let nodes = this.dict.getDict(dict).map(e => ({...e, leaf: true}))
resolve(nodes)
})
}
}
}
},
},
data() {
return {
search: {status: "", eventType: null},
page: {current: 1, size: 10, total: 0},
colConfigs: [
{prop: "event", label: "事件", dict: "integralRuleEvent"},
{prop: "type", label: "类型", dict: "integralRuleEventType"},
{prop: "ruleType", label: "规则", dict: "integralRuleRuleType"},
{prop: "scoringCycle", label: "周期范围", dict: "integralRuleScoringCycle"},
{prop: "status", label: "状态", align: "center", width: 96, dict: "integralRuleStatus"},
{slot: "options", label: "操作", align: "center"},
],
tableData: [],
dialog: false,
form: {ladderRule: []},
formRules: {
eventType: [{required: true, message: "请选择事件/类型", trigger: "change"}],
scoringCycle: [{required: true, message: "请选择周期范围", trigger: "change"}],
integral: [{required: true, pattern: /^\d*[.\d]\d?$/, message: "请输入积分分值,最多保留一位小数"}],
numberLimit: [{pattern: /^\d*$/, message: "请输入正整数"}]
},
cacheOps: []
};
},
created() {
this.dict.load("integralRuleStatus", "integralRuleRuleType", 'integralRuleScoringCycle', 'integralRuleEvent', 'integralRuleEventType').then(() => {
this.getList();
});
},
methods: {
getList() {
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
params: {...this.search, ...this.page},
}).then(res => {
if (res?.data) {
this.tableData = res.data.records;
this.page.total = res.data.total;
}
});
},
toEdit(row) {
this.form = this.$copy(row)
let {ladderRule, event, type} = this.form,
dict = 'integralRuleEvent' + event
this.dict.load(dict).then(() => {
this.form.eventType = [event, type]
this.form.ladderRule = JSON.parse(ladderRule || "[]")
this.cacheOps = this.dict.getDict('integralRuleEvent').map(e => {
if (e.dictValue == event) {
e.children = this.dict.getDict(dict).map(d => ({...d, leaf: true}))
}
return e
})
this.$nextTick(() => {
this.dialog = true
})
})
},
remove(id) {
this.$confirm("删除后不可恢复,是否要删除该事项?", {
type: 'error'
}).then(() => {
this.instance
.post(`/app/appvillagerintegralrule/delete?ids=${id}`)
.then((res) => {
if (res.code == 0) {
this.$message.success("删除成功!");
this.getList();
}
});
});
},
changeStatus(id, status) {
let text = status == 1 ? '启用' : '停用'
this.$confirm(`确定${text}该条规则?`).then(() => {
this.instance.post(`/app/appvillagerintegralrule/enableOrDisable?id=${id}`).then((res) => {
if (res.code == 0) {
this.$message.success(`${text}成功!`)
this.getList();
}
});
});
},
onReset() {
this.page.current = 1
this.search.classification = ""
this.search.integralType = ""
this.search.ruleStatus = ""
this.getList();
},
onConfirm() {
if(this.form.ruleType==1 && !this.form.ladderRule.length) {
return this.$message.error('请添加规则')
}
this.$refs.DialogForm.validate((valid) => {
if (valid) {
let formData = this.$copy(this.form)
formData.ladderRule = JSON.stringify(formData.ladderRule)
formData.integral = formData.integral || 0
this.instance.post(`/app/appvillagerintegralrule/addOrUpdate`, formData).then((res) => {
if (res.code == 0) {
this.$message.success(`${this.isEdit ? '编辑成功' : '添加成功'}`)
this.onReset()
this.dialog = false;
}
});
} else {
return false;
}
});
},
handleTypeSearch(v) {
this.search.event = v?.[0]
this.search.type = v?.[1]
this.page.current = 1
this.$refs.eventTypeSearch.dropDownVisible = false
this.getList()
},
handleTypeForm(v) {
if (this.dialog) {
this.form.event = v?.[0]
this.form.type = v?.[1]
this.form.ruleType = !this.form.event ? null : this.form.event == 3 ? 1 : 0
}
},
handleDelete(i) {
this.$confirm("是否要删除该规则?").then(() => {
this.form.ladderRule.splice(i, 1)
}).catch(() => 0)
},
checkIntegral(v) {
return /\.\d{2,}$/.test(v) ? Math.abs(v).toFixed(1) : Math.abs(v)
}
},
};
</script>
<style lang="scss" scoped>
.AppScoreRules {
height: 100%;
background: #f3f6f9;
::v-deep .ai-list__content--right {
width: 100%;
}
::v-deep .ai-dialog {
.el-cascader {
width: 100%;
}
.tableInput {
& > input {
text-align: center;
border: none;
background: transparent;
}
}
}
}
</style>