提交 88d06606 编写于 作者: 刘英杰's avatar 刘英杰

测试提交

上级 2f98a810
文件已添加
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
......@@ -14,6 +14,7 @@
},
"dependencies": {
"@babel/runtime": "^7.2.0",
"@vue-office/pdf": "^1.5.4",
"axios": "^0.18.0",
"better-scroll": "^1.12.1",
"dayjs": "^1.8.9",
......@@ -30,7 +31,11 @@
"ua-parser-js": "^0.7.18",
"view-design": "^4.6.0",
"vue": "^2.6.10",
"vue-doc-preview": "^0.3.2",
"vue-i18n": "^7.8.1",
"vue-image-preview": "^0.0.8",
"vue-office": "^0.0.5",
"vue-pdf": "^4.3.0",
"vue-router": "^3.1.3",
"vuex": "^3.0.1"
},
......
......@@ -8,7 +8,7 @@
<title><%= VUE_APP_TITLE %></title>
</head>
<body>
<!--<script type="text/javascript" src="/a/manager/identify/identify.js"></script>-->
<script type="text/javascript" src="/a/manager/identify/identify.js"></script>
<noscript>
<strong>
请开启 JavaScript 功能来使用 <%= VUE_APP_TITLE %>。
......
......@@ -87,6 +87,15 @@ export function TeamMembersIns(data) {
});
}
export function TeacherBatchIns(data) {
///批量添加教师
return request({
url: `/api/UserInfo/api/UserInfo/TeacherBatchIns`,
method: 'post',
data
});
}
export function TeamMembersDel(data) {
//删除团队成员
return request({
......@@ -110,6 +119,16 @@ export function TeamSelect(data) {
* UserInfo
*/
export function GetPersonList(data) {
//获取用户列表
return request({
url: `/api/UserInfo/api/UserInfo/GetPersonList?page_index=${data.page_index}&page_size=${data.page_size}&condition=${data.condition}`,
method: 'get',
data
});
}
export function GetUserList(data) {
//获取用户列表
return request({
......@@ -122,7 +141,7 @@ export function GetUserList(data) {
export function GetUserInfo(data) {
//获取用户详细
return request({
url: '/api/UserInfo/api/UserInfo/GetUserInfo',
url: `/api/UserInfo/api/UserInfo/GetUserInfo`,
method: 'get',
data
});
......@@ -182,6 +201,25 @@ export function GetUserInfoByBursary(data) {
});
}
export function GetStudentList(data) {
//获取学生列表
return request({
url: `/api/UserInfo/api/UserInfo/GetStudentList?page_index=${data.page_index}&page_size=${data.page_size}&condition=${data.condition}`,
method: 'get',
data
});
}
export function GetTeacherList(data) {
//获取学生列表
return request({
url: `/api/UserInfo/api/UserInfo/GetTeacherList?page_index=${data.page_index}&page_size=${data.page_size}&condition=${data.condition}`,
method: 'get',
data
});
}
/**
* UserRole
* */
......@@ -233,6 +271,16 @@ export function UserRoleSelect(data) {
/**
CompetitionReport
*/
export function GetReportSelectWin(data) {
//获取自身赛事下拉框
return request({
url: '/api/CompetitionReport/api/CompetitionReport/GetReportSelectWin',
method: 'get',
data
});
}
export function GetReportList(data) {
//获取竞赛列表
return request({
......@@ -333,7 +381,7 @@ export function GetSignList(data) {
export function GetSignInfo(data) {
//获取详细报名表
return request({
url: `/api/CompetitionSign/api/CompetitionSign/GetSignInfo`,
url: `/api/CompetitionSign/api/CompetitionSign/GetSignInfo?id=${data.id}`,
method: 'get',
data
});
......@@ -382,7 +430,7 @@ export function GetCertificateList(data) {
export function GetCertificateInfo(data) {
//获取获奖证书详细
return request({
url: `/api/Certificate/api/Certificate/GetCertificateInfo`,
url: `/api/Certificate/api/Certificate/GetCertificateInfo?id=${data.id}`,
method: 'get',
data
});
......@@ -421,7 +469,7 @@ export function GetBursaryList(data) {
export function GetBursaryInfo(data) {
//获取补助金详细
return request({
url: `/api/Bursary/api/Bursary/GetBursaryInfo`,
url: `/api/Bursary/api/Bursary/GetBursaryInfo?id=${data.id}`,
method: 'get',
data
});
......@@ -562,9 +610,28 @@ export function FlowCancel(data) {
});
}
export function FlowNoticeSubmit(data) {
//公告流程
return request({
url: `/api/Flow/api/Flow/FlowNoticeSubmit`,
method: 'post',
data
});
}
/**
* FlowUserGroup
* */
export function GetFlowUserGroupBySelect(data) {
//获取用户组下拉框
return request({
url: `/api/FlowUserGroup/api/FlowUserGroup/GetFlowUserGroupBySelect?key=${data.key}`,
method: 'get',
data
});
}
export function GetFlowUserGroupList(data) {
//获取节点审批用户组
return request({
......@@ -610,4 +677,421 @@ export function GetUserByTeaSelect(data) {
});
}
export function FlowUserGroupDel(data) {
//删除用户组
return request({
url: `/api/FlowUserGroup/api/FlowUserGroup/FlowUserGroupDel?id=${data.id}`,
method: 'get',
data
});
}
export function GetDeptSeletct(data) {
//获取院系列表
return request({
url: `/api/UserInfo/api/UserInfo/GetDeptSeletct`,
method: 'get',
data
});
}
/**
* Score
* */
export function GetScoreList(data) {
//获取成绩列表
return request({
url: `/api/Score/GetScoreList`,
method: 'post',
data
});
}
export function ScoreDel(data) {
//删除成绩
return request({
url: `/api/Score/ScoreDel?id=${data.id}`,
method: 'get',
data
});
}
export function ScoreSave(data) {
//录入成绩
return request({
url: `/api/Score/ScoreSave?id=${data.id}&score=${data.score}&prizes=${data.prizes}&is_win=${data.is_win}`,
method: 'get',
data
});
}
export function WinSave(data) {
//设置获奖
return request({
url: `/api/Score/WinSave?id=${data.id}&is_win=${data.is_win}`,
method: 'get',
data
});
}
export function GetScoreBySignSelect(data) {
//获取成绩表里的赛事
return request({
url: `/api/Score/GetScoreBySignSelect`,
method: 'get',
data
});
}
/**
* NoticeUserGroup
*/
export function GetNoticeUserGroupSelect(data) {
//获取公告用户组下拉框
return request({
url: `/api/NoticeUserGroup/GetNoticeUserGroupSelect`,
method: 'get',
data
});
}
export function GetNoticeUserGroupList(data) {
//获取公告用户组列表
return request({
url: `/api/NoticeUserGroup/GetNoticeUserGroupList`,
method: 'get',
data
});
}
export function GetNoticeUserGroupInfo(data) {
//获取详细
return request({
url: `/api/NoticeUserGroup/GetNoticeUserGroupInfo?groupid=${data.groupid}`,
method: 'get',
data
});
}
export function NoticeUserGroupSave(data) {
//保存用户组
return request({
url: `/api/NoticeUserGroup/NoticeUserGroupSave`,
method: 'post',
data
});
}
export function NoticeUserGroupIns(data) {
//新增用户组
return request({
url: `/api/NoticeUserGroup/NoticeUserGroupIns`,
method: 'post',
data
});
}
export function NoticeUserGroupDel(data) {
//删除
return request({
url: `/api/NoticeUserGroup/NoticeUserGroupDel?id=${data.id}`,
method: 'get',
data
});
}
/**
*
* NoticeType
* */
export function GetNoticeTypeList(data) {
//获取公告分类列表
return request({
url: `/api/NoticeType/GetNoticeTypeList?page_index=${data.page_index}&page_size=${data.page_size}`,
method: 'get',
data
});
}
export function NoticeTypeSave(data) {
//保存公告分类
return request({
url: `/api/NoticeType/NoticeTypeSave`,
method: 'post',
data
});
}
export function NoticeTypeDel(data) {
//删除公告分类
return request({
url: `/api/NoticeType/NoticeTypeDel?id=${data.id}`,
method: 'get',
data
});
}
export function NoticeTypeSelect(data) {
//获取公告分类下拉框
return request({
url: `/api/NoticeType/NoticeTypeSelect`,
method: 'get',
data
});
}
/**
*
* Notice
*
* */
export function GetNoticeList(data) {
//获取公告列表
return request({
url: `/api/Notice/GetNoticeList`,
method: 'post',
data
});
}
export function GetNoticeInfo(data) {
//获取公告详细
return request({
url: `/api/Notice/GetNoticeInfo?id=${data.id}`,
method: 'get',
data
});
}
export function NoticeSave(data) {
//保存公告
return request({
url: `/api/Notice/NoticeSave`,
method: 'post',
data
});
}
export function NoticeDel(data) {
//删除公告
return request({
url: `/api/Notice/NoticeDel?id=${data.id}`,
method: 'get',
data
});
}
export function NoticePublic(data) {
//发布公告
return request({
url: `/api/Notice/NoticePublic`,
method: 'post',
data
});
}
export function NoticeSetTop(data) {
//设置公告置顶
return request({
url: `/api/Notice/NoticeSetTop?id=${data.id}&is_top=${data.is_top}`,
method: 'get',
data
});
}
/**
* FlowDesign
* **/
export function GetFlowDesignAllList(data) {
//获取流程设计列表
return request({
url: `/api/FlowDesign/GetFlowDesignAllList?page_index=${data.page_index}&page_size=${data.page_size}`,
method: 'get',
data
});
}
export function GetFlowDesignSave(data) {
//获取流程设计列表
return request({
url: `/api/FlowDesign/GetFlowDesignSave`,
method: 'post',
data
});
}
export function FlowPublic(data) {
//流程发布或取消
return request({
url: `/api/FlowDesign/FlowPublic?flowid=${data.flowid}&status=${data.status}`,
method: 'get',
data
});
}
export function FlowDesignDel(data) {
//删除流程设计
return request({
url: `/api/FlowDesign/FlowDesignDel?flowid=${data.flowid}`,
method: 'get',
data
});
}
export function GetFlowNodeList(data) {
//获取流程结点列表
return request({
url: `/api/FlowNodeList/GetFlowNodeList?flowid=${data.flowid}`,
method: 'get',
data
});
}
export function GetFlowNodeSelet(data) {
//获取结点下拉框
return request({
url: `/api/FlowDesign/GetFlowNodeSelet?flowid=${data.flowid}`,
method: 'get',
data
});
}
export function GetFlowNodeInfo(data) {
//获取节点详细
return request({
url: `/api/FlowDesign/GetFlowNodeInfo?flowid=${data.flowid}&nodeid=${data.nodeid}`,
method: 'get',
data
});
}
export function FlowNodeSave(data) {
//流程节点保存
return request({
url: `/api/FlowNodeList/FlowNodeSave`,
method: 'post',
data
});
}
export function FlowNodeDel(data) {
//删除节点
return request({
url: `/api/FlowDesign/FlowNodeDel?id=${data.id}`,
method: 'get',
data
});
}
export function GetProcessSelect(data) {
//获取审批节点
return request({
url: `/api/FlowDesign/GetProcessSelect`,
method: 'get',
data
});
}
/***
* 流程列表数据导出
* **/
export function BursaryExport(data) {
//补助金导出
return request({
url: `/api/Bursary/api/Bursary/BursaryExport?id=${data.id}`,
method: 'get',
data
});
}
export function ReportExport(data) {
//竞赛导出
return request({
url: `/api/CompetitionReport/api/CompetitionReport/ReportExport?id=${data.id}`,
method: 'get',
data
});
}
export function SignExport(data) {
//竞赛报名导出
return request({
url: `/api/CompetitionSign/api/CompetitionSign/SignExport?id=${data.id}`,
method: 'get',
data
});
}
export function FlowInit(data) {
//流程填写信息初始化
return request({
url: `/api/FlowView/api/Flow/FlowInit?flowid=${data.flowid}`,
method: 'get',
data
});
}
export function FlowChangeCommit(data) {
//流程填写信息保存
return request({
url: `/api/Flow/api/Flow/FlowChangeCommit`,
method: 'post',
data
});
}
/**
*
* MessageInfo
* **/
export function GetMessageList(data) {
//流程填写信息保存
return request({
url: `/api/Message/GetMessageList`,
method: 'post',
data
});
}
export function GetSubitemSelect(data) {
//流程填写信息保存
return request({
url: `/api/CompetitionReport/api/CompetitionReport/GetSubitemSelect?id=${data.id}`,
method: 'get',
data
});
}
export function ReportExportToExcel(data) {
//赛事列表导出
return request({
url: `/api/CompetitionReport/api/CompetitionReport/ReportExportToExcel`,
method: 'post',
data
});
}
export function CertificateSetState(data) {
//批量审批证书
return request({
url: `/api/Certificate/api/Certificate/CertificateSetState`,
method: 'get',
data
});
}
export function CertificateExportToExcel(data) {
//获奖证书导出
return request({
url: `/api/Certificate/api/Certificate/CertificateExportToExcel`,
method: 'post',
data
});
}
......@@ -4,12 +4,12 @@
</div>
</template>
<script>
const noMarginClassName = 'i-layout-content-main-no-margin';
const noCopyrightClassName = 'i-copyright-hidden';
const contextFlexClassName = 'i-layout-content-flex';
const contextMainFlexClassName = 'i-layout-content-main-flex';
// const noMarginClassName = 'i-layout-content-main-no-margin';
const noCopyrightClassName = 'i-copyright-hidden';
// const contextFlexClassName = 'i-layout-content-flex';
const contextMainFlexClassName = 'i-layout-content-main-flex';
export default {
export default {
name: 'i-frame',
props: {
src: {
......@@ -27,24 +27,24 @@
default: false
}
},
data () {
data() {
return {
ready: false,
$content: null,
$copyright: null,
$layoutContent: null,
$layoutContentMain: null
$layoutContentMain: null,
}
},
watch: {
margin: {
handler (val) {
handler(val) {
this.$nextTick(() => {
if (this.$content) {
if (!val) {
this.$content.classList.add(noMarginClassName);
// this.$content.classList.add(noMarginClassName);
} else {
this.$content.classList.remove(noMarginClassName);
// this.$content.classList.remove(noMarginClassName);
}
}
});
......@@ -52,14 +52,14 @@
immediate: true
}
},
mounted () {
mounted() {
this.$content = document.getElementsByClassName('i-layout-content-main')[0];
this.$copyright = document.getElementsByClassName('i-copyright')[0];
if (this.$copyright && !this.copyright) this.$copyright.classList.add(noCopyrightClassName);
this.$layoutContent = document.getElementsByClassName('i-layout-content')[0];
if (this.$layoutContent) this.$layoutContent.classList.add(contextFlexClassName);
// if (this.$layoutContent) this.$layoutContent.classList.add(contextFlexClassName);
this.$layoutContentMain = document.getElementsByClassName('i-layout-content-main')[0];
if (this.$layoutContentMain) this.$layoutContentMain.classList.add(contextMainFlexClassName);
......@@ -68,20 +68,20 @@
this.ready = true;
});
},
beforeDestroy () {
if (this.$content) this.$content.classList.remove(noMarginClassName);
beforeDestroy() {
// if (this.$content) this.$content.classList.remove(noMarginClassName);
if (this.$copyright) this.$copyright.classList.remove(noCopyrightClassName);
if (this.$layoutContent) this.$layoutContent.classList.remove(contextFlexClassName);
// if (this.$layoutContent) this.$layoutContent.classList.remove(contextFlexClassName);
if (this.$layoutContentMain) this.$layoutContentMain.classList.remove(contextMainFlexClassName);
this.$content = null;
this.$copyright = null;
this.$layoutContent = null;
this.$layoutContentMain = null;
}
}
}
</script>
<style lang="less">
.i-frame{
<style lang="less" scoped>
.i-frame {
position: absolute;
top: 0;
bottom: 0;
......@@ -90,7 +90,7 @@
overflow: hidden;
overflow-y: auto;
&-iframe{
&-iframe {
position: absolute;
width: 100%;
height: 100%;
......@@ -99,5 +99,5 @@
left: 0;
right: 0;
}
}
}
</style>
import {Modal,Message,Spin} from "view-design";
import {Modal, Message, Spin} from "view-design";
import Vue from "vue";
export function publicConfirm(publicFunction) {
// 公共弹窗删除
......@@ -15,6 +16,7 @@ export function publicConfirm(publicFunction) {
}
});
}
export function publicMessage(res) {
// 弹窗封装
if (res.code !== 1) {
......@@ -28,6 +30,50 @@ export function publicMessage(res) {
background: true,
content: '操作成功'
});
}
}
export function storageAddEventListener(fun) {
// 监听storage事件,当主页面修改数据时,触发该事件
window.addEventListener('storage', (event) => {
if (event.key === 'updataEvent' && event.newValue === 'getDataEvent') {
//刷新主窗口
// 执行你的逻辑
// 重置存储的值,以便下次触发事件
localStorage.setItem('updataEvent', '');
fun()
}
});
}
export async function myEncapsulationFunction(fun) {
// Spin.show()
let res = await fun()
try {
switch (res.code) {
case 1 :
Message['success']({
background: true,
content: res.msg
});
break;
default :
Message['error']({
background: true,
content: res.msg_detail
});
}
console.log("try")
// Spin.hide()
return res
} catch (e) {
console.log("catch,", e)
Spin.hide()
Message['error']({
background: true,
content: res.msg_detail
});
}
}
......@@ -25,13 +25,13 @@ import iViewPro from '@/libs/iview-pro/iview-pro.min.js';
import router from './router';
import menuHeader from '@/menu/header';
import menuSider from '@/menu/sider';
import { frameInRoutes } from '@/router/routes';
import {frameInRoutes} from '@/router/routes';
// 多语言
import i18n from '@/i18n';
// 方法
import { getHeaderName, getMenuSider, getSiderSubmenu } from '@/libs/system';
import {getHeaderName, getMenuSider, getSiderSubmenu} from '@/libs/system';
// 内置组件
import iLink from '@/components/link';
......@@ -42,8 +42,13 @@ import iFrame from '@/components/frame';
import './styles/index.less';
import './libs/iview-pro/iview-pro.css';
if (window) window.$t = (key, value) => i18n.t(key, value);
import VuePDF from 'vue-pdf';
import VueDocPreview from 'vue-doc-preview';
import VueImagePreview from 'vue-image-preview';
import pdf from 'vue-pdf'
if (window) window.$t = (key, value) => i18n.t(key, value);
Vue.prototype.protocolHost = 'https://asc.hnasct.cn'
Vue.use(plugins);
Vue.use(ViewUI, {
......@@ -52,14 +57,16 @@ Vue.use(ViewUI, {
Vue.use(iViewPro);
Vue.component('i-link', iLink);
Vue.component('i-frame', iFrame);
Vue.component('VueDocPreview', VueDocPreview)
Vue.component('vuePdf', VuePDF);
Vue.component('VueImagePreview', VueImagePreview);
new Vue({
mixins: [mixinApp],
router,
store,
i18n,
render: h => h(App),
created () {
created() {
// 处理路由 得到每一级的路由设置
this.$store.commit('admin/page/init', frameInRoutes);
// 设置顶栏菜单
......@@ -71,7 +78,7 @@ new Vue({
},
watch: {
// 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
'$route' (to, from) {
'$route'(to, from) {
let path = to.matched[to.matched.length - 1].path;
if (!Setting.dynamicSiderMenu) {
let headerName = getHeaderName(path, menuSider);
......
......@@ -2,5 +2,5 @@ export default {
path: '/Bursary',
title: '补助金列表',
header: 'home',
icon:'logo-usd'
icon: 'logo-usd'
}
export default {
path: '/competitionNotice',
title: '公告列表',
header: 'home',
icon: 'md-text'
}
export default {
path: '/competitionScore',
title: '竞赛成绩',
header: 'home',
icon: 'md-text'
}
const pre = '/flow';
export default {
path: '/',
path: '/1',
title: '流程集合',
header: 'home',
icon: 'md-clock',
......
......@@ -5,10 +5,24 @@ export default {
header: 'home',
icon: 'md-flower',
children: [
{
path: `${pre}-flowDesign`,
title: '流程设计管理',
},
{
path: `${pre}-noticeManagement`,
title: '竞赛公告管理',
},
{
path: `${pre}-approvalUserGroupManagement`,
title: '审批用户组管理',
},
// {
// path: `${pre}-score`,
// title: '成绩录入',
// // header:'home',
// },
{
path: `${pre}-userManagement`,
title: '用户管理',
......@@ -18,6 +32,11 @@ export default {
path: `${pre}-levelManagement`,
title: '权限管理',
// header:'home',
},
{
path: `${pre}-log`,
title: '日志',
// header:'home',
}
]
}
......@@ -18,9 +18,12 @@ import Bursary from "@/menu/modules/Bursary";
import Certificate from "@/menu/modules/Certificate";
import CompetitionSign from "@/menu/modules/CompetitionSign";
import flowassemble from "@/menu/modules/flowassemble";
import competitionNotice from "@/menu/modules/competitionNotice";
import competitionScore from "@/menu/modules/competitionScore";
// 系统
// import log from './modules/log';
export default [
// dashboard,
// log,
......@@ -46,7 +49,9 @@ export default [
CompetitionSign,
Bursary,
Certificate,
competitionNotice,
teamManagement,
competitionScore,
flowassemble,
systemConmfiguration,
......
......@@ -47,6 +47,7 @@
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #race_level="{row}">
<!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way]
......@@ -62,11 +63,18 @@
</template>
<template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button>
<!-- <Button v-if="false" type="info" @click="edit(row)">编辑</Button>-->
<a @click="importFile(row)">导出</a>
<a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button>
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
<!-- <Button type="primary" size="small" @click="importFile(row)">导出</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)">详细</Button>-->
<!-- &lt;!&ndash; <Button v-if="false" type="info" @click="edit(row)">编辑</Button>&ndash;&gt;-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
......@@ -84,6 +92,23 @@
</Card>
<Modal
v-model="importModal"
title="文件导出"
>
<Spin fix v-if="importLoading"></Spin>
<div style=" display: flex;justify-content: space-around;">
<Button icon="md-log-in" @click="importButton(item[1])" v-for="(item,index) in fileObject" :key="index">
{{
item[2]
}}
</Button>
</div>
<template #footer>
<Button type="text" @click="importModal =false">关闭</Button>
<!-- <Button type="primary" @click="importOk">确定</Button>-->
</template>
</Modal>
<Drawer :width="800" title="详细" :closable="true" v-model="drawer">
<div class="tableList">
<h1 style="display: flex;justify-content: center">补助金内容详细</h1>
......@@ -100,14 +125,25 @@
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colTitle">{{
<th v-if="item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colContent">{{
<td v-if="item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
<th v-if="item[0]==='fileList'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='fileList'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
......@@ -127,6 +163,8 @@ export default {
data() {
return {
importLoading: false,
importModal: false,
drawerKeyValueArray: [],
drawer: false,
grid: {
......@@ -180,18 +218,25 @@ export default {
minWidth: 150,
},
{
title: '竞赛文件名',
key: 'file_name',
title: '竞赛类别',
slot: 'race_level',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '补助金额',
key: 'money',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '竞赛类别',
slot: 'race_level',
title: '审批状态',
slot: 'approval_state',
align: 'center',
show: true,
minWidth: 150,
minWidth: 200,
},
{
title: '补助时间',
......@@ -201,12 +246,14 @@ export default {
minWidth: 200,
},
{
title: '补助金额',
key: 'money',
title: '竞赛文件名',
key: 'file_name',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '计划集训时间',
key: 'plan_train_time',
......@@ -230,14 +277,6 @@ export default {
},
{
title: '审批状态',
slot: 'approval_state',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '操作',
align: 'center',
......@@ -295,7 +334,8 @@ export default {
page_size: 10,
total: 0,
},
pageKey: 1
pageKey: 1,
fileObject: {}
}
},
// 查询条件初始化
......@@ -311,11 +351,18 @@ export default {
this.getCompetitionSignList()
},
methods: {
importButton(row) {
window.open(row, '_blank')
},
importOk() {
},
async delCompetition(row) {
let data = {
id: row.bursaryid
}
const res = await api.BursaryDel(data)
hook.publicMessage(res)
await this.getCompetitionSignList()
},
......@@ -336,11 +383,10 @@ export default {
this.pageKey++
this.init.page_index = 1
const res = await this.getCompetitionSignList()
},
// 查询
async getCompetitionSignList() {
this.$Spin.show()
this.loading = true
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
......@@ -352,17 +398,37 @@ export default {
const res = await api.GetBursaryList(data)
this.tableData = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
},
// 新增
add() {
this.$refs.addEdit.add()
},
async importFile(row) {
this.importModal = true
this.importLoading = true
const res = await api.BursaryExport({id: row.bursaryid})
try {
delete res.response.response.file_name
let data = Object.entries(res.response.response)
let name = ['PDF导出', 'Word导出']
data.map((cur, index) => {
cur.push(name[index])
})
this.fileObject = data
this.importLoading = false
} catch (e) {
this.importLoading = false
}
},
// 修改
edit(row) {
async edit(row) {
let res = await api.GetBursaryInfo({id: row.bursaryid})
console.log("🚀🚀🚀,", res)
this.drawer = true
let array = _.cloneDeep(row)
delete array.bursaryid
delete array.grant_file
......@@ -370,7 +436,8 @@ export default {
delete array.createtime
delete array._rowKey
delete array._index
delete array.approval_remark
array.fileList = res.response.fileList
this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => {
let data = [
......@@ -380,8 +447,6 @@ export default {
'学号/工号',
'身份证',
'专业/班级',
'竞赛名称',
'竞赛文件名',
'竞赛类别',
......@@ -391,7 +456,8 @@ export default {
'实际集训起止时间',
'参赛具体情况',
'审批状态',
'审批意见'
// '审批意见'
'附件',
];
cur.push(data[index])
})
......
......@@ -42,34 +42,51 @@
<template #extra>
<Input v-model="search.name" placeholder="请输入竞赛名称..." style="width: 15vw;"></Input>
<Button type="primary" :disabled="searchButton" @click="searchFun" style="margin-left: 10px">查找</Button>
<Button type="primary" @click="batchApproval" style="margin-left: 10px" v-if="getRole">一键审批
</Button>
<Button type="primary" @click="importData" style="margin-left: 10px">证书数据导出</Button>
</template>
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #competition_type="{row}">
<!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way]
}}</Tag>-->
{{ ['', 'A类', 'B类'][row.competition_type] }}
</template>
<template #team_id="{row}">
<a @click="teamInfo(row.team_id)">详细</a>
</template>
<template #race_level="{row}">
<!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way]
}}</Tag>-->
{{ ['', '国家级', '省一级', '省二级'][row.race_level] }}
{{ ['', '国家级', '省一级', '省二级', '国际级'][row.race_level] }}
</template>
<template #way="{row}">
<Tag :color="['success','primary'][row.way]">{{ ['团队', '个人'][row.way] }}</Tag>
</template>
>
<template #approval_state="{row}">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][row.approval_state] }}
</template>
<template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button>
<!-- <Button v-if="false" type="info" @click="edit(row)">编辑</Button>-->
<a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button>
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
<!-- <Button type="primary" size="small" @click="edit(row)">详细</Button>-->
<!-- &lt;!&ndash; <Button v-if="false" type="info" @click="edit(row)">编辑</Button>&ndash;&gt;-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
......@@ -125,7 +142,7 @@
<Drawer :width="800" title="详细" :closable="true" v-model="drawer">
<div class="tableList">
<h1 style="display: flex;justify-content: center">证书上传详细</h1>
<h1 style="display: flex;justify-content: center">获奖材料上传</h1>
<table border="1" class="container">
<tr class="row" v-for="(item,index) in drawerKeyValueArray" :key="index">
<th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th>
......@@ -139,23 +156,54 @@
<!-- </td>-->
<th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='race_level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<td v-if="item[0]==='race_level'" class="colContent">
{{ ['', '国家级', '省一级', '省二级', '国际级'][item[1]] }}
</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='team_id'&&item[0]!=='level' &&item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
<th v-if="item[0]==='competition_type'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='competition_type'" class="colContent">
{{ ['', 'A类', 'B类'][item[1]] }}
</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">
{{ ['团队', '个人'][item[1]] }}
</td>
<th v-if="item[0]!=='studentExcellenceFileList'&&item[0]!=='StudentExcellence'&&item[0]!=='teacherExcellenceFileList'&&item[0]!=='competition_type'&&item[0]!=='team_id'&&item[0]!=='level' &&item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='team_id'&&item[0]!=='level'&&item[0]!=='race_level' && item[0]!=='way'&& item[0]!=='approval_state'"
<td v-if="item[0]!=='studentExcellenceFileList'&&item[0]!=='StudentExcellence'&&item[0]!=='teacherExcellenceFileList'&&item[0]!=='competition_type'&&item[0]!=='team_id'&&item[0]!=='level'&&item[0]!=='race_level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
<th v-if="item[0]==='teacherExcellenceFileList'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='teacherExcellenceFileList'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
<th v-if="item[0]==='studentExcellenceFileList'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='studentExcellenceFileList'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
......@@ -170,6 +218,8 @@
import * as hook from '../../hook'
import * as api from '../../api/requestUtils'
import _ from "lodash";
import util from '@/libs/util';
import utilCookies from "@/libs/util.cookies";
export default {
name: 'list',
......@@ -204,6 +254,13 @@ export default {
show: true,
minWidth: 200,
},
{
title: '赛项名称',
key: 'competitionsubitem_name',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '主办单位',
key: 'sponsor',
......@@ -219,26 +276,48 @@ export default {
minWidth: 100,
},
{
title: '获奖团队',
slot: 'team_id',
title: '竞赛类别',
slot: 'competition_type',
align: 'center',
show: true,
minWidth: 120,
minWidth: 100,
},
// {
// title: '获奖团队',
// slot: 'team_id',
// align: 'center',
// show: true,
// minWidth: 120,
// },
{
title: '证书名称',
key: 'certificate_name',
title: '申请人',
key: 'createby',
align: 'center',
show: true,
minWidth: 150,
minWidth: 120,
},
{
title: '证书描述',
key: 'certificate_description',
title: '比赛形式',
slot: 'way',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
// {
// title: '证书名称',
// key: 'certificate_name',
// align: 'center',
// show: true,
// minWidth: 150,
// },
// {
// title: '证书描述',
// key: 'certificate_description',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '审批状态',
slot: 'approval_state',
......@@ -246,10 +325,24 @@ export default {
show: true,
minWidth: 150,
},
{
title: '比赛开始时间',
key: 'begin_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '比赛结束时间',
key: 'end_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '操作',
align: 'center',
minWidth: 180,
minWidth: 130,
fixed: 'right',
show: true,
slot: 'action'
......@@ -364,11 +457,37 @@ export default {
searchButton() {
return this.search.way === '' && this.search.level === '' && this.search.name === '' && this.search.approval_state === ''
},
getRole() {
let info = JSON.parse(util.cookies.get('userinfo'))
return info.role.indexOf('["管理员"]') !== -1
}
},
mounted() {
this.getGetCertificateList()
},
methods: {
importData() {
hook.myEncapsulationFunction(async () => {
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
"way": this.search.wayCurrentValue,
"approval_state": this.search.approval_stateCurrentValue,
"page_index": this.init.page_index,
"page_size": this.init.page_size,
}
const res = await api.CertificateExportToExcel(data)
window.location.href = res.response
return res
})
},
batchApproval() {
hook.myEncapsulationFunction(async () => {
return await api.CertificateSetState()
})
},
async teamInfo(e) {
this.$Spin.show()
try {
......@@ -392,10 +511,12 @@ export default {
id: row.certificateid
}
const res = await api.CertificateDel(data)
hook.publicMessage(res)
await this.getGetCertificateList()
},
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.getGetCertificateList()
},
// 切换每页条数
......@@ -410,12 +531,13 @@ export default {
this.search.approval_stateCurrentValue = this.search.approval_state
this.pageKey++
this.init.page_index = 1
const res = await this.getGetCertificateList()
},
// 查询
async getGetCertificateList() {
this.$Spin.show()
this.loading = true
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
......@@ -427,7 +549,7 @@ export default {
const res = await api.GetCertificateList(data)
this.tableData = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
},
// 新增
......@@ -435,16 +557,29 @@ export default {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
async edit(row) {
this.drawer = true
let array = _.cloneDeep(row)
let res = await api.GetCertificateInfo({id: row.certificateid})
console.log("🚀🚀🚀,", res)
let array = _.cloneDeep(res.response.certificateInfo)
delete array.competitionreportid
delete array.certificateid
delete array.certificate_file
delete array.createtime
delete array._rowKey
delete array._index
delete array.approval_remark
delete array.certificate_description
delete array.team_id
delete array.competitionsubitem_id
array.teacherExcellenceFileList = res.response.teacherExcellenceFileList
array.studentExcellenceFileList = res.response.studentExcellenceFileList
// array.StudentExcellence = res.response.studentExcellenceFileList
delete array.money
delete array.team_id
delete array.certificate_name
console.log("🚀🚀array🚀,", array)
this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => {
let data = [
......@@ -452,16 +587,26 @@ export default {
'赛事名称',
'主办单位',
'赛事级别',
'获奖团队',
'证书名称',
'证书描述',
// '证书名称',
'审批状态',
'审批意见'
// '获奖奖金',
'竞赛类别',
'比赛开始时间',
'比赛结束时间',
// '证书描述',
'赛项名称',
'竞赛形式',
'申请人',
'教师证书',
'学生证书',
// '审批意见'
];
cur.push(data[index])
})
console.log("🚀🚀🚀,", this.drawerKeyValueArray)
console.log("🚀🚀drawerKeyValueArray🚀,", this.drawerKeyValueArray)
},
// 删除
......
......@@ -47,6 +47,7 @@
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #race_level="{row}">
......@@ -69,10 +70,17 @@
</template>
<template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button>
<a @click="importFile(row)">导出</a>
<a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button>
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
<!-- <Button type="primary" size="small" @click="importFile(row)">导出</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)">详细</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
......@@ -96,35 +104,70 @@
<table border="1" class="container">
<tr class="row" v-for="(item,index) in drawerKeyValueArray" :key="index">
<th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='level'" class="colContent">{{ ['国家级', '省一级', '省二级'][item[1]] }}</td>
<td v-if="item[0]==='level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
<th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='race_level'" class="colContent">{{ ['国家级', '省一级', '省二级'][item[1]] }}</td>
<td v-if="item[0]==='race_level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
<th v-if="item[0]!=='projectInfo'&&item[0]!=='trainPlanInfo' &&item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
<td v-if="item[0]!=='projectInfo'&&item[0]!=='trainPlanInfo'&&item[0]!=='level' && item[0]!=='race_level'&& item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
<th v-if="item[0]==='trainPlanInfo'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='trainPlanInfo'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
<th v-if="item[0]==='projectInfo'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='projectInfo'" class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
</div>
</Drawer>
<Modal
v-model="importModal"
title="文件导出"
>
<Spin fix v-if="importLoading"></Spin>
<div style=" display: flex;justify-content: space-around;">
<Button icon="md-log-in" @click="importButton(item[1])" v-for="(item,index) in fileObject" :key="index">
{{
item[2]
}}
</Button>
</div>
<template #footer>
<Button type="text" @click="importModal =false">关闭</Button>
<!-- <Button type="primary" @click="importOk">确定</Button>-->
</template>
</Modal>
</div>
</template>
......@@ -326,7 +369,11 @@ export default {
page_size: 10,
total: 0,
},
pageKey: 1
pageKey: 1,
importLoading: false,
importModal: false,
fileObject: [],
}
},
// 查询条件初始化
......@@ -342,11 +389,36 @@ export default {
this.getCompetitionSignList()
},
methods: {
importButton(row) {
window.open(row, '_blank')
},
async importFile(row) {
console.log("🚀🚀🚀,", row)
this.importModal = true
this.importLoading = true
const res = await api.SignExport({id: row.competitionsignid})
try {
delete res.response.response.file_name
let data = Object.entries(res.response.response)
let name = ['PDF导出', 'Word导出']
data.map((cur, index) => {
cur.push(name[index])
})
this.fileObject = data
this.importLoading = false
} catch (e) {
this.importLoading = false
}
},
async delCompetition(row) {
let data = {
id: row.competitionsignid
}
const res = await api.SignDel(data)
hook.publicMessage(res)
await this.getCompetitionSignList()
},
......@@ -367,11 +439,10 @@ export default {
this.pageKey++
this.init.page_index = 1
const res = await this.getCompetitionSignList()
},
// 查询
async getCompetitionSignList() {
this.$Spin.show()
this.loading = true
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
......@@ -383,7 +454,7 @@ export default {
const res = await api.GetSignList(data)
this.tableData = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
},
// 新增
......@@ -391,9 +462,9 @@ export default {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
async edit(row) {
let res = await api.GetSignInfo({id: row.competitionsignid})
this.drawer = true
let array = _.cloneDeep(row)
delete array.competitionsignid
delete array.competitionreportid
......@@ -404,6 +475,9 @@ export default {
delete array._rowKey
delete array._index
delete array.sign_up
delete array.approval_remark
array.trainPlanInfo = res.response.trainPlanInfo
array.projectInfo = res.response.projectInfo
this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => {
let data = [
......@@ -423,12 +497,14 @@ export default {
'培训结束时间',
'竞赛的其他要求',
'审批状态',
'审批意见'
// '审批意见'
'培训计划附件',
'竞赛方案附件',
];
cur.push(data[index])
})
console.log("🚀🚀🚀,", this.drawerKeyValueArray)
},
// 删除
del(row) {
......@@ -465,7 +541,6 @@ export default {
text-align: center;
width: 200px;
height: 50px;
}
.colContent {
......@@ -473,6 +548,10 @@ export default {
height: 50px;
text-align: center;
}
.aText:hover {
transform: scale(1.2);
}
}
}
......
<template>
<div class="container">
<div class="header">
<h1 style="display: flex;justify-content: center"> 竞赛公告详细</h1>
<div style="margin-left:20px;display: flex;align-items: center">
<Notification
:count="data.length"
@on-load-more="handleLoadMore"
@on-clear="handleClear"
:scroll-to-load="true"
:show-clear="false"
:clear-close="true"
:locale="loading"
>
<NotificationTab
title="需阅读用户列表"
name="message"
>
<template #clear>
关闭
</template>
<NotificationItem
v-for="(item, index) in data.publicList"
:key="index"
:title="item.public_name"
:content="['未读','已读'][item.is_read]"
:read="item.is_read"
:tag="item.public_type === 'Team' ? '团队': item.public_type === 'UserInfo' ? '个人' :'公告用户组'"
/>
</NotificationTab>
</Notification>
(阅读列表)
</div>
</div>
<div class="content">
<Card style="width: 50%;margin-top: 20px;border-radius: 20px;box-sizing: border-box">
<div class="tableList">
<table border="1" class="container1">
<tr v-for="(item,index) in data.keyValueArray" :key="index">
<th v-if="item[0]==='is_top'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_top'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<th v-if="item[0]==='is_public'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_public'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<th v-if="item[0]==='content'" class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]==='content'" class="colContent">
<spin style="max-height: 500px;overflow-y: auto" v-html="item[1]"></spin>
</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
</tr>
<tr>
<th>附件:</th>
<td class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in data.fileList"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
</div>
</Card>
</div>
</div>
</template>
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import * as api from "@api/requestUtils";
import * as hook from "@/hook";
export default {
//import引入的组件需要注入到对象中才能使用",
components: {},
data() {
//这里存放数据",
return {
init: {
noticeid: '',
is_readTrue: 0,
is_readFalse: 0,
},
data: {
Object: {}
}
};
},
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {},
//方法集合",
methods: {
handleLoadMore() {
},
handleClear(e) {
console.log("🚀🚀🚀,", e)
},
async getNoticeInfo() {
this.$Spin.show()
const downSpin = (res) => {
if (res.code !== 1) {
this.$Spin.hide();
this.$Message.error('无数据')
}
}
this.init.noticeid = this.$route.query.id
const res4 = await api.GetNoticeInfo({id: this.$route.query.id})
this.data = res4.response
this.data.length = res4.response.publicList.length
downSpin(res4)
this.data.Object = res4.response
delete res4.response.noticeInfo.noticeid
delete res4.response.noticeInfo.typeid
delete res4.response.noticeInfo.createtime
delete res4.response.noticeInfo.competitionreportid
this.data.keyValueArray = Object.entries(res4.response.noticeInfo)
this.data.keyValueArray.map((cur, index) => {
let array4 = [
// 'bursaryid',
'公告标题',
'公告类型',
'发布时间',
'发布用户',
'是否置顶',
'是否发布',
'审批状态',
'修改人',
'修改时间',
'公告内容',
]
cur.push(array4[index])
})
hook.publicMessage(res4)
}
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
created() {
},
//生命周期 - 挂载之前",html模板未渲染
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.getNoticeInfo()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
beforeUpdate() {
},
//生命周期 - 更新之后",数据模型已更新,html模板已更新
updated() {
},
//生命周期 - 销毁之前",
beforeDestroy() {
},
destroyed() {
},
//生命周期 - 销毁完成",
//如果页面有keep-alive缓存功能,这个函数会触发",
activated() {
},
}
</script>
<style scoped>
.container {
width: 100vw;
height: 100vh;
}
.header {
width: 100%;
height: 8%;
background-color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
}
.content {
width: 100%;
height: 92%;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
justify-content: center;
.tableList {
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
.container1 {
border-collapse: collapse;
box-sizing: border-box;
width: 100%;
.row {
width: 100%;
height: 100%;
}
.colTitle {
text-align: center;
width: 30%;
height: 50px;
}
.colContent {
width: 70%;
height: 50px;
text-align: center;
}
}
}
}
</style>
<template>
<div class="container">
<Card style="width: 50%">
<template #title><h2 style="text-align: center">
竞赛公告编辑</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<Row>
<Col :span="12">
<FormItem label="公告标题" prop="title">
<Input v-model="formValidate.title" placeholder="请输入公告标题"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="公告类型" prop="typeid">
<Select v-model="formValidate.typeid"
placeholder="请选择公告类型">
<Option v-for="(item,index) in noticeSelect" :key="index"
:value="item.id">
{{ item.name }}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<!-- <Row>-->
<!-- <Col :span="12">-->
<!-- <FormItem label="公告是否置顶" prop="is_top">-->
<!-- <Select v-model="formValidate.is_top"-->
<!-- placeholder="请选择是否置顶">-->
<!-- <Option v-for="(item,index) in noticeIsTop" :key="index"-->
<!-- :value="item.value">-->
<!-- {{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- </Col>-->
<!-- </Row>-->
<richText :value="formValidate.content" :minHeight="500" @setRichTextValue="getRichTextValue"></richText>
<!-- <FormItem>-->
<Upload
:multiple="true"
:before-upload="beforeUpload"
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:show-upload-list="true"
type="drag"
action=""
>
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>附件上传</p>-->
<div style="padding: 20px 0;width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>附件上传</p>
</div>
</Upload>
<div class="filelist" v-for="(item,index) in files_list" :key="index">
{{ item.file_name }}
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)" type="ios-trash"/>
</div>
<!-- </FormItem>-->
<FormItem>
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">保存
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</Card>
</div>
<!-- <Grid center square :border="false" style="height: 100%">-->
<!-- <GridItem >1</GridItem>-->
<!-- <GridItem>2</GridItem>-->
<!-- <GridItem>3</GridItem>-->
<!-- </Grid>-->
</template>
<script>
import * as hook from '../../../hook'
import * as api from '../../../api/requestUtils'
import _ from "lodash";
import richText from '../../../components/quill/index.vue'
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用",
components: {richText},
data() {
//这里存放数据",
return {
noticeIsTop: [
{value: 0, name: '否'},
{value: 1, name: '是'}
],
noticeSelect: [],
teamSelect: [],
competitionNameArray: [],
approval_stateArray: [
{value: 0, label: '未审批'},
{value: 1, label: '审批中'},
{value: 2, label: '审批通过'},
{value: 3, label: '审批不通过'},
],
levelArray: [
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
competitionnameValue: '',
formValidate: {
"noticeid": "",
"title": "",
"typeid": "",
content: '',
},
module: '',
"files_list": [],
ruleValidate: {
title: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
typeid: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
is_top: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
"competitionname": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
"sponsor": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
race_level: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
team_id: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
certificate_name: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
certificate_description: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
}
}
},
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {
'formValidate.content'(newValue, oldValue) {
console.log("🚀🚀newValue🚀,", newValue)
}
},
//方法集合",
methods: {
getRichTextValue(e) {
this.formValidate.content = e
},
fileDelete(e) {
this.files_list.map((cur, index) => {
if (cur.id === e.id) {
this.files_list.splice(index, 1)
}
})
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
},
onsuccess(response, file, fileList) {
console.log("🚀🚀🚀,onsuccess", response, file, fileList)
},
onFormatError(response, file, fileList) {
this.$Message.info('文件类型错误!')
},
async beforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload(this.module, formData);
this.files_list.push(res.response)
hook.publicMessage(res)
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
await hook.myEncapsulationFunction(async () => {
this.formValidate.files_list = this.files_list
let data = _.cloneDeep(this.formValidate)
const res = await api.NoticeSave(data)
setTimeout(() => {
localStorage.setItem('updataEvent', 'getDataEvent');
window.close()
}, 1500)
return res
})
}
})
},
handleReset() {
this.formValidate = {}
},
async getCompetiotionName() {
const res = await api.GetReportSelect()
this.competitionNameArray = res.response
const date = await api.TeamSelect()
this.teamSelect = date.response
const noticeSelect = await api.NoticeTypeSelect()
this.noticeSelect = noticeSelect.response
},
async GetNoticeInfo() {
this.$Spin.show()
const res = await api.GetNoticeInfo({id: this.formValidate.noticeid})
try {
this.formValidate = res.response.noticeInfo
this.files_list = res.response.fileList
this.$Spin.hide()
} catch (e) {
this.$Spin.hide()
}
}
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
created() {
},
//生命周期 - 挂载之前",html模板未渲染
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.getCompetiotionName()
this.formValidate.noticeid = this.$route.query.id;
this.module = this.$route.query.remark;
console.log("🚀🚀🚀,", this.module)
this.GetNoticeInfo()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
beforeUpdate() {
},
//生命周期 - 更新之后",数据模型已更新,html模板已更新
updated() {
},
//生命周期 - 销毁之前",
beforeDestroy() {
},
destroyed() {
},
//生命周期 - 销毁完成",
//如果页面有keep-alive缓存功能,这个函数会触发",
activated() {
},
}
</script>
<style>
.filelist {
}
.filelist:hover {
color: #1e93ff;
background-color: #f7f7f7;
}
.fileddelete {
}
.fileddelete:hover {
color: red;
transform: scale(1.5);
}
</style>
<style>
.container {
width: 100%;
min-height: 887px;
height: auto;
display: flex;
align-content: center;
justify-content: center;
flex-wrap: wrap;
}
</style>
<template>
<div>
<Card ref="card">
<template #title>
<div style="height: 80px">
<h3>竞赛公告列表</h3>
<Row style="margin-top:30px">
<Col span="8">
时间范围:
<DatePicker @on-change="selectTimeRange" type="daterange" placement="bottom-end"
placeholder="请选择时间范围"
style="width: 200px"/>
</Col>
<Col span="8">
<div style="display: flex;align-items: center;justify-content: center">
是否发布:
<Select v-model="search.is_public" style="width: 10vw;">
<Option v-for="(item,index) in search.is_publicArray" :value="item.value" :key="index"> {{
item.label
}}
</Option>
</Select>
</div>
</Col>
<Col span="8">
<div style="display: flex;align-items: center;justify-content: flex-end;">
审批状态:
<Select v-model="search.approval_state" style="width: 10vw;">
<Option v-for="(item,index) in search.approval_stateArray" :value="item.value" :key="index">
{{ item.label }}
</Option>
</Select>
</div>
</Col>
</Row>
</div>
<!-- <Button type="primary" class="ivu-ml-8" @click="add"><Icon type="md-add"/>新增竞赛</Button>-->
</template>
<template #extra>
<div style="display: flex">
<Input placeholder="请输入公告标题搜索..." v-model="search.value"
style="width: 15vw;margin-right: 10px"></Input>
<Button :disabled="!search.value" type="primary" @click="searchFun">搜索</Button>
</div>
</template>
<Table
:columns="columns"
:data="init.tableData"
:loading="loading"
>
<template #is_top="{row}">
<Switch ref="refSwitch" true-color="#22d86e" :value="Boolean(row.is_top)"
@on-change="changeSwitch(row)" :key="switchKey">
<template #open>
<span>是</span>
</template>
<template #close>
<span>否</span>
</template>
</Switch>
</template>
<template #approval_state="{row}">
{{
[
'未审批',
'审批中',
'审批通过',
'审批不通过',][row.approval_state]
}}
</template>
<template #is_public="{row}">
{{
['否', '是'][row.is_public]
}}
</template>
<template #title="{row}">
<Tooltip max-width="200" :transfer="true" :content="row.title" placement="top">
<Ellipsis :text="row.title" :length="30"></Ellipsis>
</Tooltip>
</template>
<template #content="{row}">
<Ellipsis :text="row.content" :length="80"></Ellipsis>
</template>
<template slot-scope="{ row }" slot="action">
<a @click="publicNotice(row)" style="margin-left: 15px;">发布</a>
<a @click="info(row)" style="margin-left: 15px;">详细</a>
<a @click="edit(row)" style="margin-left: 15px;">编辑</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
<!-- <Button type="success" size="small" @click="publicNotice(row)">发布</Button>-->
<!-- <Button type="info" size="small" @click="info(row)" style="margin-left: 10px">详细</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)" style="margin-left: 10px">编辑</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" size="small" style="margin-left: 10px">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangePageSize"
/>
</div>
<!-- 新增修改 -->
</Card>
<Modal
width="50%"
:styles="{top: '20px'}"
v-model="modal"
title="推送用户选项"
>
<div>
<Tabs type="card" @on-click="tabs">
<TabPane label="个人" name="UserInfo">
<div style="display: flex;">
<!-- <div style="display: flex;align-items: center">-->
<!-- <Form ref="pushData" :model="pushData" :rules="ruleValidate" :label-width="100">-->
<!-- <FormItem label="公告类型:" prop="public_type">-->
<!-- <Select style="width:350px;margin-bottom: 10px" v-model="pushData.public_type">-->
<!-- <Option v-for="(item,index) in pushNotice.noticeTypeArray" :value="item.id" :key="index">{{-->
<!-- item.name-->
<!-- }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- </Form>-->
<!-- </div>-->
<div style="height: 40px; margin-left: auto ;display: flex;flex-wrap: nowrap">
<Input v-model="pushNotice.searchValue" placeholder="请输入姓名或卡号搜索..."></Input>
<Button type="primary" @click="searchButton" :disabled="pushNotice.searchValue===''"
style="margin-left: 10px;">
搜索
</Button>
<Button type="text" @click="searchReset('userInfo')" style="margin-left: 10px;">重置</Button>
</div>
</div>
<Table :columns="pushNotice.columns" :data="pushNotice.userArray" @on-select-all="modalTableSelectAll"
@on-select-all-cancel="modalTableSelectAllCancel" @on-select="modalTableSelect"
@on-select-cancel="modalTableSelectCancel" :key="pushNotice.tableKey" :loading="loading1">
</Table>
<div style="height: 40px;margin-top: 20px">
<Page
show-total
:key="pushNotice.pageKey"
show-sizer
show-elevator
:total="pushNotice.total"
:page-size="pushNotice.page_size"
model-value="pushNotice.page_index"
@on-change="currentPage1"
@on-page-size-change="currentPageCount1"
:transfer="true"
/>
</div>
<div style="float: right">
<Button @click="modal =false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('userInfo')">提交</Button>
</div>
</TabPane>
<TabPane label="团队" name="Team">
<div style="display: flex;justify-content: space-between">
<Form ref="pushData" :model="pushData" :rules="ruleValidate" :label-width="100">
<FormItem label="团队:" prop="Team">
<Select style="width:30vw;margin-bottom: 10px" v-model="pushData.Team" multiple filterable>
<Option v-for="(item,index) in pushNotice.noticeTeamArray" :value="item.id" :key="index">{{
item.name
}}
</Option>
</Select>
</FormItem>
</Form>
<div>
<Button @click="modal =false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('Team')">提交</Button>
</div>
</div>
</TabPane>
<TabPane label="公告用户组" name="NoticeUserGroup">
<div style="display: flex;justify-content: space-between">
<Form ref="pushData" :model="pushData" :rules="ruleValidate" :label-width="110">
<FormItem label="公告用户组:" prop="NoticeUserGroup">
<Select style="width:30vw;margin-bottom: 10px" v-model="pushData.NoticeUserGroup" multiple
filterable>
<Option v-for="(item,index) in pushNotice.noticeNoticeUserGroupArray" :value="item.id" :key="index">
{{
item.name
}}
</Option>
</Select>
</FormItem>
</Form>
<div>
<Button @click="modal =false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('NoticeUserGroup')">提交</Button>
</div>
</div>
</TabPane>
</Tabs>
</div>
<template #footer>
{{ null }}
</template>
</Modal>
</div>
</template>
<script>
import * as api from '../../api/requestUtils'
import * as hook from '../../hook/index'
export default {
name: 'list',
data() {
return {
ruleValidate: {
NoticeUserGroup: [
{type: 'array', required: true, message: '该项不能为空', trigger: 'change'}
],
Team: [
{type: 'array', required: true, message: '该项不能为空', trigger: 'change'}
],
public_type: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
},
modal: false,
pushData: {
public_type: '',
noticeid: '',
userInfo: [],
Team: [],
NoticeUserGroup: [],
"public_id_list": [],
},
pushNotice: {
tableKey: 0,
noticeTypeArray: [],
page_index: 1,
page_size: 10,
total: 0,
Value: '',
userArray: [],
searchValue: '',
columns: [
{
type: 'selection',
minWidth: 100,
},
{
title: '姓名',
minWidth: 100,
key: 'name',
},
{
title: '卡号/学号',
minWidth: 100,
key: 'card_name',
},
],
},
tableData: [],
switchKey: 0,
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '公告标题',
slot: 'title',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '内容',
slot: 'content',
align: 'center',
show: true,
minWidth: 400,
},
{
title: '创建人',
key: 'createby',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '公告分类',
key: 'typename',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '是否置顶',
slot: 'is_top',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '审批状态',
slot: 'approval_state',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '是否发布',
slot: 'is_public',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '发布时间',
key: 'publish_time',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '修改人',
key: 'modifyby',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '操作',
align: 'center',
minWidth: 230,
fixed: 'right',
slot: 'action'
}
],
loading: false,
loading1: false,
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
params: {
pageIndex: 1,
pageSize: 10,
college_id: '',
grade: '',
classId_Name: '',
status: ''
},
init: {
columns: [],
tableData: [],
page_index: 1,
page_size: 10,
total: 0,
"title": "",
"start_time": "",
"end_time": "",
"public_type": "",
"approval_state": "",
"is_public": "",
},
search: {
start_time: '',
end_time: '',
is_public: '',
value: '',
currentValue: '',
way: '',
name: '',
approval_state: '',
level: '',
wayCurrentValue: '',
nameCurrentValue: '',
approval_stateCurrentValue: '',
levelCurrentValue: '',
is_publicArray: [
{value: 0, label: '否'},
{value: 1, label: '是'},
],
approval_stateArray: [
{value: 0, label: '未审批'},
{value: 1, label: '审批中'},
{value: 2, label: '审批通过'},
{value: 3, label: '审批不通过'},
],
levelArray: [
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
},
}
},
// 查询条件初始化
created() {
},
watch: {
'pushData.userInfo'(newvalue, oldvalue) {
console.log("🚀🚀🚀,", newvalue)
},
'pushData.public_id_list'(newvalue, oldvalue) {
console.log("🚀public_id_list🚀🚀,", newvalue)
},
},
mounted() {
this.GetNoticeList()
this.GetPersonList()
this.NoticeTypeSelect()
this.TeamSelect()
this.GetNoticeUserGroupSelect()
hook.storageAddEventListener(() => {
this.GetNoticeList()
})
},
methods: {
tabs(e) {
console.log("🚀🚀🚀,", e)
},
async GetNoticeUserGroupSelect() {
const res = await api.GetNoticeUserGroupSelect()
this.pushNotice.noticeNoticeUserGroupArray = res.response
},
async TeamSelect() {
const res = await api.TeamSelect()
this.pushNotice.noticeTeamArray = res.response
},
async NoticeTypeSelect() {
const res = await api.NoticeTypeSelect()
this.pushNotice.noticeTypeArray = res.response
},
async searchButton() {
this.pushNotice.Value = this.pushNotice.searchValue
await this.GetPersonList()
},
searchReset(e) {
switch (e) {
case 'userInfo':
this.pushNotice.searchValue = ''
this.pushNotice.Value = ''
this.pushData.public_type = ''
this.pushData.userInfo = []
this.pushNotice.tableKey++
break;
}
},
handleSubmit(e) {
const fun = (data) => {
hook.myEncapsulationFunction(async () => {
const res = await api.NoticePublic(data)
return res
})
}
switch (e) {
case 'userInfo':
this.pushData.public_id_list = this.pushData.userInfo
this.pushData.public_type = 'UserInfo'
let data = this.pushData
fun(data)
break;
case 'Team':
this.pushData.public_id_list = this.pushData.Team
this.pushData.public_type = e
let data1 = this.pushData
fun(data1)
break;
case 'NoticeUserGroup':
this.pushData.public_id_list = this.pushData.NoticeUserGroup
this.pushData.public_type = e
let data2 = this.pushData
fun(data2)
break;
}
},
async GetPersonList() {
this.loading1 = true
let data = {
page_index: this.pushNotice.page_index,
page_size: this.pushNotice.page_size,
condition: this.pushNotice.Value,
}
const res = await api.GetPersonList(data)
this.pushNotice.total = res.response.data_count
this.pushNotice.userArray = res.response.data
this.loading1 = false
},
changeSwitch(row) {
hook.myEncapsulationFunction(async () => {
let data = {
id: row.noticeid,
is_top: Boolean(row.is_top) ? 0 : 1,
}
const res = await api.NoticeSetTop(data)
await this.GetNoticeList()
return res
})
this.switchKey++
},
searchFun() {
this.init.start_time = this.search.start_time
this.init.end_time = this.search.end_time
this.init.title = this.search.value
this.init.approval_state = this.search.approval_state
this.init.is_public = this.search.is_public
this.GetNoticeList()
},
selectTimeRange(e) {
this.search.start_time = e[0]
this.search.end_time = e[1]
},
// 查询
async GetNoticeList() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
"title": this.init.title,
"start_time": this.init.start_time,
"end_time": this.init.end_time,
"approval_state": this.init.approval_state,
"is_public": this.init.is_public,
}
try {
const res = await api.GetNoticeList(data);
this.init.total = res.response.data_count
this.init.tableData = res.response.data
this.loading = false
} catch {
this.loading = false
}
},
// 新增
add() {
this.$refs.addEdit.add()
},
publicNotice(row) {
this.modal = true
this.pushData.noticeid = row.noticeid
},
//详细
info(row) {
const url = this.$router.resolve({
name: 'noticeInfo',
query: {
id: row.noticeid,
}
})
window.open(url.href, '_blank')
},
// 修改
edit(row) {
let url = this.$router.resolve({
name: 'updateNotice',
query: {
id: row.noticeid,
remark: 'Notice',
}
})
window.open(url.href, '_blank')
},
// 删除
del(row) {
hook.myEncapsulationFunction(async () => {
const res = await api.NoticeDel({id: row.noticeid})
await this.GetNoticeList()
return res
})
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.GetNoticeList()
},
// 切换每页条数
handleChangePageSize(size) {
this.init.page_size = size
this.GetNoticeList()
},
currentPage1(pageNumber) {
this.pushNotice.page_index = pageNumber
this.GetPersonList()
},
currentPageCount1(pageNumber) {
this.pushNotice.page_size = pageNumber
this.GetPersonList()
},
modalTableSelectAll(selection) {
let array = []
selection.map((cur, index) => {
array.push(cur.card_name)
})
this.pushData.userInfo = array
},
modalTableSelectAllCancel(selection) {
let array = []
selection.map((cur, index) => {
array.push(cur.card_name)
})
this.pushData.userInfo = array
},
modalTableSelect(selection) {
let array = []
selection.map((cur, index) => {
array.push(cur.card_name)
})
this.pushData.userInfo = array
},
modalTableSelectCancel(selection) {
let array = []
selection.map((cur, index) => {
array.push(cur.card_name)
})
this.pushData.userInfo = array
},
}
}
</script>
<style>
.ts:hover {
color: #1e93ff;
transform: scale(1.5);
}
</style>
<template>
<div>
<Card ref="card">
<template #title>
<div style="height: 30px;display: flex;align-items: center">
<h3>竞赛成绩</h3>
</div>
</template>
<!-- <Button type="primary" class="ivu-ml-8" @click="add">-->
<!-- <Icon type="md-add"/>-->
<!-- 新增-->
<!-- </Button>-->
<template #extra>
参与方式:
<Select v-model="init.reportid" style="width: 10vw;">
<Option v-for="(item,index) in personageCompetitionSelect" :value="item.id" :key="index"> {{ item.name }}
</Option>
</Select>
<Button class="ivu-ml-8" @click="resetSearchSelect">
重置
</Button>
</template>
<Table
:columns="columns"
:data="tableData"
class="ivu-mt"
:loading="loading"
:size="tableSize"
>
<template #way="{row}">
<tag :color="['success','primary'][row.way]"> {{ ['团队', '个人'][row.way] }}</tag>
</template>
<template v-slot:is_win="{row}">
<tag :color="['primary','success'][row.is_win]"> {{ ['否', '是'][row.is_win] }}</tag>
<!-- <Switch v-if="!!tableData.length " size="large" v-model="row.is_win" :true-value="1" :false-value="0"-->
<!-- @on-change="switchChange(row)">-->
<!-- <span type="md-checkmark" slot="open">是</span>-->
<!-- <span type="md-close" slot="close">否</span>-->
<!-- </Switch>-->
</template>
<template slot-scope="{ row }" slot="action">
<a @click="importScore(row)">录入成绩</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="importScore(row)" @on-cancel="cancel">
<a style="margin-left: 15px;color: red">删除成绩</a>
</Poptip>
<!-- <Button type="info" @click="importScore(row)">录入成绩</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除成绩</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangepage_size"
/>
</div>
</Card>
<Modal
v-model="scoreModal"
title="编辑"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="竞赛成绩" prop="score">
<InputNumber style="width: 100%" :min="0" :max="100" v-model="formValidate.score"
placeholder="请输入竞赛成绩"></InputNumber>
</FormItem>
<FormItem label="是否获奖" prop="is_win">
<Select style="width: 100%" v-model="formValidate.is_win"
placeholder="请输入竞赛成绩">
<Option :value="i.value" v-for="(i,ind) in is_winArray" :key="ind">{{ i.name }}</Option>
</Select>
</FormItem>
<FormItem label="奖项名称" prop="prizes1">
<Input :disabled="prizesDis" style="width: 100%" v-model="formValidate.prizes"
placeholder="请输入奖项名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="scoreModal =false">取消</Button>
<Button type="primary" @click="scoreOk">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from "@api/requestUtils";
import {myEncapsulationFunction} from "@/hook";
export default {
name: 'list',
data() {
return {
prizesDis: false,
personageCompetitionSelect: [],
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '赛事名称',
key: 'competitionname',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '报名者',
key: 'sign_name',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '竞赛形式(团/个人)',
slot: 'way',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '成绩',
key: 'score',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '是否获奖',
slot: 'is_win',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '奖项',
key: 'prizes',
align: 'center',
show: true,
minWidth: 120,
},
// {
// title: '创建时间',
// key: 'createtime',
// align: 'center',
// show: true,
// minWidth: 120,
// },
// {
// title: '创建人',
// key: 'createby',
// align: 'center',
// show: true,
// minWidth: 150,
// },
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 120,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '操作',
align: 'center',
minWidth: 180,
fixed: 'right',
show: true,
slot: 'action'
}
],
loading: false,
tableData: [],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
init: {
select: '',
page_index: 1,
page_size: 10,
total: 0,
reportid: '',
score: 0,
},
is_winArray: [
{name: '否', value: 0},
{name: '是', value: 1},
],
scoreModal: false,
ruleValidate: {
score: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'},
],
prizes: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'},
],
is_win: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'},
],
},
formValidate: {
score: 0,
id: '',
prizes: '',
is_win: '',
}
}
},
watch: {
'init.reportid'(newValue, oldValue) {
this.init.reportid = newValue
newValue ? this.getData() : ''
},
'formValidate.is_win'(newValue, oldValue) {
Boolean(newValue) ? this.prizesDis = false : this.prizesDis = true
}
},
// 查询条件初始化
created() {
},
mounted() {
// this.getData()
this.GetScoreBySignSelect()
},
methods: {
scoreOk() {
this.$refs['formValidate'].validate((val) => {
if (val) {
myEncapsulationFunction(async () => {
let data = this.formValidate
const res = await api.ScoreSave(data)
await this.getData()
this.scoreModal = false
return res
})
}
})
},
// switchChange(row) {
// myEncapsulationFunction(async () => {
// let data = {
// id: row.scoreid,
// is_win: !Boolean(row.is_win) ? 0 : 1
// }
// const res = await api.WinSave(data)
// await this.getData()
// return res
// })
// console.log("🚀🚀row🚀,", row)
// },
resetSearchSelect() {
this.init.reportid = ''
},
async GetScoreBySignSelect() {
const res = await api.GetScoreBySignSelect()
this.personageCompetitionSelect = res.response
},
// 查询
async getData() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
reportid: this.init.reportid,
}
const res = await api.GetScoreList(data)
try {
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
} catch (e) {
this.loading = false
}
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.$refs.addEdit.edit(row)
},
importScore(row) {
this.scoreModal = true
this.formValidate = {}
this.formValidate.id = row.scoreid
},
// 删除
del(row) {
myEncapsulationFunction(async () => {
const res = await api.ScoreDel({id: row.scoreid})
this.getData()
return res
})
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.getData()
},
// 切换每页条数
handleChangepage_size(size) {
this.current = 1;
this.init.page_size = size
this.getData()
},
}
}
</script>
......@@ -26,7 +26,10 @@
<table border="1" class="container1">
<tr v-for="(item,index) in data.keyValueArray" :key="index">
<th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='level'" class="colContent">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</td>
<td v-if="item[0]==='level'" class="colContent">{{
['', '国家级', '省一级', '省二级', '国际级'][item[1]]
}}
</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
......@@ -35,12 +38,19 @@
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]==='competition_type'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='competition_type'" class="colContent">{{
['', 'A类', 'B类'][item[1]]
}}
</td>
<th v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colTitle">{{
<th v-if="item[0]!=='competition_type'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colContent">{{
<td v-if="item[0]!=='competition_type'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
......@@ -55,6 +65,16 @@
</a>
</td>
</tr>
<!-- <tr>-->
<!-- <th>赛项名称:</th>-->
<!-- <td class="colContent">-->
<!-- <a class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"-->
<!-- v-for="(ite,inde) in data.Object.subitem_list"-->
<!-- :key="inde">-->
<!-- {{ ite.competitionsubitem_name }}-->
<!-- </a>-->
<!-- </td>-->
<!-- </tr>-->
</table>
</div>
......@@ -75,6 +95,7 @@
}}
</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
......@@ -83,6 +104,7 @@
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='race_level'&& item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
......@@ -118,7 +140,7 @@
<th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='race_level'" class="colContent">{{
['', '国家级', '省一级', '省二级'][item[1]]
['', '国家级', '省一级', '省二级', '国际级'][item[1]]
}}
</td>
......@@ -130,17 +152,26 @@
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
<th v-if="item[0]==='competition_type'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='competition_type'" class="colContent">{{ ['', 'A类', 'B类'][item[1]] }}</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='team_id'&&item[0]!=='race_level'&& item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
<th v-if="item[0]==='competition'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='competition'" class="colContent">
{{ ['', 'A类', 'B类'][item[1]] }}
</td>
<th v-if="item[0]!=='competition_type'&&item[0]!=='competition'&&item[0]!=='team_id'&&item[0]!=='race_level'&& item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='team_id'&&item[0]!=='race_level'&& item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
<td v-if="item[0]!=='competition_type'&&item[0]!=='competition'&&item[0]!=='team_id'&&item[0]!=='race_level'&& item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
......@@ -170,7 +201,7 @@
<th v-if="item[0]==='race_level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='race_level'" class="colContent">{{
['', '国家级', '省一级', '省二级'][item[1]]
['', '国家级', '省一级', '省二级', '国际级'][item[1]]
}}
</td>
......@@ -207,160 +238,57 @@
</div>
</Card>
<!-- <Card style="width: 50%;margin-top: 20px;border-radius: 20px" v-if="form_name === 'CompetitionReport'">-->
<!-- <template #title><h2 style="text-align: center">-->
<!-- {{ data.Object.module }}</h2></template>-->
<!-- <Row v-for="(item,index) in data.keyValueArray" :key="index">-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>{{ item[2] }}:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12">-->
<!-- <Tag class="text" type="dot" color="primary" style="width: 15vw">-->
<!-- <span v-if="item[0]==='level'">&nbsp;&nbsp; {{ ['', '国家级', '省一级', '省二级'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='way'">&nbsp;&nbsp; {{ ['团队', '个人'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='approval_state'">&nbsp;&nbsp; {{-->
<!-- ['未审批', '审批中', '审批通过', '审批不通过'][item[1]]-->
<!-- }}</span>-->
<!-- <span v-if="item[0]!=='way' && item[0]!=='level' && item[0]!=='approval_state'">&nbsp;&nbsp; {{-->
<!-- item[1]-->
<!-- }}</span>-->
<!-- </Tag>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- <Row>-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>附件:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12"-->
<!-- style="display: flex;justify-content:flex-start;flex-wrap: wrap;margin-top: 5px;">-->
<!-- <a :href="ite.path" class="aText" style="margin-right: auto" v-for="(ite,inde) in data.Object.file_list"-->
<!-- :key="inde">-->
<!-- {{ ite.file_name }}-->
<!-- </a>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- </Card>-->
<!-- <Card style="width: 50%;margin-top: 20px;border-radius: 20px" v-if="form_name === 'CompetitionSign'">-->
<!-- <template #title><h2 style="text-align: center">-->
<!-- {{ data.Object.module }}</h2></template>-->
<!-- <Row v-for="(item,index) in data.keyValueArray" :key="index">-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>{{ item[2] }}:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12">-->
<!-- <Tag class="text" type="dot" color="primary" style="width: 15vw">-->
<!-- <span v-if="item[0]==='level'">&nbsp;&nbsp; {{ ['', '国家级', '省一级', '省二级'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='race_level'">&nbsp;&nbsp; {{ ['', '国家级', '省一级', '省二级'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='way'">&nbsp;&nbsp; {{ ['团队', '个人'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='approval_state'">&nbsp;&nbsp; {{-->
<!-- ['未审批', '审批中', '审批通过', '审批不通过'][item[1]]-->
<!-- }}</span>-->
<!-- <span-->
<!-- v-if="item[0]!=='way' && item[0]!=='level' && item[0]!=='approval_state' && item[0] !=='race_level'">&nbsp;&nbsp; {{-->
<!-- item[1]-->
<!-- }}</span>-->
<!-- </Tag>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- <Row>-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>附件:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12"-->
<!-- style="display: flex;justify-content:flex-start;flex-wrap: wrap;margin-top: 5px;">-->
<!-- <a :href="ite.path" class="aText" style="margin-right: auto" v-for="(ite,inde) in data.Object.file_list"-->
<!-- :key="inde">-->
<!-- {{ ite.file_name }}-->
<!-- </a>-->
<Card style="width: 50%;margin-top: 20px;border-radius: 20px" v-if="form_name === 'Notice'">
<div class="tableList">
<h1 style="display: flex;justify-content: center"> {{ data.Object.module }}</h1>
<table border="1" class="container1">
<tr v-for="(item,index) in data.keyValueArray" :key="index">
<th v-if="item[0]==='is_top'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_top'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<!-- </Col>-->
<!-- </Row>-->
<!-- </Card>-->
<!-- <Card style="width: 50%;margin-top: 20px;border-radius: 20px" v-if="form_name === 'Certificate'">-->
<!-- <template #title><h2 style="text-align: center">-->
<!-- {{ data.Object.module }}</h2></template>-->
<!-- <Row v-for="(item,index) in data.keyValueArray" :key="index">-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>{{ item[2] }}:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12">-->
<!-- <Tag class="text" type="dot" color="primary" style="width: 15vw">-->
<!-- <span v-if="item[0]==='approval_state'">&nbsp;&nbsp; {{-->
<!-- ['未审批', '审批中', '审批通过', '审批不通过'][item[1]]-->
<!-- }}</span>-->
<!-- <span v-if="item[0]==='race_level'">{{ ['', '国家级', '省一级', '省二级'][item[1]] }}</span>-->
<!-- <span @click="teamInfo" class="teamInfo" v-if="item[0]==='team_id'">-->
<!-- 团队详细-->
<!-- </span>-->
<!-- <span v-if="item[0]!=='team_id'&& item[0]!=='approval_state'&&item[0]!=='race_level'">&nbsp;&nbsp;-->
<!-- {{-->
<!-- item[1]-->
<!-- }}</span>-->
<!-- </Tag>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- <Row>-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>附件:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12"-->
<!-- style="display: flex;justify-content:flex-start;flex-wrap: wrap;margin-top: 5px;">-->
<!-- <a :href="ite.path" class="aText" style="margin-right: auto" v-for="(ite,inde) in data.Object.file_list"-->
<!-- :key="inde">-->
<!-- {{ ite.file_name }}-->
<!-- </a>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- </Card>-->
<!-- <Card style="width: 50%;margin-top: 20px;border-radius: 20px" v-if="form_name === 'Bursary'">-->
<!-- <template #title><h2 style="text-align: center">-->
<!-- {{ data.Object.module }}</h2></template>-->
<!-- <Row v-for="(item,index) in data.keyValueArray" :key="index">-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>{{ item[2] }}:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12">-->
<!-- <Tag class="text" type="dot" color="primary" style="width: 15vw">-->
<!-- <span v-if="item[0]==='race_level'">&nbsp;&nbsp; {{ ['', '国家级', '省一级', '省二级'][item[1]] }}</span>-->
<!-- <span v-if="item[0]==='approval_state'">&nbsp;&nbsp; {{-->
<!-- ['未审批', '审批中', '审批通过', '审批不通过'][item[1]]-->
<!-- }}</span>-->
<!-- <span v-if="item[0]!=='race_level' && item[0]!=='approval_state'">&nbsp;&nbsp; {{-->
<!-- item[1]-->
<!-- }}</span>-->
<!-- </Tag>-->
<!-- </Col>-->
<!-- </Row>-->
<!-- <Row>-->
<!-- <Col :pull="1" :span="12" style="display: flex;justify-content:flex-end;">-->
<!-- <h3>附件:</h3>-->
<!-- </Col>-->
<!-- <Col :span="12"-->
<!-- style="display: flex;justify-content:flex-start;flex-wrap: wrap;margin-top: 5px;">-->
<!-- <a :href="ite.path" class="aText" style="margin-right: auto" v-for="(ite,inde) in data.Object.file_list"-->
<!-- :key="inde">-->
<!-- {{ ite.file_name }}-->
<!-- </a>-->
<th v-if="item[0]==='is_public'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='is_public'" class="colContent">{{ ['否', '是'][item[1]] }}</td>
<th v-if="item[0]==='content'" class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]==='content'" class="colContent">
<spin style="max-height: 500px;overflow-y: auto" v-html="item[1]"></spin>
</td>
<th v-if="item[0]==='approval_state'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='approval_state'" class="colContent">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='content'&&item[0]!=='race_level'&& item[0]!=='is_top'&& item[0]!=='is_public' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
</tr>
<tr>
<th>附件:</th>
<td class="colContent">
<a :href="ite.path" class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in data.Object.file_list"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
<!-- </Col>-->
<!-- </Row>-->
<!-- </Card>-->
</div>
</Card>
<Modal
v-model="publicModal"
......@@ -513,11 +441,21 @@ export default {
case 'pass':
const pass = await api.FlowApproval(data)
hook.publicMessage(pass)
if (pass.code === 1) {
setTimeout(() => {
localStorage.setItem('updataEvent', 'getDataEvent');
window.close()
}, 1500)
}
break;
case 'revocation':
const Revocation = await api.FlowRevocation(data)
if (Revocation.code === 1) {
hook.publicMessage(Revocation)
setTimeout(() => {
localStorage.setItem('updataEvent', 'getDataEvent');
window.close()
}, 1500)
} else {
this.$Spin.hide()
this.$Message.error(Revocation.msg_detail)
......@@ -565,22 +503,50 @@ export default {
runid: this.runid
}
let res = await api.GetFlowInfo(data)
console.log("🚀🚀🚀,", res)
downSpin(res)
this.data.Object = res.response
delete res.response.competition_report.competitionreportid
delete res.response.competition_report.competition_file
// delete res.response.competition_report.approval_remark
delete res.response.competition_report.approval_remark
delete res.response.competition_report.dept_id
delete res.response.competition_report.game_size
delete res.response.competition_report.average
delete res.response.competition_report.ratio_info
delete res.response.competition_report.intro
delete res.response.competition_report.undertaker
delete res.response.competition_report.participant
delete res.response.competition_report.reason
delete res.response.competition_report.competition_time
delete res.response.competition_report.subitem_list
this.data.keyValueArray = Object.entries(res.response.competition_report)
this.data.keyValueArray.map((cur, index) => {
let array = [
'赛事名称',
'主办单位',
'承办单位/秘书处',
// '承办单位/秘书处',
'赛事级别',
'正常比赛时间与天数',
'参赛对象',
// '正常比赛时间与天数',
// '参赛对象',
'组队方式',
'比赛规模', '近三年参赛平均数量', '获奖比例', '赛事及竞赛方案简介', '拟参赛专业和相关课程', '参赛理由', '创建时间', '审批状态', '审批意见']
// '比赛规模',
// '近三年参赛平均数量',
// '获奖比例',
// '赛事及竞赛方案简介',
'拟参赛专业和相关课程',
// '参赛理由',
'创建时间',
'审批状态',
'竞赛类型',
'院系',
'赛事奖金',
'竞赛开始时间',
'竞赛结束时间',
'参赛对象',
// '审批意见',
]
cur.push(array[index])
})
hook.publicMessage(res)
......@@ -595,9 +561,11 @@ export default {
this.data.Object = res1.response
delete res1.response.competition_sign.competitionsignid
delete res1.response.competition_sign.competition_file
// delete res1.response.competition_sign.approval_remark
delete res1.response.competition_sign.approval_remark
delete res1.response.competition_sign.competitionreportid
delete res1.response.competition_sign.sign_up
delete res1.response.competition_sign.approach_file
delete res1.response.competition_sign.train_file
this.data.keyValueArray = Object.entries(res1.response.competition_sign)
this.data.keyValueArray.map((cur, index) => {
let array1 = ['竞赛项目名称(大赛名称)',
......@@ -615,11 +583,12 @@ export default {
'培训开始时间',
'培训结束时间',
'竞赛的其他要求',
'竞赛方案附件',
'培训计划附件',
// '竞赛方案附件',
// '培训计划附件',
'创建时间',
'审批状态',
'审批意见',]
// '审批意见',
]
cur.push(array1[index])
})
hook.publicMessage(res1)
......@@ -634,20 +603,34 @@ export default {
this.data.Object = res2.response
delete res2.response.certificate.certificateid
delete res2.response.certificate.certificate_file
// delete res2.response.certificate.approval_remark
delete res2.response.certificate.approval_remark
delete res2.response.certificate.competitionreportid
delete res2.response.certificate.createtime
delete res2.response.certificate.certificate_description
delete res2.response.certificate.competitionsubitem_id
delete res2.response.certificate.money
delete res2.response.certificate.team_id
delete res2.response.certificate.certificate_name
this.data.keyValueArray = Object.entries(res2.response.certificate)
this.data.keyValueArray.map((cur, index) => {
let array2 = [
'赛事名称',
'主办单位',
'赛事级别',
'获奖团队',
'证书名称',
'证书描述',
'创建时间',
// '获奖团队',
// '证书名称',
'审批状态',
'审批意见'
// '获奖奖金',
'竞赛类别',
'比赛开始时间',
'比赛结束时间',
// '证书描述',
'赛项名称',
'竞赛形式',
// '教师证书',
// '学生证书',
'申请人',
]
cur.push(array2[index])
})
......@@ -666,6 +649,7 @@ export default {
delete res3.response.bursary.grant_file
// delete res3.response.bursary.approval_remark
delete res3.response.bursary.competitionreportid
delete res3.response.bursary.approval_remark
this.data.keyValueArray = Object.entries(res3.response.bursary)
this.data.keyValueArray.map((cur, index) => {
let array3 = [
......@@ -688,13 +672,48 @@ export default {
// '附件',
'创建时间',
'审批状态',
'审批意见',
// '审批意见',
]
cur.push(array3[index])
})
hook.publicMessage(res3)
break;
case 'Notice':
this.$Spin.show()
let data4 = {
runid: this.runid
}
let res4 = await api.GetFlowInfo(data4)
downSpin(res4)
this.data.Object = res4.response
delete res4.response.notice.noticeid
delete res4.response.notice.typeid
delete res4.response.notice.grant_file
delete res4.response.notice.createtime
// delete res3.response.bursary.approval_remark
delete res4.response.notice.competitionreportid
this.data.keyValueArray = Object.entries(res4.response.notice)
this.data.keyValueArray.map((cur, index) => {
let array4 = [
// 'bursaryid',
'公告标题',
'公告类型',
'发布时间',
'发布用户',
'修改人',
'修改时间',
'是否置顶',
'是否发布',
'审批状态',
'公告内容',
]
cur.push(array4[index])
})
hook.publicMessage(res4)
break;
}
......@@ -809,7 +828,6 @@ export default {
.colContent {
width: 70%;
height: 50px;
text-align: center;
}
......
......@@ -13,6 +13,7 @@
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #todo="{row}">
<span v-for="(item,index) in row.todo" :key="index">{{
......@@ -32,7 +33,9 @@
</Tag>
</template>
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="approvalLisFun(row)">审批</Button>
<a @click="approvalLisFun(row)">审批</a>
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
......@@ -138,27 +141,6 @@ export default {
show: true,
minWidth: 120,
},
{
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '当前节点名称',
key: 'current_node_name',
......@@ -173,7 +155,6 @@ export default {
show: true,
minWidth: 200,
},
{
title: '参与人',
slot: 'partcipant',
......@@ -182,26 +163,49 @@ export default {
minWidth: 200,
},
{
title: '修改人',
key: 'modifyby',
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
{
title: '关联模块',
key: 'form_name',
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '关联模块',
// key: 'form_name',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '操作',
align: 'center',
......@@ -237,17 +241,33 @@ export default {
pageKey: 1
}
},
watch: {},
// 查询条件初始化
created() {
},
mounted() {
this.GetFlowTaskList()
hook.storageAddEventListener(async () => {
await this.GetFlowTaskList()
})
// // 监听storage事件,当主页面修改数据时,触发该事件
// window.addEventListener('storage', (event) => {
// if (event.key === 'updataEvent' && event.newValue === 'getDataEvent') {
// //刷新主窗口
// // 执行你的逻辑
// // 重置存储的值,以便下次触发事件
// localStorage.setItem('updataEvent', '');
// this.GetFlowTaskList()
// }
// });
},
methods: {
// 查询
async GetFlowTaskList() {
this.$Spin.show()
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size
......@@ -255,7 +275,7 @@ export default {
const res = await api.GetFlowTaskList(data)
this.init.total = res.response.data_count
this.tableData = res.response.data
hook.publicMessage(res)
this.loading = false
},
// 新增
add() {
......
......@@ -13,6 +13,7 @@
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #todo="{row}">
<span v-for="(item,index) in row.todo" :key="index">{{
......@@ -32,7 +33,8 @@
</Tag>
</template>
<template slot-scope="{ row }" slot="action">
<Button type="primary" size="small" @click="approvalLisFun(row)">详细</Button>
<a @click="approvalLisFun(row)">详细</a>
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
......@@ -203,27 +205,6 @@ export default {
show: true,
minWidth: 120,
},
{
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '当前节点名称',
key: 'current_node_name',
......@@ -238,7 +219,6 @@ export default {
show: true,
minWidth: 200,
},
{
title: '参与人',
slot: 'partcipant',
......@@ -247,26 +227,49 @@ export default {
minWidth: 200,
},
{
title: '修改人',
key: 'modifyby',
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
{
title: '关联模块',
key: 'form_name',
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '关联模块',
// key: 'form_name',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '操作',
align: 'center',
......@@ -312,7 +315,7 @@ export default {
methods: {
// 查询
async GetFlowTaskList() {
this.$Spin.show()
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size
......@@ -321,7 +324,7 @@ export default {
const res = await api.GetAlreadyFlowTaskList(data)
this.init.total = res.response.data_count
this.tableData = res.response.data
hook.publicMessage(res)
this.loading = false
},
// 新增
add() {
......
<template>
<div>
<Card ref="card">
<template #title>
......@@ -7,10 +8,13 @@
<h3>流程列表</h3>
</div>
</template>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap">
<Card @click.native="flowAssembleFun(item)"
style="width: 150px;min-height: 150px;margin: 10px 5px;"
v-for="(item,index) in init.data" :key="index">
<div style="display: flex;align-items: center;flex-wrap: wrap;justify-content: center">
<Icon :type="item.icon" size="100"/>
<span>
......@@ -188,6 +192,7 @@ export default {
query: {
id: e.flowid,
remark: e.remark,
entrance: 'flow',
}
})
window.open(href.href, '_blank')
......@@ -200,13 +205,13 @@ export default {
page_size: this.init.page_size
}
let res = await api.GetFlowDesignList(data)
let iconArray = ['ios-ribbon', 'md-trophy', 'md-list-box', 'logo-usd']
let iconArray = ['ios-ribbon', 'md-trophy', 'md-list-box', 'logo-usd', 'md-chatboxes']
res.response.data.map((currentValue, index) => {
currentValue.icon = iconArray[index]
})
this.init.data = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.$Spin.hide()
},
// 新增
add() {
......
......@@ -36,7 +36,7 @@
<Option v-for="(item,index) in levelArray" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem label="补助时间" prop="grant_time">
<FormItem label="补助时间" prop="grant_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.grant_time" @on-change="bursaryTime"
placeholder="请选择补助时间" style="width: 100%"/>
</FormItem>
......@@ -44,17 +44,17 @@
<InputNumber style="width: 100%" v-model="formValidate.money"
placeholder="请输入补助金额"></InputNumber>
</FormItem>
<FormItem label="计划集训时间" prop="plan_train_time">
<FormItem label="计划集训时间" prop="plan_train_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.plan_train_time" @on-change="intensiveTrainingTime"
placeholder="请选择计划集训时间" style="width: 100%"/>
</FormItem>
<FormItem label="实际集训起止时间" prop="train_time">
<FormItem label="实际集训起止时间" prop="train_time" :key="timeKey">
<DatePicker type="date" v-model="formValidate.train_time" @on-change="actualTrainingStartAndEndTime"
placeholder="请选择实际集训起止时间" style="width: 100%"/>
</FormItem>
<FormItem label="参赛具体情况" prop="competition_info">
<Input v-model="formValidate.competition_info" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
<Input v-model="formValidate.competition_info" type="textarea" :autosize="{minRows: 7,maxRows: 10}"
placeholder="请输入参赛具体情况"></Input>
</FormItem>
......@@ -95,7 +95,7 @@
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:key="fileKey"
:show-upload-list="true"
type="drag"
action=""
......@@ -117,7 +117,7 @@
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button type="primary" @click="save">保存</Button>
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
......@@ -162,6 +162,12 @@ export default {
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
changecommitid: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
timeKey: 1,
competitionnameValue: '',
formValidate: {
"flowid": "",
......@@ -239,6 +245,54 @@ export default {
},
//方法集合",
methods: {
save() {
const fun = async (changecommitid) => {
let formValidate = _.cloneDeep(this.formValidate)
let files_list = formValidate.files_list
delete formValidate.files_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"bursary": formValidate,
'files_list': files_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
res.response.bursary.rece_level = Number(res.response.bursary.rece_level)
res.response.bursary.level = Number(res.response.bursary.level)
res.response.bursary.money = Number(res.response.bursary.money)
this.formValidate = res.response.bursary
this.formValidate.files_list = res.response.files_list
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
this.competitionSelectName(res.response.bursary.competitionname)
this.timeKey++
break;
}
},
intensiveTrainingTime(e) {
//计划集训时间
this.formValidate.plan_train_time = dayjs(e).format('YYYY-MM-DD')
......@@ -257,6 +311,7 @@ export default {
this.formValidate.files_list.splice(index, 1)
}
})
this.fileKey++
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
......@@ -275,17 +330,21 @@ export default {
const res = await api.fileUpload(this.formValidate.files_list.module, formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
this.$Spin.show()
this.formValidate.competitionname = this.competitionnameValue
let data = _.cloneDeep(this.formValidate)
data.flowid = this.flowid
const res = await api.FlowBursarySubmit(data)
hook.publicMessage(res)
setTimeout(() => {
window.open("about:blank", "_top").close()
}, 1500)
}
})
},
......@@ -330,6 +389,9 @@ export default {
this.getCompetiotionName()
this.formValidate.flowid = this.$route.query.id;
this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.FlowInit()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
......
......@@ -2,88 +2,148 @@
<div class="container">
<Card style="width: 50%">
<template #title><h2 style="text-align: center">
证书上传流程</h2></template>
获奖材料上传</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="180">
<FormItem label="赛事名称" prop="competitionname">
<Select v-model="formValidate.competitionname" @on-change="competitionSelectName"
<Select filterable v-model="formValidate.competitionname" @on-change="competitionSelectName"
placeholder="请选择赛事名称">
<Option v-for="(item,index) in competitionNameArray" :key="index"
:value="item.id">
{{ item.name }}
</Option>
<Option v-for="(item,index) in competitionNameArray" :key="index" :value="item.id"> {{ item.name }}</Option>
</Select>
</FormItem>
<FormItem label="主办单位" prop="sponsor">
<!-- ********-->
<FormItem label="赛项名称" prop="sponsor1">
<Input v-model="formValidate.competitionsubitem_name" placeholder="请输入赛项名称"></Input>
</FormItem>
<!-- ********-->
<!-- <FormItem label="赛项名称" prop="competitionsubitem_id1">-->
<!-- <Select v-model="formValidate.competitionsubitem_id" :key="Key1"-->
<!-- placeholder="请选择赛项名称">-->
<!-- <Option v-for="(item,index) in competitionItemArray" :key="index"-->
<!-- :value="item.competitionsubitemid">-->
<!-- {{ item.competitionsubitem_name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<FormItem label="主办单位" prop="sponsor1">
<Input v-model="formValidate.sponsor" :disabled="true" placeholder="请输入主办单位"></Input>
</FormItem>
<FormItem label="赛事级别" prop="race_level">
<FormItem label="赛事级别" prop="race_level1">
<Select v-model="formValidate.race_level" :disabled="true" placeholder="请选择赛事级别">
<Option v-for="(item,index) in levelArray" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem label="获奖团队" prop="team_id">
<Select v-model="formValidate.team_id" placeholder="请选择获奖团队">
<Option v-for="(item,index) in teamSelect" :key="index" :value="item.id">
{{ item.name }}
</Option>
<FormItem label="竞赛类别" prop="competition_type1">
<Select v-model="formValidate.competition_type" placeholder="请选择竞赛类型">
<Option v-for="(item,index) in competitionClass" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem label="证书名称" prop="certificate_name">
<Input v-model="formValidate.certificate_name" placeholder="请输入证书名称"></Input>
<!-- <FormItem label="获奖团队" prop="team_id1">-->
<!-- <Select v-model="formValidate.team_id" placeholder="请选择获奖团队">-->
<!-- <Option v-for="(item,index) in teamSelect" :key="index" :value="item.id">-->
<!-- {{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<FormItem label="比赛时间" prop="competition_time1">
<DatePicker style="width: 100%" type="daterange"
v-model="formValidate.competition_time"
@on-change="getCompetitionTime"
placement="bottom-end"
placeholder="请选择比赛时间"/>
</FormItem>
<FormItem label="证书描述" prop="certificate_description">
<Input v-model="formValidate.certificate_description" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
placeholder="请输入证书描述"></Input>
<FormItem label="比赛形式" prop="way1">
<Select v-model="formValidate.way" placeholder="请选择组队方式">
<Option v-for="(item,index) in wayArray" :key="index" :value="item.value">
{{ item.label }}
</Option>
</Select>
</FormItem>
<FormItem>
<!-- <div style="display: flex;">-->
<!-- <Upload-->
<!-- :multiple="false"-->
<!-- :before-upload="beforeUpload"-->
<!-- :on-error="onError"-->
<!-- :on-success="onsuccess"-->
<!-- :on-format-error="onFormatError"-->
<!-- :show-upload-list="true"-->
<!-- type="select"-->
<!-- action=""-->
<!-- style="display: inline-block;width:58px;margin-right: 20px">-->
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>培训计划</p>-->
<!-- </Upload>-->
<!-- <FormItem label="获奖奖金" prop="money1">-->
<!-- <InputNumber :min="0" style="width: 100%" v-model="formValidate.money"-->
<!-- placeholder="请输入比赛奖金"></InputNumber>-->
<!-- </FormItem>-->
<!-- <FormItem label="证书名称" prop="certificate_name1">-->
<!-- <Input v-model="formValidate.certificate_name" placeholder="请输入证书名称"></Input>-->
<!-- </FormItem>-->
<!-- **************************************************************************-->
<!-- <FormItem label="证书描述" prop="certificate_description">-->
<!-- <Input v-model="formValidate.certificate_description" type="textarea" :autosize="{minRows: 7,maxRows: 10}"-->
<!-- placeholder="请输入证书描述"></Input>-->
<!-- </FormItem>-->
<FormItem :key="fileKey">
<div style="display: flex;justify-content: flex-start;box-sizing: border-box">
<Upload
style="margin-right: 10px"
:multiple="false"
:before-upload="PersonalExcellenceBeforeUpload"
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:show-upload-list="true"
type="drag"
action=""
>
<div style="padding: 20px 30px; width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>教师证书</p>
</div>
</Upload>
<!-- <Upload-->
<!-- style="margin-right: 10px"-->
<!-- :multiple="false"-->
<!-- :before-upload="beforeUpload"-->
<!-- :before-upload="TeamExcellenceBeforeUpload"-->
<!-- :on-error="onError"-->
<!-- :on-success="onsuccess"-->
<!-- :on-format-error="onFormatError"-->
<!-- :show-upload-list="true"-->
<!-- type="select"-->
<!-- action=""-->
<!-- style="display: inline-block;width:58px;margin-right: 20px">-->
<!-- type="drag"-->
<!-- action="">-->
<!-- <div style="padding: 20px 30px; width: 100%;">-->
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>竞赛方案</p>-->
<!-- <p>学生证书</p>-->
<!-- </div>-->
<!-- </Upload>-->
<Upload
:multiple="true"
:before-upload="beforeUpload"
:multiple="false"
:before-upload="StudentExcellenceBeforeUpload"
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:show-upload-list="true"
type="drag"
action=""
>
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>附件上传</p>-->
<div style="padding: 20px 0;width: 100%;">
action="">
<div style="padding: 20px 30px; width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>附件上传</p>
<p>学生证书</p>
</div>
</Upload>
</div>
<!-- <Upload-->
<!-- :multiple="true"-->
<!-- :before-upload="beforeUpload"-->
<!-- :on-error="onError"-->
<!-- :on-success="onsuccess"-->
<!-- :on-format-error="onFormatError"-->
<!-- :show-upload-list="true"-->
<!-- type="drag"-->
<!-- action=""-->
<!-- >-->
<!-- &lt;!&ndash; <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>&ndash;&gt;-->
<!-- &lt;!&ndash; <p>附件上传</p>&ndash;&gt;-->
<!-- <div style="padding: 20px 0;width: 100%;">-->
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>附件上传</p>-->
<!-- </div>-->
<!-- </Upload>-->
<div class="filelist" v-for="(item,index) in formValidate.files_list" :key="index">
{{ item.file_name }}
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)" type="ios-trash"/>
......@@ -93,7 +153,7 @@
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button type="primary" @click="save">保存</Button>
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
......@@ -120,6 +180,7 @@ export default {
data() {
//这里存放数据",
return {
competitionItemArray: [],
teamSelect: [],
competitionNameArray: [],
approval_stateArray: [
......@@ -128,17 +189,37 @@ export default {
{value: 2, label: '审批通过'},
{value: 3, label: '审批不通过'},
],
competitionClass: [
{value: 1, label: 'A类'},
{value: 2, label: 'B类'},
],
levelArray: [
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
{value: 4, label: '国际级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
competitionnameValue: '',
changecommitid: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
Key: 1,
Key1: 1,
competitionname: '',
formValidate: {
competitionsubitem_name: '',
money: 0,
competition_time: '',
begin_time: '',
end_time: '',
competition_type: '',
'competitionsubitem_id': '',
"flowid": "",
"certificateid": "",
"competitionname": "",
......@@ -149,21 +230,16 @@ export default {
"certificate_name": "",
"certificate_description": "",
"certificate_file": "",
"files_list": [
// {
// "id": "string",
// "module": "string",
// "file_name": "string",
// "form_id": "string",
// "path": "string",
// "suffix": "string",
// "size": "string",
// "createby": "string",
// "createtime": "2023-09-14T08:44:07.514Z"
// }
]
'PersonalExcellence': [],
'TeamExcellence': [],
'StudentExcellence': [],
"files_list": []
},
ruleValidate: {
"competitionsubitem_id": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
"competitionname": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
......@@ -192,12 +268,78 @@ export default {
watch: {},
//方法集合",
methods: {
getCompetitionTime(e) {
console.log("🚀🚀🚀,", e)
this.formValidate.begin_time = e[0]
this.formValidate.end_time = e[1]
},
save() {
const fun = async (changecommitid) => {
let formValidate = _.cloneDeep(this.formValidate)
let files_list = formValidate.files_list
delete formValidate.files_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"certificate": formValidate,
'files_list': files_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
res.response.certificate.level = Number(res.response.certificate.level)
res.response.certificate.race_level = Number(res.response.certificate.race_level)
this.formValidate = res.response.certificate
this.formValidate.files_list = res.response.files_list
this.formValidate.competition_time = [res.response.certificate.begin_time, res.response.certificate.end_time]
this.formValidate.competitionname = res.response.certificate.competitionname
console.log("🚀🚀🚀,", this.competitionItemArray)
this.competitionItemArray = [{
competitionsubitemid: res.response.certificate.competitionsubitem_id,
competitionsubitem_name: res.response.certificate.competitionsubitem_name,
}]
console.log("🚀🚀🚀,", this.competitionItemArray)
this.formValidate.competitionsubitem_id = res.response.certificate.competitionsubitem_id
this.Key1++
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
// await this.competitionSelectName(res.response.certificate.competitionname)
break;
}
},
fileDelete(e) {
this.formValidate.files_list.map((cur, index) => {
if (cur.id === e.id) {
this.formValidate.files_list.splice(index, 1)
}
})
this.fileKey++
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
......@@ -208,25 +350,60 @@ export default {
onFormatError(response, file, fileList) {
this.$Message.info('文件类型错误!')
},
// PersonalExcellence
// TeamExcellence
// StudentExcellence
async PersonalExcellenceBeforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload('TeacherExcellence', formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
async TeamExcellenceBeforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload('TeamExcellence', formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
async StudentExcellenceBeforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload('StudentExcellence', formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
async beforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload(this.formValidate.files_list.module, formData);
const res = await api.fileUpload(this.module, formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
this.$Spin.show()
this.formValidate.competitionname = this.competitionnameValue
this.formValidate.competitionname = this.competitionname
let data = _.cloneDeep(this.formValidate)
data.flowid = this.flowid
const res = await api.FlowCertificateSubmit(data)
hook.publicMessage(res)
setTimeout(() => {
window.open("about:blank", "_top").close()
}, 1500)
}
})
},
......@@ -240,11 +417,25 @@ export default {
this.teamSelect = date.response
},
async competitionSelectName(e) {
api.GetSubitemSelect({id: e})
.then(res => {
this.competitionItemArray = res.response
this.formValidate.competitionsubitem_id = ''
console.log("🚀🚀competitionItemArray🚀,", this.competitionItemArray)
this.Key++
})
const res = await api.ReportChange({id: e})
this.competitionnameValue = res.response.competitionname
this.competitionname = res.response.competitionname
this.formValidate.sponsor = res.response.sponsor
this.formValidate.race_level = Number(res.response.level)
this.formValidate.competitionreportid = res.response.competitionreportid
this.competitionnameValue = res.response.competitionname
this.formValidate.money = res.response.money
this.formValidate.competition_type = res.response.competition_type
this.formValidate.competition_time = [res.response.begin_time, res.response.end_time]
this.formValidate.begin_time = res.response.begin_time
this.formValidate.end_time = res.response.end_time
this.formValidate.way = res.response.way
},
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
......@@ -265,6 +456,9 @@ export default {
this.getCompetiotionName()
this.formValidate.flowid = this.$route.query.id;
this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.FlowInit()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
......@@ -317,7 +511,7 @@ export default {
.container {
width: 100%;
min-height: 987px;
min-height: 887px;
height: auto;
display: flex;
align-content: center;
......
......@@ -2,87 +2,99 @@
<div class="container">
<Card style="width: 50%">
<template #title><h2 style="text-align: center">
赛事审批流程</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="180">
赛事录入</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="180" :key="Key">
<FormItem label="赛事名称" prop="competitionname">
<div style="display: flex;flex-wrap: nowrap">
<Input v-model="formValidate.competitionname" placeholder="请输入赛事名称"></Input>
<!-- <Button v-if="false" type="primary" style="margin-left: 10px;" @click="competitionItemModal = true">添加赛项名称
</Button>-->
</div>
</FormItem>
<FormItem label="主办单位" prop="sponsor">
<FormItem label="主办单位" prop="sponsor1">
<Input v-model="formValidate.sponsor" placeholder="请输入主办单位"></Input>
</FormItem>
<FormItem label="承办单位/秘书处" prop="undertaker">
<Input v-model="formValidate.undertaker" placeholder="请输入承办单位/秘书处"></Input>
</FormItem>
<FormItem label="赛事级别" prop="level">
<!-- <FormItem label="承办单位/秘书处" prop="undertaker">-->
<!-- <Input v-model="formValidate.undertaker" placeholder="请输入承办单位/秘书处"></Input>-->
<!-- </FormItem>-->
<FormItem label="赛事级别" prop="level1">
<Select v-model="formValidate.level" placeholder="请选择赛事级别">
<Option v-for="(item,index) in levelArray" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem label="正常比赛时间与天数" prop="competition_time">
<InputNumber style="width: 100%" :min="1" v-model="formValidate.competition_time"
placeholder="请输入正常比赛时间与天数"></InputNumber>
<FormItem label="竞赛类型" prop="competition_type1">
<Select v-model="formValidate.competition_type" placeholder="请选择竞赛类型">
<Option v-for="(item,index) in competitionClass" :key="index" :value="item.value">{{ item.label }}</Option>
</Select>
</FormItem>
<FormItem label="参赛对象" prop="participant">
<Input v-model="formValidate.participant" placeholder="请输入参赛对象"></Input>
<FormItem label="比赛奖金" prop="money1">
<InputNumber :min="0" style="width: 100%" v-model="formValidate.money"
placeholder="请输入比赛奖金"></InputNumber>
</FormItem>
<FormItem label="组队方式" prop="way">
<Select v-model="formValidate.way" placeholder="请选择组队方式">
<Option v-for="(item,index) in wayArray" :disabled="item.value===1" :key="index" :value="item.value">
{{ item.label }}
</Option>
<FormItem label="院系" prop="dept_id">
<Select :disabled="formValidate.competition_type === 1" v-model="formValidate.dept_id"
placeholder="请选择院系">
<Option v-for="(item,index) in faculty" :key="index" :value="item.id">{{ item.name }}</Option>
</Select>
</FormItem>
<FormItem label="比赛规模" prop="game_size">
<Input v-model="formValidate.game_size" placeholder="请输入比赛规模"></Input>
</FormItem>
<FormItem label="近三年参赛平均数量" prop="average">
<Input v-model="formValidate.average" placeholder="请输入近三年参赛平均数量"></Input>
<!-- <FormItem label="比赛时间" prop="competition_time">-->
<!-- <Input style="width: 100%" v-model="formValidate.competition_time"-->
<!-- placeholder="请输入正常比赛时间与天数"></Input>-->
<!-- </FormItem>-->
<FormItem label="比赛时间" prop="competition_time1">
<DatePicker style="width: 100%" type="daterange"
v-model="formValidate.competition_time"
@on-change="getCompetitionTime"
placement="bottom-end"
placeholder="请选择比赛时间"/>
</FormItem>
<FormItem label="获奖比例" prop="ratio_info">
<Input v-model="formValidate.ratio_info" placeholder="请输入获奖比例"></Input>
<FormItem label="参赛对象" prop="competitor1">
<Select v-model="formValidate.competitor"
placeholder="请选择参赛对象">
<Option v-for="(item,index) in competitionObjectArray" :key="index" :value="item.value">{{
item.name
}}
</Option>
</Select>
</FormItem>
<FormItem label="赛事及竞赛方案简介" prop="intro">
<Input v-model="formValidate.intro" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
placeholder="请输入赛事及竞赛方案简介"></Input>
<FormItem label="比赛形式" prop="way1">
<Select v-model="formValidate.way" placeholder="请选择组队方式">
<Option v-for="(item,index) in wayArray" :key="index" :value="item.value">
{{ item.label }}
</Option>
</Select>
</FormItem>
<FormItem label="拟参赛专业和相关课程" prop="correlation">
<Input v-model="formValidate.correlation" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
<!-- <FormItem label="比赛规模" prop="game_size">-->
<!-- <Input v-model="formValidate.game_size" placeholder="请输入比赛规模"></Input>-->
<!-- </FormItem>-->
<!-- <FormItem label="近三年参赛平均数量" prop="average">-->
<!-- <Input v-model="formValidate.average" placeholder="请输入近三年参赛平均数量"></Input>-->
<!-- </FormItem>-->
<!-- <FormItem label="获奖比例" prop="ratio_info">-->
<!-- <Input v-model="formValidate.ratio_info" placeholder="请输入获奖比例"></Input>-->
<!-- </FormItem>-->
<!-- <FormItem label="赛事及竞赛方案简介" prop="intro">-->
<!-- <Input v-model="formValidate.intro" type="textarea" :autosize="{minRows: 7,maxRows: 10}"-->
<!-- placeholder="请输入赛事及竞赛方案简介"></Input>-->
<!-- </FormItem>-->
<FormItem label="拟参赛专业和相关课程" prop="correlation1">
<Input v-model="formValidate.correlation" type="textarea" :autosize="{minRows: 7,maxRows: 10}"
placeholder="请输入拟参赛专业和相关课程"></Input>
</FormItem>
<FormItem label="参赛理由" prop="reason">
<Input v-model="formValidate.reason" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
placeholder="请输入参赛理由"></Input>
</FormItem>
<FormItem>
<!-- <div style="display: flex;">-->
<!-- <Upload-->
<!-- :multiple="false"-->
<!-- :before-upload="beforeUpload"-->
<!-- :on-error="onError"-->
<!-- :on-success="onsuccess"-->
<!-- :on-format-error="onFormatError"-->
<!-- :show-upload-list="true"-->
<!-- type="select"-->
<!-- action=""-->
<!-- style="display: inline-block;width:58px;margin-right: 20px">-->
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>培训计划</p>-->
<!-- </Upload>-->
<!-- <Upload-->
<!-- :multiple="false"-->
<!-- :before-upload="beforeUpload"-->
<!-- :on-error="onError"-->
<!-- :on-success="onsuccess"-->
<!-- :on-format-error="onFormatError"-->
<!-- :show-upload-list="true"-->
<!-- type="select"-->
<!-- action=""-->
<!-- style="display: inline-block;width:58px;margin-right: 20px">-->
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>竞赛方案</p>-->
<!-- </Upload>-->
<!-- <FormItem label="参赛理由" prop="reason">-->
<!-- <Input v-model="formValidate.reason" type="textarea" :autosize="{minRows: 7,maxRows: 10}"-->
<!-- placeholder="请输入参赛理由"></Input>-->
<!-- </FormItem>-->
<FormItem :key="fileKey" label="附件上传">
<Upload
:multiple="true"
:before-upload="beforeUpload"
......@@ -98,18 +110,39 @@
<!-- <p>附件上传</p>-->
<div style="padding: 20px 0;width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>附件上传</p>
<p>需上传比赛通知文件、竞赛规程、技术文件等文件</p>
</div>
</Upload>
<!-- </div>-->
<div v-if="!!formValidate.files_list.length">
<span>附件:</span>
<div class="filelist" v-for="(item,index) in formValidate.files_list" :key="index">
{{ item.file_name }}
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)" type="ios-trash"/>
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)"
type="ios-trash"/>
</div>
</div>
<div :key="competitoionItemKey" v-if="!!formValidate.subitem_list.length">
<span>赛项名称:</span>
<div class="competitionItemText" v-for="(item,index) in formValidate.subitem_list" :key="index"
style="margin-top: 5px">
<span style="height: 160px">
<span> {{ item.competitionsubitem_name }}</span>
<Icon @click="deleteCompetitionItem(item)" class="competitionItemIcon" type="ios-trash"
color="#A2A6AD"
style="font-size: 16px;margin-left: 5px;"/>
</span>
</div>
</div>
</FormItem>
<FormItem>
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程
@click="handleSubmit">提交
</Button>
<Button type="primary"
@click="save">保存
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
......@@ -118,6 +151,30 @@
</Card>
<Modal
width="40"
v-model="competitionItemModal"
title="添加赛项名称"
>
<div :key="competitoionItemKey">
<div style="display: flex;align-items: flex-start;">
<Input v-model="formValidate.competitionsubitem_nameValue" placeholder="请输入赛项名称"></Input>
<Button @click="ok" type="primary" style="margin-left: 20px">确认赛项名称</Button>
</div>
<div class="competitionItemText" v-for="(item,index) in formValidate.subitem_list" :key="index"
style="margin-top: 5px">
<span style="height: 160px">
<span> {{ item.competitionsubitem_name }}</span>
<Icon @click="deleteCompetitionItem(item)" class="competitionItemIcon" type="ios-trash" color="#A2A6AD"
style="font-size: 16px;margin-left: 5px"/>
</span>
</div>
</div>
<template v-slot:footer>
<Button @click="competitionItemModal = false">关闭</Button>
<!-- <Button @click="ok" type="primary">保存</Button>-->
</template>
</Modal>
</div>
<!-- <Grid center square :border="false" style="height: 100%">-->
<!-- <GridItem >1</GridItem>-->
......@@ -130,6 +187,7 @@
import * as hook from '../../../hook'
import * as api from '../../../api/requestUtils'
import _ from "lodash";
import dayjs from "dayjs";
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
......@@ -138,6 +196,14 @@ export default {
data() {
//这里存放数据",
return {
Key: 1,
competitionItemModal: false,
entrance: '',
faculty: [],
competitionClass: [
{value: 1, label: 'A类'},
{value: 2, label: 'B类'},
],
approval_stateArray: [
{value: 0, label: '未审批'},
{value: 1, label: '审批中'},
......@@ -148,18 +214,37 @@ export default {
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
{value: 4, label: '国际级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
competitionObjectArray: [
{value: '学生', name: '学生'},
{value: '教师', name: '教师'},
{value: '师生同赛', name: '师生同赛'},
],
changecommitid: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
competitoionItemKey: 1,
formValidate: {
'competitor': '',
'end_time': '',
'begin_time': '',
'money': 0,
'subitem_list': [],
'competitionsubitem_nameValue': '',
'competitionsubitem_name': [],
"flowid": "",
"competitionname": "",
"sponsor": "",
"undertaker": "",
"level": "",
"competition_time": 1,
"competition_time": [],
"participant": "",
"way": '',
"game_size": "",
......@@ -168,22 +253,24 @@ export default {
"intro": "",
"correlation": "",
"reason": "",
'dept_id': '',
'competition_type': '',
"data": [],
"files_list": [
// {
// "id": "",
// "module": "",
// "file_name": "",
// "form_id": "",
// "path": "",
// "suffix": "",
// "size": "",
// "createby": "",
// }
]
"files_list": []
},
ruleValidate: {
// dept_id: [
// {type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
// ],
money: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'}
],
competitor: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
competition_type: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
"competitionname": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
......@@ -197,7 +284,7 @@ export default {
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
"competition_time": [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'}
{type: 'date', required: true, message: '该项不能为空', trigger: 'change'}
],
"participant": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
......@@ -217,9 +304,7 @@ export default {
"intro": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
"correlation": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
"reason": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
......@@ -231,15 +316,102 @@ export default {
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {},
watch: {
'formValidate.competition_type'(newValue, oldValue) {
if (newValue === 1) this.formValidate.dept_id = ''
},
'formValidate.competition_time'(newValue, oldValue) {
console.log("🚀newValue🚀🚀,", newValue)
},
},
//方法集合",
methods: {
fileDelete(e) {
this.formValidate.files_list.map((cur, index) => {
getCompetitionTime(e) {
console.log("🚀🚀🚀,", e)
this.formValidate.begin_time = e[0]
this.formValidate.end_time = e[1]
},
deleteCompetitionItem(e) {
this.formValidate.subitem_list.forEach((cur, index) => {
if (cur.competitionsubitem_name === e.competitionsubitem_name) this.formValidate.subitem_list.splice(index, 1)
})
this.competitoionItemKey++
},
ok() {
if (this.formValidate.competitionsubitem_nameValue) {
this.formValidate.subitem_list.push({
competitionsubitem_name: this.formValidate.competitionsubitem_nameValue,
competitionsubitemid: ''
})
this.formValidate.competitionsubitem_nameValue = undefined
} else {
this.$Message.destroy()
this.$Message.error('赛项名称不能为空')
}
},
save() {
const fun = async (changecommitid) => {
console.log("🚀this.formValidate🚀🚀,", this.formValidate)
let formValidate = _.cloneDeep(this.formValidate)
let subitem_list = formValidate.subitem_list
let files_list = formValidate.files_list
delete formValidate.files_list
delete formValidate.competition_time
delete formValidate.subitem_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"competition_report": formValidate,
'files_list': files_list,
'subitem_list': subitem_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
res.response.competition_report.level = Number(res.response.competition_report.level)
this.formValidate = res.response.competition_report
this.formValidate.files_list = res.response.files_list
this.formValidate.subitem_list = res.response.subitem_list
this.formValidate.competition_time = [res.response.competition_report.begin_time, res.response.competition_report.end_time]
console.log("🚀🚀 this.formValidate.competition_time🚀,", this.formValidate.competition_time)
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
break;
}
},
async fileDelete(e) {
this.formValidate.files_list.forEach((cur, index) => {
if (cur.id === e.id) {
this.formValidate.files_list.splice(index, 1)
}
})
this.fileKey++
// await this.save()
// await this.FlowInit()
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
......@@ -264,32 +436,58 @@ export default {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload(this.formValidate.files_list.module, formData);
const res = await api.fileUpload(this.module, formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
let data = _.cloneDeep(this.formValidate)
const res = await api.FlowReportSubmit(data)
// hook.publicMessage(res)
data.flowid = this.flowid
delete data.competition_time
const fun = (res) => {
if (res.code !== 1) {
this.$Message.error(res.msg_detail)
this.$Spin.hide()
} else {
hook.publicMessage(res)
setTimeout(() => {
localStorage.setItem('updataEvent', 'getDataEvent')
window.close()
}, 1500)
}
}
// ------
switch (this.entrance) {
case 'flow':
const res = await api.FlowReportSubmit(data)
fun(res)
break;
case 'race':
data.approval_state = 2
const res1 = await api.ReportSave(data)
fun(res1)
break;
}
}
})
},
handleReset() {
this.formValidate = {}
console.log("🚀🚀🚀,")
},
async GetDeptSeletct() {
const res = await api.GetDeptSeletct()
this.faculty = res.response
}
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
......@@ -300,11 +498,14 @@ export default {
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.formValidate.flowid = this.$route.query.id;
this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.entrance = this.$route.query.entrance;
this.FlowInit()
this.GetDeptSeletct()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
......@@ -328,10 +529,8 @@ export default {
},
}
</script>
<style>
<style scoped>
.filelist {
......@@ -349,8 +548,26 @@ export default {
.fileddelete:hover {
color: red;
cursor: pointer;
transform: scale(1.5);
}
.competitionItemText {
font-size: 16px;
word-break: break-all
}
.competitionItemText:hover {
color: #1e93ff;
background-color: #f7f7f7;
}
.competitionItemIcon:hover {
color: red !important;
transform: scale(1.5);
cursor: pointer;
}
</style>
<style>
......@@ -364,4 +581,6 @@ export default {
justify-content: center;
flex-wrap: wrap;
}
</style>
......@@ -22,8 +22,8 @@
</Select>
</FormItem>
<FormItem label="比赛时间(天数)" prop="competition_time">
<InputNumber style="width: 100%" :min="1" v-model="formValidate.competition_time"
placeholder="请输入比赛时间(天数)"></InputNumber>
<Input style="width: 100%" v-model="formValidate.competition_time"
placeholder="请输入比赛时间(天数)"></Input>
</FormItem>
<FormItem label="竞赛地点" prop="place">
<Input v-model="formValidate.place" placeholder="请输入竞赛地点"></Input>
......@@ -68,19 +68,19 @@
style="width: 100%"/>
</FormItem>
<FormItem label="近三年参赛平均数量" prop="average">
<Input v-model="formValidate.average" placeholder="请输入近三年参赛平均数量"></Input>
</FormItem>
<FormItem label="获奖比例" prop="ratio_info">
<Input v-model="formValidate.ratio_info" placeholder="请输入获奖比例"></Input>
</FormItem>
<!-- <FormItem label="近三年参赛平均数量" prop="average">-->
<!-- <Input v-model="formValidate.average" placeholder="请输入近三年参赛平均数量"></Input>-->
<!-- </FormItem>-->
<!-- <FormItem label="获奖比例" prop="ratio_info">-->
<!-- <Input v-model="formValidate.ratio_info" placeholder="请输入获奖比例"></Input>-->
<!-- </FormItem>-->
<FormItem label="竞赛的其他要求" prop="request">
<Input v-model="formValidate.request" type="textarea" :autosize="{minRows: 2,maxRows: 5}"
<Input v-model="formValidate.request" type="textarea" :autosize="{minRows: 7,maxRows: 10}"
placeholder="请输入竞赛的其他要求"></Input>
</FormItem>
<FormItem>
<FormItem :key="fileKey">
<div style="display: flex;justify-content: flex-start;box-sizing: border-box">
<Upload
style="margin-right: 10px"
......@@ -123,6 +123,9 @@
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程
</Button>
<Button type="primary"
@click="save">保存
</Button>
<!-- <Button type="primary" @click="saveFile">保存附件</Button>-->
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
......@@ -164,13 +167,18 @@ export default {
{value: 1, label: '个人'},
],
competitionnameValue: '',
changecommitid: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
formValidate: {
"flowid": "",
"competitionname": "",
"competitionreportid": "",
"sponsor": "",
"level": "",
"competition_time": 1,
"competition_time": '',
"place": "",
"sign_up": "",
"file_name": "",
......@@ -186,19 +194,7 @@ export default {
// "train_file": "",
'competitionTimeRange': '',
"files_list": [
{
// "id": "string",
// "module": "string",
// "file_name": "string",
// "form_id": "string",
// "path": "string",
// "suffix": "string",
// "size": "string",
// "createby": "string",
// "createtime": "2023-09-14T06:18:42.375Z"
}
]
"files_list": []
},
ruleValidate: {
place: [
......@@ -214,7 +210,7 @@ export default {
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
competition_time: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'}
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
sign_up: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
......@@ -260,6 +256,52 @@ export default {
watch: {},
//方法集合",
methods: {
save() {
const fun = async (changecommitid) => {
let formValidate = _.cloneDeep(this.formValidate)
let files_list = formValidate.files_list
delete formValidate.files_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"competition_sign": formValidate,
'files_list': files_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
res.response.competition_sign.level = Number(res.response.competition_sign.level)
res.response.competition_sign.race_level = Number(res.response.competition_sign.race_level)
// this.formValidate.competitionTimeRange = new Date(res.response.competition_sign.start_time) + '-' + new Date(res.response.competition_sign.end_time)
this.formValidate = res.response.competition_sign
this.formValidate.files_list = res.response.files_list
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
break;
}
},
clearableTime(e) {
this.formValidate.competitionTimeRange = []
console.log("🚀🚀🚀,", e)
......@@ -284,6 +326,7 @@ export default {
this.formValidate.files_list.splice(index, 1)
}
})
this.fileKey++
},
onError(response, file, fileList) {
......@@ -303,6 +346,7 @@ export default {
const res = await api.fileUpload('TrainPlan', formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
async trainBeforeUpload(file) {
......@@ -312,6 +356,7 @@ export default {
const res = await api.fileUpload('Project', formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
handleSubmit() {
......@@ -319,9 +364,13 @@ export default {
if (cur) {
this.$Spin.show()
this.formValidate.competitionname = this.competitionnameValue
this.formValidate.flowid = this.flowid
let data = _.cloneDeep(this.formValidate)
const res = await api.FlowSignSubmit(data)
hook.publicMessage(res)
setTimeout(() => {
window.open("about:blank", "_top").close()
}, 1500)
}
})
},
......@@ -353,6 +402,9 @@ export default {
this.getCompetiotionName()
this.formValidate.flowid = this.$route.query.id;
// this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.FlowInit()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
......
<template>
<div class="container">
<Card style="width: 50%">
<template #title><h2 style="text-align: center">
竞赛公告流程</h2></template>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<Row>
<Col :span="12">
<FormItem label="公告标题" prop="title">
<Input v-model="formValidate.title" placeholder="请输入公告标题"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="公告类型" prop="typeid">
<Select v-model="formValidate.typeid"
placeholder="请选择公告类型">
<Option v-for="(item,index) in noticeSelect" :key="index"
:value="item.id">
{{ item.name }}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row>
<Col :span="12">
<FormItem label="公告是否置顶" prop="is_top">
<Select v-model="formValidate.is_top"
placeholder="请选择是否置顶">
<Option v-for="(item,index) in noticeIsTop" :key="index"
:value="item.value">
{{ item.name }}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<richText :value="formValidate.content" :minHeight="500" @setRichTextValue="getRichTextValue"></richText>
<!-- <FormItem>-->
<Upload
:multiple="true"
:before-upload="beforeUpload"
:on-error="onError"
:on-success="onsuccess"
:on-format-error="onFormatError"
:show-upload-list="true"
type="drag"
action=""
:key="fileKey"
>
<!-- <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>-->
<!-- <p>附件上传</p>-->
<div style="padding: 20px 0;width: 100%;">
<Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
<p>附件上传</p>
</div>
</Upload>
<div class="filelist" v-for="(item,index) in formValidate.files_list" :key="index">
{{ item.file_name }}
<Icon v-if="item.file_name" class="fileddelete" @click="fileDelete(item)" type="ios-trash"/>
</div>
<!-- </FormItem>-->
<FormItem>
<Button type="primary" style="margin-right: 10px"
@click="handleSubmit">提交流程
</Button>
<Button type="primary" @click="save">保存</Button>
<Button @click="handleReset" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</Card>
</div>
<!-- <Grid center square :border="false" style="height: 100%">-->
<!-- <GridItem >1</GridItem>-->
<!-- <GridItem>2</GridItem>-->
<!-- <GridItem>3</GridItem>-->
<!-- </Grid>-->
</template>
<script>
import * as hook from '../../../hook'
import * as api from '../../../api/requestUtils'
import _ from "lodash";
import richText from '../../../components/quill/index.vue'
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
export default {
//import引入的组件需要注入到对象中才能使用",
components: {richText},
data() {
//这里存放数据",
return {
noticeIsTop: [
{value: 0, name: '否'},
{value: 1, name: '是'}
],
noticeSelect: [],
teamSelect: [],
competitionNameArray: [],
approval_stateArray: [
{value: 0, label: '未审批'},
{value: 1, label: '审批中'},
{value: 2, label: '审批通过'},
{value: 3, label: '审批不通过'},
],
levelArray: [
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
],
wayArray: [
{value: 0, label: '团队'},
{value: 1, label: '个人'},
],
competitionnameValue: '',
flowid: '',
module_id: '',
module: '',
fileKey: 1,
formValidate: {
"flowid": "",
"title": "",
"content": "",
"typeid": "",
"is_top": 0,
"is_public": 0,
"files_list": []
},
ruleValidate: {
title: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
typeid: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
is_top: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
"competitionname": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
"sponsor": [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
race_level: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'}
],
team_id: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'change'}
],
certificate_name: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
certificate_description: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}
],
}
}
},
//监听属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {
'formValidate.content'(newValue, oldValue) {
console.log("🚀🚀newValue🚀,", newValue)
}
},
//方法集合",
methods: {
save() {
const fun = async (changecommitid) => {
let formValidate = _.cloneDeep(this.formValidate)
let files_list = formValidate.files_list
delete formValidate.files_list
let data = {
"changecommitid": changecommitid,
"flowid": this.flowid,
"module_id": this.module_id,
"module": this.module,
"notice": formValidate,
'files_list': files_list,
}
await hook.myEncapsulationFunction(async () => {
return await api.FlowChangeCommit(data)
})
}
switch (this.changecommitid) {
case undefined :
fun(this.changecommitid)
break;
default:
fun(this.changecommitid)
break;
}
},
async FlowInit() {
const res = await api.FlowInit({flowid: this.flowid})
switch (res.response.changecommitid) {
case null:
break;
default :
this.formValidate = res.response.notice
this.formValidate.files_list = res.response.files_list
//------------------------------
this.changecommitid = res.response.changecommitid
this.flowid = res.response.flowid
this.module_id = res.response.module_id
this.module = res.response.module
break;
}
},
getRichTextValue(e) {
this.formValidate.content = e
},
fileDelete(e) {
this.formValidate.files_list.map((cur, index) => {
if (cur.id === e.id) {
this.formValidate.files_list.splice(index, 1)
}
})
this.fileKey++
},
onError(response, file, fileList) {
console.log("🚀🚀🚀,onError", response, file, fileList)
},
onsuccess(response, file, fileList) {
console.log("🚀🚀🚀,onsuccess", response, file, fileList)
},
onFormatError(response, file, fileList) {
this.$Message.info('文件类型错误!')
},
async beforeUpload(file) {
this.$Spin.show()
let formData = new FormData();
formData.append(`file`, file);
const res = await api.fileUpload(this.formValidate.files_list.module, formData);
this.formValidate.files_list.push(res.response)
hook.publicMessage(res)
this.fileKey++
return false
},
handleSubmit() {
this.$refs['formValidate'].validate(async (cur) => {
if (cur) {
this.$Spin.show()
// this.formValidate.competitionname = this.competitionnameValue
this.formValidate.flowid = this.flowid
let data = _.cloneDeep(this.formValidate)
const res = await api.FlowNoticeSubmit(data)
hook.publicMessage(res)
setTimeout(() => {
window.open("about:blank", "_top").close()
}, 1500)
}
})
},
handleReset() {
this.formValidate = {}
},
async getCompetiotionName() {
const res = await api.GetReportSelect()
this.competitionNameArray = res.response
const date = await api.TeamSelect()
this.teamSelect = date.response
const noticeSelect = await api.NoticeTypeSelect()
this.noticeSelect = noticeSelect.response
},
},
//生命周期 - 创建之前",数据模型未加载,方法未加载,html模板未加载
beforeCreate() {
},
//生命周期 - 创建完成(可以访问当前this实例)",数据模型已加载,方法已加载,html模板已加载,html模板未渲染
created() {
},
//生命周期 - 挂载之前",html模板未渲染
beforeMount() {
},
//生命周期 - 挂载完成(可以访问DOM元素)",html模板已渲染
mounted() {
this.getCompetiotionName()
this.formValidate.flowid = this.$route.query.id;
this.formValidate.files_list.module = this.$route.query.remark;
this.flowid = this.$route.query.id;
this.module = this.$route.query.remark;
this.FlowInit()
},
//生命周期 - 更新之前",数据模型已更新,html模板未更新
beforeUpdate() {
},
//生命周期 - 更新之后",数据模型已更新,html模板已更新
updated() {
},
//生命周期 - 销毁之前",
beforeDestroy() {
},
destroyed() {
},
//生命周期 - 销毁完成",
//如果页面有keep-alive缓存功能,这个函数会触发",
activated() {
},
}
</script>
<style>
.filelist {
}
.filelist:hover {
color: #1e93ff;
background-color: #f7f7f7;
}
.fileddelete {
}
.fileddelete:hover {
color: red;
transform: scale(1.5);
}
</style>
<style>
.container {
width: 100%;
min-height: 887px;
height: auto;
display: flex;
align-content: center;
justify-content: center;
flex-wrap: wrap;
}
</style>
......@@ -13,6 +13,7 @@
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #todo="{row}">
<span v-for="(item,index) in row.todo" :key="index">{{
......@@ -32,10 +33,15 @@
</Tag>
</template>
<template slot-scope="{ row }" slot="action">
<Button :key="cancelKey" :disabled="row.status === 2" type="error" size="small" @click="flowCancel(row)"
style="margin-right: 10px">取消
</Button>
<Button type="primary" size="small" @click="approvalLisFun(row)">详细</Button>
<!-- <Button :key="cancelKey" :disabled="row.status === 2" type="error" size="small" @click="flowCancel(row)"-->
<!-- style="margin-right: 10px">取消-->
<!-- </Button>-->
<a :key="cancelKey" v-if="row.status === 2" class="cancel" style="margin-right: 15px;">取消</a>
<a :key="cancelKey" v-else @click="flowCancel(row)" style="margin-right: 15px;color: red">取消</a>
<!-- <Button type="primary" size="small" @click="approvalLisFun(row)">详细</Button>-->
<a @click="approvalLisFun(row)">详细</a>
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
......@@ -208,27 +214,6 @@ export default {
show: true,
minWidth: 120,
},
{
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '当前节点名称',
key: 'current_node_name',
......@@ -252,26 +237,49 @@ export default {
minWidth: 200,
},
{
title: '修改人',
key: 'modifyby',
title: '发起人',
key: 'starter',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
title: '发起人姓名',
key: 'starter_name',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
{
title: '关联模块',
key: 'form_name',
title: '发起时间',
key: 'start_time',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
// {
// title: '修改人',
// key: 'modifyby',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '修改时间',
// key: 'modifytime',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '关联模块',
// key: 'form_name',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '操作',
align: 'center',
......@@ -317,7 +325,7 @@ export default {
methods: {
// 查询
async GetFlowTaskList() {
this.$Spin.show()
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size
......@@ -325,7 +333,7 @@ export default {
const res = await api.GetMyFlowTaskList(data)
this.init.total = res.response.data_count
this.tableData = res.response.data
hook.publicMessage(res)
this.loading = false
},
// 新增
add() {
......@@ -335,6 +343,7 @@ export default {
hook.publicConfirm(async () => {
const res = await api.FlowCancel({runid: row.runid})
this.cancelKey++
hook.publicMessage(res)
await this.GetFlowTaskList()
})
......@@ -378,3 +387,9 @@ export default {
}
}
</script>
<style>
.cancel {
cursor: not-allowed;
color: #c5c8ce
}
</style>
<template>
<div>
<Card ref="card">
<template #title>
<h3 style="height: 30px;display: flex;align-items: center">
流程设计管理
</h3>
</template>
<template #extra>
<Button type="primary" @click="add">
新增流程
</Button>
</template>
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #status="{row}">
<Switch ref="refSwitch" true-color="#22d86e" :value="Boolean(row.status)"
@on-change="changeSwitch(row)">
<template #open>
<span>是</span>
</template>
<template #close>
<span>否</span>
</template>
</Switch>
<!-- <Tag :color="['warning','success'][row.status]">-->
<!-- {{ ['未发布', '已发布'][row.status] }}-->
<!-- </Tag>-->
</template>
<template #remark="{row}">
{{ row.remark }}
</template>
<template #member="{row}">
<Tag v-for="(item,index) in row.member" :key="index" type="border" color="primary">
{{ item.name }}({{ item.card }})
</Tag>
</template>
<template slot-scope="{ row }" slot="action">
<a @click="node(row)">节点信息</a>
<a @click="edit(row)" style="margin-left: 15px;">编辑</a>
<a @click="deleteUserGroup(row)" style="margin-left: 15px;color: red;">删除</a>
<!-- <Button type="success" style="margin-right: 10px" size="small" @click="node(row)">节点信息</Button>-->
<!-- <Button type="primary" size="small" @click="edit(row)" style="margin-right: 10px">编辑</Button>-->
<!-- <Button type="error" size="small" @click="deleteUserGroup(row)">删除</Button>-->
<!-- -->
</template>
</Table>
<div style="width: 100%;height: 70px;display: flex;align-items: center;">
<Page show-total
show-sizer
show-elevator
:total="init.total"
:page-size="init.page_size"
model-value="init.page_index"
@on-change="currentPage"
@on-page-size-change="currentPageCount"
/>
</div>
</Card>
<Modal
v-model="addModal"
title="新增"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label=流程名称 prop="flowname">
<Input v-model="formValidate.flowname" placeholder="请输入流程名称"></Input>
</FormItem>
<FormItem label="流程备注" prop="remark">
<Input v-model="formValidate.remark" placeholder="请输入流程名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="addModal =false">取消</Button>
<Button type="primary" @click="addOk">确定</Button>
</template>
</Modal>
<!-- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
<Modal
v-model="nodeModal"
title=""
:width="80"
@on-visible-change="closeNodeModal"
:closable="false"
>
<template #header>
<div style=" display: flex;justify-content: space-between;align-items: center">
<span style="font-size: 18px"> 流程节点列表</span>
<Button type="primary" @click="addNode">
新增节点
</Button>
</div>
</template>
<Table
:columns="nodecolumns"
:data="nodetableData"
:loading="tableLoading"
>
<!-- <template v-slot:process_mode="{row}">-->
<!-- <Tag :color="['primary','success'][row.process_mode]"> {{ ['或签', '会签'][row.process_mode] }}</Tag>-->
<!-- </template>-->
<template v-slot:action="{row}">
<a @click="nodeInfo(row)">详细</a>
<a @click="editNode(row)" style="margin-left: 15px;">编辑</a>
<a @click="deleteNode(row)" style="margin-left: 15px;color: red;">删除</a>
<!-- ***************************-->
<!-- <Button type="success" style="margin-right: 10px" size="small" @click="nodeInfo(row)">详细</Button>-->
<!-- <Button type="primary" size="small" @click="editNode(row)" style="margin-right: 10px">编辑</Button>-->
<!-- <Button type="error" size="small" @click="deleteNode(row)">删除</Button>-->
</template>
</Table>
<!-- <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">-->
<!-- <FormItem label=流程名称 prop="flowname">-->
<!-- <Input v-model="formValidate.flowname" placeholder="请输入流程名称"></Input>-->
<!-- </FormItem>-->
<!-- <FormItem label="流程备注" prop="remark">-->
<!-- <Input v-model="formValidate.remark" placeholder="请输入流程名称"></Input>-->
<!-- </FormItem>-->
<!-- </Form>-->
<template #footer>
<Button type="text" @click="nodeModal =false">取消</Button>
<Button type="primary" @click="addOk">确定</Button>
</template>
<Drawer v-model="nodeDrawer" :transfer="false" title="节点详细信息" :width="450"
>
<Timeline>
<TimelineItem color="blue">
<p style="font-weight: bold">{{ nodeDrewerData.last_node_name ? nodeDrewerData.last_node_name : '无' }}</p>
<p>上一个节点</p>
</TimelineItem>
<TimelineItem color="green">
<p style="font-weight: bold">{{ nodeDrewerData.nodename }}</p>
<p>当前节点</p>
</TimelineItem>
<TimelineItem color="blue">
<p style="font-weight: bold">{{ nodeDrewerData.next_node_name ? nodeDrewerData.next_node_name : '无' }}</p>
<p>下一个节点</p>
</TimelineItem>
</Timeline>
<Row>
<Col :span="12">
<span>
接收组:
</span>
<span class="font">
{{ nodeDrewerData.receive_name }}
</span>
</Col>
<Col :span="12" style=" display: flex;justify-content: flex-end">
<span>
创建人:
</span>
<span class="font">
{{ nodeDrewerData.createby }}
</span>
</Col>
</Row>
</Drawer>
</Modal>
<Modal
v-model="addNodeModal"
title="新增节点"
width="40"
>
<Form ref="formValidate1" :model="formValidate1" :rules="ruleValidate" :label-width="130">
<FormItem label="当前节点名称" prop="nodename">
<Input v-model="formValidate1.nodename" placeholder="请输入当前节点名称"></Input>
</FormItem>
<FormItem label=上一个节点 prop="last_node_id">
<Select v-model="formValidate1.last_node_id">
<Option v-for="(item,index) in nodeList" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<FormItem label=下一个节点 prop="next_node_id">
<Select v-model="formValidate1.next_node_id">
<Option v-for="(item,index) in nodeList" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<FormItem label=接收节点用户组 prop="receive">
<Select v-model="formValidate1.receive">
<Option v-for="(item,index) in userGroupArray" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<!-- <FormItem label=节点处理模式 prop="process_mode">-->
<!-- <Select v-model="formValidate1.process_mode">-->
<!-- <Option v-for="(item,index) in processModeArray" :value="item.value" :key="index"> {{-->
<!-- item.name-->
<!-- }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
</Form>
<template #footer>
<Button type="text" @click="addNodeModal =false">取消</Button>
<Button type="primary" @click="addNodeOk">确定</Button>
</template>
</Modal>
<Modal
v-model="addNodeModal1"
title="编辑节点"
width="40"
>
<Form ref="formValidate2" :model="formValidate2" :rules="ruleValidate" :label-width="130">
<FormItem label="当前节点名称" prop="nodename">
<Input v-model="formValidate2.nodename" placeholder="请输入当前节点名称"></Input>
</FormItem>
<FormItem label=上一个节点 prop="last_node_id">
<Select v-model="formValidate2.last_node_id">
<Option v-for="(item,index) in nodeList" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<FormItem label=下一个节点 prop="next_node_id">
<Select v-model="formValidate2.next_node_id">
<Option v-for="(item,index) in nodeList" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<FormItem label=接收节点用户组 prop="receive">
<Select v-model="formValidate2.receive">
<Option v-for="(item,index) in userGroupArray" :value="item.id" :key="index"> {{
item.name
}}
</Option>
</Select>
</FormItem>
<!-- <FormItem label=节点处理模式 prop="process_mode">-->
<!-- <Select v-model="formValidate2.process_mode">-->
<!-- <Option v-for="(item,index) in processModeArray" :value="item.value" :key="index"> {{-->
<!-- item.name-->
<!-- }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
</Form>
<template #footer>
<Button type="text" @click="addNodeModal1 =false">取消</Button>
<Button type="primary" @click="addNodeOk1">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from '../../api/requestUtils'
import * as hook from '../../hook/index'
import _ from "lodash";
export default {
name: 'list',
data() {
return {
addNodeModal1: false,
processModeArray: [
{name: '或签', value: 0},
{name: '会签', value: 1},
],
userGroupArray: [],
addNodeModal: false,
nodeDrawer: false,
nodeList: [],
nodeApprovalMode: [],
tableLoading: false,
nodeModal: false,
tramsferKey: 1,
GroupUserInfo: {},
formValidate: {
addOrEdit: '',
flowname: '',
remark: '',
createtime: '',
createby: '',
},
formValidate1: {
"nodename": "",
"flow_id": "",
"last_node_id": "",
"next_node_id": "",
"process_mode": 0,
"receive": "",
},
formValidate2: {
"nodename": "",
"flow_id": "",
"last_node_id": "",
"next_node_id": "",
"process_mode": 0,
"receive": "",
},
ruleValidate: {
nodename: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'blur'},
],
last_node_id1: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'change'},
],
next_node_id1: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'change'},
],
receive: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'change'},
],
process_mode: [
{type: 'number', required: true, message: '此项不能为空', trigger: 'change'},
],
flowname: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'blur'},
],
remark: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'change'},
],
},
addModal: false,
editId: '',
editModal: false,
approvalGroup: [],
init: {
total: null,
page_size: 10,
page_index: 1,
},
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '流程名称',
key: 'flowname',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '备注',
slot: 'remark',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '发布状态',
slot: 'status',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '创建人',
key: 'createby',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '创建时间',
key: 'createtime',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '修改人',
key: 'modifyby',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '修改时间',
key: 'modifytime',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '操作',
align: 'center',
minWidth: 180,
show: true,
slot: 'action'
}
],
loading: false,
nodecolumns: [
{
title: '当前节点名称',
key: 'nodename',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '上个节点名称',
key: 'last_node_name',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '下个节点名称',
key: 'next_node_name',
align: 'center',
show: true,
minWidth: 100,
},
// {
// title: '节点处理模式',
// slot: 'process_mode',
// align: 'center',
// show: true,
// minWidth: 100,
// },
{
title: '接收用户组',
key: 'receive_name',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '创建人',
key: 'createby',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '创建时间',
key: 'createtime',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '修改人',
key: 'modifyby',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '修改时间',
key: 'modifytime',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '操作',
align: 'center',
minWidth: 180,
show: true,
slot: 'action'
}
],
nodetableData: [],
nodeDrewerData: {},
tableData: [],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
// mixArr: []
}
},
watch: {
'formValidate1.flow_id'(newValue, oldValue) {
console.log("🚀🚀🚀,", newValue)
}
},
// 查询条件初始化
created() {
},
mounted() {
this.GetFlowDesignAllList()
this.getSelectList()
this.GetFlowUserGroupBySelect()
},
methods: {
async GetFlowUserGroupBySelect() {
const res = await api.GetFlowUserGroupBySelect({key: ''})
this.userGroupArray = res.response
},
addNode() {
// this.formValidate1 = {}
this.addNodeModal = true
},
closeNodeModal(e) {
console.log("🚀🚀🚀,", e)
e ? '' : this.nodeDrawer = false
},
add() {
this.addModal = true
this.formValidate = {}
this.formValidate.addOrEdit = 'add'
},
changeSwitch(row) {
hook.myEncapsulationFunction(async () => {
let data = {
flowid: row.flowid,
status: Boolean(row.status) ? 0 : 1,
}
const res = await api.FlowPublic(data)
this.GetFlowDesignAllList()
return res
})
},
render(item) {
return item.name;
},
handleChange(newTargetKeys, direction, moveKeys) {
switch (direction) {
case 'left':
moveKeys.map((c, i) => {
if (this.GroupUserInfo.member.indexOf(c) !== -1) {
this.GroupUserInfo.member.splice(this.GroupUserInfo.member.indexOf(c), 1)
}
})
break;
case 'right':
this.GroupUserInfo.member = newTargetKeys
break;
}
},
Ok() {
},
async getSelectList() {
const res = await api.GetProcessSelect()
this.nodeApprovalMode = res.response
},
// async GetFlowNodeList() {
// this.$Spin.show()
// let data = {
// page_index: this.init.page_index,
// page_size: this.init.page_size,
// }
// const res = await api.GetFlowNodeList(data)
// this.nodetableData = res.response.data
// this.$Spin.hide()
// },
// 查询
async GetFlowDesignAllList() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
}
const res = await api.GetFlowDesignAllList(data)
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
},
// 新增
async addOk(e) {
this.$refs['formValidate'].validate((validate) => {
if (validate) {
const fun = async () => {
let data = _.cloneDeep(this.formValidate)
const res = await api.GetFlowDesignSave(data)
await this.GetFlowDesignAllList()
this.addModal = false
return res
}
hook.myEncapsulationFunction(async () => {
switch (this.formValidate.addOrEdit) {
case 'add':
return await fun()
break;
case 'edit':
return await fun()
break;
}
})
}
})
},
async editOk() {
this.$refs.formValidate1.validate(async (value) => {
if (value) {
let data = {
"groupid": this.GroupUserInfo.groupid,
"groupname": this.formValidate.name,
"member": this.GroupUserInfo.member
}
const res = await api.FlowUserGroupSave(data)
if (res.code !== 1) {
this.$Message.error(res.msg_detail)
} else {
hook.publicMessage(res)
this.GetFlowDesignAllList()
this.editModal = false
}
}
})
},
async deleteUserGroup(row) {
hook.publicConfirm(async () => {
await hook.myEncapsulationFunction(async () => {
let res = await api.FlowDesignDel({flowid: row.flowid})
await this.GetFlowDesignAllList()
return res
})
})
},
addNodeOk() {
const empty = () => {
this.addNodeModal = false
this.formValidate1 = {}
}
this.$refs['formValidate1'].validate(async (va) => {
if (va) {
let data = _.cloneDeep(this.formValidate1)
const res = await hook.myEncapsulationFunction(async () => {
const res = await api.FlowNodeSave(data)
await this.fun(this.formValidate1.flow_id)
return res
})
console.log("res", res.code)
res.code === 1 ? empty() : ''
}
})
},
async fun(e) {
let data = {flowid: e}
this.tableLoading = true
const res = await api.GetFlowNodeList(data)
this.nodetableData = res.response
this.tableLoading = false
// ----------------------
const nodeSelect = await api.GetFlowNodeSelet(data)
this.nodeList = nodeSelect.response
},
deleteNode(row) {
hook.publicConfirm(() => hook.myEncapsulationFunction(async () => {
const res = await api.FlowNodeDel({id: row.nodeid})
await this.fun(row.flow_id)
return res
}))
},
// 修改
async edit(row) {
this.formValidate = {}
this.formValidate = row
this.formValidate.addOrEdit = 'edit'
// this.formValidate.flowid = row.flowid
// this.formValidate.flowname = row.flowname
// this.formValidate.remark = row.remark
// this.formValidate.createby = row.createby
// this.formValidate.createtime = row.createtime
this.addModal = true
},
async editNode(row) {
this.formValidate2 = {}
this.addNodeModal1 = true
const res = await api.GetFlowNodeInfo({flowid: row.flow_id, nodeid: row.nodeid})
this.formValidate2 = res.response
},
async addNodeOk1() {
const empty = () => {
this.addNodeModal1 = false
this.formValidate2 = {}
}
const res = await hook.myEncapsulationFunction(async () => {
let data = _.cloneDeep(this.formValidate2)
const res = await api.FlowNodeSave(data)
await this.fun(this.formValidate2.flow_id)
return res
})
res.code === 1 ? empty() : ''
},
async nodeInfo(row) {
this.nodeDrawer = true
let data = {
flowid: row.flow_id,
nodeid: row.nodeid
}
const res = await api.GetFlowNodeInfo(data)
this.nodeDrewerData = res.response
},
async node(row) {
this.nodeModal = true
let data = {flowid: row.flowid}
this.tableLoading = true
const res = await api.GetFlowNodeList(data)
this.nodetableData = res.response
this.formValidate1.flow_id = row.flowid
this.tableLoading = false
// -----------------
const nodeSelect = await api.GetFlowNodeSelet(data)
this.nodeList = nodeSelect.response
},
// 删除
del(row) {
console.log('删除');
this.$Message.info('删除成功');
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
currentPage(e) {
this.init.page_index = e
this.GetFlowDesignAllList()
},
currentPageCount(e) {
this.init.page_size = e
this.GetFlowDesignAllList()
},
}
}
</script>
<style scoped>
.font {
font-weight: bold;
}
</style>
<template>
<div>
<Card>
<template #title >
<template #title>
<div style="height: 30px;display: flex;align-items: center;">
<h3 >权限分配</h3>
<h3>权限分配</h3>
</div>
</template>
<template #extra>
<div style="display: flex;flex-wrap: nowrap;align-items: center; ">
<Input v-model="searchValue" placeholder="请输入权限名称进行查找..."></Input>
<Button type="primary" :disabled="searchValue === ''" @click="searchEvent" style="margin-left: 10px;">查找</Button>
<Button type="primary" :disabled="searchValue === ''" @click="searchEvent" style="margin-left: 10px;">查找
</Button>
<Button type="primary" @click="addRoleClass" style="margin-left: 10px;">增添权限类型</Button>
</div>
</template>
<Table :columns="columns" :data="data">
<Table :columns="columns" :data="data" :loading="loading1">
<template #action="{row}">
<Button type="primary" size="small" @click="update(row)">修改</Button>
<Button type="error" size="small" @click="roleDelete(row)" style="margin-left: 10px;">删除</Button>
<a @click="update(row)">修改</a>
<a style="color: red;margin-left: 10px;" @click="roleDelete(row)">删除</a>
<!-- <Button type="primary" size="small" @click="update(row)">修改</Button>-->
<!-- <Button type="error" size="small" @click="roleDelete(row)" style="margin-left: 10px;">删除</Button>-->
<Modal
v-model="modal"
:title="`${ModalTitleValue}`"
......@@ -28,12 +33,12 @@
ok-text="确认"
:mask-closable="false"
>
<Form :model="formTop" :label-width="80" ref="updateRoleValue" >
<Form :model="formTop" :label-width="80" ref="updateRoleValue">
<!-- :rules="ruleValidate"-->
<FormItem label="权限名称" prop="input1" >
<FormItem label="权限名称" prop="input1">
<Input v-model="formTop.input1"></Input>
</FormItem>
<FormItem label="备注" prop="input2" >
<FormItem label="备注" prop="input2">
<Input v-model="formTop.input2"></Input>
</FormItem>
</Form>
......@@ -66,37 +71,36 @@ import Vue from "vue";
export default {
//import引入的组件需要注入到对象中才能使用",
components: {
},
components: {},
data() {
//这里存放数据",
return {
searchValue:'', // 搜索框的值
total:null,
page_size:10,
page_index:1,
ruleValidate:{
loading1: false,
searchValue: '', // 搜索框的值
total: null,
page_size: 10,
page_index: 1,
ruleValidate: {
input1: [
{ required: true, message: '不能为空!', trigger: 'blur' }
{required: true, message: '不能为空!', trigger: 'blur'}
],
input2: [
{ required: true, message: '不能为空!', trigger: 'blur' }
{required: true, message: '不能为空!', trigger: 'blur'}
]
},
formTop_roleId:"",
formTop:{ //当前行对象赋值
input1:"",
input2:"",
roleId:'',
roleCreateTime:'',
formTop_roleId: "",
formTop: { //当前行对象赋值
input1: "",
input2: "",
roleId: '',
roleCreateTime: '',
},
modal:false, // 触发modal
columns:[
modal: false, // 触发modal
columns: [
{
title:'序号',
type:'index',
align:'center',
title: '序号',
type: 'index',
align: 'center',
},
{
......@@ -105,7 +109,7 @@ export default {
},
{
title: '备注',
key:'role_remark',
key: 'role_remark',
},
// {
// title: '创建时间',
......@@ -113,17 +117,17 @@ export default {
// },
{
title: '操作',
slot:'action',
slot: 'action',
align: 'center',
}
],
data:[]
data: []
};
},
//监听属性 类似于data概念",
computed: {
ModalTitleValue(){
ModalTitleValue() {
// modal title value
return this.formTop.input1 === '' ? '增添权限类型' : '信息修改'
},
......@@ -131,7 +135,7 @@ export default {
},
//监控data中的数据变化",
watch: {
'formTop.input1'(newValue,oldValue){
'formTop.input1'(newValue, oldValue) {
console.log(newValue)
},
// searchValue(newValue,oldValue){
......@@ -142,29 +146,28 @@ export default {
},
//方法集合",
methods: {
searchEvent(){
searchEvent() {
// 搜索按钮事件
this.page_index = 1
this.GetUserRoleList()
},
currentPage(e){
currentPage(e) {
console.log(e)
this.page_index = e
this.GetUserRoleList()
},
currentPageCount(e){
console.log(e,'currentPageCount')
currentPageCount(e) {
console.log(e, 'currentPageCount')
this.page_size = e
this.GetUserRoleList()
},
publicConfirm(publicFunction){
publicConfirm(publicFunction) {
// 公共弹窗删除
this.$Modal.confirm({
title: '警告',
content: '<p>是否继续此操作?</p>',
cancelText:"取消",
okText:'确定',
cancelText: "取消",
okText: '确定',
onOk: async () => {
// 接收需执行的方法
await publicFunction()
......@@ -173,13 +176,13 @@ export default {
}
});
},
publicMessage(res){ // 弹窗封装
if(res.code !== 1){
publicMessage(res) { // 弹窗封装
if (res.code !== 1) {
this.$Message['warning']({
background: true,
content: '操作异常'
});
}else{
} else {
this.$Spin.hide();
this.$Message['success']({
background: true,
......@@ -188,46 +191,49 @@ export default {
});
}
},
async roleDeleteEvent(){
async roleDeleteEvent() {
let data = {"id": this.formTop.roleId}
const res = await api.UserRoleDel(data)
this.publicMessage(res)
await this.GetUserRoleList()
},
async roleDelete(e){
async roleDelete(e) {
//删除权限类型
this.formTop.roleId = e.roleid;
this.publicConfirm(()=>{return this.roleDeleteEvent()})
this.publicConfirm(() => {
return this.roleDeleteEvent()
})
},
// roleDetails(e){
// //详细按钮
// console.log(e)
// },
addRoleClass(){
addRoleClass() {
// 添增权限类型
this.formTop.input1 = '' ;
this.formTop.input2 = '' ;
this.formTop.roleId = '' ;
this.formTop.input1 = '';
this.formTop.input2 = '';
this.formTop.roleId = '';
this.modal = true
},
update(row){
update(row) {
// 修改按钮触发弹窗
this.modal = true;
this.formTop.input1 = row.role_name;
this.formTop.input2= row.role_remark;
this.formTop.input2 = row.role_remark;
this.formTop.roleId = row.roleid;
this.formTop.roleCreateTime = row.createtime;
},
modalOkDataAction(e){
modalOkDataAction(e) {
//修改弹窗 确认事件data 处理 e 不为空 表示点击修改 e空 为新增
let data
if(e){
if (e) {
data = {
"roleid": this.formTop.roleId,
"role_name": this.formTop.input1,
"role_remark": this.formTop.input2,
"createtime": this.formTop.roleCreateTime,
}
}else {
} else {
data = {
"role_name": this.formTop.input1,
"role_remark": this.formTop.input2,
......@@ -236,30 +242,31 @@ export default {
}
return data
},
async modalOk(e){
async modalOk(e) {
//修改弹窗 确认事件
// this.$refs['updateRoleValue'].validate(async (validateValue) => {
// if(validateValue){
const data = this.modalOkDataAction(e)
const res = await api.UserRoleSave(data)
this.publicMessage(res)
await this.GetUserRoleList()
// }
// })
},
async GetUserRoleList(){
this.$Spin.show();
async GetUserRoleList() {
this.loading1 = true
// 获取初始话列表
let data = {
"page_index":this.page_index,
"page_size":this.page_size,
"name":this.searchValue,
"page_index": this.page_index,
"page_size": this.page_size,
"name": this.searchValue,
}
const res = await api.GetUserRoleList(data)
this.data = []
this.data = res.response.data
this.total = res.response.data_count
this.publicMessage(res)
this.loading1 = false
}
......@@ -305,11 +312,10 @@ export default {
}
</script>
<style scoped>
.columnsItemMinWidth{
.columnsItemMinWidth {
min-width: 1000px;
}
</style>
<template>
<div>
<Card ref="card">
<template #title>
<div style="height: 80px">
<h3>日志记录</h3>
<Row style="margin-top:30px">
<Col span="8">
结束时间:
<DatePicker @on-change="selectTimeRange" type="daterange" placement="bottom-end"
placeholder="请选择结束时间"
style="width: 200px"/>
</Col>
<!-- <Col span="8">-->
<!-- <div style="display: flex;align-items: center;justify-content: center">-->
<!-- 参与方式:-->
<!-- <Select v-model="init.reportid" style="width: 10vw;">-->
<!-- <Option v-for="(item,index) in personageCompetitionSelect" :value="item.id" :key="index"> {{-->
<!-- item.name-->
<!-- }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </div>-->
<!-- </Col>-->
<Col span="8">
<div style="display: flex;align-items: center;">
是否成功:
<Select v-model="init.is_succeed" style="width: 10vw;">
<Option v-for="(item,index) in is_succeedArray" :value="item.value" :key="index">
{{ item.name }}
</Option>
</Select>
</div>
</Col>
<Col span="8">
<div style="display: flex;align-items: center;justify-content: flex-end;">
<Input style="width: 20vw" v-model="init.key" placeholder="请输入姓名或卡号查找..."></Input>
<Button type="primary" class="ivu-ml-8" @click="resetSearchSelect">
查找
</Button>
</div>
</Col>
</Row>
</div>
</template>
<template #extra>
</template>
<Table
:columns="columns"
:data="tableData"
class="ivu-mt"
:loading="loading"
:size="tableSize"
>
<template #is_succeed="{row}">
<tag :color="['','error','success'][row.is_succeed]"> {{ ['', '失败', '成功'][row.is_succeed] }}</tag>
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangepage_size"
/>
</div>
</Card>
<Modal
v-model="scoreModal"
title="编辑"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="竞赛成绩" prop="score">
<InputNumber style="width: 100%" :min="0" :max="100" v-model="formValidate.score"
placeholder="请输入竞赛成绩"></InputNumber>
</FormItem>
<FormItem label="是否获奖" prop="is_win">
<Select style="width: 100%" v-model="formValidate.is_win"
placeholder="请输入竞赛成绩">
<Option :value="i.value" v-for="(i,ind) in is_winArray" :key="ind">{{ i.name }}</Option>
</Select>
</FormItem>
<FormItem label="奖项名称" prop="prizes">
<Input :disabled="prizesDis" style="width: 100%" v-model="formValidate.prizes"
placeholder="请输入奖项名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="scoreModal =false">取消</Button>
<Button type="primary" @click="scoreOk">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from "@api/requestUtils";
import {myEncapsulationFunction} from "@/hook";
export default {
name: 'list',
data() {
return {
prizesDis: false,
personageCompetitionSelect: [],
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '消息内容',
key: 'messageinfo',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '发送时间',
key: 'send_time',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '创建时间',
key: 'createtime',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '接收人卡号',
key: 'reception_card',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '接收人',
key: 'reception_man',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '是否成功',
slot: 'is_succeed',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '内容',
key: 'content',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '链接',
key: 'meg_link',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '失败原因',
key: 'remark',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '关联表id',
key: 'relevance_id',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '关联表名称',
key: 'relevance_name',
align: 'center',
show: true,
minWidth: 200,
},
//
// {
// title: '操作',
// align: 'center',
// minWidth: 180,
// fixed: 'right',
// show: true,
// slot: 'action'
// }
],
loading: false,
tableData: [],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
init: {
"begin_time": "",
"end_time": "",
"key": "",
"is_succeed": "",
"page_index": 1,
"page_size": 10,
total: 0,
},
init1: {
"begin_time": "",
"end_time": "",
"key": "",
"is_succeed": "",
"page_index": 1,
"page_size": 10,
total: 0,
},
is_succeedArray: [
{name: '失败', value: 1},
{name: '成功', value: 2},
],
is_winArray: [
{name: '否', value: 0},
{name: '是', value: 1},
],
scoreModal: false,
ruleValidate: {
score: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'blur'},
],
prizes: [
{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'},
],
is_win: [
{type: 'number', required: true, message: '该项不能为空', trigger: 'change'},
],
},
formValidate: {
score: 0,
id: '',
prizes: '',
is_win: '',
}
}
},
watch: {
'init.reportid'(newValue, oldValue) {
this.init.reportid = newValue
newValue ? this.getData() : ''
},
'formValidate.is_win'(newValue, oldValue) {
Boolean(newValue) ? this.prizesDis = false : this.prizesDis = true
}
},
// 查询条件初始化
created() {
},
mounted() {
// this.getData()
this.GetMessageList()
},
methods: {
selectTimeRange(e) {
this.init.begin_time = e[0]
this.init.end_time = e[1]
},
scoreOk() {
this.$refs['formValidate'].validate((val) => {
if (val) {
myEncapsulationFunction(async () => {
let data = this.formValidate
const res = await api.ScoreSave(data)
await this.getData()
this.scoreModal = false
return res
})
}
})
},
resetSearchSelect() {
this.init1.begin_time = this.init.begin_time
this.init1.end_time = this.init.end_time
this.init1.is_succeed = this.init.is_succeed
this.init1.key = this.init.key
this.GetMessageList()
},
async GetMessageList() {
this.loading = true
let data = {
begin_time: this.init1.begin_time,
end_time: this.init1.end_time,
key: this.init1.key,
is_succeed: this.init1.is_succeed,
page_index: this.init.page_index,
page_size: this.init.page_size,
}
const res = await api.GetMessageList(data)
try {
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
} catch (e) {
this.loading = false
}
},
// 查询
async getData() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
reportid: this.init.reportid,
}
const res = await api.GetScoreList(data)
try {
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
} catch (e) {
this.loading = false
}
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.$refs.addEdit.edit(row)
},
importScore(row) {
this.scoreModal = true
this.formValidate = {}
this.formValidate.id = row.scoreid
},
// 删除
del(row) {
myEncapsulationFunction(async () => {
const res = await api.ScoreDel({id: row.scoreid})
this.getData()
return res
})
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.GetMessageList()
},
// 切换每页条数
handleChangepage_size(size) {
this.init.page_size = size
this.GetMessageList()
},
}
}
</script>
<template>
<div>
<!-- <Card ref="card">-->
<!-- <template #title>-->
<!-- <h3 style="height: 30px;display: flex;align-items: center">-->
<!-- 审批用户组管理-->
<!-- </h3>-->
<!-- </template>-->
<!-- <template #extra>-->
<!-- <Button type="primary" @click="addModal = true">-->
<!-- 新增-->
<!-- </Button>-->
<!-- </template>-->
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #member="{row}">
<Tag v-for="(item,index) in row.member" :key="index" type="border" color="primary">
{{ item.name }}({{ item.card }})
</Tag>
</template>
<template slot-scope="{ row }" slot="action">
<!-- <Button type="primary" size="small" @click="edit(row)" style="margin-right: 10px">编辑</Button>-->
<!-- <Button type="error" size="small" @click="deleteNoticeUserGroup(row)">删除</Button>-->
<a @click="edit(row)">编辑</a>
<a @click="deleteNoticeUserGroup(row)" style="margin-left: 15px;color: red">删除</a>
</template>
</Table>
<div style="width: 100%;height: 70px;display: flex;align-items: center;">
<Page show-total
show-sizer
show-elevator
:total="init.total"
:page-size="init.page_size"
model-value="init.page_index"
@on-change="currentPage"
@on-page-size-change="currentPageCount"
/>
</div>
<!-- </Card>-->
<Modal
v-model="init.modal"
title="新增"
:closable="false"
:mask-closable="false"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="审批组名称" prop="name">
<Input v-model="formValidate.name" placeholder="请输入审批组名称"></Input>
</FormItem>
<FormItem label="成员" prop="user">
<Select multiple v-model="formValidate.user" placeholder="成员">
<Option v-for="(item,index) in formValidate.userArray" :key="index" :value="item.id">{{
item.name
}}
</Option>
</Select>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="addCancel">取消</Button>
<Button type="primary" @click="addOk">确定</Button>
</template>
</Modal>
<Modal
v-model="editModal"
title="编辑"
>
<Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="审批组名称" prop="name">
<Input v-model="formValidate.name" placeholder="审批组名称"></Input>
</FormItem>
</Form>
<div style="display: flex;justify-content: center">
<Transfer
:key="tramsferKey"
:data="GroupUserInfo.unmember"
:target-keys="GroupUserInfo.member"
:render-format="render"
@on-change="handleChange"
:titles="['选择成员','在组成员']">
</Transfer>
</div>
<template #footer>
<Button type="text" @click="editModal =false">取消</Button>
<Button type="primary" @click="editOk">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from '../../../api/requestUtils'
import * as hook from '../../../hook/index'
export default {
name: 'list',
data() {
return {
tramsferKey: 1,
GroupUserInfo: {},
formValidate: {
name: '',
user: [],
userArray: [],
},
ruleValidate: {
name: [
{type: 'string', required: true, message: '此项不能为空', trigger: 'blur'},
],
user: [
{type: 'array', required: true, message: '此项不能为空', trigger: 'change'},
],
},
addModal: false,
editId: '',
editModal: false,
approvalGroup: [],
init: {
total: null,
page_size: 10,
page_index: 1,
modal: false,
},
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '审批用户组名称',
key: 'groupname',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '成员',
slot: 'member',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '操作',
align: 'center',
minWidth: 180,
show: true,
slot: 'action'
}
],
loading: false,
tableData: [
{},
],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
// mixArr: []
}
},
props: ['modal'],
watch: {
modal(aaa, bbb) {
this.init.modal = aaa
},
'formValidate.user'(aaa, bbb) {
console.log("🚀🚀🚀,", aaa)
},
'GroupUserInfo.member'(aaa, bbb) {
console.log("🚀🚀🚀,", aaa)
}
},
// 查询条件初始化
created() {
},
mounted() {
this.GetNoticeUserGroupList()
this.GetUserByTeaSelect()
},
methods: {
async deleteNoticeUserGroup(row) {
hook.publicConfirm(async () => {
this.$Spin.show()
let res = await api.NoticeUserGroupDel({id: row.groupid})
hook.publicMessage(res)
await this.GetNoticeUserGroupList()
this.$Spin.hide()
})
},
render(item) {
return item.name;
},
handleChange(newTargetKeys, direction, moveKeys) {
console.log("🚀🚀🚀,newTargetKeys", newTargetKeys)
console.log("🚀🚀🚀,", newTargetKeys, direction, moveKeys)
switch (direction) {
case 'left':
moveKeys.forEach((c, i) => {
if (this.GroupUserInfo.member.indexOf(c) !== -1) {
this.GroupUserInfo.member.splice(this.GroupUserInfo.member.indexOf(c), 1)
console.log("🚀🚀🚀,")
}
})
break;
case 'right':
this.GroupUserInfo.member = newTargetKeys
break;
}
},
Ok() {
},
getApprovalGroup() {
},
async GetUserByTeaSelect() {
const res = await api.GetUserByTeaSelect()
this.formValidate.userArray = res.response
},
// 查询
async GetNoticeUserGroupList() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
}
const res = await api.GetNoticeUserGroupList(data)
this.init.total = res.response.data_count
this.tableData = res.response.data
this.loading = false
},
addCancel() {
this.init.modal = false
this.$emit('modalFun', this.init.modal)
},
// 新增
async addOk(e) {
this.$refs['formValidate'].validate(async (validate) => {
if (validate) {
let data = {
groupname: this.formValidate.name,
"member": this.formValidate.user,
}
const res = await api.NoticeUserGroupIns(data)
hook.publicMessage(res)
await this.GetNoticeUserGroupList()
this.init.modal = false
this.$emit('modalFun', this.init.modal)
}
})
},
async editOk() {
this.$refs.formValidate1.validate(async (value) => {
if (value) {
let data = {
"groupid": this.GroupUserInfo.groupid,
"groupname": this.formValidate.name,
"member": this.GroupUserInfo.member
}
const res = await api.NoticeUserGroupSave(data)
if (res.code !== 1) {
this.$Message.error(res.msg_detail)
} else {
hook.publicMessage(res)
this.GetNoticeUserGroupList()
this.editModal = false
}
}
})
},
// 修改
async edit(row) {
this.$Spin.show()
this.GroupUserInfo.groupid = row.groupid
this.formValidate.name = row.groupname
let data = {groupid: row.groupid}
let res = await api.GetNoticeUserGroupInfo(data)
res.response.unmember.map((cu, index) => {
cu.key = cu.card
cu.label = cu.name
})
this.GroupUserInfo = res.response
this.$Spin.hide()
this.editModal = true
},
// 删除
del(row) {
console.log('删除');
this.$Message.info('删除成功');
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
currentPage(e) {
this.init.page_index = e
this.GetNoticeUserGroupList()
},
currentPageCount(e) {
this.init.page_size = e
this.GetNoticeUserGroupList()
},
}
}
</script>
<template>
<div>
<Card ref="card">
<Button type="primary" class="ivu-ml-8" @click="add">
<Icon type="md-add"/>
新增
</Button>
<Table
:columns="columns"
:data="init.tableData"
>
<template slot-scope="{ row }" slot="action">
<Button type="info" @click="edit(row)">编辑</Button>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">
<Button type="error" style="margin-left: 20px">删除</Button>
</Poptip>
</template>
</Table>
<div class="ivu-text-center ivu-mt">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangePageSize"
/>
</div>
<!-- 新增修改 -->
</Card>
</div>
</template>
<script>
import * as api from '../../../api/requestUtils'
import * as hook from '../../../hook/index'
export default {
name: 'list',
data() {
return {
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '公告标题',
key: 'title',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '内容',
key: 'content',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '发布时间',
key: 'publish_time',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '创建人',
key: 'createby',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '修改人',
key: 'modifyby',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '公告分类',
key: 'typename',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '是否置顶',
key: 'is_top',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '审批状态',
key: 'approval_state',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '是否发布',
key: 'is_public',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '操作',
align: 'center',
minWidth: 180,
fixed: 'right',
show: true,
slot: 'action'
}
],
loading: false,
tableData: [
{},
],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
params: {
pageIndex: 1,
pageSize: 10,
college_id: '',
grade: '',
classId_Name: '',
status: ''
},
init: {
columns: [],
tableData: [],
page_index: 1,
page_size: 10,
total: 0,
"title": "",
"start_time": "",
"end_time": "",
"typeid": "",
"approval_state": "",
"is_public": "",
}
}
},
// 查询条件初始化
created() {
},
mounted() {
this.GetNoticeList()
},
methods: {
// 查询
async GetNoticeList() {
let resData = await hook.myEncapsulationFunction(async () => {
let data = {
page_inde: this.init.page_inde,
page_size: this.init.page_size,
"title": this.init.title,
"start_time": this.init.start_time,
"end_time": this.init.end_time,
"typeid": this.init.typeid,
"approval_state": this.init.approval_state,
"is_public": this.init.is_public,
}
const res = await api.GetNoticeList(data);
this.init.total = res.response.data_count
this.init.tableData = res.response.data
return res
})
console.log("🚀🚀🚀,", resData)
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.$refs.addEdit.edit(row)
},
// 删除
del(row) {
console.log('删除');
this.$Message.info('删除成功');
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.params.pageIndex = pageNumber
this.GetNoticeList()
},
// 切换每页条数
handleChangePageSize(size) {
this.current = 1;
this.params.pageSize = size
this.GetNoticeList()
},
}
}
</script>
<template>
<div>
<Table
:columns="columns"
:data="init.tableData"
:loading="loading"
>
<template slot-scope="{ row }" slot="action">
<a @click="edit(row)">编辑</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">
<a style="margin-left: 15px;color: red;">删除</a>
</Poptip>
<!-- <Button type="primary" @click="edit(row)" size="small">编辑</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px" size="small">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div style="width: 100%;height: 70px;display: flex;align-items: center;">
<Page
:total="init.total"
:current.sync="init.page_index"
show-total
show-sizer
:page-size="init.page_size"
@on-change="handleChangePage"
@on-page-size-change="handleChangePageSize"
/>
</div>
<!-- 新增修改 -->
<Modal
v-model="modal3"
title="新增"
:closable="false"
:mask-closable="false"
>
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="公告类型名称" prop="typename">
<Input v-model="formValidate.typename" placeholder="请输入公告类型名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="addCancel">取消</Button>
<Button type="primary" @click="addOk">确定</Button>
</template>
</Modal>
<Modal
v-model="init.modal3Edit"
title="编辑"
:closable="false"
:mask-closable="false"
>
<Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="公告类型名称" prop="typenameUpdate">
<Input v-model="formValidate.typenameUpdate" placeholder="请输入公告类型名称"></Input>
</FormItem>
</Form>
<template #footer>
<Button type="text" @click="addCancel1">取消</Button>
<Button type="primary" @click="addOk1">确定</Button>
</template>
</Modal>
</div>
</template>
<script>
import * as api from '../../../api/requestUtils'
import * as hook from '../../../hook/index'
export default {
name: 'list',
props: ['modal3'],
data() {
return {
formValidate: {
id: '',
typename: '',
typenameUpdate: '',
},
ruleValidate: {
typename: [{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}],
typenameUpdate: [{type: 'string', required: true, message: '该项不能为空', trigger: 'blur'}],
},
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 180
},
{
title: '公告类型',
key: 'typename',
align: 'center',
show: true,
minWidth: 180,
},
{
title: '操作',
align: 'center',
minWidth: 180,
show: true,
slot: 'action'
}
],
loading: false,
tableData: [
{},
],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
params: {
pageIndex: 1,
pageSize: 10,
college_id: '',
grade: '',
classId_Name: '',
status: ''
},
init: {
editRow: {},
modal3Edit: false,
modal3: false,
columns: [],
tableData: [],
page_index: 1,
page_size: 10,
total: 0,
}
}
},
// 查询条件初始化
created() {
},
mounted() {
this.init.modal3 = this.modal3
this.GetNoticeList()
},
watch: {},
methods: {
addCancel1() {
this.init.modal3Edit = false
},
addOk1() {
this.$refs.formValidate1.validate((validate) => {
if (validate) {
let data = {
typename: this.formValidate.typenameUpdate,
typeid: this.formValidate.id
}
hook.myEncapsulationFunction(async () => {
const res = await api.NoticeTypeSave(data)
this.init.modal3Edit = false
await this.GetNoticeList()
return res
})
}
})
},
addCancel() {
this.init.modal3 = false
this.$emit('modalFun', this.init.modal3)
},
addOk() {
this.$refs.formValidate.validate((validate) => {
if (validate) {
hook.myEncapsulationFunction(async () => {
const res = await api.NoticeTypeSave({typename: this.formValidate.typename})
this.init.modal3 = false
this.$emit('modalFun', this.init.modal3)
await this.GetNoticeList()
return res
})
}
})
},
// 查询
async GetNoticeList() {
this.loading = true
let data = {
page_index: this.init.page_index,
page_size: this.init.page_size,
}
const res = await api.GetNoticeTypeList(data);
this.init.total = res.response.data_count
this.init.tableData = res.response.data
this.loading = false
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.init.modal3Edit = true
this.formValidate.typenameUpdate = row.typename
this.formValidate.id = row.typeid
},
// 删除
del(row) {
hook.myEncapsulationFunction(async () => {
const res = await api.NoticeTypeDel({id: row.typeid})
await this.GetNoticeList()
return res
})
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.GetNoticeList()
},
// 切换每页条数
handleChangePageSize(size) {
this.init.page_size = size
this.GetNoticeList()
},
}
}
</script>
<template>
<div>
<Card ref="card">
<template #title>
<div style="height: 50px">
<RadioGroup v-model="init.radioValue" @on-change="radioChange" type="button" button-style="solid">
<Radio v-for="(item,index) in init.radioInitArray" :key="index" :label="item.value">{{ item.label }}</Radio>
</RadioGroup>
</div>
</template>
<template #extra>
<Button v-if="init.radioValue ===1" type="primary" @click="init.modal = true">
新增
</Button>
<Button v-if="init.radioValue ===3" type="primary" @click="init.modal3 = true">
新增
</Button>
</template>
<!-- <Button type="primary" class="ivu-ml-8" @click="add">-->
<!-- <Icon type="md-add"/>-->
<!-- 新增-->
<!-- </Button>-->
<!-- <Table-->
<!-- :columns="columns"-->
<!-- :data="init.tableData"-->
<!-- >-->
<!-- <template slot-scope="{ row }" slot="action">-->
<!-- <Button type="info" @click="edit(row)">编辑</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
<!-- </template>-->
<!-- </Table>-->
<!-- <div class="ivu-text-center ivu-mt">-->
<!-- <Page-->
<!-- :total="init.total"-->
<!-- :current.sync="init.page_index"-->
<!-- show-total-->
<!-- show-sizer-->
<!-- :page-size="init.page_size"-->
<!-- @on-change="handleChangePage"-->
<!-- @on-page-size-change="handleChangePageSize"-->
<!-- />-->
<!-- </div>-->
<!-- 新增修改 -->
<noticeApprovalUserGroup v-if="init.radioValue ===1" :modal="init.modal"
@modalFun="modalFun"></noticeApprovalUserGroup>
<noticeType v-if="init.radioValue ===3" :modal3="init.modal3" @modalFun="modalFun3"></noticeType>
<noticePublish v-if="init.radioValue ===2"></noticePublish>
</Card>
</div>
</template>
<script>
import * as api from '../../api/requestUtils'
import * as hook from '../../hook/index'
import noticeApprovalUserGroup from './noticeComponents/noticeApprovalUserGroup.vue'
import noticePublish from './noticeComponents/noticePublish.vue'
import noticeType from './noticeComponents/noticeType.vue'
export default {
components: {
noticeApprovalUserGroup,
noticePublish,
noticeType,
},
data() {
return {
grid: {
xl: 8,
lg: 12,
md: 24,
sm: 24,
xs: 24
},
columns: [
{
title: '序号',
type: 'index',
align: 'center',
show: true,
width: 80
},
{
title: '公告标题',
key: 'title',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '内容',
key: 'content',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '发布时间',
key: 'publish_time',
align: 'center',
show: true,
minWidth: 100,
},
{
title: '创建人',
key: 'createby',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '修改人',
key: 'modifyby',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '修改时间',
key: 'modifytime',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '公告分类',
key: 'typename',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '是否置顶',
key: 'is_top',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '审批状态',
key: 'approval_state',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '是否发布',
key: 'is_public',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '操作',
align: 'center',
minWidth: 180,
fixed: 'right',
show: true,
slot: 'action'
}
],
loading: false,
tableData: [
{},
],
tableSize: 'default',
tableFullscreen: false,
total: 0,
collapse: false,
params: {
pageIndex: 1,
pageSize: 10,
college_id: '',
grade: '',
classId_Name: '',
status: ''
},
init: {
modal3: false,
modal: false,
radioInitArray: [
{label: '公告用户审批组', value: 1},
// {label: '公告发布', value: 2},
{label: '公告类型', value: 3},
],
radioValue: 1,
columns: [],
tableData: [],
page_index: 1,
page_size: 10,
total: 0,
"title": "",
"start_time": "",
"end_time": "",
"typeid": "",
"approval_state": "",
"is_public": "",
}
}
},
// 查询条件初始化
created() {
},
mounted() {
this.GetNoticeList()
},
methods: {
modalFun(e) {
console.log("🚀🚀🚀dasdas,", e)
this.init.modal = e
},
modalFun3(e) {
console.log("🚀🚀🚀33,", e)
this.init.modal3 = e
},
radioChange(e) {
switch (e) {
}
console.log("🚀🚀🚀,", e)
},
// 查询
async GetNoticeList() {
let resData = await hook.myEncapsulationFunction(async () => {
let data = {
page_inde: this.init.page_inde,
page_size: this.init.page_size,
"title": this.init.title,
"start_time": this.init.start_time,
"end_time": this.init.end_time,
"typeid": this.init.typeid,
"approval_state": this.init.approval_state,
"is_public": this.init.is_public,
}
const res = await api.GetNoticeList(data);
this.init.total = res.response.data_count
this.init.tableData = res.response.data
return res
})
console.log("🚀🚀🚀,", resData)
},
// 新增
add() {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
this.$refs.addEdit.edit(row)
},
// 删除
del(row) {
console.log('删除');
this.$Message.info('删除成功');
},
// 取消删除
cancel() {
this.$Message.info('You click cancel');
},
// 切换第几页
handleChangePage(pageNumber) {
this.params.pageIndex = pageNumber
this.GetNoticeList()
},
// 切换每页条数
handleChangePageSize(size) {
this.current = 1;
this.params.pageSize = size
this.GetNoticeList()
},
}
}
</script>
<template>
<div>
<Card >
<Card>
<template #title>
<Button type="primary" class="ivu-ml-8" @click="modal = true"><Icon type="md-add"/>新增用户</Button>
<Button type="primary" class="ivu-ml-8" @click="modalAction">
<Icon type="md-add"/>
新增用户
</Button>
</template>
<template #extra>
<div style="display: flex;align-items: center;">
<Select v-model="search.selectValue" style="width: 10vw;margin-right: 10px;">
<Option v-for="(item,index) in promiseAllArray[2]" :value="item.id" :key="index">{{ item.name }}</Option>
<Option v-for="(item,index) in promiseAllArray[0]" :value="item.id" :key="index">{{ item.name }}</Option>
</Select>
<Input type="text" v-model="search.inputValue" style="width: 10vw;margin-right: 10px;" placeholder="请输入姓名查找..."></Input>
<Input type="text" v-model="search.mobileValue" style="width: 10vw;" placeholder="请输入手机号查找..."></Input>
<Button type="primary" :disabled="search.selectValue === '' && search.inputValue === '' && search.mobileValue === ''" style="margin-left: 10px" @click="searchFun"><Icon type="md-search"/>查找</Button>
<Input type="text" v-model="search.inputValue" style="width: 10vw;margin-right: 10px;"
placeholder="请输入姓名查找..."></Input>
<Input type="text" v-model="search.mobileValue" style="width: 10vw;"
placeholder="请输入手机号查找..."></Input>
<Button type="primary"
:disabled="search.selectValue === '' && search.inputValue === '' && search.mobileValue === ''"
style="margin-left: 10px" @click="searchFun">
<Icon type="md-search"/>
查找
</Button>
</div>
</template>
<Table
......@@ -20,13 +30,13 @@
:loading="loading"
>
<template v-slot:role_name="{row}">
<Tag color="primary" v-for="(item,index) in row.role_name" :key="index"> {{item}} </Tag>
<Tag color="primary" v-for="(item,index) in row.role_name" :key="index"> {{ item }}</Tag>
</template>
<template v-slot:action="{row}">
<!-- <Button type="info" size="small" @click="edit(row)">编辑</Button>-->
<!-- <Button type="info" size="small" @click="edit(row)">编辑</Button>-->
<Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button>
<a style="color: red;">删除</a>
</Poptip>
</template>
</Table>
......@@ -41,53 +51,158 @@
@on-page-size-change="handleChangePageSize"
/>
</div>
<!-- 新增修改 -->
</Card>
<Modal
width="40%"
width="50%"
:styles="{top: '20px'}"
v-model="modal"
title="添加用户"
>
<!-- <div>-->
<!-- <Tabs type="card">-->
<!-- <TabPane label="添加学生">-->
<!-- <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">-->
<!-- <FormItem label="学生" prop="student">-->
<!-- <Select transfer filterable v-model="formValidate.student" @on-change="studentSelect" multiple placeholder="请选择">-->
<!-- <Option v-for="(item,index) in promiseAllArray[1]" :value="item.id" :key="index">{{item.name}}</Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- <FormItem>-->
<!-- <Button type="primary" @click="handleSubmit('s')">提交</Button>-->
<!-- <Button @click="handleReset('s')" style="margin-left: 8px">重置</Button>-->
<!-- </FormItem>-->
<!-- </Form>-->
<!-- </TabPane>-->
<!-- <TabPane label="添加教师">-->
<!-- <Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">-->
<!-- <FormItem label="教师" prop="teacher">-->
<!-- <Select clearable transfer filterable v-model="formValidate.teacher" placeholder="请选择">-->
<!-- <Option v-for="(item,index) in promiseAllArray[0]" :value="item.id" :key="index">{{item.name}}</Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- <FormItem label="权限" prop="role">-->
<!-- <Select transfer filterable v-model="formValidate.role" @on-change="studentSelect1" multiple placeholder="请选择">-->
<!-- <Option :disabled="item.name ==='学生'" v-for="(item,index) in promiseAllArray[2]" :value="item.id" :key="index">{{item.name}}</Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- <FormItem>-->
<!-- <Button type="primary" @click="handleSubmit('t')">提交</Button>-->
<!-- <Button @click="handleReset('t')" style="margin-left: 8px">重置</Button>-->
<!-- </FormItem>-->
<!-- </Form>-->
<!-- </TabPane>-->
<!-- </Tabs>-->
<!-- </div>-->
<!-- <template #footer>-->
<!-- {{null}}-->
<!-- </template>-->
<div>
<Tabs type="card">
<TabPane label="添加学生">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="学生" prop="student">
<Select transfer filterable v-model="formValidate.student" @on-change="studentSelect" multiple placeholder="请选择">
<Option v-for="(item,index) in promiseAllArray[1]" :value="item.id" :key="index">{{item.name}}</Option>
</Select>
</FormItem>
<FormItem>
<div style="display: flex;">
<div style="height: 40px; margin-left: auto ;display: flex;flex-wrap: nowrap">
<Input v-model="modalSelect.searchValue" placeholder="请输入姓名或卡号搜索..."></Input>
<Button type="primary" @click="searchButton" :disabled="modalSelect.searchValue===''"
style="margin-left: 10px;">
搜索
</Button>
<Button type="text" @click="searchReset" style="margin-left: 10px;">重置</Button>
</div>
</div>
<Table :loading="loading1" :columns="modalSelect.column" :data="modalSelect.sList"
@on-select-all="modalTableSelectAll"
@on-select-all-cancel="modalTableSelectAllCancel" @on-select="modalTableSelect"
@on-select-cancel="modalTableSelectCancel">
</Table>
<div style="height: 40px;margin-top: 20px">
<Page
show-total
:key="modalSelect.pageKey"
show-sizer
show-elevator
:page-size-opts="pageSizeOpts"
:total="modalSelect.total"
:page-size="modalSelect.page_size"
model-value="modalSelect.page_index"
@on-change="currentPage1"
@on-page-size-change="currentPageCount1"
:transfer="true"
/>
</div>
<div style="float: right">
<Button @click="modal =false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('s')">提交</Button>
<Button @click="handleReset('s')" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</div>
</TabPane>
<TabPane label="添加教师">
<Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="教师" prop="teacher">
<Select clearable transfer filterable v-model="formValidate.teacher" placeholder="请选择">
<Option v-for="(item,index) in promiseAllArray[0]" :value="item.id" :key="index">{{item.name}}</Option>
</Select>
</FormItem>
<FormItem label="权限" prop="role">
<Select transfer filterable v-model="formValidate.role" @on-change="studentSelect1" multiple placeholder="请选择">
<Option :disabled="item.name ==='学生'" v-for="(item,index) in promiseAllArray[2]" :value="item.id" :key="index">{{item.name}}</Option>
<div style="display: flex;">
<!-- <Select transfer filterable v-model="formValidate.role" @on-change="studentSelect1" multiple-->
<!-- placeholder="请选择">&ndash;&gt;-->
<!-- <Option :disabled="item.name ==='学生'" v-for="(item,index) in promiseAllArray[2]" :value="item.id"-->
<!-- :key="index">{{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<CheckboxGroup style="margin-bottom: 5px" v-model="modalSelect1.checkboxValue">
<Checkbox :disabled="item.name ==='学生'" v-for="(item,index) in promiseAllArray[0]" :label="item.id"
:key="index"
border><span>{{ item.name }}</span></Checkbox>
</CheckboxGroup>
<div style="height: 40px; margin-left: auto ;display: flex;flex-wrap: nowrap">
<Input v-model="modalSelect1.searchValue" placeholder="请输入姓名或卡号搜索..."></Input>
<Button type="primary" @click="searchButton" :disabled="modalSelect1.searchValue===''"
style="margin-left: 10px;">
搜索
</Button>
<Button type="text" @click="searchReset1" style="margin-left: 10px;">重置</Button>
</div>
</div>
<div style="display: flex;align-items: center">
<spin style="font-weight:bold">院系:</spin>
<Select style="width:500px;margin-bottom: 5px" v-model="modalSelect1.deptValue" multiple>
<Option v-for="(item,index) in modalSelect1.deptSelectArray" :value="item.id" :key="index">{{
item.name
}}
</Option>
<!-- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>-->
</Select>
</FormItem>
<FormItem>
</div>
<Table :loading="loading2" :columns="modalSelect1.column" :data="modalSelect1.sList"
@on-select-all="modalTableSelectAll1"
@on-select-all-cancel="modalTableSelectAllCancel1" @on-select="modalTableSelect1"
@on-select-cancel="modalTableSelectCancel1">
</Table>
<div style="height: 40px;margin-top: 20px">
<Page
:transfer="true"
show-total
:key="modalSelect1.pageKey"
:page-size-opts="pageSizeOpts"
show-sizer
show-elevator
:total="modalSelect1.total"
:page-size="modalSelect1.page_size"
model-value="modalSelect1.page_index"
@on-change="currentPage2"
@on-page-size-change="currentPageCount2"
/>
</div>
<div style="float: right">
<Button @click="modal = false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('t')">提交</Button>
<Button @click="handleReset('t')" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</div>
</TabPane>
</Tabs>
</div>
<template #footer>
{{null}}
{{ null }}
</template>
</Modal>
</div>
......@@ -97,34 +212,98 @@
import * as api from '../../api/requestUtils'
import * as hook from '../../hook/index'
import _ from "lodash"
import {GetDeptSeletct} from "../../api/requestUtils";
export default {
data(){
data() {
return {
ruleValidate:{
student:[ { type:'array', required: true, message: '请选择学生', trigger: 'change' }],
teacher:[ { type:'string', required: true, message: '请选择教师', trigger: 'change' }],
role:[ { type:'array', required: true, message: '请选择权限', trigger: 'change' }],
pageSizeOpts: [10, 20, 30, 40, 100, 200],
modalSelect1: {
deptValue: [],
deptSelectArray: [],
tArray: [],
checkboxValue: [],
rList: [{value: 0, label: '非指导教师'}, {value: 1, label: '指导教师'}],
sArray: [],
searchValue: '',
condition: '',
column: [
{
type: 'selection',
minWidth: 150,
},
formValidate:{
student:[],
{
title: '姓名',
minWidth: 150,
key: 'name'
},
{
title: '学号/工号',
minWidth: 150,
key: 'number'
}
],
sList: [],
pageKey: 1,
total: 0,
page_size: 10,
page_index: 1,
},
modalSelect: {
checkboxValue: '',
rList: [{value: 0, label: '否'}, {value: 1, label: '是'}],
sArray: [],
searchValue: '',
condition: '',
column: [
{
type: 'selection',
minWidth: 150,
},
{
title: '姓名',
minWidth: 150,
key: 'name'
},
{
title: '学号/工号',
minWidth: 150,
key: 'number'
}
],
sList: [],
pageKey: 1,
total: 0,
page_size: 10,
page_index: 1,
},
ruleValidate: {
student: [{type: 'array', required: true, message: '请选择学生', trigger: 'change'}],
teacher: [{type: 'string', required: true, message: '请选择教师', trigger: 'change'}],
role: [{type: 'array', required: true, message: '请选择权限', trigger: 'change'}],
},
formValidate: {
student: [],
teacher: '',
role: [],
},
modal:false,
promiseAllArray:[],
search:{
searchCityList:[],
selectValue:'',
inputValue:'',
mobileValue:'',
input:'',
select:'',
mobile:'',
},
page_index:1,
page_size:10,
total:0,
modal: false,
promiseAllArray: [],
search: {
searchCityList: [],
selectValue: '',
inputValue: '',
mobileValue: '',
input: '',
select: '',
mobile: '',
},
page_index: 1,
page_size: 10,
total: 0,
grid: {
xl: 8,
lg: 12,
......@@ -132,7 +311,7 @@ export default {
sm: 24,
xs: 24
},
columns:[
columns: [
{
title: '序号',
type: 'index',
......@@ -161,6 +340,13 @@ export default {
show: true,
minWidth: 250,
},
{
title: '院系',
key: 'dept',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '手机号',
key: 'mobile',
......@@ -182,13 +368,7 @@ export default {
show: true,
minWidth: 120,
},
{
title: '部门',
key: 'dept',
align: 'center',
show: true,
minWidth: 120,
},
{
title: '操作',
align: 'center',
......@@ -199,100 +379,302 @@ export default {
}
],
loading: false,
tableData:[],
loading1: false,
loading2: false,
tableData: [],
tableSize: 'default',
tableFullscreen: false,
collapse: false,
}
},
// 查询条件初始化
created(){
created() {
},
mounted(){
watch: {
'modalSelect1.deptValue'(aaa, bbb) {
console.log("🚀🚀aaa🚀,", aaa)
}
},
mounted() {
this.getData()
this.promiseAll()
this.GetDeptSeletct()
},
methods: {
handleSubmit(e){
switch (e){
case 't' :
this.$refs['formValidate1'].validate(async (vali) => {
if (vali) {
async modalAction() {
this.modal = true
this.modalSelect.sArray = []
this.modalSelect1.tArray = []
await this.getTorS()
this.getTorS1()
},
searchButton() {
this.modalSelect.condition = this.modalSelect.searchValue
this.modalSelect.page_index = 1
this.modalSelect1.condition = this.modalSelect1.searchValue
this.modalSelect1.page_index = 1
this.getTorS()
this.getTorS1()
},
searchReset() {
this.modalSelect.condition = ''
this.modalSelect.searchValue = ''
this.modalSelect.page_index = 1
this.modalSelect.page_size = 10
this.modalSelect.sArray = []
this.modalSelect.pageKey++
this.getTorS()
},
searchReset1() {
this.modalSelect1.deptValue = []
this.modalSelect1.searchValue = ''
this.modalSelect1.checkboxValue = []
this.modalSelect1.condition = ''
this.modalSelect1.page_index = 1
this.modalSelect1.page_size = 10
this.modalSelect1.tArray = []
this.modalSelect1.pageKey++
this.getTorS1()
},
modalTableSelectCancel1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectAll1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectAllCancel1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelect1(selection, row) {
this.modalSelect1.tArray = []
console.log("🚀🚀🚀,", selection)
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectCancel(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelectAll(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelectAllCancel(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelect(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
async getTorS() {
this.loading1 = true
let data = {
tid:this.formValidate.teacher,
role:this.formValidate.role,
page_index: this.modalSelect.page_index,
page_size: this.modalSelect.page_size,
condition: this.modalSelect.condition,
}
const res = await api.TeacherUserInfoSave(data)
this.modal =false
await this.getData()
let res = await api.GetStudentList(data)
this.modalSelect.sList = res.response.data
this.modalSelect.total = res.response.data_count
this.loading1 = false
},
async getTorS1() {
this.loading2 = true
let data = {
page_index: this.modalSelect1.page_index,
page_size: this.modalSelect1.page_size,
condition: this.modalSelect1.condition,
}
})
let res = await api.GetTeacherList(data)
this.modalSelect1.sList = res.response.data
this.modalSelect1.total = res.response.data_count
this.loading2 = false
},
currentPage2(e) {
this.modalSelect1.page_index = e
this.getTorS1()
},
currentPageCount2(e) {
this.modalSelect1.page_size = e
this.getTorS1()
},
currentPage1(e) {
this.modalSelect.page_index = e
this.getTorS()
},
currentPageCount1(e) {
this.modalSelect.page_size = e
this.getTorS()
},
handleReset(e) {
switch (e) {
case 's':
this.searchReset()
this.formValidate.student = []
break;
case 't':
this.formValidate.teacher = []
this.searchReset1()
break;
}
},
async handleSubmit(e) {
switch (e) {
case 's' :
this.$refs['formValidate'].validate(async (vali) => {
if (vali) {
let data = this.formValidate.student
// this.$refs['formValidate'].validate(async (validate) => {
// if (validate) {
//
// }
// })
let data = this.modalSelect.sArray
const res = await api.StudentUserInfoSave(data)
this.modal =false
this.modalSelect.sArray = []
hook.publicMessage(res)
await this.getData()
this.modal = false
break;
case 't' :
// this.$refs['formValidate1'].validate(async (validate) => {
// if (validate) {
//
// }
// })
let data1 = {
'dept': this.modalSelect1.deptValue,
"role": this.modalSelect1.checkboxValue,
"tid": this.modalSelect1.tArray
}
})
break;
if (!!this.modalSelect1.deptValue.length) {
const res1 = await api.TeacherBatchIns(data1)
if (res1.code !== 1) {
this.$Message.error(res1.msg_detail)
} else {
hook.publicMessage(res1)
await this.getData()
this.modal = false
this.modalSelect1.tArray = []
}
},
handleReset(e){
switch (e){
case 't':
this.formValidate.role = []
break;
case 's':
this.formValidate.student = []
} else {
this.$Message.error('未选择院系')
}
break;
}
},
studentSelect1(e){
// handleSubmit(e) {
// switch (e) {
// case 't' :
// this.$refs['formValidate1'].validate(async (vali) => {
// if (vali) {
// let data = {
// tid: this.formValidate.teacher,
// role: this.formValidate.role,
// }
// const res = await api.TeacherUserInfoSave(data)
// this.modal = false
// await this.getData()
//
// }
// })
// break;
// case 's' :
// this.$refs['formValidate'].validate(async (vali) => {
// if (vali) {
// let data = this.formValidate.student
// const res = await api.StudentUserInfoSave(data)
// this.modal = false
// await this.getData()
//
// }
// })
// break;
// }
// },
// handleReset(e) {
// switch (e) {
// case 't':
// this.formValidate.role = []
// break;
// case 's':
// this.formValidate.student = []
// break;
// }
// },
studentSelect1(e) {
// this.formValidate.role = e
},
studentSelect(e){
studentSelect(e) {
this.formValidate.student = e
console.log("🚀🚀🚀,",e)
console.log("🚀🚀🚀,", e)
},
addOk() {
},
addCancel() {
},
addOk(){},
addCancel(){},
async promiseAll() {
const res = await Promise.all([
new Promise(async (resolve, reject) => {
const res = await api.GetTeacher()
resolve(res.response)
}),
new Promise(async (resolve, reject) => {
const res = await api.GetStudent()
resolve(res.response)
}),
// new Promise(async (resolve, reject) => {
// const res = await api.GetTeacher()
// resolve(res.response)
// }),
// new Promise(async (resolve, reject) => {
// const res = await api.GetStudent()
// resolve(res.response)
// }),
new Promise(async (resolve, reject) => {
const res = await api.UserRoleSelect()
resolve(res.response)
}),
])
this.promiseAllArray = res
console.log("🚀🚀🚀,",res)
console.log("🚀🚀🚀,", res)
},
searchFun(){
searchFun() {
this.search.select = this.search.selectValue
this.search.input = this.search.inputValue
this.search.mobile = this.search.mobileValue
this.getData()
},
add(){
add() {
// 新增
},
// 修改
edit(row){
console.log("🚀🚀🚀,",row)
edit(row) {
console.log("🚀🚀🚀,", row)
},
// 删除
async del(row) {
......@@ -300,10 +682,11 @@ export default {
id: row.userid
}
const res = await api.UserInfoDel(data)
hook.publicMessage(res)
await this.getData()
},
// 取消删除
cancel () {
cancel() {
this.$Message.info('已取消');
},
......@@ -313,22 +696,22 @@ export default {
this.getData()
},
// 切换每页条数
handleChangePageSize(size){
handleChangePageSize(size) {
this.page_size = size
this.getData()
},
// 查询
tryAndCatch(publicFun){
tryAndCatch(publicFun) {
try {
publicFun()
}catch (e){
} catch (e) {
this.$Spin.hide()
this.$Message.error(e)
}
},
async getData(){
this.tryAndCatch(async ()=>{
this.$Spin.show()
async getData() {
this.tryAndCatch(async () => {
this.loading = true
let data = {
"name": this.search.input,
"roleid": this.search.select,
......@@ -339,10 +722,13 @@ export default {
const res = await api.GetUserList(data)
this.tableData = res.response.data
this.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
})
},
async GetDeptSeletct() {
const res = await api.GetDeptSeletct()
this.modalSelect1.deptSelectArray = res.response
},
}
}
</script>
......@@ -16,18 +16,26 @@
:columns="columns"
:data="tableData"
style="margin-top: 20px"
:loading="loading"
>
<!-- <template v-slot:is_win="{row}">-->
<!-- <tag :color="['warning','success'][row.is_win]" type="primary" >{{['未获奖', '获奖'][row.is_win]
}}</tag>-->
<!-- </template>-->
<template v-slot:action="{row}">
<Button size="small" type="success" style="margin-right: 20px" @click="addTeamPeople(row)">添加队员</Button>
<Button size="small" type="info" style="margin-right: 20px" @click="updateTeamInfo(row)">修改</Button>
<Button size="small" type="primary" @click="detailed(row)">详细</Button>
<a @click="addTeamPeople(row)" style="margin-left: 15px;">添加队员</a>
<a @click="updateTeamInfo(row)" style="margin-left: 15px;">修改</a>
<a @click="detailed(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">
<Button size="small" type="error" style="margin-left: 20px">删除</Button>
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
<!-- ***************************************-->
<!-- <Button size="small" type="success" style="margin-right: 20px" @click="(row)">添加队员</Button>-->
<!-- <Button size="small" type="info" style="margin-right: 20px" @click="(row)">修改</Button>-->
<!-- <Button size="small" type="primary" @click="(row)">详细</Button>-->
<!-- <Poptip confirm transfer title="你确定删除吗?" @on-ok="del(row)" @on-cancel="cancel">-->
<!-- <Button size="small" type="error" style="margin-left: 20px">删除</Button>-->
<!-- </Poptip>-->
</template>
</Table>
<div class="ivu-text-center ivu-mt" style="display: flex;justify-content: flex-start">
......@@ -80,50 +88,125 @@
</Table>
</Drawer>
<Modal
width="40%"
width="50%"
v-model="addTeamModal"
title="添加队员"
:styles="{top: '20px'}"
>
<div>
<Tabs type="card">
<TabPane label="添加学生队员">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="学生" prop="student">
<Select transfer filterable v-model="formValidate.student" @on-change="studentSelect" multiple
placeholder="请选择">
<Option v-for="(item,index) in promiseAllArray[1]" :value="item.id" :key="index">{{ item.name }}
</Option>
</Select>
</FormItem>
<FormItem>
<!-- <Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">-->
<!-- <FormItem label="学生" prop="student">-->
<!-- <Select transfer filterable v-model="formValidate.student" @on-change="studentSelect" multiple-->
<!-- placeholder="请选择">-->
<!-- <Option v-for="(item,index) in promiseAllArray[1]" :value="item.id" :key="index">{{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- <FormItem>-->
<!-- <Button type="primary" @click="handleSubmit('s')">提交</Button>-->
<!-- <Button @click="handleReset('s')" style="margin-left: 8px">重置</Button>-->
<!-- </FormItem>-->
<!-- </Form>-->
<div style="display: flex;">
<div style="height: 40px; margin-left: auto ;display: flex;flex-wrap: nowrap">
<Input v-model="modalSelect.searchValue" placeholder="请输入姓名或卡号搜索..."></Input>
<Button type="primary" @click="searchButton" :disabled="modalSelect.searchValue===''"
style="margin-left: 10px;">
搜索
</Button>
<Button type="text" @click="searchReset" style="margin-left: 10px;">重置</Button>
</div>
</div>
<Table :columns="modalSelect.column" :data="modalSelect.sList" @on-select-all="modalTableSelectAll"
@on-select-all-cancel="modalTableSelectAllCancel" @on-select="modalTableSelect"
@on-select-cancel="modalTableSelectCancel">
</Table>
<div style="height: 40px;margin-top: 20px">
<Page
show-total
:key="modalSelect.pageKey"
show-sizer
show-elevator
:total="modalSelect.total"
:page-size="modalSelect.page_size"
model-value="modalSelect.page_index"
@on-change="currentPage1"
@on-page-size-change="currentPageCount1"
:transfer="true"
/>
</div>
<div style="float: right">
<Button @click="addTeamModal =false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('s')">提交</Button>
<Button @click="handleReset('s')" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</div>
</TabPane>
<TabPane label="添加教师队员">
<Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">
<FormItem label="教师" prop="teacher">
<Select clearable transfer filterable multiple v-model="formValidate.teacher" placeholder="请选择">
<Option v-for="(item,index) in promiseAllArray[0]" :value="item.id" :key="index">{{ item.name }}
</Option>
</Select>
</FormItem>
<FormItem label="是否为指导老师" prop="is_leadValue">
<Select clearable transfer filterable v-model="formValidate.is_leadValue" placeholder="请选择">
<Option v-for="(item,index) in is_lead" :value="item.value" :key="index">{{ item.label }}</Option>
</Select>
</FormItem>
<!-- <FormItem label="权限" prop="role">-->
<!-- <Select transfer filterable v-model="formValidate.role" @on-change="studentSelect1" multiple placeholder="请选择">-->
<!-- <Option :disabled="item.name ==='学生'" v-for="(item,index) in promiseAllArray[2]" :value="item.id" :key="index">{{item.name}}</Option>-->
<!-- <Form ref="formValidate1" :model="formValidate" :rules="ruleValidate" :label-width="80">-->
<!-- <FormItem label="教师" prop="teacher">-->
<!-- <Select clearable transfer filterable multiple v-model="formValidate.teacher" placeholder="请选择">-->
<!-- <Option v-for="(item,index) in promiseAllArray[0]" :value="item.id" :key="index">{{ item.name }}-->
<!-- </Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<FormItem>
<!-- <FormItem label="是否为指导老师" prop="is_leadValue">-->
<!-- <Select clearable transfer filterable v-model="formValidate.is_leadValue" placeholder="请选择">-->
<!-- <Option v-for="(item,index) in is_lead" :value="item.value" :key="index">{{ item.label }}</Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
<!-- <FormItem>-->
<!-- <Button type="primary" @click="handleSubmit('t')">提交</Button>-->
<!-- <Button @click="handleReset('t')" style="margin-left: 8px">重置</Button>-->
<!-- </FormItem>-->
<!-- </Form>-->
<div style="display: flex;">
<RadioGroup style="margin-bottom: 15px" v-model="modalSelect1.checkboxValue">
<Radio v-for="(item,index) in modalSelect1.rList" :label="item.value" :key="index"
border><span>{{ item.label }}</span></Radio>
</RadioGroup>
<div style="height: 40px; margin-left: auto ;display: flex;flex-wrap: nowrap">
<Input v-model="modalSelect1.searchValue" placeholder="请输入姓名或卡号搜索..."></Input>
<Button type="primary" @click="searchButton" :disabled="modalSelect1.searchValue===''"
style="margin-left: 10px;">
搜索
</Button>
<Button type="text" @click="searchReset1" style="margin-left: 10px;">重置</Button>
</div>
</div>
<Table :columns="modalSelect1.column" :data="modalSelect1.sList" @on-select-all="modalTableSelectAll1"
@on-select-all-cancel="modalTableSelectAllCancel1" @on-select="modalTableSelect1"
@on-select-cancel="modalTableSelectCancel1">
</Table>
<div style="height: 40px;margin-top: 20px">
<Page
:transfer="true"
show-total
:key="modalSelect1.pageKey"
show-sizer
show-elevator
:total="modalSelect1.total"
:page-size="modalSelect1.page_size"
model-value="modalSelect1.page_index"
@on-change="currentPage2"
@on-page-size-change="currentPageCount2"
/>
</div>
<div style="float: right">
<Button @click="addTeamModal = false" style="margin-right: 20px;">取消</Button>
<Button type="primary" @click="handleSubmit('t')">提交</Button>
<Button @click="handleReset('t')" style="margin-left: 8px">重置</Button>
</FormItem>
</Form>
</div>
</TabPane>
</Tabs>
</div>
......@@ -147,11 +230,15 @@
<FormItem label="团队名称" prop="teamName">
<Input placeholder="请输入团队名称" v-model="formValidate.teamName"></Input>
</FormItem>
<FormItem label="是否获奖" prop="is_winValue">
<Select clearable transfer filterable v-model="formValidate.is_winValue" placeholder="请选择">
<Option v-for="(item,index) in is_win" :value="item.value" :key="index">{{ item.label }}</Option>
</Select>
</FormItem>
<!-- <FormItem label="是否获奖" prop="is_winValue">-->
<!-- <Select :disabled="true" clearable transfer filterable v-model="formValidate.is_winValue"-->
<!-- placeholder="否"-->
<!-- >-->
<!-- <Option v-for="(item,index) in is_win" :value="0" :key="index">{{ item.label }}</Option>-->
<!-- </Select>-->
<!-- </FormItem>-->
</Form>
</div>
......@@ -160,6 +247,7 @@
<Button type="primary" @click="createTeamFunOk">确认</Button>
</template>
</Modal>
<Modal
width="40%"
v-model="updateTeamModal"
......@@ -192,12 +280,72 @@ import * as api from '../../api/requestUtils'
// import AddEditDrawer from './component/addEditDrawer.vue'
// import TableFrom from './component/table-from.vue'
import * as hook from '../../hook/index'
import {GetStudentList} from "../../api/requestUtils";
export default {
name: 'list',
// components: { AddEditDrawer, TableFrom },
data() {
return {
modalSelect1: {
tArray: [],
checkboxValue: '',
rList: [{value: 0, label: '非指导教师'}, {value: 1, label: '指导教师'}],
sArray: [],
searchValue: '',
condition: '',
column: [
{
type: 'selection',
minWidth: 150,
},
{
title: '姓名',
minWidth: 150,
key: 'name'
},
{
title: '学号/工号',
minWidth: 150,
key: 'number'
}
],
sList: [],
pageKey: 1,
total: 0,
page_size: 10,
page_index: 1,
},
modalSelect: {
checkboxValue: '',
rList: [{value: 0, label: '否'}, {value: 1, label: '是'}],
sArray: [],
searchValue: '',
condition: '',
column: [
{
type: 'selection',
minWidth: 150,
},
{
title: '姓名',
minWidth: 150,
key: 'name'
},
{
title: '学号/工号',
minWidth: 150,
key: 'number'
}
],
sList: [],
pageKey: 1,
total: 0,
page_size: 10,
page_index: 1,
},
updateTeamModal: false,
createTeamModal: false,
ruleValidate: {
......@@ -206,7 +354,7 @@ export default {
teacher: [{type: 'array', required: true, message: '请选择教师', trigger: 'change'}],
role: [{type: 'array', required: true, message: '请选择权限', trigger: 'change'}],
createTeamTeacher: [{type: 'string', required: true, message: '请选择教师', trigger: 'change'}],
is_winValue: [{type: 'number', required: true, message: '请选择是否获奖', trigger: 'change'}],
// is_winValue: [{type: 'number', required: true, message: '请选择是否获奖', trigger: 'change'}],
is_leadValue: [{type: 'number', required: true, message: '请选择是否为指导老师', trigger: 'change'}],
updateTeamName: [{type: 'string', required: true, message: '请输入团队名称', trigger: 'blur'}],
updateIs_winValue: [{type: 'number', required: true, message: '请选择是否获奖', trigger: 'change'}],
......@@ -279,6 +427,7 @@ export default {
align: 'center',
minWidth: 200,
fixed: 'right',
show: true,
slot: 'action'
}
],
......@@ -364,9 +513,133 @@ export default {
},
mounted() {
this.getTeamList()
this.promiseAll()
// this.promiseAll()
},
methods: {
searchButton() {
this.modalSelect.condition = this.modalSelect.searchValue
this.modalSelect.page_index = 1
this.modalSelect1.condition = this.modalSelect1.searchValue
this.modalSelect1.page_index = 1
this.getTorS()
this.getTorS1()
},
searchReset() {
this.modalSelect.condition = ''
this.modalSelect.searchValue = ''
this.modalSelect.page_index = 1
this.modalSelect.page_size = 10
this.modalSelect.sArray = []
this.modalSelect.pageKey++
this.getTorS()
},
searchReset1() {
this.modalSelect1.searchValue = ''
this.modalSelect1.checkboxValue = ''
this.modalSelect1.condition = ''
this.modalSelect1.page_index = 1
this.modalSelect1.page_size = 10
this.modalSelect1.tArray = []
this.modalSelect1.pageKey++
this.getTorS1()
},
modalTableSelectCancel1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectAll1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectAllCancel1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelect1(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect1.tArray = []
selection.map((cur, index) => {
this.modalSelect1.tArray.push(cur.tid)
})
},
modalTableSelectCancel(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelectAll(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelectAllCancel(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
modalTableSelect(selection, row) {
console.log("🚀🚀🚀,", selection)
this.modalSelect.sArray = []
selection.map((cur, index) => {
this.modalSelect.sArray.push(cur.sid)
})
},
async getTorS() {
let data = {
page_index: this.modalSelect.page_index,
page_size: this.modalSelect.page_size,
condition: this.modalSelect.condition,
}
let res = await api.GetStudentList(data)
this.modalSelect.sList = res.response.data
this.modalSelect.total = res.response.data_count
},
async getTorS1() {
let data = {
page_index: this.modalSelect1.page_index,
page_size: this.modalSelect1.page_size,
condition: this.modalSelect1.condition,
}
let res = await api.GetTeacherList(data)
this.modalSelect1.sList = res.response.data
this.modalSelect1.total = res.response.data_count
},
currentPage2(e) {
this.modalSelect1.page_index = e
this.getTorS1()
},
currentPageCount2(e) {
this.modalSelect1.page_size = e
this.getTorS1()
},
currentPage1(e) {
this.modalSelect.page_index = e
this.getTorS()
},
currentPageCount1(e) {
this.modalSelect.page_size = e
this.getTorS()
},
async drawerDel(e) {
const res = await api.TeamMembersDel({teammembersid: e.teammembersid})
this.detailed({teamid: e.team_id})
......@@ -379,46 +652,58 @@ export default {
handleReset(e) {
switch (e) {
case 's':
this.searchReset()
this.formValidate.student = []
break;
case 't':
this.formValidate.teacher = []
this.searchReset1()
break;
}
},
handleSubmit(e) {
async handleSubmit(e) {
switch (e) {
case 's' :
this.$refs['formValidate'].validate(async (validate) => {
if (validate) {
// this.$refs['formValidate'].validate(async (validate) => {
// if (validate) {
//
// }
// })
let data = {
"team_id": this.formValidate.currentTeamId,
"is_tea": 0,
"is_lead": 0,
"id_list": this.formValidate.student
"id_list": this.modalSelect.sArray
}
const res = await api.TeamMembersIns(data)
hook.publicMessage(res)
await this.getTeamList()
this.addTeamModal = false
this.formValidate.student = []
}
})
this.modalSelect.sArray = []
break;
case 't' :
this.$refs['formValidate1'].validate(async (validate) => {
if (validate) {
let data = {
// this.$refs['formValidate1'].validate(async (validate) => {
// if (validate) {
//
// }
// })
let data1 = {
"team_id": this.formValidate.currentTeamId,
"is_tea": 1,
"is_lead": this.formValidate.is_leadValue,
"id_list": this.formValidate.teacher
"is_lead": this.modalSelect1.checkboxValue,
"id_list": this.modalSelect1.tArray
}
const res = await api.TeamMembersIns(data)
const res1 = await api.TeamMembersIns(data1)
if (res1.code !== 1) {
this.$Message.error(res1.msg_detail)
} else {
hook.publicMessage(res1)
await this.getTeamList()
this.addTeamModal = false
this.formValidate.teacher = []
this.modalSelect1.tArray = []
}
})
break;
}
},
......@@ -432,6 +717,7 @@ export default {
"is_win": this.formValidate.updateIs_winValue,
}
const res = await api.TeamSave(data)
hook.publicMessage(res)
await this.getTeamList()
this.updateTeamModal = false
}
......@@ -445,8 +731,10 @@ export default {
this.formValidate.num = e.num
this.updateTeamModal = true
},
addTeamPeople(e) {
async addTeamPeople(e) {
this.formValidate.currentTeamId = e.teamid
const res = await this.getTorS()
this.getTorS1()
this.addTeamModal = true
},
addTeamOk() {
......@@ -457,6 +745,7 @@ export default {
},
searchFun() {
this.init.teamname = this.searchValue
this.init.page_index = 1
this.getTeamList()
},
......@@ -469,7 +758,7 @@ export default {
},
// 查询
async getTeamList() {
this.$Spin.show()
this.loading = true
let data = {
teamname: this.init.teamname,
page_index: this.init.page_index,
......@@ -478,7 +767,7 @@ export default {
const res = await api.GetTeamList(data)
this.tableData = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
},
createTeamFunOk() {
this.$refs['formValidate3'].validate(async (validate) => {
......@@ -487,9 +776,11 @@ export default {
"teamid": this.formValidate.teamid,
"teamname": this.formValidate.teamName,
"num": 1,
"is_win": this.formValidate.is_winValue,
// "is_win": this.formValidate.is_winValue,
"is_win": 0,
}
const res = await api.TeamSave(data)
hook.publicMessage(res)
this.getTeamList()
this.createTeamModal = false
}
......@@ -509,6 +800,7 @@ export default {
// 删除
async del(row) {
const res = await api.TeamDel({teamid: row.teamid})
hook.publicMessage(res)
await this.getTeamList()
},
// 取消删除
......
......@@ -42,16 +42,25 @@
<template #extra>
<Input v-model="search.name" placeholder="请输入竞赛名称..." style="width: 15vw;"></Input>
<Button type="primary" :disabled="searchButton" @click="searchFun" style="margin-left: 10px">查找</Button>
<Button type="text" @click="importCompetition"
style="margin-left: 10px">赛事数据导出
</Button>
<Button type="primary" @click="flowAssembleFun({flowid:101,remark:'CompetitionReport'})"
style="margin-left: 10px">赛事录入
</Button>
</template>
<Table
:columns="columns"
:data="tableData"
:loading="loading"
>
<template #level="{row}">
<!-- <Tag :color="['','success','primary'][row.way]">{{['国家级', '省一级', '省二级'][row.way]
}}</Tag>-->
{{ ['', '国家级', '省一级', '省二级'][row.level] }}
{{ ['', '国家级', '省一级', '省二级', '国际级'][row.level] }}
</template>
<template #way="{row}">
<Tag :color="['success','primary'][row.way]">{{ ['团队', '个人'][row.way] }}</Tag>
......@@ -60,12 +69,24 @@
<template #approval_state="{row}">
{{ ['未审批', '审批中', '审批通过', '审批不通过'][row.approval_state] }}
</template>
<template #competition_type="{row}">
<Tag v-if="row.competition_type" :color="['','primary','success'][row.competition_type]"> {{
['', 'A类', 'B类'][row.competition_type]
}}
</Tag>
</template>
<template v-slot:action="{row}">
<Button type="primary" size="small" @click="edit(row)">详细</Button>
<a @click="importFile(row)">导出</a>
<a @click="edit(row)" style="margin-left: 15px;">详细</a>
<Poptip confirm transfer title="你确定删除吗?" @on-ok="delCompetition(row)" @on-cancel="cancel">
<Button type="error" size="small" style="margin-left: 20px">删除</Button>
<a style="margin-left: 15px;color: red">删除</a>
</Poptip>
</template>
</Table>
<div style="height: 60px;display: flex;align-items: center;">
......@@ -80,13 +101,17 @@
:key="pageKey"
/>
</div>
<Drawer :width="800" title="详细" :closable="true" v-model="drawer">
<div class="tableList">
<h1 style="display: flex;justify-content: center">竞赛内容详细</h1>
<table border="1" class="container">
<tr class="row" v-for="(item,index) in drawerKeyValueArray" :key="index">
<th v-if="item[0]==='level'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='level'" class="colContent">{{ ['国家级', '省一级', '省二级'][item[1]] }}</td>
<td v-if="item[0]==='level'" class="colContent">{{
['', '国家级', '省一级', '省二级', '国际级'][item[1]]
}}
</td>
<th v-if="item[0]==='way'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='way'" class="colContent">{{ ['团队', '个人'][item[1]] }}</td>
......@@ -96,14 +121,45 @@
{{ ['未审批', '审批中', '审批通过', '审批不通过'][item[1]] }}
</td>
<th v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colTitle">{{
<th v-if="item[0]==='competition_type'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='competition_type'" class="colContent">
{{ ['', 'A类', 'B类'][item[1]] }}
</td>
<th v-if="item[0]!=='subitem_list'&&item[0]!=='competition_type'&&item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colTitle">{{
item[2]
}}
</th>
<td v-if="item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'" class="colContent">{{
<td v-if="item[0]!=='subitem_list'&&item[0]!=='competition_type'&&item[0]!=='fileList'&&item[0]!=='level' && item[0]!=='way'&& item[0]!=='approval_state'"
class="colContent">{{
item[1]
}}
</td>
<!-- <th v-if="item[0]==='subitem_list'" class="colTitle">{{ item[2] }}</th>-->
<!-- <td v-if="item[0]==='subitem_list'" class="colContent">-->
<!-- <a class="aText" style="display: flex;flex-wrap: wrap;justify-content: center"-->
<!-- v-for="(ite,inde) in item[1]"-->
<!-- :key="inde">-->
<!-- {{ ite.competitionsubitem_name }}-->
<!-- </a>-->
<!-- </td>-->
<th v-if="item[0]==='fileList'" class="colTitle">{{ item[2] }}</th>
<td v-if="item[0]==='fileList'" class="colContent">
<!-- :href="ite.path" target="_blank" -->
<a class="aText" @click="aFun(ite)"
style="display: flex;flex-wrap: wrap;justify-content: center"
v-for="(ite,inde) in item[1]"
:key="inde">
{{ ite.file_name }}
</a>
</td>
</tr>
</table>
......@@ -112,19 +168,76 @@
</Drawer>
</Card>
<Modal
v-model="importModal"
title="文件导出"
>
<Spin fix v-if="importLoading"></Spin>
<div style=" display: flex;justify-content: space-around;">
<Button icon="md-log-in" @click="importButton(item[1])" v-for="(item,index) in fileObject" :key="index">
{{
item[2]
}}
</Button>
</div>
<template #footer>
<Button type="text" @click="importModal =false">关闭</Button>
<!-- <Button type="primary" @click="importOk">确定</Button>-->
</template>
</Modal>
<!-- :value="`competition/upfiles/attachment/asc666_2023_9_1695643952260190208 - 副本 (2).xlsx`"-->
<Drawer :width="100" :height="100" placement="bottom" v-model="drawerPreview" :key="previewKey">
<template #header>
<div style="display: flex;justify-content: center;">
<h3>文件预览</h3>
</div>
</template>
<template #close>
<Button type="text" style="color: #1e93ff" @click="downFile">下载</Button>
<Button type="text" @click="drawerPreview=false">关闭</Button>
</template>
<!--&& fileType ==='office'-->
<VueDocPreview
style="height:calc(100vh-45px);"
v-if="src && fileType ==='office'"
:value="src"
:url="src"
language="JavaScript"
type="office">
</VueDocPreview>
<!-- "msg_detail": "请上传.doc|.docx|.pdf|.xls|.xlsx|.jpg|.jpeg|.png 格式的文件",-->
<i-frame
v-if="src && fileType ==='image'"
:src="src"
></i-frame>
</Drawer>
</div>
</template>
<script>
import * as hook from '../../hook'
import * as api from '../../api/requestUtils'
import _ from "lodash";
import frame from "@/components/frame/index.vue";
export default {
name: 'list',
components: {},
components: {frame},
data() {
return {
fileType: '',
drawerPreview: false,
previewKey: 1,
src: '',
drawerKeyValueArray: [],
drawer: false,
grid: {
......@@ -157,13 +270,13 @@ export default {
show: true,
minWidth: 150,
},
{
title: '承办单位',
key: 'undertaker',
align: 'center',
show: true,
minWidth: 100,
},
// {
// title: '承办单位',
// key: 'undertaker',
// align: 'center',
// show: true,
// minWidth: 100,
// },
{
title: '赛事级别',
slot: 'level',
......@@ -172,76 +285,113 @@ export default {
minWidth: 120,
},
{
title: '正常比赛时间与天数',
key: 'competition_time',
align: 'center',
show: true,
minWidth: 170,
},
{
title: '参赛对象',
key: 'participant',
title: '审批状态',
slot: 'approval_state',
align: 'center',
show: true,
minWidth: 120,
minWidth: 200,
},
{
title: '组队方式',
slot: 'way',
title: '院系',
key: 'dept',
align: 'center',
show: true,
minWidth: 150,
},
{
title: '比赛规模',
key: 'game_size',
title: '赛事类型',
slot: 'competition_type',
align: 'center',
show: true,
minWidth: 120,
minWidth: 100,
},
// {
// title: '正常比赛时间与天数',
// key: 'competition_time',
// align: 'center',
// show: true,
// minWidth: 170,
// },
{
title: '审批状态',
slot: 'approval_state',
title: '参赛对象',
key: 'competitor',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
{
title: '近三年参赛平均数量',
key: 'average',
title: '比赛奖金',
key: 'money',
align: 'center',
show: true,
minWidth: 200,
minWidth: 120,
},
{
title: '获奖比例',
key: 'ratio_info',
title: '比赛形式',
slot: 'way',
align: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
// {
// title: '比赛规模',
// key: 'game_size',
// align: 'center',
// show: true,
// minWidth: 120,
// },
// {
// title: '近三年参赛平均数量',
// key: 'average',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '获奖比例',
// key: 'ratio_info',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '赛事及竞赛方案简介',
// key: 'intro',
// align: 'center',
// show: true,
// minWidth: 200,
// },
{
title: '赛事及竞赛方案简介',
key: 'intro',
title: '拟参赛专业和相关课程',
key: 'correlation',
align: 'center',
show: true,
minWidth: 200,
},
{
title: '拟参赛专业和相关课程',
key: 'correlation',
align: 'center',
title: '比赛开始时间',
key: 'begin_time',
alot: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
{
title: '参赛理由',
key: 'reason',
align: 'center',
title: '比赛结束时间',
key: 'end_time',
alot: 'center',
show: true,
minWidth: 200,
minWidth: 150,
},
// {
// title: '参赛理由',
// key: 'reason',
// align: 'center',
// show: true,
// minWidth: 200,
// },
// {
// title: '附件',
// key: 'competition_file',
// align: 'center',
......@@ -300,6 +450,7 @@ export default {
{value: 1, label: '国家级'},
{value: 2, label: '省一级'},
{value: 3, label: '省二级'},
{value: 4, label: '国际级'},
],
wayArray: [
{value: 0, label: '团队'},
......@@ -311,7 +462,10 @@ export default {
page_size: 10,
total: 0,
},
pageKey: 1
pageKey: 1,
importLoading: false,
importModal: false,
fileObject: {},
}
},
// 查询条件初始化
......@@ -324,9 +478,79 @@ export default {
}
},
mounted() {
this.getCompetitionList()
hook.storageAddEventListener(async () => {
await this.getCompetitionList()
})
},
methods: {
downFile() {
window.open(this.src, '_blank')
},
aFun(e) {
const fun = (e, url) => {
this.src = 'https://asc.hnasct.cn' + url.path
this.fileType = e
this.drawerPreview = true
}
if (e.suffix === '.jpg' || e.suffix === '.jpeg' || e.suffix === '.png' || e.suffix === '.pdf') {
fun('image', e)
} else if (e.suffix === '.doc' || e.suffix === '.docx' || e.suffix === '.xls'
|| e.suffix === '.xlsx') {
fun('office', e)
}
},
async importCompetition() {
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
"way": this.search.wayCurrentValue,
"approval_state": this.search.approval_stateCurrentValue,
"page_index": this.init.page_index,
"page_size": this.init.page_size,
}
await hook.myEncapsulationFunction(async () => {
const res = await api.ReportExportToExcel(data)
window.location.href = res.response
return res
})
},
importButton(row) {
window.open(row, '_blank')
},
async importFile(row) {
this.importModal = true
this.importLoading = true
const res = await api.ReportExport({id: row.competitionreportid})
try {
delete res.response.response.file_name
let data = Object.entries(res.response.response)
let name = ['PDF导出', 'Word导出']
data.map((cur, index) => {
cur.push(name[index])
})
this.fileObject = data
this.importLoading = false
} catch (e) {
this.importLoading = false
}
},
flowAssembleFun(e) {
let href = this.$router.resolve({
path: `/${e.remark}Form`,
query: {
id: e.flowid,
remark: e.remark,
entrance: 'race',
}
})
window.open(href.href, '_blank')
},
async searchFun() {
this.search.wayCurrentValuethis = this.search.name
this.search.levelCurrentValue = this.search.level
......@@ -335,10 +559,11 @@ export default {
this.pageKey++
this.init.page_index = 1
const res = await this.getCompetitionList()
},
// 查询
async getCompetitionList() {
this.$Spin.show()
this.loading = true
let data = {
"name": this.search.wayCurrentValuethis,
"level": this.search.levelCurrentValue,
......@@ -350,7 +575,7 @@ export default {
const res = await api.GetReportList(data)
this.tableData = res.response.data
this.init.total = res.response.data_count
hook.publicMessage(res)
this.loading = false
},
// 新增
......@@ -358,34 +583,57 @@ export default {
this.$refs.addEdit.add()
},
// 修改
edit(row) {
async edit(row) {
this.drawer = true
let res = await api.GetReportInfo({id: row.competitionreportid})
console.log("🚀🚀🚀,", res)
let array = _.cloneDeep(row)
delete array.competitionreportid
delete array.competition_file
delete array.createtime
delete array._rowKey
delete array._index
delete array.approval_remark
delete array.dept_id
delete array.game_size
delete array.average
delete array.ratio_info
delete array.intro
delete array.undertaker
delete array.participant
delete array.reason
delete array.competition_time
// array.subitem_list = res.response.reportInfo.subitem_list
delete res.response.reportInfo.subitem_list
array.fileList = res.response.fileList
this.drawerKeyValueArray = Object.entries(array)
this.drawerKeyValueArray.map((cur, index) => {
let data = [
'赛事名称',
'主办单位',
'承办单位/秘书处',
// '承办单位/秘书处',
'赛事级别',
'正常比赛时间与天数',
'参赛对象',
// '比赛时间',
// '参赛对象',
'组队方式',
'比赛规模',
'近三年参赛平均数量',
'获奖比例',
'赛事及竞赛方案简介',
// '比赛规模',
// '近三年参赛平均数量',
// '获奖比例',
// '赛事及竞赛方案简介',
'拟参赛专业和相关课程',
'参赛理由',
// '参赛理由',
'审批状态',
'审批意见'
// '审批意见'
'竞赛类型',
'院系',
'赛事奖金',
'比赛开始时间',
'比赛结束时间',
'参赛对象',
// '赛项名称',
'附件',
];
cur.push(data[index])
})
......@@ -398,6 +646,7 @@ export default {
id: row.competitionreportid
}
const res = await api.ReportDel(data)
hook.publicMessage(res)
await this.getCompetitionList()
},
......@@ -409,6 +658,7 @@ export default {
// 切换第几页
handleChangePage(pageNumber) {
this.init.page_index = pageNumber
this.getCompetitionList()
},
// 切换每页条数
......@@ -449,5 +699,15 @@ export default {
}
}
::v-deep .ivu-drawer-body {
width: 100%;
height: calc(100% - 51px);
padding: 0 !important;
font-size: 14px;
line-height: 1.5;
word-wrap: break-word;
position: absolute;
overflow: auto;
}
</style>
......@@ -46,7 +46,7 @@ function errorLog(err) {
// 创建一个 axios 实例
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 10000 // 请求超时时间
timeout: 60000 // 请求超时时间
});
let flag = 1
const refreshToken = async () => {
......
......@@ -26,33 +26,28 @@ const router = new VueRouter({
*/
router.beforeEach(async (to, from, next) => {
console.log(to, '111to')
console.log(from, 'fr111om')
console.log(next, 'nex11t')
if (Setting.showProgressBar) iView.LoadingBar.start();
// 判断是否需要登录才可以进入
if (to.matched.some(_ => _.meta.auth)) {
// 这里依据 token 判断是否登录,可视情况修改
const token = util.cookies.get('token');
if (token && token !== 'undefined') {
console.log("🚀🚀1111🚀,")
next();
} else {
console.log("🚀🚀2---------2222🚀,")
let token = ''
if (Cookies.get('token')) {
if (Cookies.get('token') && Cookies.get('token') !== 'undefined' || Cookies.get('token') && Cookies.get('token') !== 'null') {
token = Cookies.get('token')
console.log("🚀🚀Cookies🚀,", token)
} else {
token = localStorage.getItem('token')
Cookies.set('token', token)
// Cookies.set('token', token)
console.log("🚀🚀localStorage🚀,", token)
}
await store.dispatch('admin/account/ascLogin', {
"token": token
}, {root: true});
console.log("🚀🚀🚀我验证完成了,", token)
console.log("🚀🚀22222🚀,")
next();
// 没有登录的时候跳转到登录界面
......@@ -66,7 +61,6 @@ router.beforeEach(async (to, from, next) => {
}
} else {
// 不需要身份校验 直接通过
console.log("🚀🚀333333🚀,")
next();
}
});
......
import BasicLayout from '@/layouts/basic-layout';
const meta = {
auth: true
};
export default {
path: '/',
name: '',
meta,
component: BasicLayout,
children: [
{
path: `competitionNotice`,
name: `competitionNotice`,
meta: {
...meta,
title: '竞赛公告列表',
closable: false
},
component: () => import('@/pages/CompetititonNotice/index')
}
]
};
import BasicLayout from '@/layouts/basic-layout';
const meta = {
auth: true
};
export default {
path: '/',
name: '',
meta,
component: BasicLayout,
directive: {
name: 'competitionScore'
},
children: [
{
path: `competitionScore`,
name: `competitionScore`,
meta: {
...meta,
title: '竞赛成绩列表',
closable: false
},
component: () => import('@/pages/competitionScore/index')
}
]
};
......@@ -9,6 +9,7 @@ export default {
path: '/',
name: '',
meta,
component: BasicLayout,
direction: {
name: 'userManagement',
......@@ -17,6 +18,7 @@ export default {
{
path: `${pre}-userManagement`,
name: `userManagement`,
meta: {
...meta,
title: '用户管理',
......@@ -43,6 +45,37 @@ export default {
closable: false
},
component: () => import('@/pages/systemConfiguration/approvalUserGroupManagement.vue')
}
},
{
path: `${pre}-noticeManagement`,
name: `noticeManagement`,
meta: {
...meta,
title: '竞赛公告管理',
closable: false
},
component: () => import('@/pages/systemConfiguration/noticeIndex.vue')
},
{
path: `${pre}-flowDesign`,
name: `flowDesign`,
meta: {
...meta,
title: '流程设计管理',
closable: false
},
component: () => import('@/pages/systemConfiguration/flowDesign.vue')
},
{
path: `${pre}-log`,
name: `log`,
meta: {
...meta,
title: '日志',
closable: false
},
component: () => import('@/pages/systemConfiguration/log.vue')
},
]
};
......@@ -18,6 +18,8 @@ import Bursary from "@/router/modules/Bursary";
import Certificate from "@/router/modules/Certificate";
import CompetitionSign from "@/router/modules/CompetitionSign";
import flowAssemble from "@/router/modules/flowAssemble";
import competitionNotice from "@/router/modules/competitionNotice";
import competitionScore from "@/router/modules/competitionScore";
/**
* 在主框架内显示
......@@ -95,7 +97,8 @@ const frameIn = [
Certificate,
CompetitionSign,
flowAssemble,
competitionNotice,
competitionScore,
];
......@@ -168,6 +171,15 @@ const frameOut = [
},
component: () => import('@/pages/flowAssemble/flowComponent/BursaryForm.vue')
},
{
path: `/NoticeForm`,
name: `NoticeForm`,
meta: {
auth: true,
title: '竞赛公告流程'
},
component: () => import('@/pages/flowAssemble/flowComponent/NoticeForm.vue')
},
{
path: `/awaitDoneInformation`,
name: `awaitDoneInformation`,
......@@ -177,6 +189,25 @@ const frameOut = [
},
component: () => import('@/pages/flowAssemble/awaitDoneComponents/index.vue')
},
{
path: `/updateNotice`,
name: `updateNotice`,
meta: {
auth: true,
title: '公告编辑'
},
component: () => import('@/pages/CompetititonNotice/components/updateNotice.vue')
},
{
path: `/noticeInfo`,
name: `noticeInfo`,
meta: {
auth: true,
title: '公告详细'
},
component: () => import('@/pages/CompetititonNotice/components/noticeInfo.vue')
},
];
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或