修改外校确认报道相关
This commit is contained in:
parent
386e7d085f
commit
d3594e1546
|
@ -120,9 +120,9 @@
|
||||||
const checkedKeys = ref<Array<string | number>>([]);
|
const checkedKeys = ref<Array<string | number>>([]);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
import { configStyleImportPlugin } from 'build/vite/plugin/styleImport';
|
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 { registerCoordinateSystem } from 'echarts';
|
||||||
import { usePermission } from '/@/hooks/web/usePermission'
|
import { usePermission } from '/@/hooks/web/usePermission';
|
||||||
const { hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
// 定义响应式数据
|
// 定义响应式数据
|
||||||
const dormOptions = ref([]);
|
const dormOptions = ref([]);
|
||||||
|
@ -303,34 +303,108 @@
|
||||||
* 操作栏
|
* 操作栏
|
||||||
*/
|
*/
|
||||||
function getTableAction(record) {
|
function getTableAction(record) {
|
||||||
const actions = [
|
const actions = [];
|
||||||
{
|
|
||||||
|
if (record.status !== 0) {
|
||||||
|
actions.push({
|
||||||
label: '编辑',
|
label: '编辑',
|
||||||
onClick: handleEdit.bind(null, record),
|
onClick: handleEdit.bind(null, record),
|
||||||
},
|
});
|
||||||
];
|
}
|
||||||
|
|
||||||
return actions;
|
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) {
|
function ConfirmRegistration(record) {
|
||||||
const actions = [{}];
|
const actions = [];
|
||||||
// 添加“确认报到”和“取消确认”按钮
|
|
||||||
|
const handleConfirm = (actionType) => {
|
||||||
|
//const currentUser = useSelector((state) => state.user.currentUser);
|
||||||
|
//console.log(currentUser)
|
||||||
|
console.log(record);
|
||||||
|
Modal.confirm({
|
||||||
|
title: actionType === 'confirm' ? '确认报到' : '取消确认',
|
||||||
|
content: <ConfirmContent record={record} />,
|
||||||
|
// 注意:如果你使用的是 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) {
|
if (record.status === 0) {
|
||||||
actions.push({
|
actions.push({
|
||||||
label: '取消确认',
|
label: '取消确认',
|
||||||
color: 'error', // 按钮颜色
|
color: 'error',
|
||||||
onClick: () => updateStatus(record.id, 'un'), // 点击事件
|
onClick: () => handleConfirm('cancel'),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
actions.push({
|
actions.push({
|
||||||
label: '确认报到',
|
label: '确认报到',
|
||||||
color: 'primary', // 按钮颜色
|
color: 'primary',
|
||||||
onClick: () => updateStatus(record.id), // 点击事件
|
onClick: () => handleConfirm('confirm'),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
const ConfirmContent = ({ record }) => (
|
||||||
|
<Descriptions
|
||||||
|
bordered
|
||||||
|
size="small"
|
||||||
|
column={2}
|
||||||
|
labelStyle={{ width: '100px', whiteSpace: 'nowrap' }}
|
||||||
|
contentStyle={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}
|
||||||
|
>
|
||||||
|
<Descriptions.Item label="姓名">{record.userName}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="身份证">{record.identityId}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="年龄">{record.age}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="性别">{record.sex === 0 ? '男' : '女'}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="手机号">{record.phone}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="职称">{record.jobTitle}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="职务">{record.office}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="单位名称">{record.workName}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="单位电话">{record.workPhone}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="银行卡号">{record.pyCard}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="开户地区">{record.bankAddress}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="开户行">{record.bankName}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="车牌号">{record.carNumber}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="饭卡">{record.mealCard}</Descriptions.Item>
|
||||||
|
|
||||||
|
<Descriptions.Item label="所属分组">{record.dormitoryName}</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="学科">{record.majorIdDescription}</Descriptions.Item>
|
||||||
|
</Descriptions>
|
||||||
|
);
|
||||||
async function updateStatus(id, action = '') {
|
async function updateStatus(id, action = '') {
|
||||||
try {
|
try {
|
||||||
let params = { id };
|
let params = { id };
|
||||||
|
@ -426,4 +500,7 @@
|
||||||
.ant-select .ant-input__inner::placeholder {
|
.ant-select .ant-input__inner::placeholder {
|
||||||
color: #999 !important;
|
color: #999 !important;
|
||||||
}
|
}
|
||||||
|
.qr {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue