|
@@ -103,7 +103,6 @@
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
plain
|
|
plain
|
|
|
-
|
|
|
|
|
@click="handleAssociateCampus"
|
|
@click="handleAssociateCampus"
|
|
|
v-hasPermi="['dz:cards:add']"
|
|
v-hasPermi="['dz:cards:add']"
|
|
|
style="border-color: #1890ff; color: #1890ff; font-weight: 500"
|
|
style="border-color: #1890ff; color: #1890ff; font-weight: 500"
|
|
@@ -121,7 +120,7 @@
|
|
|
style="border-color: #52c41a; color: #52c41a; font-weight: 500"
|
|
style="border-color: #52c41a; color: #52c41a; font-weight: 500"
|
|
|
>
|
|
>
|
|
|
<svg-icon icon-class="edit" class="mr-1" style="font-size: 16px" />
|
|
<svg-icon icon-class="edit" class="mr-1" style="font-size: 16px" />
|
|
|
- 申请开卡
|
|
|
|
|
|
|
+ 直接开卡
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
@@ -167,6 +166,11 @@
|
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
|
@getList="getList"
|
|
@getList="getList"
|
|
|
>
|
|
>
|
|
|
|
|
+ <!-- 序号插槽 -->
|
|
|
|
|
+ <template #index="{ row, $index }">
|
|
|
|
|
+ {{ getRowIndex($index) }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
<!-- 姓名-手机插槽 -->
|
|
<!-- 姓名-手机插槽 -->
|
|
|
<template #studentInfo="{ row }">
|
|
<template #studentInfo="{ row }">
|
|
|
<div class="student-info">
|
|
<div class="student-info">
|
|
@@ -187,6 +191,7 @@
|
|
|
|
|
|
|
|
<AssignCardDialog
|
|
<AssignCardDialog
|
|
|
v-model="assignCardOpen"
|
|
v-model="assignCardOpen"
|
|
|
|
|
+ :selected-cards="selectedRows"
|
|
|
:school-list="schoolList"
|
|
:school-list="schoolList"
|
|
|
:card-type-options="card_type"
|
|
:card-type-options="card_type"
|
|
|
@success="handleDialogSuccess"
|
|
@success="handleDialogSuccess"
|
|
@@ -281,7 +286,7 @@ import ApplyCardDialog from "./components/ApplyCardDialog.vue";
|
|
|
import formInfo from "./config/form.js";
|
|
import formInfo from "./config/form.js";
|
|
|
import tableConfig from "./config/table.js";
|
|
import tableConfig from "./config/table.js";
|
|
|
import { listUniversity } from "@/api/dz/school";
|
|
import { listUniversity } from "@/api/dz/school";
|
|
|
-import { assignCard, issueCard } from "@/api/dz/cards";
|
|
|
|
|
|
|
+import { assignCard, issueCard, getCampusList } from "@/api/dz/cards";
|
|
|
import { listDept } from "@/api/system/dept";
|
|
import { listDept } from "@/api/system/dept";
|
|
|
import { listAgent } from "@/api/dz/agent";
|
|
import { listAgent } from "@/api/dz/agent";
|
|
|
|
|
|
|
@@ -304,6 +309,7 @@ const {
|
|
|
|
|
|
|
|
const cardsList = ref([]);
|
|
const cardsList = ref([]);
|
|
|
const schoolList = ref([]);
|
|
const schoolList = ref([]);
|
|
|
|
|
+const campusList = ref([]); // 校区列表
|
|
|
const classList = ref([]); // 班级列表
|
|
const classList = ref([]); // 班级列表
|
|
|
const open = ref(false);
|
|
const open = ref(false);
|
|
|
const cardGenerationOpen = ref(false); // 制卡对话框
|
|
const cardGenerationOpen = ref(false); // 制卡对话框
|
|
@@ -313,7 +319,7 @@ const closeCardOpen = ref(false); // 关卡对话框
|
|
|
const reopenCardOpen = ref(false); // 重开对话框
|
|
const reopenCardOpen = ref(false); // 重开对话框
|
|
|
const refundOpen = ref(false); // 退费对话框
|
|
const refundOpen = ref(false); // 退费对话框
|
|
|
const associateCampusOpen = ref(false); // 关联校区对话框
|
|
const associateCampusOpen = ref(false); // 关联校区对话框
|
|
|
-const applyCardOpen = ref(false); // 申请开卡对话框
|
|
|
|
|
|
|
+const applyCardOpen = ref(false); // 直接开卡对话框
|
|
|
const currentCardNo = ref([]); // 当前缴费的卡号(支持数组)
|
|
const currentCardNo = ref([]); // 当前缴费的卡号(支持数组)
|
|
|
const currentCloseCardNo = ref([]); // 当前关卡的卡号(支持数组)
|
|
const currentCloseCardNo = ref([]); // 当前关卡的卡号(支持数组)
|
|
|
const currentReopenCardNo = ref([]); // 当前重开的卡号(支持数组)
|
|
const currentReopenCardNo = ref([]); // 当前重开的卡号(支持数组)
|
|
@@ -362,6 +368,12 @@ const searchConfig = computed(() => {
|
|
|
case "assignSchoolId":
|
|
case "assignSchoolId":
|
|
|
item.option = schoolList.value || [];
|
|
item.option = schoolList.value || [];
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "registerSchoolId":
|
|
|
|
|
+ item.option = schoolList.value || [];
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "campusId":
|
|
|
|
|
+ item.option = campusList.value || [];
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -497,6 +509,13 @@ watch(
|
|
|
{ immediate: true, deep: true }
|
|
{ immediate: true, deep: true }
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+/** 获取行序号 */
|
|
|
|
|
+function getRowIndex(index) {
|
|
|
|
|
+ const pageNum = queryParams.value?.pageNum || 1;
|
|
|
|
|
+ const pageSize = queryParams.value?.pageSize || 10;
|
|
|
|
|
+ return (pageNum - 1) * pageSize + index + 1;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 查询学习卡列表 */
|
|
/** 查询学习卡列表 */
|
|
|
function getList() {
|
|
function getList() {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
@@ -522,8 +541,8 @@ function getSchoolList() {
|
|
|
// 传递pageNum和pageSize参数
|
|
// 传递pageNum和pageSize参数
|
|
|
const requestParams = {
|
|
const requestParams = {
|
|
|
location,
|
|
location,
|
|
|
- pageNum: queryParams.value.pageNum || 1,
|
|
|
|
|
- pageSize: queryParams.value.pageSize || 10,
|
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 9999, // 获取所有学校选项
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
listUniversity(requestParams)
|
|
listUniversity(requestParams)
|
|
@@ -563,6 +582,46 @@ function getSchoolList() {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 获取校区列表 */
|
|
|
|
|
+function getCampusListData() {
|
|
|
|
|
+ getCampusList({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 9999, // 获取所有校区
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((response) => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ // 处理API返回的数据结构
|
|
|
|
|
+ let campusData = [];
|
|
|
|
|
+ if (response.data) {
|
|
|
|
|
+ campusData = Array.isArray(response.data) ? response.data : [];
|
|
|
|
|
+ } else if (response.rows) {
|
|
|
|
|
+ campusData = response.rows;
|
|
|
|
|
+ } else if (response.list) {
|
|
|
|
|
+ campusData = response.list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 确保数据格式符合配置要求
|
|
|
|
|
+ campusData = campusData.map((item) => {
|
|
|
|
|
+ // 如果API返回的是 {id, name, ...} 格式,直接使用
|
|
|
|
|
+ if (item.id && item.name) {
|
|
|
|
|
+ return item;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果是其他格式,需要转换
|
|
|
|
|
+ return {
|
|
|
|
|
+ id: item.id || item.value || item.campusId,
|
|
|
|
|
+ name: item.name || item.label || item.campusName || item.title,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ campusList.value = campusData;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ console.error("获取校区列表失败:", error);
|
|
|
|
|
+ campusList.value = [];
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
// 处理弹窗成功事件
|
|
// 处理弹窗成功事件
|
|
|
function handleDialogSuccess(message) {
|
|
function handleDialogSuccess(message) {
|
|
@@ -689,6 +748,7 @@ function handleSearchFormUpdate(newData) {
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
function handleSelectionChange(selection) {
|
|
function handleSelectionChange(selection) {
|
|
|
|
|
+ console.log("Selection changed:", selection);
|
|
|
selectedRows.value = selection;
|
|
selectedRows.value = selection;
|
|
|
ids.value = selection.map((item) => item.cardId);
|
|
ids.value = selection.map((item) => item.cardId);
|
|
|
single.value = selection.length != 1;
|
|
single.value = selection.length != 1;
|
|
@@ -837,7 +897,7 @@ async function getAgentListData() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/** 申请开卡按钮操作 */
|
|
|
|
|
|
|
+/** 直接开卡按钮操作 */
|
|
|
function handleApplyCard() {
|
|
function handleApplyCard() {
|
|
|
if (selectedRows.value.length === 0) {
|
|
if (selectedRows.value.length === 0) {
|
|
|
// proxy.$modal.msgWarning("请选择要申请开卡的卡片");
|
|
// proxy.$modal.msgWarning("请选择要申请开卡的卡片");
|
|
@@ -846,22 +906,23 @@ function handleApplyCard() {
|
|
|
applyCardOpen.value = true;
|
|
applyCardOpen.value = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 处理申请开卡成功
|
|
|
|
|
|
|
+// 处理直接开卡成功
|
|
|
function handleApplyCardSuccess(message) {
|
|
function handleApplyCardSuccess(message) {
|
|
|
proxy.$modal.msgSuccess(message);
|
|
proxy.$modal.msgSuccess(message);
|
|
|
getList();
|
|
getList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 处理申请开卡确认
|
|
|
|
|
|
|
+// 处理直接开卡确认
|
|
|
function handleApplyCardConfirm(data) {
|
|
function handleApplyCardConfirm(data) {
|
|
|
proxy.$modal.msgSuccess(
|
|
proxy.$modal.msgSuccess(
|
|
|
- `申请开卡成功!卡号段:${data.beginCardNo}-${data.endCardNo}`
|
|
|
|
|
|
|
+ `直接开卡成功!卡号段:${data.beginCardNo}-${data.endCardNo}`
|
|
|
);
|
|
);
|
|
|
getList(); // 刷新列表
|
|
getList(); // 刷新列表
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 分配卡按钮操作 */
|
|
/** 分配卡按钮操作 */
|
|
|
function handleAssignCard() {
|
|
function handleAssignCard() {
|
|
|
|
|
+ console.log("分配卡按钮点击,当前选中的行:", selectedRows.value);
|
|
|
assignCardOpen.value = true;
|
|
assignCardOpen.value = true;
|
|
|
getInstitutionList(); // 获取机构列表
|
|
getInstitutionList(); // 获取机构列表
|
|
|
getAgentList(); // 获取代理商列表
|
|
getAgentList(); // 获取代理商列表
|
|
@@ -984,6 +1045,7 @@ function handleExport() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getList();
|
|
getList();
|
|
|
|
|
+getCampusListData(); // 获取校区列表
|
|
|
|
|
|
|
|
// 监听地址选择变化,自动获取学校列表
|
|
// 监听地址选择变化,自动获取学校列表
|
|
|
watch(
|
|
watch(
|