This commit is contained in:
2024-09-02 14:08:37 +08:00
parent c409249f61
commit 4f3a1910bc
82 changed files with 9497 additions and 2733 deletions
+52 -28
View File
@@ -75,19 +75,19 @@ layout("/mobile/platform.html"){
<div class="user_info">
<van-row style="height: 200px">
<van-image
width="100%"
height="200px"
src="/back2.png"
width="100%"
></van-image>
</van-row>
<van-row class="user_avatar" style="height: 80px">
<van-col span="6" class="text-center">
<van-col class="text-center" span="6">
<van-image
:src="avatar"
height="70"
round
width="70"
height="70"
:src="avatar"
></van-image>
</van-col>
<van-col span="18">
@@ -99,7 +99,8 @@ layout("/mobile/platform.html"){
${@shiro.getPrincipalProperty('loginname')}
</span>
</div>
<div class="van-ellipsis" style="height: 40px;line-height: 40px;font-size: 14px;color: #969799">
<div class="van-ellipsis"
style="height: 40px;line-height: 40px;font-size: 14px;color: #969799">
<!--#if(@shiro.getPrincipalProperty('union')!=null){#-->
${@shiro.getPrincipalProperty('union').getUnionname()}
<!--#}#-->
@@ -109,23 +110,24 @@ layout("/mobile/platform.html"){
</div>
<div v-if="paramType === '会员管理'">
<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('public')||@shiro.hasRole('H01')}"
class="van-sidebar-item van-sidebar-item--select">
<div class="van-sidebar-item van-sidebar-item--select"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('public')||@shiro.hasRole('H01')}">
会员管理
</div>
<van-grid :column-num="3" :border="false">
<van-grid-item v-if="${@shiro.hasRole('H01')}" url="/mobile/member/detail">
<van-grid :border="false" :column-num="3">
<van-grid-item url="/mobile/member/detail" v-if="${@shiro.hasRole('H01')}">
<image src="/assets/mobile/icon/member/da.png"></image>
<span class="icon_text"> 会员档案</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.lacksRole('H01')}" url="/mobile/member/apply">
<van-grid-item url="/mobile/member/apply" v-if="${@shiro.lacksRole('H01')}">
<image src="/assets/mobile/icon/member/apply.png"></image>
<span class="icon_text"> 申请入会</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')}"
url="/mobile/member/audit">
<van-grid-item
url="/mobile/member/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')}">
<image src="/assets/mobile/icon/member/audit.png"></image>
<span class="icon_text"> 会员审核</span>
</van-grid-item>
@@ -145,32 +147,33 @@ layout("/mobile/platform.html"){
民主管理
</div>
<van-grid
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')||@shiro.hasRole('jdhdb01') || @shiro.hasRole('jdh12')}"
:border="false" :column-num="3">
<van-grid-item v-if="${@shiro.hasRole('jdhdb01')}"
url="/platform/mobile/proposal/compose">
:border="false"
:column-num="3"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')||@shiro.hasRole('jdhdb01') || @shiro.hasRole('jdh12')}">
<van-grid-item url="/platform/mobile/proposal/compose"
v-if="${@shiro.hasRole('jdhdb01')}">
<image src="/assets/mobile/icon/proposal/myProposal.png"></image>
<span class="icon_text">个人提案阅览</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('jdhdb01')}"
url="/platform/mobile/proposal/seconded">
<van-grid-item url="/platform/mobile/proposal/seconded"
v-if="${@shiro.hasRole('jdhdb01')}">
<image src="/assets/mobile/icon/proposal/fy.png"></image>
<span class="icon_text">附议提案</span>
</van-grid-item>
<van-grid-item
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')}"
url="/platform/mobile/proposal/delegation">
<image style="width: 59px" src="/assets/mobile/icon/proposal/tz.png"></image>
url="/platform/mobile/proposal/delegation"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')}">
<image src="/assets/mobile/icon/proposal/tz.png" style="width: 59px"></image>
<span class="icon_text">团长审议</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}"
url="/platform/mobile/proposal/integrated">
<van-grid-item url="/platform/mobile/proposal/integrated"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}">
<image src="/assets/mobile/icon/proposal/search.png"></image>
<span class="icon_text">提案查询</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}"
url="/mobile/proposal/delegate/index">
<van-grid-item url="/mobile/proposal/delegate/index"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}">
<image src="/assets/mobile/icon/proposal/cx.png"></image>
<span class="icon_text">代表查询</span>
</van-grid-item>
@@ -284,6 +287,26 @@ layout("/mobile/platform.html"){
</van-grid-item>
</van-grid>
</van-row>
<van-row v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H01')}">
<div class="van-sidebar-item van-sidebar-item--select">
会议管理
</div>
<van-grid :border="false" :column-num="3">
<van-grid-item url="/mobile/meeting/mine/myMeeting"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')||@shiro.hasRole('H01')}">
<image src="/assets/mobile/icon/meeting/会议(我的会议).png"></image>
<span class="icon_text">我的会议</span>
</van-grid-item>
<van-grid-item url="/mobile/meeting/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('jdhdbt01')}">
<image src="/assets/mobile/icon/meeting/会议(会议审核).png"></image>
<span class="icon_text">会议审核</span>
</van-grid-item>
</van-grid>
</van-row>
</div>
<div v-if="paramType === '福利慰问'">
@@ -291,7 +314,8 @@ layout("/mobile/platform.html"){
职工慰问
</div>
<van-grid :border="false" :column-num="3">
<template v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('H01')}">
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('H01')}">
<van-grid-item url="/mobile/condolence/apply/for">
<image src="/assets/mobile/icon/condolence/apply.png"></image>
<span class="icon_text">慰问申请</span>
@@ -303,8 +327,8 @@ layout("/mobile/platform.html"){
</van-grid-item>
</template>
<van-grid-item
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')||@shiro.hasRole('xghkj')}"
url="/mobile/condolence/audit">
url="/mobile/condolence/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')||@shiro.hasRole('xghkj')}">
<image src="/assets/mobile/icon/condolence/audit.png"></image>
<span class="icon_text">慰问审核</span>
</van-grid-item>
@@ -0,0 +1,504 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-index-bar__sidebar {
display: none;
}
.van-doc-card {
margin: 14px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 13px;
position: relative;
}
.van-divider {
margin: 6px 0 6px 0px;
border-color: lightgray;
}
.van-button--small {
border-radius: revert;
width: 40%;
height: 30px;
}
.van-col {
line-height: 20px;
}
.title_span {
font-size: 16px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 13px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.showMore {
color: #1867b0;
}
.cus_popup {
width: 70%;
height: 50%;
/*border-radius: 10px;*/
padding: 10px 14px;
font-size: 15px;
/*background-color: #E5E7E9;
background-image: url("https://www.transparenttextures.com/patterns/green-cup.png");*/
}
.cus_icon {
z-index: 10000;
color: white;
font-size: 35px;
position: fixed;
top: 81%;
left: 44%;
}
.userPopup {
height: 80%;
background-color: #f6f7f9;
font-size: 14px;
}
.van-row div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.firstName {
width: 45px;
background-color: lightgrey;
border-radius: 45px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
color: white;
}
.content {
height: 84%;
overflow: auto;
}
.van-dialog__header {
padding-top: 8px;
}
.van-dialog__confirm {
color: #1867b0;
}
.van-field__label {
width: 5em;
}
.cus_cell {
padding: 4px 0px;
font-size: 12px;
}
.van-checkbox-group {
max-height: 260px;
overflow-y: auto;
margin-top: 6px;
}
.unit {
display: inline-block;
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
}
.cus_button {
border-top-right-radius: 16px;
border-bottom-left-radius: 16px;
height: 26px;
}
.audit_icon {
font-size: 24px;
position: absolute;
font-weight: bolder;
right: 0;
}
.van-dropdown-menu__item {
flex: auto;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="会议请假审核"
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
@search="doSearch"
maxlength="10"
placeholder="请输入会议名称、会议地点进行查询"
shape="round"
v-model="pageForm.searchKeyword"
>
</van-search>
<van-dropdown-menu>
<van-dropdown-item :options="meetingTimeList" @change="doSearch"
v-model="pageForm.meetingTime"></van-dropdown-item>
<van-dropdown-item :options="typeList" @change="doSearch"
v-model="pageForm.typeId"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false"
@load="onLoad"
v-model="loading">
<div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id, o.modulename)">
<div style="display: flex; justify-content: space-between">
<div style="width: 70%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.meetingname}}</span>
</div>
<div style="color: grey">{{o.location}}</div>
</div>
<div style="color: #1867b0;">
{{o.meetingtypename}}
</div>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议时间:</span>
{{o.starttime}}
<!--<van-col span="12"><span style="color: grey">结束时间:</span></van-col>-->
</van-row>
<van-row>
<!--<van-col span="12">{{o.endtime}}</van-col>-->
</van-row>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 8px;">
<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">会议描述:</span>
{{o.meetingdescription}}
</div>
<span @click.stop="desc = o.meetingdescription; popupShow = true" class="showMore">查看更多</span>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div>
<van-button @click.stop="getAuditList(o)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">已审{{o.audit}}
</van-button>
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">未审{{o.no_audit}}
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<!--弹出框-->
<van-popup class="cus_popup" v-model:show="popupShow">
<pre style="margin: 0; white-space: break-spaces">{{desc}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" name="close" v-if="popupShow"></van-icon>
<!--审核人员-->
<van-action-sheet :title="queryType === 'notAudit' ? '请假人员列表' : '请假人员列表'" @close="popClose" class="userPopup"
v-model:show="userShow">
<div class="content">
<div class="van-doc-card" v-for="(item, i) in userList">
<div style="display: flex; justify-content: space-between">
<div style="width: 80%">
<!--<span>{{moment(item.startTime).format('YYYY-MM-DD HH:mm') + ' ~ ' + moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</span>-->
<span>{{'会议时间:' + moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</span>
</div>
<div v-if="queryType === 'notAudit'">
<span @click="checkAll(i)">全选</span>
<span @click="toggleAll(i)" style="margin-left: 4px">反选</span>
</div>
</div>
<div style="margin-top: 4px">
<van-row>
<van-col span="24">
会议名称:
<van-tag size="medium" type="primary">{{item.timePeriodName}}</van-tag>
</van-col>
</van-row>
</div>
<van-checkbox-group ref="checkboxGroup" v-if="item.users !== null" v-model="result">
<van-cell-group>
<van-cell
:key="obj.id"
@click="toggle(i, index)" class="cus_cell"
clickable
v-for="(obj, index) in item.users">
<span style="display: inline-block; width: 40px">{{obj.username}}</span>
<span style="display: inline-block; width: 20px">{{obj.sex}}</span>
<span style="display: inline-block; width: 60px">{{obj.loginname}}</span>
<span class="unit">{{obj.unitname}}</span>
<van-icon class="audit_icon" color="green" name="passed"
v-if="queryType === 'hasAudit' && obj.auditState === true"></van-icon>
<van-icon class="audit_icon" color="grey" name="close"
v-if="queryType === 'hasAudit' && obj.auditState === false"></van-icon>
<template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
<div style="margin-top: 4px; text-align: center" v-else>暂无请假人员</div>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%"
v-if="queryType === 'notAudit'">
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回
</van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过
</van-button>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%"
v-if="queryType === 'notAudit'">
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回
</van-button>
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过
</van-button>
</div>
</div>
</van-action-sheet>
<!--审核弹框-->
<van-dialog @confirm="auditDo" show-cancel-button title="温馨提示" v-model:show="auditShow">
<div style="padding-top: 8px; text-align: center; font-size: 14px; color: #646566">{{str}}</div>
<van-divider style="margin: 12px 0 1px 0px;"></van-divider>
<van-field
autosize
label="审核意见:"
maxlength="50"
placeholder="请输入审核意见"
rows="2"
show-word-limit
type="textarea"
v-model="reason"
></van-field>
</van-dialog>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
desc: '',
list: ['a', 'b'],
result: [],
reason: '',
auditShow: false,
popupShow: false,
userShow: false,
userList: [],
userClickList: [],
str: '',
type: '',
auditType: '',
queryType: '',
typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {text: '即将开始', value: 0}, {text: '已结束', value: 1}],
}
},
methods: {
async getAuditList(o) {
this.queryType = 'hasAudit'
const resp = await $.post('/mobile/meeting/audit/getLeaveUser', {
meetingId: o.id,
auditType: 'hasAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userList.forEach(item => {
if (item.users && item.users.length > 1) {
item.users.sort((a, b) => {
return b.auditState - a.auditState
})
}
})
this.userShow = true
}
},
checkAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle(true))
},
toggleAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle())
},
toggle(i, index) {
if (i > 0) {
let length = 0
for (let m = 0; m < i; m++) {
length += this.userList[m].users.length
}
index = length + index
}
this.$refs.checkboxes[index].toggle();
},
async auditDo() {
let idList = this.result
if (this.type === 'all') {
this.userList.forEach(item => {
if (item.users !== null && item.users !== undefined) {
idList = idList.concat(item.users.map(o => o.id))
}
})
}
const resp = await $.post('/mobile/meeting/audit/audit', {
tpuIds: JSON.stringify(idList),
auditOpinion: this.reason,
isPass: this.auditType === 'pass'
})
if (resp.code === 0) {
this.doSearch()
}
vant.Toast(resp.msg)
this.userShow = false
},
audit(type, auditType) {
this.type = type
this.auditType = auditType
if (type === 'many' && this.result.length === 0) {
vant.Toast('请先选择人员')
return
}
this.str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择' : '您确定要一键全部审核吗?'
this.reason = auditType === 'pass' ? '同意' : '拒绝'
this.auditShow = true
},
async openView(id, modulename) {
this.queryType = 'notAudit'
this.userList = []
const resp = await $.post('/mobile/meeting/audit/getLeaveUser', {
meetingId: id,
moduleName: modulename,
auditType: 'canAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userClickList = []
if (this.userList.length === 0) {
vant.Toast('暂无请假人员')
} else {
this.userShow = true
}
return
}
vant.Toast('系统错误,请联系管理员')
},
popClose() {
this.$nextTick(function () {
if (this.$refs.checkboxes !== undefined) {
this.$refs.checkboxes.forEach(item => item.toggle(false));
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.onLoad()
},
async onLoad() {
this.loading = true
$.post('/mobile/meeting/audit/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
})
},
},
async created() {
this.typeList = await meetUtil.getAllMeetingType()
this.typeList.unshift({text: '全部会议类型'})
if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value)
}
this.$set(this.pageForm, "meetingTime", this.meetingTimeList[1].value)
this.onLoad()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,532 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-index-bar__sidebar {
display: none;
}
.van-doc-card {
margin: 14px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 13px;
position: relative;
}
.van-divider {
margin: 6px 0 6px 0px;
border-color: lightgray;
}
.van-button--small {
border-top-right-radius: 16px;
border-bottom-left-radius: 16px;
height: 26px;
}
.van-col {
line-height: 20px;
}
.title_span {
font-size: 16px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 13px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.showMore {
color: #1867b0;
}
.cus_popup {
width: 70%;
height: 50%;
/*border-radius: 10px;*/
padding: 10px 14px;
font-size: 15px;
/*background-color: #E5E7E9;
background-image: url("https://www.transparenttextures.com/patterns/green-cup.png");*/
}
.cus_icon {
z-index: 10000;
color: white;
font-size: 35px;
position: fixed;
top: 81%;
left: 44%;
}
.van-dropdown-menu__item {
flex: auto;
}
.leave_pop {
height: 80%;
background-color: #f6f7f9;
}
.content {
height: 82%;
overflow: auto;
}
.van-field__label {
width: 4.6em;
}
.checkDiv {
font-size: 33px;
color: #1867b0;
position: absolute;
right: 4px;
top: 30px;
}
.auditState {
position: absolute;
right: -10px;
top: -3px;
border-radius: 4px;
padding: 1px 8px;
border: 1px #1867b0 solid;
background: #1867b0;
opacity: 0.6;
color: white;
transform: skewY(5deg);
}
.van-field--min-height .van-field__control {
min-height: auto;
font-size: 13px;
}
.border_div {
width: 33px;
height: 33px;
border: 1px lightgrey solid;
border-radius: 14px;
position: absolute;
right: 4px;
top: 28px;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="我的会议"
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
@search="doSearch"
maxlength="10"
placeholder="请输入会议名称、会议地点进行查询"
shape="round"
v-model="pageForm.searchKeyWord"
>
</van-search>
<van-dropdown-menu>
<van-dropdown-item :options="meetingList" @change="doSearch"
v-model="pageForm.tabNameIndex"></van-dropdown-item>
<van-dropdown-item :options="meetingTimeList" @change="doSearch"
v-model="pageForm.meetingTime"></van-dropdown-item>
<van-dropdown-item :options="typeList" @change="doSearch"
v-model="pageForm.typeId"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false"
@load="onLoad"
v-model="loading"
>
<div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id)">
<div style="display: flex; justify-content: space-between">
<div style="width: 74%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.meetingName}}</span>
</div>
</div>
<div style="color: #1867b0; white-space: nowrap;">
{{o.meetingTypeName}}
</div>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议地点:</span>
{{o.location}}
</van-row>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议时间:</span>
{{o.startTime}}
<!--<van-col span="12"><span style="color: grey">结束时间:</span></van-col>-->
</van-row>
<van-row>
<!--<van-col span="12">{{o.endTime}}</van-col>-->
</van-row>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 8px">
<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">会议描述:</span>
{{o.meetingDescription}}
</div>
<span @click.stop="popupShow = true; clickRow = o"
class="showMore">查看更多</span>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: flex-end">
<!--<div style="display: flex; align-items: center">
<span style="color: grey">审核状态:</span>
<span :style="'color: ' + o.stateColor">{{o.stateName}}</span>
</div>-->
<div>
<!--<van-button @click="needLeave(o)" v-if="o.isCanLeave === null && o.isJoin === null"
type="primary" size="small" color="#1867b0" style="margin-right: 8px">我要请假</van-button>
<van-button v-if="o.isJoin === false" size="small" disabled color="grey" style="margin-right: 8px">已请假</van-button>
<van-button type="primary" v-if="o.isJoin !== false" size="small" color="#1867b0">我要签到</van-button>
<van-button v-if="o.isJoin === true" size="small" disabled color="grey">已签到</van-button>-->
<van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, false)"
color="#1867b0" size="small" style="margin-right: 8px"
type="primary">查看请假状态
</van-button>
<van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, true)"
color="#1867b0" size="small" style="margin-right: 8px"
type="primary">我要请假
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<!--弹出框-->
<van-popup class="cus_popup" v-model:show="popupShow">
<pre style="margin: 0; white-space: break-spaces; line-height: 28px">{{clickRow.meetingDescription}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" name="close" v-if="popupShow"></van-icon>
<!--请假弹框-->
<van-action-sheet class="leave_pop" title="会议信息" v-model="leaveShow">
<div v-if="flag === true"
style="padding: 0px 0px 10px 0px; text-align: center; font-size: 14px; color: #646566">
请<span style="color: red">点击选择</span>请假时间段,填写请假原因
</div>
<div class="content">
<div class="van-doc-card" v-for="(item, index) in timeList">
<div>
<div><span style="color: grey">会议名称:</span>{{item.timePeriodName}}</div>
</div>
<div @click="leaveClick(item, index)"
style="display: flex; justify-content: space-between">
<div>
<div>
<span style="color: grey">会议时间:</span>
{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}
</div>
<!--<div><span style="color: grey">结束时间:</span>{{moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</div>-->
</div>
<div>
<div v-if="flag === true" class="border_div"></div>
<van-icon v-if="flag === true" :class="'checkDiv checkDiv' + index"
name="success" style="display: none;"></van-icon>
<span class="auditState"
v-if="item.isJoin === false">{{item.stateName}}</span>
</div>
</div>
<div v-if="item.isJoin === false">
<div><span style="color: grey">审核状态:</span>{{item.stateName}}</div>
</div>
<div>
<span style="float: left; color: grey">请假原因:</span>
<van-field :disabled="item.isJoin === false" placeholder="请输入请假原因" rows="1"
style="font-size: 12px; padding: 0; width: 70%; line-height: 20px"
type="textarea" autosize
v-model="item.leaveReason"></van-field>
</div>
<div v-if="flag === false && item.stateCode === clickRow.firstState && item.stateAuditType !== 1"
style="text-align: right">
<van-button @click.stop="cancelLeave(item)" border color="#1867b0" size="small">
取消请假
</van-button>
</div>
<div v-if="flag === false && item.stateAuditType === 1" style="text-align: right">
<van-button @click.stop="refreshApply(item)" border color="#1867b0"
size="small">重新申请
</van-button>
</div>
</div>
</div>
<div v-if="flag === true">
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 20px; width: 100%">
<van-button @click="leaveShow = false" color="lightgrey" size="small"
style="width: 40%; border-radius: revert; height: 38px">取消
</van-button>
<van-button @click="leave" color="#1867b0" size="small"
style="width: 40%; border-radius: revert; height: 38px">确定
</van-button>
</div>
</div>
</van-action-sheet>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
timeList: [],
checked: [],
checkboxRefs: [],
leaveReason: '',
leaveShow: false,
popupShow: false,
tabNameIndex: 0,
clickRow: {},
meetingList: [{text: '全部', value: '0'}, {text: '我参与的', value: '1'}, {
text: '我请假的',
value: '2'
}],
typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {
text: '即将开始',
value: 0
}, {text: '已结束', value: 1}],
flag: true,
}
},
methods: {
refreshApply(o) {
vant.Dialog.confirm({
title: '温馨提示',
message: '您确定要重新申请吗?',
}).then(async () => {
await this.needLeave(this.clickRow, true)
this.timeList.forEach((re, index) => {
if (re.stateAuditType === 1) {
re.isJoin = null
re.stateCode = null
re.leaveReason = null
$('.checkDiv' + index).css('display', 'none')
this.checked = this.checked.filter(function (item, index) {
return item.id !== re.id
})
}
})
}).catch(() => {
})
},
cancelLeave(o) {
vant.Dialog.confirm({
title: '温馨提示',
message: '您确定要取消请假吗?',
}).then(async () => {
const res = await $.post('/mobile/meeting/mine/cancelLeave', {id: o.id})
if (res.code === 0) {
vant.Toast('操作成功')
this.doSearch()
this.leaveShow = false
}
}).catch(() => {
})
},
leaveClick(item, index) {
if (item.isJoin === false) {
return
}
const isExist = this.checked.some(o => o.tpuId === item.tpuId)
if (!isExist) {
$('.checkDiv' + index).css('display', '')
this.checked.push(item)
} else {
$('.checkDiv' + index).css('display', 'none')
this.checked = this.checked.filter(o => o.tpuId !== item.tpuId)
}
},
toggle(item, index) {
if (item.auditIdList === null) {
this.$refs.checkboxes[index].toggle();
}
},
openView(id) {
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.onLoad()
},
async onLoad() {
this.loading = true
$.post('/mobile/meeting/mine/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
})
},
async needLeave(o, flag) {
this.flag = flag
this.clickRow = o
if (moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false) {
vant.Toast('抱歉,已过请假截止时间');
return
}
this.leaveReason = ''
this.checked = []
const res = await $.post('/mobile/meeting/mine/findMyMeetPeriod', {meetingId: o.id})
if (res.code === 0) {
this.timeList = res.data
if (this.timeList.length === 0) {
vant.Toast('您暂无可请假的假时间段');
return
}
this.leaveShow = true
this.$nextTick(function () {
this.timeList.forEach((re, index) => {
if (re.isJoin === false) {
this.checked.push(re)
$('.checkDiv' + index).css('display', '')
}
})
})
return
}
vant.Toast('系统错误,请联系管理员');
},
async leave() {
if (this.checked.length === 0) {
vant.Toast('请选择请假时间段');
return
}
const array = this.timeList.find(o => o.stateCode === null || o.stateCode < this.clickRow.firstState)
if (array === undefined) {
vant.Toast('您的所有请假均已处于审核阶段');
return
}
const paramArray = []
let valid = false
this.checked.forEach(item => {
if (item.leaveReason === '' || item.leaveReason === undefined) {
vant.Toast('请填写请假原因');
valid = true
return
}
if (!item.stateCode) {
paramArray.push(
{
id: item.tpuId,
meetingId: this.clickRow.id,
leaveReason: item.leaveReason
}
)
}
})
if (paramArray.length === 0) {
vant.Toast('请选择请假时间段');
return
}
if (valid) {
return
}
const resp = await $.post('/mobile/meeting/mine/askForLeave', {
meetingId: this.clickRow.id,
data: JSON.stringify(paramArray)
})
if (resp.code === 0) {
vant.Toast('操作成功');
this.doSearch()
this.leaveShow = false
}
$('.checkDiv').css('display', 'none')
}
},
async created() {
this.typeList = await meetUtil.getAllMeetingType()
this.typeList.unshift({'text': '全部会议类型'})
if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value)
}
this.$set(this.pageForm, "tabNameIndex", this.meetingList[0].value)
this.$set(this.pageForm, "meetingTime", this.meetingTimeList[1].value)
this.onLoad()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,320 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
[v-cloak] {
display: none !important;
}
#app {
max-height: 100vh;
opacity: 0;
}
.header {
height: 400px;
max-height: 400px;
background-color: white
}
.body {
background-color: white;
margin-top: 6px;
height: calc(100vh - (400px + 6px + 26px + 70px));
max-height: calc(100vh - (400px + 6px + 26px + 70px));
padding: 10px;
}
.footer {
background-color: white;
margin-top: 6px;
width: 100%;
height: 70px;
display: flex;
align-items: center;
}
.meeting_info {
height: 200px;
width: 86%;
margin: 0 auto;
transform: translateY(-60%);
background-color: white;
box-shadow: 0 8px 12px #ebedf0;
padding: 10px 10px;
border-radius: 10px;
}
.header .text {
color: white;
text-align: center;
letter-spacing: 3px;
line-height: 40px;
}
.meeting_info .meeting_name {
text-align: center;
font-weight: bold;
}
.meeting_info .meeting_address {
text-align: center;
color: grey;
font-size: 14px;
}
.van-button--block {
margin: 0 auto;
width: 92%;
}
.tag {
color: #1867b0;
font-weight: bold;
font-size: 20px;
margin-right: 6px;
}
.span_text {
color: grey;
font-size: 14px;
}
.van-col {
font-size: 14px;
}
.van-col span {
color: grey;
font-size: 14px;
}
.icon {
width: 6.4em;
height: 6.4em;
display: inline-block;
vertical-align: middle;
font-size: 10px;
-webkit-mask-size: 100%;
-webkit-mask-position: 50% 50%;
background-color: currentColor;
}
.icon_ok {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
color: #07c160;
}
.icon_no {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
color: #fa5151;
}
.weui-msg__text-area {
margin-bottom: 32px;
padding: 0 32px;
-webkit-box-flex: 1;
line-height: 1.6;
}
.weui-msg__text-area .weui-msg__title {
margin-bottom: 16px;
font-weight: 500;
font-size: 22px;
color: rgba(0, 0, 0, 0.9);
}
.weui-msg__desc {
font-size: 17px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
margin-bottom: 16px;
}
.meeting_index {
width: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: lightgrey;
color: white;
font-size: 20px;
font-weight: bold;
}
.meeting_peri {
width: 90%;
line-height: 19px;
margin-left: 10px
}
.meeting_primary {
display: flex;
justify-content: space-between;
margin-bottom: 10px
}
.weui-btn_primary:not(.weui-btn_disabled):visited {
color: #fff;
}
.weui-btn_primary {
background-color: #1867b0;
}
.weui-btn {
position: relative;
display: block;
width: 184px;
margin-left: auto;
margin-right: auto;
padding: 8px 24px;
box-sizing: border-box;
font-weight: 700;
font-size: 17px;
text-align: center;
text-decoration: none;
color: #fff;
line-height: 1.88235294;
border-radius: 8px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
</style>
<div id="app">
<div v-if="isCanAudit">
<div class="header">
<div style="height: 300px; background-color: #1867b0; border-radius: 0 0 16% 16%;">
<div class="text">会议签到</div>
</div>
<div class="meeting_info">
<div class="meeting_name">{{meetingInfo.meetingName}}</div>
<div class="meeting_address">{{meetingInfo.location}}</div>
<div style="position: relative; top: 55px">
<van-row>
<van-col span="24"><span>会议类型:</span>{{typeName}}</van-col>
</van-row>
<div style="position: relative; top: 30px">
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">会议时间:</span>
{{moment(meetingInfo.startTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">结束时间:</span>
{{moment(meetingInfo.endTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
</div>
</div>
</div>
</div>
<div class="body">
<div><span class="tag">|</span>会议名称</div>
<div style="overflow-y: auto; height: 100%; font-size: 13px;margin-top: 16px">
<div class="meeting_primary" v-for="(item,index) in meetingInfo.meetingTimePeriods">
<div :style="item.id === mtpId ? 'background-color: #43b26a; font-size: 15px' : ''"
class="meeting_index" v-if="item.id === mtpId">
当前
</div>
<div class="meeting_index" style="font-weight: normal" v-else>
{{index + 1}}
</div>
<div class="meeting_peri">
<div>{{item.timePeriodName}}</div>
<div>{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</div>
</div>
</div>
</div>
</div>
<div class="footer">
<van-button :disabled="signInfo.isSignIn" @click="signIn" block color="#1867b0" round type="primary">
{{signInfo.isSignIn ? '您已签到' : '点击签到'}}
</van-button>
</div>
</div>
<div style="text-align: center; padding-top: calc(100% - 50%)" v-cloak v-else>
<div style="margin-bottom: 32px;">
<span :class="isIncorrect === true ? 'icon icon_ok' : 'icon icon_no'"></span>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">{{isIncorrect === true ? '操作成功' : '温馨提示'}}</h2>
<p class=".weui-msg__desc">{{incorrectMag}}</p>
</div>
<p style="margin-top: 190px">
<span @click="back" class="weui-btn weui-btn_primary" role="button">点击返回</span>
</p>
</div>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
const vue = new Vue({
el: '#app',
data() {
return {
meetingInfo: {},
signInfo: {},
isCanAudit: true,
incorrectMag: '',
meetingId: '',
mtpId: '',
isIncorrect: true,
typeName: '',
}
},
methods: {
async pageData() {
const res = await $.get('/mobile/meeting/mine/getMeetingInfo', {
meetingId: this.meetingId,
mtpId: this.mtpId,
})
if (res.code === 0) {
this.meetingInfo = res.data.meetingInfo
this.signInfo = res.data.signInfo
const typeList = await meetUtil.getAllMeetingType()
const type = typeList.find(o => o.id === this.meetingInfo.typeId)
this.typeName = type !== undefined ? type.meetingTypeName : ''
} else {
this.isCanAudit = false
this.incorrectMag = res.msg
this.isIncorrect = false
}
$('#app').css('opacity', '1')
},
async signIn() {
const res = await $.post('/mobile/meeting/mine/signIn', {
mtpId: this.mtpId,
})
this.isIncorrect = res.code === 0
this.isCanAudit = false
this.incorrectMag = res.msg
},
back() {
const str = this.incorrectMag === '你不是当前会议人员' ? 'http://' + window.location.host : '/mobile/meeting/mine/go_sign?meetingId=' + this.meetingId + '&mtpId=' + this.mtpId
location.href = str
},
},
async created() {
this.meetingId = getQueryString('meetingId')
this.mtpId = getQueryString('mtpId')
await this.pageData()
}
})
</script>
<!--#
}
#-->
File diff suppressed because it is too large Load Diff
@@ -1,391 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.page-survey {
background-color: rgba(242, 242, 242, 1);
}
.page-survey .survey-container {
height: 100%;
overflow: visible;
padding-top: 0;
display: flex;
flex-direction: column;
}
.survey-container .question-list {
flex: auto;
padding-bottom: 84px;
}
.question {
position: relative;
margin-bottom: 20px;
background: rgba(255, 255, 255, 1);
}
.question-head {
overflow: hidden;
position: relative;
padding: 20px;
background: rgba(255, 255, 255, 1);
}
.question-tags {
position: absolute;
top: -2px;
}
.question-title {
position: relative;
font-size: 1.125em;
font-weight: normal;
word-wrap: break-word;
word-break: break-word;
outline: 0;
}
.question-seq {
display: block;
margin-right: 8px;
font-size: 18px;
float: left;
}
.question-title .text {
margin-right: 4px;
}
.question-body {
background-color: rgba(255, 255, 255, 1);
user-select: none;
}
.van-checkbox {
margin-right: 10px;
}
.van-cell__title {
font-size: 16px;
color: rgba(0, 0, 0, 1);
}
.page-control {
padding: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
}
.survey-head {
padding: 20px;
background: #fff;
margin-bottom: 10px;
}
.survey-head .title {
font-size: 22px;
font-weight: 600;
text-align: center;
}
.survey-head .desc {
padding: 10px;
font-size: 14px;
}
</style>
<div id="app" v-cloak>
<div class="root">
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="知识竞答" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<template v-if="!mLoading">
<div v-if="finishAnswer">
{{finishAnswer}}
<van-empty description="您已经答完该问卷">
<div>
<van-button type="info" @click="viewScore">查看成绩</van-button>
<van-button type="info" @click="viewAnswerSheet">查看答卷</van-button>
<!-- <van-button type="info" @click="answerAgain">再答一次</van-button>-->
</div>
</van-empty>
</div>
<div v-else class="page-survey" style="touch-action: manipulation;min-height: 100vh;">
<div class="survey-container">
<div class="survey-head">
<div class="title">
{{questionData.qtitle}}
</div>
<div class="desc">
{{titleMsg}}
</div>
</div>
<div class="question-list">
<section v-for="(issue,issueIdx) in issueList" :key="issue.iid" class="question"
:id="'issue'+issue.iid">
<div class="question-head">
<div class="question-tags">
<template v-if="issue.itx===1">
<van-tag :type="issue.iisdx?'primary':'warning'">{{issue.iisdx?'单选':'多选'}}
</van-tag>
</template>
<van-tag v-if="issue.fraction" type="primary">{{issue.fraction}}分</van-tag>
</div>
<h2 class="question-title">
<span class="question-seq">
<b>
{{issueIdx+1}}
</b>
</span>
<div class="text" v-html="issue.iname"></div>
</h2>
</div>
<div class="question-body">
<van-checkbox-group v-model="issue.userSelect" :ref="'checkboxGroup'+issue.iid">
<van-cell-group>
<van-cell
v-for="(item,index) in issue.wors"
clickable
:key="item"
:title="item.wtxt"
@click="toggle(issue,item.wid)"
>
<template #icon>
<van-checkbox :name="item.wid" :ref="'checkboxes'+item.wid"
:shape="issue.iisdx?'round':'square'"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</section>
</div>
<div class="page-control">
<van-button type="info" block @click="save()">保存</van-button>
<van-button type="info" block @click="submit()">提交</van-button>
</div>
</div>
</div>
</template>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
questionData: {
issues: []
},
currentIssueIndex: 0,
replyInfo: [],
finishAnswer: false,
mLoading: true
}
},
computed: {
issueList() {
return this.questionData.issues
},
titleMsg() {
debugger
const radios = this.issueList.filter(v => v.itx === 1 && v.iisdx)
const checkBoxes = this.issueList.filter(v => v.itx === 1 && !v.iisdx)
const radioScore = radios.length > 0 ? radios[0].fraction : 0
const checkBoxesScore = checkBoxes.length > 0 ? checkBoxes[0].fraction : 0
const radioScoreSum = radios.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
const checkBoxesScoreSum = checkBoxes.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
const sumScore = radioScoreSum + checkBoxesScoreSum
return "说明:单选题" + radios.length + "题,每题" + radioScore + "分,合计" + radioScoreSum + "分;多选题" + checkBoxes.length + "题,每题" + checkBoxesScore + "分,合计" + checkBoxesScoreSum + "分;总分" + sumScore + "分。"
},
fullScore() {
return this.issueList.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
radioNum() {
return this.issueList.filter(v => v.idx === 1 && v.iisdx).map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
checkBoxNum() {
}
},
methods: {
async getQuestionData() {
const resp = await $.get(BASE_URL + '/questionInfo/' + this.id)
this.questionData = resp.data
this.questionData.issues.forEach(i => {
// i.userSelect = null
})
},
toggle(issue, worId) {
//单选
if (issue.iisdx) {
vue.$refs['checkboxGroup' + issue.iid][0].toggleAll(false)
} else {
}
console.log(issue.userSelect)
this.$refs['checkboxes' + worId][0].toggle()
setTimeout(() => {
console.log(issue.userSelect)
})
},
save() {
this.$modal.confirm('保存后下次可继续做答,您确定要保存吗?').then(async () => {
const replies = this.questionData.issues.map(v => {
return {
qid: v.iid,
issueId: v.iid,
userSelect: v.userSelect,
}
})
const {code} = await $.post(BASE_URL + '/saveAnswer', {
replies: JSON.stringify(replies),
questionId: this.questionData.qid,
isSave: true
})
this.$modal.closeLoading()
if (code === 0) {
this.$modal.msg('保存成功')
} else {
this.$modal.msg('保存失败')
}
})
},
submit() {
const iids = this.questionData.issues.filter(v => !v.userSelect).map(v => v.iid)
if (iids.length > 0) {
vant.Toast('您还有' + iids.length + '题未作答,请答完后再提交!')
document.getElementById('issue' + iids[0]).scrollIntoView({behavior: 'smooth', block: 'center','inline':'start'});
return
}
const msg = '一旦提交不可修改,您确定要提交吗?'
this.$modal.confirm(msg).then(async () => {
const replies = this.questionData.issues.map(v => {
return {
qid: v.iid,
issueId: v.iid,
userSelect: v.userSelect,
}
})
const {code} = await $.post(BASE_URL + '/saveAnswer', {
replies: JSON.stringify(replies),
questionId: this.questionData.qid,
isSave: false
})
this.$modal.closeLoading()
if (code === 0) {
this.$modal.msg('提交成功')
await this.checkUserFinishAnswer()
if (this.finishAnswer) {
//查看分数
this.viewScore()
}
}
})
},
//获取回答信息
async getReply() {
const resp = await $.get(BASE_URL + '/answerInfo/' + this.id)
this.replyInfo = resp.data
},
//用户是否全部答完提交
async checkUserFinishAnswer() {
this.mLoading = true
const resp = await $.get(BASE_URL + '/checkUserFinishAnswer', {questionId: this.id})
setTimeout(async () => {
this.mLoading = false
this.finishAnswer = resp.data
if (resp.data) {
} else {
await this.getReply()
await this.assignmentAnswer()
}
}, 1000)
},
//答案赋值
assignmentAnswer() {
this.questionData.issues.forEach(issue => {
const rwids = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
rwids.forEach(rwid => {
this.toggle(issue, rwid)
})
})
},
answerAgain() {
this.finishAnswer = false
setTimeout(() => {
this.questionData.issues.forEach(issue => {
issue.wors.forEach(wor => {
this.$refs['checkboxes' + wor.wid][0].toggle(false)
})
})
}, 0)
},
viewScore() {
window.location.href = BASE_URL + '/score?id=' + this.id
},
viewAnswerSheet(){
window.location.href = BASE_URL + '/answerSheet?id=' + this.id
}
},
async created() {
this.id = GetQueryString("id")
await this.getQuestionData()
await this.checkUserFinishAnswer()
// await this.getReply()
// this.assignmentAnswer()
}
})
window.addEventListener('pageshow', async e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.id = GetQueryString("id")
await vue.getQuestionData()
await vue.checkUserFinishAnswer()
}
})
</script>
<!--#
}
#-->
@@ -1,323 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.page-survey {
background-color: rgba(242, 242, 242, 1);
}
.page-survey .survey-container {
height: 100%;
overflow: visible;
padding-top: 0;
display: flex;
flex-direction: column;
}
.survey-container .question-list {
flex: auto;
padding-bottom: 84px;
}
.question {
position: relative;
margin-bottom: 20px;
background: rgba(255, 255, 255, 1);
}
.question-head {
overflow: hidden;
position: relative;
padding: 20px;
background: rgba(255, 255, 255, 1);
}
.question-tags {
position: absolute;
top: -2px;
}
.question-title {
position: relative;
font-size: 1.125em;
font-weight: normal;
word-wrap: break-word;
word-break: break-word;
outline: 0;
}
.question-seq {
display: block;
margin-right: 8px;
font-size: 18px;
float: left;
}
.question-title .text {
margin-right: 4px;
}
.question-body {
background-color: rgba(255, 255, 255, 1);
user-select: none;
}
.van-checkbox {
margin-right: 10px;
}
.van-cell__title {
font-size: 16px;
color: rgba(0, 0, 0, 1);
}
.page-control {
padding: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
}
.survey-head {
padding: 20px;
background: #fff;
margin-bottom: 10px;
}
.survey-head .title {
font-size: 22px;
font-weight: 600;
text-align: center;
}
.survey-head .desc {
padding: 10px;
font-size: 14px;
}
@font-face {
font-family: 'Indie Flower';
font-style: normal;
font-weight: 400;
src: url(/assets/platform/fonts/m8JVjfNVeKWVnh3QMuKkFcZVaUuH.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.survey-head .score{
color: red;
font-family: 'Indie Flower', cursive;
font-size: 30px;
text-align: right;
}
.question-footer {
padding: 16px;
}
.van-checkbox--disabled .van-checkbox__icon--checked .van-icon {
color: #fff;
background-color: #1989fa;
border-color: #1989fa;
}
</style>
<div id="app" v-cloak>
<div class="page-survey" style="touch-action: manipulation;min-height: 100vh;">
<div class="survey-container">
<div class="survey-head">
<div class="title">
{{questionData.qtitle}}
</div>
<div class="desc">
{{titleMsg}}
</div>
<div class="score">
{{score}}
</div>
</div>
<div class="question-list">
<section v-for="(issue,issueIdx) in issueList" :key="issue.iid" class="question"
:id="'issue'+issue.iid">
<div class="question-head">
<div class="question-tags">
<template v-if="issue.itx===1">
<van-tag :type="issue.iisdx?'primary':'warning'">{{issue.iisdx?'单选':'多选'}}
</van-tag>
</template>
<van-tag v-if="issue.fraction" type="primary">{{issue.fraction}}分</van-tag>
</div>
<h2 class="question-title">
<span class="question-seq">
<b>
{{issueIdx+1}}
</b>
</span>
<div class="text" v-html="issue.iname"></div>
</h2>
</div>
<div class="question-body">
<van-checkbox-group v-model="issue.userSelect" :ref="'checkboxGroup'+issue.iid" disabled>
<van-cell-group>
<van-cell
v-for="(item,index) in issue.wors"
clickable
:key="item"
:title="item.wtxt"
>
<template #label>
<div>
{{item.correct?'正确答案':''}}
</div>
</template>
<template #icon>
<van-checkbox :name="item.wid" :ref="'checkboxes'+item.wid"
:shape="issue.iisdx?'round':'square'"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
<div class="question-footer" v-if="replyInfo">
<div>
<div style="display: flex;align-items: center;"
:style="{color:(issue.isEqual?'#15db81':'red')}">
{{issue.isEqual?'回答正确':'回答错误'}}
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
questionData: {
issues: []
},
currentIssueIndex: 0,
replyInfo: [],
finishAnswer: false,
mLoading: true,
score: 0
}
},
computed: {
issueList() {
return this.questionData.issues
},
titleMsg() {
// const radios = this.issueList.filter(v => v.itx === 1 && v.iisdx)
// const checkBoxes = this.issueList.filter(v => v.itx === 1 && !v.iisdx)
//
// const radioScore = radios ? radios[0].fraction : 0
// const checkBoxesScore = checkBoxes ? checkBoxes[0].fraction : 0
//
// const radioScoreSum = radios.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
// const checkBoxesScoreSum = checkBoxes.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
//
// const sumScore = radioScoreSum + checkBoxesScoreSum
//
// return "说明:单选题" + radios.length + "题,每题" + radioScore + "分,合计" + radioScoreSum + "分;多选题" + checkBoxes.length + "题,每题" + checkBoxesScore + "分,合计" + checkBoxesScoreSum + "分;总分" + sumScore + "分。"
return null
},
fullScore() {
return this.issueList.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
radioNum() {
return this.issueList.filter(v => v.idx === 1 && v.iisdx).map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
checkBoxNum() {
}
},
methods: {
async getQuestionData() {
const resp = await $.get(BASE_URL + '/questionInfo/' + this.id)
this.questionData = resp.data
},
toggle(issue, worId) {
//单选
if (issue.iisdx) {
vue.$refs['checkboxGroup' + issue.iid][0].toggleAll(false)
} else {
}
this.$refs['checkboxes' + worId][0].toggle()
},
async getReply() {
const resp = await $.get(BASE_URL + '/answerInfo/' + this.id)
this.replyInfo = resp.data
},
//用户是否全部答完提交
async checkUserFinishAnswer() {
this.mLoading = true
const resp = await $.get(BASE_URL + '/checkUserFinishAnswer', {questionId: this.id})
this.finishAnswer = resp.data
if (resp.data) {
await this.getReply()
await this.assignmentAnswer()
} else {
// await this.getReply()
// await this.assignmentAnswer()
}
},
//答案赋值
assignmentAnswer() {
this.questionData.issues.forEach(issue => {
const rwids = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
rwids.forEach(rwid => {
this.toggle(issue, rwid)
})
const wids = issue.wors.filter(v => v.correct).map(v => v.wid)
const userSelects = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
const isEqual = wids.length === userSelects.length && wids.every(value => userSelects.includes(value))
issue.isEqual = isEqual
})
},
checkIsCorrect(issue) {
const wids = issue.wors.filter(v => v.correct).map(v => v.wid)
const userSelects = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
const isEqual = wids.length === userSelects.length && wids.every(value => userSelects.includes(value))
return isEqual
},
async getScore() {
const resp = await $.get(BASE_URL + '/getScore', {questionId: this.id})
this.score = resp.data.score
},
},
async created() {
this.id = GetQueryString("id")
await this.getScore()
await this.getQuestionData()
await this.checkUserFinishAnswer()
}
})
</script>
<!--#
}
#-->
@@ -1,163 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.transcript-container {
background-image: url(/assets/mobile/img/question/score.jpg);
background-size: 100% 100%;
min-height: 100%;
padding: 15px;
width: 100%;
max-width: 1128px;
box-sizing: border-box;
height: 100vh;
}
.transcript-header {
margin-bottom: 15px;
flex-direction: column;
text-align: center;
display: flex;
justify-content: space-between;
align-items: center;
color: #fff;
}
.score-detail-group {
align-self: stretch;
background: rgba(255, 255, 255, 0.01);
-webkit-backdrop-filter: blur(50px);
backdrop-filter: blur(50px);
border-radius: 20px;
padding: 20px 0;
margin: 20px 0 0 0 !important;
border: 1px solid rgba(255, 255, 255, 0.1);
flex: none;
text-align: center;
}
.score-total {
margin: 40px 0;
transform: translate3d(0px, 0px, 0px);
display: flex;
align-items: stretch;
justify-content: center;
height: 120px;
line-height: 1;
}
.score-number {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 20px;
}
.score-text-title {
font-size: 16px;
font-weight: 600;
line-height: 32px;
margin-bottom: 30px;
color: #FFFFFF;
}
.score-text-info {
font-size: 32px;
font-weight: 600;
line-height: 50px;
}
.total-number {
font-size: 64px;
min-width: 100px;
}
.total-percent {
margin-top: 10px;
font-size: 20px;
}
</style>
<div id="app">
<van-nav-bar title="知识竞答分数" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<div class="transcript-container">
<div class="transcript-header transcript-header-mobile">
<div class="score-text-container">
<div class="score-text-title">
{{title}}
</div>
<div class="score-text-info">
{{message}}
<!-- <ul>-->
<!-- <li>姓名:{{user.username}}</li>-->
<!-- <li>工号:{{user.loginname}}</li>-->
<!-- <li>单位:{{user.unitname}}</li>-->
<!-- <li>工会:{{user.unionname}}</li>-->
<!-- </ul>-->
</div>
</div>
<div class="score-detail-group">
<div class="score-total" style="transform: translate3d(0px, 0px, 0px);">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 88 188">
<path fill="#fff"
d="M41.035 41.216c1.313-.407 2.5-.657 3.844-.875 2.812-.438 5.687-.438 8.437-.094a21.44 21.44 0 01-3.188 5.25s-.125.125-.125.156c-5.468 6.062-11.999 8.78-20.123 8.75-.625-7.25 4.968-11.125 11.155-13.187zM25.63 76.244c-2.281-8.999 5.062-14.561 12.562-17.436 2.75-.937 5.655-1.437 8.53-1.625C44.38 66.87 35.223 74.682 25.63 76.244zm1.844 9.562c2.218-3.25 4.562-5.25 7.905-7.28 2.594-1.532 5.406-2.657 8.312-3.406-.656 10.53-7.78 19.998-17.623 24.06-2.375-4.75-1.25-9.03 1.406-13.374zm3.687 35.06c-5.75-7.843-.531-16.311 5.53-22.06 2.313-2.032 4.907-3.72 7.688-5.063 1.28 10.499-4.344 21.717-13.218 27.123zm9.28 19.717c-7.218-6.718-3.468-16.155 1.532-22.935 1.968-2.438 4.28-4.594 6.812-6.5 3.156 10.124-.656 22.467-8.343 29.435zm7.781.438c.625-2.406 1.406-4.312 2.563-6.5 1.5-2.812 3.437-5.406 5.624-7.749a24.494 24.494 0 012.25 6.249c1.937 8.75.125 17.812-4.906 25.186-6.25-3.906-6.874-10.499-5.53-17.186zm22.218 31.748c-9.75-3.969-9.906-14.562-7.594-23.374.969-3.187 2.375-6.187 4.125-8.968 6.718 8.656 8.093 22.592 3.468 32.342zM38.504 34.216c.938-8.655 9.437-10.999 16.936-11.03 2.782.093 5.5.625 8.156 1.437a22.477 22.477 0 01-3.968 4.469c-5.656 4.843-13.874 6.78-21.124 5.124zm7.031-16.155c7.562.219 12.687-4.874 15.686-11.343 1-2.125 1.75-4.406 2.313-6.718-2.438.062-4.844.469-7.156 1.281-6.937 2.437-12.937 9-10.843 16.78zM25.63 33.591c-.406-1.375-.812-2.718-1.312-4.062-1.032-2.906-2.313-5.75-3.719-8.468a28.868 28.868 0 00-3.843 7.812c-2.813 8.968-.531 18.123 7.218 23.686 4.593-5.75 3.468-12.343 1.656-18.968zm-6.25 42.091c3.969-7.562-.718-17.28-4.874-23.717a63.492 63.492 0 00-5.656-7.562C4.257 55.653 6.975 71.12 19.38 75.682zm-2.687 10.124c-2.156-3.53-4.437-6.25-7.312-9.218-2.28-2.312-4.718-4.5-7.312-6.468-.812 5.03-.375 10.905 1.469 15.686 3.156 7.75 7.812 12.75 16.28 14.155 1.125-5.374-.5-9.53-3.125-14.155zm8.5 37.154c.156-8.843-9.03-16.155-15.718-20.436a73.267 73.267 0 00-8.812-4.875 33.031 33.031 0 002.125 9.624c3.594 9.281 11.937 16.874 22.405 15.687zm9.843 20.904c-1.844-8.78-12.656-13.842-20.249-16.53a77.954 77.954 0 00-9.843-2.749 32.908 32.908 0 004.281 8.968c5.718 8.405 15.718 13.874 25.81 10.311zm-2.626 7.656c-2.53-.594-4.936-1-7.53-1.312-3.468-.407-6.968-.563-10.405-.532a33.547 33.547 0 006.25 7.969c.124.125.937.906 1.03.937 8.437 6.75 17.437 9.437 27.342 3.937-3.5-6.655-9.75-9.093-16.686-10.999zm34.373 26.436c-5.937-7.469-18.53-7.781-27.185-7.031a72.233 72.233 0 00-10.624 1.656 36.742 36.742 0 008.249 6.812c9.187 5.468 21.436 6.562 29.56-1.437zM33.067 31.216c6.593-4.593 6.468-14.811 5.53-21.904A60.312 60.312 0 0036.818.5c-8.75 7.843-12.25 21.905-3.75 30.717z"></path>
<path fill="#fff"
d="M33.629 37.56c3.5-7.219 7.062-13 11.843-19.405-5.031 6.28-8.718 11.968-12.468 19.123-8.124 16.5-11.405 30.154-11.905 48.56.312 23.748 5.374 41.184 17.967 61.276 13.062 18.999 26.654 30.592 47.528 40.435.469-1.063.937-2.125 1.406-3.156-20.342-9.437-33.623-20.561-46.528-38.904-12.561-19.53-17.748-36.497-18.467-59.683.125-18.186 3.093-31.716 10.624-48.246z"></path>
</svg>
<div class="score-number">
<div class="total-number">{{score}}分</div>
<div v-if="answerCount>1" class="total-percent">历史最高分:{{maxScore}}</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 88 188"
style="transform: rotateY(180deg);">
<path fill="#fff"
d="M41.035 41.216c1.313-.407 2.5-.657 3.844-.875 2.812-.438 5.687-.438 8.437-.094a21.44 21.44 0 01-3.188 5.25s-.125.125-.125.156c-5.468 6.062-11.999 8.78-20.123 8.75-.625-7.25 4.968-11.125 11.155-13.187zM25.63 76.244c-2.281-8.999 5.062-14.561 12.562-17.436 2.75-.937 5.655-1.437 8.53-1.625C44.38 66.87 35.223 74.682 25.63 76.244zm1.844 9.562c2.218-3.25 4.562-5.25 7.905-7.28 2.594-1.532 5.406-2.657 8.312-3.406-.656 10.53-7.78 19.998-17.623 24.06-2.375-4.75-1.25-9.03 1.406-13.374zm3.687 35.06c-5.75-7.843-.531-16.311 5.53-22.06 2.313-2.032 4.907-3.72 7.688-5.063 1.28 10.499-4.344 21.717-13.218 27.123zm9.28 19.717c-7.218-6.718-3.468-16.155 1.532-22.935 1.968-2.438 4.28-4.594 6.812-6.5 3.156 10.124-.656 22.467-8.343 29.435zm7.781.438c.625-2.406 1.406-4.312 2.563-6.5 1.5-2.812 3.437-5.406 5.624-7.749a24.494 24.494 0 012.25 6.249c1.937 8.75.125 17.812-4.906 25.186-6.25-3.906-6.874-10.499-5.53-17.186zm22.218 31.748c-9.75-3.969-9.906-14.562-7.594-23.374.969-3.187 2.375-6.187 4.125-8.968 6.718 8.656 8.093 22.592 3.468 32.342zM38.504 34.216c.938-8.655 9.437-10.999 16.936-11.03 2.782.093 5.5.625 8.156 1.437a22.477 22.477 0 01-3.968 4.469c-5.656 4.843-13.874 6.78-21.124 5.124zm7.031-16.155c7.562.219 12.687-4.874 15.686-11.343 1-2.125 1.75-4.406 2.313-6.718-2.438.062-4.844.469-7.156 1.281-6.937 2.437-12.937 9-10.843 16.78zM25.63 33.591c-.406-1.375-.812-2.718-1.312-4.062-1.032-2.906-2.313-5.75-3.719-8.468a28.868 28.868 0 00-3.843 7.812c-2.813 8.968-.531 18.123 7.218 23.686 4.593-5.75 3.468-12.343 1.656-18.968zm-6.25 42.091c3.969-7.562-.718-17.28-4.874-23.717a63.492 63.492 0 00-5.656-7.562C4.257 55.653 6.975 71.12 19.38 75.682zm-2.687 10.124c-2.156-3.53-4.437-6.25-7.312-9.218-2.28-2.312-4.718-4.5-7.312-6.468-.812 5.03-.375 10.905 1.469 15.686 3.156 7.75 7.812 12.75 16.28 14.155 1.125-5.374-.5-9.53-3.125-14.155zm8.5 37.154c.156-8.843-9.03-16.155-15.718-20.436a73.267 73.267 0 00-8.812-4.875 33.031 33.031 0 002.125 9.624c3.594 9.281 11.937 16.874 22.405 15.687zm9.843 20.904c-1.844-8.78-12.656-13.842-20.249-16.53a77.954 77.954 0 00-9.843-2.749 32.908 32.908 0 004.281 8.968c5.718 8.405 15.718 13.874 25.81 10.311zm-2.626 7.656c-2.53-.594-4.936-1-7.53-1.312-3.468-.407-6.968-.563-10.405-.532a33.547 33.547 0 006.25 7.969c.124.125.937.906 1.03.937 8.437 6.75 17.437 9.437 27.342 3.937-3.5-6.655-9.75-9.093-16.686-10.999zm34.373 26.436c-5.937-7.469-18.53-7.781-27.185-7.031a72.233 72.233 0 00-10.624 1.656 36.742 36.742 0 008.249 6.812c9.187 5.468 21.436 6.562 29.56-1.437zM33.067 31.216c6.593-4.593 6.468-14.811 5.53-21.904A60.312 60.312 0 0036.818.5c-8.75 7.843-12.25 21.905-3.75 30.717z"></path>
<path fill="#fff"
d="M33.629 37.56c3.5-7.219 7.062-13 11.843-19.405-5.031 6.28-8.718 11.968-12.468 19.123-8.124 16.5-11.405 30.154-11.905 48.56.312 23.748 5.374 41.184 17.967 61.276 13.062 18.999 26.654 30.592 47.528 40.435.469-1.063.937-2.125 1.406-3.156-20.342-9.437-33.623-20.561-46.528-38.904-12.561-19.53-17.748-36.497-18.467-59.683.125-18.186 3.093-31.716 10.624-48.246z"></path>
</svg>
</div>
</div>
</div>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
score: 0,
maxScore: 0,
title: null,
user: {},
message: null,
answerCount: 0,
questionId: null,
}
},
methods: {
async getScore() {
const resp = await $.get(BASE_URL + '/getScore', {questionId: this.questionId})
this.score = resp.data.score
this.maxScore = resp.data.maxScore
this.title = resp.data.title
this.user = resp.data.user
this.answerCount = resp.data.answerCount
this.message = resp.data.message
},
},
created() {
this.questionId = GetQueryString("id")
this.getScore()
}
})
</script>
<!--#
}
#-->
@@ -86,13 +86,14 @@ layout("/mobile/platform.html"){
width: 100%;
background: transparent;
}
.winPopup img{
.winPopup img {
transform: translateY(-50%);
position: absolute;
top: 50%;
}
.winPopup .van-popup__close-icon{
.winPopup .van-popup__close-icon {
}
@@ -107,7 +108,7 @@ layout("/mobile/platform.html"){
width: 100%;
}
.win_tag{
.win_tag {
position: relative;
top: 16px;
left: 5px;
@@ -138,19 +139,25 @@ layout("/mobile/platform.html"){
<div class="quizzes-item-info-v">
<div class="quizzes-item-info-title">{{ item.qtitle }}</div>
<div class="quizzes-item-info-right">
<span class="quizzes-item-info-tip">创建时间:</span>
<span class="quizzes-item-info-tip">活动开始时间:</span>
<span class="quizzes-item-info-text">
{{ moment(item.createTime).format('YYYY年MM月DD日') }}
{{ moment(item.startTime).format('YYYY年MM月DD日') }}
</span>
</div>
<div class="quizzes-item-info-right" v-if="item.qlx!==4">
<span class="quizzes-item-info-tip">题目数量:</span>
<div class="quizzes-item-info-right">
<span class="quizzes-item-info-tip">活动结束时间:</span>
<span class="quizzes-item-info-text">
{{item.ctMode === 1 ? item.topicTotal : item.ctNum }}
</span>
<span class="quizzes-item-info-text" style="position: absolute;right: 0" >
<van-tag @click.stop="showWinInfo(item)" type="primary" class="win_tag" v-if="item.qlx===2 && item.isRaffle && moment(item.startTime).diff(moment(new Date().getTime()),'days') < 0">获奖信息</van-tag>
<!-- v-if="moment(item.startTime).diff(moment(new Date().getTime()),'days') < 0"-->
{{ moment(item.endTime).format('YYYY年MM月DD日') }}
</span>
</div>
<div class="quizzes-item-info-right" v-if="item.isRaffle">
<!-- <span class="quizzes-item-info-tip">题目数量:</span>-->
<!-- <span class="quizzes-item-info-text">-->
<!-- {{item.ctMode === 1 ? item.topicTotal : item.ctNum }}-->
<!-- </span>-->
<span class="quizzes-item-info-text" style="position: absolute;right: 0;bottom: 0">
<van-tag @click.stop="showWinInfo(item)" type="primary" class="win_tag"
v-if="item.qlx===2 && item.isRaffle && moment().isAfter(moment('2024-06-18 00:05:00'))">获奖信息</van-tag>
</span>
</div>
</div>
@@ -166,17 +173,22 @@ layout("/mobile/platform.html"){
<van-popup v-model="winPopupShow" class="winPopup"
:style="{ height: '100%' }"
>
>
<div style="display: flex;align-items: center">
<img v-if="isWin" width="100%" height="60%" src="/assets/mobile/img/question/win.png"/>
<!-- <img v-if="!isWin" width="100%" height="50%" src="/assets/mobile/img/question/noWin1.png"/>-->
<img v-if="!isWin" width="100%" height="50%" src="https://img1.baidu.com/it/u=3192248910,26901819&fm=253&fmt=auto&app=138&f=JPEG?w=403&h=500"/>
<img v-if="!isWin" width="100%" height="50%"
src="/assets/mobile/img/question/noWin1-removebg-preview.png"/>
</div>
<div class="iconDiv">
<div v-if="isWin" style="font-size: 14px;!important;">恭喜您中奖了,本次活动中奖机会只有一次喔!</div>
<van-icon @click="winPopupShow = false" name="close"></van-icon>
</div>
</van-popup>
<van-dialog v-model="tipShow" title="提示">
<div>活动期间,每天答题次数不限,每天答题的最终成绩取最高分。每天答题得90分(含)以上者,可参加线上抽奖活动。</div>
<div>6月17日至6月23日每天线上抽取“幸运奖”100名'。</div>
</van-dialog>
</div>
</div>
@@ -193,8 +205,10 @@ layout("/mobile/platform.html"){
queryForm: {
status: '1'
},
winPopupShow:false,
isWin:false
winPopupShow: false,
isWin: false,
tipShow:false
}
},
created() {
@@ -270,6 +284,7 @@ layout("/mobile/platform.html"){
async openAnswer(item) {
const {qid, qlx, qflag, activityUserScopeId} = item
if (qflag !== 2) {
this.$modal.msg('该问卷未发布')
return
@@ -289,12 +304,38 @@ layout("/mobile/platform.html"){
}
}
if (qid === '827cc4ef9cde47ed97bc21f6be75f91a') {
this.$dialog.alert({
title:'提示',
messageAlign:'left',
message: '<div style="text-indent: 2em;">活动期间,每天答题次数不限,每天答题的最终成绩取最高分。每天答题得90分(含)以上者,可参加线上抽奖活动。<div>' +
'<div style="text-indent: 2em;">6月17日至6月23日每天线上抽取“幸运奖”100名。</div>'+
'<div style="text-indent: 2em;">答题并提交成功后,可于次日查看获奖信息。</div>'
,
}).then(()=>{
if (qlx === 1) {
//调查
location.href = '/mobile/question/h5/poll/index?id=' + qid
} else if (qlx === 2) {
//答题
location.href = '/mobile/question/h5/answer/index?id=' + qid
} else if (qlx === 3) {
//购物
location.href = '/mobile/question/h5/shop/index?id=' + qid
} else if (qlx === 4) {
//蛋糕卡
location.href = '/mobile/question/h5/cake/index?id=' + qid
}
})
return
}
if (qlx === 1) {
//调查
location.href = '/mobile/question/h5/poll/index?id=' + qid
} else if (qlx === 2) {
//答题
location.href = '/mobile/question/h5/answer/index_ctgu?id=' + qid
location.href = '/mobile/question/h5/answer/index?id=' + qid
} else if (qlx === 3) {
//购物
location.href = '/mobile/question/h5/shop/index?id=' + qid
@@ -344,4 +385,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -58,7 +58,7 @@ layout("/mobile/platform.html"){
margin-bottom: 1rem;
padding: 10px;
border-radius: 10px;
/*box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);*/
box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);
position: relative;
}
@@ -143,7 +143,7 @@ layout("/mobile/platform.html"){
right: 0;
max-height: 64px;
background-color: #FFF;
/*box-shadow: 0 0 20px rgb(230, 230, 230);*/
box-shadow: 0 0 20px rgb(230, 230, 230);
z-index: 999;
padding: 10px 20px;
display: flex;
@@ -324,17 +324,6 @@ layout("/mobile/platform.html"){
})
},
submitAnswer() {
const v1 = this.issueList.some(v => v.itx === 1 && v.iisbd && v.rwid == null)
if (v1) {
this.$modal.msg('请选择后再提交')
return
}
const v2 = this.issueList.some(v => v.itx === 2 && v.iisbd && (v.rval == null || v.rval === ''))
if (v2) {
this.$modal.msg('请填写后再提交')
return
}
const formData = this.formatFormData()
formData.forEach(v => v.save = false)
this.$modal.confirm('您确定要提交吗?提交后不能修改!').then(() => {
@@ -0,0 +1,502 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.middle-subject {
width: 100%;
height: 100vh;
background-color: #f6f7f9;
position: relative;
}
.middle-subject-info-padding {
padding: 10px;
background-color: #f6f7f9;
}
.middle-subject-info-scroll {
/*height: 100%;*/
height: calc(100vh - 110px);
max-height: calc(100vh - 110px);
overflow-y: scroll;
}
.middle-subject-info-head {
text-align: center;
}
.middle-subject-topic-icon {
width: 30px;
padding: 2px;
font-size: 10px;
background-color: #1678ff;
color: #fff;
text-align: center;
border-radius: 0 0 5px 5px;
position: absolute;
top: 0;
right: 10px;
}
.middle-subject-title {
margin-bottom: 1rem;
font-weight: bolder;
font-size: 16px;
}
.middle-subject-other {
color: #909399;
font-size: 13px;
display: flex;
justify-content: space-around;
margin-bottom: 1rem;
}
.middle-subject-topic {
background-color: #FFFFFF;
margin-bottom: 1rem;
padding: 10px;
border-radius: 10px;
box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);
position: relative;
}
.middle-subject-topic-title {
font-weight: bolder;
}
.middle-subject-topic-submit {
margin-top: 30px;
margin-bottom: 30px;
text-align: center;
}
.middle-subject-topic-desc {
color: rgb(160, 160, 160);
text-align: left;
margin-left: 20px;
font-size: 12px;
margin-bottom: 10px;
padding: 20px 0;
}
.itx_field {
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #606266;
display: inline-block;
font-size: inherit;
height: 40px;
line-height: 40px;
outline: none;
padding: 0 15px;
transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
width: 100%;
}
.middle-subject-topic-submit .u-btn {
width: 60%;
}
.middle-subject-info-search {
position: absolute;
bottom: 45%;
right: 0;
height: 40px;
z-index: 999;
background-color: #FFF;
box-shadow: 0 0 20px rgb(230, 230, 230);
border-radius: 20px 0 0 20px;
}
.middle-subject-info-search-icon {
height: 40px;
width: 40px;
box-shadow: 0 0 10px #1678ff;
border-radius: 20px 0 0 20px;
background-color: #FFF;
display: flex;
justify-content: center;
align-items: center;
}
.middle-subject-info-search-info {
padding: 0 10px;
display: flex;
height: inherit;
z-index: 999;
align-items: center;
box-shadow: 0 0 10px #1678ff;
border-radius: 20px 0 0 20px;
background-color: #FFF;
}
.middle-subject-info-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
max-height: 64px;
background-color: #FFF;
box-shadow: 0 0 20px rgb(230, 230, 230);
z-index: 999;
padding: 10px 20px;
display: flex;
}
.middle-subject-info-footer-save {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.middle-subject-info-footer-save .van-button {
/*width: 40%;*/
width: calc((100% - 100px) / 2);
}
.middle-subject-info-footer-pagination {
display: flex;
justify-content: space-between;
align-items: center;
width: 70%;
}
.van-radio__label {
width: 100%;
}
.totalMoney {
width: 80px;
max-width: 80px;
white-space: nowrap;
overflow: hidden;
overflow-x: scroll;
color: red;
font-size: 20px;
}
</style>
<div id="app" v-cloak>
<div class="middle-subject">
<van-nav-bar title="在线调查" left-arrow
@click-left="history.back()"></van-nav-bar>
<div class="middle-subject-info">
<div class="middle-subject-info-scroll">
<div class="middle-subject-info-padding">
<div class="middle-subject-info-head">
<div class="middle-subject-title">{{ questionData.qtitle }}</div>
<div class="middle-subject-other">
<template v-if="questionData.qlx!==3">
<!-- <span>创建人:{{ questionData.username }}</span>-->
<!-- <span>总题数:{{ issueList.length }}</span>-->
</template>
</div>
</div>
<div class="middle-subject-info-body">
<div class="middle-subject-topic" v-for="(issue,issueIndex) in issueList" :key="issue.qid">
<div v-if="!issue.iisdx" class="middle-subject-topic-icon">
<span>多选</span>
</div>
<div style="margin-bottom: 10px">
<span v-if="issue.iisbd" style="color: red;">*</span>
<span class="middle-subject-topic-title">
{{ issueIndex + 1 }}.
{{ removeHTMLTag(issue.iname) }}
<span v-if="issue.iminselect">(最少选择:{{issue.iminselect}})</span>
<span v-if="issue.imaxselect">(最多选择:{{issue.imaxselect}})</span>
<div v-if="issue.its" class="middle-subject-topic-desc"
style="margin-left: 17px;font-size: 12px;font-weight: 500;">
{{ issue.its }}
</div>
</span>
</div>
<!-- 选择题 -->
<template v-if="issue.itx===1">
<!-- 单选题 -->
<van-radio-group v-if="issue.iisdx" v-model="issue.rwid" :disabled="replyFinish">
<div v-for="(wor,worIndex) in issue.wors" :key="wor.wid">
<van-radio :ref="wor.wid" :name="wor.wid">
{{ letterList[worIndex] }}.&ensp;{{ wor.wtxt }}
</van-radio>
<div class="middle-subject-topic-desc">
<van-row gutter="16">
<van-col span="8" v-if="wor.wimg">
<image style="height: 80px;width: 80px" :src="wor.wimg"
mode="aspectFit">
</image>
</van-col>
<van-col span="16" v-if="wor.wsm">
{{ wor.wsm }}
</van-col>
</van-row>
<van-row style="margin-top: 10px;">
<van-col :span="8"
style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565">
单价:¥{{ wor.price }}
</van-col>
<van-col :span="16" style="display: flex;justify-content: right"
v-if="issue.rwid === wor.wid">
<view style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565;">
数量:
</view>
<van-stepper v-model="wor.number" :disabled="replyFinish" integer
disable-input :default-value="0"
:min="0"></van-stepper>
</van-col>
</van-row>
</div>
</div>
</van-radio-group>
<!-- 多选题 -->
<van-checkbox-group v-else-if="!issue.iisdx" v-model="issue.rwid"
:disabled="replyFinish"
:max="issue.imaxselect ? issue.imaxselect:0">
<div v-for="(wor,worIndex) in issue.wors" :key="wor.wid">
<van-checkbox :ref="wor.wid" :name="wor.wid" shape="square">
{{ letterList[worIndex] }}.&ensp;{{ wor.wtxt }}
</van-checkbox>
<div class="middle-subject-topic-desc">
<van-row gutter="16">
<van-col span="8" v-if="wor.wimg">
<image style="height: 80px;width: 80px" :src="wor.wimg"
mode="aspectFit">
</image>
</van-col>
<van-col span="16" v-if="wor.wsm">
{{ wor.wsm }}
</van-col>
</van-row>
<van-row style="margin-top: 10px;">
<van-col :span="8"
style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565">
单价:¥{{ wor.price }}
</van-col>
<van-col :span="16" style="display: flex;justify-content: right"
v-if="issue.rwid && issue.rwid.includes(wor.wid)">
<view style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565;">
数量:
</view>
<van-stepper v-model="wor.number" :disabled="replyFinish" integer
disable-input :default-value="0"
:min="0"></van-stepper>
</van-col>
</van-row>
</div>
</div>
</van-checkbox-group>
</template>
<!-- 填空题 -->
<template v-if="issue.itx===2">
<van-field v-model="issue.rval" type="text" border
class="itx_field"
cursor-spacing="100"
:show-confirmbar="false"
:disabled="replyFinish" :auto-height="true" maxlength="2000"></van-field>
</template>
</div>
</div>
</div>
</div>
<div class="middle-subject-info-footer">
<div class="middle-subject-info-footer-save">
<div class="totalMoney">
¥{{ totalMoney }}
</div>
<van-button size="medium" type="primary" @click="saveAnswer" :disabled="replyFinish">
保存
</van-button>
<van-button size="medium" type="info" :disabled="replyFinish" @click="submitAnswer">
提交
</van-button>
</div>
</div>
</div>
</div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
id: null,
questionData: {},
issueList: [],
replyInfo: []
}
},
computed: {
letterList() {
const alphabet = Array.from(new Array(26), (ele, index) => {
return String.fromCharCode(65 + index);
})
return alphabet
},
replyFinish() {
return this.replyInfo.some(v => !v.save)
},
totalMoney() {
let sum = 0
this.issueList.forEach(v => {
if (v.itx === 1 && v.iisdx && v.rwid) {
//单选
const sel = v.wors.find(w => w.wid === v.rwid)
sum += sel.number * sel.price
} else if (v.itx === 1 && !v.iisdx && v.rwid) {
//多选
sum += v.wors.filter(w => v.rwid.includes(w.wid)).map(w => isNaN(w.price * w.number) ? 0 : w.price * w.number).reduce((a, b) => a + b, 0)
}
})
return sum
}
},
methods: {
async getQuestionData() {
const resp = await $.get('/mobile/question/h5/questionInfo/' + this.id)
this.questionData = resp.data
this.issueList = this.questionData && this.questionData.issues
},
saveAnswer() {
const formData = this.formatFormData(true)
if (formData.length === 0) {
this.$modal.msg('请先选择后再保存')
return
}
if (formData.some(v => v.number === 0)) {
this.$modal.msg('最少选择一项')
return
}
this.$modal.loading('保存中')
$.post('/mobile/question/h5/saveAnswer', {repliesArray: JSON.stringify(formData)}).then(res => {
this.$modal.closeLoading()
if (res.code === 0) {
this.$modal.msg('保存成功')
this.getReply()
} else {
this.$modal.msg('保存失败')
}
})
},
submitAnswer() {
const formData = this.formatFormData(false)
if (formData.length === 0) {
this.$modal.msg('请先选择后再提交')
return
}
if (formData.some(v => v.number === 0)) {
this.$modal.msg('最少选择一项')
return
}
this.$modal.confirm('您确定要提交吗?提交后不能修改!').then(() => {
this.$modal.loading('提交中')
$.post('/mobile/question/h5/saveAnswer', {repliesArray: JSON.stringify(formData)}).then(res => {
this.$modal.closeLoading()
if (res.code === 0) {
this.$modal.msg('提交成功')
this.getReply()
} else {
this.$modal.msg('提交失败')
}
})
})
},
//格式化提交数据
formatFormData(save) {
const formData = []
this.issueList.forEach(v => {
if (v.itx === 1 && v.iisdx) {
//单选
if (v.rwid) {
formData.push({
"rwid": v.rwid,
"qid": this.questionData.qid,
"issueId": v.iid,
"number": v.wors.find(w => w.wid === v.rwid).number,
"save": save
})
}
} else if (v.itx === 1 && !v.iisdx) {
//多选
if (v.rwid) {
v.rwid.forEach(r => {
formData.push({
"rwid": r,
"qid": this.questionData.qid,
"issueId": v.iid,
"number": v.wors.find(w => w.wid === r).number,
"save": save
})
})
}
} else if (v.itx === 2) {
if (v.rval) {
formData.push({
"rval": v.rval,
"qid": this.questionData.qid,
"issueId": v.iid,
"save": save
})
}
}
})
return formData
},
//获取回答信息并赋值
async getReply() {
const resp = await $.get('/mobile/question/h5/answerInfo/' + this.id)
this.replyInfo = resp.data
this.issueList.forEach((issue, issueIndex) => {
if (issue.itx === 1 && issue.iisdx) {
//单选
const rw = this.replyInfo.find(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rwid', rw ? rw.rwid : null)
if (rw) {
const worIndex = issue.wors.findIndex(v => v.wid === rw.rwid)
this.$set(this.issueList[issueIndex]['wors'][worIndex], 'number', rw ? rw.number : 0)
}
} else if (issue.itx === 1 && !issue.iisdx) {
//多选
const rws = this.replyInfo.filter(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rwid', rws ? rws.map(v => v.rwid) : [])
if (rws) {
rws.forEach(rw => {
const worIndex = issue.wors.findIndex(v => v.wid === rw.rwid)
this.$set(issue.wors[worIndex], 'number', rw ? rw.number : 0)
})
}
} else if (issue.itx === 2) {
//填空题
const rw = this.replyInfo.find(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rval', rw ? rw.rval : null)
}
})
}
},
async created() {
this.id = GetQueryString("id")
await this.getQuestionData()
await this.getReply()
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,229 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.cus_icon {
font-size: 34px;
cursor: pointer;
}
.el-icon-circle-plus {
color: #236eb4;
}
.el-icon-remove {
color: #f56c6c;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<template #header>
<h3 style="color: #1867b0">发起会议</h3>
</template>
<el-tabs type="card" v-model="activeName">
<el-tab-pane label="会议基础信息" name="first">
<template>
<vi-title title="会议基础信息"></vi-title>
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="会议名称" prop="meetingName">
<el-input placeholder="请填写会议名称" type="text"
v-model.trim="formData.meetingName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="会议地点" prop="meetingAddress">
<el-input placeholder="请填写会议地点" type="text"
v-model.trim="formData.meetingAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="会议类型" prop="typeId">
<el-select filterable placeholder="请选择会议类型" style="width: 100%"
v-model="formData.typeId">
<el-option :label="item.meetingTypeName" :value="item.id"
v-for="item in meetingTypeList"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="会议时间" prop="meetingTime">
<el-date-picker end-placeholder="结束日期"
format="yyyy-MM-dd"
range-separator="至" start-placeholder="开始日期" style="width: 100%"
type="daterange"
v-model="formData.meetingTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="formData.isMsgNotify === '1' ? '6' : '12'">
<el-form-item label="是否消息通知" prop="isMsgNotify">
<el-radio border label="1" size="medium" v-model="formData.isMsgNotify">是
</el-radio>
<el-radio border label="2" size="medium" v-model="formData.isMsgNotify">否
</el-radio>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.isMsgNotify === '1'">
<el-form-item label="发送方式" prop="sendType">
<el-checkbox-group size="medium" v-model="formData.sendType">
<el-checkbox border label="msg">短信发送</el-checkbox>
<el-checkbox border label="WeChat">微信发送</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否可以请假" prop="isCanLeave">
<el-radio border label="yes" size="medium" v-model="formData.isCanLeave">允许
</el-radio>
<el-radio border label="no" size="medium" v-model="formData.isCanLeave">不允许
</el-radio>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.isCanLeave === 'yes'">
<el-form-item label="请假截止时间" prop="leaveDeadline">
<el-date-picker format="yyyy-MM-dd" placeholder="请选择日期" style="width: 100%"
type="date"
v-model="formData.leaveDeadline"
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex" v-if="formData.isMsgNotify === '1'">
<el-col :span="24">
<el-form-item label="消息内容" prop="msgContent">
<el-input :rows="4" placeholder="请输入消息内容" type="textarea"
v-model="formData.msgContent"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="24">
<el-form-item label="会议描述" prop="meetingDescribe">
<el-input :rows="4" placeholder="请输入会议描述" type="textarea"
v-model="formData.meetingDescribe"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</el-tab-pane>
<el-tab-pane label="参与人员信息" name="second">
<template>
<vi-title title="参与人员信息"></vi-title>
<el-table :data="userTableData" style="width: 100%; margin-bottom: 20px">
<el-table-column label="用户名" prop="stateName"></el-table-column>
<el-table-column label="姓名" prop="reviewer"></el-table-column>
<el-table-column label="性别" prop="reviewer"></el-table-column>
<el-table-column label="所属单位" prop="reviewer"></el-table-column>
<el-table-column label="院级工会" prop="reviewer"></el-table-column>
</el-table>
</template>
</el-tab-pane>
</el-tabs>
<el-row justify="end" style="margin-top: 20px" type="flex">
<el-button @click="doSubmit" type="primary">提交</el-button>
</el-row>
</el-card>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
meetingTypeList: [],
activeName: 'first',
formData: {isMsgNotify: '2', sendType: [], isCanLeave: 'no'},
userTableData: [],
tableData: [{stateName: '', auditStateUserList: []}],
formRules: {
meetingName: [{required: true, message: '请填写会议名称', trigger: ['blur', 'change']}],
meetingAddress: [{required: true, message: '请填写会议地点', trigger: ['blur', 'change']}],
typeId: [{required: true, message: '请选择会议类型', trigger: ['blur', 'change']}],
meetingTime: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
sendType: [{required: true, message: '请选择发送方式', trigger: ['blur', 'change']}],
msgContent: [{required: true, message: '请填写消息内容', trigger: ['blur', 'change']}],
leaveDeadline: [{required: true, message: '请选择请假截止时间', trigger: ['blur', 'change']}],
},
userList: [],
}
},
methods: {
async doSubmit() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
if (this.formData.isCanLeave === 'yes') {
for (const [index, item] of this.tableData.entries()) {
if (item.stateName === '' || item.stateName === undefined) {
this.$notify({title: '警告', message: '第' + (index + 1) + '条审核节点名称不能为空', type: 'warning'})
return
}
if (item.auditStateUserList.length === 0) {
console.log(item.auditStateUserList)
this.$notify({title: '警告', message: '第' + (index + 1) + '条审核人不能为空', type: 'warning'})
return
}
}
}
//开始提交
const submitFormData = clone(this.formData)
submitFormData.startTime = this.formData.meetingTime && this.formData.meetingTime.length > 0 ? this.formData.meetingTime[0] : ''
submitFormData.endTime = this.formData.meetingTime && this.formData.meetingTime.length > 1 ? this.formData.meetingTime[1] : ''
delete submitFormData.meetingTime
submitFormData.meetingUserList = this.userTableData
const {code} = await $.post(loc() + "/doAdd", {
meetingInfo: JSON.stringify(submitFormData)
})
if (code === 0) {
this.$notify({title: '成功', message: '提交成功', type: 'success'})
}
}
},
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
},
watch: {
'tableData': {
handler: function (newValue, oldValue) {
},
deep: true,
}
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,422 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.audit-userids-select .el-select__tags {
flex-wrap: unset;
overflow: auto;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<table-tool :app="this" label="类型列表">
<template #func>
<el-button @click="openAdd" size="small" type="primary">新增类型</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize"
@sort-change="pageOrder" class="vi-table"
row-key="id" style="width: 100%">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
min-width="50"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
<el-table-column label="操作">
<template scope="{row}">
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<template #edit>
<vi-title title="基础信息"></vi-title>
<el-form :model="formData" :rules="formRules" label-width="80px" ref="form">
<el-form-item label="名称" prop="meetingTypeName">
<el-input v-model="formData.meetingTypeName"></el-input>
</el-form-item>
<el-form-item label="模块名称" prop="moduleName">
<el-input v-model="formData.moduleName"></el-input>
</el-form-item>
<el-form-item label="序号" prop="sortNum">
<el-input-number :max="tableData.length + 1" :min="1" :precision="0"
v-model="formData.sortNum"></el-input-number>
</el-form-item>
<vi-title title="审核节点信息(温馨提醒:如审核节点没有限制,审核节点类型不选即可)"></vi-title>
<el-table :data="formData.auditStateList">
<el-table-column label="节点ID" prop="stateId" width="100px">
<template slot-scope="scope">
<el-input readonly v-model="scope.row.stateId"></el-input>
</template>
</el-table-column>
<el-table-column label="审核节点名称" prop="stateName">
<template slot-scope="scope">
<el-input v-model="scope.row.stateName"></el-input>
</template>
</el-table-column>
<el-table-column label="审核节点类型" prop="auditAfterType" width="150px">
<template slot-scope="scope">
<el-select v-model="scope.row.auditAfterType" clearable>
<el-option :label="item.desc"
:value="item.value"
v-for="item in customAuditTypeList"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="审核人" prop="selectUserId">
<template slot-scope="scope">
<el-select :remote-method="userRemoteMethod"
class="audit-userids-select" filterable
multiple placeholder="请输入姓名或工号查找"
remote style="width: 100%"
v-model="scope.row.selectUserId">
<el-option :key="item.id"
:label="item.username + '(' + item.loginname + ')'"
:value="item.id"
v-for="item in userList"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="筛选审核人" width="100px">
<template scope="scope">
<el-button @click="openUserSelect(scope.$index)" type="text">筛选用户</el-button>
</template>
</el-table-column>
<el-table-column label="通过下个节点" pro="afterPassStateId" width="120px">
<template slot-scope="scope">
<el-select v-model="scope.row.afterPassStateId">
<el-option :label="item"
:value="item"
v-for="item in stateIdList"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="拒绝下个节点" pro="afterRejectStateId" width="120px">
<template slot-scope="scope">
<el-select v-model="scope.row.afterRejectStateId">
<el-option :label="item"
:value="item"
v-for="item in stateIdList"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="审核类型" prop="stateAuditType" width="150px">
<template slot-scope="scope">
<el-select v-model="scope.row.stateAuditType">
<el-option :label="item.desc"
:value="item.value"
v-for="item in stateAuditTypeList"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column width="100px">
<template scope="scope" slot="header">
<el-button @click="addState"
icon="el-icon-circle-plus-outline"
size="mini"
type="primary"></el-button>
</template>
<template scope="scope">
<el-button @click="formData.auditStateList.splice(scope.$index, 1)"
icon="el-icon-delete"
size="mini"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-form>
<el-row class="mt10" justify="end" type="flex">
<el-button @click="$refs.guava.index()">取消</el-button>
<el-button @click="doConfirm" type="primary">确定</el-button>
</el-row>
</template>
</guava>
<condition :fields="fields"
:show_filter_result="true"
@confirm="cndConfirm"
ref="cnd"
v-model="cnd"></condition>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
},
data() {
return {
tableColumns: [
{prop: 'meetingTypeName', label: '类型名称'},
{prop: 'moduleName', label: '模块名称'},
{prop: 'sortNum', label: '排序编号'}],
stateAuditTypeList: [],
customAuditTypeList: [],
formData: {
auditStateList: []
},
formRules: {
meetingTypeName: [{
required: true,
message: '请输入类型名称',
trigger: ['blur', 'change']
}],
moduleName: [{
required: true,
message: '请输入模块名称,英文命名',
trigger: ['blur', 'change']
}],
sortNum: [{required: true, message: '请输入排序编号', trigger: ['blur', 'change']}]
},
userList: [],
maxStateId: 0,
userSelectDialogVisible: false,
cnd: {},
fields: [],
nodeIndex: null
}
},
watch: {
async 'formData.auditStateList'(val) {
const {id} = this.formData
for (let i = 0; i < val.length; i++) {
let item = val[i]
if (id) {
if (item.isAddRow) {
//当前行是新增的第几行
const addIndex = i + 1 - val.filter(v => !v.isAddRow).length
const stateId = val[0].stateId + i * 10
const licitStateCode = await this.checkStateId(stateId, addIndex)
item['stateId'] = licitStateCode
}
} else {
item['stateId'] = this.maxStateId + (i + 1) * 10
}
}
// this.$set(this.formData,'auditStateList',val)
}
},
computed: {
dialogTitle() {
if (this.formData.id) {
return '编辑'
}
return '新增'
},
stateIdList() {
return this.formData.auditStateList.map(v => v.stateId)
}
},
methods: {
async checkStateId(stateId, stateIndex) {
const resp = await $.get(loc() + '/checkStateId', {stateId, stateIndex})
if (resp.code === 0) {
return resp.data
} else {
this.notifyError(resp.msg)
}
},
addState() {
this.formData.auditStateList.push({
stateId: null,
stateName: null,
selectUserId: [],
auditStateUserList: [],
afterPassStateId: null,
afterRejectStateId: null,
isAddRow: true
})
},
async findAll() {
const resp_data = await $.get(loc() + '/findAll')
if (resp_data.code === 0) {
resp_data.data.forEach(v => {
v.auditStateList.forEach(x => {
if (x.matchCnd) {
x.matchCnd = JSON.parse(x.matchCnd)
}
})
})
this.tableData = resp_data.data
}
},
openAdd() {
this.formData = {
meetingName: null,
sortNum: this.tableData.length + 1,
auditStateList: [{}]
}
this.$refs.guava.edit()
},
async doConfirm() {
try {
const valid = await this.$refs['form'].validate()
if (valid) {
this.formData.auditStateList.forEach(v => {
v['auditStateUserList'] = v.selectUserId.map(x => {
return {userId: x}
})
v['matchCnd'] = JSON.stringify(v['matchCnd'])
})
const resp = await $.post(loc() + '/doHandle', {data: JSON.stringify(this.formData)})
if (resp.code === 0) {
this.$refs.guava.index()
this.notifySuccess(resp.msg)
this.findAll()
} else {
this.notifyError(resp.msg)
}
}
} catch (e) {
}
},
async openEdit(row) {
const d = clone(row)
let u = []
d.auditStateList.forEach(v => {
v['selectUserId'] = v.auditStateUserList.map(x => x.userId)
u = u.concat(v['selectUserId'])
})
this.userList = await queryUserByIds(u)
this.formData = d
this.$refs.guava.edit()
},
async doDelete(id) {
try {
const confirm = await this.$confirm('您确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post(loc() + '/delete/' + id)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.findAll()
} else {
this.notifyError(resp.msg)
}
}
} catch (e) {
console.log(e)
}
},
async userRemoteMethod(query) {
if (query) {
this.userList = await searchUser(query)
}
},
openUserSelect(node_index) {
this.nodeIndex = node_index
const node = this.formData.auditStateList[node_index]
if (node.matchCnd) {
this.cnd = node.matchCnd
console.log('......')
} else {
this.cnd = {method: "AND", conditions: [{}]}
}
this.$refs.cnd.open(false)
},
async initCndFields() {
this.cnd = {
method: "AND",
conditions: [{}],
}
const meet_data = await getOpenMeeting()
const meet_options = meet_data.map(v => {
return {"label": v.jdhallname, "value": v.id}
})
this.fields.push(
{label: '教代会', value: 'jdhid', type: "select", options: meet_options}
)
const {data: role_data} = await $.get('/platform/sys/role/getAllRoles')
const role_options = role_data.map(v => {
return {"label": v.name, "value": v.id}
})
this.fields.push(
{label: '角色', value: 'roleId', type: "select", options: role_options}
)
this.fields.push(
{label: '姓名', value: 'username', options: null}
)
},
async cndConfirm(val) {
if (val) {
const matchCnd = clone(val)
if (matchCnd.conditions && matchCnd.conditions.length > 0) {
this.formData.auditStateList[this.nodeIndex].matchCnd = matchCnd
const resp = await $.post('/platform/userFilter/findUserByCnd', {cnd: JSON.stringify(matchCnd)})
if (resp.code === 0) {
if (resp.data) {
const d = this.formData.auditStateList[this.nodeIndex]
d.matchCnd = matchCnd
d.selectUserId = [...new Set(d.selectUserId.concat(resp.data.map(v => v.id)))]
this.$set(this.formData.auditStateList, this.nodeIndex, d)
let u = []
this.formData.auditStateList.forEach(v => {
u = u.concat(v.selectUserId.map(x => x))
})
this.userList = await queryUserByIds([...new Set(u)])
}
}
console.log(resp)
}
}
}
},
async created() {
this.findAll()
this.initCndFields()
this.maxStateId = await meetUtil.findMaxStateId()
this.stateAuditTypeList = await getEnumOptions('AuditTypeEnum')
this.customAuditTypeList = await getEnumOptions('CustomAuditTypeEnum')
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,40 @@
// const meetingUtil = {
//
//
//
// async getMeetingType(){
// $.get()
// }
//
// }
class meetingUtil {
constructor() {
}
/**
* 获取全部会议类型
* @returns {Promise<*[]|*>}
*/
async getAllMeetingType() {
const resp = await $.get('/platform/meeting/basic/type/findAll')
if (resp.code === 0) {
resp.data.forEach(v => {
v['text'] = v['meetingTypeName']
v['value'] = v['id']
})
return resp.data
}
return []
}
async findMaxStateId() {
const resp = await $.get('/platform/meeting/basic/type/findMaxStateId')
if (resp.code === 0) {
return resp.data
}
}
}
@@ -0,0 +1,139 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年份"
style="width: 100%" type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会议名称:</div>
<div class="search-item-option">
<el-input clearable
placeholder="可输入会议名称、地点进行查询"
v-model="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="会议信息">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isCanLeave'">
<span class="text-muted" v-if="row.isCanLeave==null">未设置</span>
<span class="text-success" v-if="row.isCanLeave==true">能</span>
<span class="text-danger" v-if="row.isCanLeave==false">否</span>
</template>
</el-table-column>
<el-table-column label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini">查看</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
window['vue'] = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
hold: false,
tableColumns: [
{prop: 'meetingName', label: '会议名称', sortable: true},
{prop: 'meetingTypeName', label: '会议类型', sortable: true},
{prop: 'startTime', label: '会议时间', sortable: true},
/*{prop: 'endTime', label: '结束时间', sortable: true},*/
{prop: 'location', label: '会议地点', sortable: true},
{prop: 'isCanLeave', label: '能否请假', sortable: true},
],
pageForm: {
year: new Date().getFullYear().toString()
},
meetingTypeList: []
}
},
methods: {
openView(row) {
const {id, notifyId, hold} = row
window.location.href = '/platform/meeting/manage/createMeeting?notifyId=' + notifyId + "&hold=" + true + "&id=" + id
},
openEdit(row) {
const {id, notifyId, hold} = row
window.location.href = '/platform/meeting/manage/createMeeting?notifyId=' + notifyId + "&hold=" + false + "&id=" + id
},
async doDelete(id) {
try {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post(loc() + '/doDelete', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
}
}
} catch (e) {
console.log(e)
}
}
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,263 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<template #header>
<el-row type="flex">
<el-col :span="12" v-if="id">
<el-button @click="location.replace('/platform/meeting/manage')"
icon="el-icon-back"
style="font-size: 16px" type="text">返回
</el-button>
</el-col>
<el-col :span="12" class="text-right">
<h3 style="color: rgb(24, 103, 176);">{{h3Title}}</h3>
</el-col>
</el-row>
</template>
<!--<template #header>
<h3 style="color: #1867b0">发起会议</h3>
</template>-->
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
<vi-title title="会议基础信息"></vi-title>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="会议名称" prop="meetingName">
<el-input :disabled="hold" @input="meetingNameInput"
placeholder="请填写会议名称" type="text"
v-model.trim="formData.meetingName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="会议地点" prop="location">
<el-input :disabled="hold" placeholder="请填写会议地点"
type="text" v-model.trim="formData.location"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="12">
<el-form-item label="会议类型" prop="typeId">
<el-select :disabled="hold" filterable placeholder="请选择会议类型"
style="width: 100%" v-model="formData.typeId">
<el-option :label="item.meetingTypeName" :value="item.id"
v-for="item in meetingTypeList"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<!--<el-form-item label="会议时间" prop="meetingTime">
<el-date-picker end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
range-separator="至" start-placeholder="开始日期"
style="width: 100%"
:disabled="hold"
type="datetimerange"
v-model="formData.meetingTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>-->
<el-form-item label="会议时间" prop="meetTime">
<el-date-picker :disabled="hold"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择会议时间"
style="width: 100%"
type="datetime"
v-model="formData.meetTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="8">
<el-form-item label="是否可以请假" prop="isCanLeave">
<el-radio :disabled="hold" :label="true" border size="medium" v-model="formData.isCanLeave">
允许
</el-radio>
<el-radio :disabled="hold" :label="false" border size="medium"
v-model="formData.isCanLeave">不允许
</el-radio>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否多次签到">
<el-checkbox v-model="formData.manySign"></el-checkbox>
</el-form-item>
</el-col>
<el-col :span="12" v-if="formData.isCanLeave">
<el-form-item label="请假截止时间" prop="leaveDeadline">
<el-date-picker :disabled="hold" format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择日期" style="width: 100%"
type="datetime"
v-model="formData.leaveDeadline"
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex">
<el-col :span="24">
<el-form-item label="会议描述" prop="meetingDescription">
<el-input :disabled="hold" :rows="4" maxlength="400" placeholder="请输入会议描述"
type="textarea" v-model="formData.meetingDescription"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20" type="flex" v-show="formData.manySign">
<el-col :span="24">
<el-form-item label="场次">
<!--# include("/platform/meeting/manage/add_time_period.html"){} #-->
</el-form-item>
</el-col>
</el-row>
<!--# include("/platform/meeting/manage/add_users.html"){} #-->
</el-form>
<el-row justify="end" style="margin-top: 20px" type="flex" v-if="!hold">
<el-button @click="doSubmit" type="primary">提交</el-button>
</el-row>
</el-card>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'msg-notify': httpVueLoader('/components/msgNotify/msgNotify.vue'),
},
data() {
const that = this
return {
h3Title: "发起会议",
id: "",
notify_id: "",
hold: false,
meetingTypeList: [],
formData: {
isCanLeave: false,
meetingTimePeriods: [{timePeriodName: '', startTime: '', endTime: ''}],
sendTypes: [],
meetingTime: [],
meetTime: '',
},
pickerOptions: {
disabledDate(time) {
return (
moment(time.getTime()).format("YYYY-MM-DD HH:mm:ss") > that.formData.meetingTime[1] || moment(time.getTime()).format("YYYY-MM-DD HH:mm:ss") < that.formData.meetingTime[0]
);
}
},
formRules: {
meetingName: [{required: true, message: '请填写会议名称', trigger: ['blur', 'change']}],
location: [{required: true, message: '请填写会议地点', trigger: ['blur', 'change']}],
typeId: [{required: true, message: '请选择会议类型', trigger: ['blur', 'change']}],
meetingTime: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
meetTime: [{required: true, message: '请选择会议时间', trigger: ['blur', 'change']}],
sendType: [{required: true, message: '请选择发送方式', trigger: ['blur', 'change']}],
msgContent: [{required: true, message: '请填写消息内容', trigger: ['blur', 'change']}],
leaveDeadline: [{required: true, message: '请选择请假截止时间', trigger: ['blur', 'change']}],
isCanLeave: [{required: true, message: '请选择', trigger: ['blur', 'change']}],
},
msgData: {
type: "",
sendTypes: []
}
}
},
methods: {
meetingNameInput(val) {
this.$set(this.msgData, "title", val)
this.formData.meetingTimePeriods[0].timePeriodName = val
},
async doSubmit() {
const valid = await this.$refs["addForm"].validate()
if (valid) {
const submitFormData = clone(this.formData)
submitFormData.startTime = this.formData.meetingTime && this.formData.meetingTime.length > 0 ? this.formData.meetingTime[0] : ''
submitFormData.endTime = this.formData.meetingTime && this.formData.meetingTime.length > 1 ? this.formData.meetingTime[1] : ''
if (this.msgData.sendTypes.length > 0) {
const confirm = await this.$confirm('下一步需要到消息管理系统中择机发送短信通知', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
})
}
const resp = await $.post("/platform/meeting/manage" + (this.formData.id ? "/doEdit" : "/doAdd"), {
meetingInfo: JSON.stringify(submitFormData),
msgNotify: JSON.stringify(this.msgData),
users: JSON.stringify(this.msgData.users.length > 0 ? this.msgData.users.map(v => v.id) : this.msgData.users),
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
sublime.jumpPagePjax('/platform/meeting/manage')
}
}
},
async findOne(id) {
const {data} = await $.post("/platform/meeting/manage/findOne", {id})
data.meetingTime = [data.startTime, data.endTime]
data.meetTime = data.startTime
this.formData = data
}
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
this.id = GetQueryString("id")
this.notify_id = GetQueryString("notifyId")
if (this.id) {
this.hold = GetQueryString("hold")
this.findOne(this.id)
this.h3Title = this.hold === "true" ? "查看会议" : "编辑会议"
this.hold = this.hold !== 'false'
}
},
watch: {
'formData.meetingTime'(val) {
if (val) {
this.formData.meetingTimePeriods[0].startTime = val[0]
this.formData.meetingTimePeriods[0].endTime = val[1]
}
},
'formData.meetTime'(val) {
if (val) {
//结束时间往后加30分钟
const endTime = moment(val).add(30, 'm').format('YYYY-MM-DD HH:mm:ss')
this.formData.meetingTime = [val, endTime]
}
}
},
})
</script>
<!--#
}
#-->
@@ -0,0 +1,49 @@
<!-- 会议时间段 -->
<el-table :data="formData.meetingTimePeriods" border style="width: 100%">
<el-table-column label="名称" prop="timePeriodName">
<template slot-scope="scope">
<el-input :disabled="hold" maxlength="20" v-model="scope.row.timePeriodName"></el-input>
</template>
</el-table-column>
<el-table-column label="开始时间" prop="startTime" sortable>
<template slot-scope="scope">
<el-date-picker
:disabled="hold"
:picker-options="pickerOptions"
placeholder="选择开始时间"
type="datetime"
v-model="scope.row.startTime"
value-format="yyyy-MM-dd HH:mm">
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="结束时间" prop="endTime">
<template slot-scope="scope">
<el-date-picker
:disabled="hold"
:picker-options="pickerOptions"
placeholder="选择结束时间"
type="datetime"
v-model="scope.row.endTime"
value-format="yyyy-MM-dd HH:mm">
</el-date-picker>
</template>
</el-table-column>
<el-table-column width="100px">
<template scope="scope" slot="header">
<el-button :disabled="hold"
@click="formData.meetingTimePeriods.push({timePeriodName:null,startTime:null,endTime:null})"
icon="el-icon-circle-plus-outline"
size="small"
type="primary"></el-button>
</template>
<template scope="scope">
<el-button :disabled="hold"
@click="formData.meetingTimePeriods.splice(scope.$index, 1)"
icon="el-icon-delete"
size="small"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
@@ -0,0 +1,3 @@
<vi-title title="参与人员信息"></vi-title>
<msg-notify :hold="hold" :notify_id="notify_id" :title_disabled="true" v-model="msgData"></msg-notify>
@@ -0,0 +1,128 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年份"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会议名称:</div>
<div class="search-item-option">
<el-input clearable
placeholder="可输入会议名称、地点进行查询"
v-model="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="会议信息">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isCanLeave'">
<span class="text-muted" v-if="row.isCanLeave==null">未设置</span>
<span class="text-success" v-if="row.isCanLeave==true">能</span>
<span class="text-danger" v-if="row.isCanLeave==false">否</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
window['vue'] = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'meetingName', label: '会议名称', sortable: true},
{prop: 'meetingTypeName', label: '会议类型', sortable: true},
{prop: 'startTime', label: '开始时间', sortable: true},
{prop: 'endTime', label: '结束时间', sortable: true},
{prop: 'location', label: '会议地点', sortable: true},
{prop: 'isCanLeave', label: '能否请假', sortable: true},
],
pageForm: {
year: new Date().getFullYear().toString()
},
meetingTypeList: []
}
},
methods: {
async doDelete(id) {
try {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.post(loc() + '/doDelete', {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
}
}
} catch (e) {
console.log(e)
}
}
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,377 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.qrcode {
min-width: 240px;
text-align: center;
display: flex;
flex-direction: column;
}
.real-data {
display: flex;
flex-wrap: wrap;
}
.real-data .data-card {
border-radius: 10px;
width: calc((100% - 80px) / 4);
min-width: 100px;
/*height: 150px;*/
/*min-height: 100px;*/
/*max-height: 150px;*/
/*background: #3CB371;*/
/*background: #000;*/
background-image: linear-gradient(141deg, #9fb8ad 0%, #1fc8db 51%, #2cb5e8 75%);
margin: 10px 0 10px 20px;
padding: 10px;
color: #ffffff;
display: flex;
flex-direction: column;
position: relative;
}
.real-data .data-card .data-card-title {
font-size: 20px;
max-width: 100%;
text-overflow: ellipsis;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
flex: 1;
position: absolute;
}
.real-data .data-card .data-card-num {
font-size: 90px;
flex: auto;
display: flex;
justify-content: center;
align-items: center;
}
.real-data .data-card .flow-border {
position: absolute;
display: block;
}
.timePeriod_card {
border-top: 5px solid #106898;
}
.timePeriod_card .el-form-item {
margin-bottom: 0 !important;
}
img {
height: 100% !important;
width: 100%;
}
.operation {
position: fixed;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1111;
}
</style>
<div id="app" v-cloak>
<guava ref="guava" v-model="guavaIndex">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年份"
style="width: 100%" type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会议名称:</div>
<div class="search-item-option">
<el-input clearable
placeholder="可输入会议名称、地点进行查询"
v-model="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会议类型:</div>
<div class="search-item-option">
<el-select clearable style="width: 100%" v-model="pageForm.typeId">
<el-option :label="item.meetingTypeName"
:value="item.id"
v-for="item in meetingTypeList"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="会议信息">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center"
header-align="center" ref="meetingTable">
<el-table-column type="expand">
<template scope="scope">
<el-row :gutter="20" justify="start" style="flex-wrap: wrap" type="flex"
v-if="scope.row.timePeriods && scope.row.timePeriods.length>0">
<el-col span="5" v-for="tp in scope.row.timePeriods">
<el-card class="mb10 timePeriod_card" shadow="hover">
<el-form label-width="80px">
<el-form-item label="名称">{{tp.timePeriodName}}</el-form-item>
<el-form-item label="会议时间">{{tp.startTime}}</el-form-item>
<!--<el-form-item label="结束时间">{{tp.endTime}}</el-form-item>-->
</el-form>
<el-row justify="space-around"
style="border-top: 1px solid #ebeef5;padding: 20px 0 0 0"
type="flex">
<el-button @click="exportSignature(tp.id)" size="medium" type="text">
导出签字表
</el-button>
<el-button @click="title = tp.timePeriodName; openOnline(tp.id,scope.row.id)"
size="medium" type="text">
扫描二维码
</el-button>
</el-row>
</el-card>
</el-col>
</el-row>
<el-row v-else>
<el-empty description="没有时间段"></el-empty>
</el-row>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isCanLeave'">
<span class="text-muted" v-if="row.isCanLeave==null">未设置</span>
<span class="text-success" v-if="row.isCanLeave==true">能</span>
<span class="text-danger" v-if="row.isCanLeave==false">否</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200px">
<template scope="{row}">
<el-button @click="toggleRowTimePeriod(row)" size="mini" type="primary">展开</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<template #view>
<div style="min-width: 500px;height: 100%;position: relative">
<el-row type="flex">
<el-col :span="4" class="qrcode">
<div @click="downLoadQrCode" title="点击二维码可下载">
<qrcode :value="qrCodeUrl" ref="qrCode"
tag="img"></qrcode>
</div>
</el-col>
<el-col :span="20" class="real-data">
<template v-for="rd of realTimeData">
<div class="data-card">
<div class="data-card-title">
{{rd.label}}
</div>
<div class="data-card-num">
<count-to :end-val="rd.value"
:start-val="getLastValue(rd.key)"></count-to>
</div>
</div>
</template>
</el-col>
</el-row>
<!-- <el-row class="mt20">-->
<el-table :data="userData" :max-height="signTableHeight" class="mt20" ref="signTable">
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="性别" prop="sex"></el-table-column>
<el-table-column label="单位" prop="unitname"></el-table-column>
<el-table-column label="签到时间" prop="signInDateTime"></el-table-column>
<el-table-column label="签到名次">
<template scope="scope">
{{userData.length - scope.$index}}
</template>
</el-table-column>
</el-table>
<!-- </el-row>-->
</div>
</template>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
let pollingInterval = null
const intervalTime = 3500
window['vue'] = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
title: '',
tableColumns: [
{prop: 'meetingName', label: '会议名称', sortable: true},
{prop: 'meetingTypeName', label: '会议类型', sortable: true},
{prop: 'startTime', label: '会议时间', sortable: true},
/*{prop: 'endTime', label: '结束时间', sortable: true},*/
{prop: 'location', label: '会议地点', sortable: true},
{prop: 'isCanLeave', label: '能否请假', sortable: true},
],
pageForm: {
year: new Date().getFullYear().toString()
},
meetingTypeList: [],
lastTimeData: [],
realTimeData: [],
userData: [],
meetingId: null,
timePeriodId: null,
qrcodeVisible: false,
qrCodeUrl: null,
signTableHeight: 600
}
},
watch: {
guavaIndex(val) {
if (val === 'index') {
this.toggleFullScreen()
}
}
},
methods: {
//导出签字表
exportSignature(timePeriodId) {
window.open(loc() + '/exportSignature/' + timePeriodId)
},
//打开在线
async openOnline(timePeriodId, meetingId) {
this.meetingId = meetingId
this.timePeriodId = timePeriodId
this.$refs.guava.view()
this.toggleFullScreen()
this.calcSignTableHeight()
this.generateQrCodeUrl(timePeriodId, meetingId)
this.stopInterval()
pollingInterval = this.startPolling(this.getRealTimeData)
},
calcSignTableHeight() {
this.$nextTick(() => {
setTimeout(() => {
console.log(window.innerHeight)
const offsetTop = this.$refs.signTable.$el.offsetTop
const th = window.innerHeight - 54 - 40 - offsetTop
console.log(th)
this.$set(this, 'signTableHeight', th)
})
})
},
async generateQrCodeUrl(tpId, meetingId) {
const resp = await $.get(loc() + '/generateQrCodeUrl', {tpId, meetingId})
if (resp.code === 0) {
this.qrCodeUrl = resp.data
} else {
this.notifyError(resp.msg)
}
},
async getRealTimeData() {
this.lastTimeData = clone(this.realTimeData)
const resp = await $.get(loc() + '/getRealTimeData/' + this.timePeriodId)
if (resp.code === 0) {
this.lastTimeData = clone(this.realTimeData)
this.$set(this, 'realTimeData', resp.data.countData)
//去重
let ud = clone(this.userData)
ud.unshift(...resp.data.userData)
let uMap = new Map()
for (let u of ud) {
if (!uMap.has(u.loginname)) {
uMap.set(u.loginname, u)
}
}
this.$set(this, 'userData', [...uMap.values()])
} else {
}
},
startPolling(func) {
this.lastTimeData = []
this.realTimeData = []
this.userData = []
func()
return setInterval(func, intervalTime)
},
stopInterval() {
if (pollingInterval) {
clearInterval(pollingInterval)
}
},
getLastValue(key) {
if (this.lastTimeData && this.lastTimeData.length > 0) {
return this.lastTimeData.find(v => v.key === key).value
} else {
return 0
}
},
downLoadQrCode() {
if (this.$refs['qrCode']) {
const src = this.$refs['qrCode'].$el.currentSrc
const aEle = document.createElement('a')
aEle.setAttribute("download", '签到二维码')
aEle.setAttribute("href", src)
aEle.click()
}
},
toggleRowTimePeriod(row) {
this.$refs['meetingTable'].toggleRowExpansion(row)
}
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
this.pageData()
// this.openOnline('2bb2b18a053b4c8ca00e27d30e8f4573')
},
beforeDestroy() {
this.stopInterval()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,321 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.timeTable {
color: red;
}
</style>
<div id="app" v-cloak>
<guava>
<template>
<el-card class="mt10" shadow="never">
<div class="btn-group tool-button mr10">
<el-date-picker @change="getMeetingList(pageForm.meetingTime)" clearable
end-placeholder="结束日期"
range-separator="-"
start-placeholder="开始日期"
type="daterange"
v-model="pageForm.meetingTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</div>
<div class="btn-group tool-button mr10">
<el-select @change="doSearch" clearable
filterable="true"
placeholder="请输入会议名称"
style="width: 100%;" v-model="pageForm.meetingId">
<el-option :label="item.meetingName" :value="item.id" v-for="item in meetingList"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mr10">
<el-select @change="doSearch" clearable placeholder="请选择会议类型" v-model="pageForm.typeId">
<el-option :label="item.meetingTypeName"
:value="item.id"
v-for="item in meetingTypeList"></el-option>
</el-select>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="会议时间段列表">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize"
@sort-change="pageOrder"
row-key="id">
<el-table-column label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column type="expand">
<template scope="{row}">
<el-table :data="row.meetingTimeData" :header-cell-style="{color:'#1867b0'}" row-key="id">
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in ((row.moduleName === 'teacherMeeting'||row.moduleName === 'gdh') ? jdhTimeTableColumns : timeTableColumns)">
<template scope="{row}" v-if="column.prop==='total'">
<el-link @click="openView(row,'total')" type="primary">{{row.total}}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='signJoinNum'">
<el-link @click="openView(row,'signJoinNum')" type="primary">
{{row.signJoinNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='notJoinNum'">
<el-link @click="openView(row,'notJoinNum')" type="primary">{{row.notJoinNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='notJoinNullNum'">
<el-link @click="openView(row,'notJoinNullNum')" type="primary">
{{row.notJoinNullNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='zsdbNum'">
<el-link @click="openView(row,'zsdbNum')" type="primary">
{{row.zsdbNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='lxdbNum'">
<el-link @click="openView(row,'lxdbNum')" type="primary">
{{row.lxdbNum}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop==='proportionNum'">
{{proportionNum(row.joinNum,row.total)}}
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作">
<template scope="{row}">
<el-button @click="exportUser(row)" size="mini" type="primary">导出人员</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<el-dialog :close-on-click-modal="false" :visible.sync="dialogTableVisible" title="人数详情">
<div class="btn-group tool-button mr10">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%"
v-model="pageFormUser.searchKeyword">
<el-select placeholder="查询类型" slot="prepend" style="width: 80px;"
v-model="pageFormUser.searchName">
<el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button mr10"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageFormUser.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mr10">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageFormUser.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
<div class="btn-group tool-button ">
<el-button @click="doSearchUser" icon="el-icon-search" type="primary">搜索</el-button>
</div>
<el-table :data="userTableData" :row-key="(row)=>{row.id}"
:size="tableSize">
<el-table-column label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageFormUser.pageNumber - 1) * pageFormUser.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column label="用户名" prop="loginName"></el-table-column>
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="所属单位" prop="unitName"></el-table-column>
<el-table-column label="院级工会" prop="unionName"></el-table-column>
</el-table>
<el-pagination
:current-page="pageFormUser.pageNumber"
:page-size="pageFormUser.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="pageFormUser.totalCount"
@current-change="pageNumberUserChange"
@size-change="pageSizeUserChange"
layout="total, sizes, prev, pager, next">
</el-pagination>
</el-dialog>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
window.vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
meetingTypeList: [],
unions: [],
units: [],
pageFormUser: {
searchName: "u.username",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
meetingTimeData: {},
meetingNumType: "",
userTableData: [],
meetingList: [],
dialogTableVisible: false,
oldSignNum: 0,
newSignNum: 0,
timeTableColumns: [
{prop: 'timePeriodName', label: '时间段名称'},
{prop: 'startTime', label: '会议时间'},
/*{prop: 'endTime', label: '结束时间'},*/
{prop: 'total', label: '应到人数'},
{prop: 'signJoinNum', label: '实到人数'},
{prop: 'notJoinNum', label: '请假人数'},
{prop: 'notJoinNullNum', label: '未到人数'},
{prop: 'proportionNum', label: '人数比例'},
],
jdhTimeTableColumns: [
{prop: 'timePeriodName', label: '时间段名称'},
{prop: 'startTime', label: '会议时间'},
/*{prop: 'endTime', label: '结束时间'},*/
{prop: 'total', label: '应到人数'},
{prop: 'signJoinNum', label: '实到人数'},
{prop: 'zsdbNum', label: '正式代表'},
{prop: 'lxdbNum', label: '列席代表'},
{prop: 'notJoinNum', label: '请假人数'},
{prop: 'notJoinNullNum', label: '未到人数'},
{prop: 'proportionNum', label: '人数比例'},
],
tableColumns: [
{prop: 'meetingName', label: '会议名称'},
{prop: 'meetingTypeName', label: '会议类型'},
{prop: 'startTime', label: '会议时间'},
/*{prop: 'endTime', label: '结束时间'},*/
{prop: 'leaveDeadline', label: '请假截至时间'},
]
}
},
methods: {
proportionNum(joinNum, total) {
console.log(joinNum, total)
return ((joinNum ? joinNum : 0) / total * 100).toFixed(2) + "%"
},
exportUser(row) {
window.open(loc() + '/exportUser?id=' + row.id + "&meetingId=" + row.meetingId)
},
doSearchUser() {
this.pageFormUser.pageNumber = 1
this.getUserData(this.meetingTimeData, this.meetingNumType)
},
pageNumberUserChange(val) {
this.pageFormUser.pageNumber = val;
this.getUserData(this.meetingTimeData, this.meetingNumType)
},
pageSizeUserChange(val) {
this.pageFormUser.pageSize = val;
this.getUserData(this.meetingTimeData, this.meetingNumType)
},
async getMeetingList(meetingTime) {
const {data} = await $.post(loc() + "/getMeetingList", {meetingTime: JSON.stringify(meetingTime)})
this.meetingList = data
/*if (this.meetingList.length > 0) {
this.$set(this.pageForm, "meetingId", this.meetingList[0].id)
this.pageData()
}*/
},
async openView(row, type) {
this.meetingTimeData = row
this.meetingNumType = type
await this.getUserData(row, type)
this.unions = await getUnions(null)
await this.flushUnits()
this.dialogTableVisible = true
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async getUserData(row, type) {
const {id, meetingId} = row
const pageForm = clone(this.pageFormUser)
pageForm.id = id
pageForm.meetingId = meetingId
pageForm.type = type
const resp = await $.post(loc() + "/getUserData", pageForm)
if (resp.code === 0) {
this.userTableData = resp.data.list
this.pageFormUser.totalCount = resp.data.totalCount
}
},
},
async created() {
this.meetingTypeList = await meetUtil.getAllMeetingType()
let format = moment().add(-1, 'year').format('YYYY-MM-DD HH:mm:ss');
let format1 = moment().format('YYYY-MM-DD HH:mm:ss');
this.$set(this.pageForm, "meetingTime", [format, format1])
await this.getMeetingList(this.pageForm.meetingTime)
await this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -51,10 +51,10 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt20">
<el-table :data="tableData" header-align="center" style="width: 100%">
<el-table-column align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
<el-table-column align="center" label="标题" prop="qtitle" show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" label="标题" prop="qtitle"></el-table-column>
<el-table-column align="center" label="说明" prop="qsm" show-overflow-tooltip="true">
<template scope="scope">
<div v-if="scope.row.qsm">{{removeHTMLTag(scope.row.qsm)}}</div>
<div v-html="scope.row.qsm" v-if="scope.row.qsm">{{scope.row.qsm}}</div>
<span v-else>暂无</span>
</template>
</el-table-column>
@@ -90,14 +90,13 @@ layout("/layouts/platform.html"){
<template #edit_func>
<el-button @click="doExport" icon="el-icon-printer" type="primary">导出</el-button>
<el-button @click="doExportByUnion" icon="el-icon-printer" type="primary">按分工会导出</el-button>
</template>
<template #edit>
<div class="pl10 pr10">
<el-row class="text-center">
<h2 style="margin: 0">{{viewData.q.qtitle}}</h2>
</el-row>
<el-row class="mb20" style="width: 96%; margin: 20px auto 0;">
<el-row class="mb20">
<div v-html="viewData.q.qsm"></div>
</el-row>
@@ -165,7 +164,7 @@ layout("/layouts/platform.html"){
:visible.sync="tkViewDialogVisible"
custom-class="ViewDialogClass"
title="详细信息"
width="60%"
width="50%"
>
<el-row>
<div class="btn-group tool-button mt5">
@@ -178,56 +177,43 @@ layout("/layouts/platform.html"){
</div>
</el-row>
<el-table
:data="tkTableData"
header-align="center"
size="medium"
style="width: 100%; margin-top: 20px"
>
<el-table-column
align="center"
<el-row class="el-table-container" style="margin-top: 20px;">
<el-table
:data="tkTableData"
header-align="center"
label="序号"
type="index"
size="medium"
style="width: 100%"
>
<template scope="scope">
<span>{{scope.$index+(tkPageForm.pageNumber - 1) * tkPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="提交时间"
prop="rtime"
width="180px">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="提交人"
show-overflow-tooltip
prop="username">
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="所属工会"
show-overflow-tooltip
prop="unionname">
</el-table-column>
<el-table-column
header-align="center"
label="文本"
prop="rval"
width="600px">
</el-table-column>
</el-table>
<el-table-column
align="center"
header-align="center"
label="序号"
type="index"
>
<template scope="scope">
<span>{{scope.$index+(tkPageForm.pageNumber - 1) * tkPageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
label="提交时间"
prop="rtime"
width="200px">
</el-table-column>
<el-table-column
header-align="center"
label="文本"
prop="rval">
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
:current-page="tkPageForm.pageNumber"
:page-size="tkPageForm.pageSize"
:page-sizes="[10, 20, 30, 50]"
:total="tkPageForm.totalCount"
:total="pageForm.totalCount"
@current-change="(val)=>{tkPageForm.pageNumber = val;tkPageData();}"
@size-change="(val)=>{tkPageForm.pageSize = val;tkPageData();}"
layout="total, prev, pager, next">
@@ -271,9 +257,6 @@ layout("/layouts/platform.html"){
}
},
methods: {
doExportByUnion() {
location.href = loc() + '/doExportByUnion?questionId=' + this.questionId
},
doExport() {
location.href = loc() + '/doExport?questionId=' + this.questionId
},
@@ -34,10 +34,6 @@ layout("/layouts/platform.html"){
color: red;
}
#qsmEditor .w-e-text-container {
height: 200px !important;
}
.btDiv {
cursor: pointer;
}
@@ -158,11 +154,13 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="标题"
show-overflow-tooltip prop="qtitle"></el-table-column>
prop="qtitle"></el-table-column>
<el-table-column align="center" header-align="center" label="说明" prop="qsm"
show-overflow-tooltip>
<template scope="scope">
<div v-if="scope.row.qsm">{{removeHTMLTag(scope.row.qsm)}}</div>
<div v-html="scope.row.qsm" v-if="!isNull(scope.row.qsm)">
{{scope.row.qsm}}
</div>
<span v-else>暂无</span>
</template>
</el-table-column>
@@ -223,7 +221,7 @@ layout("/layouts/platform.html"){
<template #edit>
<div v-if="editMode==='basicInfo'">
<el-form :model="formData" :rules="formRules" label-position="right"
label-width="120px" ref="addform">
label-width="120px" ref="addForm">
<vi-title2 title="基础设置"></vi-title2>
<el-form-item label="问卷类型" prop="qlx">
@@ -232,90 +230,12 @@ layout("/layouts/platform.html"){
<el-radio :label="1" border>投票调查</el-radio>
<el-radio :label="2" border>答题</el-radio>
<!-- <el-radio :label="3" border>购物调查</el-radio>-->
<el-radio :label="4" border>意向选择</el-radio>
<!-- <el-radio :label="4" border>意向选择</el-radio>-->
</el-radio-group>
</el-form-item>
<el-form-item class="is-required" label="标题" prop="qtitle">
<el-input placeholder="请填写标题" v-model="formData.qtitle"></el-input>
</el-form-item>
<el-row v-show="![1,3,4].includes(formData.qlx)" :gutter="20">
<el-col :span="12">
<el-form-item class="is-required" label="每日可答次数" label-width="120px"
prop="qrkdcs">
<el-input-number :max="100" :min="0"
controls-position="right"
placeholder="设0则不限制次数"
style="width: 100%"
v-model="formData.qrkdcs"></el-input-number>
<div class="text-primary">设0则不限制次数</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="每日答题时间" prop="qdtkssj">
<el-time-picker
end-placeholder="结束时间"
is-range
placeholder="选择时间范围"
range-separator="-"
start-placeholder="开始时间"
style="width: 100%"
v-model="formData.qdtsj"
value-format="HH:mm:ss">
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row v-show="![1,3,4].includes(formData.qlx)" :gutter="20">
<el-col :span="12">
<el-form-item class="is-required" label="回答总次数" label-width="120px"
prop="answerTotalSum">
<el-input-number :max="100" :min="0"
controls-position="right"
placeholder="设0则不限制次数"
style="width: 100%"
v-model="formData.answerTotalSum"></el-input-number>
<div class="text-primary">设0则不限制次数</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
style="width: 100%"
type="datetime"
v-model="formData.startTime"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
:picker-options="endTimeOptions"
style="width: 100%"
type="datetime"
v-model="formData.endTime"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" v-show="formData.qlx===4">
<el-form-item label="自动选择默认项" label-width="150px" prop="autoSelect">
<el-switch
v-model="formData.autoSelect"
>
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="说明" prop="qsm">
<div id="qsmEditor"></div>
<el-input placeholder="请填写标题" v-model="formData.qtitle" maxlength="200"></el-input>
</el-form-item>
<el-form-item label="参加人员" prop="activityUserScopeId">
@@ -334,52 +254,236 @@ layout("/layouts/platform.html"){
</el-form-item>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="出题模式" prop="ctMode">
<el-radio-group v-model="formData.ctMode" size="small">
<el-radio :label="1" border>定时定题</el-radio>
<el-radio :label="2" border>随机题目</el-radio>
</el-radio-group>
<el-col :span="12">
<el-form-item label="开始时间" prop="startTime"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-date-picker
style="width: 100%"
type="datetime"
v-model="formData.startTime"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.ctMode===2">
<el-form-item label="单次出题数量" prop="ctNum">
<!--:max="formData.issues.length"-->
<el-input-number :min="1"
controls-position="right"
style="width: 100%"
v-model="formData.ctNum"></el-input-number>
<el-col :span="12">
<el-form-item label="结束时间" prop="endTime"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-date-picker
:picker-options="endTimeOptions"
style="width: 100%"
type="datetime"
v-model="formData.endTime"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-form-item label="说明" prop="qsm">
<text-editor v-model="formData.qsm"></text-editor>
</el-form-item>
<vi-title2 title="出题设置"></vi-title2>
<el-form-item label="出题模式" prop="ctMode"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-radio-group v-model="formData.ctMode" size="small">
<el-radio :label="1" border>定时定题</el-radio>
<el-radio :label="2" border>随机题目</el-radio>
<el-radio :label="3" border>常规模式</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="题目顺序打乱" prop="disruptingOrder"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-radio-group v-model="formData.disruptingOrder" size="small">
<el-radio :label="true" border>打乱</el-radio>
<el-radio :label="false" border>不变</el-radio>
</el-radio-group>
</el-form-item>
<el-row :gutter="20" v-if="formData.ctMode==2">
<el-col :span="6">
<el-form-item label="是否抽奖" prop="isRaffle">
<el-radio-group v-model="formData.isRaffle" size="small">
<el-form-item label="单次随机题数" prop="ranDomSingleIssueNum"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-input-number :min="1"
controls-position="right"
style="width: 100%"
v-model="formData.ranDomSingleIssueNum"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="总共随机数" prop="ranDomSum"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-input-number :min="1"
controls-position="right"
style="width: 100%"
v-model="formData.ranDomSum"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"
v-if="formData.ctMode!=2 || (formData.ctMode==2 && formData.startTime && formData.endTime && moment(formData.endTime).diff(formData.startTime,'days') >= 1)">
<el-col :span="24">
<el-form-item label="是否可重复答" prop="canRepeatedAnswer"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-radio-group v-model="formData.canRepeatedAnswer" size="small">
<el-radio :label="true" border>是</el-radio>
<el-radio :label="false" border>否</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.isRaffle">
<el-form-item label="抽奖分数" prop="raffleScore">
<el-input-number :min="1"
<el-col :span="24">
<el-form-item label="可重复答次数"
prop="canRepeatedAnswerNum"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]"
v-if="formData.canRepeatedAnswer">
<el-input-number :min="0"
controls-position="right"
style="width: 100%"
v-model="formData.raffleScore"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="6" v-if="formData.isRaffle">
<el-form-item label="获奖人数" prop="raffleWinnerUserNum">
<el-input-number :max="10000" :min="1"
controls-position="right"
style="width: 100%"
v-model="formData.raffleWinnerUserNum"></el-input-number>
style="width: 300px"
v-model="formData.canRepeatedAnswerNum"></el-input-number>
<div class="text-primary">设0则为不限制</div>
</el-form-item>
</el-col>
</el-row>
<template>
<vi-title2 title="分数统计设置"></vi-title2>
<el-form-item label="分数统计" prop="calcScoreMode"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-radio-group v-model="formData.calcScoreMode" size="small">
<el-radio :label="1" border>最高得分</el-radio>
<el-radio :label="2" border>最新得分</el-radio>
</el-radio-group>
</el-form-item>
</template>
<vi-title2 title="抽奖设置"></vi-title2>
<el-form-item label="是否抽奖" prop="isRaffle"
:rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">
<el-radio-group v-model="formData.isRaffle" size="small">
<el-radio :label="true" border>是</el-radio>
<el-radio :label="false" border>否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="抽奖规则" prop="raffleRule" v-if="formData.isRaffle">
<el-table :data="formData.raffleRule" border size="small">
<el-table-column label="开始答题时间" prop="startAnswerDate">
<template scope="{row,$index}">
<el-form-item label-width="0"
:prop="'raffleRule.'+$index+'.startAnswerDate'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-date-picker
v-model="row.startAnswerDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始答题时间">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="结束答题时间" prop="endAnswerDate">
<template scope="{row,$index}">
<el-form-item label-width="0"
:prop="'raffleRule.'+$index+'.endAnswerDate'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-date-picker
v-model="row.endAnswerDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束答题时间">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="抽奖时间" prop="raffleTime">
<template scope="{row,$index}">
<el-form-item label-width="0"
:prop="'raffleRule.'+$index+'.raffleTime'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-date-picker
v-model="row.raffleTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择抽奖时间">
</el-date-picker>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="抽奖分数" prop="raffleScore">
<template scope="{row,$index}">
<el-form-item label-width="0"
:prop="'raffleRule.'+$index+'.raffleScore'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number :min="1"
controls-position="right"
style="width: 300px"
placeholder="抽奖分数"
v-model="row.raffleScore"></el-input-number>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="获奖人数" prop="raffleWinnerUserNum">
<template scope="{row,$index}">
<el-form-item label-width="0"
:prop="'raffleRule.'+$index+'.raffleWinnerUserNum'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number :min="1"
controls-position="right"
style="width: 300px"
placeholder="获奖人数"
v-model="row.raffleWinnerUserNum"></el-input-number>
</el-form-item>
</template>
</el-table-column>
<el-table-column width="100px">
<template scope="{row}" slot="header">
<el-button icon="el-icon-plus"
size="mini"
type="primary"
@click="formData.raffleRule.push({})"
></el-button>
</template>
<template scope="{$index}">
<el-button size="mini"
icon="el-icon-delete"
type="danger"
@click="formData.raffleRule.splice($index,1)"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<!-- <el-form-item label="抽奖时间" prop="raffleTime"-->
<!-- v-if="formData.isRaffle"-->
<!-- :rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">-->
<!-- <el-date-picker-->
<!-- v-model="formData.raffleTime"-->
<!-- type="datetime"-->
<!-- value-format="yyyy-MM-dd HH:mm:ss"-->
<!-- placeholder="选择抽奖时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="抽奖分数" prop="raffleScore"-->
<!-- v-if="formData.isRaffle"-->
<!-- :rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">-->
<!-- <el-input-number :min="1"-->
<!-- controls-position="right"-->
<!-- style="width: 300px"-->
<!-- v-model="formData.raffleScore"></el-input-number>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="获奖人数" prop="raffleWinnerUserNum"-->
<!-- v-if="formData.isRaffle"-->
<!-- :rules="[{required: true, message: '必填', trigger: ['blur', 'change']}]">-->
<!-- <el-input-number :max="10000" :min="1"-->
<!-- controls-position="right"-->
<!-- style="width: 300px"-->
<!-- v-model="formData.raffleWinnerUserNum"></el-input-number>-->
<!-- </el-form-item>-->
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="medium">取消</el-button>
<el-button @click="modifyBasicInfo" type="primary">确定</el-button>
@@ -718,7 +822,7 @@ layout("/layouts/platform.html"){
<el-row>
<span>
标题、提示
标题提示:
</span>
<el-button @click="openIssueName('iname')" plain size="small">
@@ -732,7 +836,7 @@ layout("/layouts/platform.html"){
<el-row type="flex" style="flex-flow: row wrap;column-gap: 10px;margin:20px 0">
<div>
<span>题目类型</span>
<span>题目类型:</span>
<el-select
@change="if(currentModifyIssue.itx==2){issueData[currentModifyIssueIndex].iplfs=1;issueData[currentModifyIssueIndex].iisdx=true;issueData[currentModifyIssueIndex].wors=[{}]}else{issueData[currentModifyIssueIndex].wors=[{wtxt:'选项1'},{wtxt:'选项2'}]}"
placeholder="题型" size="small"
@@ -795,8 +899,9 @@ layout("/layouts/platform.html"){
</div>
</el-row>
<el-row class="mb20">
<span>显示日期</span>
<!--定时定题模式下才需要设置显示日期-->
<el-row class="mb20" v-if="questionData.ctMode==1">
<span>显示日期:</span>
<el-date-picker placeholder="请选择显示日期"
size="small"
type="date"
@@ -806,16 +911,6 @@ layout("/layouts/platform.html"){
</el-date-picker>
</el-row>
<el-row class="mb20">
<span>排序编号</span>
<el-input
v-if="questionData.ctMode==1"
v-model="issueData[currentModifyIssueIndex].ipxbh"
place="请输入排序编号"
style="width: 80px"
size="small"></el-input>
</el-row>
<template v-if="issueData[currentModifyIssueIndex].itx===1">
<vi-title2 title="选项设置"></vi-title2>
<el-row v-if="currentModifyIssue.itx==1">
@@ -958,7 +1053,6 @@ layout("/layouts/platform.html"){
</div>
<script>
let qsmEditor
let upTxtEditor
let cakeEditor
let vue = new Vue({
@@ -983,7 +1077,7 @@ layout("/layouts/platform.html"){
year: new Date().getFullYear() + ''
},
viewData: {issue: [{word: []}]},
formData: {issues: [{wors: [{}]}]},
formData: {issues: [{wors: [{}]}], raffleRule: []},
setTitleDialogVisible: false,
formRules: {
qtitle: [{required: true, message: '请填写标题', trigger: ['blur', 'change']}],
@@ -1217,14 +1311,7 @@ layout("/layouts/platform.html"){
this.$refs.guava.edit()
this.editMode = 'basicInfo'
setTimeout(() => {
$('#qsmEditor').html("")
qsmEditor = new wangEditor('#qsmEditor')
qsmEditor.config.uploadImgShowBase64 = true
qsmEditor.config.onchange = (html) => {
this.$set(this.formData, "qsm", html)
}
qsmEditor.create()
this.formData = {issues: [], qlx: 2, qrkdcs: 0}
this.formData = {issues: [], qlx: 2, qrkdcs: 0, raffleRule: []}
}, 300)
},
@@ -1233,18 +1320,15 @@ layout("/layouts/platform.html"){
async openEditBasicInfo(qid) {
const {code, data, msg} = await $.get(loc() + "/findBasicInfo", {qid: qid})
if (code === 0) {
this.$nextTick(() => {
$('#qsmEditor').html(data.qsm)
qsmEditor = new wangEditor('#qsmEditor')
qsmEditor.config.onchange = (html) => {
this.$set(this.formData, "qsm", html)
setTimeout(() => {
if (data.raffleRule == null) {
data.raffleRule = []
}
qsmEditor.create()
this.formData = data
if (!this.isNull(this.formData.qdtkssj) && !this.isNull(this.formData.qdtjssj)) {
this.$set(this.formData, 'qdtsj', [this.formData.qdtkssj, this.formData.qdtjssj])
}
})
}, 300)
this.editMode = 'basicInfo'
this.$refs.guava.edit()
} else {
@@ -1252,6 +1336,7 @@ layout("/layouts/platform.html"){
}
},
async modifyBasicInfo() {
if (this.formData.qlx === 4) {
if (this.formData.autoSelect && this.formData.endTime < new Date().getTime()) {
this.$message.warning('结束时间必须要大于当前时间')
@@ -1259,22 +1344,25 @@ layout("/layouts/platform.html"){
}
}
//答题 并且是 定时定题
// if (this.formData.qlx === 2 && this.formData.ctMode === 1) {
// if (this.formData.issues.some(v => v.displayDate != null) && this.formData.issues.some(v => v.displayDate == null)) {
// this.$message.warning('显示日期只能全为空或者全不为空')
// return
// }
// }
this.$refs['addForm'].validate(async valid => {
if (valid) {
// if (this.formData.isRaffle && moment(this.formData.raffleTime).isBefore(moment(this.formData.endTime))) {
// this.$message.warning('抽奖时间必须要大于活动结束时间')
// return
// }
const {code, msg} = await $.post(loc() + '/modifyBasicInfo', this.formData)
if (code === 0) {
this.notifySuccess(msg)
this.$refs.guava.index()
this.pageData()
} else {
this.notifyWarning(msg)
}
const {code, msg} = await $.post(loc() + '/modifyBasicInfo', {
question: JSON.stringify(this.formData)
})
if (code === 0) {
this.$message.success(msg)
this.$refs.guava.index()
this.pageData()
} else {
this.$message.warning(msg)
}
}
})
},
//打开题目设置
@@ -1303,14 +1391,23 @@ layout("/layouts/platform.html"){
//修改题目
async doModifyIssues() {
//答题 并且是 定时定题
if (this.questionData.qlx === 2 && this.questionData.ctMode === 1) {
if (this.issueData.some(v => v.displayDate != null) && this.issueData.some(v => v.displayDate == null)) {
this.notifyWarning('显示日期只能全为空或者全不为空')
//答题
if (this.questionData.qlx === 2) {
if (this.issueData.some(v => v.fraction == null || v.fraction === '')) {
this.$message.warning('每题都需要设置分数')
return
}
}
//定时定题需要设置时间
if (this.questionData.ctMode === 1) {
if (this.issueData.some(v => v.displayDate == null || v.displayDate === '')) {
this.$message.warning('每题都需要设置显示日期')
return
}
}
const confirm = await this.$confirm('您确定要提交吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -40,7 +40,8 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword"
maxlength="10"></el-input>
</div>
</div>
@@ -113,6 +114,7 @@ layout("/layouts/platform.html"){
<el-table-column
:label="column.label"
:prop="column.prop"
:key="column.key"
:sortable="column.sortable"
align="center"
header-align="center"
@@ -122,6 +124,10 @@ layout("/layouts/platform.html"){
<span @click="showDays(row)" style="color: #236eb4; cursor: pointer">{{ row.dayCount ? row.dayCount : 0 }}</span>
</template>
</el-table-column>
<el-table-column label="每轮得分" prop="everyRandomScore"
v-if="questionCtMode==2 && isSameDay"></el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
@@ -167,8 +173,8 @@ layout("/layouts/platform.html"){
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
// {prop: 'answerTotal', label: '答题次数(第几回答题)', sortable: true},
{prop: 'max_score', label: '得分'},
{prop: 'answerDate', label: '答题日期'},
{prop: 'score', label: '得分'},
],
pageForm: {
unionId: '',
@@ -179,8 +185,29 @@ layout("/layouts/platform.html"){
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue')
computed: {
//判断是否为同一天
isSameDay() {
if (this.pageForm.questionId) {
const currentQuestion = this.questions.find(v => v.qid === this.pageForm.questionId)
if (currentQuestion) {
const {startTime, endTime} = currentQuestion
return moment(startTime).isSame(moment(endTime), 'day')
}
return false
}
return false
},
questionCtMode(){
if (this.pageForm.questionId) {
const currentQuestion = this.questions.find(v => v.qid === this.pageForm.questionId)
if (currentQuestion) {
return currentQuestion.ctMode
}
return null
}
return null
}
},
methods: {
showDays(row) {
@@ -209,7 +236,7 @@ layout("/layouts/platform.html"){
this.doSearch()
},
async getQuestion() {
const {data} = await $.get(loc()+"/getQuestion", {year: this.pageForm.year})
const {data} = await $.get(loc() + "/getQuestion", {year: this.pageForm.year})
return data
},
async flushUnits() {
@@ -1,222 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-tabs__content {
padding-top: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
@change="yearChange"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属问卷:</div>
<div class="search-item-option">
<el-select filterable="true" placeholder="所属问卷" style="width: 100%;" @change="doSearch"
v-model="pageForm.questionId">
<el-option :label="item.qtitle" :value="item.qid" v-for="item in questions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">工号姓名:</div>
<div class="search-item-option">
<el-input placeholder="输入关键字" v-model="pageForm.searchKeyword" maxlength="10"></el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="参加人员">
<template #func>
<el-button :disabled="!pageForm.questionId" @click="doExportInventory" icon="el-icon-printer"
size="small"
type="primary">导出名单
</el-button>
<!--<el-button :disabled="!pageForm.questionId" @click="doExportAll" icon="el-icon-printer"
size="small"
type="primary">导出分工会阶段得分
</el-button>-->
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
ref="table" row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column
align="center" header-align="center" label="名次" type="index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
<template v-if="column.prop=='dayCount'" scope="{row}">
<span @click="showDays(row)" style="color: #236eb4; cursor: pointer">{{ row.dayCount ? row.dayCount : 0 }}</span>
</template>
</el-table-column>
</el-table>
<!--# include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
<!-- <el-dialog title="答题次数" :visible.sync="dayDialogVisible" width="40%">-->
<!-- <el-table :data="dayTableData" style="width: 100%;" max-height="400">-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="姓名"-->
<!-- prop="username"></el-table-column>-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="工号"-->
<!-- prop="loginname"></el-table-column>-->
<!-- <el-table-column align="center" header-align="center" show-overflow-tooltip label="答题时间"-->
<!-- prop="day"></el-table-column>-->
<!-- </el-table>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="dayDialogVisible = false">确 定</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
dayDialogVisible: false,
dayTableData: [],
unions: [],
units: [],
questions: [],
tableLoading: false,
tableKey: '',
tableColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
// {prop: 'answerTotal', label: '答题次数(第几回答题)', sortable: true},
{prop: 'max_score', label: '得分'},
// {prop: 'answerDate', label: '答题日期'},
],
pageForm: {
unionId: '',
unitId: '',
year: new Date().getFullYear() + '',
keyWord: '',
answerDate: moment().format("YYYY-MM-DD")
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue')
},
methods: {
showDays(row) {
if (!row.days || row.dayCount === 0) {
return
}
this.dayTableData = []
row.days.split(',').map(o => {
this.dayTableData.push({username: row.username, loginname: row.loginname, day: o})
})
this.dayDialogVisible = true
},
doExportInventory() {
let {questionId, unionId, unitId, answerDate} = this.pageForm
answerDate = answerDate == null ? '' : answerDate
window.open(loc() + "/export?questionId=" + questionId + "&unionId=" + unionId + "&unitId=" + unitId + "&answerDate=" + answerDate)
},
doExportAll() {
const {questionId, unionId, unitId} = this.pageForm
window.open(loc() + "/doExportAll?questionId=" + questionId)
},
async yearChange() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.doSearch()
},
async getQuestion() {
const {data} = await $.get("/platform/question/answer/ranking/getQuestion", {year: this.pageForm.year})
return data
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.questions = await this.getQuestion()
this.questions = this.questions.filter(v => v.qlx === 2)
this.$set(this.pageForm, "questionId", this.questions.length > 0 ? this.questions[0].qid : '')
this.pageData();
this.unions = await getUnions(null)
this.flushUnits();
}
})
</script>
<!--#
}
#-->
@@ -91,11 +91,6 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="中奖名单">
<template #func>
<el-button :disabled="!pageForm.questionId" @click="doRaffle" icon="el-icon-printer"
size="small"
type="primary">立即抽奖
</el-button>
<el-button :disabled="!pageForm.questionId" @click="exportWinners" icon="el-icon-printer"
size="small"
type="primary">导出中奖名单
@@ -152,9 +147,8 @@ layout("/layouts/platform.html"){
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '工会'},
{prop: 'mobile', label: '联系方式'},
{prop: 'score', label: '得分'},
// {prop: 'winDate', label: '中奖日期'},
// {prop: 'maxScore', label: '抽奖分数(最高分)'},
{prop: 'winDate', label: '中奖日期'},
{prop: 'score', label: '抽奖分数'},
],
pageForm: {
unionId: '',
@@ -188,12 +182,6 @@ layout("/layouts/platform.html"){
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async doRaffle() {
const {code} = await $.get('/platform/question/answer/statistics/doRaffle', {questionId: this.pageForm.questionId})
if (code === 0) {
this.doSearch()
}
}
},
async created() {
this.questions = await this.getQuestion()