This commit is contained in:
yanran200730
2022-08-11 10:31:48 +08:00
4 changed files with 85 additions and 142 deletions

View File

@@ -17,7 +17,7 @@
</div> </div>
</div> </div>
</el-row> </el-row>
<el-row class="echertsBox" style="margin-bottom: 16px"> <!-- <el-row class="echertsBox" style="margin-bottom: 16px">
<div class="title"> <div class="title">
<h4>事件汇总</h4> <h4>事件汇总</h4>
<div class="timecSelect"> <div class="timecSelect">
@@ -28,13 +28,13 @@
<div id="chartDom" style="height: 230px; width: 100%;"></div> <div id="chartDom" style="height: 230px; width: 100%;"></div>
<ai-empty v-if="false" style="height: 230px;"></ai-empty> <ai-empty v-if="false" style="height: 230px;"></ai-empty>
</div> </div>
</el-row> </el-row> -->
<ai-card> <ai-card>
<ai-title slot="title" title="余额变动明细"/> <ai-title slot="title" title="余额变动明细"/>
<template #content> <template #content>
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<ai-select v-model="type" placeholder="请选择类型" @change="page.current=1,getIntegralChange()" <ai-select v-model="search.type" placeholder="请选择类型" @change="page.current=1,getIntegralChange()"
:selectList="dict.getDict('integralDetailType')"/> :selectList="dict.getDict('integralDetailType')"/>
</template> </template>
<template #right> <template #right>
@@ -63,6 +63,7 @@ export default {
search: { search: {
name: '', name: '',
girdId: '', girdId: '',
type: '',
}, },
page: { page: {
current: 1, current: 1,
@@ -74,7 +75,7 @@ export default {
data: {}, data: {},
startTime: '', startTime: '',
endTime: '', endTime: '',
type: '',
} }
}, },
props: { props: {
@@ -94,7 +95,9 @@ export default {
return [ return [
{ prop: "doTime", label: '时间', align: "left", width: "200px" }, { prop: "doTime", label: '时间', align: "left", width: "200px" },
{ prop: "integralType", label: '类型', align: "center", width: "180px", dict:"integralDetailType"}, { prop: "integralType", label: '类型', align: "center", width: "180px", dict:"integralDetailType"},
{ prop: "changeIntegral", label: '变动积分', align: "center",width: "200px" }, { prop: "changeIntegral", label: '变动积分', align: "center",width: "200px",render: (h, { row }) => {
return h('span', {}, `${row.integralCalcType == 1 ? '+' : '-'}${row.changeIntegral}`)
}},
{ prop: "nowIntegral", label: '剩余积分', align: "center",width: "200px" }, { prop: "nowIntegral", label: '剩余积分', align: "center",width: "200px" },
{ prop: "eventDesc", label: '事件', align: "center", }, { prop: "eventDesc", label: '事件', align: "center", },
] ]
@@ -119,14 +122,14 @@ export default {
}) })
}, },
// 事件汇总暂定 // 事件汇总 暂定
// 余额变动明细 // 余额变动明细
getIntegralChange() { getIntegralChange() {
this.instance.post(`/app/appintegraluser/getChangeDetail`, null, { this.instance.post(`/app/appintegraluser/getChangeDetail`, null, {
params: { params: {
...this.page, ...this.page,
type: this.type, //积分类型 type: this.search.type, //积分类型
id: this.$route.query.id, id: this.$route.query.id,
} }
}).then(res => { }).then(res => {
@@ -216,7 +219,7 @@ export default {
}, },
mounted() { mounted() {
this.getColEcherts() // this.getColEcherts()
}, },
destroyed () { destroyed () {

View File

@@ -20,6 +20,21 @@
</ai-search-bar> </ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict"> @getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="integral" label="积分余额" align="center" :sortable="'custom'">
<template slot-scope="{ row }">
<span>{{ row.integral }}</span>
</template>
</el-table-column>
<el-table-column slot="totalIntegral" label="累计积分" align="center" :sortable="'custom'">
<template slot-scope="{ row }">
<span>{{ row.totalIntegral }}</span>
</template>
</el-table-column>
<el-table-column slot="usedIntegral" label="已用积分" align="center" :sortable="'custom'">
<template slot-scope="{ row }">
<span>{{ row.usedIntegral }}</span>
</template>
</el-table-column>
<el-table-column slot="options" label="操作" align="center"> <el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="dialog = true">调整积分</el-button> <el-button type="text" @click="dialog = true">调整积分</el-button>
@@ -52,7 +67,7 @@
maxlength="100"></el-input> maxlength="100"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上传凭证"> <el-form-item label="上传凭证">
<ai-uploader :instance="instance" fileType="file" v-model="form.enclosure" :limit="1"></ai-uploader> <ai-uploader :instance="instance" fileType="file" v-model="form.file" :limit="1"></ai-uploader>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="integralCalcType"> <el-form-item label="类型" prop="integralCalcType">
<ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/> <ai-select v-model="form.integralCalcType" :selectList="dict.getDict('integralCalcType')"/>
@@ -89,9 +104,10 @@ export default {
form: { form: {
ids: [], ids: [],
eventDesc: "", eventDesc: "",
enclosure: [], // 附件 enclosure: "", // 附件
integralCalcType: "", integralCalcType: "",
integral: 0, integral: 0,
file: [],
}, },
personList: [], personList: [],
dialog: false, dialog: false,
@@ -109,18 +125,15 @@ export default {
this.getTableData() this.getTableData()
this.getGridList() this.getGridList()
}, },
watch: {
gridChange() {}
},
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
colConfigs() { colConfigs() {
return [ return [
{ prop: "userName", label: '姓名', align: "left", }, { prop: "userName", label: '姓名', align: "left", },
{ prop: "girdName", label: '所属网格', align: "center", }, { prop: "girdName", label: '所属网格', align: "center", },
{ prop: "integral", label: '积分余额', align: "center", }, { slot: "integral", label: '积分余额', align: "center", },
{ prop: "totalIntegral", label: '累计积分', align: "center", }, { slot: "totalIntegral", label: '累计积分', align: "center", },
{ prop: "usedIntegral", label: '已用积分', align: "center", }, { slot: "usedIntegral", label: '已用积分', align: "center", },
{ slot: "options" }, { slot: "options" },
] ]
}, },
@@ -142,6 +155,7 @@ export default {
} }
}).then(res => { }).then(res => {
if(res?.data) { if(res?.data) {
console.log(res.data.records);
this.tableData = res.data.records this.tableData = res.data.records
this.page.total = res.data.total this.page.total = res.data.total
} }
@@ -195,17 +209,22 @@ export default {
}, },
onConfirm() { onConfirm() {
if(this.form.file?.length) {
this.form.enclosure = this.form.file[0].url
}
this.instance.post(`/app/appintegraluser/changeIntegral`,{ this.instance.post(`/app/appintegraluser/changeIntegral`,{
ids: this.form.ids, ids: this.form.ids,
eventDesc: this.form.eventDesc, eventDesc: this.form.eventDesc,
enclosure: this.form.enclosure?.[0].url, // 附件 enclosure: this.form.enclosure, // 附件
integralCalcType: this.form.integralCalcType, integralCalcType: this.form.integralCalcType,
integral: this.form.integral, integral: this.form.integral,
}).then(res => { }).then(res => {
if(res.code == 0) { if(res.code == 0) {
this.$message.success('调整积分成功') this.$message.success('调整积分成功')
this.getTableData() setTimeout(() =>{
this.dialog = false this.getTableData()
this.dialog = false
})
} }
}) })
}, },

View File

@@ -325,7 +325,7 @@ export default {
color: "#5087ec", color: "#5087ec",
label: { label: {
show: true, //开启显示 show: true, //开启显示
position: 'right', //在方显示 position: 'right', //在方显示
textStyle: { textStyle: {
fontSize: 13, fontSize: 13,
color: '#666' color: '#666'
@@ -397,7 +397,11 @@ export default {
}, },
getDetail(id) { getDetail(id) {
this.instance.post(`/app/appintegraldetail/queryDetailById?id=${id}`).then(res=> {
if(res?.data) {
console.log(res.data);
}
})
}, },
selectDete() { selectDete() {

View File

@@ -19,68 +19,34 @@
<ai-select placeholder="民族" v-model="search.nation" <ai-select placeholder="民族" v-model="search.nation"
:selectList="resident.dict.getDict('nation')" :selectList="resident.dict.getDict('nation')"
@change="page.current=1,refreshTable()"/> @change="page.current=1,refreshTable()"/>
<el-date-picker <ai-search label="出生日期">
value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker
v-model="search.birthStart" value-format="yyyy-MM-dd HH:mm:ss"
style="width:250px;border-radius:0;" v-model="search.birthStart"
type="date" type="date"
size="small" size="small"
unlink-panels placeholder="选择开始日期"
placeholder="选择出生开始日期" @change="page.current=1,refreshTable()"
@change="page.current=1,refreshTable()" />
/> <el-date-picker
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" v-model="search.birthEnd"
v-model="search.birthEnd" type="date"
style="width:250px;border-radius:0;" size="small"
type="date" placeholder="选择结束日期"
size="small" @change="page.current=1,refreshTable()"
placeholder="选择出生结束日期" />
unlink-panels </ai-search>
@change="page.current=1,refreshTable()"
/> <ai-select placeholder="政治面貌" v-model="search.politicsStatus"
<el-select :selectList="resident.dict.getDict('politicsStatus')"
v-model="search.politicsStatus" @change="page.current=1,refreshTable()"/>
placeholder="政治面貌" <ai-select placeholder="是否户主" v-model="search.householdName"
size="small" :selectList="resident.dict.getDict('householdName')"
@change="page.current=1,refreshTable()" @change="page.current=1,refreshTable()"/>
clearable <ai-select placeholder="宗教信仰" v-model="search.faithType"
> :selectList="resident.dict.getDict('faithType')"
<el-option @change="page.current=1,refreshTable()"/>
v-for="(item,i) in resident.dict.getDict('politicsStatus')"
:key="i"
:label="item.dictName"
:value="item.dictValue"
></el-option>
</el-select>
<el-select
v-model="search.householdName"
placeholder="是否户主"
size="small"
@change="page.current=1,refreshTable()"
clearable
>
<el-option
v-for="(item,i) in resident.dict.getDict('householdName')"
:key="i"
:label="item.dictName"
:value="item.dictValue"
></el-option>
</el-select>
<el-select
v-model="search.faithType"
placeholder="宗教信仰"
@change="page.current=1,refreshTable()"
size="small"
clearable
>
<el-option
v-for="(item,i) in resident.dict.getDict('faithType')"
:key="i"
:label="item.dictName"
:value="item.dictValue"
></el-option>
</el-select>
</template> </template>
<template #right> <template #right>
<el-input <el-input
@@ -232,30 +198,6 @@ export default {
}; };
}, },
methods: { methods: {
handleClick() {
this.tableData = [];
this.multipleSelection = [];
this.searchInit()
},
searchInit() {
let tempAreaId = this.search.areaId;
this.search = {
fileStatus: "",
sex: "",
nation: "",
education: "",
politicsStatus: "",
birth: [],
faithType: "",
householdName: "",
areaId: "",
con: "",
maritalStatus: ""
};
this.search.areaId = tempAreaId;
this.page = {current: 1, size: 10, total: 0};
this.refreshTable()
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.deleteIds = []; this.deleteIds = [];
this.multipleSelection = val; this.multipleSelection = val;
@@ -263,41 +205,6 @@ export default {
this.deleteIds.push(e.id); this.deleteIds.push(e.id);
}); });
}, },
exportrExcle() {
if (this.deleteIds.length == 0) {
if (this.search.birth) {
this.search.birth = this.search.birth.join(",");
}
this.resident.instance
.post(`/app/appresident/exportAll`, null, {
params: {
...this.search,
...this.page
}
})
.then(res => {
if (res && res.code == 0) {
this.$message.success(res.data);
if (typeof this.search.birth == "string") {
this.search.birth = this.search.birth.split(",");
}
}
});
} else {
this.resident.instance.post(`/app/appresident/exportByIds`, {
ids: this.deleteIds,
areaId: this.user.info.areaId
}).then(res => {
if (res?.code == 0) {
this.$message.success(res.data);
}
});
}
},
handleSizeChange(val) {
this.page.size = val;
this.refreshTable()
},
detailShow(row) { detailShow(row) {
this.$router.push({query: {type: this.active, id: row.id}}) this.$router.push({query: {type: this.active, id: row.id}})
}, },
@@ -349,5 +256,15 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.ResidentList { .ResidentList {
height: 100%; height: 100%;
::v-deep.AiSearch {
.el-input + .el-input > .el-input__inner {
border-left-color: transparent;
&:hover, &:focus {
border-left-color: inherit;
}
}
}
} }
</style> </style>