<template>
|
<div class="app-container">
|
<!-- 表格数据 -->
|
<el-table v-loading="loading" :data="dataList" :border="true">
|
<el-table-column label="序号" type="index" align="center" width="80" />
|
<el-table-column label="机构名称" prop="name" align="center" />
|
<el-table-column label="社会信用代码" prop="creditCode" align="center" />
|
<el-table-column label="机构属性" prop="attribute" align="center" >
|
<template #default="scope">
|
<span v-if="scope.row.attribute == 0">疆内</span>
|
<span v-if="scope.row.attribute == 1">疆外</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="所属区域" prop="province" align="center" >
|
<template #default="scope">
|
<span >{{scope.row.province}}<span v-if="scope.row.province">/</span>{{scope.row.city}}<span v-if="scope.row.district">/</span>{{scope.row.district}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="资质证书编号" prop="certNumber" align="center" />
|
<el-table-column label="发证日期" prop="issueDate" align="center" />
|
<el-table-column label="有效期" prop="validDate" align="center" />
|
<el-table-column label="公示状态" prop="status" align="center" >
|
<template #default="scope">
|
<span v-if="scope.row.publication ===0">公示</span>
|
<span v-if="scope.row.publication ===1">未公示</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
|
<template #default="scope">
|
<el-button link type="primary" @click="openDialog(scope.row)" >查看</el-button>
|
<el-button link type="primary" @click="publicity(scope.row)" >{{scope.row.publicMsg}}</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<div class="pag-container">
|
<el-pagination
|
v-model:current-page="data.queryParams.pageNum"
|
v-model:page-size="data.queryParams.pageSize"
|
:page-sizes="[10,15,20,25]"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="total"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
<institution-dialog ref="inRef" @getList="getList"></institution-dialog>
|
</div>
|
</template>
|
|
<script setup>
|
import {getCurrentInstance, onMounted, reactive, ref, toRefs} from "vue";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
import institutionDialog from "./components/viewInstitution.vue"
|
import {changeInsitutionPublic, getInsitutionList} from "@/api/backManage/insitution";
|
import {changeStatus} from "@/api/sysUsers";
|
const { proxy } = getCurrentInstance();
|
const loading = ref(false);
|
const inRef = ref();
|
const data = reactive({
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
},
|
total: 0,
|
dataList: [
|
]
|
});
|
|
const { queryParams, total, dataList } = toRefs(data);
|
|
onMounted(() => {
|
getList();
|
});
|
const getList = async () => {
|
loading.value = true;
|
const res = await getInsitutionList(data.queryParams);
|
if(res.code === 200){
|
dataList.value = res.data.list.map(item => {
|
return {
|
...item,
|
publicMsg: item.publication ===0 ? '取消公示' : "公示",
|
issueDate: item.issueDate.substring(0,10),
|
validDate: item.validDate.substring(0,10)
|
}
|
})
|
total.value = res.data.total
|
}else{
|
ElMessage.warning(res.message)
|
}
|
loading.value = false;
|
}
|
const handleSizeChange = (val) => {
|
data.queryParams.pageNum = 1
|
data.queryParams.pageSize = val
|
getList()
|
}
|
const handleCurrentChange = (val) => {
|
data.queryParams.pageNum = val
|
getList()
|
}
|
|
const openDialog = (value) => {
|
inRef.value.openDialog( value);
|
}
|
|
const publicity = async (val) => {
|
ElMessageBox.confirm(
|
'确定修改该机构公示状态?',
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then( async() => {
|
const param = {
|
id: val.id,
|
publication: val.publication ===0 ? 1: 0
|
}
|
const res = await changeInsitutionPublic(param);
|
if(res.code === 200){
|
ElMessage({
|
type: 'success',
|
message: '成功'
|
});
|
getList()
|
}else{
|
ElMessage.warning(res.message)
|
}
|
})
|
}
|
|
const handleDelete = (val) => {
|
ElMessageBox.confirm(
|
'确定删除此条数据?',
|
'提示',
|
{
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then( async() => {
|
|
})
|
}
|
|
</script>
|
<style lang="scss">
|
.pag-container{
|
float: right;
|
margin-top: 10px;
|
}
|
</style>
|