first commit
This commit is contained in:
@@ -0,0 +1,359 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.table_fixed {
|
||||
table-layout: fixed !important;
|
||||
}
|
||||
|
||||
.map-search {
|
||||
margin-bottom: 1rem;
|
||||
border-radius: .25rem;
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
background-color: white;
|
||||
width: auto;
|
||||
min-width: 22rem;
|
||||
border-width: 0;
|
||||
right: 1rem;
|
||||
box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
|
||||
}
|
||||
.map-search .input-item{
|
||||
position: relative;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="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" style="width: 100%"
|
||||
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 @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
clearable
|
||||
style="width: 100%" v-model="pageForm.activityName">
|
||||
</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>
|
||||
<el-button @click="openAdd" size="medium" type="primary">新建活动</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" 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"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop==='isDisabled'">
|
||||
<el-switch
|
||||
:active-value="false"
|
||||
:inactive-value="true"
|
||||
@change="(val)=>{activityStatusChange(row.notice,val,row.id)}"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.isDisabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
<template scope="{row:{opAt}}" v-else-if="column.prop==='opAt'">
|
||||
{{moment(opAt * 1000).format('YYYY-MM-DD HH:mm:ss')}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='notice'">
|
||||
<el-switch
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
@change="(val)=>{activityNoticeChange(row.isDisabled,val,row.id)}"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
v-model="row.notice">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown>
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="openCode(row.id)">
|
||||
活动二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="makeCode(row)">
|
||||
签到二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="sendMsg(row)">
|
||||
通知
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openView(row)">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openEdit(row)">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="deleteDo(row)">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<!--#include("/platform/trainSingUp/manage/include_activity_view.html"){}#-->
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="courseDialog" :title="trainType + '列表'" top="50px">
|
||||
|
||||
<el-table :data="clickRow.courseList">
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
|
||||
<el-table-column label="校区" prop="campus"></el-table-column>
|
||||
<el-table-column label="是否签到" prop="isMobileSign">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.isMobileSign === true">签到</span>
|
||||
<span v-else>不签到</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到方式" prop="signType">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.signType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.signType === 2">被扫</span>
|
||||
<span v-else-if="row.signType === 3">GPS定位签到</span>
|
||||
<span v-else>暂无签到方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否领取礼品" prop="isReceiveGift">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.isReceiveGift === true">领取</span>
|
||||
<span v-else>不领取</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="领取方式" prop="giftType">
|
||||
<template scope="{row}">
|
||||
<span v-if="row.giftType === 1">扫描二维码</span>
|
||||
<span v-else-if="row.giftType === 2">面对面确认</span>
|
||||
<span v-else>暂无领取方式</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="260">
|
||||
<template scope="{row}">
|
||||
<el-button v-if="row.signType === 1" @click="makeCourseCode(row)" size="mini" type="primary">生成二维码
|
||||
</el-button>
|
||||
<el-button v-else size="mini" type="text">该{{trainType}}的签到方式不支持生成二维码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<send-msg ref="sendMsg" :url="url"></send-msg>
|
||||
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let geocoder = null
|
||||
let viewMap = null
|
||||
let viewMarker = null
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
const that = this
|
||||
return {
|
||||
url: '',
|
||||
courseDialog: false,
|
||||
trainType: '',
|
||||
trainTypeList: [],
|
||||
campusList: [],
|
||||
tableColumns: [
|
||||
{label: '活动名称', prop: 'activityName'},
|
||||
{label: '年度', prop: 'year'},
|
||||
{label: '开始时间', prop: 'activityStartTime'},
|
||||
{label: '结束时间', prop: 'activityEndTime'},
|
||||
{label: '是否开启', prop: 'isDisabled'},
|
||||
{label: '是否通知', prop: 'notice'},
|
||||
{label: '创建时间', prop: 'opAt'},
|
||||
],
|
||||
viewData: {},
|
||||
mapDialog: false,
|
||||
mapIndex: 0,
|
||||
courseTypeList: [],
|
||||
courseTimeListDialog: false,
|
||||
courseTimeList: [],
|
||||
viewMapDialog: false,
|
||||
clickRow: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
||||
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
|
||||
},
|
||||
methods: {
|
||||
sendMsg(row) {
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/platform/mobile/trainSignUpActivity/trainList") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
},
|
||||
openCode(id) {
|
||||
this.$refs.openQRCode.openCode("/platform/mobile/trainSignUpActivity/trainList")
|
||||
},
|
||||
makeCode(row) {
|
||||
this.clickRow = row
|
||||
const type = this.trainTypeList.find(o => o.code === row.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
this.courseDialog = true
|
||||
},
|
||||
makeCourseCode(row) {
|
||||
const o = {
|
||||
courseId: row.id
|
||||
}
|
||||
// 生成二维码的 base64 编码
|
||||
const content = jrQrcode.getQrBase64(JSON.stringify(o))
|
||||
let image = new Image()
|
||||
image.src = content
|
||||
let viewer = new Viewer(image)
|
||||
viewer.show()
|
||||
},
|
||||
openAdd() {
|
||||
sublime.jumpPagePjax('/platform/trainSingUp/manage/activity/add')
|
||||
},
|
||||
//活动状态改变
|
||||
async activityStatusChange(notice, val, id) {
|
||||
const resp = await $.post(loc() + '/activityStatusChange', {notice: notice, isDisabled: val, id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async activityNoticeChange(isDisabled, val, id) {
|
||||
const resp = await $.post(loc() + '/activityStatusChange', {isDisabled: isDisabled, notice: val, id})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
sublime.jumpPagePjax('/platform/trainSingUp/manage/activity/add?id=' + row.id + '&fromEdit=edit')
|
||||
},
|
||||
async deleteDo(row) {
|
||||
const confirm = await this.$confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post(loc() + '/doDelete', {id: row.id})
|
||||
this.notifySuccess("删除成功")
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
async openView(row) {
|
||||
const {id} = row
|
||||
const resp = await $.get(loc() + '/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
let cloneData = clone(resp.data)
|
||||
cloneData.campusList = new Set(cloneData.courseList.map(v => v.campus))
|
||||
this.viewData = cloneData
|
||||
const type = this.trainTypeList.find(o => o.code === cloneData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
this.$refs['guava'].view()
|
||||
}
|
||||
},
|
||||
openViewMap(point) {
|
||||
if (!Array.isArray(point)) {
|
||||
this.$message.warning('没有设置点位,无法通过地图查看')
|
||||
return
|
||||
}
|
||||
this.viewMapDialog = true
|
||||
this.$nextTick(() => {
|
||||
viewMap = new AMap.Map("viewMap", {
|
||||
resizeEnable: true,
|
||||
center: point,
|
||||
zoom: 16
|
||||
})
|
||||
if (viewMarker) {
|
||||
viewMap.remove(viewMarker)
|
||||
}
|
||||
viewMarker = new AMap.Marker({
|
||||
position: point,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
viewMap.add(viewMarker)
|
||||
viewMap.setFitView(null, false, [150, 60, 100, 60]);
|
||||
})
|
||||
},
|
||||
getAddress(position) {
|
||||
// if (!geocoder) {
|
||||
// geocoder = new AMap.Geocoder({
|
||||
// city: "010", //城市设为北京,默认:“全国”
|
||||
// radius: 1000 //范围,默认:500
|
||||
// });
|
||||
// }
|
||||
// geocoder.getAddress(position, (status, result) => {
|
||||
// if (status === 'complete' && result.regeocode) {
|
||||
// const address = result.regeocode.formattedAddress
|
||||
// this.formData.courseList[this.mapIndex].location = address
|
||||
// } else {
|
||||
// log.error('根据经纬度查询地址失败')
|
||||
// }
|
||||
// })
|
||||
},
|
||||
openViewCourseTime(courseTimeList) {
|
||||
this.courseTimeList = courseTimeList
|
||||
this.courseTimeListDialog = true
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
this.campusList = await getCampus()
|
||||
this.courseTypeList = await getEnumOptions('TrainCourseType')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,840 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.el-row--flex {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-drawer__body{
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
.my-drawer .el-col-4 {
|
||||
text-align: right;
|
||||
}
|
||||
.my-drawer .el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<!--#include("/platform/trainSingUp/manage/include_activity_edit.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let pointX = '${config.AppMapCenterPointX!}'
|
||||
let pointY = '${config.AppMapCenterPointY!}'
|
||||
let map = null
|
||||
let marker = null
|
||||
let geocoder = null
|
||||
let E = window.wangEditor
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
|
||||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||||
},
|
||||
data() {
|
||||
const that = this
|
||||
return {
|
||||
use: false,
|
||||
historicalActList: [],
|
||||
historicalAct: '',
|
||||
trainType: '培训班',
|
||||
trainTypeList: [],
|
||||
fromEdit: '',
|
||||
formData: {
|
||||
notice: false,
|
||||
courseList: [
|
||||
{courseName: '1', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1},
|
||||
{courseName: '2', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1}
|
||||
],
|
||||
conditionStructure: {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
},
|
||||
restrictLimit: 1,
|
||||
limitNum: 1,
|
||||
typeLimits: [],
|
||||
},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
|
||||
},
|
||||
},
|
||||
setUpCoursePickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.parse(moment(that.formData.activityTime[0]).format('YYYY-MM-DD') + ' 00:00:00')
|
||||
|| time.getTime() > Date.parse(moment(that.formData.activityTime[1]).format('YYYY-MM-DD') + ' 00:00:00')
|
||||
},
|
||||
},
|
||||
courseIndex: 0,
|
||||
setUpCourseDialog: false,
|
||||
unionLimitIndex: 0,
|
||||
setUpUnionLimitDialog: false,
|
||||
unitLimitIndex: 0,
|
||||
setUpUnitLimitDialog: false,
|
||||
viewMapDialog: false,
|
||||
mapDialog: false,
|
||||
courseTypeList: [],
|
||||
campusList: [],
|
||||
courseTimeOneKeySet: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
},
|
||||
conditionStructure: {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
},
|
||||
fields: [],
|
||||
activityGroupList: [],
|
||||
signUpDialog: false,
|
||||
|
||||
userScopeIndex: 0,
|
||||
|
||||
unionUserNumCalc: [{}],
|
||||
unitUserNumCalc: [{}],
|
||||
unionUserNumOneKeyRatio: null,
|
||||
unitUserNumOneKeyRatio: null,
|
||||
|
||||
summaryCount: 0,
|
||||
unitSummaryCount: 0,
|
||||
|
||||
moreInfoDrawer: false,
|
||||
moreInfoRow: {},
|
||||
moreInfoIndex: 0,
|
||||
placeSearchComponent: null,
|
||||
addressValue: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
unionUserNumCalcTips() {
|
||||
return this.unionUserNumCalc.map(v => {
|
||||
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
|
||||
})
|
||||
},
|
||||
unitUserNumCalcTips() {
|
||||
return this.unitUserNumCalc.map(v => {
|
||||
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的单位,限报' + (v.resultNum ? v.resultNum : '?') + '人'
|
||||
})
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
courseTypeChange(val, row) {
|
||||
const courseType = this.courseTypeList.find(o => o.id === val)
|
||||
if(courseType.isBringFamily === true) {
|
||||
this.$set(row, 'isBringFamily', true)
|
||||
} else {
|
||||
this.$set(row, 'isBringFamily', false)
|
||||
}
|
||||
row.reserveMode = 1
|
||||
},
|
||||
openMoreInfo(row, index) {
|
||||
this.moreInfoRow = row
|
||||
this.moreInfoIndex = index
|
||||
this.moreInfoDrawer = true
|
||||
},
|
||||
openSetUpUserScope(index) {
|
||||
const id = GetQueryString("id")
|
||||
if (id && this.formData.courseList[index].conditionStructure
|
||||
&& this.formData.courseList[index].conditionStructure.conditions.length > 0) {
|
||||
this.conditionStructure = this.formData.courseList[index].conditionStructure
|
||||
} else {
|
||||
this.conditionStructure = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
}
|
||||
this.userScopeIndex = index
|
||||
this.$refs.joinCnd.open()
|
||||
},
|
||||
cancel() {
|
||||
sublime.jumpPagePjax('/platform/trainSingUp/manage/activity')
|
||||
},
|
||||
changeActivity(val) {
|
||||
if (val) {
|
||||
const group = this.activityGroupList.find(v => v.groupId === val)
|
||||
this.$set(this.formData, "activityGroupName", group.groupName)
|
||||
} else {
|
||||
this.$set(this.formData, "activityGroupName", "全部教职工")
|
||||
}
|
||||
},
|
||||
//添加培训班
|
||||
addCourse() {
|
||||
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1})
|
||||
},
|
||||
//删除培训班
|
||||
async removeTableCourse(index) {
|
||||
const confirm = await this.$confirm('请确认是否删除此' + this.trainType + '?如果该' + this.trainType + '已有报名人员,会随之一起删除!确定吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm) {
|
||||
this.formData.courseList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
//培训日期change
|
||||
setUpCourseDataChange(val) {
|
||||
if (!val) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = []
|
||||
return
|
||||
}
|
||||
//培训时间日期Set
|
||||
if(this.formData.courseList[this.courseIndex].courseTimeList === undefined) {
|
||||
this.$set(this.formData.courseList[this.courseIndex], 'courseTimeList', [])
|
||||
}
|
||||
const ctList = new Set(this.formData.courseList[this.courseIndex].courseTimeList.map(v => moment(v.courseDate).format('YYYY-MM-DD')))
|
||||
val.forEach(v => {
|
||||
if (!ctList.has(v)) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.push({
|
||||
courseDate: v, courseTime: null
|
||||
})
|
||||
}
|
||||
})
|
||||
const filterCtList = this.formData.courseList[this.courseIndex].courseTimeList.filter(v => {
|
||||
return val.includes(moment(v.courseDate).format('YYYY-MM-DD'))
|
||||
})
|
||||
this.formData.courseList[this.courseIndex].courseTimeList = filterCtList
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.sort((a, b) => {
|
||||
return Date.parse(a['courseDate']) - Date.parse(b['courseDate'])
|
||||
})
|
||||
},
|
||||
//设置课程时间确定
|
||||
doConfirmSetUpCourse() {
|
||||
const courseTableData = this.formData.courseList[this.courseIndex].courseTimeList
|
||||
if (courseTableData.length === 0) {
|
||||
this.$message.warning('请填写培训时间!')
|
||||
return
|
||||
}
|
||||
if (courseTableData && courseTableData.length > 0) {
|
||||
const valid = courseTableData.every(v => v.courseStartTime && v.courseEndTime && (v.courseStartTime < v.courseEndTime))
|
||||
if (!valid) {
|
||||
this.$message.warning('时间填写不完整或者有误!')
|
||||
return
|
||||
}
|
||||
this.setUpCourseDialog = false
|
||||
}
|
||||
|
||||
},
|
||||
//打开设置课程时间
|
||||
openSetUpCourseTime(index) {
|
||||
if (!this.formData.activitySignTime || this.formData.activityTime.length === 0) {s
|
||||
this.$message.warning('请先设置活动报名起止时间')
|
||||
return
|
||||
}
|
||||
this.courseIndex = index
|
||||
this.setUpCourseDialog = true
|
||||
},
|
||||
//打开设置分工会人数限制
|
||||
async openSetUpUnionLimit(index) {
|
||||
this.unionLimitIndex = index
|
||||
this.setUpUnionLimitDialog = true
|
||||
if (!this.formData.courseList[this.unionLimitIndex].unionLimit || this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/getUnionLimit', {activityScopeId: this.formData.activityGroupId})
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData.courseList[this.unionLimitIndex], 'unionLimit', resp.data)
|
||||
}
|
||||
}
|
||||
this.summaryCount = this.formData.courseList[this.unionLimitIndex].unionLimit.reduce((prev, curr) => {
|
||||
console.log(curr)
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
//打开设置单位人数限制
|
||||
async openSetUpUnitLimit(index) {
|
||||
this.unitLimitIndex = index
|
||||
this.setUpUnitLimitDialog = true
|
||||
if (!this.formData.courseList[this.unitLimitIndex].unitLimit || this.formData.courseList[this.unitLimitIndex].unitLimit.length === 0) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/getUnitLimit', {activityScopeId: this.formData.activityGroupId})
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData.courseList[this.unitLimitIndex], 'unitLimit', resp.data)
|
||||
}
|
||||
}
|
||||
this.unitSummaryCount = this.formData.courseList[this.unitLimitIndex].unitLimit.reduce((prev, curr) => {
|
||||
console.log(curr)
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
},
|
||||
unionLimitQuickSetting() {
|
||||
this.unionUserNumCalc.forEach((v, i) => {
|
||||
const startNum = v.startNum
|
||||
const endNum = v.endNum
|
||||
const resultNum = v.resultNum
|
||||
if (startNum > endNum) {
|
||||
this.$message.warning('第' + (i + 1) + '行设置错误')
|
||||
} else {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach(x => {
|
||||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||||
x.limitCount = resultNum
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
}
|
||||
})
|
||||
},
|
||||
unitLimitQuickSetting() {
|
||||
this.unitUserNumCalc.forEach((v, i) => {
|
||||
const startNum = v.startNum
|
||||
const endNum = v.endNum
|
||||
const resultNum = v.resultNum
|
||||
if (startNum > endNum) {
|
||||
this.$message.warning('第' + (i + 1) + '行设置错误')
|
||||
} else {
|
||||
this.formData.courseList[this.unitLimitIndex].unitLimit.forEach(x => {
|
||||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||||
x.limitCount = resultNum
|
||||
}
|
||||
})
|
||||
this.unitCalSummaryCount()
|
||||
}
|
||||
})
|
||||
},
|
||||
doConfirmSetUpUnionLimit() {
|
||||
this.setUpUnionLimitDialog = false
|
||||
/*if (this.formData.courseList[this.unionLimitIndex].unionLimit) {
|
||||
const totalLimit = this.formData.courseList[this.unionLimitIndex].unionLimit.map(v => v.limitCount).reduce((a, b) => a + b)
|
||||
console.log(totalLimit)
|
||||
this.formData.courseList[this.unionLimitIndex].coursePeopleNumber = totalLimit
|
||||
}*/
|
||||
},
|
||||
doConfirmSetUpUnitLimit() {
|
||||
this.setUpUnitLimitDialog = false
|
||||
/*if (this.formData.courseList[this.unionLimitIndex].unionLimit) {
|
||||
const totalLimit = this.formData.courseList[this.unionLimitIndex].unionLimit.map(v => v.limitCount).reduce((a, b) => a + b)
|
||||
console.log(totalLimit)
|
||||
this.formData.courseList[this.unionLimitIndex].coursePeopleNumber = totalLimit
|
||||
}*/
|
||||
},
|
||||
//应用比例设置
|
||||
applyScaleSettings() {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit.forEach(v => {
|
||||
v.limitCount = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
|
||||
if (v.ratio) {
|
||||
v.limitCount = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
|
||||
}
|
||||
})
|
||||
this.calSummaryCount()
|
||||
},
|
||||
unitApplyScaleSettings() {
|
||||
this.formData.courseList[this.unitLimitIndex].unitLimit.forEach(v => {
|
||||
v.limitCount = parseFloat((v.teacherCount * this.unitUserNumOneKeyRatio / 100).toFixed(0))
|
||||
if (v.ratio) {
|
||||
v.limitCount = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
|
||||
}
|
||||
})
|
||||
this.unitCalSummaryCount()
|
||||
},
|
||||
async clearUnitLimit() {
|
||||
const confirm = await this.$confirm('确定要清空单位人数限制吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' === confirm) {
|
||||
this.formData.courseList[this.unitLimitIndex].unitLimit = []
|
||||
this.unitUserNumOneKeyRatio = null
|
||||
this.unitUserNumCalc = [{}]
|
||||
this.setUpUnitLimitDialog = false
|
||||
}
|
||||
},
|
||||
async clearUnionLimit() {
|
||||
const confirm = await this.$confirm('确定要清空分工会人数限制吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' === confirm) {
|
||||
this.formData.courseList[this.unionLimitIndex].unionLimit = []
|
||||
this.unionUserNumOneKeyRatio = null
|
||||
this.unionUserNumCalc = [{}]
|
||||
this.setUpUnionLimitDialog = false
|
||||
}
|
||||
},
|
||||
//设置签到点位
|
||||
openMap(index) {
|
||||
this.mapIndex = index
|
||||
this.mapDialog = true
|
||||
this.$nextTick(() => {
|
||||
map = new AMap.Map("signMap", {
|
||||
resizeEnable: true,
|
||||
center: [pointX, pointY],
|
||||
zoom: 16
|
||||
})
|
||||
this.placeSearchComponent = new AMap.PlaceSearch({
|
||||
// city 指定搜索所在城市,支持传入格式有:城市名、citycode和adcode
|
||||
city: ''
|
||||
})
|
||||
const coordinateArray = this.formData.courseList[this.mapIndex].courseLocationCoordinates
|
||||
this.clearMarker()
|
||||
this.createMarker(coordinateArray)
|
||||
map.on('click', (e) => {
|
||||
this.clearMarker()
|
||||
const position = [e.lnglat.getLng(), e.lnglat.getLat()]
|
||||
this.createMarker(position)
|
||||
this.formData.courseList[this.mapIndex].courseLocationCoordinates = position
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelect(item) {
|
||||
if(item.location) {
|
||||
//定位到中心点
|
||||
map.setCenter(item.location);
|
||||
//TODO 获取数据,对数据进行操作如:添加marker等
|
||||
this.clearMarker()
|
||||
this.createMarker(item.location)
|
||||
this.formData.courseList[this.mapIndex].courseLocationCoordinates = [item.location.lng, item.location.lat]
|
||||
}
|
||||
},
|
||||
querySearchAsync(queryString, cb) {
|
||||
if(!queryString) {
|
||||
return
|
||||
}
|
||||
this.placeSearchComponent.search(queryString, function (status, result) {
|
||||
// 查询成功时,result即对应匹配的POI信息
|
||||
if(status !== 'error') {
|
||||
result.poiList.pois.forEach(item => {
|
||||
item.value = item.name + '【详细地址:' + item.address + '】'
|
||||
})
|
||||
cb(result.poiList.pois)
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除一行培训时间记录
|
||||
removeSetUpTableCourseRow(row, index) {
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.splice(index, 1)
|
||||
//培训时间列表日期数组
|
||||
const courseDateArray = this.formData.courseList[this.courseIndex].courseTimeList.map(v => moment(v.courseDate).format('YYYY-MM-DD'))
|
||||
//选择课程日期数组
|
||||
const scdList = this.formData.courseList[this.courseIndex].setUpCourseData
|
||||
|
||||
this.formData.courseList[this.courseIndex].setUpCourseData = scdList.filter(v => {
|
||||
return courseDateArray.includes(moment(v).format('YYYY-MM-DD'))
|
||||
})
|
||||
},
|
||||
//清楚签到点位
|
||||
clearMarker() {
|
||||
if (marker) {
|
||||
map.remove(marker)
|
||||
}
|
||||
},
|
||||
//创建签到点位
|
||||
createMarker(position) {
|
||||
marker = new AMap.Marker({
|
||||
position: position,
|
||||
offset: new AMap.Pixel(-13, -30)
|
||||
})
|
||||
map.add(marker)
|
||||
this.getAddress(position)
|
||||
map.setFitView(null, false, [150, 60, 100, 60]);
|
||||
},
|
||||
getAddress() {
|
||||
|
||||
},
|
||||
courseOrderNumChange() {
|
||||
this.formData.courseList = this.formData.courseList.sort((a, b) => a.orderNum - b.orderNum)
|
||||
},
|
||||
//提交
|
||||
async doHandle(flag) {
|
||||
if(flag === false) {
|
||||
let valid = false
|
||||
this.$refs.form.validateField('activityName', (errMsg) => {
|
||||
valid = errMsg === ''
|
||||
})
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
const courseValid = this.formData.courseList.some((v, i) => {
|
||||
const basicValid = v.courseName && v.coursePeopleNumber && v.campus
|
||||
&& v.courseLocation && v.courseInstructor && v.courseType
|
||||
const timeValid = v.courseTimeList.length > 0 && v.courseTimeList.every(x => {
|
||||
return x.courseStartTime && x.courseEndTime && (x.courseStartTime < x.courseEndTime)
|
||||
})
|
||||
|
||||
if(!timeValid) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '时间填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if (!basicValid) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '信息填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if(v.isMobileSign === true && v.signType === 3 && (v.courseLocationCoordinates === undefined || v.courseLocationCoordinates.length < 2)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '地点坐标填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if(v.isMobileSign === true && v.signType === 3 && (v.signType === '' || v.signType === undefined)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '签到方式填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
if(v.isReceiveGift === true && (v.giftType === '' || v.giftType === undefined)) {
|
||||
this.$message.warning('第' + (i + 1) + '行' + this.trainType + '领取方式填写有误,请核查!')
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) {
|
||||
return
|
||||
}
|
||||
if (this.formData.restrictLimit === 2) {
|
||||
if (this.formData.typeLimits.length === 0) {
|
||||
this.$notify({title: '警告', type: 'warning', message: '请设置报名限制!'});
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
const cloneData = clone(this.formData)
|
||||
|
||||
//cloneData.conditionStructure.conditions = cloneData.conditionStructure.conditions.filter(v => v.field && v.fieldObj && v.operational && v.value)
|
||||
|
||||
if (cloneData.cover && cloneData.cover.length > 0) {
|
||||
cloneData.cover = cloneData.cover[0]
|
||||
}
|
||||
if (cloneData.wechat && cloneData.wechat.length > 0) {
|
||||
cloneData.wechat = cloneData.wechat[0]
|
||||
}
|
||||
cloneData.activitySignUpStartTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[0] : null
|
||||
cloneData.activitySignUpEndTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[1] : null
|
||||
cloneData.activityStartTime = cloneData.activityTime !== undefined ? cloneData.activityTime[0] : null
|
||||
cloneData.activityEndTime = cloneData.activityTime !== undefined ? cloneData.activityTime[1] : null
|
||||
if(cloneData.activityStartTime !== undefined && cloneData.activityStartTime !== null) {
|
||||
cloneData.year = new Date(cloneData.activityStartTime).getFullYear()
|
||||
}
|
||||
|
||||
/*const limitNumArray = []
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
limitNumArray.push({
|
||||
typeId: item.id,
|
||||
limitNum: item.limitNum
|
||||
})
|
||||
})*/
|
||||
const limitNumArray = []
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
if (item.typeId === '' || item.typeId === undefined) {
|
||||
limitNumArray.push({
|
||||
typeId: item.id,
|
||||
limitNum: item.limitNum
|
||||
})
|
||||
} else {
|
||||
limitNumArray.push(item)
|
||||
}
|
||||
})
|
||||
cloneData.typeLimits = limitNumArray
|
||||
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/doHandle', {data: JSON.stringify(cloneData)})
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/trainSingUp/manage/activity')
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
resp.data.cover = [resp.data.cover]
|
||||
if (resp.data.wechat) {
|
||||
resp.data.wechat = [resp.data.wechat]
|
||||
}
|
||||
this.formData = resp.data
|
||||
const type = this.trainTypeList.find(o => o.code === this.formData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
editor.txt.html(resp.data.introduce)
|
||||
})
|
||||
|
||||
this.formData.courseList.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.courseType)
|
||||
if(type !== null && type !== undefined) {
|
||||
if(type.isBringFamily === true) {
|
||||
this.$set(item, 'isBringFamily', true)
|
||||
item.reserveMode = 1
|
||||
} else {
|
||||
this.$set(item, 'isBringFamily', false)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
})
|
||||
}
|
||||
},
|
||||
async initCnd() {
|
||||
const userState = await getDictByCode('userState')
|
||||
const personType = await getDictByCode('personType')
|
||||
|
||||
const userStateOptions = userState.map(v => {
|
||||
return {label: v.name, value: v.name}
|
||||
})
|
||||
|
||||
const personTypeOptions = personType.map(v => {
|
||||
return {label: v.name, value: v.name}
|
||||
})
|
||||
|
||||
|
||||
this.fields = [
|
||||
{
|
||||
label: '性别',
|
||||
value: 'sex',
|
||||
type: "select",
|
||||
options: [{label: '男', value: '男'}, {label: '女', value: '女'}]
|
||||
},
|
||||
{label: '在职状态', value: 'userState', type: "select", options: userStateOptions},
|
||||
{label: '人员类型', value: 'personType', type: "select", options: personTypeOptions},
|
||||
]
|
||||
},
|
||||
oneKeySetStartEndTime() {
|
||||
const {startTime, endTime} = this.courseTimeOneKeySet
|
||||
this.formData.courseList[this.courseIndex].courseTimeList.forEach(v => {
|
||||
this.$set(v, 'courseStartTime', startTime)
|
||||
this.$set(v, 'courseEndTime', endTime)
|
||||
// if (!v.courseStartTime) {
|
||||
// v.courseStartTime = startTime
|
||||
// }
|
||||
// if (!v.courseEndTime) {
|
||||
// v.courseEndTime = endTime
|
||||
// }
|
||||
})
|
||||
this.$forceUpdate()
|
||||
},
|
||||
doBack() {
|
||||
if (GetQueryString("id") !== '') {
|
||||
sublime.jumpPagePjax('/platform/trainSingUp/manage/activity')
|
||||
}
|
||||
},
|
||||
async validNumber(row, old) {
|
||||
if (GetQueryString("id") === '') {
|
||||
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {
|
||||
this.$alert('预留人数不能大于' + this.trainType + '人数!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
});
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
} else {
|
||||
const registerUserCount = await this.getRegisterUserCount(row.id)
|
||||
if ((row.courseReservedNumber + registerUserCount) > row.coursePeopleNumber) {
|
||||
if(row.reserveMode === 1) {
|
||||
let num = row.coursePeopleNumber - registerUserCount
|
||||
let str = '您设置的' + this.trainType + '人数为' + row.coursePeopleNumber + '人,当前报名人数为' + registerUserCount + '人,预留名额上限为' + num + '人!'
|
||||
this.$alert(str, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
})
|
||||
row.courseReservedNumber = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//获取培训班报名人数
|
||||
async getRegisterUserCount(courseId) {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/getRegisterUserCount', {courseId})
|
||||
return resp.code === 0 ? resp.data : 0
|
||||
},
|
||||
setSignUpCondition() {
|
||||
|
||||
if (this.formData.courseList !== undefined && this.formData.courseList.length > 0) {
|
||||
const courseValid = this.formData.courseList.some((item, index) => {
|
||||
if (item.courseType === undefined) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
type: 'warning',
|
||||
message: '请在' + (index + 1) + '行' + this.trainType + '信息中选择类型!'
|
||||
});
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if (courseValid) {
|
||||
return
|
||||
}
|
||||
|
||||
const array = [...new Set(this.formData.courseList.map(o => o.courseType))]
|
||||
const typeArray = clone([...this.courseTypeList].filter(x => array.some(y => x.id === y)))
|
||||
const arr = []
|
||||
typeArray.forEach(item => {
|
||||
const t = this.formData.typeLimits.find(o => o.typeId === item .id)
|
||||
if(t) {
|
||||
const type = this.courseTypeList.find(o => o.id === t.typeId)
|
||||
t.code = type.code
|
||||
t.lxname = type.lxname
|
||||
arr.push(t)
|
||||
} else {
|
||||
item.limitNum = 0
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
this.formData.typeLimits = arr
|
||||
|
||||
/*if (GetQueryString("id") === '' || this.formData.typeLimits.length === 0) {
|
||||
const array = [...new Set(this.formData.courseList.map(o => o.courseType))]
|
||||
this.formData.typeLimits = clone([...this.courseTypeList].filter(x => array.some(y => x.id === y)))
|
||||
} else {
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.typeId)
|
||||
item.code = type.code
|
||||
item.lxname = type.lxname
|
||||
})
|
||||
}*/
|
||||
this.signUpDialog = true
|
||||
} else {
|
||||
this.$notify({title: '警告', type: 'warning', message: '请在' + this.trainType + '信息中选择类型!'});
|
||||
}
|
||||
},
|
||||
doLimitNum() {
|
||||
/* const courseValid = this.formData.typeLimits.some((item, index) => {
|
||||
if(item.limitNum === 0) {
|
||||
this.$notify({title: '警告', type: 'warning', message: '第'+ (index + 1) +'行限制个数不能为0!'});
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
if(courseValid) {
|
||||
return
|
||||
}*/
|
||||
this.signUpDialog = false
|
||||
},
|
||||
cancelLimitNum() {
|
||||
//this.formData.typeLimits.forEach(item => item.limitNum = 0)
|
||||
this.signUpDialog = false
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/type/getAllType', {})
|
||||
return resp.data
|
||||
},
|
||||
calSummaryCount() {
|
||||
const array = this.formData.courseList[this.unionLimitIndex].unionLimit
|
||||
if (array) {
|
||||
this.summaryCount = array.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
unitCalSummaryCount() {
|
||||
const array = this.formData.courseList[this.unitLimitIndex].unitLimit
|
||||
if (array) {
|
||||
this.unitSummaryCount = array.reduce((prev, curr) => {
|
||||
const value = Number(curr.limitCount);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr.limitCount;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
},
|
||||
typeChange(val) {
|
||||
const type = this.trainTypeList.find(o => o.code === val)
|
||||
this.trainType = type ? type.name : ''
|
||||
},
|
||||
async getHistoricalActList() {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/getHistoricalActList', {})
|
||||
return resp.data
|
||||
},
|
||||
async historicalActChange(val) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/findOne', {id: val})
|
||||
if (resp.code === 0) {
|
||||
resp.data.cover = [resp.data.cover]
|
||||
if (resp.data.wechat) {
|
||||
resp.data.wechat = [resp.data.wechat]
|
||||
}
|
||||
this.formData = resp.data
|
||||
const type = this.trainTypeList.find(o => o.code === this.formData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
editor.txt.html(resp.data.introduce)
|
||||
})
|
||||
|
||||
this.formData.courseList.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.courseType)
|
||||
if (type.isBringFamily === true) {
|
||||
this.$set(item, 'isBringFamily', true)
|
||||
item.reserveMode = 1
|
||||
} else {
|
||||
this.$set(item, 'isBringFamily', false)
|
||||
}
|
||||
})
|
||||
this.formData.id = ''
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
await this.initCnd()
|
||||
this.courseTypeList = await this.getAllType()
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
await this.initData()
|
||||
this.activityGroupList = await getActivityGroup()
|
||||
this.campusList = await getCampus()
|
||||
this.historicalActList = await this.getHistoricalActList()
|
||||
},
|
||||
watch: {
|
||||
'formData.restrictLimit'(val) {
|
||||
if (GetQueryString("id") === '') {
|
||||
this.formData.limitNum = val === 3 ? 1 : ''
|
||||
}
|
||||
},
|
||||
conditionStructure(val) {
|
||||
console.log(val)
|
||||
this.formData.courseList[this.userScopeIndex].conditionStructure = val
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,657 @@
|
||||
<el-form :model="formData" label-width="130px" ref="form">
|
||||
<vi-title title="活动信息"></vi-title>
|
||||
<el-row :gutter="20" type="flex" v-if="fromEdit !== 'edit'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否沿用之前活动" prop="use">
|
||||
<el-radio-group v-model="use">
|
||||
<el-radio :label="true">沿用之前活动</el-radio>
|
||||
<el-radio :label="false">不沿用之前活动</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="use">
|
||||
<el-form-item label="往期活动" prop="historicalAct">
|
||||
<el-select v-model="historicalAct" placeholder="请选择往期活动"
|
||||
style="width: 100%" @change="historicalActChange">
|
||||
<el-option
|
||||
v-for="item in historicalActList"
|
||||
:key="item.id"
|
||||
:label="item.activityName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请输入活动名称', trigger: 'blur'}" label="活动名称"
|
||||
prop="activityName">
|
||||
<el-input maxlength="50" v-model="formData.activityName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="trainType + '通知'" prop="notice">
|
||||
<el-radio-group v-model="formData.notice" 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-row>
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择起止时间', trigger: 'blur'}" label="活动时间"
|
||||
prop="activityTime">
|
||||
<el-date-picker
|
||||
:picker-options="pickerOptions"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.activityTime"
|
||||
value-format="yyyy-MM-dd HH:mm">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择起止时间', trigger: 'blur'}" label="报名时间"
|
||||
prop="activitySignTime">
|
||||
<el-date-picker
|
||||
:disabled="false"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.activitySignTime"
|
||||
value-format="yyyy-MM-dd HH:mm">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面向对象" prop="joinCnd">
|
||||
<div style="display: flex; justify-content: space-between">
|
||||
<div style="width: 99%">
|
||||
<el-select @change="changeActivity" clearable filterable placeholder="请选择可报名人员范围"
|
||||
style="width: 99%" v-model="formData.activityGroupId">
|
||||
<el-option :key="item.groupId"
|
||||
:label="item.groupName"
|
||||
:value="item.groupId"
|
||||
v-for="item in activityGroupList"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="$refs.drawerUserScope.userScopeDialog = true" type="primary">设置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--<el-button @click="$refs.joinCnd.open()" icon="el-icon-s-operation" size="small">打开</el-button>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动类型" prop="trainType" :rules="{required:true,message: '请选择活动类型', trigger: 'blur'}">
|
||||
<el-select @change="typeChange" filterable placeholder="请选择活动类型"
|
||||
style="width: 100%" v-model="formData.trainType">
|
||||
<el-option :label="item.name" :value="item.code" v-for="item in trainTypeList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
||||
<!--<el-input
|
||||
:autosize="{ minRows: 5, maxRows: 10}"
|
||||
placeholder="请输入活动介绍"
|
||||
type="textarea"
|
||||
v-model="formData.introduce">
|
||||
</el-input>-->
|
||||
<div id="introduce"></div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||
<el-col :span="12">
|
||||
<file-upload :files.sync="formData.cover" :max="1" :type="['jpg','jpeg','png','JPG','JPEG','PNG']">
|
||||
<template #el-upload__tip>
|
||||
<div class="el-upload__tip" slot="tip">请上传一张jpg/png/jpeg等格式,且不大于2M的照片</div>
|
||||
</template>
|
||||
</file-upload>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="微信群二维码" prop="wechat">
|
||||
<file-upload :files.sync="formData.wechat" :max="1" :type="['jpg','jpeg','png','JPG','JPEG','PNG']">
|
||||
<template #el-upload__tip>
|
||||
<div slot="tip" class="el-upload__tip">请上传一张jpg/png/jpeg等格式,且不大于2M的照片</div>
|
||||
</template>
|
||||
</file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<vi-title2 :title="trainType + '信息'">
|
||||
<template #func>
|
||||
<el-button @click="addCourse" size="small" type="primary">
|
||||
添加{{ trainType }}
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
|
||||
<el-table :data="formData.courseList">
|
||||
<el-table-column label="序号" prop="orderNum" width="120px">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.orderNum"
|
||||
@change="courseOrderNumChange"
|
||||
:min="1"
|
||||
:max="formData.courseList.length"
|
||||
:step="1"
|
||||
step-strictly
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
style="width: 100px"
|
||||
label="序号">
|
||||
</el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.courseName"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="类型" prop="courseType" sortable>
|
||||
<template scope="{row}">
|
||||
<el-select v-model="row.courseType" @change="(val) => {courseTypeChange(val, row)}">
|
||||
<el-option :label="c.lxname" :value="c.id" v-for="c in courseTypeList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '人数'" prop="coursePeopleNumber" width="110px">
|
||||
<template scope="{row}">
|
||||
<el-input-number :controls="false"
|
||||
:max="1000"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
step-strictly
|
||||
style="max-width: 100px"
|
||||
@change="(c, o) => validNumber(row, null)"
|
||||
v-model="row.coursePeopleNumber"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber" width="110px">
|
||||
<template scope="{row}">
|
||||
<el-input-number :controls="false"
|
||||
:max="1000"
|
||||
:min="0"
|
||||
:precision="0"
|
||||
step-strictly
|
||||
style="max-width: 100px"
|
||||
@change="(c, o) => validNumber(row, o)"
|
||||
v-model="row.courseReservedNumber"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="校区" prop="campus">
|
||||
<template scope="{row}">
|
||||
<el-select v-model="row.campus" style="width: 100%">
|
||||
<el-option :label="item.campus_name" :value="item.campus_name"
|
||||
v-for="item in campusList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '地点'" prop="courseLocation">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.courseLocation"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '负责人'" prop="courseInstructor">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.courseInstructor"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分类标识" prop="assort">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.assort"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType + '时间'">
|
||||
<template scope="scope">
|
||||
<el-button @click="openSetUpCourseTime(scope.$index)" type="text">设置{{ trainType }}时间</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200">
|
||||
<template scope="scope">
|
||||
<el-button @click="openMoreInfo(scope, scope.$index)"
|
||||
size="mini" type="primary">
|
||||
自定义设置
|
||||
</el-button>
|
||||
<el-button @click="removeTableCourse(scope.$index)"
|
||||
size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<vi-title class="mt10" title="个人报名数量限制"></vi-title>
|
||||
<el-form-item label="报名数量限制" prop="cover">
|
||||
<el-radio-group v-model="formData.restrictLimit" size="small">
|
||||
<el-radio border :label="1">无限制</el-radio>
|
||||
<el-radio border :label="2">按类型限制</el-radio>
|
||||
<el-radio border :label="3">按活动限制</el-radio>
|
||||
</el-radio-group>
|
||||
<div calss="limit_div">
|
||||
<div v-if="formData.restrictLimit === 1" style="color: #c64120; font-size: 12px;">注:无限制指对报名的个数不做任何限制
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 2" style="color: #c64120; font-size: 12px;">
|
||||
<div>
|
||||
<el-button @click="setSignUpCondition" size="mini" type="primary">
|
||||
设置报名限制
|
||||
</el-button>
|
||||
<span style="color: #c64120; font-size: 12px;">注:按类型限制指对每个类型下的个数进行限制</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="formData.restrictLimit === 3">
|
||||
<div>
|
||||
<el-input-number v-model="formData.limitNum" :min="1" :max="100" size="mini"
|
||||
label="限制报名个数"></el-input-number>
|
||||
<span style="color: #c64120; font-size: 12px;">注:按活动限制指只能报{{formData.limitNum}}个,不与类型关联</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button v-if="GetQueryString('id') !== ''" @click="doBack">返回</el-button>
|
||||
<el-button @click="doHandle(false)" type="primary">保存</el-button>
|
||||
<el-button @click="doHandle(true)" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
|
||||
<condition :fields="fields" ref="joinCnd" :show_filter_result="true" v-model="conditionStructure"></condition>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="setUpCourseDialog" title="设置时间">
|
||||
<div style="color: red;margin-bottom: 10px">温馨提示:有人员报名后,禁止修改下列时间,如有修改,请联系管理员</div>
|
||||
<vi-title title="选择日期"></vi-title>
|
||||
<el-date-picker
|
||||
v-if="formData.courseList && formData.courseList[courseIndex]"
|
||||
:picker-options="setUpCoursePickerOptions"
|
||||
@change="setUpCourseDataChange"
|
||||
placeholder="选择一个或多个日期"
|
||||
style="width: 100%"
|
||||
type="dates"
|
||||
v-model="formData.courseList[courseIndex].setUpCourseData"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<vi-title class="mt20" :title="'设置' + trainType + '时间'"></vi-title>
|
||||
|
||||
<el-row>
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:10',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="开始时间"
|
||||
size="mini"
|
||||
v-model="courseTimeOneKeySet.startTime"
|
||||
>
|
||||
</el-time-select>
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:10',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="结束时间"
|
||||
size="mini"
|
||||
v-model="courseTimeOneKeySet.endTime">
|
||||
</el-time-select>
|
||||
<el-button @click="oneKeySetStartEndTime" size="mini" type="primary">一键设置开始/结束时间</el-button>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="formData.courseList && formData.courseList[courseIndex]"
|
||||
:data="formData.courseList[courseIndex].courseTimeList">
|
||||
<el-table-column label="日期">
|
||||
<template scope="{row}">
|
||||
<i class="el-icon-time"></i>
|
||||
{{moment(row.courseDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间">
|
||||
<template scope="{row}">
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:10',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="开始时间"
|
||||
v-model="row.courseStartTime">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间">
|
||||
<template scope="{row}">
|
||||
<el-time-select
|
||||
:picker-options="{
|
||||
start: '08:30',
|
||||
step: '00:10',
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="结束时间"
|
||||
v-model="row.courseEndTime">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template scope="{row,$index}">
|
||||
<el-button
|
||||
@click="formData.courseList[courseIndex].courseTimeList.splice($index,0,{courseDate:row.courseDate,courseStartTime:'',courseEndTime:''})"
|
||||
size="small">
|
||||
新增同天时段
|
||||
</el-button>
|
||||
<el-button @click="removeSetUpTableCourseRow(row,$index)" size="small" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button v-if="fromEdit === 'edit'" @click="cancel">取消</el-button>
|
||||
<el-button @click="doConfirmSetUpCourse" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="mapDialog" title="位置信息">
|
||||
<!--#include("/platform/trainSingUp/manage/include_activity_map.html"){}#-->
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="signUpDialog" title="设置报名限制">
|
||||
<el-table :data="formData.typeLimits">
|
||||
<el-table-column prop="code" label="类型编码"></el-table-column>
|
||||
<el-table-column prop="lxname" label="类型名称"></el-table-column>
|
||||
<el-table-column label="限制个数" width="500">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span>限制个数</span>
|
||||
<span style="color: #c64120; font-size: 12px;">注:值为空或者为0则表示此类型不限制报名个数</span>
|
||||
</template>
|
||||
<template scope="{row}">
|
||||
<el-input-number size="small" v-model="row.limitNum" :min="0"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="cancelLimitNum">取消</el-button>
|
||||
<el-button @click="doLimitNum" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="setUpUnionLimitDialog" title="分工会人数限制" top="50px">
|
||||
<vi-title2 title="分段设置">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" @click="unionLimitQuickSetting">
|
||||
应用分段设置
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1" placeholder="请输入最小人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1" placeholder="请输入最大人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1" placeholder="请输入限制人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="4" class="text-right">
|
||||
<el-button icon="el-icon-plus" @click="unionUserNumCalc.push({})"></el-button>
|
||||
<el-button icon="el-icon-minus" @click="unionUserNumCalc.splice(index,1)"
|
||||
:disabled="unionUserNumCalc.length===1"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="mt10">
|
||||
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
|
||||
<span class="mr10">({{index+1}}).</span> {{item}}
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<vi-title2 title="比例设置" class="mt20">
|
||||
<template #func>
|
||||
一键比例:
|
||||
<el-input-number v-model="unionUserNumOneKeyRatio" :precision="0" :step="1" :min="0"
|
||||
placeholder="请输入一键比例"
|
||||
size="small"
|
||||
:max="100"></el-input-number>
|
||||
<el-button size="small" type="primary" @click="applyScaleSettings" class="ml5">应用比例设置</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.courseList[unionLimitIndex].unionLimit" max-height="500px">
|
||||
<el-table-column prop="unionname" label="分工会"></el-table-column>
|
||||
<el-table-column prop="teacherCount" label="人数"></el-table-column>
|
||||
<el-table-column prop="ratio" label="比例(%)">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0" :max="100"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="limitCount" label="限制人数">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.limitCount" :precision="0" :step="1" :min="0"
|
||||
:max="row.teacherCount" @change="calSummaryCount"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<div class="text-danger" style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">限制总人数:{{summaryCount}}人</div>
|
||||
<el-button @click="clearUnionLimit" type="danger">清空分工会人数限制</el-button>
|
||||
<el-button @click="setUpUnionLimitDialog=false">取消</el-button>
|
||||
<el-button @click="doConfirmSetUpUnionLimit" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="setUpUnitLimitDialog" title="单位人数限制" top="50px">
|
||||
<vi-title2 title="分段设置">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" @click="unitLimitQuickSetting">
|
||||
应用分段设置
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-row v-for="(item,index) in unitUserNumCalc" :gutter="20" class="mb5">
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.startNum" :precision="0" :step="1" :min="1" placeholder="请输入最小人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-input-number v-model="item.endNum" :precision="0" :step="1" :min="1" placeholder="请输入最大人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-input-number v-model="item.resultNum" :precision="0" :step="1" :min="1" placeholder="请输入限制人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-col>
|
||||
<el-col :span="4" class="text-right">
|
||||
<el-button icon="el-icon-plus" @click="unitUserNumCalc.push({})"></el-button>
|
||||
<el-button icon="el-icon-minus" @click="unitUserNumCalc.splice(index,1)"
|
||||
:disabled="unitUserNumCalc.length===1"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="mt10">
|
||||
<div v-for="(item,index) in unitUserNumCalcTips" class="text-danger">
|
||||
<span class="mr10">({{index+1}}).</span> {{item}}
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<vi-title2 title="比例设置" class="mt20">
|
||||
<template #func>
|
||||
一键比例:
|
||||
<el-input-number v-model="unitUserNumOneKeyRatio" :precision="0" :step="1" :min="0"
|
||||
placeholder="请输入一键比例"
|
||||
size="small"
|
||||
:max="100"></el-input-number>
|
||||
<el-button size="small" type="primary" @click="unitApplyScaleSettings" class="ml5">应用比例设置</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.courseList[unitLimitIndex].unitLimit" max-height="500px">
|
||||
<el-table-column prop="unitname" label="单位"></el-table-column>
|
||||
<el-table-column prop="teacherCount" label="人数"></el-table-column>
|
||||
<el-table-column prop="ratio" label="比例(%)">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.ratio" :precision="0" :step="1" :min="0" :max="100"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="limitCount" label="限制人数">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.limitCount" :precision="0" :step="1" :min="0"
|
||||
:max="row.teacherCount" @change="unitCalSummaryCount"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<div class="text-danger" style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">限制总人数:{{unitSummaryCount}}人</div>
|
||||
<el-button @click="clearUnitLimit" type="danger">清空单位人数限制</el-button>
|
||||
<el-button @click="setUpUnitLimitDialog=false">取消</el-button>
|
||||
<el-button @click="doConfirmSetUpUnitLimit" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer
|
||||
title="自定义设置" size="50%" class="my-drawer"
|
||||
:visible.sync="moreInfoDrawer">
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>分工会人数限制</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openSetUpUnionLimit(moreInfoIndex)" type="primary" size="small">设置分工会人数限制</el-button>
|
||||
<span v-if="formData.courseList[moreInfoIndex].unionLimit && formData.courseList[moreInfoIndex].unionLimit.length > 0" class="text-success">
|
||||
已设置
|
||||
</span>
|
||||
<span v-else class="text-danger">
|
||||
未设置
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>单位人数限制</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openSetUpUnitLimit(moreInfoIndex)" type="primary" size="small">设置单位人数限制</el-button>
|
||||
<span v-if="formData.courseList[moreInfoIndex].unitLimit && formData.courseList[moreInfoIndex].unitLimit.length > 0" class="text-success">
|
||||
已设置
|
||||
</span>
|
||||
<span v-else class="text-danger">
|
||||
未设置
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>报名人员范围</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openSetUpUserScope(moreInfoIndex)" type="primary" size="small">设置报名人员范围
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>是否签到</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].isMobileSign" size="small">
|
||||
<el-radio border :label="true">签到</el-radio>
|
||||
<el-radio border :label="false">不签到</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formData.courseList[moreInfoIndex].isMobileSign === true" :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>签到方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].signType" size="small">
|
||||
<el-radio border :label="1">扫描二维码</el-radio>
|
||||
<el-radio border :label="2">被扫</el-radio>
|
||||
<el-radio border :label="3">GPS定位签到</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formData.courseList[moreInfoIndex].isMobileSign === true
|
||||
&& formData.courseList[moreInfoIndex].signType == 3" :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>地点坐标</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-button @click="openMap(moreInfoIndex)" type="primary" size="small">设置签到点</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>是否领取礼品</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].isReceiveGift" size="small">
|
||||
<el-radio border :label="true">领取</el-radio>
|
||||
<el-radio border :label="false">不领取</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="formData.courseList[moreInfoIndex].isReceiveGift === true" :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>领取方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].giftType" size="small">
|
||||
<el-radio border :label="1">扫描二维码</el-radio>
|
||||
<el-radio border :label="2">面对面确认</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="50" type="flex">
|
||||
<el-col :span="4">
|
||||
<span>预留名额方式</span>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<el-radio-group v-model="formData.courseList[moreInfoIndex].reserveMode" size="small"
|
||||
:disabled="formData.courseList[moreInfoIndex].isBringFamily === true">
|
||||
<el-radio border :label="1">报名人员减少模式</el-radio>
|
||||
<el-radio border :label="2">候补模式</el-radio>
|
||||
</el-radio-group>
|
||||
<span v-if="formData.courseList[moreInfoIndex].isBringFamily === true"
|
||||
class="text-danger" style="margin-left: 6px">
|
||||
温馨提醒:{{formData.courseList[moreInfoIndex].courseName}}为携带家属,只支持报名人员减少模式
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
<drawer-user-scope
|
||||
@group_change="getActivityGroup"
|
||||
ref="drawerUserScope"
|
||||
:group_id.sync="formData.activityGroupId"
|
||||
></drawer-user-scope>
|
||||
@@ -0,0 +1,12 @@
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-autocomplete
|
||||
v-model="addressValue" style="width: 100%"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入关键词查询地址"
|
||||
@select="handleSelect"></el-autocomplete>
|
||||
</div>
|
||||
<div id="signMap" style="width: 100%;height: 500px"></div>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="mapDialog = false" type="danger">关闭</el-button>
|
||||
<!-- <el-button @click="mapConfirm" type="primary">确定</el-button>-->
|
||||
</el-row>
|
||||
@@ -0,0 +1,65 @@
|
||||
<el-tabs>
|
||||
<el-tab-pane label="基础信息">
|
||||
<el-descriptions :column="2" border class="table_fixed">
|
||||
<el-descriptions-item :span="2" label="活动名称">
|
||||
{{viewData.activityName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="年度">
|
||||
{{viewData.year}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{moment(viewData.opAt * 1000).format('YYYY-MM-DD HH:mm:ss')}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动开始时间">
|
||||
{{viewData.activityStartTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动结束时间">
|
||||
{{viewData.activityEndTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报名开始时间">
|
||||
{{viewData.activitySignUpStartTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="报名结束时间">
|
||||
{{viewData.activitySignUpEndTime}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="trainType + '信息'">
|
||||
<el-table :data="viewData.courseList">
|
||||
<el-table-column :label="trainType + '名称'" prop="courseName"></el-table-column>
|
||||
<el-table-column label="类型" prop="courseTypeName"></el-table-column>
|
||||
<el-table-column label="人数" prop="coursePeopleNumber"></el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber"></el-table-column>
|
||||
<el-table-column label="地点" prop="courseLocation">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openViewMap(row.courseLocationCoordinates)" type="text">{{row.courseLocation}}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="校区" prop="campus"></el-table-column>
|
||||
<el-table-column label="负责人" prop="courseInstructor"></el-table-column>
|
||||
<el-table-column label="上课时间" prop="courseTimeList" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openViewCourseTime(row.courseTimeList)" type="text" type="text">点击查看课程时间
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog :visible.sync="courseTimeListDialog" :title="trainType + '时间'" width="60%" append-to-body>
|
||||
<el-table :data="courseTimeList">
|
||||
<el-table-column label="日期" prop="courseDate">
|
||||
<template scope="{row}">
|
||||
{{moment(row.courseDate).format('YYYY-MM-DD')}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="courseStartTime"></el-table-column>
|
||||
<el-table-column label="结束时间" prop="courseEndTime"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="viewMapDialog" title="地点" width="60%">
|
||||
<div id="viewMap" style="width: 100%;height: 500px"></div>
|
||||
</el-dialog>
|
||||
@@ -0,0 +1,50 @@
|
||||
<el-form ref="paramForm" :rules="paramFormRules" :model="clickRow" label-width="80px">
|
||||
|
||||
<template v-if="['SELECT'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="选项列表" prop="selectValues">
|
||||
<el-select v-model="clickRow.selectValues" multiple style="width: 100%"
|
||||
filterable allow-create default-first-option placeholder="请选择选项列表(如无数据时,需手动输入选项进行添加)">
|
||||
<el-option
|
||||
v-for="item in clickRow.columnOptions" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="['RADIO'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="选项列表" prop="selectValues">
|
||||
<el-select v-model="clickRow.selectValues" multiple style="width: 100%"
|
||||
filterable allow-create default-first-option placeholder="请选择选项列表(如无数据时,需手动输入选项进行添加)">
|
||||
<el-option
|
||||
v-for="item in clickRow.columnOptions" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-if="['FILE'].includes(clickRow.columnFormType)">
|
||||
<el-form-item label="文件类型" prop="fileType">
|
||||
<el-select v-model="clickRow.fileType" multiple style="width: 100%"
|
||||
filterable placeholder="请选择文件类型">
|
||||
<el-option label="jpg" value="jpg"></el-option>
|
||||
<el-option label="png" value="png"></el-option>
|
||||
<el-option label="jpeg" value="jpeg"></el-option>
|
||||
<el-option label="doc" value="doc"></el-option>
|
||||
<el-option label="docx" value="docx"></el-option>
|
||||
<el-option label="xlsx" value="xlsx"></el-option>
|
||||
<el-option label="pdf" value="pdf"></el-option>
|
||||
<el-option label="mp3" value="mp3"></el-option>
|
||||
<el-option label="mp4" value="mp4"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件个数" prop="fileNumber">
|
||||
<el-input-number v-model="clickRow.fileNumber" :min="1" :max="10" placeholder="请输入文件个数" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="detailedParamsVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doDetailParams">确 定</el-button>
|
||||
</div>
|
||||
@@ -0,0 +1,407 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.el-row--flex.is-justify-space-between {
|
||||
justify-content: left;
|
||||
}
|
||||
.el-drawer__body {
|
||||
padding: 0px 30px 0px 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
|
||||
<template>
|
||||
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button">
|
||||
<el-input style="width: 350px;" clearable placeholder="请输入类型名称" v-model="pageForm.lxname"></el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<el-button type="primary" @click="doSearch" icon="el-icon-search"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right">
|
||||
<el-button type="primary" size="medium" @click="openAdd"><i class="ti-plus"></i> 新增类型</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" @sort-change="pageOrder">
|
||||
<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 align="center" header-align="center" label="类型编码" prop="code" sortable></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="类型名称" prop="lxname"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" width="150px">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini"><i class="ti-settings"></i><span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'top',data:scope.row}" v-if="scope.row.xh!==1">
|
||||
上移
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'bottom',data:scope.row}"
|
||||
v-if="scope.row.xh!==pageForm.totalCount">
|
||||
下移
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
|
||||
<vi-title title="基础信息"></vi-title>
|
||||
<el-form label-width="120px" :model="formData" ref="addForm" :rules="rules">
|
||||
<el-form-item prop="code" label="类型编码">
|
||||
<el-input v-model="formData.code" placeholder="请输入类型编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="lxname" label="类型名称">
|
||||
<el-input v-model="formData.lxname" placeholder="请输入类型名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="isBringFamily" label="是否携带家属">
|
||||
<el-radio-group v-model="formData.isBringFamily" @input="isBringFamilyInput">
|
||||
<el-radio :label="true" border>携带</el-radio>
|
||||
<el-radio :label="false" border>不携带</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.isBringFamily === true" prop="isAddFamily" label="家属纳入总人数">
|
||||
<el-radio-group v-model="formData.isAddFamily">
|
||||
<el-radio :label="true" border>纳入</el-radio>
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.isBringFamily === true" prop="selfAddFamily" label="本人纳入总人数">
|
||||
<el-radio-group v-model="formData.selfAddFamily">
|
||||
<el-radio :label="true" border>纳入</el-radio>
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<vi-title2 title="报名填写字段">
|
||||
<template slot="func">
|
||||
<el-button @click="formData.trainMobileSignColumnList.push({isRequired: false})" size="small" type="primary"
|
||||
style="margin-left: 10px">
|
||||
添加
|
||||
</el-button>
|
||||
<div style="color: #c64120; margin-left: 10px">注:移动端报名时字段的显示顺序会按照下面表格中的序号进行排列、字段编码不能重复</div>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.trainMobileSignColumnList">
|
||||
|
||||
<el-table-column label="序号" prop="columnIndex">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.columnIndex" placeholder="请输入序号"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段名称" prop="columnName">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.columnName" placeholder="请输入字段名称"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段编码" prop="columnCode">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.columnCode" placeholder="请输入字段编码"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="控件类型" prop="columnFormType">
|
||||
<template scope="{row, $index}">
|
||||
<el-select filterable v-model="row.columnFormType" @change="(val) => {columnFormTypeChange(val, $index)}"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'" placeholder="请选择控件类型">
|
||||
<el-option v-for="item in columnFormTypeList" :label="item.description" :value="item.code"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="字段类型" prop="columnType">
|
||||
<template scope="{row}">
|
||||
<el-select filterable placeholder="请选择字段类型" v-model="row.columnType"
|
||||
:disabled="row.isDisabled || (formData.isBringFamily === true && row.columnCode === 'xdqsrs')">
|
||||
<el-option v-for="item in columnTypeOptions" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="是否必填" prop="isRequired" sortable>
|
||||
<template scope="{row}">
|
||||
<el-switch v-model="row.isRequired" active-color="#13ce66" inactive-color="#ff4949"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'"
|
||||
:active-value="true" :inactive-value="false"
|
||||
active-text="是" inactive-text="否"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template scope="{row, $index}">
|
||||
<el-button @click="openDetailedParams(row, $index)" :disabled="!['SELECT', 'RADIO', 'FILE'].includes(row.columnFormType)" size="mini" type="primary">
|
||||
设置详细参数
|
||||
</el-button>
|
||||
<el-button @click="formData.trainMobileSignColumnList.splice($index, 1)"
|
||||
:disabled="formData.isBringFamily === true && row.columnCode === 'xdqsrs'"
|
||||
size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="$refs.guava.index()">取 消</el-button>
|
||||
<el-button type="primary" @click="doHandle">确 定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-drawer :visible.sync="detailedParamsVisible" size="40%">
|
||||
<template #title>
|
||||
<vi-title title="设置详细参数" style="margin-bottom: 0px"></vi-title>
|
||||
</template>
|
||||
<!--#include("/platform/trainSingUp/manage/include_signUp_edit.html"){}#-->
|
||||
</el-drawer>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
detailedParamsVisible: false,
|
||||
pageForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
lxname: ''
|
||||
},
|
||||
formData: {
|
||||
trainMobileSignColumnList: [{isRequired: false}],
|
||||
isBringFamily: false,
|
||||
isAddFamily: null,
|
||||
},
|
||||
rules: {
|
||||
lxname: [{required: true, message: '请输入类型名称', trigger: ['change', 'blur']}],
|
||||
code: [{required: true, message: '请输入类型编码', trigger: ['change', 'blur']}],
|
||||
isBringFamily: [{required: true, message: '请选择是否携带家属', trigger: ['blur', 'change']}],
|
||||
isAddFamily: [{required: true, message: '请选择家属是否纳入总人数', trigger: ['blur', 'change']}],
|
||||
},
|
||||
tableData: [],
|
||||
columnTypeOptions: [],
|
||||
columnFormTypeList: [],
|
||||
clickRow: {},
|
||||
paramFormRules: {
|
||||
selectValues: [{required: true, message: '请选择选项列表', trigger: ['blur']}],
|
||||
fileType: [{required: true, message: '请选择文件类型', trigger: ['blur']}],
|
||||
fileNumber: [{required: true, message: '请输入文件个数', trigger: ['blur', 'change']}],
|
||||
},
|
||||
choose: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isBringFamilyInput(o) {
|
||||
this.$set(this.formData, 'isAddFamily', o === true ? false : null)
|
||||
if(o === true) {
|
||||
this.formData.trainMobileSignColumnList.unshift({
|
||||
columnName: '携带亲属人数',
|
||||
columnCode: 'xdqsrs',
|
||||
columnFormType: 'INPUT',
|
||||
columnType: 'INT',
|
||||
isRequired: true,
|
||||
})
|
||||
} else {
|
||||
this.formData.trainMobileSignColumnList.forEach((item, index) => {
|
||||
if(item.columnCode === 'xdqsrs' && this.formData.isBringFamily === false) {
|
||||
this.formData.trainMobileSignColumnList.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
columnFormTypeChange(val, index) {
|
||||
if(val === 'FILE') {
|
||||
this.formData.trainMobileSignColumnList[index].columnType = 'JSON'
|
||||
this.formData.trainMobileSignColumnList[index].isDisabled = true
|
||||
} else {
|
||||
this.formData.trainMobileSignColumnList[index].columnType = ''
|
||||
this.formData.trainMobileSignColumnList[index].isDisabled = false
|
||||
}
|
||||
},
|
||||
doHandle() {
|
||||
if(this.choose.id) {
|
||||
this.doEdit()
|
||||
} else {
|
||||
this.doAdd()
|
||||
}
|
||||
},
|
||||
async doDetailParams() {
|
||||
const isValid = await this.$refs['paramForm'].validate()
|
||||
if(isValid) {
|
||||
this.detailedParamsVisible = false
|
||||
}
|
||||
},
|
||||
openDetailedParams(row, index) {
|
||||
this.clickRow = row
|
||||
this.detailedParamsVisible = true
|
||||
if (this.$refs["paramForm"])
|
||||
this.$refs["paramForm"].clearValidate()
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'top') {
|
||||
this.rowChange(data, false)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
} else if (type == 'bottom') {
|
||||
this.rowChange(data, true)
|
||||
}
|
||||
},
|
||||
rowChange(row, toDown) {
|
||||
$.post(loc() + '/xhChange', {id: row.id, xh: row.xh, toDown}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
},
|
||||
openAdd() {
|
||||
this.choose = {}
|
||||
this.formData = {
|
||||
trainMobileSignColumnList: [{isRequired: false}],
|
||||
isBringFamily: false,
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs["addForm"])
|
||||
this.$refs["addForm"].resetFields()
|
||||
},
|
||||
async doAdd() {
|
||||
this.$refs['addForm'].validate(valid => {
|
||||
if (valid) {
|
||||
const newListLength = new Set(this.formData.trainMobileSignColumnList.map(item=>item.columnCode)).size;
|
||||
const listLength = this.formData.trainMobileSignColumnList.length;
|
||||
if(listLength > newListLength) {
|
||||
this.$notify.warning({title: '警告', message: '字段编码不能重复!'})
|
||||
return
|
||||
}
|
||||
const cloneData = clone(this.formData)
|
||||
$.post(loc() + '/doAdd', {data: JSON.stringify(cloneData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar()
|
||||
$.post(loc() + '/pageData', this.pageForm).then(res => {
|
||||
sublime.closeLoadingbar()
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
}
|
||||
})
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val
|
||||
this.pageData()
|
||||
},
|
||||
openEdit(obj) {
|
||||
this.choose = obj
|
||||
this.formData = JSON.parse(JSON.stringify(obj))
|
||||
this.formData.trainMobileSignColumnList.forEach(item => {
|
||||
item.isDisabled = item.columnFormType === 'FILE'
|
||||
})
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
doEdit() {
|
||||
this.$refs['addForm'].validate(valid => {
|
||||
if (valid) {
|
||||
const newListLength = new Set(this.formData.trainMobileSignColumnList.map(item=>item.columnCode)).size;
|
||||
const listLength = this.formData.trainMobileSignColumnList.length;
|
||||
if(listLength > newListLength) {
|
||||
this.$notify.warning({title: '警告', message: '字段编码不能重复!'})
|
||||
return
|
||||
}
|
||||
const cloneData = clone(this.formData)
|
||||
cloneData.trainMobileSignColumnList = JSON.stringify(cloneData.trainMobileSignColumnList)
|
||||
$.post(loc() + '/doEdit', cloneData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('此操作将删除类型,确认删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post(loc() + '/doDelete', {id: id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(res.msg)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
async getColTypeOptions() {
|
||||
const resp = await $.get(loc() + '/getColumnType')
|
||||
this.columnTypeOptions = resp.data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getColTypeOptions()
|
||||
this.columnFormTypeList = await getEnumOptions('ColumnFormTypeEnum')
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
|
||||
|
||||
@@ -0,0 +1,386 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.adjustDialog .el-radio__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.adjustDialog .el-dialog__body {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="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
|
||||
:clearable="false"
|
||||
@change="yearChange"
|
||||
placeholder="选择年度"
|
||||
type="year" style="width: 100%"
|
||||
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 @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"
|
||||
></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="人员调整"></table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type:="index"
|
||||
width="80px">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="trainType" prop="courseName" align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="类型" prop="courseType" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable align="center"
|
||||
header-align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column :label="trainType === '培训班' ? '讲师' : '负责人'" prop="courseInstructor" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<span v-if="row.reserveMode === 1">
|
||||
{{row.coursePeopleNumber}}
|
||||
</span>
|
||||
<span v-if="row.reserveMode === 2">
|
||||
{{row.coursePeopleNumber + row.courseReservedNumber}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="限制报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="预留人数" prop="courseReservedNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<template v-if="row.isAddFamily && row.isBringFamily">
|
||||
<el-link v-if="row.selfAddFamily" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + '家属(' + row.familyCount + ')'}}
|
||||
</el-link>
|
||||
<el-link v-else @click="openView(row)" type="primary">
|
||||
{{row.familyCount}}
|
||||
</el-link>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">调整</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<vi-title :title="registerCourse.courseName + '报名人员'"></vi-title>
|
||||
<div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input v-model="registerForm.searchKeyword" placeholder="请输入内容">
|
||||
<el-select slot="prepend" v-model="registerForm.searchName" placeholder="查询类型"
|
||||
style="width: 120px;">
|
||||
<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 mt5">
|
||||
<el-select v-model="registerForm.unionId" clearable filterable placeholder="请选择院级工会"
|
||||
@change="getUnitList()">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="registerForm.unitId" clearable filterable placeholder="请选择单位">
|
||||
<el-option
|
||||
v-for="item in unitList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button icon="el-icon-search" type="primary" @click="registerSearch"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="registerUserTableData" :size="tableSize">
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in registerUserTableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop === 'state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="adjust(row)" size="mini" type="primary">修改</el-button>
|
||||
<el-button @click="deleteSignUser(row)" size="mini" type="primary">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title="人员调整" top="6vh" class="adjustDialog" :close-on-click-modal="false"
|
||||
:visible.sync="adjustDialogVisible"
|
||||
width="40%">
|
||||
<span style="color: #c33714">注:如单选为灰色选择不了,则表示对应的{{ trainType }}人数已满!</span>
|
||||
<el-table :data="courseList">
|
||||
<el-table-column label="单选" width="160">
|
||||
<template scope="{row}">
|
||||
<el-radio :label="row.id" @change.native="getCurrentRow(row)"
|
||||
:disabled="(row.courseReservedNumber + row.registerNum) >= row.coursePeopleNumber"
|
||||
v-model="afterAdjustCourse"></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="trainType + '列表'"
|
||||
prop="courseName"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" align="center"
|
||||
header-align="center"></el-table-column>
|
||||
<el-table-column label="预留名额" prop="courseReservedNumber" align="center"
|
||||
header-align="center"></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" align="center" header-align="center"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="adjustDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdjust">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
trainType: '培训班',
|
||||
trainTypeList: [],
|
||||
afterAdjustCourse: '',
|
||||
adjustDialogVisible: false,
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
registerForm: {},
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '培训班', prop: 'courseName'},
|
||||
{label: '类型', prop: 'courseType', sortable: true},
|
||||
{label: '地点', prop: 'courseLocation'},
|
||||
{label: '教师', prop: 'courseInstructor', sortable: true},
|
||||
{label: '最多报名人数', prop: 'coursePeopleNumber', sortable: true},
|
||||
{label: '已报名人数', prop: 'registerNum', sortable: true},
|
||||
],
|
||||
registerUserTableData: [],
|
||||
registerUserTableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '单位', prop: 'unitname'},
|
||||
{label: '分工会', prop: 'unionname'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '报名时间', prop: 'signUpTime'},
|
||||
{label: '报名状态', prop: 'state'},
|
||||
],
|
||||
registerCourse: {},
|
||||
courseList: [],
|
||||
userInfo: {},
|
||||
chooseRow: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activityChange(val) {
|
||||
const activity = this.activityList.find(o => o.id === val)
|
||||
const type = this.trainTypeList.find(o => o.code === activity.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.chooseRow = row
|
||||
},
|
||||
async doAdjust() {
|
||||
if (!this.afterAdjustCourse) {
|
||||
this.notifyWarning('请选择要调整的' + this.trainType + '!')
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm("您确定要将"
|
||||
+ "<span style='color: red'>" + this.userInfo.username + "</span>"
|
||||
+ "的报名信息调整到"
|
||||
+ "<span style='color: red'>" + this.chooseRow.courseName + "</span>"
|
||||
+ "中吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
dangerouslyUseHTMLString: true,
|
||||
}).then(async () => {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '努力调整中,感谢您的耐心等待。。。',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post(loc() + '/adjust', {
|
||||
activityId: this.pageForm.activityId,
|
||||
oldCourseId: this.registerCourse.id,
|
||||
newCourseId: this.afterAdjustCourse,
|
||||
userId: this.userInfo.userId,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$notify({title: '成功', message: '操作成功!', type: 'success',});
|
||||
this.$refs.guava.index()
|
||||
this.adjustDialogVisible = false
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$notify({title: '警告', message: '操作失败!', type: 'warning',});
|
||||
}
|
||||
loading.close();
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
adjust(o) {
|
||||
this.userInfo = o
|
||||
this.afterAdjustCourse = ''
|
||||
this.adjustDialogVisible = true
|
||||
},
|
||||
deleteSignUser(o) {
|
||||
this.$confirm("您确定要删除"
|
||||
+ "<span style='color: red'>" + o.username + "</span>"
|
||||
+ "的报名信息吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
dangerouslyUseHTMLString: true,
|
||||
}).then(async () => {
|
||||
const resp = await $.post(loc() + '/deleteSignUser', {
|
||||
activityId: this.pageForm.activityId,
|
||||
courseId: this.registerCourse.id,
|
||||
userId: o.userId,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$notify({title: '成功', message: '操作成功!', type: 'success',});
|
||||
await this.registerSearch()
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$notify({title: '警告', message: '操作失败!', type: 'warning',});
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
async registerSearch() {
|
||||
this.registerForm.courseId = this.registerCourse.id
|
||||
const resp_register = await $.get(loc() + '/registerUserList', this.registerForm)
|
||||
this.registerUserTableData = resp_register.data
|
||||
},
|
||||
async getUnitList() {
|
||||
this.registerForm.unitId = ''
|
||||
this.unitList = await getUnit(this.registerForm.unionId)
|
||||
},
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await $.get(loc() + '/activityList', {year: this.pageForm.year})
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
const type = this.trainTypeList.find(o => o.code === this.activityList[0].trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
this.unionList = await getUnion()
|
||||
},
|
||||
async openView(o) {
|
||||
this.registerCourse = o
|
||||
this.registerForm.courseId = o.id
|
||||
this.$refs.guava.view()
|
||||
const resp_register = await $.post(loc() + '/registerUserList', this.registerForm)
|
||||
this.registerUserTableData = resp_register.data
|
||||
},
|
||||
async getCourse(val) {
|
||||
const {data} = await $.post(loc() + '/getCourse', {activityId: val})
|
||||
this.courseList = data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
},
|
||||
watch: {
|
||||
'pageForm.activityId'(val) {
|
||||
this.getCourse(val)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,325 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="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
|
||||
:clearable="false"
|
||||
@change="yearChange"
|
||||
placeholder="选择年度"
|
||||
type="year" style="width: 100%"
|
||||
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 @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">{{trainType}}:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="courseChange" :placeholder="'请选择' + trainType" style="width: 100%" v-model="pageForm.courseId">
|
||||
<el-option :label="item.courseName"
|
||||
:value="item.id"
|
||||
v-for="item in courseList"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员信息:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input clearable placeholder="输入姓名或者工号搜索" v-model="pageForm.userKeyWord"></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 ref="tool" :app="this" :label="trainType + '(温馨提示:如需补充人员,请在上面选择具体的' + trainType + ')'">
|
||||
<template #func>
|
||||
<el-button @click="openReserve" type="primary"
|
||||
v-if="reserveMode === 2" size="small">补充人员</el-button>
|
||||
<el-button @click="exportSignPerson" type="primary" size="small">导出签到名单</el-button>
|
||||
<el-button @click="exportGiftPerson" type="primary" size="small">导出领取名单</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.prop === 'courseNames' ? trainType + column.label : column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-if="(column.prop !== 'state') || (reserveMode === 2 && column.prop === 'state')"
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop==='isDisabled'">
|
||||
<span class="text-danger" v-if="row.isDisabled">是</span>
|
||||
<span class="text-success" v-else>否</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<!-- <el-button @click="openView(row.userId)" size="mini" type="primary">查看</el-button>-->
|
||||
<el-button @click="handleUser(row.userId)" size="mini" type="danger" v-if="!row.isDisabled">拉黑
|
||||
</el-button>
|
||||
<el-button @click="handleUser(row.userId)" size="mini" type="success" v-if="row.isDisabled">解封
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<!--#include("/platform/trainSingUp/statistics/include_view.html"){}#-->
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="补充人员" :visible.sync="reserveDialogVisible" width="55%" top="3%">
|
||||
<vi-title title="以下为候补人员,已为您按照报名时间降序排列"></vi-title>
|
||||
<el-table :data="reserveTableData" ref="multipleTable" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
:selectable="(row, index) => {return row.state === 2}"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="username"
|
||||
label="姓名"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="loginname"
|
||||
label="工号"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="mobile"
|
||||
label="联系方式"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="unitname"
|
||||
label="单位"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="unionname"
|
||||
label="工会"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" prop="signUpTime"
|
||||
label="报名时间"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="reserveDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="reserveDo">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
reserveDialogVisible: false,
|
||||
reserveTableData: [],
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '单位', prop: 'unitname', sortable: true},
|
||||
{label: '分工会', prop: 'unionname', sortable: true},
|
||||
// {label: '课程次数', prop: 'tourseTotal'},
|
||||
{label: '课程', prop: 'courseNames', sortable: true},
|
||||
{label: '缺席次数', prop: 'absentCount'},
|
||||
{label: '是否黑名单', prop: 'isDisabled', sortable: true},
|
||||
],
|
||||
|
||||
registerUserTableData: [],
|
||||
registerUserTableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '单位', prop: 'unitname'},
|
||||
{label: '分工会', prop: 'unionname'},
|
||||
{label: '课程次数', prop: 'tourseTotal'},
|
||||
{label: '缺席次数', prop: 'absentCount'},
|
||||
{label: '是否黑名单', prop: 'isDisabled'},
|
||||
],
|
||||
userSignInfo: {},
|
||||
trainType: '培训班',
|
||||
trainTypeList: [],
|
||||
courseList: [],
|
||||
course: {},
|
||||
reserveMode: 1,
|
||||
multipleSelection: [],
|
||||
clickRow: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val
|
||||
},
|
||||
async openReserve() {
|
||||
const activity = this.activityList.find(o => o.id === this.pageForm.activityId)
|
||||
if (moment().unix() < moment(activity.activityEndTime).unix()) {
|
||||
this.$alert('此活动还未结束,无法补充', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
})
|
||||
return
|
||||
}
|
||||
const resp = await $.post('/platform/trainSingUp/userManage/getReserveUser', {courseId: this.course.id})
|
||||
this.reserveTableData = resp.data
|
||||
this.reserveDialogVisible = true
|
||||
},
|
||||
reserveDo() {
|
||||
if (this.multipleSelection.length === 0) {
|
||||
this.$message.warning('请先在左侧多选框中选择要补充的人员')
|
||||
return
|
||||
}
|
||||
this.$confirm('您选择了' + this.multipleSelection.length + '位教职工,确定要进行补充操作吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const ids = this.multipleSelection.map(o => o.userId)
|
||||
const resp = await $.post('/platform/trainSingUp/userManage/reserveSingUp', {
|
||||
ids: JSON.stringify(ids),
|
||||
courseId: this.course.id
|
||||
})
|
||||
if(resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.doSearch()
|
||||
this.multipleSelection = []
|
||||
this.$refs.multipleTable.clearSelection()
|
||||
this.reserveDialogVisible = false
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
courseChange(val) {
|
||||
const course = this.courseList.find(o => o.id === val)
|
||||
this.course = course
|
||||
this.reserveMode = course.reserveMode
|
||||
if(this.reserveMode === 2) {
|
||||
this.tableColumns.push({label: '报名状态', prop: 'state', sortable: true},)
|
||||
} else {
|
||||
this.tableColumns.splice(this.tableColumns.length - 1, 1)
|
||||
}
|
||||
this.$refs.tool.app = this
|
||||
this.doSearch()
|
||||
},
|
||||
exportSignPerson() {
|
||||
this.exportPro(loc() + '/exportSignPerson', {activityId: this.pageForm.activityId})
|
||||
},
|
||||
exportGiftPerson() {
|
||||
this.exportPro(loc() + '/exportGiftPerson', {activityId: this.pageForm.activityId})
|
||||
},
|
||||
exportPro(url, param) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在努力导出中,感谢您的耐心等待!',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
axios({
|
||||
url: url,
|
||||
method: 'post',
|
||||
params: param,
|
||||
headers:{
|
||||
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
},
|
||||
responseType: 'blob',
|
||||
}).then((res) => {
|
||||
const { data, headers } = res
|
||||
const fileName = headers['content-disposition'].replace(/\w+;filename=(.*)/, '$1')
|
||||
// 此处当返回json文件时需要先对data进行JSON.stringify处理,其他类型文件不用做处理
|
||||
//const blob = new Blob([JSON.stringify(data)], ...)
|
||||
const blob = new Blob([data], {type: headers['content-type']})
|
||||
let dom = document.createElement('a')
|
||||
let url = window.URL.createObjectURL(blob)
|
||||
dom.href = url
|
||||
dom.download = decodeURI(fileName)
|
||||
dom.style.display = 'none'
|
||||
document.body.appendChild(dom)
|
||||
dom.click()
|
||||
dom.parentNode.removeChild(dom)
|
||||
window.URL.revokeObjectURL(url)
|
||||
loading.close();
|
||||
}).catch((err) => {})
|
||||
},
|
||||
async activityChange(val) {
|
||||
const activity = this.activityList.find(o => o.id === val)
|
||||
const type = this.trainTypeList.find(o => o.code === activity.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
const resp = await $.get(loc() + '/getCourseByActivityId', {activityId: val})
|
||||
this.courseList = resp.data
|
||||
this.pageForm.courseId = ''
|
||||
},
|
||||
async handleUser(userId) {
|
||||
const resp = await $.post(loc() + '/doHandleUser', {userId})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await $.get('/platform/trainSingUp/statistics/activity/activityList', {year: this.pageForm.year})
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
const type = this.trainTypeList.find(o => o.code === this.activityList[0].trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
await this.activityChange(this.activityList[0].id)
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
},
|
||||
async openView(userId) {
|
||||
this.$refs.guava.view()
|
||||
// const resp_register = await $.get(loc() + '/registerUserList', {courseId})
|
||||
// this.registerUserTableData = resp_register.data
|
||||
// const resp_signInfo = await $.get(loc() + '/getSignInfo', {courseId})
|
||||
// this.userSignInfo = resp_signInfo.data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,215 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.el-icon-arrow-left, .el-icon-arrow-right {
|
||||
font-size: 28px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="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
|
||||
:clearable="false"
|
||||
@change="yearChange"
|
||||
placeholder="选择年度"
|
||||
type="year" style="width: 100%"
|
||||
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 @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
|
||||
<el-option :label="item.activityName"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"
|
||||
></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="trainType">
|
||||
<template #func>
|
||||
<el-button
|
||||
type="primary" size="small" @click="exportSignUserByGroup" :disabled="!pageForm.activityId">
|
||||
按工会小组导出报名人员
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
type="primary" size="small" @click="exportSignUser" :disabled="!pageForm.activityId">
|
||||
导出报名人员(excel)
|
||||
</el-button>
|
||||
<el-button v-if="pageForm.activityId === 'a93d5b6c9b5941708c0987ef26367a09'"
|
||||
type="primary" size="small" @click="exportOther" :disabled="!pageForm.activityId">
|
||||
导出报名人员(word)
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column :label="trainType" prop="courseName" align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="类型" prop="courseType" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable align="center"
|
||||
header-align="center" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="负责人" prop="courseInstructor" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<span v-if="row.reserveMode === 1">
|
||||
{{row.coursePeopleNumber}}
|
||||
</span>
|
||||
<span v-if="row.reserveMode === 2">
|
||||
{{row.coursePeopleNumber + row.courseReservedNumber}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="限制报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="预留人数" prop="courseReservedNumber" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<template v-if="row.isAddFamily && row.isBringFamily">
|
||||
<el-link v-if="row.selfAddFamily" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + '家属(' + row.familyCount + ')'}}
|
||||
</el-link>
|
||||
<el-link v-else @click="openView(row)" type="primary">
|
||||
{{row.familyCount}}
|
||||
</el-link>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<!--#include("/platform/trainSingUp/statistics/include_view.html"){}#-->
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
activityId: null
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '培训班', prop: 'courseName'},
|
||||
{label: '类型', prop: 'courseType', sortable: true},
|
||||
{label: '地点', prop: 'courseLocation'},
|
||||
{label: '教师', prop: 'courseInstructor', sortable: true},
|
||||
{label: '最多报名人数', prop: 'coursePeopleNumber', sortable: true},
|
||||
{label: '已报名人数', prop: 'registerNum', sortable: true},
|
||||
],
|
||||
|
||||
registerUserTableData: [],
|
||||
registerUserTableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '单位', prop: 'unitname'},
|
||||
{label: '分工会', prop: 'unionname'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '报名时间', prop: 'signUpTime'},
|
||||
{label: '报名状态', prop: 'state'},
|
||||
],
|
||||
userSignInfo: {},
|
||||
trainType: '培训班',
|
||||
trainTypeList: [],
|
||||
clickRow: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
activityChange(val) {
|
||||
const activity = this.activityList.find(o => o.id === val)
|
||||
const type = this.trainTypeList.find(o => o.code === activity.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
},
|
||||
exportSignUser() {
|
||||
window.open(loc() + '/exportSignUser?activityId=' + this.pageForm.activityId + '&groupType=default')
|
||||
},
|
||||
exportSignUserByGroup() {
|
||||
window.open(loc() + '/exportSignUser?activityId=' + this.pageForm.activityId + '&groupType=groupName')
|
||||
},
|
||||
exportOther() {
|
||||
window.open(loc() + '/exportOther?activityId=' + this.pageForm.activityId)
|
||||
},
|
||||
async yearChange() {
|
||||
this.pageForm.activityId = null
|
||||
await this.getActivityList()
|
||||
await this.doSearch()
|
||||
},
|
||||
async getActivityList() {
|
||||
const resp = await $.get(loc() + '/activityList', {year: this.pageForm.year})
|
||||
this.activityList = resp.data
|
||||
if (this.activityList && this.activityList.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
const type = this.trainTypeList.find(o => o.code === this.activityList[0].trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
await this.getActivityList()
|
||||
},
|
||||
async openView(row) {
|
||||
this.clickRow = row
|
||||
this.$refs.guava.view()
|
||||
const resp_register = await $.get(loc() + '/registerUserList', {courseId: row.id})
|
||||
this.registerUserTableData = resp_register.data
|
||||
const resp_signInfo = await $.get(loc() + '/getSignInfo', {courseId: row.id})
|
||||
this.userSignInfo = resp_signInfo.data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
await this.initData()
|
||||
await this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,62 @@
|
||||
<el-tabs>
|
||||
<el-tab-pane label="报名人员">
|
||||
<el-table :data="registerUserTableData" :size="tableSize">
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in registerUserTableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop === 'state'">
|
||||
<span class="text-success" v-if="row.state === 1">正常报名</span>
|
||||
<span class="text-warning" v-else-if="row.state === 2">候补报名</span>
|
||||
<span class="text-success" v-else-if="row.state === 3">正常报名(候补)</span>
|
||||
<span class="text-info" v-else-if="row.state === 4">无效报名(缺席)</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="签到情况" v-if="clickRow.isMobileSign === true">
|
||||
<!-- <el-timeline>-->
|
||||
<!-- <el-timeline-item-->
|
||||
<!-- :color="item.length>0 && Date.now() > Date.parse(item[0].courseStartTime) ? '#0bbd87' :''"-->
|
||||
<!-- :key="key"-->
|
||||
<!-- :timestamp="key"-->
|
||||
<!-- placement="top"-->
|
||||
<!-- v-for="(item, key) in userSignInfo">-->
|
||||
<!-- <el-table :data="item">-->
|
||||
<!-- <el-table-column label="姓名" prop="username"></el-table-column>-->
|
||||
<!-- <el-table-column label="工号" prop="loginname"></el-table-column>-->
|
||||
<!-- <el-table-column label="是否签到" prop="isAttend"></el-table-column>-->
|
||||
<!-- <el-table-column label="签到时间" prop="attendTime"></el-table-column>-->
|
||||
<!-- </el-table>-->
|
||||
<!-- </el-timeline-item>-->
|
||||
<!-- </el-timeline>-->
|
||||
|
||||
<el-tabs style="height: 600px;" tab-position="left">
|
||||
<el-tab-pane v-for="(item, key) in userSignInfo">
|
||||
<span slot="label"><i class="el-icon-date"></i> {{key}}</span>
|
||||
<el-table :data="item" style="max-height: 600px; overflow-y: auto">
|
||||
<el-table-column label="姓名" prop="username"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginname"></el-table-column>
|
||||
<el-table-column label="是否签到" prop="isAttend">
|
||||
<template scope="{row}">
|
||||
<template v-if="Date.now() < Date.parse(row.courseStartTime)">
|
||||
<span class="text-default">未开始</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="text-success" v-if="row.isAttend">已签到</span>
|
||||
<span class="text-warning" v-else>未签到</span>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="签到时间" prop="attendTime"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
Reference in New Issue
Block a user