|
|
@@ -9,7 +9,7 @@
|
|
|
plain
|
|
|
:icon="PlusOutlined"
|
|
|
v-permission="'data:universities:add'"
|
|
|
- @click="handleBatchDelete"
|
|
|
+ @click="handleUpdate()"
|
|
|
>
|
|
|
新增高校
|
|
|
</el-button>
|
|
|
@@ -26,7 +26,7 @@
|
|
|
type="success"
|
|
|
plain
|
|
|
v-permission="'data:universities:export'"
|
|
|
- @click="handleBatchDelete"
|
|
|
+ @click="handleExportExcel"
|
|
|
:icon="DownloadOutlined"
|
|
|
>
|
|
|
导出EXCEL
|
|
|
@@ -60,6 +60,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #schoolTag="{ row }">
|
|
|
+ <dict-data code="school_tag" type="tag" :model-value="row.schoolTag" />
|
|
|
+ </template>
|
|
|
|
|
|
<template #action="{ row }">
|
|
|
<div>
|
|
|
@@ -67,7 +70,7 @@
|
|
|
type="primary"
|
|
|
link
|
|
|
v-permission="'data:universities:update'"
|
|
|
- @click="toOrderDetail(row)"
|
|
|
+ @click="handleUpdate(row)"
|
|
|
>
|
|
|
编辑
|
|
|
</el-button>
|
|
|
@@ -82,14 +85,16 @@
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
link
|
|
|
- v-permission="'data:universities:delete'"
|
|
|
- @click="handleApplyForOrderRestore(row)"
|
|
|
+ v-permission="'data:universities:schoolTag'"
|
|
|
+ @click="handleSchoolTag(row)"
|
|
|
>
|
|
|
- 标为正常/标为盗版
|
|
|
+ {{ row.schoolTag == 2 ? '标为正常' : '标为盗版' }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</common-table>
|
|
|
+
|
|
|
+ <universities-edit ref="editRef" @success="reload"></universities-edit>
|
|
|
</ele-page>
|
|
|
</template>
|
|
|
|
|
|
@@ -107,9 +112,19 @@
|
|
|
import universitiesSearch from '@/views/data/universities/components/universities-search.vue';
|
|
|
import { useDictData } from '@/utils/use-dict-data';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
+ import request from '@/utils/request';
|
|
|
|
|
|
- defineOptions({ name: 'recycleOrderCancelled' });
|
|
|
+ defineOptions({ name: 'universities' });
|
|
|
+ const [schoolLevelDicts, schoolTagDicts] = useDictData([
|
|
|
+ 'school_level',
|
|
|
+ 'school_tag'
|
|
|
+ ]);
|
|
|
|
|
|
+ console.log(
|
|
|
+ schoolLevelDicts.value,
|
|
|
+ schoolTagDicts,
|
|
|
+ 'schoolLevelDicts, schoolTagDicts'
|
|
|
+ );
|
|
|
/** 表格列配置 */
|
|
|
const columns = ref([
|
|
|
{
|
|
|
@@ -123,30 +138,27 @@
|
|
|
label: '学校名称',
|
|
|
prop: 'schoolName',
|
|
|
align: 'center',
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- label: '省份',
|
|
|
- prop: 'province',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '所在市',
|
|
|
- prop: 'city',
|
|
|
- align: 'center'
|
|
|
+ minWidth: 140
|
|
|
},
|
|
|
- { label: '主管部门', prop: 'createTime', align: 'center' },
|
|
|
+ { label: '省份', prop: 'provinceName', align: 'center' },
|
|
|
+ { label: '所在市', prop: 'cityName', align: 'center' },
|
|
|
+ { label: '主管部门', prop: 'departmentName', align: 'center' },
|
|
|
{
|
|
|
label: '办学层次',
|
|
|
- prop: 'tag',
|
|
|
- align: 'center'
|
|
|
+ prop: 'schoolLevel',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) =>
|
|
|
+ schoolLevelDicts.value.find((d) => d.dictValue == row.schoolLevel)
|
|
|
+ ?.dictLabel
|
|
|
},
|
|
|
{
|
|
|
label: '标记',
|
|
|
- prop: 'peo',
|
|
|
- formatter: (row) => '是',
|
|
|
+ prop: 'schoolTag',
|
|
|
align: 'center',
|
|
|
- width:150
|
|
|
+ slot: 'schoolTag',
|
|
|
+ formatter: (row) =>
|
|
|
+ schoolTagDicts.value.find((d) => d.dictValue == row.schoolTag)
|
|
|
+ ?.dictLabel
|
|
|
},
|
|
|
{
|
|
|
columnKey: 'action',
|
|
|
@@ -162,8 +174,8 @@
|
|
|
const pageRef = ref(null);
|
|
|
|
|
|
const pageConfig = reactive({
|
|
|
- // pageUrl: '/baseinfo/schoolInfo/list',
|
|
|
- exportUrl: '',
|
|
|
+ pageUrl: '/baseinfo/schoolInfo/list',
|
|
|
+ exportUrl: '/baseinfo/schoolInfo/export',
|
|
|
fileName: '高校列表',
|
|
|
cacheKey: 'universitiesTable'
|
|
|
});
|
|
|
@@ -175,46 +187,35 @@
|
|
|
|
|
|
//批量删除
|
|
|
function handleBatchDelete(row) {
|
|
|
+ let selections = row ? [row] : pageRef.value?.getSelections();
|
|
|
+ let ids = selections.map((item) => item.id).join(',');
|
|
|
+ let url = `/baseinfo/schoolInfo/removeById/${ids}`;
|
|
|
pageRef.value?.operatBatch({
|
|
|
title: '确认删除?',
|
|
|
- row,
|
|
|
- url: '/recycleOrder/batchAudit'
|
|
|
+ method: 'post',
|
|
|
+ url,
|
|
|
+ row
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- //订单详情
|
|
|
- function toOrderDetail(row) {
|
|
|
- router.push({ path: '/recycleOrder/detail', query: { id: row.postId } });
|
|
|
- }
|
|
|
-
|
|
|
- //订单日志
|
|
|
- const orderLogRef = ref(null);
|
|
|
- function openOrderLog(row) {
|
|
|
- orderLogRef.value?.handleOpen(row);
|
|
|
- }
|
|
|
-
|
|
|
- //用户绑定标签
|
|
|
- const userTagRef = ref(null);
|
|
|
- function openEditUserTag(row) {
|
|
|
- userTagRef.value?.handleOpen(row);
|
|
|
+ //导出excel
|
|
|
+ function handleExportExcel() {
|
|
|
+ pageRef.value?.exportData('高校列表');
|
|
|
}
|
|
|
|
|
|
- function messageBoxConfirm({ message, url, row }) {
|
|
|
- ElMessageBox.confirm(message, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '关闭',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- console.log(row, 'row');
|
|
|
+ //申请恢复订单
|
|
|
+ function handleSchoolTag(row) {
|
|
|
+ let message = row.schoolTag == 1 ? '确认标为盗版?' : '确认标为正常?';
|
|
|
+ let data = JSON.parse(JSON.stringify(row));
|
|
|
+ data.schoolTag = row.schoolTag == 1 ? 2 : 1;
|
|
|
+ pageRef.value?.messageBoxConfirm({
|
|
|
+ message,
|
|
|
+ fetch: () => request.post('/baseinfo/schoolInfo/edit', data)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //申请恢复订单
|
|
|
- function handleApplyForOrderRestore(row) {
|
|
|
- messageBoxConfirm({
|
|
|
- message: '确认申请恢复订单?',
|
|
|
- url: `/recycleOrder/applyForOrderRestore/${row.postId}`,
|
|
|
- row
|
|
|
- });
|
|
|
+ //编辑页面
|
|
|
+ const editRef = ref(null);
|
|
|
+ function handleUpdate(row) {
|
|
|
+ editRef.value?.handleOpen(row);
|
|
|
}
|
|
|
</script>
|