main
Gitea 1 year ago
parent 7966a8878a
commit 63bcb45f9b
  1. 516
      jeecgboot-vue3-master/src/views/annualCompPoint/committee/AnnualCompPointList.vue

@ -58,288 +58,302 @@
</template>
<script lang="ts" name="AnnualCompPoint-annualCompPoint" setup>
import {ref, reactive} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {award} from '/@/views/award/AwardManagement.api.ts';
import {useListPage} from '/@/hooks/system/useListPage';
import {columns} from './AnnualCompPoint.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
updateApply,
collectScore
} from './AnnualCompPoint.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import AnnualCompPointModal from './components/AnnualCompPointModal.vue'
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import {router} from "/@/router";
import {useRouter} from "vue-router";
import {ref, reactive} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {award} from '/@/views/award/AwardManagement.api.ts';
import {useListPage} from '/@/hooks/system/useListPage';
import {columns} from './AnnualCompPoint.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
updateApply,
collectScore,
pj
} from './AnnualCompPoint.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import AnnualCompPointModal from './components/AnnualCompPointModal.vue'
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import {router} from "/@/router";
import {useRouter} from "vue-router";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
tableProps: {
title: '年度比赛项目管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 330,
fixed: 'right',
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
tableProps: {
title: '年度比赛项目管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 330,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
exportConfig: {
name: "年度比赛项目管理",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
},
exportConfig: {
name: "年度比赛项目管理",
url: getExportUrl,
params: queryParam,
},
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 handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 年度项目管理 评奖
*/
const router = useRouter()
function pingjiang(record: Recordable) {
router.push({
path: '/award/AwardManagementList',
query: {id: record.id}
});
}
/**
* 年度项目管理 作品管理
*/
function workManage(record: Recordable) {
router.push({
path: '/workManage/works',
query: {annualCompPointId: record.id}
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 handleSubmitandApply(record: Recordable) {
updateApply({id: record.id, annualCompState: record.annualCompState}, handleSuccess);
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
function handleCollectScoreApply(record: Recordable) {
collectScore({id: record.id, annualCompId: record.annualCompId}, handleSuccess);
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 年度项目管理 评奖
*/
const router = useRouter()
function pingjiang(record: Recordable) {
router.push({
path: '/award/AwardManagementList',
query: {id: record.id}
});
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 年度项目管理 作品管理
*/
function workManage(record: Recordable) {
router.push({
path: '/workManage/works',
query: {annualCompPointId: record.id}
});
}
function handleCollectScoreApply(record: Recordable) {
collectScore({id: record.id, annualCompId: record.annualCompId}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 年度项目管理 提交审核按钮
*/
function handleSubmitandApply(record: Recordable) {
updateApply({id: record.id, annualCompState: record.annualCompState}, handleSuccess);
}
/**
* 操作栏
*/
function getTableAction(record) {
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 评奖事件
*/
async function pjgl(record) {
await pj({id: record.id}, handleSuccess);
}
const actions = [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
];
if (record.annualCompState === "0") { // 01()234
actions.unshift({
label: '提交',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "1") {
actions.unshift({
label: '修改',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "2") {
actions.unshift({
label: '修改',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "3") {
actions.unshift({
label: '待驳回'
});
} else if (record.annualCompState === "4") {
actions.unshift({
label: '提交',
onClick: handleSubmitandApply.bind(null, record),
});
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
if (record.annualCompState === "8") {
actions.unshift({
label: '评奖',
onClick: pingjiang.bind(null, record),
});
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
是否已凭奖为1且未汇总过时可以积分汇总操作
* 状态0待提交1已提交(待审核)2已审核(已通过)3待驳回4已驳回5-已报名6-已选题7-已上传作品8-已评分9-已评奖,10-积分已汇总
* 操作栏
*/
if (record.isPj == 1 && record.annualCompState != "10") {
function getTableAction(record) {
const actions = [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
];
if(Date.parse(new Date())>Date.parse(record.scoreEndTime)){
actions.unshift({
label: '评奖',
popConfirm: {
title: '是否确认评奖',
confirm: pjgl.bind(null, record),
}
});
}
if (record.annualCompState === "0") { // 01()234
actions.unshift({
label: '提交',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "1") {
actions.unshift({
label: '修改',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "2") {
actions.unshift({
label: '修改',
onClick: handleSubmitandApply.bind(null, record),
});
} else if (record.annualCompState === "3") {
actions.unshift({
label: '待驳回'
});
} else if (record.annualCompState === "4") {
actions.unshift({
label: '提交',
onClick: handleSubmitandApply.bind(null, record),
});
}
/**
是否已凭奖为1且未汇总过时可以积分汇总操作
* 状态0待提交1已提交(待审核)2已审核(已通过)3待驳回4已驳回5-已报名6-已选题7-已上传作品8-已评分9-已评奖,10-积分已汇总
*/
if (record.isPj == 1 && record.annualCompState != "10") {
actions.unshift({
label: '个人积分汇总',
onClick: handleCollectScoreApply.bind(null, record),
});
}
/* if (record.annualCompState === "8") {
actions.unshift({
label: '评奖',
onClick: pingjiang.bind(null, record),
});
}*/
actions.unshift({
label: '个人积分汇总',
onClick: handleCollectScoreApply.bind(null, record),
label: '作品管理',
onClick: workManage.bind(null, record),
});
// if (record.requireUploadWorks === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
// if (record.requireTopic === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
// if (record.requireApply === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
return actions;
}
actions.unshift({
label: '作品管理',
onClick: workManage.bind(null, record),
});
// if (record.requireUploadWorks === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
// if (record.requireTopic === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
// if (record.requireApply === 'Y' && record.annualCompState === "2") {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
return actions;
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* popup组件值改变事件
*/
function setFieldsValue(map) {
Object.keys(map).map((key) => {
queryParam[key] = map[key];
});
}
/**
* popup组件值改变事件
*/
function setFieldsValue(map) {
Object.keys(map).map((key) => {
queryParam[key] = map[key];
});
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.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-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
}
}
</style>

Loading…
Cancel
Save