祖安之光
2025-06-27 b609f77709c4646daf155341475ae14fc0c7943d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<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>