From d3594e1546a705a3c4976436223e3aabfe5bd9c7 Mon Sep 17 00:00:00 2001 From: Qi <3194726156@qq.com> Date: Wed, 21 May 2025 13:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=96=E6=A0=A1=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E6=8A=A5=E9=81=93=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cees/waiTeacher/CeesWaiTeacherList.vue | 125 ++++++++++++++---- 1 file changed, 101 insertions(+), 24 deletions(-) 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; + }