|
|
@@ -126,6 +126,19 @@
|
|
|
申请开卡
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['dz:cards:remove']"
|
|
|
+ style="border-color: #ff4d4f; color: #ff4d4f; font-weight: 500"
|
|
|
+ >
|
|
|
+ <svg-icon icon-class="delete" class="mr-1" style="font-size: 16px" />
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
@@ -185,7 +198,6 @@
|
|
|
<EditStudentDialog
|
|
|
v-model="open"
|
|
|
:card-id="currentCardId"
|
|
|
- :school-list="schoolList"
|
|
|
:class-list="classList"
|
|
|
@success="handleDialogSuccess"
|
|
|
/>
|
|
|
@@ -291,6 +303,7 @@ const {
|
|
|
|
|
|
const cardsList = ref([]);
|
|
|
const schoolList = ref([]);
|
|
|
+const classList = ref([]); // 班级列表
|
|
|
const open = ref(false);
|
|
|
const cardGenerationOpen = ref(false); // 制卡对话框
|
|
|
const assignCardOpen = ref(false); // 分配卡对话框
|
|
|
@@ -823,12 +836,60 @@ function handleAssignCard() {
|
|
|
}
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
-function handleUpdate(row) {
|
|
|
+async function handleUpdate(row) {
|
|
|
reset();
|
|
|
const _cardId = row.cardId || ids.value;
|
|
|
currentCardId.value = _cardId;
|
|
|
- open.value = true;
|
|
|
- getClassList(); // 获取班级列表
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 获取学习卡详细信息
|
|
|
+ const response = await getCards(_cardId);
|
|
|
+ if (response.code === 200) {
|
|
|
+ const cardData = response.data;
|
|
|
+
|
|
|
+ // 将后端数据对应到表单字段
|
|
|
+ form.value = {
|
|
|
+ cardId: cardData.cardId,
|
|
|
+ cardNo: cardData.cardNo,
|
|
|
+ password: cardData.password,
|
|
|
+ type: cardData.type,
|
|
|
+ status: cardData.status,
|
|
|
+ distributeStatus: cardData.distributeStatus,
|
|
|
+ timeStatus: cardData.timeStatus,
|
|
|
+ payStatus: cardData.payStatus,
|
|
|
+ isSettlement: cardData.isSettlement,
|
|
|
+ deptId: cardData.deptId,
|
|
|
+ agentId: cardData.agentId,
|
|
|
+ leftAgentId: cardData.leftAgentId,
|
|
|
+ campusId: cardData.campusId,
|
|
|
+ assignSchoolId: cardData.assignSchoolId,
|
|
|
+ schoolId: cardData.schoolId,
|
|
|
+ classId: cardData.classId,
|
|
|
+ year: cardData.year,
|
|
|
+ endYear: cardData.endYear,
|
|
|
+ openId: cardData.openId,
|
|
|
+ nickName: cardData.nickName,
|
|
|
+ mobile: cardData.mobile,
|
|
|
+ chineseMathEnglish: cardData.chineseMathEnglish,
|
|
|
+ vocationalSkills: cardData.vocationalSkills,
|
|
|
+ studentCategory: cardData.studentCategory,
|
|
|
+ assignExamType: cardData.assignExamType,
|
|
|
+ areaIds: cardData.areaIds,
|
|
|
+ remark: cardData.remark,
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取班级列表
|
|
|
+ await getClassList();
|
|
|
+
|
|
|
+ // 打开编辑弹窗
|
|
|
+ open.value = true;
|
|
|
+ } else {
|
|
|
+ proxy.$modal.msgError("获取学习卡信息失败");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取学习卡详细信息失败:", error);
|
|
|
+ proxy.$modal.msgError("获取学习卡信息失败");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
@@ -855,10 +916,22 @@ function submitForm() {
|
|
|
/** 删除按钮操作 */
|
|
|
function handleDelete(row) {
|
|
|
const _cardIds = row.cardId || ids.value;
|
|
|
+ const cardIdsArray = Array.isArray(_cardIds) ? _cardIds : [_cardIds];
|
|
|
+
|
|
|
+ if (cardIdsArray.length === 0) {
|
|
|
+ proxy.$modal.msgWarning("请选择要删除的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const message =
|
|
|
+ cardIdsArray.length === 1
|
|
|
+ ? `是否确认删除学习卡编号为"${cardIdsArray[0]}"的数据项?`
|
|
|
+ : `是否确认删除选中的${cardIdsArray.length}条学习卡数据?`;
|
|
|
+
|
|
|
proxy.$modal
|
|
|
- .confirm('是否确认删除学习卡编号为"' + _cardIds + '"的数据项?')
|
|
|
+ .confirm(message)
|
|
|
.then(function () {
|
|
|
- return delCards(_cardIds);
|
|
|
+ return delCards(cardIdsArray);
|
|
|
})
|
|
|
.then(() => {
|
|
|
getList();
|