奖项管理

main
Gitea 5 months ago
parent 8313a6c122
commit 984d2de953
  1. 128
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 42
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue
  3. 284
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue

@ -40,11 +40,10 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.scorepersion.entity.ScorePersion;
import org.jeecg.modules.system.entity.SysRole;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.entity.SysUserDepart; import org.jeecg.modules.system.service.*;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -92,9 +91,11 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
@Resource @Resource
private JeecgBaseConfig jeecgBaseConfig; private JeecgBaseConfig jeecgBaseConfig;
@Autowired @Autowired
private ISysUserDepartService sysUserDepartService;
@Autowired
private ISysDepartService sysDepartService; private ISysDepartService sysDepartService;
@Autowired
private ISysRoleService sysRoleService;
@Autowired
private ISysUserRoleService sysUserRoleService;
/** /**
* 分页列表查询 * 分页列表查询
@ -114,29 +115,54 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
HttpServletRequest req) { HttpServletRequest req) {
//逻辑变动:奖项管理针对学生(上传证书和查询),组委会(全部都可以),学院(上传和查询),学校(教务处)(全部都可以),做一下数据筛选以及操作列权限 //逻辑变动:奖项管理针对学生(上传证书和查询),组委会(全部都可以),学院(上传和查询),学校(教务处)(全部都可以),做一下数据筛选以及操作列权限
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
Comp comp = new Comp(); List<SysRole> sysRoleList = sysUserRoleService.getUserRoleByUserId(user.getId());
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap()); if(sysRoleList.get(0).getId().equals("1724327596426760194")){
queryWrappercomp.like("comp_admin",user.getUsername()); //学生(上传证书和查询)(根据学号查询筛选)
List<Comp> list = compService.list(queryWrappercomp); Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList()); QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>(); queryWrapper.eq("studentcode",user.getUsername());
queryWrapperAnnual.in(ids.size()!=0,"compid",ids); IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual); return Result.OK(pageList);
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList()); }else if(sysRoleList.get(0).getId().equals("1693451972151386114")){
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap()); //组委会(全部都可以)(根据比赛负责人查询比赛id筛选)
queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds); Comp comp = new Comp();
QueryWrapper<Comp> queryWrappercomp = QueryGenerator.initQueryWrapper(comp, req.getParameterMap());
queryWrappercomp.like("comp_admin",user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in(ids.size()!=0,"compid",ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.in(annualIds.size()!=0,"annal_comp",annualIds);
AnnualCompPoint annualCompPoint = new AnnualCompPoint(); AnnualCompPoint annualCompPoint = new AnnualCompPoint();
QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap()); QueryWrapper<AnnualCompPoint> queryWrapperacp = QueryGenerator.initQueryWrapper(annualCompPoint, req.getParameterMap());
queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds); queryWrapperacp.in(annualIds.size()!=0,"annual_comp_id",annualIds);
queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的 queryWrapperacp.eq("annual_comp_switch","Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp); List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList()); List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds); queryWrapper.in(acpIds.size()!=0,"annual_comp_p",acpIds);
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else if(sysRoleList.get(0).getId().equals("1693452352310517762")){
//学院(上传和查询)(根据部门查询数据,该学院下所有学生的获奖信息)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
queryWrapper.eq("studentorg",sysDepartService.queryDepartsByUsername(user.getUsername()).get(0).getOrgCode());
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}else {
//学校和超级管理员(全部都可以)(查全部数据)
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, req.getParameterMap());
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
return Result.OK(pageList);
} }
@ -204,10 +230,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername()); awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1); annualCompPoint.setIsPj(1);
@ -217,15 +240,16 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername()); awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersionService.save(awardPersion); awardPersionService.save(awardPersion);
AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP()); AnnualCompPoint annualCompPoint = annualCompPointService.getById(awardPersion.getAnnualCompP());
annualCompPoint.setIsPj(1); annualCompPoint.setIsPj(1);
annualCompPointService.updateById(annualCompPoint); annualCompPointService.updateById(annualCompPoint);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
/* SysUserDepart sysUserDepart = new SysUserDepart(null,null);
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());*/
} }
} }
@ -270,20 +294,14 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername()); awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersionService.updateById(awardPersion); awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
}else { }else {
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
awardPersion.setStudentname(sysUser.getRealname()); awardPersion.setStudentname(sysUser.getRealname());
awardPersion.setStudentcode(sysUser.getUsername()); awardPersion.setStudentcode(sysUser.getUsername());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); awardPersion.setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, req.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
awardPersion.setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
awardPersionService.updateById(awardPersion); awardPersionService.updateById(awardPersion);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@ -482,10 +500,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
queryWrappertm1.eq("captain","1"); queryWrappertm1.eq("captain","1");
List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1); List<TeamManagement> listtm1 = teamManagementService.list(queryWrappertm1);
SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm1.get(0).getUserId());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1); list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
@ -517,10 +532,7 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
}else { }else {
SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId());
SysUserDepart sysUserDepart = new SysUserDepart(null,null); list.get(i).setStudentorg(sysDepartService.queryDepartsByUsername(sysUser.getUsername()).get(0).getOrgCode());
QueryWrapper<SysUserDepart> queryWrappersud = QueryGenerator.initQueryWrapper(sysUserDepart, request.getParameterMap());
queryWrappersud.eq("user_id",sysUser.getId());
list.get(i).setStudentorg(sysDepartService.getById(sysUserDepartService.getOne(queryWrappersud).getDepId()).getOrgCode());
if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){ if(listaca.get(0).getFirstPrize().equals(list.get(i).getAwardname())){
list.get(i).setAwardsort(1); list.get(i).setAwardsort(1);
list.get(i).setAwardid(listaca.get(0).getId()); list.get(i).setAwardid(listaca.get(0).getId());
@ -587,4 +599,18 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
//return super.importExcel(request, response, AwardPersion.class); //return super.importExcel(request, response, AwardPersion.class);
} }
/**
* 上传证书
*
* @param
* @return
*/
@AutoLog(value = "上传证书")
@ApiOperation(value="上传证书", notes="上传证书")
@PostMapping(value = "/sczs")
public Result<String> sczs(@RequestBody AwardPersion awardPersion,HttpServletRequest req) {
awardPersionService.updateById(awardPersion);
return Result.OK("成功!");
}
} }

@ -54,7 +54,7 @@
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> <TableAction :actions="getTableAction(record)"/>
</template> </template>
<!--字段回显插槽--> <!--字段回显插槽-->
<template #htmlSlot="{text}"> <template #htmlSlot="{text}">
@ -72,6 +72,7 @@
<!-- 表单区域 --> <!-- 表单区域 -->
<AwardPersionModal ref="registerModal" @success="handleSuccess"></AwardPersionModal> <AwardPersionModal ref="registerModal" @success="handleSuccess"></AwardPersionModal>
<AwardPersionModal1 ref="registerModal1" @success="handleSuccess"></AwardPersionModal1> <AwardPersionModal1 ref="registerModal1" @success="handleSuccess"></AwardPersionModal1>
<AwardPersionModal2 ref="registerModal2" @success="handleSuccess"></AwardPersionModal2>
</div> </div>
</template> </template>
@ -92,6 +93,7 @@
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue' import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue' import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api"; import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
@ -101,6 +103,7 @@
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const registerModal1 = ref(); const registerModal1 = ref();
const registerModal2 = ref();
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({
tableProps: { tableProps: {
@ -181,6 +184,14 @@
await deleteOne({ id: record.id }, handleSuccess); await deleteOne({ id: record.id }, handleSuccess);
} }
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/** /**
* 批量删除事件 * 批量删除事件
*/ */
@ -206,16 +217,27 @@
* 操作栏 * 操作栏
*/ */
function getTableAction(record) { function getTableAction(record) {
return [ const actions = [];
{ actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '编辑', label: '编辑',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record),
}, });
// { actions.unshift({
// label: '', label: '详情',
// onClick: handlePersonalAbilityEvaluation.bind(null, record), onClick: handleDetail.bind(null, record),
// }, });
]; actions.unshift({
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
});
return actions;
} }
/** /**
@ -232,7 +254,7 @@
title: '是否确认删除', title: '是否确认删除',
confirm: handleDelete.bind(null, record), confirm: handleDelete.bind(null, record),
} }
} },
] ]
} }

@ -0,0 +1,284 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="年度" name="annualid">
<j-dict-select-tag placeholder="请选择年度" v-model:value="queryParam.annualid" dictCode="annual,annual_name,id"/>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="报名编号" name="enrollCode">
<a-input placeholder="请输入报名编号" v-model:value="queryParam.enrollCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{text}">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AwardPersionModal ref="registerModal" @success="handleSuccess"></AwardPersionModal>
<AwardPersionModal1 ref="registerModal1" @success="handleSuccess"></AwardPersionModal1>
<AwardPersionModal2 ref="registerModal2" @success="handleSuccess"></AwardPersionModal2>
</div>
</template>
<script lang="ts" name="awardpersion-awardPersion" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AwardPersion.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getExportUrlMb,
// personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {collectScore} from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls,onExportXlsMb } = useListPage({
tableProps: {
title: '获奖管理',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 230,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "获奖管理",
url: getExportUrl,
params: queryParam,
},
exportConfigMb: {
name: "获奖管理",
url: getExportUrlMb,
params: null,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 重新获取事件
*/
function cxhq() {
registerModal1.value.disableSubmit = false;
registerModal1.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
// /**
// *
// */
// function handlePersonalAbilityEvaluation(record: Recordable) {
// personalAbilityEvaluation({annualCompP: record.annualCompP, enrollCode: record.enrollCode}, handleSuccess);
// }
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [];
actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '详情',
onClick: handleDetail.bind(null, record),
});
return actions;
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
}
</style>
Loading…
Cancel
Save