updates
This commit is contained in:
parent
6717ff9bae
commit
d06b03a1cd
|
|
@ -12,4 +12,3 @@ VITE_UPLOAD_URL = '/'
|
|||
VITE_APP_TITLE = ''
|
||||
|
||||
VITE_PROGRAM_TYPE = '艺体志愿宝'
|
||||
+
|
||||
|
|
@ -6,19 +6,19 @@ const router = useRouter();
|
|||
const state = reactive({
|
||||
options: [
|
||||
{
|
||||
title: '省控线', img: 'https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/icons/menu/shengkongxian.png',
|
||||
title: '省控线', img: 'https://cdn.jsdelivr.net/gh/zwt13703/picx-images-hosting@master/shengkongxian.58huy54ft5.webp',
|
||||
linkUrl: '/scoreControlLine'
|
||||
},
|
||||
{
|
||||
title: '测文化', img: 'https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/icons/menu/cewenhua.png',
|
||||
title: '测文化', img: 'https://cdn.jsdelivr.net/gh/zwt13703/picx-images-hosting@master/cewenhua.4ubf79vdqc.webp',
|
||||
linkUrl: '/school/search'
|
||||
},
|
||||
{
|
||||
title: '查位次', img: 'https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/icons/menu/chaweici.png',
|
||||
title: '查位次', img: 'https://cdn.jsdelivr.net/gh/zwt13703/picx-images-hosting@master/chaweici.3rbpwdznff.webp',
|
||||
linkUrl: '/checkRanking'
|
||||
},
|
||||
{
|
||||
title: '算投档', img: 'https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/icons/menu/suantoudang.png',
|
||||
title: '算投档', img: 'https://cdn.jsdelivr.net/gh/zwt13703/picx-images-hosting@master/suantoudang.8l0ksil260.webp',
|
||||
linkUrl: '/calculateInvestment'
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ const Volunteer={
|
|||
volunteerPage:'/art/volunteer/page',
|
||||
volunteerRecordDel:'/art/volunteer/recordDel',//删除志愿明细
|
||||
volunteerRecordReplace:'/art/volunteer/replaceVolunteer',//替换志愿明细
|
||||
saveFilledVolunteer: '/art/volunteer/saveFilledVolunteer',
|
||||
}
|
||||
const Article={
|
||||
articlePage: '/mini/article/page',//文章列表
|
||||
|
|
|
|||
|
|
@ -314,17 +314,6 @@
|
|||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- [修改] 在这里增加保存按钮的显示逻辑 -->
|
||||
<div class="flex-item-4 pl-20 pr-10" style="line-height: 30px;">
|
||||
<div class="flexWrap" v-if="state.visible.showOrderSaveBtn">
|
||||
<div class="flex-item-1" style="color: #f56c6c; font-weight: bold;">提示</div>
|
||||
<div class="flex-item-4 pl-10">
|
||||
<span style="font-size: 12px; color: #666; margin-right: 10px;">顺序已变更</span>
|
||||
<el-button type="primary" size="default" @click="handleSaveVolunteerOrder">保存排序</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flexWrap mt-15">
|
||||
<div class="flex-item-4 pl-10 pr-10" style="line-height: 30px">
|
||||
|
|
@ -332,6 +321,11 @@
|
|||
<div class="flex-item-1">功能</div>
|
||||
<div class="flex-item-2 pl-10"><el-button @click="handlerVolunteerSwitch">切换</el-button></div>
|
||||
<div class="flex-item-2 pl-10"><el-button @click="handlerVolunteerExport">打印</el-button></div>
|
||||
|
||||
<!-- [修改] 在这里增加保存按钮的显示逻辑 -->
|
||||
<div class="flex-item-4 pl-10" v-if="state.visible.showOrderSaveBtn">
|
||||
<el-button type="primary" size="default" @click="handleSaveVolunteerOrder">保存排序</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -459,11 +453,12 @@
|
|||
<el-table-column fixed="right" width="115" label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<div class="flexWrap font-size-14" style="height: 150px;" v-if="scope.row.schoolName">
|
||||
<el-popover placement="left" :width="200" trigger="click">
|
||||
<span class="selectVolunteerBtn selectVolunteerBtn-active">
|
||||
志愿 {{scope.row.indexs}}
|
||||
</span>
|
||||
<!-- <el-popover placement="left" :width="200" trigger="click">
|
||||
<template #reference>
|
||||
<span class="selectVolunteerBtn selectVolunteerBtn-active">
|
||||
志愿 {{scope.row.indexs}}
|
||||
</span>
|
||||
|
||||
</template>
|
||||
<div class="" style="height: 300px;overflow:auto;">
|
||||
<div v-for="(item,index) in returnVolunteerList()" @click="handleSwitchVolunteer(scope.row,(index+1))" :key="index" class="switchVolunteerItemBtn"
|
||||
|
|
@ -471,7 +466,7 @@
|
|||
志愿 {{item.indexs}}
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
</el-popover> -->
|
||||
<el-popconfirm
|
||||
confirm-button-text="确定"
|
||||
cancel-button-text="取消"
|
||||
|
|
@ -726,7 +721,7 @@ import Sortable from 'sortablejs'; // [新增] 引入 Sortablejs
|
|||
import {checkLevel, isNull} from '@/utils/tool';
|
||||
import {getScore,getRulesEnrollrobabilityMenuList} from '@/axios/api';
|
||||
import {ScoreInfoEntity} from '@/types/index';
|
||||
import {ElMessage} from 'element-plus';
|
||||
import {ElMessage, ElMessageBox} from 'element-plus';
|
||||
import ApiConstant from '@/utils/ApiConstant';
|
||||
import ImagesConstant from '@/utils/ImagesConstant';
|
||||
import StaticConstant from '@/utils/StaticConstant';
|
||||
|
|
@ -814,8 +809,8 @@ const state = reactive({
|
|||
|
||||
},//已报志愿信息
|
||||
otherMajorInfo:{
|
||||
schoolCode:'6353',
|
||||
schoolName:'河南女子学校',
|
||||
schoolCode:'',
|
||||
schoolName:'',
|
||||
current:1,
|
||||
total:0,//总条数
|
||||
pages:0,//总页数
|
||||
|
|
@ -959,7 +954,26 @@ function clearPage(){
|
|||
|
||||
//切换子页面
|
||||
function switchPages(page:string){
|
||||
state.activePage = page
|
||||
if (state.activePage != page && state.visible.showOrderSaveBtn) {
|
||||
ElMessageBox.confirm(
|
||||
'列表已经被切换,你确认要取消?',
|
||||
'Warning',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
getVolunteerDetail()
|
||||
state.activePage = page
|
||||
state.visible.showOrderSaveBtn = false
|
||||
})
|
||||
.catch(() => {})
|
||||
}else{
|
||||
state.activePage = page
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function switchBatch(batch:string){
|
||||
|
|
@ -1252,35 +1266,53 @@ function confirmVolunteerDeleteEvent(majorInfo:any){
|
|||
if(majorInfo.batch === '提前批'|| majorInfo.batch.includes('本科')){
|
||||
flag = true
|
||||
a = state.volunteerInfo.volunteerBenIndexMap.get(key)
|
||||
// state.volunteerInfo.volunteerBenList = state.volunteerInfo.volunteerBenList.filter((item:any)=>item.id != a.id)
|
||||
}else{
|
||||
a = state.volunteerInfo.volunteerZhuanIndexMap.get(key)
|
||||
// state.volunteerInfo.volunteerZhuanList = state.volunteerInfo.volunteerZhuanList.filter((item:any)=>item.id != a.id)
|
||||
}
|
||||
axiosInstance({
|
||||
url: ApiConstant.Volunteer.volunteerDeleteBatch,
|
||||
method: 'post',
|
||||
data:{
|
||||
list:[a.id]
|
||||
},
|
||||
/*showLoading: false,//是否显示加载图标*/
|
||||
}).then((response) => {
|
||||
return response.data
|
||||
}).then((data) => {
|
||||
if(!data.success){
|
||||
ElMessage.error(data.message);
|
||||
return false
|
||||
}else{
|
||||
ElMessage.success('删除成功');
|
||||
//删除这个志愿明细key信息
|
||||
deleteVolunteerMapByKey(flag,key)
|
||||
//刷新志愿明细
|
||||
getVolunteerDetail()
|
||||
//关闭弹框
|
||||
//closeOtherMajorDialog()
|
||||
}
|
||||
}).catch((error: any) => {
|
||||
console.log(error);
|
||||
}).finally(() => {
|
||||
|
||||
console.log('confirmVolunteerDeleteEvent',a)
|
||||
// 1. 获取当前志愿列表
|
||||
const currentList = returnVolunteerList();
|
||||
const oldIndex = currentList.findIndex((item:any)=>item.id === a.id);
|
||||
// 2. 删除该支援数据
|
||||
currentList.splice(oldIndex, 1);
|
||||
// 3. 重算 indexs (志愿序号),确保 UI 上的 "志愿1, 志愿2" 显示正确
|
||||
currentList.forEach((item: any, index: number) => {
|
||||
item.indexs = index + 1;
|
||||
});
|
||||
|
||||
// deleteVolunteerMapByKey(flag,key)
|
||||
state.visible.showOrderSaveBtn = true
|
||||
|
||||
|
||||
// axiosInstance({
|
||||
// url: ApiConstant.Volunteer.volunteerDeleteBatch,
|
||||
// method: 'post',
|
||||
// data:{
|
||||
// list:[a.id]
|
||||
// },
|
||||
// /*showLoading: false,//是否显示加载图标*/
|
||||
// }).then((response) => {
|
||||
// return response.data
|
||||
// }).then((data) => {
|
||||
// if(!data.success){
|
||||
// ElMessage.error(data.message);
|
||||
// return false
|
||||
// }else{
|
||||
// ElMessage.success('删除成功');
|
||||
// //删除这个志愿明细key信息
|
||||
// deleteVolunteerMapByKey(flag,key)
|
||||
// //刷新志愿明细
|
||||
// getVolunteerDetail()
|
||||
// //关闭弹框
|
||||
// //closeOtherMajorDialog()
|
||||
// }
|
||||
// }).catch((error: any) => {
|
||||
// console.log(error);
|
||||
// }).finally(() => {
|
||||
// });
|
||||
}
|
||||
|
||||
//判断是storge/本科/专科 的志愿表map里删除
|
||||
|
|
@ -1540,12 +1572,14 @@ function handlerVolunteerSwitch(){
|
|||
function closeOtherVolunteerDialog(){
|
||||
state.visible.showOtherVolunteerDialog = false
|
||||
}
|
||||
|
||||
//导出志愿信息
|
||||
function handlerVolunteerExport(){
|
||||
if(getScoreInfo() && state.volunteerInfo.id){
|
||||
window.open('https://www.yitisheng.vip/volunteer/preview?id='+state.volunteerInfo.id+"&type=2")
|
||||
}
|
||||
}
|
||||
|
||||
// 切换志愿顺序
|
||||
function handleSwitchVolunteer(now:any,endIndexs:any){
|
||||
//state.switchVolunteerIndex
|
||||
|
|
@ -1644,7 +1678,7 @@ const initSortable = () => {
|
|||
currentList.forEach((item: any, index: number) => {
|
||||
item.indexs = index + 1;
|
||||
});
|
||||
|
||||
console.log(currentList)
|
||||
// 4. 显示保存按钮
|
||||
state.visible.showOrderSaveBtn = true;
|
||||
|
||||
|
|
@ -1672,35 +1706,60 @@ watch(() => state.selectForm.batchPaneName, () => {
|
|||
|
||||
// [新增] 保存排序事件
|
||||
const handleSaveVolunteerOrder = () => {
|
||||
const currentList = returnVolunteerList();
|
||||
// const tiqianList = state.volunteerInfo.volunteerTiQianList;
|
||||
if(state.visible.showOrderSaveBtn){
|
||||
ElMessageBox.confirm(
|
||||
'确定保存新的志愿信息吗?',
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
confirmSaveVolunteerOrder()
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
};
|
||||
|
||||
const confirmSaveVolunteerOrder = () =>{
|
||||
const benList = state.volunteerInfo.volunteerBenList;
|
||||
const zhuanList = state.volunteerInfo.volunteerZhuanList;
|
||||
// 提取需要的参数,通常只需要 id 和新的 indexs
|
||||
const sortData = currentList.map((item: any) => ({
|
||||
id: item.id || item.calculationMajorId, // 根据你实际的ID字段调整
|
||||
const benSortData = benList.map((item: any) => ({
|
||||
id: item.id,
|
||||
calculationMajorId: item.calculationMajorId, // 根据你实际的ID字段调整
|
||||
indexs: item.indexs
|
||||
})).filter((item: any) => item.id); // 过滤掉空行
|
||||
|
||||
// 这里调用你的后端接口
|
||||
// 模拟调用
|
||||
console.log('提交保存的数据:', sortData);
|
||||
const zhuanSortData = zhuanList.map((item: any) => ({
|
||||
id: item.id,
|
||||
calculationMajorId: item.calculationMajorId, // 根据你实际的ID字段调整
|
||||
indexs: item.indexs
|
||||
})).filter((item: any) => item.id); // 过滤掉空行
|
||||
|
||||
/*
|
||||
const sortData = [...benSortData, ...zhuanSortData]
|
||||
const calculationMajorIdList = sortData.map((item)=>item.calculationMajorId)
|
||||
axiosInstance({
|
||||
url: ApiConstant.Volunteer.saveOrder, // 替换为你的保存排序接口
|
||||
url: ApiConstant.Volunteer.saveFilledVolunteer, // 替换为你的保存排序接口
|
||||
method: 'post',
|
||||
data: sortData
|
||||
data: {
|
||||
volunteerId: state.volunteerInfo.id,
|
||||
calculationMajorIdList: calculationMajorIdList
|
||||
},
|
||||
}).then(res => {
|
||||
if(res.data.success){
|
||||
if(res.data.success){
|
||||
ElMessage.success('志愿顺序保存成功');
|
||||
state.visible.showOrderSaveBtn = false; // 隐藏按钮
|
||||
getVolunteerDetail(); // 重新获取最新数据
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
ElMessage.error('保存失败,请稍后重试');
|
||||
console.error('保存志愿顺序出错:', error);
|
||||
});
|
||||
*/
|
||||
// 临时模拟成功
|
||||
ElMessage.success('顺序已保存 (演示)');
|
||||
state.visible.showOrderSaveBtn = false;
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
@ -1708,14 +1767,6 @@ const handleSaveVolunteerOrder = () => {
|
|||
width: 95%;
|
||||
}
|
||||
|
||||
// @media screen and (min-height: 596px) {
|
||||
// .elTable{
|
||||
// width: 100%;
|
||||
// height: 550px;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/* 左侧选择子页面菜单 start */
|
||||
:deep(.el-card__body){
|
||||
padding: 10px 20px;
|
||||
|
|
|
|||
Loading…
Reference in New Issue