积分整合

This commit is contained in:
aixianling
2022-05-13 16:14:55 +08:00
parent e04acbcf5b
commit 5d656a9e65
13 changed files with 0 additions and 1739 deletions

View File

@@ -1,84 +0,0 @@
<template>
<ai-list>
<template slot="title">
<ai-title title="积分管理" :isShowBottomBorder="false" :instance="instance" :isShowArea="true" v-model="areaId"
@change="changeArea"></ai-title>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :is="tab.comp" v-if="currIndex === String(i)" :bizType="tab.bizType" :ref="tab.name"
:areaId="areaId" :instance="instance" :dict="dict" :permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
</template>
<script>
import pointsDeclaration from "./pointsDeclaration.vue"
import pointsDetails from "./pointsDetails.vue"
import pointsAppeal from './pointsAppeal'
import {mapState} from 'vuex'
import scoreChange from "./scoreChange";
export default {
name: 'AppScoreManage',
label: "积分管理",
components: {pointsDeclaration, pointsDetails, pointsAppeal, scoreChange},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
...mapState(['user']),
tabs() {
return [
// {
// label: "积分申报",
// name: "pointsDeclaration",
// comp: pointsDeclaration,
// permission: "app_apppartyfee_record",
// bizType: '0'
// },
// { label: "积分申诉", name: "pointsAppeal", comp: pointsAppeal, permission: "app_apppartyfee_config", bizType: '1'},
{
label: "积分明细",
name: "pointsDetails",
comp: pointsDetails,
permission: "app_apppartyfee_statistics",
bizType: '2'
},
{
label: "积分调整",
name: "scoreChange",
comp: scoreChange,
permission: "",
},
]
}
},
created() {
this.areaId = this.user.info.areaId
},
methods: {
changeArea() {
this.$nextTick(() => {
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList()
})
}
},
data() {
return {
activeName: "pointsDeclaration",
currIndex: '0',
areaId: ''
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -1,176 +0,0 @@
<template>
<div class="scoreChange">
<ai-list isTabs>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-button type="primary" icon="iconfont iconAdd" @click="dialog=true"
:disabled="!permissions('app_appvillagerintegraldetail_change')">添加
</el-button>
<ai-import :instance="instance" :dict="dict" name="积分调整" type="appvillagerintegraldetail"
v-if="permissions('app_appvillagerintegraldetail_change')" @success="getList"/>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
</ai-table>
</template>
</ai-list>
<ai-dialog
title="添加积分调整"
:visible.sync="dialog"
:destroyOnClose="true"
width="720px"
@onConfirm="onConfirm"
@closed="form={}">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="选择人员" prop="residentId">
<ai-person-select :instance="instance" :customClicker="true"
:url="'/app/appresident/list?auditType=1areaId=' + user.info.areaId"
:isMultiple="false" dialogTitle="选择" @selectPerson="selectPerson">
<template name="option" v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.name }}</span>
<ai-id mode="show" :show-eyes="false" :value="item.idNumber"/>
</template>
</ai-person-select>
</el-form-item>
<el-form-item label="调整说明" prop="description">
<el-input v-model.trim="form.description" placeholder="请输入..." type="textarea" :rows="4" show-word-limit
maxlength="100"></el-input>
</el-form-item>
<el-form-item label="类型" prop="doType">
<el-radio-group v-model="form.doType">
<el-radio label="0">加分</el-radio>
<el-radio label="1">减分</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="积分" prop="changeIntegral">
<el-input v-model.trim.num="form.changeIntegral" placeholder="请输入正整数" size="small"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</div>
</template>
<script>
import {mapState} from "vuex"
export default {
name: "scoreChange",
props: {
instance: Function,
dict: Object,
permissions: Function,
areaId: String
},
data() {
return {
tableData: [],
page: {
current: 1,
size: 10,
total: 10
},
form: {},
dialog: false,
personList: [],
}
},
computed: {
...mapState(["user"]),
rules() {
return {
residentId: [{required: true, message: '请选择人员', trigger: 'blur'},],
description: [{required: true, message: '请输入调整说明', trigger: 'blur'},],
doType: [{required: true, message: '请输入调整说明', trigger: 'change'},],
changeIntegral: [
{
required: true, validator: (rule, value, callback) => {
if (!/^[1-9]\d*$/.test(value)) {
callback(new Error('请输入正整数'))
} else {
callback();
}
}, trigger: 'blur'
},],
}
},
colConfigs() {
return [
{prop: "residentName", label: "姓名"},
{prop: "description", label: "调整说明"},
{
prop: "changeIntegral", label: "类型", align: "center",
render: (h, {row}) => [< span> {+row.changeIntegral > 0 ? "加分" : '减分'
} < /span>]
},
{
prop: "changeIntegral",
label: "积分",
align: "center",
render: (h, {row}) => [
<span>{row.changeIntegral > 0 ? `+${row.changeIntegral}` : `${row.changeIntegral}`}</span>]
},
{prop: "doTime", label: "操作时间"},
{prop: "declareObjName", label: "操作人", align: "center"},
]
}
},
methods: {
selectPerson(val) {
if (val) {
this.form.residentId = val.id
this.personList = [{...val}]
} else {
this.form.residentId = ""
this.personList = []
}
},
onConfirm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.instance.post(`/app/appvillagerintegraldetail/changeIntegral`, {
...this.form,
changeIntegral: this.form.doType == 0 ? `+${this.form.changeIntegral}` : `-${this.form.changeIntegral}`
}).then(res => {
if (res.code == 0) {
this.$message.success("添加成功")
this.dialog = false
this.getList()
}
})
}
})
},
getList() {
this.instance.post(`/app/appvillagerintegraldetail/list`, null, {
params: {
...this.page,
areaId: this.areaId,
doType: 2
}
}).then(res => {
if (res?.data) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
}
},
created() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.scoreChange {
height: 100%;
overflow: auto;
}
</style>

View File

@@ -1,611 +0,0 @@
<template>
<section class="pointsDeclaration">
<ai-list isTabs>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-button type="primary" icon="iconfont iconAdd" @click="onAdd" v-if="$permissions('app_appvillagerintegraldeclare_edit')">代申诉</el-button>
<el-button icon="iconfont iconEdit" @click="batchAduit()" :disabled="!Boolean(selectionList.length)" v-if="$permissions('app_appvillagerintegraldeclare_edit')">批量审核</el-button>
<ai-select
v-model="search.status"
@change="page.current = 1, getList()"
placeholder="发布状态"
:selectList="dict.getDict('integralDeclareStatus')">
</ai-select>
<div class="times_div">
<p class="times">申诉时间</p>
<el-date-picker
v-model="search.declareTimeStart"
type="date"
size="small"
@change="page.current = 1,getList()"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="search.declareTimeEnd"
type="date"
size="small"
@change="page.current = 1,getList()"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束日期">
</el-date-picker>
</div>
</template>
<template slot="right">
<el-input
v-model="search.familyName"
class="search-input"
size="mini"
placeholder="申诉人/申诉对象/..."
clearable
v-throttle="() => {page.current = 1, getList()}"
@clear="page.current = 1, getList()"
suffix-icon="iconfont iconSearch" />
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList"
@selection-change="handleSelectionChange"
>
<el-table-column slot="selection" type="selection" width="55" :selectable="(row, index)=>{
if(row.status==0){
return true
}else{
return false
}
}"></el-table-column>
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<span
class="iconfont iconEdit icon-color89B"
v-if="row.status === '0'&&$permissions('app_appvillagerintegraldeclare_edit')"
title="编辑"
@click="toEdit(row)"
></span>
<span
class="iconfont iconShow icon-color89B"
v-if="row.status !== '0'&&$permissions('app_appvillagerintegraldeclare_detail')"
title="详情"
@click="toEdit(row)"
></span>
<!-- <span
class="iconfont iconDelete icon-color89B"
v-if="$permissions('app_appofficialdocumentinfo_del')"
title="删除"
@click="remove(row.id)"
></span> -->
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog
title="积分代申诉"
:visible.sync="dialog.visibleAdd"
:customFooter="true"
:destroyOnClose="true"
width="720px"
@close="init('ruleForm')"
>
<div class="form_div">
<el-form
ref="ruleForm"
:model="dialogInfo"
:rules="formRules"
size="small"
label-suffix=""
label-width="140px"
>
<el-form-item label="代申诉家庭" prop="users">
<ai-person-select :customClicker="true" :isMultiple="true" :chooseUserList.sync="dialogInfo.users" :instance="instance" url="/app/appvillagerintegralfamilymember/list" >
<template name="option" v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.name }}</span>
<ai-id mode="show" :show-eyes="false" :value="item.idNumber" />
</template>
</ai-person-select>
</el-form-item>
<el-form-item label="代申诉说明" prop="declareDescription">
<el-input type="textarea" :rows="3" placeholder="请输入…" maxlength="100" show-word-limit v-model="dialogInfo.declareDescription"></el-input>
</el-form-item>
<el-form-item label="照片" prop="fileList">
<div class="upload">
<ai-uploader :instance="instance" v-model="dialogInfo.fileList" :limit="9" ></ai-uploader>
</div>
</el-form-item>
</el-form>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visibleAdd=false" size="medium">取消</el-button>
<el-button @click="declare('ruleForm')" type="primary" size="medium">提交</el-button>
</div>
</ai-dialog>
<ai-dialog
title="申诉审核"
:visible.sync="dialog.visibleDetail"
:customFooter="true"
:destroyOnClose="true"
width="720px"
@close="init('rules')"
>
<div class="form_content" v-if="!isBatch">
<div class="form_flex form_info">
<div>
<span class="form_label">申诉人</span>
<span class="form_value">{{rowInfo.declareName}}</span>
</div>
<div>
<span class="form_label">申诉对象</span>
<span class="form_value">{{rowInfo.declareObjName}}</span>
</div>
<div>
<span class="form_label">户主</span>
<span class="form_value">{{rowInfo.familyName}}</span>
</div>
</div>
<div class="form_info">
<span class="form_label">申诉说明</span>
<span class="form_value">{{rowInfo.declareDescription}}</span>
</div>
<div class="form_info">
<span class="form_label">申诉时间</span>
<span class="form_value">{{rowInfo.declareTime}}</span>
</div>
<div class="form_info">
<span class="form_label">照片</span>
<span class="form_value">
<ai-uploader :disabled="true" :instance="instance" v-model="rowInfo.fileList" :limit="9" ></ai-uploader>
</span>
</div>
</div>
<div class="form_div">
<el-form
ref="rules"
:model="dialogDetail"
:rules="formRules"
size="small"
label-suffix=""
v-show="rowInfo.status==0"
label-width="90px"
>
<el-form-item label="类型" prop="doType">
<el-radio-group v-model="dialogDetail.doType" @change="changeDoType">
<el-radio label="1">加分</el-radio>
<el-radio label="0">扣分</el-radio>
<el-radio label="2">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="事项" prop="ruleId" v-if='dialogDetail.doType!=2'>
<el-select v-model="dialogDetail.ruleId" placeholder="请选择..." @change="ruleChange">
<el-option
v-for="(item,i) in rulesList"
:key="i"
:label="item.ruleName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="积分" prop="doIntegral" v-if='dialogDetail.doType!=2'>
<el-col :span="1.5" style="margin-right: 8px;">{{dialogDetail.doType==0? '减少' :'增加'}}</el-col>
<el-col :span="6" style="margin-right: 8px;width:120px;"><el-input type="number" v-model="dialogDetail.doIntegral" :placeholder="placeholder" :disabled="integralEdit"></el-input></el-col>
<el-col :span="1" style="margin-right: 8px;"></el-col>
</el-form-item>
<el-form-item label="备注说明">
<el-input type="textarea" :rows="3" maxlength="100" placeholder="请输入…" show-word-limit v-model="dialogDetail.remark"></el-input>
</el-form-item>
</el-form>
<ai-wrapper
label-width="70px"
v-if="rowInfo.status!=0"
:columnsNumber="1">
<ai-info-item label="类型:"><span :style="{color:colorList[rowInfo.status]}" >{{dict.getLabel('integralDeclareStatus', rowInfo.status)}}</span></ai-info-item>
<ai-info-item label="事项:" v-if='rowInfo.doType!=2'><span >{{rowInfo.ruleName}}</span></ai-info-item>
<ai-info-item label="积分:" v-if='rowInfo.doType!=2'>{{rowInfo.doType==0? '减少' :'增加'}}<span style="color:#2266FF">{{Math.abs(rowInfo.doIntegral)}}</span></ai-info-item>
<ai-info-item label="备注说明:"><span>{{rowInfo.remark||'-'}}</span></ai-info-item>
</ai-wrapper>
</div>
<div class="dialog-footer" slot="footer" v-if="rowInfo.status==0">
<el-button @click="dialog.visibleDetail=false" size="medium">取消</el-button>
<el-button @click="onConfirm('rules')" type="primary" size="medium">提交</el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from 'vuex';
export default {
name: "pointsAppeal",
props: {
instance: Function,
dict: Object,
bizType:String,
areaId:String
},
data() {
var integral = (rule, value, callback) => {
if (value) {
if (/^[1-9]\d*$/.test(value)) {
if(!this.integralEdit){
if(Number(value)>=this.sectionNum.min&&Number(value)<=this.sectionNum.max){
callback();
}else{
callback(new Error(`请输入${this.sectionNum.min}${this.sectionNum.max}之间的正整数积分`));
}
}else{
callback();
}
} else {
callback(new Error('请输入正整数'));
}
} else {
callback(new Error('请输入正整数'));
}
};
return {
search: {
status:'',
familyName:'',
declareTimeStart:null,
declareTimeEnd:null
},
page:{
current: 1,
size: 10,
total:0
},
colConfigs: [
{ slot: "selection", label: "", align: "center" },
{ prop: "declareName", label: "申诉人", align: "center" },
{ prop: "declareObjName", label: "申诉对象", align: "center",hide:this.bizType==1 },
{
prop: "familyName",
label: "户主",
},
{
prop: "declareDescription",
label: "申诉说明",
align: "left",
width:300
},
{
prop: "declareTime",
label: "申诉时间",
align: "left",
width:150
},
{
prop: "declareName",
label: "操作人",
align: "center",
},
{
prop: "status",
label: "状态",
align: "center",
render: (h, {row}) => {
return h('span', {style: {color: this.dict.getColor('integralDeclareStatus', row.status)}}, this.dict.getLabel('integralDeclareStatus', row.status))
},
},
{ slot: "options", label: "操作", align: "center" },
],
tableData: [],
dialog: {
visibleAdd: false,
visibleDetail: false,
title:'积分代申诉'
},
dialogInfo: {
users: [],
reportIds:[],
declareDescription: "",
fileList: [],
},
dialogDetail: {
doType: '1',
ruleId: '',
doIntegral: '',
remark: '',
aduitIds:[],
ruleName:''
},
isBatch:false,
rulesList:[],
rowInfo:{},
formRules: {
users: [{ required: true, message: "请选择人员", trigger: "change" },],
declareDescription: [{ required: true, message: "代申诉说明", trigger: "blur" }],
// fileList: [{ required: true, message: "请上传照片", trigger: "blur" },],
ruleId: [{ required: true, message: "请选择事项", trigger: "blur" }],
doIntegral: [{ required: true, validator: integral, trigger: "blur" }],
doType:[{ required: true, message: "请选择类型", trigger: "change" }]
},
selectionList:[],
integralEdit:false,
sectionNum:{
min:null,
max:null
},
placeholder:'请输入...'
};
},
computed:{
colorList(){
return {
'0':'#FF8822',
'1':'#2EA222',
'2':'#FF4466'
}
}
},
created() {
this.dict
.load([
'integralDeclareStatus',
'integralDeclareDoType'
]).then(() => {
this.getList();
});
},
methods: {
getList() {
this.instance.post(`/app/appvillagerintegraldeclare/list`, null, {
params: {
...this.search,
...this.page,
bizType:this.bizType,
areaId:this.areaId
},
})
.then((res) => {
if (res.code == 0) {
this.tableData = res.data.records;
this.page.total = res.data.total;
}
});
},
handleSelectionChange(val){
this.selectionList=val
this.dialogDetail.aduitIds=[];
val.forEach(e=>{
this.dialogDetail.aduitIds.push(e.id);
})
},
// getSelect(val){
// for(let e of val){
// this.dialogInfo.reportIds.push(e.id)
// }
// },
getColor(status){
return this.dict.getColor('integralDeclareStatus', status)
},
onChange(val){
},
declare(formName){
this.dialogInfo.reportIds=[];
for(let e of this.dialogInfo.users){
this.dialogInfo.reportIds.push(e.id)
};
this.$refs[formName].validate((valid) => {
if (valid) {
this.instance.post("/app/appvillagerintegraldeclare/addOrUpdate", {
...this.dialogInfo,
bizType:this.bizType
}, null).then(res => {
if (res.code==0) {
this.dialog.visibleAdd=false;
this.getList();
}
})
} else {
return false;
}
});
},
init(formName){
this.$refs[formName].clearValidate();
this.dialogDetail = {
doType: '1',
ruleId: '',
doIntegral: '',
remark: '',
aduitIds:[],
ruleName:''
}
this.dialogInfo= {
users: [],
reportIds:[],
declareDescription: "",
fileList: [],
};
this.rulesList = [];
},
//批量审核
batchAduit(){
this.isBatch=true;
this.rowInfo.status=0;
this.dialog.visibleDetail = true;
this.getRules('1')
},
getRowDetail(row){
this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById`, null, {
params: {
id:row.id
},
}).then((res) => {
if (res.code == 0) {
this.rowInfo = {...res.data}
this.dialog.visibleDetail = true;
this.dialogDetail.aduitIds=[];
this.dialogDetail.aduitIds.push(row.id);
}
});
},
toEdit(row) {
this.isBatch=false;
this.getRowDetail(row);
this.getRules('1')
},
changeDoType(val){
this.dialogDetail.ruleId="";
this.dialogDetail.ruleName = "";
this.dialogDetail.doIntegral = "";
this.placeholder = '请输入...';
this.$refs.rules.clearValidate();
this.getRules(val)
},
ruleChange(val){
let item = this.rulesList.find(e => e.id == val);
this.dialogDetail.doIntegral='';
this.$refs.rules.clearValidate();
if(item){
//固定区间
this.dialogDetail.ruleName = item.ruleName;
if(item.integralValueType==0){
this.dialogDetail.doIntegral = Math.abs(item.integral);
this.integralEdit = true;
}else{
this.integralEdit = false;
if(Math.abs(item.integralEnd)>Math.abs(item.integralStart)){
this.sectionNum.min = Math.abs(item.integralStart);
this.sectionNum.max = Math.abs(item.integralEnd);
}else{
this.sectionNum.max = Math.abs(item.integralStart);
this.sectionNum.min = Math.abs(item.integralEnd);
}
this.placeholder = `${this.sectionNum.min}~${this.sectionNum.max}`
}
}
},
//事项查询
getRules(integralType){
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
params: {
integralType,
size:10000000
},
}).then((res) => {
if (res.code == 0) {
this.rulesList = res.data.records.filter(e=> e.ruleStatus == 1);
}
});
},
remove(id) {
this.$confirm("确定删除该公文及其相关的流转信息?").then(() => {
this.instance
.post(`/app/appofficialdocumentinfo/delete?ids=${id}`)
.then((res) => {
if (res.code == 0) {
this.$message.success("删除成功!");
this.getList();
}
});
});
},
onReset() {
Object.keys(this.search).forEach(e => {
this.search[e] = "";
});
this.search.declareTimeStart = null;
this.search.declareTimeEnd = null;
this.getList();
},
onAdd() {
this.dialog.visibleAdd = true;
},
onConfirm(formName) {
this.$refs[formName].validate(v =>{
if(v){
this.instance.post("/app/appvillagerintegraldeclare/aduit", {
...this.dialogDetail,
}, null).then(res => {
if (res.code==0) {
this.dialog.visibleDetail=false;
this.$message.success("提交成功!");
this.dialogDetail.aduitIds=[];
this.getList();
}
})
}else{
return false
}
})
},
},
};
</script>
<style lang="scss">
.pointsDeclaration {
height: 100%;
overflow: auto;
background: #f3f6f9;
.times_div{
display: flex;
align-items: center;
.times{
display: block;
width: 72px;
height: 30px;
line-height: 30px;
text-align: center;
background: #F5F5F5;
border-radius: 2px 0px 0px 2px;
border: 1px solid #D0D4DC;
font-size: 14px;
color:#666666;
}
}
.form_content{
border-bottom:1px solid #eee;
.form_flex{
display: flex;
div{
flex: 1;
}
}
.form_info{
margin-bottom: 8px;
}
.form_label{
display: inline-block;
color: #999;
vertical-align: top;
}
.form_value{
display: inline-block;
color: #333;
width: calc(100% - 80px);
}
}
.form_div{
padding-top:24px;
}
.status-0 {
color: #ff8822;
}
.status-1 {
color: #2266ff;
}
.status-2 {
color: #999999;
}
}
</style>

View File

@@ -1,603 +0,0 @@
<template>
<section class="pointsDeclaration">
<ai-list isTabs>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-button type="primary" icon="iconfont iconAdd" @click="onAdd" v-if="$permissions('app_appvillagerintegraldeclare_edit')">代申报</el-button>
<el-button icon="iconfont iconEdit" @click="batchAduit()" :disabled="!Boolean(selectionList.length)"v-if="$permissions('app_appvillagerintegraldeclare_edit')">批量审核</el-button>
<ai-select
v-model="search.status"
@change="page.current = 1, getList()"
placeholder="发布状态"
:selectList="dict.getDict('integralDeclareStatus')">
</ai-select>
<div class="times_div">
<p class="times">申报时间</p>
<el-date-picker
v-model="search.declareTimeStart"
type="date"
size="small"
@change="page.current = 1,getList()"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始日期">
</el-date-picker>
<el-date-picker
v-model="search.declareTimeEnd"
type="date"
size="small"
@change="page.current = 1,getList()"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束日期">
</el-date-picker>
</div>
</template>
<template slot="right">
<el-input
v-model="search.familyName"
class="search-input"
size="mini"
placeholder="申诉人/申诉对象/..."
clearable
v-throttle="() => {page.current = 1, getList()}"
@clear="page.current = 1, getList()"
suffix-icon="iconfont iconSearch" />
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList"
@selection-change="handleSelectionChange">
<el-table-column slot="selection" type="selection" width="55" :selectable="(row, index)=>{
if(row.status==0){
return true
}else{
return false
}
}"></el-table-column>
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button
type="text"
:disabled="row.status === '0' || $permissions('app_appvillagerintegraldeclare_edit')"
title="编辑"
@click="toEdit(row)">
编辑
</el-button>
<el-button
type="text"
:disabled="$permissions('app_appvillagerintegraldeclare_detail')"
title="详情"
@click="toEdit(row)">
详情
</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog
title="积分代申报"
:visible.sync="dialog.visibleAdd"
:customFooter="true"
:destroyOnClose="true"
width="720px"
@close="init('ruleForm')">
<div class="form_div">
<el-form
ref="ruleForm"
:model="dialogInfo"
:rules="formRules"
size="small"
label-suffix=""
label-width="140px">
<el-form-item label="代申报家庭" prop="users">
<ai-person-select :customClicker="true" :isMultiple="true" :chooseUserList.sync="dialogInfo.users" :instance="instance" url="/app/appvillagerintegralfamilymember/list" >
<template name="option" v-slot:option="{ item }">
<span class="iconfont iconProlife">{{ item.name }}</span>
<ai-id mode="show" :show-eyes="false" :value="item.idNumber" />
</template>
</ai-person-select>
</el-form-item>
<el-form-item label="代申报说明" prop="declareDescription">
<el-input type="textarea" :rows="3" placeholder="请输入…" maxlength="100" show-word-limit v-model="dialogInfo.declareDescription"></el-input>
</el-form-item>
<el-form-item label="照片" prop="fileList">
<div class="upload">
<ai-uploader :instance="instance" v-model="dialogInfo.fileList" :limit="9" ></ai-uploader>
</div>
</el-form-item>
</el-form>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visibleAdd=false" size="medium">取消</el-button>
<el-button @click="declare('ruleForm')" type="primary" size="medium">提交</el-button>
</div>
</ai-dialog>
<ai-dialog
title="申报审核"
:visible.sync="dialog.visibleDetail"
:customFooter="true"
:destroyOnClose="true"
width="720px"
@close="init('rules')">
<div class="form_content" v-if="!isBatch">
<div class="form_flex form_info">
<div>
<span class="form_label">申报人</span>
<span class="form_value">{{rowInfo.declareName}}</span>
</div>
<div>
<span class="form_label">申报对象</span>
<span class="form_value">{{rowInfo.declareObjName}}</span>
</div>
<div>
<span class="form_label">户主</span>
<span class="form_value">{{rowInfo.familyName}}</span>
</div>
</div>
<div class="form_info">
<span class="form_label">申报说明</span>
<span class="form_value">{{rowInfo.declareDescription}}</span>
</div>
<div class="form_info">
<span class="form_label">申报时间</span>
<span class="form_value">{{rowInfo.declareTime}}</span>
</div>
<div class="form_info">
<span class="form_label">照片</span>
<span class="form_value">
<ai-uploader :disabled="true" :instance="instance" v-model="rowInfo.fileList" :limit="9" ></ai-uploader>
</span>
</div>
</div>
<div class="form_div">
<el-form
ref="rules"
:model="dialogDetail"
:rules="formRules"
size="small"
label-suffix=""
v-show="rowInfo.status==0"
label-width="90px"
>
<el-form-item label="类型" prop="doType">
<el-radio-group v-model="dialogDetail.doType" @change="changeDoType">
<el-radio label="1">加分</el-radio>
<el-radio label="0">扣分</el-radio>
<el-radio label="2">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="事项" prop="ruleId" v-if='dialogDetail.doType!=2'>
<el-select v-model="dialogDetail.ruleId" placeholder="请选择..." @change="ruleChange">
<el-option
v-for="(item,i) in rulesList"
:key="i"
:label="item.ruleName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="积分" prop="doIntegral" v-if='dialogDetail.doType!=2'>
<el-col :span="1.5" style="margin-right: 8px;">{{dialogDetail.doType==0? '减少' :'增加'}}</el-col>
<el-col :span="6" style="margin-right: 8px;width:120px;"><el-input type="number" v-model="dialogDetail.doIntegral" :placeholder="placeholder" :disabled="integralEdit"></el-input></el-col>
<el-col :span="1" style="margin-right: 8px;"></el-col>
</el-form-item>
<el-form-item label="备注说明">
<el-input type="textarea" :rows="3" maxlength="100" placeholder="请输入…" show-word-limit v-model="dialogDetail.remark"></el-input>
</el-form-item>
</el-form>
<ai-wrapper
label-width="70px"
v-if="rowInfo.status!=0"
:columnsNumber="1">
<ai-info-item label="类型:"><span :style="{color:colorList[rowInfo.status]}" >{{dict.getLabel('integralDeclareStatus', rowInfo.status)}}</span></ai-info-item>
<ai-info-item label="事项:" v-if='rowInfo.doType!=2'><span >{{rowInfo.ruleName}}</span></ai-info-item>
<ai-info-item label="积分:" v-if='rowInfo.doType!=2'>{{rowInfo.doType==0? '减少' :'增加'}}<span style="color:#2266FF">{{Math.abs(rowInfo.doIntegral)}}</span></ai-info-item>
<ai-info-item label="备注说明:"><span>{{rowInfo.remark||'-'}}</span></ai-info-item>
</ai-wrapper>
</div>
<div class="dialog-footer" slot="footer" v-if="rowInfo.status==0">
<el-button @click="dialog.visibleDetail=false" size="medium">取消</el-button>
<el-button @click="onConfirm('rules')" type="primary" size="medium">提交</el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from 'vuex';
export default {
name: "pointsDeclaration",
props: {
instance: Function,
dict: Object,
bizType:String,
areaId:String
},
data() {
var integral = (rule, value, callback) => {
if (value) {
if (/^[1-9]\d*$/.test(value)) {
if(!this.integralEdit){
if(Number(value)>=this.sectionNum.min&&Number(value)<=this.sectionNum.max){
callback();
}else{
callback(new Error(`请输入${this.sectionNum.min}${this.sectionNum.max}之间的正整数积分`));
}
}else{
callback();
}
} else {
callback(new Error('请输入正整数'));
}
} else {
callback(new Error('请输入正整数'));
}
};
return {
search: {
status:'',
familyName:'',
declareTimeStart:null,
declareTimeEnd:null
},
page:{
current: 1,
size: 10,
total:0
},
colConfigs: [
{ slot: "selection", label: "" },
{ prop: "declareName", label: "申报人", align: "center" },
{ prop: "declareObjName", label: "申报对象", align: "center",hide:this.bizType==1 },
{
prop: "familyName",
label: "户主",
},
{
prop: "declareDescription",
label: "申诉说明",
align: "left",
width:300
},
{
prop: "declareTime",
label: "申报时间",
align: "left",
width:150
},
{
prop: "declareName",
label: "操作人",
align: "center",
},
{
prop: "status",
label: "状态",
align: "center",
render: (h, {row}) => {
return h('span', {style: {color: this.dict.getColor('integralDeclareStatus', row.status)}}, this.dict.getLabel('integralDeclareStatus', row.status))
},
},
{ slot: "options", label: "操作", align: "center" },
],
tableData: [],
dialog: {
visibleAdd: false,
visibleDetail: false,
title:'积分代申报'
},
dialogInfo: {
users: [],
reportIds:[],
declareDescription: "",
fileList: [],
},
dialogDetail: {
doType: '1',
ruleId: '',
doIntegral: '',
remark: '',
aduitIds:[],
ruleName:''
},
isBatch:false,
rulesList:[],
rowInfo:{},
formRules: {
users: [{ required: true, message: "请选择人员", trigger: "change" },],
declareDescription: [{ required: true, message: "代申报说明", trigger: "blur" }],
// fileList: [{ required: true, message: "请上传照片", trigger: "blur" },],
ruleId: [{ required: true, message: "请选择事项", trigger: "blur" }],
doIntegral: [{ required: true, validator: integral, trigger: "blur" }],
doType:[{ required: true, message: "请选择类型", trigger: "change" }]
},
selectionList:[],
integralEdit:false,
sectionNum:{
min:null,
max:null
},
placeholder:'请输入...'
};
},
computed:{
colorList(){
return {
'0':'#FF8822',
'1':'#2EA222',
'2':'#FF4466'
}
}
},
created() {
this.dict
.load([
'integralDeclareStatus',
'integralDeclareDoType'
]).then(() => {
this.getList();
});
},
methods: {
getList() {
this.instance.post(`/app/appvillagerintegraldeclare/list`, null, {
params: {
...this.search,
...this.page,
bizType:this.bizType,
areaId:this.areaId
},
})
.then((res) => {
if (res.code == 0) {
this.tableData = res.data.records;
this.page.total = res.data.total;
}
});
},
handleSelectionChange(val){
this.selectionList=val
this.dialogDetail.aduitIds=[];
val.forEach(e=>{
this.dialogDetail.aduitIds.push(e.id);
})
},
// getSelect(val){
// for(let e of val){
// this.dialogInfo.reportIds.push(e.id)
// }
// },
getColor(status){
return this.dict.getColor('integralDeclareStatus', status)
},
onChange(val){
},
declare(formName){
this.dialogInfo.reportIds=[];
for(let e of this.dialogInfo.users){
this.dialogInfo.reportIds.push(e.id)
};
this.$refs[formName].validate((valid) => {
if (valid) {
this.instance.post("/app/appvillagerintegraldeclare/addOrUpdate", {
...this.dialogInfo,
bizType:this.bizType
}, null).then(res => {
if (res.code==0) {
this.dialog.visibleAdd=false;
this.getList();
}
})
} else {
return false;
}
});
},
init(formName){
this.$refs[formName].clearValidate();
this.dialogDetail = {
doType: '1',
ruleId: '',
doIntegral: '',
remark: '',
aduitIds:[],
ruleName:''
}
this.dialogInfo= {
users: [],
reportIds:[],
declareDescription: "",
fileList: [],
};
this.rulesList = [];
},
//批量审核
batchAduit(){
this.isBatch=true;
this.rowInfo.status=0;
this.dialog.visibleDetail = true;
this.getRules('1')
},
getRowDetail(row){
this.instance.post(`/app/appvillagerintegraldeclare/queryDetailById`, null, {
params: {
id:row.id
},
}).then((res) => {
if (res.code == 0) {
this.rowInfo = {...res.data}
this.dialog.visibleDetail = true;
this.dialogDetail.aduitIds=[];
this.dialogDetail.aduitIds.push(row.id);
}
});
},
toEdit(row) {
this.isBatch=false;
this.getRowDetail(row);
this.getRules('1')
},
changeDoType(val){
this.dialogDetail.ruleId="";
this.dialogDetail.ruleName = "";
this.dialogDetail.doIntegral = "";
this.placeholder = '请输入...';
this.$refs.rules.clearValidate();
this.getRules(val)
},
ruleChange(val){
let item = this.rulesList.find(e => e.id == val);
this.dialogDetail.doIntegral='';
this.$refs.rules.clearValidate();
if(item){
//固定区间
this.dialogDetail.ruleName = item.ruleName;
if(item.integralValueType==0){
this.dialogDetail.doIntegral = Math.abs(item.integral);
this.integralEdit = true;
}else{
this.integralEdit = false;
if(Math.abs(item.integralEnd)>Math.abs(item.integralStart)){
this.sectionNum.min = Math.abs(item.integralStart);
this.sectionNum.max = Math.abs(item.integralEnd);
}else{
this.sectionNum.max = Math.abs(item.integralStart);
this.sectionNum.min = Math.abs(item.integralEnd);
}
this.placeholder = `${this.sectionNum.min}~${this.sectionNum.max}`
}
}
},
//事项查询
getRules(integralType){
this.instance.post(`/app/appvillagerintegralrule/list`, null, {
params: {
integralType,
size:10000000
},
}).then((res) => {
if (res.code == 0) {
this.rulesList = res.data.records.filter(e=> e.ruleStatus == 1);
}
});
},
remove(id) {
this.$confirm("确定删除该公文及其相关的流转信息?").then(() => {
this.instance
.post(`/app/appofficialdocumentinfo/delete?ids=${id}`)
.then((res) => {
if (res.code == 0) {
this.$message.success("删除成功!");
this.getList();
}
});
});
},
onReset() {
Object.keys(this.search).forEach(e => {
this.search[e] = "";
});
this.search.declareTimeStart = null;
this.search.declareTimeEnd = null;
this.getList();
},
onAdd() {
this.dialog.visibleAdd = true;
},
onConfirm(formName) {
this.$refs[formName].validate(v =>{
if(v){
this.instance.post("/app/appvillagerintegraldeclare/aduit", {
...this.dialogDetail,
}, null).then(res => {
if (res.code==0) {
this.dialog.visibleDetail=false;
this.$message.success("提交成功!");
this.dialogDetail.aduitIds=[];
this.getList();
}
})
}else{
return false
}
})
},
},
};
</script>
<style lang="scss">
.pointsDeclaration {
height: 100%;
overflow: auto;
background: #f3f6f9;
.times_div{
.times{
display: block;
width: 72px;
height: 30px;
line-height: 30px;
text-align: center;
background: #F5F5F5;
border-radius: 2px 0px 0px 2px;
border: 1px solid #D0D4DC;
font-size: 14px;
color:#666666;
}
}
.form_content{
border-bottom:1px solid #eee;
.form_flex{
display: flex;
div{
flex: 1;
}
}
.form_info{
margin-bottom: 8px;
}
.form_label{
display: inline-block;
color: #999;
vertical-align: top;
}
.form_value{
display: inline-block;
color: #333;
width: calc(100% - 80px);
}
}
.form_div{
padding-top:24px;
}
.status-0 {
color: #ff8822;
}
.status-1 {
color: #2266ff;
}
.status-2 {
color: #999999;
}
}
</style>

View File

@@ -1,265 +0,0 @@
<template>
<section class="pointsDetails">
<ai-list isTabs>
<template slot="content">
<ai-search-bar bottomBorder>
<template slot="left">
<el-date-picker size="small" v-model="searchDotime" type="daterange" range-separator="至" @change="timeChange"
start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</template>
<template slot="right">
<el-input
v-model="search.familyName"
class="search-input"
size="small"
placeholder="对象、户主、事件类型"
clearable
v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, getList()"
suffix-icon="iconfont iconSearch" />
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
ref="aitableex"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="changeIntegral" label="积分" align= "center">
<template slot-scope="{ row }">
<span>{{row.changeIntegral > 0 ? '+' : ''}}{{row.changeIntegral}}</span>
</template>
</el-table-column>
<el-table-column slot="doType" label="类型" align= "center">
<template slot-scope="{ row }">
<span>{{ dict.getLabel('integralDetailType', row.bizType) }}</span>
</template>
</el-table-column>
<el-table-column slot="options" label="操作" align="center" fixed="right" width="120">
<template slot-scope="{ row }">
<el-button
type="text"
title="详情"
:disabled="!$permissions('app_appvillagerintegraldetail_detail')"
@click="viewItem(row)">
详情
</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog
title="详情"
:visible.sync="dialog.visible"
:customFooter="true"
:destroyOnClose="true"
width="720px"
>
<div class="form_content">
<div class="form_info">
<span class="form_label">户主</span>
<span class="form_value">{{dialogInfo.familyName}}</span>
</div>
<div class="form_info">
<span class="form_label">事项</span>
<span class="form_value">{{dialogInfo.ruleName}}</span>
</div>
<div class="form_flex form_info">
<div>
<span class="form_label">积分</span>
<span class="form_value">{{dialogInfo.changeIntegral >= 0 ? '增加' : '减少'}}<span style="color:#2266FF">{{Math.abs(dialogInfo.changeIntegral)}}</span></span>
</div>
</div>
</div>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog.visible=false" size="medium">关闭</el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
export default {
name: "pointsDeclaration",
props: {
instance: Function,
dict: Object,
areaId:String
},
data() {
return {
searchDotime: [],
search: {
current: 1,
size: 10,
familyName: '',
doTimeStart: null,
doTimeEnd: null
},
total: 10,
colConfigs: [
{ prop: "residentName", label: "对象", width:160 },
{ prop: "familyName", label: "户主", align: "center", width:160 },
{
prop: "ruleName",
label: "事件类型",
"show-overflow-tooltip": true,
width:420
},
{
prop: "doTime",
label: "时间",
width:200
},
// {
// prop: "doType",
// label: "类型",
// align: "center",
// width: 100,
// render: (h, params) => {
// return h(
// "span",
// {
// class: "status-" + params.row.doType,
// },
// this.$dict.getLabel("integralIntegralType", params.row.doType)
// );
// },
// },
{ slot: "doType", label: "类型", width: 100},
{ slot: "changeIntegral", label: "积分", width: 100},
// {
// prop: "bizType",
// label: "途径",
// align: "center",
// width: 100,
// formart: (bizType) =>
// this.$dict.getLabel("integralDetailBizType", bizType) || '-',
// },
{ slot: "options", label: "操作", align: "center" },
],
tableData: [],
dialog: {
visible: false,
},
dialogInfo: {},
};
},
mounted() {
this.$dict
.load([
"integralDeclareDoType",
"integralDetailType",
])
.then(() => {
this.getList();
});
},
methods: {
getList() {
this.instance
.post(`/app/appvillagerintegraldetail/list`, null, {
params: {
...this.search,
areaId: this.areaId,
},
})
.then((res) => {
if (res.code == 0) {
this.tableData = res.data.records;
this.total = res.data.total;
}
});
},
timeChange() {
if(this.searchDotime) {
this.search.doTimeStart = this.searchDotime[0]
this.search.doTimeEnd = this.searchDotime[1]
}else {
this.search.doTimeStart = null
this.search.doTimeEnd = null
}
this.search.current = 1
this.getList()
},
viewItem(row) {
this.dialog.visible = true
this.instance.post(`/app/appvillagerintegraldetail/queryDetailById?id=${row.id}`, null, {}).then((res) => {
if (res.code == 0) {
this.dialogInfo = res.data
console.log(this.dialogInfo)
}
});
},
onReset() {
this.search.current = 1
this.search.doTimeStart = null
this.search.doTimeEnd = null
this.search.familyName = ''
this.searchDotime = []
this.getList();
},
},
};
</script>
<style lang="scss">
.pointsDetails {
height: 100%;
background: #f3f6f9;
overflow: auto;
.form_content {
.form_flex {
display: flex;
div {
flex: 1;
}
}
.form_info {
margin-bottom: 8px;
}
.form_label {
display: inline-block;
color: #999;
vertical-align: top;
width: 70px;
text-align: right;
}
.form_value {
display: inline-block;
color: #333;
width: calc(100% - 70px);
// img {
// width: 100px;
// height: 100px;
// margin: 0 8px 8px 0;
// }
}
}
.form_div {
padding-top: 24px;
border-top: 1px solid #eee;
}
.status-0 {
color: #FF4466;
}
.status-1 {
color: #2EA222;
}
.status-2 {
color: #999999;
}
}
</style>