2025-09-05 14:58:43 +08:00
|
|
|
|
<template>
|
2025-10-22 09:34:48 +08:00
|
|
|
|
<div>
|
2025-09-05 14:58:43 +08:00
|
|
|
|
<!--引用表格-->
|
|
|
|
|
|
<BasicTable @register="registerTable" style="padding: 0 !important;">
|
|
|
|
|
|
<!--插槽:table标题-->
|
|
|
|
|
|
<template #tableTitle>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<!--操作栏-->
|
|
|
|
|
|
<template #action="{ record }">
|
2025-10-22 09:34:48 +08:00
|
|
|
|
<TableAction :actions="getTableAction(record)" />
|
2025-09-05 14:58:43 +08:00
|
|
|
|
</template>
|
2026-03-10 09:17:22 +08:00
|
|
|
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
|
|
|
|
|
<template v-if="column.dataIndex === 'type1'">
|
|
|
|
|
|
<span style="color: red;font-weight: 700;font-size: 16px;" v-if="text == '0'">×</span>
|
|
|
|
|
|
<span style="color: green;font-weight: 700;font-size: 16px;" v-else-if="text == '1'">√</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="column.dataIndex === 'type2'">
|
|
|
|
|
|
<span style="color: red;font-weight: 700;font-size: 16px;" v-if="text == '0'">×</span>
|
|
|
|
|
|
<span style="color: green;font-weight: 700;font-size: 16px;" v-else-if="text == '1'">√</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="column.dataIndex === 'type3'">
|
|
|
|
|
|
<span style="color: red;font-weight: 700;font-size: 16px;" v-if="text == '0'">×</span>
|
|
|
|
|
|
<span style="color: green;font-weight: 700;font-size: 16px;" v-else-if="text == '1'">√</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-if="column.dataIndex === 'type4'">
|
|
|
|
|
|
<span style="color: red;font-weight: 700;font-size: 16px;" v-if="text == '0'">×</span>
|
|
|
|
|
|
<span style="color: green;font-weight: 700;font-size: 16px;" v-else-if="text == '1'">√</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</template>
|
2025-09-05 14:58:43 +08:00
|
|
|
|
</BasicTable>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" name="internaltool-clean-advisory" setup>
|
|
|
|
|
|
import { ref, reactive } from 'vue';
|
|
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
|
|
|
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
|
|
|
import { columns, formSchema } from './cleanadvisory.data';
|
2025-10-22 09:34:48 +08:00
|
|
|
|
import { list, dataClean, dataDelete } from './cleanadvisory.api';
|
2025-09-05 14:58:43 +08:00
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
serverType: '',
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const queryParam = reactive<any>({});
|
|
|
|
|
|
//注册table数据
|
|
|
|
|
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|
|
|
|
|
tableProps: {
|
|
|
|
|
|
title: '入驻咨询表',
|
|
|
|
|
|
api: list,
|
|
|
|
|
|
columns: columns,
|
|
|
|
|
|
formConfig: {
|
|
|
|
|
|
schemas: formSchema
|
|
|
|
|
|
},
|
2025-10-22 09:34:48 +08:00
|
|
|
|
actionColumn: {
|
|
|
|
|
|
width: 380,
|
|
|
|
|
|
},
|
2025-09-05 14:58:43 +08:00
|
|
|
|
canResize: false,
|
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
|
showTableSetting: false,
|
|
|
|
|
|
showActionColumn: true,
|
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
|
beforeFetch: async (params) => {
|
|
|
|
|
|
queryParam.serverType = props.serverType
|
|
|
|
|
|
return Object.assign(params, queryParam);
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 成功回调
|
|
|
|
|
|
*/
|
|
|
|
|
|
function handleSuccess() {
|
|
|
|
|
|
(selectedRowKeys.value = []) && reload();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 查询
|
|
|
|
|
|
*/
|
|
|
|
|
|
function searchQuery() {
|
|
|
|
|
|
reload();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-22 09:34:48 +08:00
|
|
|
|
async function handleClean(record, type) {
|
2025-09-23 16:26:09 +08:00
|
|
|
|
console.log("🚀 ~ handleClean ~ record:", record)
|
|
|
|
|
|
record.advisoryType = type;
|
2025-09-05 14:58:43 +08:00
|
|
|
|
await dataClean(record, handleSuccess);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-22 09:34:48 +08:00
|
|
|
|
async function handleDelete(record, type) {
|
2025-09-23 16:26:09 +08:00
|
|
|
|
console.log("🚀 ~ handleDelete ~ record:", record)
|
2025-09-05 14:58:43 +08:00
|
|
|
|
await dataDelete(record, handleSuccess);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 操作栏
|
|
|
|
|
|
*/
|
|
|
|
|
|
function getTableAction(record) {
|
|
|
|
|
|
return [
|
|
|
|
|
|
{
|
2026-03-10 09:17:22 +08:00
|
|
|
|
label: '清除员工',
|
2025-09-23 16:26:09 +08:00
|
|
|
|
popConfirm: {
|
2026-03-10 09:17:22 +08:00
|
|
|
|
title: '是否确认清除员工',
|
|
|
|
|
|
confirm: handleClean.bind(null, record, '2'),
|
2025-09-23 16:26:09 +08:00
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
|
},
|
2026-03-10 09:17:22 +08:00
|
|
|
|
ifShow: record.type1 == '1'
|
2025-09-23 16:26:09 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-03-10 09:17:22 +08:00
|
|
|
|
label: '清除供应商',
|
2025-09-23 16:26:09 +08:00
|
|
|
|
popConfirm: {
|
2026-03-10 09:17:22 +08:00
|
|
|
|
title: '是否确认清除供应商',
|
|
|
|
|
|
confirm: handleClean.bind(null, record, '4'),
|
2025-09-23 16:26:09 +08:00
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
|
},
|
2026-03-10 09:17:22 +08:00
|
|
|
|
ifShow: record.type2 == '1'
|
2025-09-23 16:26:09 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-01-22 16:31:10 +08:00
|
|
|
|
label: '清除机构',
|
2025-09-05 14:58:43 +08:00
|
|
|
|
popConfirm: {
|
2026-01-22 16:31:10 +08:00
|
|
|
|
title: '是否确认清除机构',
|
2025-10-22 09:34:48 +08:00
|
|
|
|
confirm: handleClean.bind(null, record, '3'),
|
2025-09-05 14:58:43 +08:00
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
|
},
|
2026-03-10 09:17:22 +08:00
|
|
|
|
ifShow: record.type3 == '1'
|
2025-09-05 14:58:43 +08:00
|
|
|
|
},
|
2026-01-22 16:31:10 +08:00
|
|
|
|
{
|
2026-03-10 09:17:22 +08:00
|
|
|
|
label: '清除长者',
|
2026-01-22 16:31:10 +08:00
|
|
|
|
popConfirm: {
|
2026-03-10 09:17:22 +08:00
|
|
|
|
title: '是否确认清除长者',
|
|
|
|
|
|
confirm: handleClean.bind(null, record, '1'),
|
2026-01-22 16:31:10 +08:00
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
|
},
|
2026-03-10 09:17:22 +08:00
|
|
|
|
ifShow: record.type4 == '1'
|
2026-01-22 16:31:10 +08:00
|
|
|
|
},
|
2025-09-05 14:58:43 +08:00
|
|
|
|
{
|
|
|
|
|
|
label: '清除所有',
|
|
|
|
|
|
popConfirm: {
|
|
|
|
|
|
title: '是否确认清除所有',
|
2026-03-10 09:17:22 +08:00
|
|
|
|
confirm: handleDelete.bind(null, record, '-1'),
|
2025-09-05 14:58:43 +08:00
|
|
|
|
placement: 'topLeft',
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
|
searchQuery
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
.jeecg-basic-table-form-container {
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
.table-page-search-submitButtons {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.query-group-cust {
|
|
|
|
|
|
min-width: 100px !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.query-group-split-cust {
|
|
|
|
|
|
width: 30px;
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
text-align: center
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ant-form-item:not(.ant-form-item-with-help) {
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-picker),
|
|
|
|
|
|
:deep(.ant-input-number) {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-table-title) {
|
|
|
|
|
|
display: none !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.darkened-table) {
|
|
|
|
|
|
.ant-table-thead>tr>th {
|
|
|
|
|
|
background-color: #dadadaee;
|
|
|
|
|
|
}
|
2025-10-22 09:34:48 +08:00
|
|
|
|
|
2025-09-05 14:58:43 +08:00
|
|
|
|
.ant-table-tbody>tr>td {
|
|
|
|
|
|
background-color: #f3f3f3f5;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:deep(.z-table-class) {
|
|
|
|
|
|
.ant-table-thead>tr>th {
|
|
|
|
|
|
background-color: #e6f0fd;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ant-table-tbody>tr>td {
|
|
|
|
|
|
background-color: #FBFBFB;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|