Files
dvcp_v2_webapp/project/pingchang/apps/AppOrganizationChange/components/history.vue

94 lines
2.5 KiB
Vue
Raw Normal View History

2022-10-13 17:57:48 +08:00
<template>
2022-10-21 11:53:29 +08:00
<section class="history">
<ai-search-bar>
<template #left>
2022-10-28 16:32:02 +08:00
<el-button type="primary" icon="iconfont iconEdit" @click="$router.push({hash:'#makeup',query:{oid}})">补录</el-button>
2022-10-21 11:53:29 +08:00
</template>
<template #right>
2022-10-31 16:40:18 +08:00
<el-input size="small" placeholder="请输入届次" v-model="search.sessionTime" clearable @change="getList"/>
2022-10-21 11:53:29 +08:00
</template>
</ai-search-bar>
2022-10-24 16:13:01 +08:00
<ai-table :tableData="tableData" :col-configs="colConfigs" :isShowPagination="false" @getList="getList">
2022-10-21 11:53:29 +08:00
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
2022-10-24 16:13:01 +08:00
<el-button type="text" @click="handleEdit(row.id)">编辑</el-button>
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
2022-10-21 11:53:29 +08:00
</template>
</el-table-column>
</ai-table>
</section>
2022-10-13 17:57:48 +08:00
</template>
<script>
export default {
2022-10-14 11:36:06 +08:00
name: "history",
2022-10-24 16:13:01 +08:00
inject: {
permissions: {},
instance: {},
dict: {}
2022-10-14 11:36:06 +08:00
},
2022-10-14 14:47:48 +08:00
data() {
return {
2022-10-31 16:40:18 +08:00
search: {sessionTime: null},
2022-10-24 16:13:01 +08:00
tableData: []
2022-10-14 14:47:48 +08:00
}
},
computed: {
colConfigs() {
return [
2022-10-24 16:13:01 +08:00
{prop: 'sessionTime', label: '届次', align: 'left'},
{prop: 'changeTime', label: '换届日期', align: 'center'},
{prop: 'createTime', label: '操作时间', align: 'center'},
{prop: 'createUserName', label: '操作人', align: 'center'},
2022-10-14 14:47:48 +08:00
{slot: 'options'},
]
2022-10-24 16:13:01 +08:00
},
oid: v => v.$attrs.selected.id
2022-10-14 14:47:48 +08:00
},
2022-10-27 18:07:02 +08:00
watch: {
oid: {
immediate: true,
handler() {
2022-10-31 16:58:03 +08:00
this.search.sessionTime = null
2022-10-27 18:07:02 +08:00
this.getList()
}
}
},
2022-10-14 14:47:48 +08:00
methods: {
2022-10-24 16:13:01 +08:00
handleEdit(id) {
this.$router.push({hash: "#makeup", query: {id}})
},
handleDelete(id) {
this.$confirm("是否要删除该条届次记录?").then(() => {
this.instance.post("/app/apporganizationgeneralelection/delete", null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.$message.success("删除成功!")
this.getList()
}
})
}).catch(() => 0)
},
getList() {
const {oid: organizationId} = this
2022-10-27 18:07:02 +08:00
organizationId && this.instance.post("/app/apporganizationgeneralelection/list", null, {
2022-10-31 16:40:18 +08:00
throttle: 500,
2022-10-24 16:13:01 +08:00
params: {...this.search, organizationId}
}).then(res => {
if (res?.data) {
this.tableData = res.data
}
})
}
2022-10-14 14:47:48 +08:00
},
2022-10-13 17:57:48 +08:00
}
</script>
2022-10-14 11:36:06 +08:00
<style lang="scss" scope>
.history {
2022-10-14 15:27:43 +08:00
padding-top: 0 !important;
background-color: #FFF !important;
2022-10-14 11:36:06 +08:00
}
2022-10-21 11:53:29 +08:00
</style>