积分管理

This commit is contained in:
2025-07-18 16:16:36 +08:00
parent 3e86198a82
commit 4d66cded17
16 changed files with 2187 additions and 0 deletions
@@ -0,0 +1,290 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-form-item {
margin-bottom: 0px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card class="box-card" shadow="never">
<template #header>
<h3 style="color: #1867b0">积分基础配置</h3>
</template>
<div>
<el-form :model="formData"
:rules="formRules"
class="applyForm"
label-width="0"
ref="form">
<el-descriptions border class="descriptions-form">
<el-descriptions-item label="每日签到积分">
<el-form-item label-width="0"
prop="dailyAttendanceIntegral">
<el-input-number :min="0" placeholder="请填写每日签到积分" style="width: 100%"
v-model="formData.dailyAttendanceIntegral"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="个人活动报名积分">
<el-form-item label-width="0" prop="userApplyActivityIntegral">
<el-input-number :min="0" placeholder="请填写个人活动报名积分"
style="width: 100%"
v-model="formData.userApplyActivityIntegral"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="参加活动积分">
<el-form-item label-width="0"
prop="attendActivityIntegral">
<el-input-number :min="0" placeholder="请填写参加活动积分" style="width: 100%"
v-model="formData.attendActivityIntegral"></el-input-number>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :span="3" label="评优评先等级积分">
<el-table :data="formData.honorLevelList" border>
<el-table-column label="等级名称" prop="day" width="365px">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="name">
<el-input maxlength="10" readonly
v-model="row.name"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="积分" prop="integral">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="integral">
<el-input-number maxlength="10" :min="0"
style="width: 100%"
v-model="row.integral"></el-input-number>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-descriptions-item>
<el-descriptions-item :span="3" label="自定义每月几号签到积分">
<el-table :data="formData.dayIntegralList" border>
<el-table-column label="几号" prop="day" width="365px">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="day">
<el-date-picker
placeholder="选择日期"
style="width: 100%"
type="date"
v-model="row.day"
value-format="yyyy-MM-dd">
</el-date-picker>
<!-- <el-input-number maxlength="10" min="0"
style="width: 100%"
v-model="row.day"></el-input-number>-->
</el-form-item>
</template>
</el-table-column>
<el-table-column label="积分" prop="integral">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="integral">
<el-input-number maxlength="10" :min="0"
style="width: 100%"
v-model="row.integral"></el-input-number>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" width="150px">
<template slot="header" scope="scope">
<el-button @click="formData.dayIntegralList.push({})"
size="mini"
type="primary">
增加记录
</el-button>
</template>
<template scope="scope">
<el-button
@click="formData.dayIntegralList.splice(scope.$index,1)"
icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-descriptions-item>
<el-descriptions-item :span="3" label="自定义其他模块积分">
<el-table :data="formData.otherModelList" border>
<el-table-column label="模块" prop="day" width="365px">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="day">
<el-select @change="otherModeChange(row)"
placeholder="请选择模块"
style="width: 100%"
v-model="row.otherModeCode">
<el-option
:disabled="item.disabled"
:key="item.otherModeCode"
:label="item.otherModeName"
:value="item.otherModeCode"
v-for="item in modelOptions">
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="积分" prop="integral">
<template scope="{row,$index}">
<el-form-item label-width="0"
prop="integral">
<el-input-number maxlength="10" :min="0"
style="width: 100%"
v-model="row.integral"></el-input-number>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" width="150px">
<template slot="header" scope="scope">
<el-button @click="doOtherModel"
size="mini"
type="primary">
增加记录
</el-button>
</template>
<template scope="scope">
<el-button
@click="deleteOtherModel(scope)"
icon="el-icon-delete" size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-descriptions-item>
</el-descriptions>
<el-row align="center" justify="end" style="padding: 20px" type="flex">
<el-button @click="submit" type="primary">提交
</el-button>
</el-row>
</el-form>
</div>
</el-card>
</guava>
</div>
<script>
const honor_level_id = '3c1058afc91b4e69be46c585b1a48191'
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
formData: {
dayIntegralList: [],
honorLevelList: [],
otherModelList: [],
},
modelOptions: []
}
},
methods: {
otherModeChange(row) {
const otherMode = this.modelOptions.find(m => m.otherModeCode === row.otherModeCode)
row.otherModeName = otherMode.otherModeName
this.modelOptions.map(m => {
if (m.otherModeCode === row.otherModeCode) {
m.disabled = true
}
})
},
deleteOtherModel(scope) {
this.formData.otherModelList.splice(scope.$index, 1)
this.modelOptions.map(m => {
if (m.otherModeCode === scope.row.otherModeCode) {
m.disabled = false
}
})
},
doOtherModel() {
this.formData.otherModelList.push({})
const otherModes = this.formData.otherModelList.map(o => o.otherModeCode)
this.modelOptions.map(m => m.disabled = otherModes.includes(m.otherModeCode))
},
async submit() {
const resp = await $.post(loc() + '/submit', {
integralConfig: JSON.stringify(this.formData)
})
if (resp.code === 0) {
this.$notify({
title: '成功',
message: resp.msg,
type: 'success'
});
this.findOne()
} else {
this.$notify({
title: '警告',
message: resp.msg,
type: 'warning'
});
}
},
findOne() {
$.post(loc() + '/findOne').then(res => {
if (res.data) {
this.formData = res.data
}
if (!this.formData.dayIntegralList) {
this.$set(this.formData, "dayIntegralList", [])
}
if (!this.formData.honorLevelList) {
this.$set(this.formData, "honorLevelList", [])
}
if (!this.formData.otherModelList) {
this.$set(this.formData, "otherModelList", [])
} else {
const otherModes = this.formData.otherModelList.map(o => o.otherModeCode)
this.modelOptions.map(m => m.disabled = otherModes.includes(m.otherModeCode))
}
if (!this.formData.honorLevelList) {
this.getHonorLevelData()
}
})
},
async getHonorLevelData() {
const res_data = await $.get('/platform/honor/basic/settings/getData', {parentId: honor_level_id})
this.formData.honorLevelList = res_data.data
},
async getEnumOptions() {
const resp = await this.$axios.post("/open/common/dictEnumOptions", { name: "IntegralOtherModelConstant" })
if (resp.code === 0) {
this.modelOptions = resp.data
}
},
},
async created() {
this.getEnumOptions()
this.findOne()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,220 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年月">
<el-date-picker
@change="doSearch"
placeholder="选择年月"
style="width: 100%" type="month"
v-model="pageForm.month"
value-format="yyyy-MM">
</el-date-picker>
</search-item>
<search-item label="积分日期">
<el-date-picker
@change="doSearch"
placeholder="选择积分日期"
style="width: 100%"
type="date"
v-model="pageForm.integralTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</search-item>
<search-item label="姓名/工号">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="所属工会">
<el-select
@change="flushUnits"
@clear="flushUnits"
clearable
filterable
placeholder="所属工会"
style="width: 100%"
v-model="pageForm.unionId"
>
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unionList"></el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select clearable filterable placeholder="请选择" style="width: 100%"
v-model="pageForm.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unitList"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="积分增扣列表">
<el-button @click="exportIntegralDetail(false)" size="small" type="primary">
导出积分详情表
</el-button>
<el-button @click="exportIntegralDetail(true)" size="small" type="primary">
按分工会导出详情表
</el-button>
</table-tool>
<el-table :data="tableData"
:size="tableSize"
@sort-change="pageOrder"
ref="table"
row-key="id"
@sort-change="pageOrder"
style="width: 100%">
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
header-align="center"
min-width="100px"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看
</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-table>
</el-card>
</template>
</guava>
<el-diaLog :close-on-click-modal="false" :visible.sync="deductionsVisible" title="积分扣减详情"
width="30%">
<el-form label-width="80px">
<el-form-item label="扣减积分">
{{viewData.integral}}
</el-form-item>
<el-form-item label="扣减原因">
<div style="white-space: pre-line">{{viewData.integralNotes}}</div>
</el-form-item>
</el-form>
<div style="text-align: right">
<span>
<el-button @click="deductionsVisible = false" type="primary">关 闭</el-button>
</span>
</div>
</el-diaLog>
</div>
<script>
const vue = new Vue({
el: '#app',
store,
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别'},
{prop: 'mobile', label: '联系电话'},
{prop: 'unionName', label: '所属工会', sortable: true},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'integral', label: '积分', sortable: true},
{prop: 'integralTime', label: '增扣时间', sortable: true},
],
pageForm: {
month: moment().format('YYYY-MM'),
integralTime: '',
searchKeyword: '',
unionId: '',
unitId: '',
},
unionList: [],
unitList: [],
deductionsVisible: false,
viewData: {}
}
},
methods: {
exportIntegralDetail(isZip) {
const {
year,
integralTime,
searchKeyword,
unionId,
unitId,
personType,
userState
} = this.pageForm
window.open(loc() + '/exportIntegralDetail?searchKeyword=' + searchKeyword + '&unionId=' + unionId + '&unitId=' + unitId +
'&year=' + year + '&integralTime=' + integralTime + '&isZip=' + isZip )
},
doDelete(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.post(loc() + "/doDelete", {id}).then((resp) => {
if (resp.code === 0) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.pageData()
}
})
}).catch(() => {
})
},
openView(row) {
this.viewData = row
this.deductionsVisible = true
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.unitList = []
if (this.pageForm.unionId) {
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
this.unitList = data
})
}
},
},
async created() {
this.$businessTool.listUnion().then((data) => {
this.unionList = data
})
this.$businessTool.listUnit().then((data) => {
this.unitList = data
})
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,451 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<search @search="doSearch">
<search-item label="年度">
<el-date-picker
@change="doSearch"
placeholder="选择年度"
style="width: 100%" type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="姓名/工号">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"></el-input>
</search-item>
<search-item label="所属工会">
<el-select
@change="flushUnits"
@clear="flushUnits"
clearable
filterable
placeholder="所属工会"
style="width: 100%"
v-model="pageForm.unionId"
>
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unionList"></el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select clearable filterable placeholder="请选择" style="width: 100%"
v-model="pageForm.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unitList"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
<dict-select v-model="pageForm.userState" placeholder="在职状态" @change="doSearch"
code="USER_STATE"></dict-select>
</search-item>
<search-item label="人员类型">
<dict-select v-model="pageForm.personType" placeholder="人员类型" @change="doSearch"
code="PERSON_TYPE"></dict-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="积分列表">
<el-button @click="batchDeductions()" size="small" type="primary">批量扣减
</el-button>
<el-button @click="openImport" size="small" type="primary">扣减导入</el-button>
<el-button @click="exportIntegralSum(false)" size="small" type="primary">
导出积分汇总表
</el-button>
<el-button @click="exportIntegralSum(true)" size="small" type="primary">
按分工会导出汇总表
</el-button>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
@selection-change="tableHandleSelectionChange"
style="width: 100%">
<el-table-column :reserve-selection="true" type="selection"></el-table-column>
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
header-align="center"
min-width="100px"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button @click="openView(row.userId)" size="mini" type="primary">查看
</el-button>
<el-button @click="doDeductions(row.userId)" size="mini" type="primary">
扣减
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年月:</div>
<div class="search-item-option">
<el-date-picker
@change="doViewSearch"
placeholder="选择年月"
style="width: 100%" type="month"
v-model="viewForm.month"
value-format="yyyy-MM">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">积分日期:</div>
<div class="search-item-option">
<el-date-picker
@change="doViewSearch"
placeholder="选择积分日期"
style="width: 100%"
type="date"
v-model="viewForm.integralTime"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
<div class="search-query">
<el-button @click="doViewSearch" icon="el-icon-search" type="primary">搜索
</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="积分详细信息">
</table-tool>
<el-table :data="viewData" :size="tableSize" @sort-change="pageOrder"
class="vi-table"
ref="viewTable"
row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column type="index" width="80px">
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in viewTableColumns"
>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" prop="online"
width="180px">
<template scope="{row}">
<el-button @click="openEdit(row)" size="mini" type="primary">编辑
</el-button>
<el-button @click="removeById(row.id)" size="mini" type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #edit>
<file-import ref="viewImport" temp_url="/platform/integral/manage/downloadImportTemp"
post_url="/platform/integral/manage/doImport" @flush="$refs.guava.index();pageData()"
></file-import>
</template>
</guava>
<el-diaLog :close-on-click-modal="false" :visible.sync="deductionsVisible" title="积分扣减"
width="40%">
<el-form label-width="80px">
<el-form-item label="扣减积分">
<el-input placeholder="请输入要扣减的积分" style="width: 100%" type="number"
v-model="deductionsData.integral"></el-input>
</el-form-item>
<el-form-item label="扣减原因">
<el-input placeholder="请输入扣减原因" style="width: 100%" type="text"
v-model="deductionsData.integralNotes"></el-input>
</el-form-item>
</el-form>
<div style="text-align: right">
<span>
<el-button @click="deductionsVisible = false">取 消</el-button>
<el-button @click="doSubmit" type="primary">确 定</el-button>
</span>
</div>
</el-diaLog>
<el-diaLog :close-on-click-modal="false" :visible.sync="editVisible" title="积分编辑" width="40%">
<el-form label-width="80px">
<el-form-item label="工号">
<el-input readonly style="width: 100%" type="text"
v-model="editData.loginname"></el-input>
</el-form-item>
<el-form-item label="姓名">
<el-input readonly style="width: 100%" type="text"
v-model="editData.username"></el-input>
</el-form-item>
<el-form-item label="积分">
<el-input placeholder="请输入要积分" style="width: 100%" type="number"
v-model="editData.integral"></el-input>
</el-form-item>
<el-form-item label="积分备注">
<el-input style="width: 100%" type="textarea" :rows="3"
v-model="editData.integralNotes"></el-input>
</el-form-item>
<el-form-item label="积分时间">
<el-input readonly style="width: 100%" type="text"
v-model="editData.integralTime"></el-input>
</el-form-item>
</el-form>
<div style="text-align: right">
<span>
<el-button @click="editVisible = false">取 消</el-button>
<el-button @click="doEdit" type="primary">确 定</el-button>
</span>
</div>
</el-diaLog>
</div>
<script>
const vue = new Vue({
el: '#app',
store,
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别'},
{prop: 'mobile', label: '联系电话'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionName', label: '所属工会', sortable: true},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'sumIntegral', label: '总积分', sortable: true},
],
viewTableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别'},
{prop: 'integral', label: '积分'},
{prop: 'integralNotes', label: '积分备注'},
{prop: 'integralTime', label: '积分时间'},
],
pageForm: {
year: moment().format('YYYY') + "",
integralTime: '',
searchKeyword: '',
unionId: '',
unitId: '',
personType: '',
userState: ''
},
unitList: [],
unionList: [],
deductionsVisible: false,
editVisible: false,
deductionsData: {},
editData: {},
checkUsers: [],
viewForm: {
userId: '',
month: moment().format('YYYY-MM'),
integralTime: ''
},
}
},
components: {
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
},
methods: {
openImport() {
this.$refs.guava.edit()
this.$refs.viewImport.resetImportData()
},
openEdit(row) {
this.editData = {}
this.editData = {
id: row.id,
integral: row.integral,
username: row.username,
loginname: row.loginname,
integralNotes: row.integralNotes,
integralTime: row.integralTime,
}
this.editVisible = true
},
async doEdit() {
const resp = await $.get(loc() + '/doEdit', this.editData)
if (resp.code === 0) {
this.editVisible = false
this.notifySuccess(resp.msg)
await this.getDetailByUserId()
this.pageData();
} else {
this.notifyError(resp.msg)
}
},
async removeById(id) {
const confirm = await this.$confirm('您确定要删除此条记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' === confirm) {
const resp = await $.get(loc() + '/removeById', {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
await this.getDetailByUserId()
this.pageData();
} else {
this.notifyError(resp.msg)
}
}
},
batchDeductions() {
try {
if (!this.checkUsers.length) {
this.notifyWarning("请先勾选需要扣减的数据!!!")
return
}
this.deductionsData = {
userIds: [],
integral: '',
integralNotes: '',
}
const userIds = this.checkUsers.map(obj => obj.userId);
this.deductionsData.userIds = JSON.stringify(userIds)
this.deductionsVisible = true;
} catch (e) {
console.log(e)
}
},
doDeductions(userId) {
this.deductionsData = {
userIds: [],
integral: '',
integralNotes: '',
}
this.checkUsers = []
this.checkUsers.push(userId)
this.deductionsData.userIds = JSON.stringify(this.checkUsers)
this.deductionsVisible = true;
},
async doSubmit() {
if (!this.deductionsData.integral && !this.deductionsData.integralNotes) {
this.notifyWarning("请填写完整信息!!!")
return;
}
const confirm = await this.$confirm('您确定要进行扣减吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post(loc() + '/doDeductions', this.deductionsData)
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection();
this.checkUsers = []
this.notifySuccess(resp.msg)
this.deductionsVisible = false
} else {
this.notifyWarning(resp.msg)
}
}
},
doViewSearch() {
if (this.viewForm.integralTime) {
this.viewForm.month = ''
}
this.getDetailByUserId();
},
async openView(userId) {
this.viewForm.userId = userId
await this.getDetailByUserId()
this.$refs.guava.view()
},
async getDetailByUserId() {
const resp = await $.post(loc() + '/getDetailByUserId', this.viewForm)
if (resp.code === 0) {
this.viewData = resp.data
}
},
exportIntegralSum(isZip) {
const {
year,
integralTime,
searchKeyword,
unionId,
unitId,
personType,
userState
} = this.pageForm
window.open(loc() + '/exportIntegralSum?searchKeyword=' + searchKeyword + '&unionId=' + unionId + '&unitId=' + unitId +
'&year=' + year + '&integralTime=' + integralTime + '&isZip=' + isZip +
'&personType=' + personType + '&userState=' + userState)
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
this.unitList = []
if (this.pageForm.unionId) {
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
this.unitList = data
})
}
},
},
async created() {
const isAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
if (isAdmin) {
this.$businessTool.listUnion().then((data) => {
this.unionList = data
})
this.$businessTool.listUnit().then((data) => {
this.unitList = data
})
} else {
this.$businessTool.listUnion(this.$store.state.user.union.id).then((data) => {
this.unionList = data
})
this.$businessTool.listUnit(this.$store.state.user.union.id).then((data) => {
this.unitList = data
})
}
this.pageData();
}
})
</script>
<!--#
}
#-->