diff --git a/src/views/cees/waiTeacher/CeesWaiTeacherList.vue b/src/views/cees/waiTeacher/CeesWaiTeacherList.vue index cb028ce..6458f21 100644 --- a/src/views/cees/waiTeacher/CeesWaiTeacherList.vue +++ b/src/views/cees/waiTeacher/CeesWaiTeacherList.vue @@ -120,9 +120,9 @@ const checkedKeys = ref>([]); const userStore = useUserStore(); import { configStyleImportPlugin } from 'build/vite/plugin/styleImport'; - import { message } from 'ant-design-vue'; + import { message, Modal, Descriptions } from 'ant-design-vue'; import { registerCoordinateSystem } from 'echarts'; - import { usePermission } from '/@/hooks/web/usePermission' + import { usePermission } from '/@/hooks/web/usePermission'; const { hasPermission } = usePermission(); // 定义响应式数据 const dormOptions = ref([]); @@ -273,7 +273,7 @@ /** * 批量分组事件 */ - async function batchHandleGroup() { + async function batchHandleGroup() { if (selectedRowKeys.value.length < 1) { message.warning('请至少选择一个用户!'); return; @@ -303,34 +303,108 @@ * 操作栏 */ function getTableAction(record) { - const actions = [ - { + const actions = []; + + if (record.status !== 0) { + actions.push({ label: '编辑', onClick: handleEdit.bind(null, record), - }, - ]; - - return actions; - } - function ConfirmRegistration(record) { - const actions = [{}]; - // 添加“确认报到”和“取消确认”按钮 - if (record.status === 0) { - actions.push({ - label: '取消确认', - color: 'error', // 按钮颜色 - onClick: () => updateStatus(record.id, 'un'), // 点击事件 - }); - } else { - actions.push({ - label: '确认报到', - color: 'primary', // 按钮颜色 - onClick: () => updateStatus(record.id), // 点击事件 }); } return actions; } + //function ConfirmRegistration(record) { + // const actions = [{}]; + // // 添加“确认报到”和“取消确认”按钮 + // if (record.status === 0) { + // actions.push({ + // label: '取消确认', + // color: 'error', // 按钮颜色 + // onClick: () => updateStatus(record.id, 'un'), // 点击事件 + // }); + // } else { + // actions.push({ + // label: '确认报到', + // color: 'primary', // 按钮颜色 + // onClick: () => updateStatus(record.id), // 点击事件 + // }); + // } + // return actions; + //} + function ConfirmRegistration(record) { + const actions = []; + + const handleConfirm = (actionType) => { + //const currentUser = useSelector((state) => state.user.currentUser); + //console.log(currentUser) + console.log(record); + Modal.confirm({ + title: actionType === 'confirm' ? '确认报到' : '取消确认', + content: , + // 注意:如果你使用的是 JSX 或 Vue3 的 h() 语法,可以使用 `content: () => h('div', ...)` + okText: '确认', + cancelText: '取消', + width: 800, // 👈 增加宽度 + onOk: () => { + if (actionType === 'confirm') { + updateStatus(record.id); + } else { + updateStatus(record.id, 'un'); + } + }, + }); + }; + + if (record.status === 0) { + actions.push({ + label: '取消确认', + color: 'error', + onClick: () => handleConfirm('cancel'), + }); + } else { + actions.push({ + label: '确认报到', + color: 'primary', + onClick: () => handleConfirm('confirm'), + }); + } + + return actions; + } + const ConfirmContent = ({ record }) => ( + + {record.userName} + {record.identityId} + + {record.age} + {record.sex === 0 ? '男' : '女'} + + {record.phone} + {record.jobTitle} + + {record.office} + {record.workName} + + {record.workPhone} + {record.pyCard} + + {record.bankAddress} + {record.bankName} + + {record.carNumber} + {record.mealCard} + + {record.dormitoryName} + {record.majorIdDescription} + + ); async function updateStatus(id, action = '') { try { let params = { id }; @@ -426,4 +500,7 @@ .ant-select .ant-input__inner::placeholder { color: #999 !important; } + .qr { + display: flex; + }