This commit is contained in:
zhouwentao 2026-01-12 21:27:56 +08:00
parent 6717ff9bae
commit d06b03a1cd
4 changed files with 129 additions and 78 deletions

View File

@ -12,4 +12,3 @@ VITE_UPLOAD_URL = '/'
VITE_APP_TITLE = ''
VITE_PROGRAM_TYPE = '艺体志愿宝'
+

View File

@ -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'
},

View File

@ -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',//文章列表

View File

@ -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">
志愿&nbsp;{{scope.row.indexs}}
</span>
<!-- <el-popover placement="left" :width="200" trigger="click">
<template #reference>
<span class="selectVolunteerBtn selectVolunteerBtn-active">
志愿&nbsp;{{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;